-
Notifications
You must be signed in to change notification settings - Fork 533
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
Add nomad v1 primitives #79
Add nomad v1 primitives #79
Conversation
sig[32..64].copy_from_slice(&s_bytes); | ||
// TODO: What if we try to serialize a signature where | ||
// the `v` is not normalized? | ||
sig[64] = src.v as u8; |
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.
Casting from a larger integer to a smaller integer (e.g. u32 -> u8) will truncate.
If that is not safe, pls use u8::try_from(src.v)
instead.
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.
This is safe because sig.v
can only ever be 27 or 28 here. Regarding EIP-155 (which isn't relevant because this signature is only for attestations not txs), this is only applied for transaction signing and this happens after the fact (after signature is created, you manually change the v
value)
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.
Added comment above line to clarify
fd932e5
to
a38bd88
Compare
Codecov ReportBase: 46.96% // Head: 44.91% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #79 +/- ##
===========================================
- Coverage 46.96% 44.91% -2.06%
===========================================
Files 44 61 +17
Lines 9815 11509 +1694
===========================================
+ Hits 4610 5169 +559
- Misses 5205 6340 +1135
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
@luketchang , thanks for contribution, Ill merge this PR. Just small note, if possible, lets clean up top level dependencies in next PRs.
Adds necessary Nomad primitives to Avail
primitives/avail
primitives/nomad
which contains:merkle
: light merkle tree implementationsignature
: Ethereum-specific ECDSA signature implementationnomad-core
: core message and update typesnomad-base
: abstraction around Nomad updater and domain-specific info