Skip to content

eth, cmd/devp2p: enable eth/70 with TD status and single-phase handshake#27

Merged
zlacfzy merged 4 commits into
zlacfzy:merge-v1.17.3_ci_fixfrom
flywukong:support-eth70
Jul 14, 2026
Merged

eth, cmd/devp2p: enable eth/70 with TD status and single-phase handshake#27
zlacfzy merged 4 commits into
zlacfzy:merge-v1.17.3_ci_fixfrom
flywukong:support-eth70

Conversation

@flywukong

@flywukong flywukong commented Jul 14, 2026

Copy link
Copy Markdown

Description

  1. Single-phase handshake: eth/70 exchanges one Status message and enters
    the message loop — no UpgradeStatusMsg (that remains eth/68-only).
  2. TD kept in StatusPacket (after NetworkID): Parlia relies on TD-based
    sync (peerToSyncOp/LegacySync), so the peer's initial TD must arrive with
    the handshake. BSC's eth/70 status therefore intentionally diverges from
    upstream's wire format (precedent: eth/68's UpgradeStatus extension; ForkID
    isolates networks). Documented on the struct to survive future merges.
  3. DisablePeerTxBroadcast is deprecated: the extension is not carried
    over to eth/70. It stays effective on eth/68 fallback connections only and
    will be removed together with eth/68.

Rationale

tell us why we need these changes...

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

Comment thread cmd/devp2p/internal/ethtest/conn.go Outdated
return err
}
if protoOffset(proto)+code == got {
if c.protoOffset(proto)+code == got {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer keeping upstream's shape

Comment thread cmd/devp2p/internal/ethtest/conn.go Outdated
// peer performs both the protocol handshake and the status message
// exchange with the node in order to peer with it.
func (c *Conn) peer(chain *Chain, status *eth.StatusPacket68) error {
func (c *Conn) peer(chain *Chain, status any) error {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep conn.go in sync with upstream? Upstream's ethtest only speaks the latest version even though the node supports older ones (its statusExchange only handles the newest StatusPacket) — so here we could keep only the eth/70 path and drop the 68/UpgradeStatus branches; eth/68 fallback is already covered by the eth/protocols/eth unit tests.

Comment thread eth/downloader/downloader_test.go Outdated

func TestCanonicalSynchronisationFull(t *testing.T) { testCanonSync(t, eth.ETH69, FullSync) }
func TestCanonicalSynchronisationSnap(t *testing.T) { testCanonSync(t, eth.ETH69, SnapSync) }
func TestCanonicalSynchronisationFull(t *testing.T) { testCanonSync(t, eth.ETH68, FullSync) }

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func TestCanonicalSynchronisationFull(t *testing.T) { testCanonSync(t, eth.ETH68, FullSync) }
func TestCanonicalSynchronisationFull(t *testing.T) { testCanonSync(t, eth.ETH70, FullSync) }

}
}

func TestInvalidBodyPeerDrop69(t *testing.T) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestInvalidBodyPeerDrop69 -> TestInvalidBodyPeerDrop

defer tester.terminate()

chain := testChainBase.shorten(blockCacheMaxItems - 15)
peer := tester.newPeer("corrupt", eth.ETH69, chain.blocks[1:])

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eth.ETH69 -> eth.ETH70

@zlacfzy
zlacfzy merged commit e386ced into zlacfzy:merge-v1.17.3_ci_fix Jul 14, 2026
2 checks passed
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.

3 participants