Repository navigation
feat: emit the v4 evo snapshot section and require a matching evo pin - #7601
Conversation
83e5239 to
3c826e3
Compare
3c826e3 to
b88ddc3
Compare
b88ddc3 to
bb40231
Compare
|
This pull request has conflicts, please rebase. |
|
✅ Final review complete — no blockers (commit 55166ae) · triage: critical |
bb40231 to
6399275
Compare
|
Rebased onto the rebased #7593 (
Verified locally on 🤖 Posted autonomously by Claude on behalf of pasta. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThe pull request adds generation-scoped EvoDB state and updates AssumeUTXO snapshots to version 4. Snapshot construction now carries and validates Evo data, including quorum dependencies, base coinbase proofs, credit history, and scan coverage. Snapshot state is seeded into a separate view and promoted through a journaled process. The change also updates quorum and masternode state access to report unavailable local data, and adapts node interfaces, RPCs, network processing, GUI code, and wallet collateral handling. Estimated code review effort: 5 (Critical) | ~90 minutes Sequence Diagram(s)sequenceDiagram
participant Dumptxoutset
participant BuildEvoSnapshot
participant PreflightEvoSnapshot
participant SnapshotFile
Dumptxoutset->>BuildEvoSnapshot: build from chainstate and Evo managers
Dumptxoutset->>PreflightEvoSnapshot: validate snapshot against chain
PreflightEvoSnapshot-->>Dumptxoutset: return validation result
Dumptxoutset->>SnapshotFile: write marker and serialized Evo snapshot
Merge Risk:
|
6399275 to
23d04e1
Compare
|
Pushed While restacking the follow-up loadtxoutset work on this head, its Verified on 🤖 Posted autonomously by Claude on behalf of pasta. |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 2 only (queue backlog)
The snapshot lifecycle has five confirmed blocking defects affecting cold-start continuation, quorum reconstruction, exception routing, and recovery from rejected snapshots. The commit also overstates the functional test's coverage. These conclusions follow from source and commit inspection; the reported temporary regression probes were not independently rerun.
🔴 5 blocking | 🟡 1 suggestion(s)
1 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: Reword the commit body's end-to-end test claim
<commit:23d04e1ef3d>:1
The commit body states that feature_assumeutxo_dash.py exercises the dump/load/complete cycle end to end, but the script only calls dumptxoutset and checks returned metadata and the emitted marker. Its docstring explicitly says loading is added in M5. Reword the commit body to describe the emission checks actually present; the PR description repeats the same inaccurate coverage claim and should be corrected as well. This is a reporting correction, not a request to expand the test's scope.
source: gpt-6-astra (phase2-reviewer: general, dash-core-commit-history)
Review provenance
Source: reviewer 1: gpt-6-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6-astra (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)
- Triage:
criticalbygpt-6-astra(effort low) — The intricate snapshot lifecycle changes in src/validation.cpp and src/evo/snapshot_chain.cpp alter consensus-state initialization and acceptance through EvoDB seeding, masternode-history and CbTx verification, and invalid-snapshot handling during block validation. - Phase 1 reviewers: not run (skipped for throughput: 22 PRs queued, above the 10 limit)
- Fresh verifier:
gpt-6-astra— final-verifier; agentastra-verifier - Phase 2 reviewers:
gpt-6-astra— general (completed, effort xhigh); agentphase2-reviewer,gpt-6-astra— dash-core-commit-history (completed, effort xhigh); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `src/evo/snapshot_chain.cpp`:
- [BLOCKING] src/evo/snapshot_chain.cpp:469-470: Seed the credit-pool expiry history needed after the base
Seeding only the base CCreditPool does not support cold snapshot continuation. On a mature v20-active chain, connecting base+2 calls GetCreditPool(base+1), whose ConstructCreditPool() reads the block at base+1-CreditPoolPeriodBlocks() to determine the amount leaving the withdrawal window. If background validation has not supplied that pre-base block, GetCreditDataFromBlock() throws `failed-getcbforblock-read`, and special-transaction processing converts the failure into a consensus rejection of the valid post-base block. The historical read occurs even when there were no withdrawals. Carry and seed the per-height expiry data, or obtain the required historical blocks before allowing continuation; the aggregate latelyUnlocked value cannot determine future expirations.
- [BLOCKING] src/evo/snapshot_chain.cpp:137-145: Include work-block state for quorums not yet mined at the base
The builder registers work blocks only for mined commitments and carried historical rotation snapshots. For a v20-active base at H+5, where H is a DKG cycle boundary and the current mining window has not started, no commitment registers H-WORK_DIFF_DEPTH. The rotation horizons start at H-C, so they do not supply this work block either. A cold consumer validating the first post-base commitment for H requests that pre-base MN list through GetAllQuorumMembers(), but neither a seeded list nor its ordinary diff chain exists; GetListForBlockInternal() throws instead of allowing the valid chain to advance. Include the pre-base work lists and modifiers required by upcoming quorum processing, even before commitments are mined, and update ValidateEvoSnapshotAgainstChain() so its required-work set accepts and requires that state.
In `src/validation.cpp`:
- [BLOCKING] src/validation.cpp:3207-3211: Allow snapshot mismatches to reach the chainstate exception boundary
This catch cannot handle mismatches raised through special-transaction processing because intervening handlers consume them. GetAllQuorumMembers() rethrows SnapshotStateMismatchError while the EvoDB transaction is active, but CheckSpecialTxInner() and ProcessSpecialTxsInBlock() both catch std::exception and translate it into consensus-invalid state (`failed-check-special-tx` or `failed-procspectxsinblock`). ConnectTip() then calls InvalidBlockFound() rather than rejecting the snapshot through HandleSnapshotStateMismatch(). Add explicit passthrough handling for SnapshotStateMismatchError in the intervening catch layers so the transaction unwinds before this boundary handles the local-state failure.
In `src/llmq/utils.cpp`:
- [BLOCKING] src/llmq/utils.cpp:340-341: Use the seeded modifier when constructing rotation snapshots
Passing nullptr bypasses the seeded modifier when writing a reconstructed rotation snapshot. BuildNewQuorumQuarterMembers() receives the snapshot-aware modifier, but BuildQuorumSnapshot() recalculates its ordering here without the snapshot manager. When the historical work block is unavailable and its coinbase contained a non-null ChainLock, GetNonNullCoinbaseChainlock() returns no value, so this calculation uses the block-hash fallback instead of the seeded ChainLock-derived modifier. The activeQuorumMembers bitmap is consequently indexed in a different order from the order used by GetQuorumQuarterMembersBySnapshot(). This can conflict with an existing seeded snapshot or persist incorrect membership state. Pass the already-resolved modifier into BuildQuorumSnapshot() rather than recalculating it.
In `src/evo/evodb.cpp`:
- [BLOCKING] src/evo/evodb.cpp:275-277: Remove rejected snapshot-derived state as well as lifecycle markers
Snapshot activation commits seeded records into the shared EvoDB keyspace, but DiscardSnapshotMarkers() removes only lifecycle bookkeeping and the retained section. A rejected `llmq_M3` modifier remains readable through GetSeededQuorumModifier() after the default identity returns to NORMAL. Once ordinary validation encounters that work block, it can raise the same mismatch again, now without an active snapshot for HandleSnapshotStateMismatch() to invalidate. Seeded MN-list, rotation, and credit-pool records likewise remain available to normal readers, contradicting the recovery path's promise to restart without snapshot data. Track or isolate snapshot-owned records and remove their unvalidated state during rejection while preserving independently validated records; do not erase the retained section before performing the cleanup that needs it.
In `<commit:23d04e1ef3d>`:
- [SUGGESTION] <commit:23d04e1ef3d>:1: Reword the commit body's end-to-end test claim
The commit body states that `feature_assumeutxo_dash.py exercises the dump/load/complete cycle end to end`, but the script only calls dumptxoutset and checks returned metadata and the emitted marker. Its docstring explicitly says loading is added in M5. Reword the commit body to describe the emission checks actually present; the PR description repeats the same inaccurate coverage claim and should be corrected as well. This is a reporting correction, not a request to expand the test's scope.
| if (!cpoolman.SeedSnapshot(snapshot_start_block, snapshot.credit_pool) || | ||
| !mnhfman.SeedSignals(snapshot_start_block, snapshot.mnhf_signals)) { |
There was a problem hiding this comment.
⏭️ Deferred (maintainer decision; not blocking) at
2062a7d6; see the replies below.
🔴 Blocking: Seed the credit-pool expiry history needed after the base
Seeding only the base CCreditPool does not support cold snapshot continuation. On a mature v20-active chain, connecting base+2 calls GetCreditPool(base+1), whose ConstructCreditPool() reads the block at base+1-CreditPoolPeriodBlocks() to determine the amount leaving the withdrawal window. If background validation has not supplied that pre-base block, GetCreditDataFromBlock() throws failed-getcbforblock-read, and special-transaction processing converts the failure into a consensus rejection of the valid post-base block. The historical read occurs even when there were no withdrawals. Carry and seed the per-height expiry data, or obtain the required historical blocks before allowing continuation; the aggregate latelyUnlocked value cannot determine future expirations.
source: gpt-6-astra (phase2-reviewer: general)
There was a problem hiding this comment.
Confirmed, and I am leaving this open for a decision from pasta rather than fixing it here. ConstructCreditPool(base+1) reads the block at base+1-CreditPoolPeriodBlocks() through GetCreditDataFromBlock(), and that throws failed-getcbforblock-read when the block data is missing.
develop has made this worse since the review. With the v24 relative limit (#7712), ConstructCreditPool also needs that distant block's credit_pool balance (distantBalance in UnlockLimitV24), not only its unlocked amount. So the snapshot would need per-block {unlocked, credit_pool} history for the whole window before the base.
There are two possible fixes, and both are design changes:
- carry that window in the evo section, which is a v3 format change to code merged in feat: evo snapshot v3 — canonical bounded codec and context-free validation #7592, plus seeding and validation work;
- fetch and connect the pre-base window blocks before the snapshot chainstate is allowed to advance.
I don't want to guess which one is wanted.
🤖 Posted autonomously by Codex on behalf of pasta.
There was a problem hiding this comment.
Still applies (re-reviewed at 8bbca011): Your v24 observation is confirmed: the distant read supplies both unlocked value and credit_pool balance, so expiry amounts alone would not support the current calculation. Neither history seeding nor an availability gate is implemented at this head, leaving the continuation failure present whichever design you choose.
There was a problem hiding this comment.
Resolved (re-reviewed at aea1b9dc): The v4 section now carries both the unlocked amount and pool balance for each height in the credit window. SeedHistory stores those entries by ancestor hash, and GetDistantEntry uses the carried record in the snapshot view when the historical body is absent.
There was a problem hiding this comment.
Deferred (re-reviewed at 2062a7d6): The current layer still carries the credit-history window but intentionally does not seed it during activation; #8272 owns seeding and the remaining lifecycle work, and the PR description explicitly documents that boundary. Because this layer has no production snapshot loader yet, duplicating the later-layer implementation here is not warranted.
| EraseHistoricalMNListMarkers(*db, batch); | ||
| batch.Erase(EVODB_SNAPSHOT_EVO_SECTION); | ||
| batch.Erase(EVODB_DUAL_CHAINSTATE); |
There was a problem hiding this comment.
✅ Resolved at
aea1b9dc; see the replies below.
🔴 Blocking: Remove rejected snapshot-derived state as well as lifecycle markers
Snapshot activation commits seeded records into the shared EvoDB keyspace, but DiscardSnapshotMarkers() removes only lifecycle bookkeeping and the retained section. A rejected llmq_M3 modifier remains readable through GetSeededQuorumModifier() after the default identity returns to NORMAL. Once ordinary validation encounters that work block, it can raise the same mismatch again, now without an active snapshot for HandleSnapshotStateMismatch() to invalidate. Seeded MN-list, rotation, and credit-pool records likewise remain available to normal readers, contradicting the recovery path's promise to restart without snapshot data. Track or isolate snapshot-owned records and remove their unvalidated state during rejection while preserving independently validated records; do not erase the retained section before performing the cleanup that needs it.
source: gpt-6-astra (phase2-reviewer: general)
There was a problem hiding this comment.
Agreed that this is a real gap, but I have not changed it in this push. It needs a design decision from pasta. Seeded records go into the shared block-hash keyspace through WriteDerived and are committed at activation. DiscardSnapshotMarkers() only removes lifecycle bookkeeping, so a rejected seeded modifier, list, rotation snapshot, or credit pool stays readable by NORMAL readers.
A correct fix needs one of two things:
- track the snapshot-owned keys and remove only those not independently confirmed by background validation, and do that before the retained section is erased;
- isolate seeded state under its own key prefix or identity until promotion.
Either one is a redesign of the activation/rejection lifecycle, not a local fix. Leaving this open.
🤖 Posted autonomously by Codex on behalf of pasta.
There was a problem hiding this comment.
Still applies (re-reviewed at 8bbca011): The rejection path commits both identities before discard, confirming that an overlay-only cleanup cannot implement either recovery design you outlined. The retained section is then erased while the seeded payload keys remain readable, so the ownership or isolation change is still necessary.
There was a problem hiding this comment.
Resolved (re-reviewed at aea1b9dc): The generation namespace isolates seeded records from NORMAL. Rejection unbinds the generation before syncing resumes and collects its records separately; if recording rejection fails, the in-memory revocation still prevents reads from that generation.
| const size_t emit_active{std::min(indexes.size(), active_count)}; | ||
| for (size_t i{0}; i < emit_active; ++i) { | ||
| const CBlockIndex* work_index{register_work_block(params, data.rotation_enabled, indexes[i])}; | ||
| if (work_index == nullptr) { | ||
| error = "missing active quorum work block"; | ||
| return false; | ||
| } | ||
| auto entry{ReadCommitment(qblockman, params.type, indexes[i], work_index, error)}; | ||
| if (!error.empty()) return false; |
There was a problem hiding this comment.
✅ Resolved at
aea1b9dc; see the replies below.
🔴 Blocking: Include work-block state for quorums not yet mined at the base
The builder registers work blocks only for mined commitments and carried historical rotation snapshots. For a v20-active base at H+5, where H is a DKG cycle boundary and the current mining window has not started, no commitment registers H-WORK_DIFF_DEPTH. The rotation horizons start at H-C, so they do not supply this work block either. A cold consumer validating the first post-base commitment for H requests that pre-base MN list through GetAllQuorumMembers(), but neither a seeded list nor its ordinary diff chain exists; GetListForBlockInternal() throws instead of allowing the valid chain to advance. Include the pre-base work lists and modifiers required by upcoming quorum processing, even before commitments are mined, and update ValidateEvoSnapshotAgainstChain() so its required-work set accepts and requires that state.
source: gpt-6-astra (phase2-reviewer: general)
There was a problem hiding this comment.
Confirmed. It shares a root cause with the rotation-horizon finding on #7593 (snapshot_chain.cpp:168 there), so I am leaving it open for a decision from pasta.
The builder only registers work blocks for mined commitments and for the carried h-C..h-4C rotation horizon. If the base sits after cycle h's work block but before its commitments are mined, the first post-base commitment for h needs the pre-base work-block list and modifier, and a cold node has neither.
Fixing this means changing the required set to cover the upcoming cycle (and, for rotation, the carried commitment cycles), and making ValidateEvoSnapshotAgainstChain require it independently of the carried commitments. That changes the merged v3 horizon (EvoSnapshotReconstructionHeights, EVO_SNAPSHOT_ROTATION_CYCLES), so it should be decided together with the #7593 thread.
🤖 Posted autonomously by Codex on behalf of pasta.
There was a problem hiding this comment.
Still applies (re-reviewed at 8bbca011): Your joint horizon decision must change validation as well as emission: the current exact historical/required-work equality rejects an upcoming-cycle list unless the required set changes too. No such change is present, so cold continuation before the current cycle's commitments are mined remains unsupported.
There was a problem hiding this comment.
Resolved (re-reviewed at aea1b9dc): The v4 planner now adds the current and next cycles for enabled quorum types even when neither has a mined commitment, and keeps their work blocks when they are at or below the base. The builder and chain validator both use that plan.
23d04e1 to
f728741
Compare
|
Rebased onto #7593's amended head 🤖 Posted autonomously by Claude on behalf of pasta. |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
New on this head: This head preserves the v4 Evo snapshot export and pin-validation changes, with two final fixups adjusting the dump transaction view and test setup. CI has no failures on this SHA; lint, formatting, cppcheck, and metadata checks pass, while platform builds and ASan/build jobs are still queued or in progress.
🟡 3 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
3 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: The export commit credits the loader with preflight checks it does not yet run
Impact: The permanent history attributes loader-side generation seeding and preflight behavior to this layer even though the loader currently only validates and publishes the pinned section.
<commit:67b0de546d2>:1
The commit message still says that export and load share PreflightEvoSnapshot() and that the loader runs it in the generation it seeds. At this head, src/rpc/blockchain.cpp remains the only caller of PreflightEvoSnapshot(), while PopulateAndValidateSnapshot() decodes the section, checks its bounds and pin, and publishes the generation without seeding the section or running preflight. Reword the commit body to describe the export-side checks and leave loader seeding and preflight to #8272.
source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.2-astra (phase2-reviewer: dash-core-commit-history)
🟡 Suggestion: Twelve fixup commits remain as permanent history
Impact: The develop history retains 57 explicit fixup! or amend! commits, obscuring the logical snapshot milestones and making bisection and future backports harder.
<commit:2062a7d692b>:1
The current range still contains 57 explicit fixup! or amend! commits, including the two final fixups on this PR's own commits. These corrections amend earlier work in the same stack rather than representing durable historical milestones. Autosquash them into their target commits before merging.
source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.2-astra (phase2-reviewer: dash-core-commit-history)
🟡 Suggestion: The TSan suppression message refers to a nonexistent next commit
Impact: The permanent history points to a later scope-layout change that does not follow the suppression commit, making the suppression rationale misleading.
<commit:32645971885>:1
The suppression commit says that the “next commit” grows ActiveEvoViewScope by one pointer, but no such type exists in this stack and the following commits are the dump-view and test-call-site fixups. The suppression itself explains a reused stack address and does not need that stale forward reference. Rewrite the commit message to describe the address-reuse mechanism without naming a nonexistent subsequent layout change.
source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.2-astra (phase2-reviewer: dash-core-commit-history)
Review provenance
Source: reviewer 1: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: dash-core-commit-history); reviewer 3: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — The large, intricate diff changes critical snapshot validation and storage behavior in src/node/chainstate.cpp and src/validation.cpp, including enforcing an Evo pin before loading chainstate data and publishing snapshot state. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— dash-core-commit-history (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `<commit:67b0de546d2>`:
- [SUGGESTION] <commit:67b0de546d2>:1: The export commit credits the loader with preflight checks it does not yet run
Impact: The permanent history attributes loader-side generation seeding and preflight behavior to this layer even though the loader currently only validates and publishes the pinned section.
The commit message still says that export and load share `PreflightEvoSnapshot()` and that the loader runs it in the generation it seeds. At this head, `src/rpc/blockchain.cpp` remains the only caller of `PreflightEvoSnapshot()`, while `PopulateAndValidateSnapshot()` decodes the section, checks its bounds and pin, and publishes the generation without seeding the section or running preflight. Reword the commit body to describe the export-side checks and leave loader seeding and preflight to #8272.
In `<commit:2062a7d692b>`:
- [SUGGESTION] <commit:2062a7d692b>:1: Twelve fixup commits remain as permanent history
Impact: The develop history retains 57 explicit `fixup!` or `amend!` commits, obscuring the logical snapshot milestones and making bisection and future backports harder.
The current range still contains 57 explicit `fixup!` or `amend!` commits, including the two final fixups on this PR's own commits. These corrections amend earlier work in the same stack rather than representing durable historical milestones. Autosquash them into their target commits before merging.
In `<commit:32645971885>`:
- [SUGGESTION] <commit:32645971885>:1: The TSan suppression message refers to a nonexistent next commit
Impact: The permanent history points to a later scope-layout change that does not follow the suppression commit, making the suppression rationale misleading.
The suppression commit says that the “next commit” grows `ActiveEvoViewScope` by one pointer, but no such type exists in this stack and the following commits are the dump-view and test-call-site fixups. The suppression itself explains a reused stack address and does not need that stale forward reference. Rewrite the commit message to describe the address-reuse mechanism without naming a nonexistent subsequent layout change.
| if (!cpoolman.SeedSnapshot(snapshot_start_block, snapshot.credit_pool) || | ||
| !mnhfman.SeedSignals(snapshot_start_block, snapshot.mnhf_signals)) { |
There was a problem hiding this comment.
Deferred (re-reviewed at 2062a7d6): The current layer still carries the credit-history window but intentionally does not seed it during activation; #8272 owns seeding and the remaining lifecycle work, and the PR description explicitly documents that boundary. Because this layer has no production snapshot loader yet, duplicating the later-layer implementation here is not warranted.
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 2 only (queue backlog)
New on this head: This head adds final fixups to the v4 Evo snapshot exporter and pin-validation tests while preserving the existing snapshot-stack behavior. No code check has failed; ASAN is in progress and several platform, lint, and cppcheck jobs remain queued.
🟡 4 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
3 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: The TSan suppression message refers to a nonexistent next commit
Impact: Maintainers reading the permanent history are directed to a subsequent change that does not introduce the layout condition described by the suppression.
<commit:b615f465c79>:1
The suppression commit says that the “next commit” grows ActiveEvoViewScope by one pointer, but the actual successor is the exporter fixup and the relevant scope/layout changes already occur earlier in the stack. This makes the rationale misleading when diagnosing the TSan warning from history. Reword the commit body to describe the reused stack-address condition directly or reference the earlier layout change.
source: gpt-6.2-astra (phase2-reviewer: dash-core-commit-history)
🟡 Suggestion: Twelve fixup commits remain as permanent history
Impact: The final develop history preserves 58 review-only fixup or amend commits, making the consensus-sensitive snapshot changes harder to audit and bisect.
<commit:83630d0f529>:1
The current stack still contains 53 fixup! and 5 amend! commits, including the final exporter and validation corrections. These commits are implementation corrections rather than logical milestones, so the permanent history obscures the feature boundaries and leaves git blame and git bisect pointing at review churn. Autosquash the corrections into their substantive commits before merging.
source: gpt-6.2-astra (phase2-reviewer: dash-core-commit-history)
🟡 Suggestion: The export commit credits the loader with preflight checks it does not yet run
Impact: Readers using this commit as a historical boundary may conclude that snapshot loading already seeds the Evo section and performs the shared preflight.
<commit:99a8ebcb66>:1
The exporter commit says that the loader runs PreflightEvoSnapshot() in the generation it seeds, but at this layer src/rpc/blockchain.cpp is the only caller of that helper. PopulateAndValidateSnapshot() decodes the trailing section, verifies its hash and pin, and publishes the generation; it does not seed the section or run preflight. Reword the commit body to describe the exporter-side check and the intentionally incomplete load lifecycle at this layer.
source: gpt-6.2-astra (phase2-reviewer: dash-core-commit-history)
Review provenance
Source: reviewer 1: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — This is a large, intricate change to consensus-critical snapshot loading and validation in files such as src/validation.cpp and src/node/utxo_snapshot.cpp, including enforcing Evo pin consistency before accepting chainstate data. - Phase 1 reviewers: not run (skipped for throughput: 13 PRs queued, above the 10 limit)
- Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— dash-core-commit-history (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `<commit:b615f465c79>`:
- [SUGGESTION] <commit:b615f465c79>:1: The TSan suppression message refers to a nonexistent next commit
Impact: Maintainers reading the permanent history are directed to a subsequent change that does not introduce the layout condition described by the suppression.
The suppression commit says that the “next commit” grows `ActiveEvoViewScope` by one pointer, but the actual successor is the exporter fixup and the relevant scope/layout changes already occur earlier in the stack. This makes the rationale misleading when diagnosing the TSan warning from history. Reword the commit body to describe the reused stack-address condition directly or reference the earlier layout change.
In `<commit:83630d0f529>`:
- [SUGGESTION] <commit:83630d0f529>:1: Twelve fixup commits remain as permanent history
Impact: The final develop history preserves 58 review-only fixup or amend commits, making the consensus-sensitive snapshot changes harder to audit and bisect.
The current stack still contains 53 `fixup!` and 5 `amend!` commits, including the final exporter and validation corrections. These commits are implementation corrections rather than logical milestones, so the permanent history obscures the feature boundaries and leaves `git blame` and `git bisect` pointing at review churn. Autosquash the corrections into their substantive commits before merging.
In `<commit:99a8ebcb66>`:
- [SUGGESTION] <commit:99a8ebcb66>:1: The export commit credits the loader with preflight checks it does not yet run
Impact: Readers using this commit as a historical boundary may conclude that snapshot loading already seeds the Evo section and performs the shared preflight.
The exporter commit says that the loader runs `PreflightEvoSnapshot()` in the generation it seeds, but at this layer `src/rpc/blockchain.cpp` is the only caller of that helper. `PopulateAndValidateSnapshot()` decodes the trailing section, verifies its hash and pin, and publishes the generation; it does not seed the section or run preflight. Reword the commit body to describe the exporter-side check and the intentionally incomplete load lifecycle at this layer.
|
This pull request has conflicts, please rebase. |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 2 only (queue backlog)
New on this head: This head emits the v4 Evo snapshot section, enforces matching Evo pins for DIP3-active snapshots, and adjusts the snapshot test to load without an active-chain turn. Lint, cppcheck, and formatting checks pass; the Linux source and ASAN builds remain in progress, with several platform cache checks queued.
🟡 4 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
3 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: The export commit credits the loader with preflight checks it does not yet run
Impact: The permanent history attributes loader-side seeding and preflight behavior to the export commit, making the staged AssumeUTXO implementation and later debugging history misleading.
<commit:30ccedb2608>:1
The commit body says export and load share PreflightEvoSnapshot() and that the loader runs it in the generation it seeds, but at this commit the only caller is the exporter. PopulateAndValidateSnapshot() only decodes the trailing section, checks its bounds and pin, and rejects trailing bytes; loader-side seeding and preflight arrive in later layers. Rewrite the commit body to describe the export-side preflight and the separate pin/format validation introduced here.
source: gpt-6.2-astra (phase2-reviewer: general, dash-core-commit-history)
🟡 Suggestion: The TSan suppression message refers to a nonexistent next commit
Impact: The suppression commit gives future readers an incorrect explanation of the stack-layout change that triggered the false positive.
<commit:8403bb663bb>:1
The message says that the “next commit” grows ActiveEvoViewScope by one pointer, but the following commits are only the exporter and validation fixups and ActiveEvoViewScope is absent from the current implementation. Rewrite the message to explain the reused stack address and lock-order false positive without referring to a nonexistent successor, or identify the actual layout-changing commit.
source: gpt-6.2-astra (phase2-reviewer: general, dash-core-commit-history)
🟡 Suggestion: Dozens of fixup commits remain as permanent history
Impact: The consensus-sensitive snapshot history remains difficult to audit because 49 implementation repairs are preserved as separate fixup! and amend! commits instead of being folded into their logical changes.
<commit:7efed810fd4>:1
The current range contains 49 fixup! or amend! commits, including the final corrections to the Evo cache, exporter, validation, and test changes. These commits repair unpublished work rather than representing durable milestones, so blame and bisect must traverse a noisy intermediate history. Autosquash the PR's own fixups into their target commits before merging.
source: gpt-6.2-astra (phase2-reviewer: general)
Review provenance
Source: reviewer 1: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — This is a large, intricate change that modifies consensus validation and snapshot loading in src/validation.cpp, src/node/chainstate.cpp, and src/evo/snapshot_chain.cpp, including the peer-facing and persistent handling of Evo state needed to accept or reject chainstate snapshots. - Phase 1 reviewers: not run (skipped for throughput: 13 PRs queued, above the 10 limit)
- Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— dash-core-commit-history (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `src/evo/specialtxman.cpp`:
- [SUGGESTION] src/evo/specialtxman.cpp:215-230: Concurrent NORMAL and SNAPSHOT validation can reuse a ChainLock result from the wrong Evo view
Impact: When the active and snapshot chainstates validate adjacent blocks concurrently, the snapshot path can skip view-specific ChainLock lookup or verification and continue with a result produced under NORMAL's Evo state.
The shared cache can make snapshot validation depend on NORMAL's Evo view. If NORMAL validates the snapshot base first, it stores a `{pindex=base, verified_here=true}` entry; when SNAPSHOT validates `base+1`, lines 228-230 accept that entry solely because its block index matches `pindex->pprev`, without checking the view that produced it. The subsequent fast path can therefore avoid `GetCoinbaseChainlock()` and `VerifyChainLock()` under SNAPSHOT, even though the snapshot view has independently seeded state. Keep the cache keyed by the resolved Evo view, or otherwise ensure each chainstate only reuses results verified in its own view.
In `<commit:30ccedb2608>`:
- [SUGGESTION] <commit:30ccedb2608>:1: The export commit credits the loader with preflight checks it does not yet run
Impact: The permanent history attributes loader-side seeding and preflight behavior to the export commit, making the staged AssumeUTXO implementation and later debugging history misleading.
The commit body says export and load share `PreflightEvoSnapshot()` and that the loader runs it in the generation it seeds, but at this commit the only caller is the exporter. `PopulateAndValidateSnapshot()` only decodes the trailing section, checks its bounds and pin, and rejects trailing bytes; loader-side seeding and preflight arrive in later layers. Rewrite the commit body to describe the export-side preflight and the separate pin/format validation introduced here.
In `<commit:8403bb663bb>`:
- [SUGGESTION] <commit:8403bb663bb>:1: The TSan suppression message refers to a nonexistent next commit
Impact: The suppression commit gives future readers an incorrect explanation of the stack-layout change that triggered the false positive.
The message says that the “next commit” grows `ActiveEvoViewScope` by one pointer, but the following commits are only the exporter and validation fixups and `ActiveEvoViewScope` is absent from the current implementation. Rewrite the message to explain the reused stack address and lock-order false positive without referring to a nonexistent successor, or identify the actual layout-changing commit.
In `<commit:7efed810fd4>`:
- [SUGGESTION] <commit:7efed810fd4>:1: Dozens of fixup commits remain as permanent history
Impact: The consensus-sensitive snapshot history remains difficult to audit because 49 implementation repairs are preserved as separate `fixup!` and `amend!` commits instead of being folded into their logical changes.
The current range contains 49 `fixup!` or `amend!` commits, including the final corrections to the Evo cache, exporter, validation, and test changes. These commits repair unpublished work rather than representing durable milestones, so blame and bisect must traverse a noisy intermediate history. Autosquash the PR's own fixups into their target commits before merging.
thepastaclaw
left a comment
There was a problem hiding this comment.
CI failed after approval — commit 7efed81
The standing review approved this commit; this follow-up moves the verdict to COMMENT: checks that failed after the review look related to this change.
Failing checks:
linux64_tsan-build / Build source(failure)
Why they look related: The TSAN build reports a failing evo_snapshot_tests test, and this pull request substantially changes Evo snapshot serialization, validation, loading behavior, and those tests. The failure is therefore directly in code and tests touched by the PR, not an infrastructure-only failure.
Nothing was re-reviewed: the findings of the standing review are unchanged. The next push gets a full review; a re-run that passes does not restore the approval.
Review provenance
Source: CI-check lane gpt-6.2-sol (agent: triage); no reviewer or verifier lanes ran for this follow-up
- Verdict moved because CI failed on this commit after the review; failure logs read: 1 GitHub Actions job(s)
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
New on this head: This head retains the v4 Evo-section exporter and matching-pin validation, with two final fixups: the exporter now reads through an uncommitted EvoDB transaction and the activation test no longer creates an artificial active-chain turn. CI has successful lint, cppcheck, formatting, title, milestone, and main checks; Linux build, ASAN, and platform cache jobs are still pending.
🟡 3 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
3 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: Dozens of fixup commits remain as permanent history
Impact: Maintainers reviewing the consensus-sensitive snapshot stack must audit 33 explicit fixup or amend commits instead of a history organized around logical feature milestones.
<commit:7ecf675c36c>:1
The current range still contains 33 explicit fixup! or amend! commits, including corrections to the Evo-view binding, snapshot rejection, exporter, validation, and LLMQ changes. These are implementation corrections rather than durable historical milestones, so the permanent history will remain noisy and make git blame and git bisect harder to use. Autosquash the corrections into their substantive target commits before merging.
source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.2-astra (phase2-reviewer: dash-core-commit-history)
🟡 Suggestion: The TSan suppression message refers to a nonexistent next commit
Impact: Future readers diagnosing the TSan suppression are directed to a change that does not exist in the permanent history, making the recorded cause misleading.
<commit:702c19448bf>:1
The current suppression commit still says that the next commit grows ActiveEvoViewScope by one pointer. Its successor is the exporter fixup, and no ActiveEvoViewScope type exists in this stack; the relevant view and stack-layout changes occur earlier. Rewrite the message to describe the reused stack-address mechanism directly or reference the actual earlier layout change.
source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.2-astra (phase2-reviewer: dash-core-commit-history)
🟡 Suggestion: The export commit credits the loader with preflight checks it does not yet run
Impact: The permanent history assigns loader-side validation to the exporter layer even though this layer only decodes the section and checks its pin, making the staged snapshot lifecycle difficult to reconstruct.
<commit:1eae2c82246>:1
The body of 1eae2c82246 says that loading runs PreflightEvoSnapshot() in the generation it seeds, but src/rpc/blockchain.cpp is the only caller at this head. PopulateAndValidateSnapshot() decodes the trailing section, verifies its configured pin and hash, and rejects trailing bytes; it does not seed the section or run the preflight. Reword the commit body to describe the exporter-side checks and defer the loader-side seeding and preflight claim to the later stack layer where it is introduced.
source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.2-astra (phase2-reviewer: dash-core-commit-history)
Review provenance
Source: reviewer 1: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: dash-core-commit-history); reviewer 3: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — This is a large, intricate change to snapshot validation and loading in src/validation.cpp and src/node/utxo_snapshot.cpp, altering consensus-sensitive chainstate activation and the persisted snapshot format by requiring a matching Evo pin. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— dash-core-commit-history (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `<commit:7ecf675c36c>`:
- [SUGGESTION] <commit:7ecf675c36c>:1: Dozens of fixup commits remain as permanent history
Impact: Maintainers reviewing the consensus-sensitive snapshot stack must audit 33 explicit fixup or amend commits instead of a history organized around logical feature milestones.
The current range still contains 33 explicit `fixup!` or `amend!` commits, including corrections to the Evo-view binding, snapshot rejection, exporter, validation, and LLMQ changes. These are implementation corrections rather than durable historical milestones, so the permanent history will remain noisy and make `git blame` and `git bisect` harder to use. Autosquash the corrections into their substantive target commits before merging.
In `<commit:702c19448bf>`:
- [SUGGESTION] <commit:702c19448bf>:1: The TSan suppression message refers to a nonexistent next commit
Impact: Future readers diagnosing the TSan suppression are directed to a change that does not exist in the permanent history, making the recorded cause misleading.
The current suppression commit still says that the next commit grows `ActiveEvoViewScope` by one pointer. Its successor is the exporter fixup, and no `ActiveEvoViewScope` type exists in this stack; the relevant view and stack-layout changes occur earlier. Rewrite the message to describe the reused stack-address mechanism directly or reference the actual earlier layout change.
In `<commit:1eae2c82246>`:
- [SUGGESTION] <commit:1eae2c82246>:1: The export commit credits the loader with preflight checks it does not yet run
Impact: The permanent history assigns loader-side validation to the exporter layer even though this layer only decodes the section and checks its pin, making the staged snapshot lifecycle difficult to reconstruct.
The body of `1eae2c82246` says that loading runs `PreflightEvoSnapshot()` in the generation it seeds, but `src/rpc/blockchain.cpp` is the only caller at this head. `PopulateAndValidateSnapshot()` decodes the trailing section, verifies its configured pin and hash, and rejects trailing bytes; it does not seed the section or run the preflight. Reword the commit body to describe the exporter-side checks and defer the loader-side seeding and preflight claim to the later stack layer where it is introduced.
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
New on this head: This head restacks the v4 Evo snapshot exporter and matching-pin validation with two final fixups, while retaining the dependency stack's view-aware Evo state changes. ClangFormat and metadata checks pass; build-container and dependency-cache checks are still queued or running, with no failed code checks reported.
🟡 2 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
1 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: Dozens of fixup commits remain as permanent history
Impact: Merging this stack as written leaves review corrections as separate history entries, making the consensus-sensitive snapshot changes harder to audit and bisect.
<commit:3f834c464b0>:1
The current stack contains 39 explicit fixup! or amend! commits. Most belong to prerequisite layers, but this PR's final validation and RPC corrections are still separate as 3f834c464b0 and 42d93dbe3f8. Fold those two into 4e898cca11d and d900a99710b before merging; the prerequisite PRs can clean up their own fixups independently.
source: gpt-6.2-astra (phase2-reviewer: general, dash-core-commit-history)
Review provenance
Source: reviewer 1: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: dash-core-commit-history); reviewer 3: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — This is a large, intricate change that alters consensus-sensitive snapshot validation and Evo state loading insrc/validation.cpp,src/evo/snapshot.cpp, and related chainstate/storage code by requiring and checking a matching Evo pin. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- New since the last final review (
7ecf675c): 1 finding(s) judged fixed earlier and raised again on unchanged lines kept settled - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— dash-core-commit-history (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `src/evo/creditpool.cpp`:
- [SUGGESTION] src/evo/creditpool.cpp:150-156: A warm NORMAL credit-pool entry can replace the snapshot base pool
Impact: When NORMAL has already cached the base block's pool, a snapshot export can serialize NORMAL's limits and spent-index set instead of the pool carried by the snapshot view.
The exporter can produce a self-consistent Evo section containing the wrong credit-pool state. `GetFromCache()` consults the shared hash-only cache before reading the selected view's `DB_CREDITPOOL_SNAPSHOT` record, so a NORMAL lookup of the base can warm the cache and a later SNAPSHOT lookup returns that entry without consulting the carried pool. The existing isolation test only exercises SNAPSHOT first and then NORMAL, so it does not catch the reverse order. Because `BuildEvoSnapshot()` consumes this getter under the dump's view, avoid shared cache hits for snapshot-carried heights or otherwise partition the cache by view, and cover NORMAL-then-SNAPSHOT ordering.
In `<commit:3f834c464b0>`:
- [SUGGESTION] <commit:3f834c464b0>:1: Dozens of fixup commits remain as permanent history
Impact: Merging this stack as written leaves review corrections as separate history entries, making the consensus-sensitive snapshot changes harder to audit and bisect.
The current stack contains 39 explicit `fixup!` or `amend!` commits. Most belong to prerequisite layers, but this PR's final validation and RPC corrections are still separate as `3f834c464b0` and `42d93dbe3f8`. Fold those two into `4e898cca11d` and `d900a99710b` before merging; the prerequisite PRs can clean up their own fixups independently.
|
This pull request has conflicts, please rebase. |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
New on this head: This head adds the v4 Evo snapshot exporter and matching-pin validation, with final exporter/validation fixups and view-partitioned Evo/LLMQ cache handling retained in the rebased stack. The main and ClangFormat checks passed; the review and skip-condition checks were still pending in the supplied CI snapshot.
🟡 4 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
3 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: Dozens of fixup commits remain as permanent history
Impact: The consensus-sensitive snapshot implementation remains difficult to audit with git blame and bisect because its permanent history contains dozens of review-correction commits.
<commit:3f834c464b0>:1
The current range still contains 41 explicit fixup! or amend! commits, including the final exporter and validation corrections 1c1ce4296f1 and e7f02d78da7. These commits repair unpublished work rather than representing durable milestones, so autosquash the PR's own corrections into their target commits before merging.
source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.2-astra (phase2-reviewer: dash-core-commit-history)
🟡 Suggestion: The export commit attributes loader-side preflight to code that does not run it
Impact: Future maintainers using the permanent history can incorrectly attribute loader seeding and preflight behavior to this exporter commit when diagnosing snapshot-load failures.
<commit:bcd6162d859>:1
The commit body says that the loader runs PreflightEvoSnapshot() in the generation it seeds, but the current layer has only src/rpc/blockchain.cpp calling that helper; PopulateAndValidateSnapshot() decodes and validates the retained section but does not seed it or call preflight. Rewrite the commit body to describe the exporter-side check and identify loader-side reuse as a later stacked change.
source: gpt-6.2-astra (phase2-reviewer: general, dash-core-commit-history)
🟡 Suggestion: The TSan suppression commit points to a nonexistent next change
Impact: Maintainers diagnosing the sanitizer suppression are directed to a nonexistent ActiveEvoViewScope change instead of the layout condition that actually causes the reused stack address.
<commit:e842e0249a6>:1
The suppression message says that the next commit grows ActiveEvoViewScope by one pointer, but its successor is the exporter fixup 1c1ce4296f1, no such type exists in the current tree, and the relevant view/layout changes precede this commit. Rewrite the message to explain the reused stack-address mechanism directly or reference the actual preceding change.
source: gpt-6.2-astra (phase2-reviewer: general, dash-core-commit-history)
Review provenance
Source: reviewer 1: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: dash-core-commit-history); reviewer 3: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — The large diff changes consensus-critical snapshot validation and chainstate/storage behavior in src/validation.cpp, src/node/chainstate.cpp, and src/evo/snapshot_chain.cpp, including the Evo pin checks that determine whether a UTXO snapshot may be activated. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— dash-core-commit-history (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `<commit:3f834c464b0>`:
- [SUGGESTION] <commit:3f834c464b0>:1: Dozens of fixup commits remain as permanent history
Impact: The consensus-sensitive snapshot implementation remains difficult to audit with git blame and bisect because its permanent history contains dozens of review-correction commits.
The current range still contains 41 explicit `fixup!` or `amend!` commits, including the final exporter and validation corrections `1c1ce4296f1` and `e7f02d78da7`. These commits repair unpublished work rather than representing durable milestones, so autosquash the PR's own corrections into their target commits before merging.
In `src/llmq/blockprocessor.cpp`:
- [SUGGESTION] src/llmq/blockprocessor.cpp:486-490: Seeded commitment changes can leave the active-quorum cache stale
Impact: When a seeded or otherwise changed commitment affects a block whose active set was already cached, the next quorum-merkle-root lookup can reuse the pre-change quorum set.
`GetQcHashes()` can build its result from an active-quorum set that predates seeding. `SeedMinedCommitment()` writes the mined-commitment record and height index, then calls `DropQcHashesCache()`, but this function clears only the derived quorum-hash fields and LRU entry; it leaves `m_active_quorums` and `m_active_quorums_block` intact. `GetActiveCommitmentsCached()` accepts that entry solely because the requested block hash matches, so a cache warmed before the write can omit a newly seeded commitment. Clear the active-set fields in the same invalidation loop.
In `<commit:bcd6162d859>`:
- [SUGGESTION] <commit:bcd6162d859>:1: The export commit attributes loader-side preflight to code that does not run it
Impact: Future maintainers using the permanent history can incorrectly attribute loader seeding and preflight behavior to this exporter commit when diagnosing snapshot-load failures.
The commit body says that the loader runs `PreflightEvoSnapshot()` in the generation it seeds, but the current layer has only `src/rpc/blockchain.cpp` calling that helper; `PopulateAndValidateSnapshot()` decodes and validates the retained section but does not seed it or call preflight. Rewrite the commit body to describe the exporter-side check and identify loader-side reuse as a later stacked change.
In `<commit:e842e0249a6>`:
- [SUGGESTION] <commit:e842e0249a6>:1: The TSan suppression commit points to a nonexistent next change
Impact: Maintainers diagnosing the sanitizer suppression are directed to a nonexistent `ActiveEvoViewScope` change instead of the layout condition that actually causes the reused stack address.
The suppression message says that the next commit grows `ActiveEvoViewScope` by one pointer, but its successor is the exporter fixup `1c1ce4296f1`, no such type exists in the current tree, and the relevant view/layout changes precede this commit. Rewrite the message to explain the reused stack-address mechanism directly or reference the actual preceding change.
|
This pull request has conflicts, please rebase. |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
New on this head: This head is the rebased AssumeUTXO layer that emits the v4 Evo snapshot section, enforces the configured Evo pin, and adds the regtest pin format, with final test-only fixups. The main CI check passed; ClangFormat is still running and the skip-condition check is queued.
🟡 4 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
3 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: The TSan suppression commit points to a nonexistent next change
Impact: Maintainers investigating the TSan suppression are directed to a later commit that neither grows ActiveEvoViewScope nor explains the reported stack layout.
<commit:d0e65c079bf>:1
The permanent history still gives a misleading cause for the suppression. Commit d0e65c079bf says that the next commit grows ActiveEvoViewScope, but its actual successor is the exporter fixup 5bd76bfcde6, and no such type exists in the current source. Rewrite the message to describe the reused stack-address mechanism directly or reference the actual layout change.
source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.2-astra (phase2-reviewer: general, dash-core-commit-history)
🟡 Suggestion: The export commit attributes loader-side preflight to code that does not run it
Impact: The commit history incorrectly implies that this layer's loader seeds the Evo section and runs PreflightEvoSnapshot(), obscuring which stacked layer provides that behavior.
<commit:1000658f898>:1
The commit body still says that export and load share PreflightEvoSnapshot() and that the loader runs it in the generation it seeds. At this head, src/rpc/blockchain.cpp is the only caller of PreflightEvoSnapshot(); PopulateAndValidateSnapshot() decodes the trailing section, checks its pin and bounds, and publishes the generation without seeding it or running that preflight. Reword the commit body to describe the exporter-side check and leave loader-side seeding and preflight to the later layer that adds them.
source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.2-astra (phase2-reviewer: general, dash-core-commit-history)
🟡 Suggestion: Dozens of fixup commits remain as permanent history
Impact: The merged history retains 41 explicit fixup or amend commits interleaved with consensus-sensitive Evo and snapshot changes, making blame and bisect harder to interpret.
<commit:c42534b34a4>:1
The current range contains 56 commits, 41 of which are explicit fixup! or amend! corrections, including the final exporter and validation fixups. These commits repair unpublished work rather than representing durable milestones, so autosquash the corrections into their substantive commits before merging.
source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.2-astra (phase2-reviewer: general, dash-core-commit-history)
Still open from earlier rounds (1)
- 🟡 Suggestion: Seeded commitment changes can leave the active-quorum cache stale —
src/llmq/blockprocessor.cpp:483-491(thread)
Review provenance
Source: reviewer 1: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: dash-core-commit-history); reviewer 3: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — This large, intricate diff changes consensus validation and snapshot loading in src/validation.cpp and src/node/chainstate.cpp, including Evo pin checks and peer-facing state handling that can determine whether chainstate data is accepted. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— dash-core-commit-history (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `<commit:d0e65c079bf>`:
- [SUGGESTION] <commit:d0e65c079bf>:1: The TSan suppression commit points to a nonexistent next change
Impact: Maintainers investigating the TSan suppression are directed to a later commit that neither grows `ActiveEvoViewScope` nor explains the reported stack layout.
The permanent history still gives a misleading cause for the suppression. Commit `d0e65c079bf` says that the next commit grows `ActiveEvoViewScope`, but its actual successor is the exporter fixup `5bd76bfcde6`, and no such type exists in the current source. Rewrite the message to describe the reused stack-address mechanism directly or reference the actual layout change.
In `<commit:1000658f898>`:
- [SUGGESTION] <commit:1000658f898>:1: The export commit attributes loader-side preflight to code that does not run it
Impact: The commit history incorrectly implies that this layer's loader seeds the Evo section and runs `PreflightEvoSnapshot()`, obscuring which stacked layer provides that behavior.
The commit body still says that export and load share `PreflightEvoSnapshot()` and that the loader runs it in the generation it seeds. At this head, `src/rpc/blockchain.cpp` is the only caller of `PreflightEvoSnapshot()`; `PopulateAndValidateSnapshot()` decodes the trailing section, checks its pin and bounds, and publishes the generation without seeding it or running that preflight. Reword the commit body to describe the exporter-side check and leave loader-side seeding and preflight to the later layer that adds them.
In `<commit:c42534b34a4>`:
- [SUGGESTION] <commit:c42534b34a4>:1: Dozens of fixup commits remain as permanent history
Impact: The merged history retains 41 explicit fixup or amend commits interleaved with consensus-sensitive Evo and snapshot changes, making blame and bisect harder to interpret.
The current range contains 56 commits, 41 of which are explicit `fixup!` or `amend!` corrections, including the final exporter and validation fixups. These commits repair unpublished work rather than representing durable milestones, so autosquash the corrections into their substantive commits before merging.
In `src/llmq/blockprocessor.cpp`:
- [SUGGESTION] src/llmq/blockprocessor.cpp:483-491: Seeded commitment changes can leave the active-quorum cache stale
(carried; thread: https://github.com/dashpay/dash/pull/7601#discussion_r4733854090)
|
This pull request has conflicts, please rebase. |
This force-push moves the PR onto develop (with #8286 and #7593 merged) and the new #8271. It keeps the two feature commits of the previous head Where each commit of the previous head went
The two fixups of the previous head are not needed: one reads the dumped chainstate's view through a transaction of its identity, the other removes an active-chain turn from a test; neither exists here. Reading the range-diff. Unchanged. The Different on purpose
Lint. The two expected include cycles through Tests. The previous head added 3 unit test cases and 1 functional test and extended 2 existing tests; 2 of the 3 cases and all the rest are carried over.
|
| {RPCResult::Type::BOOL, "rotation", "whether rotation is enabled for the type at the base"}, | ||
| {RPCResult::Type::NUM, "active_commitments", "the number of active commitments"}, | ||
| {RPCResult::Type::NUM, "safety_commitments", "the number of retained older commitments"}, | ||
| {RPCResult::Type::ARR, "rotation_cycles", "the heights of the cycles whose rotation quarters are carried", |
There was a problem hiding this comment.
nit: make rotation_cycles optional; it's not appliable for non-rotation quorums
| {RPCResult::Type::NUM, "safety_commitments", "the number of retained older commitments"}, | ||
| {RPCResult::Type::ARR, "rotation_cycles", "the heights of the cycles whose rotation quarters are carried", | ||
| {{RPCResult::Type::NUM, "", "height"}}}, | ||
| {RPCResult::Type::ARR, "bootstrap_work", "the cycle heights of the bootstrap work entries", |
There was a problem hiding this comment.
why bootstrap_work is needed and why it's empty sometimes?
There was a problem hiding this comment.
I'd keep bootstrap_work always present.
rotation_cycles became optional because it doesn't apply to a type without rotation. bootstrap_work applies to every type: the unit tests have a non-rotating type carrying one entry (evo_snapshot_tests, the plain type with cycle 156). So for it, an empty list is a real answer ("no work block needs naming at this base"), not "not applicable", and omitting the field would make those two cases look the same to a caller.
If you'd rather have it omitted when empty for a tidier output, it is a three-line change in the same fixup; say so and I'll add it.
| class AssumeutxoDashTest(DashTestFramework): | ||
| def set_test_params(self): | ||
| self.set_dash_test_params(5, 4) | ||
| self.set_dash_llmq_test_params(4, 4) |
There was a problem hiding this comment.
maybe add one more node for better coverage of quorum, so, there' could be rotation quorums that is not using 100% the same nodes on each cycle.
BACKPORT NOTE: Only ca18aea "Add AutoFile::seek and tell" is ported; the other commits are the BDB wallet parser. seek() and tell() use FileSeek64() and FileTell64() instead of std::fseek() and std::ftell(), as the rest of AutoFile does in Dash, so positions past 2 GiB work on Windows. ----- d51fbab wallet, test: Be able to always swap BDB endianness (Ava Chow) 0b75315 test: Test bdb_ro dump of wallet without reset LSNs (Ava Chow) c1984f1 test: Test dumping dbs with overflow pages (Ava Chow) fd7b16e test: Test dumps of other endian BDB files (Ava Chow) 6ace3e9 bdb: Be able to make byteswapped databases (Ava Chow) d987890 Error if LSNs are not reset (Ava Chow) 4d7a3ae Berkeley RO Database fuzz test (TheCharlatan) 3568dce tests: Add BerkeleyRO to db prefix tests (Ava Chow) 70cfbfd wallettool: Optionally use BERKELEY_RO as format when dumping BDB wallets (Ava Chow) dd57713 Add MakeBerkeleyRODatabase (Ava Chow) 6e50bee Implement handling of other endianness in BerkeleyRODatabase (Ava Chow) cdd61c9 wallet: implement independent BDB deserializer in BerkeleyRODatabase (Ava Chow) ecba230 wallet: implement BerkeleyRODatabase::Backup (Ava Chow) 0c8e728 wallet: implement BerkeleyROBatch (Ava Chow) 756ff9b wallet: add dummy BerkeleyRODatabase and BerkeleyROBatch classes (Ava Chow) ca18aea Add AutoFile::seek and tell (Ava Chow) Pull request description: Split from bitcoin#26596 This PR adds `BerkeleyRODatabase` which is an independent implementation of a BDB file parser. It provides read only access to a BDB file, and can therefore be used as a read only database backend for wallets. This will be used for dumping legacy wallet records and migrating legacy wallets without the need for BDB itself. Wallettool's `dump` command is changed to use `BerkeleyRODatabase` instead of `BerkeleyDatabase` (and `CWallet` itself) to demonstrate that this parser works and to test it against the existing wallettool functional tests. ACKs for top commit: josibake: reACK bitcoin@d51fbab TheCharlatan: Re-ACK d51fbab furszy: reACK d51fbab laanwj: re-ACK d51fbab theStack: ACK d51fbab Tree-SHA512: 1e7b97edf223b2974eed2e9eac1179fc82bb6359e0a66b7d2a0c8b9fa515eae9ea036f1edf7c76cdab2e75ad994962b134b41056ccfbc33b8d54f0859e86657b
…lected minor preparatory work BACKPORT NOTE: Only b7af960 "refactor: Add AutoFile::size" and 7f318e1 "test: Add better coverage for Autofile size()" are ported, without the util/asmap.cpp and wallet/migrate.cpp hunks of the former: DecodeAsmap() does not use AutoFile::seek() here yet and Dash has no wallet/migrate.cpp. ec0f758 and 606a251 change the asmap code and its tests only. ----- 7f318e1 test: Add better coverage for Autofile size() (Fabian Jahr) b7af960 refactor: Add AutoFile::size (Fabian Jahr) ec0f758 refactor: Modernize logging in util/asmap.cpp (Fabian Jahr) 606a251 tests: add unit test vectors for asmap interpreter (Pieter Wuille) Pull request description: This contains some commits from bitcoin#28792 that can be easily reviewed and merged independently. I hope splitting this change off can make this part move a bit faster and reduce frequency of needed rebases for bitcoin#28792. The commits in order: - Add additional unit test vectors to the asmap interpreter (written by sipa). This helps to ensure that the further refactors in bitcoin#28792 don't change behavior. - Modernizes the logging in `util/asmap.cpp`, I added this while touching the rest of the file all over anyway. - Adds an `AutoFile::size` helper function with some additional test coverage in a separate commit ACKs for top commit: maflcko: review ACK 7f318e1 🏀 hodlinator: tACK 7f318e1 laanwj: Code review ACK 7f318e1 Tree-SHA512: 45156b74e4bd9278a7ec24521dfdafe4dab1ba3384243c7d589ef17e16ca374ee2af7178c86b7229e80ca262dbe78c4d456d80a6ee742ec31d2ab5243dac8b57
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Changes requested: 1 blocker
dash-chainstatefails to link whenBUILD_UTIL_CHAINSTATEis enabled —src/kernel/CMakeLists.txt:47-50(new; not shown inline, see below)
Impact: Builders who enableBUILD_UTIL_CHAINSTATE, including the wallet-disabled CI job, cannot produce thedash-chainstateexecutable.
New on this head: This restack adds the v4 Evo section to dumptxoutset, checks snapshot sections against configured pins without seeding them, and moves computed quorum-member caches into each chainstate. Lint, cppcheck, ASan, TSan, and multiprocess checks passed; the wallet-disabled build failed at link time, while the standard Linux build stopped before compilation because its dependency-cache restore timed out and no fallback artifact was available.
🔴 1 blocking | 🟡 1 suggestion(s)
1 finding(s) not shown inline (the lines are not part of this PR's diff)
🔴 Blocking: dash-chainstate fails to link when BUILD_UTIL_CHAINSTATE is enabled
Impact: Builders who enable BUILD_UTIL_CHAINSTATE, including the wallet-disabled CI job, cannot produce the dash-chainstate executable.
src/kernel/CMakeLists.txt:47-50
The wallet-disabled build configures -DBUILD_UTIL_CHAINSTATE=ON and fails while linking dash-chainstate with undefined reference to evo::GetEvoSnapshotHash(evo::EvoSnapshot const&) and undefined reference to evo::EvoSnapshot::Validate(bool) const. This PR adds both references to the kernel's validation.cpp: deserializing the section calls Validate() and checking the pin calls GetEvoSnapshotHash(). CMake links the utility against bitcoinkernel, not the full node target, so compiling src/evo/snapshot.cpp in the node target does not supply those definitions. Add the codec translation unit to the kernel source list.
Confirmed by an independent pass: When BUILD_UTIL_CHAINSTATE=ON, the dash-chainstate executable links against bitcoinkernel, whose validation.cpp now references evo::EvoSnapshot::Validate(bool) and evo::GetEvoSnapshotHash(evo::EvoSnapshot const&), but src/kernel/CMakeLists.txt does not compile evo/snapshot.cpp into bitcoinkernel. The resulting wallet-disabled build fails at link time with undefined references, so the shipped chainstate utility cannot be built.
../evo/smldiff.cpp
../evo/snapshot.cpp
../evo/specialtx.cpp
../evo/specialtx_filter.cpp
../evo/specialtxman.cpp
source: gpt-6.2-sol (phase2-reviewer: general, backport-reviewer, dash-core-commit-history)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: backport-reviewer); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.2-sol(effort low) — This is a large and intricate cross-cutting change to snapshot serialization, chainstate validation, Evo state handling, and AssumeUTXO tooling, but it does not directly modify consensus rules, funds movement, cryptography, peer-facing deserialization, or a storage migration. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - New since the last final review (
c42534b3): 1 new blocker(s) went to an independent confirmation pass (the final verifier's model in a fresh session, without its reasoning): 1 confirmed; 1 finding(s) judged fixed earlier and raised again on unchanged lines kept settled - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— backport-reviewer (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— dash-core-commit-history (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `src/kernel/CMakeLists.txt`:
- [BLOCKING] src/kernel/CMakeLists.txt:47-50: `dash-chainstate` fails to link when `BUILD_UTIL_CHAINSTATE` is enabled
Impact: Builders who enable `BUILD_UTIL_CHAINSTATE`, including the wallet-disabled CI job, cannot produce the `dash-chainstate` executable.
The [wallet-disabled build](https://github.com/dashpay/dash/actions/runs/46971078558/job/143799254093) configures `-DBUILD_UTIL_CHAINSTATE=ON` and fails while linking `dash-chainstate` with `undefined reference to evo::GetEvoSnapshotHash(evo::EvoSnapshot const&)` and `undefined reference to evo::EvoSnapshot::Validate(bool) const`. This PR adds both references to the kernel's `validation.cpp`: deserializing the section calls `Validate()` and checking the pin calls `GetEvoSnapshotHash()`. CMake links the utility against `bitcoinkernel`, not the full node target, so compiling `src/evo/snapshot.cpp` in the node target does not supply those definitions. Add the codec translation unit to the kernel source list.
_Confirmed by an independent pass: When BUILD_UTIL_CHAINSTATE=ON, the dash-chainstate executable links against bitcoinkernel, whose validation.cpp now references evo::EvoSnapshot::Validate(bool) and evo::GetEvoSnapshotHash(evo::EvoSnapshot const&), but src/kernel/CMakeLists.txt does not compile evo/snapshot.cpp into bitcoinkernel. The resulting wallet-disabled build fails at link time with undefined references, so the shipped chainstate utility cannot be built._
In `src/rpc/blockchain.cpp`:
- [SUGGESTION] src/rpc/blockchain.cpp:3322-3324: The export commit attributes loader-side preflight to code that does not run it
Impact: Readers can mistake a matching Evo pin for proof that activation ran the chain-aware preflight on this head.
`CreateUTXOSnapshot()` is the only caller of `PreflightEvoSnapshot()` on this head. `PopulateAndValidateSnapshot()` checks the framing, decodes the section, and enforces the pin, but it neither seeds the section nor runs that preflight. The rewritten export commit and PR description still say export runs checks a loading node applies, and the inline comment says load runs them against seeded state. Describe this as an export check in all three places and identify seeded load-time reuse as work in #8272. The same distinction applies to the breaking-changes note: the absence of mainnet and testnet pins limits loading, not `dumptxoutset` output on those networks.
A snapshot of a Dash chain is useless without the Evo state a chainstate needs to validate the blocks above its base. dumptxoutset builds the evo section from the dumped chainstate's own Evo state at the same cs_main-pinned point as the coins cursor, checks it against the chain, appends it after the last coin as [marker][EvoSnapshot] and reports a summary of it. A base the section cannot represent, or a section failing those checks, is an RPC error, and so is dumping while an unvalidated snapshot chainstate, which lacks the history below its base, is active. Snapshot load decodes a trailing section and requires it to end the file; a UTXO-only file still loads. The section is not used yet, so completion of a snapshot with DIP3 active at its base returns the new SnapshotCompletionResult::EVO_DATA_UNAVAILABLE: the snapshot stays in use, unvalidated, and is never promoted until the section can be compared. Validation now includes evo/snapshot, so the section codec joins the kernel library, and it adds two include cycles the circular-dependency lint lists as expected. feature_assumeutxo_dash.py dumps a rotating-quorum chain at a base before its own cycle's mining window and at the block before the next cycle, and checks the carried rotation cycles and bootstrap entries against the dependency rule, the credit-pool window length, the base coinbase, that the reported hash is the SHA256 of the section bytes in the file, and that a second node dumps the same section. Co-authored-by: Konstantin Akimov <[email protected]>
…data A snapshot chainstate at a DIP3-active base runs on the Evo state its section carries, which nothing from the file can vouch for. Such a base now requires the section and a non-null pinned evo hash that the decoded section matches, and a non-null pin requires a section. The pin comes only from chainparams or, on regtest, from the new -assumeutxodata=<height>:<hash_serialized>:<evo_hash>:<nchaintx>:<blockhash> option, which binds each entry to its base block and authorizes nothing on other networks. A pre-DIP3 UTXO-only snapshot loads as before. EvoSnapshotTestSetup is a deterministic DIP3/v20 chain with four masternodes registered with fixed keys, whose base at 219 is pinned from the state of the node that validated it. A base without an entry, a null pin, a missing section, a section differing from its pin and bytes after the section or after the coins are each refused, and the honest snapshot activates without being validated. Co-authored-by: Konstantin Akimov <[email protected]>
GetAllQuorumMembers() cached members in process-wide statics, and computing them is also what stores a rotation cycle's quarters in the EvoDB. With two chainstates, members one chainstate computed make the other skip the computation when it connects the same cycle, so it never stores those quarters and cannot compute later cycles from them. The caches now belong to each chainstate's quorum snapshot manager. Nothing computes the same cycle in two chainstates yet, so there is no test here; the first case is the seeded snapshot chainstate, which computes the members of its carried quorums before background validation connects their cycles. Co-authored-by: pasta <[email protected]>
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
New on this head: Since the previous review, the Evo snapshot export commit adds the codec to bitcoinkernel for dash-chainstate and clarifies that chain preflight runs on export, not on load. Lint, ClangFormat, Cppcheck, and several source builds passed; other builds and tests are pending. GitHub reports the cache-pruning job as failed in the checks list, but its job record shows it was canceled before any steps ran.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-astra (agent: phase2-reviewer, role: backport-reviewer); reviewer 4: gpt-6.2-astra (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.2-sol(effort low) — This is a large, intricate change to snapshot serialization and validation in src/validation.cpp and src/rpc/blockchain.cpp, affecting consensus-critical chainstate loading and storage deserialization. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
- New since the last final review (
2f7591c3): 1 finding(s) judged fixed earlier and raised again on unchanged lines kept settled - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-astra— general (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— backport-reviewer (completed, effort high); agentphase2-reviewer,gpt-6.2-astra— dash-core-commit-history (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
Issue being fixed or feature implemented
#7593 defines the v4 evo section and #8271 makes its coverage provable, but nothing writes the section, and a loading node has no way to tell whether the Evo state a file carries is the one that was reviewed. A snapshot of a Dash chain is useless without that state: a chainstate at a DIP3-active base cannot validate the blocks above it from coins alone.
AssumeUTXO stack (merge in this order): #8286, #7593 and #8271 are merged; this PR is next, then #8272 → #8078 → #8273 → #8079 → #8276. The whole stack is in #8284.
What was done?
Built on #8286, #7593 and #8271: each
Chainstateowns its Evo state, sodumptxoutsetbuilds the section from the dumped chainstate's own managers and nothing here reads through an EvoDB view.ca18aea5c4only) and partial test, refactor: Embedded ASMap [1/3]: Selected minor preparatory work bitcoin/bitcoin#33026 (b7af960eb8,7f318e1dd0):AutoFile::seek(),tell()andsize(), which the snapshot loader needs to tell whether anything follows the coins.seek()andtell()useFileSeek64()/FileTell64()like the rest ofAutoFilein Dash. Not ported: the BDB wallet parser of wallet: Implement independent BDB parser bitcoin/bitcoin#26606, and the asmap andwallet/migrate.cppparts of test, refactor: Embedded ASMap [1/3]: Selected minor preparatory work bitcoin/bitcoin#33026.dumptxoutsetbuilds the section at the samecs_main-pinned point as the coins cursor, checks it against the chain (PreflightEvoSnapshot(); load does not run this check until feat: seed the evo snapshot section safely and rebuild it at completion #8272 seeds the section), appends it after the last coin as[marker][EvoSnapshot]and reports a summary of it in a newevoobject.EnsureEvoHistoryAvailable()).evo::EvoSnapshotFileReader, which reports the bytes left in the file: the section's bit-set decoders bound declared sizes by that (SizedStream), and upstream'sAutoFile::size()is the size of the whole file. A UTXO-only file still loads.SnapshotCompletionResult::EVO_DATA_UNAVAILABLE: nothing compares the section yet, so the snapshot stays in use, unvalidated, and is never promoted. Startup treats that result like a skipped completion.-assumeutxodata=<height>:<hash_serialized>:<evo_hash>:<nchaintx>:<blockhash>. Each such entry is bound to its base block, and the option authorizes nothing on other networks.GetAllQuorumMembers()cached members in process-wide statics, and computing them is also what stores a rotation cycle's quarters in the EvoDB. Members one chainstate computed made the other skip the computation, and with it the write. The caches now belong to each chainstate'sCQuorumSnapshotManager.Not a complete lifecycle on its own. The decoded section is checked against its pin and then dropped; #8272 seeds it into the snapshot chainstate and compares it at completion, and until then a DIP3-active snapshot is never validated. Only C++ tests can activate a snapshot at this layer:
loadtxoutsetarrives later in the stack.Two new include cycles.
validationnow includesevo/snapshotto decode the section, which adds two expected entries tolint-circular-dependencies.py:evo/creditpool -> validation -> evo/snapshot -> evo/creditpoolandevo/snapshot -> llmq/commitment -> validation -> evo/snapshot. The only new edge isvalidation -> evo/snapshot; the other two are old.evo/creditpoolandllmq/commitmentincludevalidation.honly to reach consensus params, the block manager and the notifications through aChainstateManager, plus one V24 deployment check increditpoolthat needs its versionbits cache. Plan: pass those pieces in directly,llmq/commitmentfirst, as a separate refactoring PR; the V24 check goes away when V24 is buried. That removes these two cycles together with the existing ones through the same two edges.What to focus on: the pin rules in
PopulateAndValidateSnapshot()and the format of-assumeutxodata.How Has This Been Tested?
feature_assumeutxo_dash.py(new) dumps a rotating-quorum chain at a base before its own cycle's mining window and at the block before the next cycle. It checks the carried rotation cycles and bootstrap work entries against the dependency rule, the credit-pool window length, the base coinbase, that the reported hash is the SHA256 of the section bytes in the file, and that a second node at the same tip dumps the same section.validation_chainstatemanager_tests:chainstatemanager_evo_snapshot_requires_its_pin(new, on the newEvoSnapshotTestSetup, a deterministic DIP3/v20 chain with four masternodes) refuses a base without an entry, a null pin, a pin bound to another block, a missing section, a section differing from its pin, a byte after the section and a partial marker after the coins, each checked by its log message; the honest snapshot activates and, with background validation already at the base, is not validated (EVO_DATA_UNAVAILABLE).validation_tests:assumeutxodata_option(new) checks a parsed entry, that the built-in entries stay, that the option authorizes nothing on mainnet and testnet, and seven malformed or duplicate values.streams_tests: the upstreamAutoFile::size()checks inxor_fileand the casesize_preserves_positioncome with the backport.rpc_dumptxoutset.pyfollows the new file hash and checks theevosummary of a pre-DIP3 dump.The per-chainstate member caches have no test of their own here: two chainstates computing the same cycle are first reachable in #8272.
Breaking Changes
The file
dumptxoutsetwrites now ends with the evo section, and its result has a newevoobject. No such file can be loaded on mainnet or testnet: no network pins an evo hash until #8276.Checklist: