Skip to content

eth, cmd/devp2p: enable eth/70 with TD in status, no UpgradeStatusMsg#26

Closed
zlacfzy wants to merge 1 commit into
merge-v1.17.3_ci_fixfrom
eth70-enable
Closed

eth, cmd/devp2p: enable eth/70 with TD in status, no UpgradeStatusMsg#26
zlacfzy wants to merge 1 commit into
merge-v1.17.3_ci_fixfrom
eth70-enable

Conversation

@zlacfzy

@zlacfzy zlacfzy commented Jul 14, 2026

Copy link
Copy Markdown
Owner

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: advertise ETH70 (primary) alongside ETH68; add the TD field to StatusPacket
  • eth/protocols/eth/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
  • eth/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

Verification

  • go build ./... clean
  • eth, eth/protocols/{eth,bsc,snap}, eth/downloader unit tests pass
  • TestEthSuite + TestSnapSuite (real-node end-to-end handshake) pass — the snap suite caught the ethProtoLen offset shift

Notes for review

  • eth/70 links do not carry the DisablePeerTxBroadcast extension (that rides on eth/68's UpgradeStatusMsg); eth/68 links keep it
  • Two new-version nodes negotiate eth/70; old⇄new negotiate eth/68

🤖 Generated with Claude Code

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>
@zlacfzy zlacfzy closed this Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant