Repository navigation
Conversation
…nFinOrg#3063 V2 nodes relay BFT votes/timeouts/sync infos and pooled transactions to every peer. Those message codes (0xe0-0xe5) frame at 240-245, past the suite's protocol windows, so getProto panicked and utesting recovered it per case. A protocol-level fault therefore surfaced as a confusing case failure carrying a panic string, masking the real diagnosis. Return unknownProto for codes outside the windows instead. ReadEth already skips anything classified outside ethProto, and statusExchange now skips unknown frames alongside base frames, so both readers continue to the message they are waiting for. Protocol lengths stay untouched: they bound the codes the suites read, not the full XDC message space, and changing them would shift protoOffset(snapProto) and break the snap window. Add frame-code coverage for the whole 0xe0-0xe5 range through both readers and at the getProto boundaries; the existing Xdc166 filter and decoders are unchanged. Close XinFinOrg#3063
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 49 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
gzliudan
requested review from
AnilChinchawale,
anunay-xin,
benjamin202410,
liam-lai and
wanwiset25
November 13, 2026 03:27
This was referenced Nov 13, 2026
Collaborator
Author
|
No code changes were needed here: the automated review reported |
This branch has not been deployed
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.
Summary
XDC nodes relay BFT votes/timeouts/sync infos (
0xe0-0xe2) and pooled transactions (0xe3-0xe5) to every peer. Those message codes frame at 240-245, past the16+18+10=44bound incmd/devp2p/internal/ethtest/protocol.go, sogetProtopanicked.utestingrecovers panics per case, so a protocol-level fault was reported as a confusing case failure carrying a panic string instead of the real diagnosis.getProtonow returnsunknownProtoand both readers skip those frames. Protocol lengths stay untouched: they bound the codes the suites read, not the full XDC message space, and raising them would shiftprotoOffset(snapProto)and break the snap window.isXdc166MsgCode,ReadXdc166, and both decoders are unchanged.Evidence
not ok 35 BlockHashAnnounce/panic: unhandled msg code beyond last protocol/protocol.go:88. With validators stopped (no BFT relay frames) the same case no longer panicked and failed on its own timing assertion. See issue cmd/devp2p: getProto panics on XDC BFT and pooled-transaction frame codes #3063.TestGetProtoXdcFrameCodesandTestGetProtoWindowBoundariescover the whole0xe0-0xe5frame range plus window boundaries;TestReadEthSkipsXdcRelayFramesandTestStatusExchangeSkipsXdcRelayFramesfeed all six codes through both readers on an in-process RLPx connection and assert the following real eth message / status packet is still received.panic, misclassifying the range asethProtoorsnapProto, and dropping thestatusExchangeskip each fail the new tests.go test ./cmd/devp2p/internal/ethtest/ -count=1PASS; fullbranch-workflowchain (make all,make generate,make tidy, clean tree,make lint0 issues,go vet ./...,make test) PASS (1/1 commit, rc=0, 11:16:21-11:22:09), log/tmp/verify-logs/fix-ethtest-getproto-panic-33f7af6a18-7d9uzr.log./home/me/gethmaster keeps the same panic withethProtoLen = 22and has no XDC high message codes;git grepandgit log -Sfind nounknownProtofix upstream, so this is a suite-only local adaptation with no upstream PR to port.Merge Danger
Door: two-way
Blast Radius: test-suite only
Only the standalone
devp2pethtest client changes. No node, wire protocol,ProtocolLengths, or consensus code is touched; a revert restores the previous behaviour without migration. The one intentional behaviour change is that frames outside the three windows are skipped instead of aborting the reader, which is scoped to this test client.Close #3063
Proposed changes
cmd/devp2pethtest suite: stopgetProtofrom panicking on XDC BFT and pooled-transaction frame codes, and add reader-level regression coverage. See Summary / Evidence above.Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅in the boxes that applyImpacted Components
Which parts of the codebase does this PR touch?
Put an
✅in the boxes that applyThe
devp2pethtest client is a standalone conformance/test tool undercmd/devp2p, not part of the node binary.Checklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) thatReasons for unchecked items:
devp2ptest client and does not alter node behaviour or the wire protocol. The four-node fixture devnet regression that exposed the panic (issue cmd/devp2p: getProto panics on XDC BFT and pooled-transaction frame codes #3063) is referenced in Evidence.make all, then rundevp2p rlpx eth-testagainst a V2 validator devnet with BFT relay traffic active; previouslyBlockHashAnnouncereported a panic text, now the relay frames are skipped and the case reports its own assertion. Equivalently, rungo test ./cmd/devp2p/internal/ethtest/ -run 'TestGetProto|TestReadEthSkips|TestStatusExchangeSkips' -count=1for the deterministic in-process reproduction.cmd/devp2p/internal/ethtest/test suite and the unchangedTestXdc166MsgCodeFilter/decodeEthPayloadcases; no production API or wire format changed.protocol.gowas replaced with the durable invariant; no user-facing docs describe this internal test helper.