Repository navigation
Closed
Description
Context
Split out from #327 (PR #743). The seller-side on-chain PaymentChannel settlement path is implemented and statically verified (build, clippy -D warnings, 1264 unit/integration tests, cargo deny, and bindings cross-checked against the compiled ABI). What's not covered is a live end-to-end run against a chain — there is no existing anvil/forge integration harness for the Rust node (no alloy node-bindings dev-dep, no anvil test infra).
Two runtime-only behaviors remain unverified by the static checks:
- On-chain acceptance of the normalized voucher signature
v-byte (normalize_voucher_signaturemaps 0/1 → 27/28 forECDSA.recover). - Live event decode at runtime (
ChannelOpened/ChannelSettled/ChannelCloseInitiated) — the ABI cross-check substitutes for the layout but doesn't exercise the actual subscription/decode path.
Scope
Stand up an anvil-backed e2e (gated/ignored or behind a feature so default CI stays fast):
- Deploy
CapacityBond+PaymentChannel+FeeRouterto a local anvil via the Foundry deploy scripts (script/DeployProtocol.s.sol/BaseProtocolDeploy.s.sol), wiring the USDC + roles. - Bring up a
decdn-nodepointed at the anvil RPC with a real keystore/identity and the resolvedblockchainconfig. - From a test client:
openChannelagainst the node → assert the node persists the channel and now accepts a voucher (closes the prior WrongChannel path). - Push vouchers past
redeem_threshold_micro_usdc→ assert an on-chainwithdrawlands andgetChannel().withdrawnAmountadvances. - Trigger graceful shutdown with an un-redeemed claim → assert
closeChannelfires;settleChannelafter the dispute window → assertChannelSettledis observed andstore.forgetdrops the row. - Confirm
FeeRouter.bytesPerEpochincrements (settlement routed correctly).
Notes
anvil/forgeare available locally; CI would need them provisioned for the gated job.- This is the verification gap explicitly called out in PR feat(node): on-chain PaymentChannel seller settlement + CapacityBond rename (#327) #743.
Reacted by github-actions
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
None yet
Activity
github-actions commentedon May 31, 2026
🎯 Triage report
This issue tracks standing up an anvil-backed end-to-end test harness for the
PaymentChannelRust settlement path, split out from #327 (PR #743). The static verification is complete (1264 tests, ABI cross-check); what remains are two runtime-only gaps: v-byte normalization acceptance by the on-chainECDSA.recoverand live event subscription/decode. The scope is well-defined with a concrete step-by-step checklist and explicit gating strategy for CI.📊 Assessment
testing,rust,technical,highincentive/nodecrates🔗 Similar issues
💡 Notes and suggestions
Key verification gaps to close:
v-byte normalization (
normalize_voucher_signature0/1 → 27/28): write a forge test first to confirm the SolidityECDSA.recoveraccepts both raw and normalized forms, then mirror in the Rust e2e withalloy'sLocalSigner.Live event subscription/decode: the
ChannelOpened/ChannelSettled/ChannelCloseInitiatedsubscriptions should be tested against a real anvil log stream — static ABI layout checks don't cover thealloyeth_subscribe/getLogsdecode path.Suggested implementation approach:
tokio::process::Commandto spawnanvil --silentin-process (oranvil_instancecrate).alloy::providers::ext::AnvilApito snapshot/revert state between test cases.forge script script/DeployProtocol.s.sol --broadcast --rpc-url $ANVIL_RPCOR port the deploy logic to Rust usingalloy'sContractFactory(the latter avoids a subprocess dependency in CI).#[ignore = "requires-anvil"]and add a separate CI job:cargo nextest run --ignored -p decdn-incentivewithfoundry-rs/foundry-toolchainaction.Test sequence checklist:
openChannel→ assert nodeChannelStorerow created, vouchers now acceptedredeem_threshold_micro_usdc→ assertwithdrawtx lands,withdrawnAmountadvancescloseChannelfiredsettleChannel→ assertChannelSettledevent decoded,store.forgetdrops rowFeeRouter.bytesPerEpochincrementedCI consideration: the job should be
continue-on-error: falsebut only run on non-draft PRs touchingcrates/incentive/**orcontracts/**to keep default CI fast.Add this agentic workflows to your repo
To install this agentic workflow, run
test(node): anvil e2e harness for on-chain PaymentChannel settlement (#…
test(node): anvil e2e harness for on-chain PaymentChannel settlement (#…