-
Notifications
You must be signed in to change notification settings - Fork 111
[storage] use commonware-codec
to serialize/deserialize proofs
#1127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Re:
Actually that comment around "<= 255 digests" is obsolete since we actually removed explicit encoding of the length of the digests vector. |
I am not too familiar with codec usage, but enforcing a reasonable limit on the # of digests sounds useful to me so someone doesn't try to spam us with massive proofs. OK with me if this requires an explicit vector length encoding to do through standard means. |
} | ||
} | ||
|
||
impl<H: CHasher> EncodeSize for Proof<H> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really feedback on this specific PR, but shouldn't we be able to write a macro that implements these "default" types of code serialize/deserialze implementations? This all seems very boilerplate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've advocated for manually encoding to avoid silent changes from struct modification fwiw
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #1127 +/- ##
==========================================
- Coverage 91.04% 91.03% -0.01%
==========================================
Files 215 215
Lines 57480 57471 -9
==========================================
- Hits 52330 52321 -9
Misses 5150 5150
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Replaces custom
serialize
/deserialize
implementation.Open questions:
u16::MAX
? Or should we keep the existing assumption that there are <= 255 digests?max_len
field in the read config? (Maybe moot if we limit number of digests to 255).