-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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
core/forkid: implement the forkid EIP, announce via ENR #19738
Conversation
eth/enr.go
Outdated
for i := 0; i < kind.NumField(); i++ { | ||
// Fetch the next field and skip non-fork rules | ||
field := kind.Field(i) | ||
if !strings.HasSuffix(field.Name, "Block") { |
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 a bit of a hack. Wouldn't it be better to explicity list the forks instead? But otoh, I guess you want this to 'just work' in the future too... Not sure what the best way is.
Pushed a big update. The record now auto-updates every block. I will clean up the ENR handling more after 1.9.0 is out. It's a bit annoying that we need to |
Integration seems good to me. A slight issue is that we don't fire chain head events during fast sync, so that won't trigger the fork reevaluation, but I think we can live with it for now. Will open an issue to track this limitation for 1.9.x. |
* eth: chain config (genesis + fork) ENR entry * core/forkid, eth: protocol independent fork ID, update to CRC32 spec * core/forkid, eth: make forkid a struct, next uint64, enr struct, RLP * core/forkid: change forkhash rlp encoding from int to [4]byte * eth: fixup eth entry a bit and update it every block * eth: fix lint * eth: fix crash in ethclient tests
* eth: chain config (genesis + fork) ENR entry * core/forkid, eth: protocol independent fork ID, update to CRC32 spec * core/forkid, eth: make forkid a struct, next uint64, enr struct, RLP * core/forkid: change forkhash rlp encoding from int to [4]byte * eth: fixup eth entry a bit and update it every block * eth: fix lint * eth: fix crash in ethclient tests
…reum#19738)" This reverts commit 8e998ec.
This PR implements the the fork ID EIP specced currently at ethereum/EIPs#2124.
Although the EIP only specifies the fork ID content, this PR also does the ENR integration. As such however, the PR is missing two necessary features:
eth.NewENRFilter
result somehow into the discovery process to allow blacklisting certain peers and rejecting them already before connection.Need help from @fjl to finish this up.