Repository navigation
test(e2e): cover the PaymentPool redeploy collision against two live deployments - #2182
Merged
Merged
Conversation
…deployments (#2088) Pool ids carry no contract address, so a node's first pool on a redeployed PaymentPool has the same id as its first pool on the old one. Pin the buyer-side guard against two real deployments: a node repointed at an empty redeploy drops its stale row (logged naming the old deployment as foreign_payment_pool), opens nothing at boot, and opens fresh on its first miss; a node whose key already owns the reissued id on the redeploy adopts it with the new deposit and no lanes, and pays the redeploy only for the bytes it delivers. Fixture support: ChainFixture::redeploy_payment_pool deploys a second PaymentPool behind a fresh FeeRouter (the snapshot router's role table is frozen); NodeFixture gains a PaymentPool override at launch, repoint_payment_pool, stop, and a daemon log tee with log_line / wait_for_log_line; ClientFixture can pay through a chosen PaymentPool. The redeploy leg is served by a fresh seeder: the seller-side lane store has the same collision, tracked in #2181. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Code Coverage OverviewLanguages: Rust Rust / code-coverage/cargo-llvm-covThe overall line coverage in commit 0f4b520 in the Show a line coverage summary of the most impacted files.
Updated |
…s, fixture hardening - The leg-2 lane pays SEEDER #2, not SEEDER #1, so it cannot show a #1 cumulative carried over; say what it proves (the repointed node buys and settles on #2 at the leg-2 price) and let the store assertions carry the guard. - Wait for the buyer bootstrap (decdn_buyer_wallet_usdc) after every restart before reading boot state, so the negative checks cannot pass on a bootstrap that has not run. - Propagate admin RPC and address-parse errors from polls; wait on metered bytes / watermark >= expected before asserting the exact figure; price with rate::min_payment. - redeploy_payment_pool copies the snapshot pool's and router's parameters at runtime and reads the new pool's wiring back. - NodeFixture: stop() propagates a failed kill; the log tee records a capture failure and ends a cut-off line; strip_ansi drops a lone ESC alone; wait_for_log_line timeouts carry the log tail. - Doc fixes: timelock role, HEAVY tier list, client approval. Co-Authored-By: Claude Opus 5.5 <[email protected]>
thiras
approved these changes
Sep 27, 2026
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.
Refs #2088. It stays open until #2181 lands: the seller-side lane store has the same redeploy collision, so this PR covers the buyer side only.
What
New anvil e2e
crates/e2e/tests/node_pull_pool_redeploy.rs. It deploys a secondPaymentPoolbeside the snapshot's and repoints a pull-through node at it.poolId = keccak256(owner, ownerPoolNonce), so the node's first pool on deployment 2 has the same id as its tracked pool on deployment 1.pool_id,foreign_payment_pool=#1andconfigured_payment_pool=#2on one line.ownerPoolNonce/getPoolson deployment 2 are empty.Fixture changes (
crates/e2e)ChainFixture::redeploy_payment_pool.FeeRouterandPaymentPoolfrom their forge artifacts. Their parameters are read at runtime from the snapshot pool (dispute window, delivery floor, min deposit) and the snapshot router (window, shares).ROUTER_CALLER_ROLE, then reads back the new pool's USDC, router and bond wiring.DEFAULT_ADMIN_ROLEon the snapshot router, which pinsROUTER_CALLER_ROLEto the snapshot pool.NodeFixture.launch_with_blobs_on_payment_pool,repoint_payment_pool(rewrites the pool address and discovery peers, then restarts; the data dir stays), andstop.log_line/wait_for_log_line.strip_ansi, needle matching and the tee.ClientFixture::new_on_payment_pool: the client approves, opens and signs against a chosen deployment.Reviewer notes
lane_state_v1, keyedpool_id‖signer‖provider) has the same collision. A repointed seeder rejects the buyer's first deployment 2 voucher against its deployment 1 frontier, and the pull dies asOurDeadLane.restart()returns on admin health, but the buyer bootstrap runs later on its own task. The test waits fordecdn_buyer_wallet_usdc, which is published last and per process, before reading boot state. That keeps the negative checks from passing on a bootstrap that has not yet run.bao_encoded_sizeplusrate::min_payment(content plus proof, per ADR 038).BuyerPoolState::is_onstubbed to always returntrue, both tests fail. With the log assertion also bypassed, both still fail on the store/adoption assertions.node_pull_pool_adopt.rstemplate. The contract, the admin API and every other journey call it a "provider". The rename across all three node-to-node pull journeys is tracked in test(e2e): rename "seeder" to "provider" in the node-to-node pull journeys #2184, so this PR does not touch the two older files.Verification
cargo nextest run -p decdn-e2e --features anvil-e2e --test-threads 2: 76/76 pass, including the whole existing suite on the piped-stdio fixture.cargo clippy --workspace --all-targets -- -D warnings, plus the feature-gated-p decdn-e2e --features anvil-e2e: clean.RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --document-private-items: clean.cargo fmt -- --check: clean.🤖 Generated with Claude Code