Skip to content

fix(node): pin the deployment preflight ahead of the lane store, and identify the PaymentPool by getRateBounds() - #2280

Merged
thiras merged 10 commits into
mainfrom
fix/2234-preflight-store-e2e
Oct 5, 2026
Merged

thiras merged 10 commits into
mainfrom
fix/2234-preflight-store-e2e

Conversation

@yigitdot

@yigitdot yigitdot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • New anvil journey deployment_preflight_guard: a node with a live seller lane is repointed at a codeless address, then at every other contract in the deploy manifest plus the settlement USDC. The list is read from the manifest itself (ChainFixture::manifest_contracts), not hand-written, so a new contract joins the sweep without an edit; today that is 12 contracts, including Ed25519Verifier. A contract the e2e deploy leaves undeployed (the dormant BuybackBurner, live on Arbitrum Sepolia) is covered by the selector check payment_pool_probe_selector, which scans every contract in contracts/src. Each boot exits nonzero with the matching, unretried preflight verdict, and no boot logs either seller-lane drop WARN. Reverting the config restarts it on the original deployment, where the same pool session pays for another blob and redeems past its earlier watermark.
  • This pins the ordering the preflight docs promise — check_deployment_preflight runs before PersistentPoolStateStore::open, so a typo'd address cannot drop unredeemed lane state. The verdicts were unit-tested against a mocked provider (fix(node): bind the seller store to its PaymentPool deployment #2191); only an e2e catches a reorder.
  • Fix: the preflight's contract-identity probe was usdc(), which FeeRouter and BuybackBurner also answer; a node pointed at either passed the preflight, opened the store against it, and dropped its seller lanes (the journey reproduced it: forfeited_micro_usdc=20). The probe is now PaymentPool.getRateBounds(), which only PaymentPool declares — feeRouter() would not do, DecdnGovernor answers it too. No redeploy: the getter and its binding already exist. PaymentPool.getRateBounds() and the check_deployment_preflight doc both warn that the view is the node's identity probe, so no other contract in the deployment may declare its selector (a NatSpec-only contract change; the gas snapshot is unchanged). The unit test now covers the code-3 revert a real node answers as well as empty return data. Runbook and CHANGELOG follow.
  • NodeFixture gains set_payment_pool_address (config-only rewrite) and respawn_expecting_exit (respawn without the health wait, return the exit status after the log drains). restart, terminate and respawn_expecting_exit share respawn_child / wait_for_exit: kill/reap errors propagate, and a timeout drains the log before reporting its tail. rewrite_payment_pool reuses the new address rewrite. Both lane-drop WARN needles are shared from decdn_e2e::node, so node_pull_pool_redeploy and this journey match the same text.

Test plan

  • cargo nextest run -p decdn-e2e --features anvil-e2e --test deployment_preflight_guard (~6 s)
  • Fails with the probe set back to feeRouter() ("the DecdnGovernor boot never logged the unretried getRateBounds() verdict"), and with the preflight moved after the store open (scratch checks, not committed)
  • cargo nextest run -p decdn-e2e --features anvil-e2e --test payment_pool_probe_selector (~1 s, no chain): no contract in contracts/src other than PaymentPool exposes the getRateBounds() selector, compared by 4-byte selector from forge methodIdentifiers. Fails as expected with the probe set to feeRouter() (DecdnGovernor) or usdc() (FeeRouter, BuybackBurner, BuybackBurnerUniswapV3, GuardedBuybackBurner) (scratch checks, not committed)
  • cargo nextest run -p decdn-node preflight (9 tests)
  • --test node_pull_pool_redeploy, --test anvil_pool_redeem, --test node_to_node_coalesce (uses terminate) still pass; cargo nextest run -p decdn-e2e --lib incl. the new rewrite_payment_pool_address unit test
  • Contracts: forge fmt --check, FOUNDRY_PROFILE=ci forge build --sizes --deny warnings, forge test, deterministic gas snapshot unchanged, aderyn (0 high), slither (exit 0)
  • cargo clippy --workspace --all-targets -- -D warnings, cargo clippy -p decdn-e2e --all-targets --features anvil-e2e -- -D warnings, cargo fmt -- --check, cargo doc with -D warnings

Closes #2234
Closes #2279

🤖 Generated with Claude Code

…tore is touched

