go-ethereum/cmd/devp2p/internal/ethtest
Felix Lange 0cba803fba
Some checks failed
/ Linux Build (push) Has been cancelled
/ Linux Build (arm) (push) Has been cancelled
/ Keeper Build (push) Has been cancelled
/ Windows Build (push) Has been cancelled
/ Docker Image (push) Has been cancelled
eth/protocols/eth, eth/protocols/snap: delayed p2p message decoding (#33835)
This changes the p2p protocol handlers to delay message decoding. It's
the first part of a larger change that will delay decoding all the way
through message processing. For responses, we delay the decoding until
it is confirmed that the response matches an active request and does not
exceed its limits.

In order to make this work, all messages have been changed to use
rlp.RawList instead of a slice of the decoded item type. For block
bodies specifically, the decoding has been delayed all the way until
after verification of the response hash.

The role of p2p/tracker.Tracker changes significantly in this PR. The
Tracker's original purpose was to maintain metrics about requests and
responses in the peer-to-peer protocols. Each protocol maintained a
single global Tracker instance. As of this change, the Tracker is now
always active (regardless of metrics collection), and there is a
separate instance of it for each peer. Whenever a response arrives, it
is first verified that a request exists for it in the tracker. The
tracker is also the place where limits are kept.
2026-02-15 21:21:16 +08:00
..
testdata cmd/devp2p/internal/ethtest: update to PoS-only test chain (#32850) 2025-10-08 11:14:27 +02:00
chain.go all: drop x/exp direct dependency (#30558) 2025-02-27 15:53:52 +01:00
chain_test.go cmd/devp2p: update eth/snap protocol test suites for PoS (#28340) 2023-12-20 17:23:48 +01:00
conn.go all: replace fmt.Errorf with errors.New (#32286) 2025-07-28 10:13:18 +02:00
engine.go cmd: use package filepath over path for file system operations (#29227) 2024-03-12 10:00:34 +01:00
mkchain.sh cmd/devp2p/internal/ethtest: update to PoS-only test chain (#32850) 2025-10-08 11:14:27 +02:00
protocol.go eth/protocols/eth, eth/protocols/snap: delayed p2p message decoding (#33835) 2026-02-15 21:21:16 +08:00
snap.go eth/protocols/eth, eth/protocols/snap: delayed p2p message decoding (#33835) 2026-02-15 21:21:16 +08:00
suite.go eth/protocols/eth, eth/protocols/snap: delayed p2p message decoding (#33835) 2026-02-15 21:21:16 +08:00
suite_test.go all: simplify tests using t.TempDir() (#30150) 2024-07-15 15:26:58 +02:00
transaction.go eth/protocols/eth, eth/protocols/snap: delayed p2p message decoding (#33835) 2026-02-15 21:21:16 +08:00