Repository navigation
Conversation
Add failing regression coverage for vote-extension recovery panics, proposal metadata malleability, validator-set state binding, and CoreChainLockedHeight omission from the header hash. Co-Authored-By: Claude GPT-6 <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
🕓 Queued for automated review — 19th in line, estimated start in ~6 h (commit f9cc55f)
|
Avoid mutating a proposal that may still be read by gossip workers, and address the static-analysis findings reported by CI. Co-Authored-By: Codex GPT-6 <[email protected]>
Co-Authored-By: Codex GPT-6 <[email protected]>
…he test networks (#1460) * chore(e2e): allow pinning node containers to host CPUs via E2E_CPUSET Lets a developer approximate the 4 vCPU CI runner on a larger host when measuring e2e timing. Unset (default) leaves the compose file unchanged. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(e2e): report quorum type by LLMQ name in the mock Dash Core The e2e mock Core server answered `quorum info` with the numeric LLMQ type ("100"), while Dash Core returns the LLMQ name ("llmq_test"). Since #1442, state sync authenticates the light block validator set against `quorum info` and parses the type with btcjson.GetLLMQType, so every e2e state sync rejected every snapshot, fell back to block sync at height 1, stalled there for the 60s sync timeout and only then caught up through consensus. That added minutes to every CI run and left the state sync restore path untested. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(e2e): serve complete quorum info from the mock Dash Core State sync (#1442) authenticates a light block's validator set against Dash Core `quorum info`: the threshold public key as hex and every member with its public key share, the signed proposer included. The e2e mock only knew the local node's own share and printed the threshold key in the PubKey String() form, so authentication still failed after the quorum type fix. Build every quorum of the validator set schedule the runner already writes to app.toml and serve it in full, the way Dash Core would. The FilePV path, kept for quorums outside the schedule, reports the threshold key as hex. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(p2p): register every reactor channel with the transport up front Reactors open their channels in OnStart, after the router already accepts and dials peers, and an MConn connection is created with the channel descriptors registered at that moment. A peer that spoke early on a channel the connection did not know - typically a seed sending a PEX request right after the handshake - was dropped with "unknown channel". Behind a rate-limited, connection-capped seed this left nodes peerless until block sync's 60s timeout, stalled the first heights and failed e2e runs. Create the transport with every descriptor the node's reactors open (the seed: PEX only). Until a reactor opens its channel the router drops that channel's messages instead of the connection. AddChannelDescriptors skips channel IDs already registered, and Dial reads the descriptors under the transport mutex like Accept does. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * test(e2e): start a start_at node once the chain reaches its height The start_at barrier waited for every running node to reach the height. A node still looking for peers - common behind the connection-capped seed in the CI networks - held back every later node for up to block sync's 60s timeout, and when it made no progress for 60s the runner reported the healthy chain as "stalled" and failed the run. Wait for the chain instead: any started node with state at the height. The lagging nodes keep catching up in the background, and the runner still waits for every node to reach the target height before perturbing and testing, so the same nodes, modes and sync paths are exercised. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(node): register each p2p channel descriptor exactly once p2p.ChannelDescriptors already merges the consensus and state sync descriptor sets, so also iterating those two sets handed the transport 21 descriptors for 13 channel IDs. Every connection then built two conn.MConnection channels per duplicated ID, of which channelsIdx keeps whichever the non-stable sort left last - the other one is allocated, counted against the connection's send queues, and never receives. Pull in only p2p.ChannelDescriptors, and sort with slices.SortFunc to match the package's import style. Rework the accompanying test into a unit test that no longer starts a node: it derives the expectation from makeNodeInfo / makeSeedNodeInfo rather than a second hand-kept channel list, covers validator, full and seed mode, and asserts the descriptor set is exactly the advertised set (plus p2p.ErrorChannel, which the p2p client opens lazily and which is deliberately never advertised) with no ID registered twice. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * test(p2p): pin descriptor identity in AddChannelDescriptors The previous assertions could not fail: the transport was constructed with a len == cap slice literal, so any append - in place or not - would have reallocated and left the snapshot untouched, and assert.Equal compares descriptors by value, so keeping the duplicate instead of the first registration went unnoticed. Give the initial slice spare capacity, so an in-place append really would write into the array the snapshot shares, and assert pointer identity with assert.Same for both the retained first registration and the snapshot's element. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * refactor(node): derive the advertised channels from the registered ones makeNodeInfo listed the advertised channels by hand, so the node kept three hand-maintained channel lists (up-front descriptors, validator NodeInfo, seed NodeInfo) that matched only because each was edited in step. They fail closed but silently when they drift: Router.OpenChannel never consults the transport's list, it only adds to it, so a channel missing up front still opens and only peers that speak on it over a connection established earlier get dropped. Derive both NodeInfo channel lists from channelDescriptors and document why p2p.ErrorChannel is left out - nothing is ever sent to a peer on it, it only carries p2p.PeerError to the router, which evicts the peer locally. The advertised IDs are unchanged in every mode. Assert the invariant per mode (validator, full, seed) against the descriptor sets the p2p client and the consensus, state sync, evidence and PEX reactors actually pass to OpenChannel, instead of against a literal maintained in the test file. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * feat(p2p): warn when a channel is registered after transport creation A channel the transport was not created with is a gap in the node's up-front channel list, and it is otherwise invisible: opening the channel succeeds, no test fails, and only peers that speak on it over a connection established earlier are dropped as protocol violators. Log it as a warning - not an error - since the legacy p2p test harness opens channels ad hoc, and MemoryTransport.AddChannelDescriptors is a no-op, so nothing else changes. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(blocksync): retry missing blocks without waiting for peer timeout Resolve NoBlockResponse as a typed request failure and retain a peer's unavailable history across status refreshes. Requeue the missing height without penalizing or disconnecting the peer, allowing another source to serve it immediately. Cover immediate response handling, retry selection, request accounting, status refreshes, reordered replies, and mismatched heights. Co-Authored-By: Codex <[email protected]> --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]> Co-authored-by: Codex <[email protected]>
TL;DR
Nodes keep making progress when peers send inconsistent consensus data or stop receiving large block responses. State sync now installs validator controls only after checking them against locally trusted data.
User story
As a node operator, I want malformed or slow peer traffic to remain contained so that consensus, block sync, and state sync continue without manual recovery.
Scenario
Actual behavior
Certain peer inputs could delay block serving, leave proposal metadata inconsistent, or make state sync accept validator controls that were not covered by the legacy hashes.
Expected behavior
Peer-controlled work is bounded, slow deliveries are isolated to their peer, and remotely supplied validator state is checked against Dash Core, signed header data, and local genesis parameters.
Detailed discussion
Issue being fixed or feature implemented
Remote-input edge cases could make a node lose progress, retain inconsistent metadata, or perform excessive block-serving work. This change makes those paths deterministic and bounded while preserving the v1.7 wire, vote-signing, and block-hash formats.
What was done?
These changes do not alter signature counting, vote sign bytes, header hashes, block hashes, or quorum threshold calculation.
How Has This Been Tested?
dash/core,internal/p2p/client,internal/p2p/conn,internal/blocksync,internal/statesync,types,light, andinternal/consensus.golangci-lintv2.13.2 with CI flags againstorigin/v1.7-dev: 0 issues.gofmtandgit diff --check.Breaking Changes
None.
Checklist:
For repository code-owners and collaborators only
🤖 Co-authored by Claudius the Magnificent AI Agent