-
Notifications
You must be signed in to change notification settings - Fork 138
feat(l1): discv5 #5655
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
feat(l1): discv5 #5655
Conversation
**Motivation** <!-- Why does this pull request exist? What are its goals? --> **Description** <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> **Checklist** - [ ] Updated `STORE_SCHEMA_VERSION` (crates/storage/lib.rs) if the PR includes breaking changes to the `Store` requiring a re-sync. Closes #5574 and #5575. Co-authored-by: Esteban Dimitroff Hodi <[email protected]>
**Checklist** - [ ] Updated `STORE_SCHEMA_VERSION` (crates/storage/lib.rs) if the PR includes breaking changes to the `Store` requiring a re-sync. Closes #issue_number
**Motivation** I saw current new_nonce impl allocated a vector when it can just return a fixed size array. **Description** Removes the needless vec **Checklist** - [ ] Updated `STORE_SCHEMA_VERSION` (crates/storage/lib.rs) if the PR includes breaking changes to the `Store` requiring a re-sync.
**Motivation** In order to start merging discv5 code into main, to avoid having a huge PR at the end of the development, we should create a feature flag disabled by default. Closes #5639
**Motivation** <!-- Why does this pull request exist? What are its goals? --> **Description** <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> **Checklist** - [ ] Updated `STORE_SCHEMA_VERSION` (crates/storage/lib.rs) if the PR includes breaking changes to the `Store` requiring a re-sync.
Oppen
left a comment
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.
Left a few comments but given it won't be enabled until it's ready, I think it's mostly safe to approve.
If you're gonna apply anything I suggested, the most important right now is the feature name suggestion IMO.
… tests (#5673) **Motivation** Adds a Session struct and related functions to the discv5 module, this represents a session established from a handshake. This PR does not implement the handshake protocol, but it lays a path to doing so easily. This is based on reading https://github.com/ethereum/devp2p/blob/master/discv5/discv5-theory.md#sessions This allows us to add the remaining test vectors related to cryptography, which is done now. Also renamed the PacketDecodeErr to PacketCodecError, since the error was also used when encoding and for other things. Fixed nonce generation to be secure according to the spec
| #[derive(Debug, Clone, PartialEq, Eq)] | ||
| pub struct Session { | ||
| pub keys: SessionKeys, | ||
| pub role: SessionRole, |
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.
Does this need to be kept? I think the role can be removed if we switch the keys in one of the two cases (maybe rename the keys to local and remote too).
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 will change it in a future PR
Motivation
Ethereum nodes are expected to run
discv5for early 2026.Description
On one hand, this is work in progress, but in the other we don't want to have a huge PR at the end of development. So we plan to start merging
discv5work into main, but behind a feature flag so nothing is compiled or run, except for development. The flag is already present in this commit, so we should be clear to merge.Checklist
STORE_SCHEMA_VERSION(crates/storage/lib.rs) if the PR includes breaking changes to theStorerequiring a re-sync.Closes #4491