Repository navigation
fix(node)!: a per-chain redeem floor and a final-claim sweep - #3033
Open
alpergundogdu wants to merge 2 commits into
Open
alpergundogdu wants to merge 2 commits into
alpergundogdu wants to merge 2 commits into
Conversation
The redeemer's floor is the gas of a redeemMany, priced at the payment chain's live gas price (plus the Arbitrum L1 data fee from ArbGasInfo) and the per-chain `gas_token_price_micro_usdc`. `redeem_threshold_micro_usdc` is removed. A chunk redeems at 20x its gas; a final claim (capability inside the expiry margin) redeems at 3x one claim's gas, batched or alone. A lane that expires below that floor adds to its pool's stranded value, and a pool with more than one floor stranded admits no new signer. The admin lanes API drops `settlement_eligible` and `redeem_threshold_micro_usdc`. Closes #2836 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Code coverage overviewLanguages: Rust Rust / code-coverage/cargo-llvm-cov
View coverage of the 10 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
The 1 µUSDC e2e floor lets each hint redeem, so the settlement ledger can hold more than two rows. Assert chain order and that the first two rows are the first two redeems. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
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.
Closes #2836
A pool owner could sign capabilities with a cap just under the fixed 0.05 USDC redeem threshold, take that much from each node, and let each capability expire: the node never redeemed the vouchers. This PR makes the floor a gas cost the node reads at redeem time, redeems final claims as soon as they pay their own gas, and caps what one pool can strand on a node.
What changes
1. Gas-priced floor per payment chain (
crates/node/src/redeem_floor.rs)redeemManygas × liveeth_gasPrice(+ Arbitrum L1 data fee from theArbGasInfoprecompile, 0 when the precompile has no code) ×blockchain.payment_chains[].gas_token_price_micro_usdc.contracts/test/PaymentPool.t.sol(759,105 − 695,329 = 63,776), plus 544 calldata bytes priced at 16 gas/byte. Fixed tx gas is 78,569 (the N-voucher benchmark less ten claims, plus 21,000 intrinsic).redeemManywith that many claims (gas ≤ 5% of what it redeems). Final-claim floor: 3× one claim's gas (one claim plus a whole transaction's fixed gas cost less than three claims, so a lone final claim pays for its transaction).blockchain.redeem_threshold_micro_usdcis removed. The price knob defaults to 5,000 USDC/ETH and rejects 0.2. Final-claim sweep
final_claim. At the existing cutoff wake it redeems once it clears the final-claim floor, batched with other claims or alone. A final claim below that floor is never submitted.3. Per-pool stranded-value cap
PoolProjection.InsufficientDeposit(wireUnfunded, proven requester). Lanes the node already holds keep service. No on-chain mechanism.Other surfaces
admin_v1_lanes: dropssettlement_eligibleandredeem_threshold_micro_usdc(the floor is now dynamic and per chain). CLIdecdn node lanes, the dashboard and fixtures follow.gas_token_price_micro_usdc = 1instead of the threshold.Tests
a_sub_floor_lane_is_redeemed_at_its_serve_cutoff_when_its_final_claim_clearsan_expired_sub_floor_lane_strands_its_value_on_its_poola_pool_over_its_stranded_cap_refuses_a_new_signerthe_floor_follows_the_gas_price, plus L1-fee, rounding, quote-cache and fallback tests inredeem_floor/tests.rsRan:
cargo nextest run -p decdn-node -p decdn-common -p decdn-cli(onlynode_origin_pulltiming flakes, which pass on retry and don't touch the redeemer),cargo clippy --workspace --all-targets --all-features,cargo test --no-run -p decdn-e2e --features anvil-e2e,CARGO_BUILD_WARNINGS=deny cargo doc --workspace --no-deps --document-private-items, dashboard build/test/lint.Review notes
🤖 Generated with Claude Code