Skip to content

Preserve snapshot chunk retry budget - #2437

Open
a-shannon wants to merge 1 commit into
ergoplatform:masterfrom
a-shannon:fix/snapshot-chunk-retry-budget
Open

Preserve snapshot chunk retry budget#2437
a-shannon wants to merge 1 commit into
ergoplatform:masterfrom
a-shannon:fix/snapshot-chunk-retry-budget

Conversation

@a-shannon

Copy link
Copy Markdown
Contributor

Summary

  • Preserve the accumulated delivery-check count when a timed-out UTXO snapshot chunk is requested from a replacement peer.
  • Allow the configured maxDeliveryChecks budget to terminate repeated chunk retries.
  • Add an actor-level regression test using a real chunk from a snapshot manifest, with assertions for the request type, chunk ID, peer, and updated count.

Root cause

checkDelivery incremented the stored attempt count, but requestUtxoSetChunk recreated the DeliveryTracker entry without passing that count. The default value of zero replaced the previous state on every retry, so the configured maximum could never be reached for snapshot chunks.

Impact

When UTXO snapshot bootstrap is enabled, an unavailable or non-delivering chunk could be requested repeatedly instead of exhausting the configured retry budget. This could prolong or stall that bootstrap mode while producing repeated peer penalties, timers, logs, and network traffic.

This change does not affect consensus rules, transaction validity, serialization, or default configuration.

Scope

The change enforces the existing retry budget. It does not alter snapshot-plan recovery after the budget is exhausted.

This is independent of #2434, which corrects the request type used for snapshot manifest retries. The source changes are adjacent, so this branch may need a small rebase if #2434 merges first.

Validation

  • Regression witness on unpatched master: expected count 99, observed 0.
  • sbt "testOnly org.ergoplatform.network.ErgoNodeViewSynchronizerSpecification" (26 tests)
  • sbt "testOnly scorex.core.network.DeliveryTrackerSpec org.ergoplatform.nodeView.history.UtxoSetSnapshotProcessorSpecification org.ergoplatform.network.RequestModifiersSpecification" (4 tests)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants