Repository navigation
test(core): e2e finalize-resume round-trip after a post-payment outage (#144) - #226
Merged
Merged
Conversation
Nic-dorman
force-pushed
the
test/finalize-resume-round-trip
branch
from
October 23, 2026 10:13
55092e8 to
323f523
Compare
#144) Nothing on main exercised #172's resumable external-signer finalize against a live network: no e2e test called finalize_upload_resumable, finalize_upload_merkle_multi_resumable or finalize_resume, so only the assemble_* unit tests covered the retain/hand-off contract. The harness's PointerSilence becomes Silence { pointer_gets, pointer_puts, chunk_puts }, with MiniTestnet::silence_chunk_puts. A silenced node stays in the network but reads chunk PUTs off the wire and drops them; lifting the silence brings every node back with the same PeerId and address, which paid wave chunks need (each is bound to the peers that quoted it) and a restart would not give. Two tests, wave-batch in e2e_file and merkle multi-batch in e2e_merkle, each pay as an external signer, silence chunk PUTs, assert the finalize comes back Partial with nothing stored, lift the silence, resume (bounded to three attempts), and assert Complete, an unchanged token balance (no second payment), and a byte-exact download through the public DataMap address. The merkle test lowers merkle_store_timeout_secs to 2 s for the outage only: at the 270 s default the doomed finalize alone took 92 minutes. The wave path's PUT timeout is the fixed 10 s STORE_RESPONSE_TIMEOUT, so its outage phase takes about 90 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nic-dorman
force-pushed
the
test/finalize-resume-round-trip
branch
from
October 23, 2026 18:52
323f523 to
56cc7c4
Compare
MaidSafe-Hermes
approved these changes
Oct 27, 2026
MaidSafe-Hermes
left a comment
There was a problem hiding this comment.
APPROVE
Reviewed head 56cc7c4eb04ccad205bf8e16cd930428cde62ec3 against base ccd4106dd8fd60545bbd31c40d46cc041f85fb8d. No actionable defects found. The request filter drops chunk PUTs before handling; the tests verify partial finalize, resume against the original payment, unchanged token balance, and byte-exact download.
2/2 seats reviewed (sol-1 gpt-6.1-sol xhigh; glm-1 z-ai/glm-5.3); both seats agree (two model families). All 18 CI checks passed for this head. git diff --check passed.
Non-blocking clarity note: the wave test says “a fresh retriever” but reuses its client. The address-based fetch still exercises the network chunk-get path, but not a separately created client.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #144.
Before this PR, nothing on
mainexercised #172's resumable external-signer finalize against a live network: no e2e test calledfinalize_upload_resumable,finalize_upload_merkle_multi_resumableorfinalize_resume(the Tier 1 test #144 cites belonged to #143, which #172 replaced). Only the pureassemble_*unit tests covered the retain/hand-off contract.Approach: a reversible outage, not node restarts
#144 listed three ways to get "fails after payment, then recovers": restart nodes in
MiniTestnet, add per-node stop/start toLocalDevnet(ant-node 0.21'sDevnethas neither), or a reversible network block. It called the last one least flaky, but Linux-only via iptables.The harness already had the mechanism:
PointerSilencemakes a node read and drop pointer requests while staying in the network. This generalizes it toSilence { pointer_gets, pointer_puts, chunk_puts }and addsMiniTestnet::silence_chunk_puts(bool).e2e_pointer.rschanges only for the rename (pointer_silence.gets→silence.pointer_gets, etc.).Tests
Both run in the existing CI jobs (
e2e_filein E2E Tests,e2e_merklein Merkle E2E). Each one:STORE_RESPONSE_TIMEOUT, which adds up to about 90s.merkle_store_timeout_secs. The test lowers it from 270s to 2s for the outage only. At 270s this phase alone took 92 minutes.FinalizeOutcome::Partialwith 0 stored, all failed, and thedata_map_addresscarried through.finalize_resumein a loop bounded to 3 attempts, as the API documents. AssertsCompletewith everything stored and the samedata_map_address.data_map_fetch(public address)→file_downloadand checks the bytes equal the original.e2e_file::test_finalize_resume_after_post_payment_outage_wave_batch: wave-batch, 4 KB file, the default 14-node testnet.e2e_merkle::test_external_merkle_finalize_resume_after_post_payment_outage: merkle multi-batch (cap 3, so ≥2 sub-batches), 500 KB, 35 nodes.Linear issue
Closes V2-1519
Risk tier
Test-only: harness and e2e tests, no library code.
Compatibility
Semver impact
Test evidence
Rebased 2026-10-23 onto
mainat50bc653(0.3.12 promoted).tests/support/mod.rsconflicted with #218'sChunkGetCountsand sentinel-barrier changes, which also thread throughspawn_node. The resolution keeps both sides:main'schunk_getsplumbing, plus this PR'sPointerSilence→Silencegeneralisation withchunk_putsandsilence_chunk_puts(). This PR's added and removed lines are otherwise identical to before the rebase. Re-run on Linux (dev2, stable):cargo fmt --all -- --checkandcargo clippy --all-targets --all-features -- -D warnings: pass.test_finalize_resume_after_post_payment_outage_wave_batch: passed (144 s).test_external_merkle_finalize_resume_after_post_payment_outage: passed (593 s).e2e_pointer, which exercises the renamed silence switches: 17 passed.Original evidence follows.
Local runs on Windows 11, against the in-process
MiniTestnetand Anvil:e2e_file::test_finalize_resume_after_post_payment_outage_wave_batch: passed in 159s. The finalize during the outage returnedPartialafter 91s, and the resume completed on its first attempt.e2e_merkle::test_external_merkle_finalize_resume_after_post_payment_outage: passed in 596s. The outage finalize returned after 140s (5505s before the test loweredmerkle_store_timeout_secs), and the resume completed on its first attempt.e2e_pointer, all 14 tests: passed after theSilencerename. CI doesn't run this file.cargo fmt --all -- --check: clean.cargo clippy --all-targets --all-features -- -D warnings: didn't finish locally because the machine ran short of memory. CI's Clippy job is the lint check here.CI runs both new tests on ubuntu-latest and macos-latest (E2E Tests, Merkle E2E). Merkle E2E has a 90-minute limit and has recently taken 48–54 minutes; this test adds about 10.
New dependency
none
ADR
n/a
Mitigation / rollback
Revert the commit. It only touches
ant-core/tests/.🤖 Generated with Claude Code