Conversation
CI Summary
Format - Failed0 files need formatting Release - PassedTest this PR Download artifact (GitHub CLI required): gh run download 24507419192 -n cli-release-0.0.0-pr.95 -R paritytech/dotns-sdkInstall globally: npm install -g ./parity-dotns-cli-0.0.0-pr.95.tgzVerify: dotns --helpDeploy Example — Passed
Labelspkg: cli, scope: bulletin, type: test Test - Passed140 passed, 0 failed across 140 tests. |
When a chunk's signSubmitAndWatch subscription times out, the uploader fetches a fresh nonce and resubmits the same chunk. The abandoned transaction is often still included on chain (the nonce advances), so each retry stores a duplicate 2 MiB chunk and adds another transaction to the pool. Under contention this creates a feedback loop: duplicate txs inflate the pool, the collator's txpool readiness timeout fires, blocks are produced without the pending chunk, and the client retries again — we observed a single chunk stored 6 times in one CI run, wasting ~36 s of block capacity and driving the pool to 70 txs. Fix: (1) add a nonce-advance fallback to storeContentOnBulletin — on timeout, check system_accountNextIndex via a fresh WS; if the nonce advanced past the submitted one, the tx was included, resolve as success. (2) track assigned nonces across waves in a persistent map so re-queued chunks keep their original nonce instead of allocating a new one. (3) on wave failure, check each chunk's nonce against the current account nonce before re-queuing — chunks whose nonces were consumed are marked complete rather than resubmitted.
The nonce-advance fallback can falsely mark a chunk as completed if another process consumed the nonce (concurrent uploader on the same account, or a dispatch error that consumed the nonce without storing). When a store call resolves via the nonce-advance fallback (storedIndex and blockHash both undefined), immediately verify the CID resolves via the IPFS gateway (2 attempts, 3s apart). If it doesn't resolve, throw so the chunk is retried. Chunks confirmed via the normal subscription path are trusted and skip verification. Also adds nonceHopping.test.ts demonstrating old vs new nonce behavior.
9a6e76e to
663093a
Compare
|
Concurrent 16 MB chunked upload on Key metrics
Tx pool depth during uploadWithout fix (Apr 15, 16:39–16:53 UTC)16:39 ██ 2 (baseline) With fix (Apr 16, 11:05–11:13 UTC)11:05 ░ 0 (baseline) Extrinsics per proposed blockWithout fix — alternating full/empty patternBlock 1046726 ████████████ 12 (11ms) full With fix — steady 2–4 extrinsics, no timeoutsBlock 1056849 ███ 3 (66ms) Root cause and fixProblem: When a chunk's Fix (two parts):
CI run references
|
Description
Type
Package
@parity/dotns-cliRelated Issues
Fixes
Checklist
Code
bun run lintpassesbun run formatpassesbun run typecheckpassesDocumentation
Breaking Changes
Breaking changes:
Testing
How to test:
Notes