-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Node Discovery v4 ENR Extension (EIP-868) #11540
Conversation
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.
Initial review, will be back.
While it's nice to be able to reuse the enr code, this particular library seems a bit immature and tailored for eth 2.0 client. EIP-778 (see prior #11354) doesn't seem complicated and IMHO it's better to have our own implementation here and avoid depending on libraries we don't need and not depend on a third-party if we need to change something quickly. |
util/network-devp2p/src/host.rs
Outdated
let key = H256::random().into(); | ||
save_key(tempdir.path(), &key); | ||
let r = load_key(tempdir.path()); | ||
let key = Secret::from(H256::random()); |
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.
Maybe add a test for ENR entry too?
6155317
to
d46c9b3
Compare
I have completely redone the PR from scratch using the architecture proposed by @tomusdrw. |
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.
lgtm! Few minor things, would be also good to add some docs (although I know the items are not really public nor we enforce docs here, but still it might be a good time to start adding them :))
b0a8da0
to
fad711b
Compare
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.
Mustn't grumble.
* master: (25 commits) Update .gitmodules (#11628) ethcore/res: activate ecip-1088 phoenix on classic (#11598) Upgrade parity-common deps to latest (#11620) Fix Goerli syncing (#11604) deps: switch to upstream ctrlc (#11617) Deduplicating crate dependencies (part 3 of n) (#11614) Deduplicating crate dependencies (part 2 of n, `slab`) (#11613) Actually save ENR on creation and modification (#11602) Activate POSDAO on xDai chain and update bootnodes (#11610) Activate on-chain randomness in POA Core (#11609) Deduplicating crate dependencies (part 1 of n) (#11606) Update enodes for POA Sokol (#11611) Remove .git folder from dogerignore file so vergen library can get build date and commit hash in the binary generatio vergen library can get build date and commit hash in the binary generation (#11608) Reduced gas cost for static calls made to precompiles EIP2046/1352 (#11583) [easy] `ethcore-bloom-journal` was renamed to `accounts-bloom` (#11605) Use serde_json to export hardcoded sync (#11601) Node Discovery v4 ENR Extension (EIP-868) (#11540) Fix compile warnings (#11595) Update version to 3.0.0-alpha.1 (#11592) ethcore/res: bump canon fork hash for mordor and kotti testnets (#11584) ...
This PR introduces integration with Ethereum Node Record standard as described in EIP-868.
This is really more a proof of concept because of the following caveats:
FORK_ID
andFORK_HASH
as described by EIP-2124/EIP-2364. Basically this means leaking the state of blockchain intoDiscovery
(!) on a continuous basis with the addition of every block (!). It breaks the current separation of layers betweenBlockChainClient
, sync and devp2p.Host
but is this the best solution?NodeEndpoint
- what will be the relationship between these two going forward?All in all, this implementation is partially workable, but the full implementation will require rethinking sync design.