New anvil journey deployment_preflight_guard: a node with a live seller
lane is repointed at a codeless address, then at the snapshot TOKEN.
Each boot exits nonzero with the matching preflight verdict and never
logs the seller-lane rebind drop. With the config reverted, the same
lane serves another blob and redeems past its earlier watermark.

NodeFixture gains set_payment_pool_address and respawn_expecting_exit;
rewrite_payment_pool reuses the new rewrite_payment_pool_address.

Closes #2234

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 1, 2026 21:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-code-quality

github-code-quality Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Code Coverage Overview

Languages: Rust, Solidity

Rust / code-coverage/cargo-llvm-cov

The overall line coverage in commit 2c2e6ac in the fix/2234-preflight-s... branch remains at 87%, unchanged from commit 7f938e6 in the main branch.

Show a line coverage summary of the most impacted files.
File main 7f938e6 fix/2234-preflight-s... 2c2e6ac +/-
crates/cache/src/engine.rs 95% 94% -1%
crates/node/src/runtime/mod.rs 52% 52% 0%
crates/node/src/dht/publish.rs 92% 92% 0%
crates/client/src/lib.rs 92% 92% 0%
crates/cli/src/.../bundle_pull.rs 80% 80% 0%
crates/client/s...c/connection.rs 97% 97% 0%
crates/protocol/src/framing.rs 97% 97% 0%
crates/e2e/src/chain.rs 13% 14% +1%
crates/e2e/src/node.rs 39% 40% +1%
crates/incentiv...eth_identity.rs 98% 99% +1%

Solidity / code-coverage/forge

The overall line coverage in commit 2c2e6ac in the fix/2234-preflight-s... branch remains at 92%, unchanged from commit 7f938e6 in the main branch.


Updated October 03, 2026 05:04 UTC

…preflight

FeeRouter and BuybackBurner also answer usdc(), so a node pointed at
either passed the preflight, opened the lane store against it and
dropped its seller lane state. feeRouter() is a PaymentPool immutable
no sibling contract has. The deployment_preflight_guard journey now
covers the FeeRouter alongside the TOKEN.

Closes #2279

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@yigitdot yigitdot changed the title test(e2e): pin that the deployment preflight aborts before the lane store is touched fix(node): pin the deployment preflight ahead of the lane store, and identify the PaymentPool by feeRouter() Oct 1, 2026
…ibling in e2e

DecdnGovernor also answers feeRouter(), so the previous probe still let
a Governor address open the lane store and drop the seller lanes.
getRateBounds() is declared only by PaymentPool. The preflight unit test
now covers the code-3 revert a real node answers as well as empty data.

deployment_preflight_guard boots the node against every non-PaymentPool
contract in the manifest and requires the unretried verdict for each.
Both lane-drop WARN needles are shared from decdn_e2e::node. NodeFixture
factors respawn_child and wait_for_exit out of restart, terminate and
respawn_expecting_exit; kill/reap errors propagate, and a timeout drains
the log before reporting its tail.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@yigitdot yigitdot changed the title fix(node): pin the deployment preflight ahead of the lane store, and identify the PaymentPool by feeRouter() fix(node): pin the deployment preflight ahead of the lane store, and identify the PaymentPool by getRateBounds() Oct 1, 2026
…e identity probe

PaymentPool.getRateBounds() and check_deployment_preflight both say the
view is the node's PaymentPool identity probe, so no other contract in
the deployment may declare its selector.

ChainFixture exposes every deploy-manifest contract entry, and
deployment_preflight_guard sweeps that list (plus the settlement USDC)
instead of a hand-written one, so a new contract is covered without an
edit. The sweep now includes Ed25519Verifier, which the hand list missed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

Gas snapshot

No gas changes vs base.

yigitdot and others added 3 commits October 2, 2026 05:00
…t probe selector

payment_pool_probe_selector reads the methodIdentifiers forge build
records for every contract compiled from contracts/src and fails if any
contract other than PaymentPool exposes the getRateBounds() selector.
It compares 4-byte selectors taken from the node's own PaymentPool
binding, so it covers contracts the e2e deploy leaves undeployed (the
dormant BuybackBurner, which is live on Arbitrum Sepolia) and a
differently named function that collides with the selector.

ChainFixture gains build_contracts, which runs forge build and returns
the contracts directory.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@yigitdot
yigitdot requested a review from alpergundogdu October 2, 2026 06:40
@thiras
thiras merged commit b37bbc4 into main Oct 5, 2026
28 checks passed
@thiras
thiras deleted the fix/2234-preflight-store-e2e branch October 5, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants