fix(fullnode): avoid rewriting pending proofs on retry#3176
fix(fullnode): avoid rewriting pending proofs on retry#3176tonykim525 wants to merge 8 commits intochainwayxyz:nightlyfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
|
test(sov-db): make pending proof repro test clippy-compliant - 0d950d3 Only Commands run:
|
|
Hey @tonykim525, |
jfldde
left a comment
There was a problem hiding this comment.
Great PR. Removed the Fixes #3168 as this doesn't directly address it.
|
Sorry — I moved the changelog entry before merging nightly. I’ve now resolved the changelog conflict and placed it under Unreleased as requested. Removed the pending-proof disk-usage repro test, moved the changelog entry under Validated with:
Both passed. |



Description
This PR fixes unnecessary disk-write amplification in the PendingProof retry flow.
When a proof remains pending, retry processing could re-store the same pending proof every L1 cycle. This increases write pressure/disk usage without changing logical state.
This PR includes:
sov-db)da_block_handler.rs)Implementation summary:
ProofSource(FromL1,FromPendingRetry).FromL1; pending-table retries useFromPendingRetry.store_pending_proof(...)now runs only forFromL1.Logical semantics are preserved: while a proof is still pending, its existing PendingProof entry is kept without rewrite across retry cycles.
Testing
Targeted reproduction:
cargo test -p sov-db --features "sov-schema-db/test-utils" test_pending_proofs_current_flow_rewrite_increases_disk_usage -- --nocaptureObserved:
current_rewrites=40,fixed_rewrites=0current_pre_flush_db_bytes=2981196,fixed_pre_flush_db_bytes=357396current_post_flush_db_bytes=428461,fixed_post_flush_db_bytes=362817current_live_bytes=66616,fixed_live_bytes=66616current_total_sst_bytes=66616,fixed_total_sst_bytes=666161 passed; 0 failed; 7 filtered out(targeted test-name filter)Interpretation:
Full sov-db package test run:
cargo test -p sov-db --features "sov-schema-db/test-utils" -- --nocapture8 passed; 0 failed(doc-tests:0 passed; 0 failed; 2 ignored)Additional validation:
rustfmt +nightly --check crates/fullnode/src/da_block_handler.rscargo check -p citrea-fullnode(passed)cargo test -p citrea-fullnode --no-run(passed)cargo test -p citrea --features testing --test bitcoin_e2e --no-run(passed)Docs
No public API/interface changes.
No docs update required.