eth, cmd/devp2p: enable eth/70 with TD in status, no UpgradeStatusMsg#26
Closed
zlacfzy wants to merge 1 commit into
Closed
eth, cmd/devp2p: enable eth/70 with TD in status, no UpgradeStatusMsg#26zlacfzy wants to merge 1 commit into
zlacfzy wants to merge 1 commit into
Conversation
Enable the eth/70 protocol that the v1.17.3 merge scaffolded but left off, aligning BSC with upstream's eth/70. BSC's eth/70 status keeps TD since Parlia chains still rely on total difficulty, and carries the initial block range; there is no UpgradeStatusMsg exchange in eth/70. eth/68 stays as is (two-phase handshake) for compatibility with older peers. - protocol.go: advertise ETH70 (primary) alongside ETH68; add the TD field to StatusPacket (Nathan's enable-ETH70 TODO). - handshake.go: thread td through the eth/70 handshake and record the peer's TD/head from the status reply, mirroring eth/68 (without this, chain sync would nil-deref on eth/70 peers). - handler.go: drop the hardcoded gate in blockRangeState.shouldSend so BlockRangeUpdate broadcasting runs (eth/68 peers are already skipped inside SendBlockRangeUpdate). - cmd/devp2p/ethtest: speak eth/70 natively per the TODO — single-phase status exchange using StatusPacket, ourHighestProtoVersion 70, and ethProtoLen 18 so snap message offsets line up. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Enable the eth/70 protocol that the v1.17.3 merge scaffolded but left off, aligning BSC with upstream's eth/70. BSC's eth/70 status keeps TD (Parlia chains still rely on total difficulty) and carries the initial block range; there is no UpgradeStatusMsg exchange in eth/70. eth/68 stays as is (two-phase handshake) for compatibility with older peers.
This lands the four
TODO(Nathan)markers left for eth/70 enablement.Changes
eth/protocols/eth/protocol.go: advertiseETH70(primary) alongsideETH68; add theTDfield toStatusPacketeth/protocols/eth/handshake.go: threadtdthrough the eth/70 handshake and record the peer's TD/head from the status reply, mirroring eth/68 — without this, chain sync would nil-deref on eth/70 peerseth/handler.go: drop the hardcoded gate inblockRangeState.shouldSendsoBlockRangeUpdatebroadcasting runs (eth/68 peers are already skipped insideSendBlockRangeUpdate)cmd/devp2p/ethtest: speak eth/70 natively per the TODO — single-phase status exchange usingStatusPacket,ourHighestProtoVersion70, andethProtoLen18 so snap message offsets line upVerification
go build ./...cleaneth,eth/protocols/{eth,bsc,snap},eth/downloaderunit tests passTestEthSuite+TestSnapSuite(real-node end-to-end handshake) pass — the snap suite caught theethProtoLenoffset shiftNotes for review
DisablePeerTxBroadcastextension (that rides on eth/68's UpgradeStatusMsg); eth/68 links keep it🤖 Generated with Claude Code