Skip to content

feat(contracts): add PaymentChannel USDC settlement gateway (#452) - #716

Merged
thiras merged 3 commits into
mainfrom
452-pr1-payment-channel
May 30, 2026
Merged

thiras merged 3 commits into
mainfrom
452-pr1-payment-channel

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Summary

First of 4 stacked PRs closing the remaining #452 contract surface (PaymentChannel → SlashJudge → OriginAssignment → DeployProtocol+E2E). Implements the ADR 003 PaymentChannel:

  • USDC-only off-chain payment channels; channelId = keccak256(client, provider, channelNonce).
  • EIP-712 vouchers verified with SignatureChecker (EOA + ERC-1271/4337).
  • Full lifecycle: openChannel / topUp / withdraw (early withdraw-while-open) / closeChannel (incl. zero-voucher close) / disputeChannel / settleChannel / reclaimExpired.
  • Same-tx routing of the un-withdrawn delta through FeeRouter.routeSettlement; withdrawal-watermark invariants guarantee each byte/USDC unit is counted exactly once.
  • openChannel gates on CapacityBond.isActive(provider).
  • Adds focused consumer interfaces IFeeRouterSettlement + ICapacityBondActivity (mirrors existing ICapacityBondReporter/Ejector split).

Reconciliation decisions (please confirm — ADRs disagree)

ADR 016 (canonical surface, newer) conflicts with ADR 003 in three places; I resolved each toward the canonical/consistent option and flag them here:

  1. AccessControl, not Ownable. ADR 016 §Contract Inventory + §OZ-usage table say Ownable, but ADR 016 §Access-Control Matrix lists DEFAULT_ADMIN_ROLE on all contracts + EMERGENCY_ROLE pause, ADR 003 setFeeRouter says GOVERNANCE_ROLE, and the existing BaseProtocolDeploy handoff is uniform grantRole/revokeRole. Chose AccessControl so the deploy handoff (PR4) stays uniform. Suggest updating ADR 016's inventory/OZ-table to AccessControl.
  2. Constructor + isActive gate. Followed ADR 016 §step-8 constructor (usdc, capacityBond, feeRouter, disputeWindow, maxChannelDuration, rateBounds, admin) and the call-table openChannel → isActive(provider), over ADR 003's 3-arg constructor. minDeposit (1 USDC) + maxVoucherIntervalMb (1) default internally.
  3. No node-to-node bypass. ADR 003 describes an optional cache-miss bypass; it is absent from ADR 016's canonical call table, so settleChannel always routes. (Node-to-node is Rust-integration scope, Implement on-chain CapacityBond and PaymentChannel contract integration #327.)

Also: the forced-inclusion deadline extension (ADR 003 §L2 sequencer censorship) is implemented but its detection sits behind an overridable internal seam (_arrivedViaForcedInclusion, default off) since "exact detection is finalized at L2 selection." The extended flag, reset-on-close, and extension arithmetic are fully implemented + tested via a harness.

Verification

  • forge fmt --check clean; FOUNDRY_PROFILE=ci forge build --deny warnings clean; pre-commit hooks pass.
  • forge test — 32 new tests pass (incl. 2 fuzz suites @256 runs); full suite 333 pass, 0 fail (no regressions).
  • ⚠️ slither / aderyn were NOT run locally (not installed in the dev env) — needs CI verification. I proactively added the same reentrancy-no-eth / reentrancy-state-change directives the repo already uses for the external-call-before-state-write pattern (see SlashAppeal).

Test plan

ADR 003 PaymentChannel: USDC-denominated off-chain payment channels with
EIP-712 vouchers (SignatureChecker for EOA + ERC-1271), 48h dispute window,
operator early-withdraw-while-open, and same-tx settlement routing through
FeeRouter.routeSettlement. openChannel gates on CapacityBond.isActive; the
forced-inclusion deadline extension sits behind an overridable L2 seam.

Adds focused consumer interfaces IFeeRouterSettlement + ICapacityBondActivity
(mirroring the existing ICapacityBondReporter/Ejector split). First of four
stacked PRs closing the remaining #452 contract surface.

Co-Authored-By: Claude <[email protected]>
Copilot AI review requested due to automatic review settings May 29, 2026 22:32
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions

github-actions Bot commented May 29, 2026 •

Copy link
Copy Markdown

Gas snapshot

Gas changes vs base
Compiling 119 files with Solc 0.8.28
Solc 0.8.28 finished in 12.32s
Compiler run successful!

Ran 18 tests for test/BuybackBurner.t.sol:BuybackBurnerTest
[PASS] test_constructor_grantsAdminAndGovernanceRoles() (gas: 14866)
[PASS] test_constructor_revertsOnZeroAdmin() (gas: 67810)
[PASS] test_constructor_revertsOnZeroToken() (gas: 67829)
[PASS] test_constructor_revertsOnZeroUsdc() (gas: 67793)
[PASS] test_executeBuyback_happyPath_burnsAndEmits() (gas: 105272)
[PASS] test_executeBuyback_revertsPoolNotWiredWhenPoolUnset() (gas: 840272)
[PASS] test_executeBuyback_revertsPoolNotWiredWhenVaultUnset() (gas: 840424)
[PASS] test_executeBuyback_revertsSwapNotImplementedWhenActualDeltaIsZero() (gas: 60069)
[PASS] test_executeBuyback_revertsSwapReportMismatch() (gas: 110981)
[PASS] test_executeBuyback_revertsWhenPaused() (gas: 73094)
[PASS] test_executeBuyback_revertsWithoutKeeperRole() (gas: 64298)
[PASS] test_executeBuyback_revertsZeroAmount() (gas: 20705)
[PASS] test_pause_revertsWithoutPauserRole() (gas: 11912)
[PASS] test_setPool_emitsUpdateEvent() (gas: 24953)
[PASS] test_setPool_revertsWithoutGovernanceRole() (gas: 12132)
[PASS] test_setVault_emitsUpdateEvent() (gas: 24896)
[PASS] test_setVault_revertsWithoutGovernanceRole() (gas: 12054)
[PASS] test_unpause_revertsWithoutPauserRole() (gas: 23849)
Suite result: ok. 18 passed; 0 failed; 0 skipped; finished in 2.79ms (1.79ms CPU time)

Ran 16 tests for test/FeeRouter.t.sol:FeeRouterTest
[PASS] test_bytesInWindow_sumsTrailingWindow() (gas: 497291)
[PASS] test_bytesInWindow_zeroWindowReturnsZero() (gas: 9326)
[PASS] test_pause_revertsWithoutRole() (gas: 14609)
[PASS] test_routeSettlement_distributesThreeLegs() (gas: 232441)
[PASS] test_routeSettlement_dustRoutesToOperatorWhenBuybackUnset() (gas: 141838)
[PASS] test_routeSettlement_incrementsBytesPerEpoch() (gas: 221457)
[PASS] test_routeSettlement_revertsWithoutRouterRole() (gas: 89208)
[PASS] test_setBuybackBurner_revertsWithoutRole() (gas: 14720)
[PASS] test_setSharesAndDestinations_revertsWithoutRole() (gas: 19569)
[PASS] test_setShares_rejectsNonZeroShareWithoutDestination() (gas: 16239)
[PASS] test_setShares_rejectsSumNot10000() (gas: 14523)
[PASS] test_setShares_revertsWithoutRole() (gas: 15219)
[PASS] test_setTreasury_revertsWithoutRole() (gas: 14696)
[PASS] test_setWindowEpochs_enforcesBounds() (gas: 32780)
[PASS] test_setWindowEpochs_revertsWithoutRole() (gas: 14688)
[PASS] test_unpause_revertsWithoutRole() (gas: 72166)
Suite result: ok. 16 passed; 0 failed; 0 skipped; finished in 4.56ms (3.81ms CPU time)

Ran 48 tests for test/CapacityBond.t.sol:CapacityBondTest
[PASS] test_appealGrant_unlocksClaimBeforeGateExpiry() (gas: 405232)
[PASS] test_claimVestedCredit_movesIntoActiveStake() (gas: 214310)
[PASS] test_claimVestedCredit_multiClaimFollowsLinearCurve() (gas: 218958)
[PASS] test_claimVestedCredit_revertsWhenNoActiveStake() (gas: 144400)
[PASS] test_claimVestedCredit_revertsWhenSlashedInWindow() (gas: 412937)
[PASS] test_claimVestedCredit_succeedsAfterSlashGateExpires() (gas: 416036)
[PASS] test_creditSlash_escrowsThenDistributes5050AtFinality() (gas: 431278)
[PASS] test_declaredMbps_storesValue() (gas: 37799)
[PASS] test_escrowHooks_requireSlashAppealRole() (gas: 17017)
[PASS] test_finalizeUnappealedSlash_distributes5050() (gas: 328939)
[PASS] test_firstBondedAt_immutableAcrossReBonds() (gas: 111402)
[PASS] test_firstBondedAt_setsOnFirstStake() (gas: 102556)
[PASS] test_forfeitUnvestedCredit_burnsWhenNoTreasury() (gas: 246115)
[PASS] test_forfeitUnvestedCredit_doesNotClawBackVestedUnclaimed() (gas: 281765)
[PASS] test_forfeitUnvestedCredit_onUnbond() (gas: 290510)
[PASS] test_genesisCredit_fullVestAfterDuration() (gas: 141232)
[PASS] test_genesisCredit_grantWithinWindow() (gas: 139099)
[PASS] test_genesisCredit_revertsAfterWindow() (gas: 82768)
[PASS] test_genesisCredit_vestsLinearly() (gas: 141534)
[PASS] test_markAppealOpen_blocksFinalize() (gas: 299626)
[PASS] test_pause_revertsWithoutRole() (gas: 14812)
[PASS] test_pendingCreditSlash_reducesOriginalGrant() (gas: 407094)
[PASS] test_reduceStakeAtTier_remainderClip() (gas: 5073414)
[PASS] test_reduceStakeAtTier_unbondingOnly() (gas: 5093224)
[PASS] test_registerNode_revertsOnInvalidEd25519Sig() (gas: 169259)
[PASS] test_registerNode_revertsWhenAlreadyActive() (gas: 376581)
[PASS] test_setClaimSlashGateEpochs_revertsWithoutRole() (gas: 14934)
[PASS] test_setMaxMultiaddrSize_revertsWithoutRole() (gas: 14823)
[PASS] test_setMinStake_revertsWithoutRole() (gas: 14792)
[PASS] test_setMultiaddrUpdateCooldown_revertsWithoutRole() (gas: 14844)
[PASS] test_setRegionStabilityWindow_revertsWithoutRole() (gas: 14822)
[PASS] test_setTreasury_revertsWithoutRole() (gas: 14925)
[PASS] test_setUnbondingPeriod_revertsWithoutRole() (gas: 14869)
[PASS] test_settleAppealGranted_clearsAndRefunds() (gas: 274970)
[PASS] test_settleAppealUpheld_distributes5050() (gas: 321105)
[PASS] test_slashHitsVestedAndUnvestedTogether() (gas: 450220)
[PASS] test_slashHitsVestedButUnclaimed() (gas: 417621)
[PASS] test_slashId_persistsRecord() (gas: 289005)
[PASS] test_slash_creditSlash_escalatesAcrossTiers() (gas: 593657)
[PASS] test_slash_escrowsWithoutDistribution() (gas: 300118)
[PASS] test_slash_stampsSlashedAtEpoch() (gas: 288730)
[PASS] test_slash_tier3_mixedStake_exhaustsActiveTapsUnbonding() (gas: 515004)
[PASS] test_slash_tierEscalation_15then50pct() (gas: 474185)
[PASS] test_slashedAtEpoch_zeroBeforeSlash() (gas: 10158)
[PASS] test_unpause_revertsWithoutRole() (gas: 94699)
[PASS] test_updateMultiaddrs_revertsWhenNodeNotActive() (gas: 15679)
[PASS] test_updateRegion_cooldownAndPrevSnapshot() (gas: 447956)
[PASS] test_updateRegion_revertsWhenNodeNotActive() (gas: 15675)
Suite result: ok. 48 passed; 0 failed; 0 skipped; finished in 13.43ms (11.26ms CPU time)

Ran 18 tests for test/ContentBlacklist.t.sol:ContentBlacklistTest
[PASS] test_addHashGlobal_andQuery() (gas: 38191)
[PASS] test_addHashGlobal_revertsWithoutGovernanceRole() (gas: 14608)
[PASS] test_addHashRegional_globalTakesPrecedence() (gas: 41980)
[PASS] test_addHashRegional_revertsWithoutRegionalBodyRole() (gas: 14684)
[PASS] test_addOperator_callsEjectOnCapacityBond() (gas: 91570)
[PASS] test_fullAppealFlow_ratifyRemovesHash() (gas: 275665)
[PASS] test_hasActiveAppeal_clearedOnLapseOpen() (gas: 242221)
[PASS] test_hasActiveAppeal_clearedOnReject() (gas: 433926)
[PASS] test_hasActiveAppeal_clearedOnReverse() (gas: 254985)
[PASS] test_openBlacklistAppeal_revertsDuplicatePerHash() (gas: 356697)
[PASS] test_openBlacklistAppeal_revertsOnEntryNotBlacklisted() (gas: 18635)
[PASS] test_openBlacklistAppeal_revertsOnZeroRegion() (gas: 16243)
[PASS] test_regionalCap_blocksMoreThanThreeActiveAppeals() (gas: 706667)
[PASS] test_registerRegionalBody_revertsWithoutGovernanceRole() (gas: 14830)
[PASS] test_rejectAppeal_burnsBond() (gas: 247882)
[PASS] test_removeHashRegional_blocksGlobalRegionEntries() (gas: 44419)
[PASS] test_reverseAppeal_clearsSuspendedAndBurnsBond() (gas: 261664)
[PASS] test_setAppealBond_revertsWithoutGovernanceRole() (gas: 14754)
Suite result: ok. 18 passed; 0 failed; 0 skipped; finished in 3.17ms (2.29ms CPU time)

Ran 13 tests for test/DecdnGovernor.t.sol:DecdnGovernorTest
[PASS] test_ageRampMonthsAt_preservesPriorReadAfterLaterPush() (gas: 4104760)
[PASS] test_getVotes_halfRamp() (gas: 173099)
[PASS] test_getVotes_historicalSnapshotIgnoresFutureSlash() (gas: 221405)
[PASS] test_getVotes_ramp() (gas: 173020)
[PASS] test_getVotes_recoversAfterWindowSlidesPastSlash() (gas: 196808)
[PASS] test_getVotes_uncappedWhenBelowCap() (gas: 173006)
[PASS] test_getVotes_zeroIfNeverBonded() (gas: 93593)
[PASS] test_getVotes_zeroWhenSlashedInWindow() (gas: 119032)
[PASS] test_proposalThreshold_isPointOnePercent() (gas: 71807)
[PASS] test_quorum_isFourPercentOfTotalBytesInWindow() (gas: 71639)
[PASS] test_setAgeRampMonths_revertsWithoutTimelockCaller() (gas: 11013)
[PASS] test_setVoteCapBps_revertsWithoutTimelockCaller() (gas: 11066)
[PASS] test_voteCapBpsAt_preservesPriorReadAfterLaterPush() (gas: 4104884)
Suite result: ok. 13 passed; 0 failed; 0 skipped; finished in 5.17ms (3.79ms CPU time)

Ran 20 tests for test/DeployProtocol.t.sol:DeployProtocolTest
[PASS] test_assertNoBackDoors_revertsWhenHandoffIncomplete() (gas: 18224423)
[PASS] test_assertNoBackDoors_revertsWhenTimelockMissingRole() (gas: 87363)
[PASS] test_crossContractWiring_capacityBondPeerRoles() (gas: 23400)
[PASS] test_crossContractWiring_genesisGrantorIsTimelock() (gas: 17055)
[PASS] test_crossContractWiring_slashAppealChallengerPool() (gas: 9920)
[PASS] test_deployTargets_revertsOnZeroChallengerIncentivePool() (gas: 2025126)
[PASS] test_deployTargets_revertsOnZeroDeployer() (gas: 579766)
[PASS] test_deployTargets_revertsOnZeroEd25519Verifier() (gas: 2024972)
[PASS] test_deployTargets_revertsOnZeroEmergencyMultisig() (gas: 2025060)
[PASS] test_deployTargets_revertsOnZeroInitialTokenHolder() (gas: 2025104)
[PASS] test_deployTargets_revertsOnZeroUsdc() (gas: 2024910)
[PASS] test_feeRouter_launchSharesDormantBuyback() (gas: 16388)
[PASS] test_feeRouter_treasuryIsTimelock() (gas: 10051)
[PASS] test_governor_openExecutor() (gas: 8787)
[PASS] test_governor_timelockBinding() (gas: 25888)
[PASS] test_roleMatrix_deployerHoldsNoRoleAnywhere() (gas: 66793)
[PASS] test_roleMatrix_emergencyMultisigGrants() (gas: 19503)
[PASS] test_roleMatrix_timelockHoldsDefaultAdminOnEveryTarget() (gas: 41803)
[PASS] test_roleMatrix_timelockHoldsGovernanceOnEveryTarget() (gas: 41975)
[PASS] test_token_initialHolderHoldsFullSupply() (gas: 13714)
Suite result: ok. 20 passed; 0 failed; 0 skipped; finished in 8.73ms (4.92ms CPU time)

Ran 7 tests for test/DeployProtocolScript.t.sol:DeployProtocolScriptTest
[PASS] test_readConfig_appliesDefaultsForOptionalVars() (gas: 17786)
[PASS] test_readConfig_deployerIsTxOrigin() (gas: 15801)
[PASS] test_run_abortsBeforeBroadcastWhenManifestExists() (gas: 21543)
[PASS] test_run_revertsIfDeployerIsForgeDefaultSender() (gas: 14807)
[PASS] test_writeManifest_overwritesWhenForced() (gas: 96858)
[PASS] test_writeManifest_revertsOnExistingFile() (gas: 31045)
[PASS] test_writeManifest_writesAllAddresses() (gas: 82391)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 6.74ms (7.32ms CPU time)

Ran 12 tests for test/Ed25519Verifier.t.sol:Ed25519VerifierTest
[PASS] test_MalleatedScalarRejected() (gas: 525477)
[PASS] test_NonCanonicalYRejected() (gas: 11387)
[PASS] test_OffCurvePubKeyRejected() (gas: 14174)
[PASS] test_SmallOrderPubKeyRejected() (gas: 40661)
[PASS] test_SmallOrderRRejected() (gas: 39201)
[PASS] test_ValidVectorsAccepted() (gas: 3003445)
[PASS] test_VerifyRunsUnderStaticcall() (gas: 508245)
[PASS] test_WrongLengthSignatureRejected() (gas: 12156)
[PASS] test_WrongMessageRejected() (gas: 507932)
[PASS] test_WrongPubKeyRejected() (gas: 509119)
[PASS] test_WrongRRejected() (gas: 503763)
[PASS] test_WrongSRejected() (gas: 508960)
Suite result: ok. 12 passed; 0 failed; 0 skipped; finished in 65.17ms (64.79ms CPU time)

Ran 50 tests for test/GovernanceLifecycle.t.sol:GovernanceLifecycleTest
[PASS] test_canary_executorIsTimelock() (gas: 9883)
[PASS] test_canary_governanceRoleHandoff() (gas: 98950)
[PASS] test_canary_governorVoteWeightWired() (gas: 129803)
[PASS] test_lifecycle_CapacityBond_setClaimSlashGateEpochs_happy() (gas: 588936)
[PASS] test_lifecycle_CapacityBond_setClaimSlashGateEpochs_outOfBounds() (gas: 594629)
[PASS] test_lifecycle_CapacityBond_setMaxMultiaddrSize_happy() (gas: 588593)
[PASS] test_lifecycle_CapacityBond_setMaxMultiaddrSize_outOfBounds() (gas: 594543)
[PASS] test_lifecycle_CapacityBond_setMinStake_happy() (gas: 588682)
[PASS] test_lifecycle_CapacityBond_setMinStake_outOfBounds() (gas: 594563)
[PASS] test_lifecycle_CapacityBond_setMultiaddrUpdateCooldown_happy() (gas: 605754)
[PASS] test_lifecycle_CapacityBond_setMultiaddrUpdateCooldown_outOfBounds() (gas: 594514)
[PASS] test_lifecycle_CapacityBond_setRegionStabilityWindow_happy() (gas: 588614)
[PASS] test_lifecycle_CapacityBond_setRegionStabilityWindow_outOfBounds() (gas: 594497)
[PASS] test_lifecycle_CapacityBond_setTreasury_happy() (gas: 606247)
[PASS] test_lifecycle_CapacityBond_setUnbondingPeriod_happy() (gas: 588695)
[PASS] test_lifecycle_CapacityBond_setUnbondingPeriod_outOfBounds() (gas: 594568)
[PASS] test_lifecycle_ContentBlacklist_addHashGlobal_happy() (gas: 609091)
[PASS] test_lifecycle_ContentBlacklist_addHashGlobal_outOfBounds() (gas: 596678)
[PASS] test_lifecycle_ContentBlacklist_addOperator_happy() (gas: 637766)
[PASS] test_lifecycle_ContentBlacklist_addOperator_outOfBounds() (gas: 596815)
[PASS] test_lifecycle_ContentBlacklist_registerRegionalBody_happy() (gas: 610620)
[PASS] test_lifecycle_ContentBlacklist_removeHashGlobal_happy() (gas: 993861)
[PASS] test_lifecycle_ContentBlacklist_removeHashGlobal_outOfBounds() (gas: 599226)
[PASS] test_lifecycle_ContentBlacklist_removeOperator_happy() (gas: 1022249)
[PASS] test_lifecycle_ContentBlacklist_setAppealBond_happy() (gas: 591101)
[PASS] test_lifecycle_ContentBlacklist_setAppealBond_outOfBounds() (gas: 596999)
[PASS] test_lifecycle_ContentBlacklist_setOriginBlacklist_happy() (gas: 609754)
[PASS] test_lifecycle_ContentBlacklist_setOriginBlacklist_outOfBounds() (gas: 597587)
[PASS] test_lifecycle_DecdnGovernor_setAgeRampMonths_happy() (gas: 630502)
[PASS] test_lifecycle_DecdnGovernor_setAgeRampMonths_outOfBounds() (gas: 636220)
[PASS] test_lifecycle_DecdnGovernor_setVoteCapBps_happy() (gas: 630531)
[PASS] test_lifecycle_DecdnGovernor_setVoteCapBps_outOfBounds() (gas: 636195)
[PASS] test_lifecycle_FeeRouter_setBuybackBurner_happy() (gas: 589061)
[PASS] test_lifecycle_FeeRouter_setBuybackBurner_outOfBounds() (gas: 596503)
[PASS] test_lifecycle_FeeRouter_setSharesAndDestinations_happy() (gas: 621995)
[PASS] test_lifecycle_FeeRouter_setSharesAndDestinations_outOfBounds() (gas: 597686)
[PASS] test_lifecycle_FeeRouter_setShares_happy() (gas: 608162)
[PASS] test_lifecycle_FeeRouter_setShares_outOfBounds() (gas: 596483)
[PASS] test_lifecycle_FeeRouter_setTreasury_happy() (gas: 589087)
[PASS] test_lifecycle_FeeRouter_setTreasury_outOfBounds() (gas: 594335)
[PASS] test_lifecycle_FeeRouter_setWindowEpochs_happy() (gas: 610809)
[PASS] test_lifecycle_FeeRouter_setWindowEpochs_outOfBounds() (gas: 596859)
[PASS] test_lifecycle_PublisherRegistry_setMaxNamespacesPerPublisher_happy() (gas: 591416)
[PASS] test_lifecycle_PublisherRegistry_setMaxNamespacesPerPublisher_outOfBounds() (gas: 596994)
[PASS] test_lifecycle_PublisherRegistry_setNamespaceTransferTimelock_happy() (gas: 591310)
[PASS] test_lifecycle_PublisherRegistry_setNamespaceTransferTimelock_outOfBounds() (gas: 597036)
[PASS] test_lifecycle_SlashAppeal_setAppealBond_happy() (gas: 591196)
[PASS] test_lifecycle_SlashAppeal_setAppealBond_outOfBounds() (gas: 596996)
[PASS] test_lifecycle_SlashAppeal_setChallengerIncentivePool_happy() (gas: 591545)
[PASS] test_lifecycle_SlashAppeal_setChallengerIncentivePool_outOfBounds() (gas: 596847)
Suite result: ok. 50 passed; 0 failed; 0 skipped; finished in 164.90ms (144.76ms CPU time)

Ran 27 tests for test/PublisherRegistry.t.sol:PublisherRegistryTest
[PASS] testFuzz_createNamespace_idsAreSequentialAndOwned(uint8) (runs: 1024, μ: 707836, ~: 400006)
[PASS] test_claimContent_multiClaimAcrossNamespaces() (gas: 233820)
[PASS] test_claimContent_recordsClaim() (gas: 134733)
[PASS] test_claimContent_revertsForDefaultOpenNamespace() (gas: 13756)
[PASS] test_claimContent_revertsIfNotOwner() (gas: 66829)
[PASS] test_claimContent_revertsOnDuplicateSameNamespace() (gas: 135319)
[PASS] test_constructor_revertsZeroAdmin() (gas: 36674)
[PASS] test_constructor_setsDefaultsAndRoles() (gas: 19037)
[PASS] test_createNamespace_assignsIdsFromOne() (gas: 92728)
[PASS] test_createNamespace_revertsAtCap() (gas: 98581)
[PASS] test_createNamespace_zeroIsNeverAssigned() (gas: 65471)
[PASS] test_namespaceOf_emptyForUnclaimed() (gas: 8273)
[PASS] test_setMaxNamespaces_revertsOutOfBounds() (gas: 17605)
[PASS] test_setMaxNamespaces_revertsWithoutRole() (gas: 13384)
[PASS] test_setMaxNamespaces_withinBounds() (gas: 20687)
[PASS] test_setTransferTimelock_revertsOutOfBounds() (gas: 17706)
[PASS] test_setTransferTimelock_revertsWithoutRole() (gas: 14763)
[PASS] test_setTransferTimelock_withinBounds() (gas: 20560)
[PASS] test_transfer_cancelByOwner() (gas: 78668)
[PASS] test_transfer_cancelRevertsIfNotOwner() (gas: 93302)
[PASS] test_transfer_finalizeRevertsIfNotPendingOwner() (gas: 93817)
[PASS] test_transfer_finalizeRevertsNoPending() (gas: 68544)
[PASS] test_transfer_fullFlow() (gas: 98658)
[PASS] test_transfer_initiateRevertsIfNotOwner() (gas: 66923)
[PASS] test_transfer_initiateRevertsZeroNewOwner() (gas: 64330)
[PASS] test_transfer_revertsWhenRecipientAtCap() (gas: 150145)
[PASS] test_transfer_selfTransferExemptFromCap() (gas: 95404)
Suite result: ok. 27 passed; 0 failed; 0 skipped; finished in 850.00ms (848.97ms CPU time)

Ran 18 tests for test/SlashAppeal.t.sol:SlashAppealTest
[PASS] test_cleanup_fastTrackedLapse_grantsOperatorFavorable() (gas: 428049)
[PASS] test_cleanup_openLapse_upholds() (gas: 446574)
[PASS] test_fastTrack_requiresMultisig() (gas: 457915)
[PASS] test_frequencyCap_blocksSecondAppealWithinWindow() (gas: 556749)
[PASS] test_grant_olderAppeal_preservesNewerSlashZeroOut() (gas: 549327)
[PASS] test_grant_refundsOperatorAndBondAndClearsZeroOut() (gas: 434893)
[PASS] test_grant_requiresGovernance() (gas: 468587)
[PASS] test_grant_restoresCreditVestingNotLiquid() (gas: 548160)
[PASS] test_grant_revertsIfNotFastTracked() (gas: 460295)
[PASS] test_open_locksEscrowAndPullsBond() (gas: 464294)
[PASS] test_open_revertsAfterFilingWindow() (gas: 455166)
[PASS] test_open_revertsForNonOperator() (gas: 468952)
[PASS] test_open_revertsOnDoubleAppeal() (gas: 460120)
[PASS] test_open_revertsUnknownSlash() (gas: 23820)
[PASS] test_pause_extendsFilingWindow() (gas: 381121)
[PASS] test_reject_burnsBondAndDistributesEscrow() (gas: 451073)
[PASS] test_uphold_distributesEscrowAndSplitsBond() (gas: 487514)
[PASS] test_uphold_poolUnset_burnsFullBond() (gas: 2147444)
Suite result: ok. 18 passed; 0 failed; 0 skipped; finished in 7.44ms (5.78ms CPU time)

Ran 44 tests for test/TestnetFaucet.t.sol:TestnetFaucetTest
[PASS] testFuzz_claim_atOrAboveCooldown(uint256) (runs: 1024, μ: 91487, ~: 91528)
[PASS] testFuzz_claim_belowCooldown(uint256) (runs: 1024, μ: 85185, ~: 85389)
[PASS] test_admin_canGrantAndRevokeRoles() (gas: 56401)
[PASS] test_claim_blocksReentrancy() (gas: 1550228)
[PASS] test_claim_happyPath() (gas: 82821)
[PASS] test_claim_perCallerCooldownIndependence() (gas: 133478)
[PASS] test_claim_revertsBeforeCooldown() (gas: 83092)
[PASS] test_claim_revertsOnInsufficientBalance() (gas: 50715)
[PASS] test_claim_revertsOneSecondBeforeCooldownBoundary() (gas: 82996)
[PASS] test_claim_revertsWhenPaused() (gas: 39998)
[PASS] test_claim_succeedsAfterCooldown() (gas: 90430)
[PASS] test_claim_succeedsAtExactCooldownBoundary() (gas: 87103)
[PASS] test_constructor_allowsZeroCooldown() (gas: 1810378)
[PASS] test_constructor_revertsOnCooldownExceedingMax() (gas: 1015061)
[PASS] test_constructor_revertsOnMainnetChainId() (gas: 988198)
[PASS] test_constructor_revertsOnZeroAdmin() (gas: 985898)
[PASS] test_constructor_revertsOnZeroClaimAmount() (gas: 988045)
[PASS] test_constructor_revertsOnZeroFunding() (gas: 988061)
[PASS] test_constructor_revertsOnZeroGovernance() (gas: 985864)
[PASS] test_constructor_revertsOnZeroPauser() (gas: 985954)
[PASS] test_constructor_revertsOnZeroTokenAddress() (gas: 70468)
[PASS] test_constructor_revertsOnZeroTreasury() (gas: 987830)
[PASS] test_constructor_revertsWhenTreasuryNotApproved() (gas: 1110690)
[PASS] test_constructor_setsStateAndRoles() (gas: 43070)
[PASS] test_nonAdmin_cannotGrantRoles() (gas: 17889)
[PASS] test_pause_blocksClaimUnpauseRestores() (gas: 91691)
[PASS] test_pause_revertsOnNonPauser() (gas: 14607)
[PASS] test_setClaimAmount_revertsOnNonGovernance() (gas: 14702)
[PASS] test_setClaimAmount_revertsOnZero() (gas: 13338)
[PASS] test_setClaimAmount_updatesAndEmits() (gas: 22083)
[PASS] test_setCooldown_acceptsMaxCooldown() (gas: 20228)
[PASS] test_setCooldown_allowsZero() (gas: 94920)
[PASS] test_setCooldown_revertsOnExceedingMax() (gas: 13790)
[PASS] test_setCooldown_revertsOnNonGovernance() (gas: 14705)
[PASS] test_setCooldown_updatesAndEmits() (gas: 22231)
[PASS] test_timeUntilNext_tracksCooldownWindow() (gas: 82615)
[PASS] test_timeUntilNext_zeroBeforeFirstClaim() (gas: 10099)
[PASS] test_unpause_revertsOnNonPauser() (gas: 43483)
[PASS] test_withdraw_revertsOnInsufficientBalance() (gas: 26877)
[PASS] test_withdraw_revertsOnNonGovernance() (gas: 17089)
[PASS] test_withdraw_revertsOnZeroAmount() (gas: 20838)
[PASS] test_withdraw_revertsOnZeroTo() (gas: 18662)
[PASS] test_withdraw_transfersAndEmits() (gas: 44129)
[PASS] test_withdraw_worksWhilePaused() (gas: 68286)
Suite result: ok. 44 passed; 0 failed; 0 skipped; finished in 251.07ms (249.21ms CPU time)

Ran 10 tests for test/Token.t.sol:TokenTest
[PASS] testFuzz_burn_reducesSupplyByExactAmount(uint256) (runs: 1024, μ: 27829, ~: 27700)
[PASS] test_burnFrom_consumesAllowance() (gas: 38534)
[PASS] test_burn_reducesTotalSupplyAndBalance() (gas: 26044)
[PASS] test_constructor_metadata() (gas: 17896)
[PASS] test_constructor_mintsFullSupplyToHolder() (gas: 12954)
[PASS] test_constructor_revertsOnZeroInitialHolder() (gas: 83264)
[PASS] test_constructor_totalSupplyConstantMatches() (gas: 9364)
[PASS] test_noMintFunctionExposed() (gas: 10765)
[PASS] test_noVotesSurfaceExposed() (gas: 11991)
[PASS] test_permit_setsAllowance() (gas: 67380)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 78.65ms (77.96ms CPU time)

Ran 54 tests for test/PaymentChannel.t.sol:PaymentChannelTest
[PASS] testFuzz_settle_refundEqualsDepositMinusClaimed(uint256,uint256) (runs: 1024, μ: 410623, ~: 410648)
[PASS] testFuzz_withdrawThenSettle_partitionsClaim(uint256,uint256,uint256,uint256) (runs: 1024, μ: 545916, ~: 546319)
[PASS] test_close_afterWithdraw_settleRoutesRemainderOnly() (gas: 538591)
[PASS] test_close_atWatermarkNonce_succeeds() (gas: 471986)
[PASS] test_close_revertsAfterExpiry() (gas: 209040)
[PASS] test_close_revertsOnAmountExceedingDeposit() (gas: 221040)
[PASS] test_close_revertsOnByteOnlyAdvance() (gas: 464920)
[PASS] test_close_then_settle_routesAndRefunds() (gas: 420622)
[PASS] test_close_thirdPartyCannotClose() (gas: 210915)
[PASS] test_constructor_revertsOnDisputeWindowOutOfBounds() (gas: 76787)
[PASS] test_constructor_revertsOnEoaFeeRouter() (gas: 76787)
[PASS] test_constructor_revertsOnZeroAdmin() (gas: 71702)
[PASS] test_dispute_higherNonceWins() (gas: 307630)
[PASS] test_dispute_revertsAfterDeadline() (gas: 295195)
[PASS] test_dispute_revertsOnAmountExceedingDeposit() (gas: 303144)
[PASS] test_dispute_revertsOnAmountRegression() (gas: 302754)
[PASS] test_dispute_revertsOnByteOnlyAdvance() (gas: 483308)
[PASS] test_dispute_revertsOnBytesRegression() (gas: 302891)
[PASS] test_dispute_revertsOnStaleNonce() (gas: 300180)
[PASS] test_forcedInclusion_doesNotExtendTwice() (gas: 2756694)
[PASS] test_forcedInclusion_extendsDeadlineOnce() (gas: 2734132)
[PASS] test_forcedInclusion_noExtendWhenAmpleTimeRemains() (gas: 2742648)
[PASS] test_getRateBounds_returnsConfigured() (gas: 9890)
[PASS] test_normalDispute_doesNotExtend() (gas: 317503)
[PASS] test_openChannel_derivesIdAndIncrementsNonce() (gas: 219442)
[PASS] test_openChannel_distinctIdsAcrossProviders() (gas: 347252)
[PASS] test_openChannel_revertsBelowMinDeposit() (gas: 23033)
[PASS] test_openChannel_revertsOnInactiveProvider() (gas: 29784)
[PASS] test_openChannel_revertsWhenPaused() (gas: 47399)
[PASS] test_paused_exitsStillCallable() (gas: 659037)
[PASS] test_reclaimExpired_refundsRemainderToClient() (gas: 446830)
[PASS] test_reclaimExpired_revertsBeforeExpiry() (gas: 204176)
[PASS] test_setDisputeWindow_enforcesBounds() (gas: 24815)
[PASS] test_setFeeRouter_revertsOnEoaRouter() (gas: 18660)
[PASS] test_setFeeRouter_revertsOnZeroAndUnchanged() (gas: 24635)
[PASS] test_setFeeRouter_updatesTarget() (gas: 284490)
[PASS] test_setters_onlyGovernance() (gas: 13976)
[PASS] test_settle_amountEqualsDeposit_zeroRefund() (gas: 405432)
[PASS] test_settle_fullyWithdrawn_noRouterCall() (gas: 467688)
[PASS] test_settle_revertsBeforeDisputeDeadline() (gas: 292432)
[PASS] test_topUp_increasesDeposit() (gas: 222520)
[PASS] test_topUp_onlyClient() (gas: 204390)
[PASS] test_voucher_rejectedOnWrongChannelId() (gas: 335707)
[PASS] test_withdraw_acceptsErc1271Signature() (gas: 711964)
[PASS] test_withdraw_onlyProvider() (gas: 208846)
[PASS] test_withdraw_revertsOnAmountExceedingDeposit() (gas: 220800)
[PASS] test_withdraw_revertsOnBadSignature() (gas: 213634)
[PASS] test_withdraw_revertsOnBytesRegression() (gas: 463839)
[PASS] test_withdraw_revertsOnNonMonotonicNonce() (gas: 463515)
[PASS] test_withdraw_revertsWhenDeltaZero() (gas: 464290)
[PASS] test_withdraw_routesDeltaAndAdvancesWatermark() (gas: 460090)
[PASS] test_withdraw_secondWithdrawRoutesOnlyIncrement() (gas: 546054)
[PASS] test_zeroVoucherClose_disabledAfterWithdraw() (gas: 457488)
[PASS] test_zeroVoucherClose_refundsFullDeposit() (gas: 216232)
Suite result: ok. 54 passed; 0 failed; 0 skipped; finished in 1.50s (1.52s CPU time)

Ran 14 test suites in 1.69s (2.96s CPU time): 355 tests passed, 0 failed, 0 skipped (355 total tests)
━ BuybackBurnerTest::test_constructor_grantsAdminAndGovernanceRoles() (gas: 14866 → 14866 | 0 0.000%)
━ BuybackBurnerTest::test_constructor_revertsOnZeroAdmin() (gas: 67810 → 67810 | 0 0.000%)
━ BuybackBurnerTest::test_constructor_revertsOnZeroToken() (gas: 67829 → 67829 | 0 0.000%)
━ BuybackBurnerTest::test_constructor_revertsOnZeroUsdc() (gas: 67793 → 67793 | 0 0.000%)
━ BuybackBurnerTest::test_executeBuyback_happyPath_burnsAndEmits() (gas: 105272 → 105272 | 0 0.000%)
━ BuybackBurnerTest::test_executeBuyback_revertsPoolNotWiredWhenPoolUnset() (gas: 840272 → 840272 | 0 0.000%)
━ BuybackBurnerTest::test_executeBuyback_revertsPoolNotWiredWhenVaultUnset() (gas: 840424 → 840424 | 0 0.000%)
━ BuybackBurnerTest::test_executeBuyback_revertsSwapNotImplementedWhenActualDeltaIsZero() (gas: 60069 → 60069 | 0 0.000%)
━ BuybackBurnerTest::test_executeBuyback_revertsSwapReportMismatch() (gas: 110981 → 110981 | 0 0.000%)
━ BuybackBurnerTest::test_executeBuyback_revertsWhenPaused() (gas: 73094 → 73094 | 0 0.000%)
━ BuybackBurnerTest::test_executeBuyback_revertsWithoutKeeperRole() (gas: 64298 → 64298 | 0 0.000%)
━ BuybackBurnerTest::test_executeBuyback_revertsZeroAmount() (gas: 20705 → 20705 | 0 0.000%)
━ BuybackBurnerTest::test_pause_revertsWithoutPauserRole() (gas: 11912 → 11912 | 0 0.000%)
━ BuybackBurnerTest::test_setPool_emitsUpdateEvent() (gas: 24953 → 24953 | 0 0.000%)
━ BuybackBurnerTest::test_setPool_revertsWithoutGovernanceRole() (gas: 12132 → 12132 | 0 0.000%)
━ BuybackBurnerTest::test_setVault_emitsUpdateEvent() (gas: 24896 → 24896 | 0 0.000%)
━ BuybackBurnerTest::test_setVault_revertsWithoutGovernanceRole() (gas: 12054 → 12054 | 0 0.000%)
━ BuybackBurnerTest::test_unpause_revertsWithoutPauserRole() (gas: 23849 → 23849 | 0 0.000%)
━ CapacityBondTest::test_appealGrant_unlocksClaimBeforeGateExpiry() (gas: 405232 → 405232 | 0 0.000%)
━ CapacityBondTest::test_claimVestedCredit_movesIntoActiveStake() (gas: 214310 → 214310 | 0 0.000%)
━ CapacityBondTest::test_claimVestedCredit_multiClaimFollowsLinearCurve() (gas: 218958 → 218958 | 0 0.000%)
━ CapacityBondTest::test_claimVestedCredit_revertsWhenNoActiveStake() (gas: 144400 → 144400 | 0 0.000%)
━ CapacityBondTest::test_claimVestedCredit_revertsWhenSlashedInWindow() (gas: 412937 → 412937 | 0 0.000%)
━ CapacityBondTest::test_claimVestedCredit_succeedsAfterSlashGateExpires() (gas: 416036 → 416036 | 0 0.000%)
━ CapacityBondTest::test_creditSlash_escrowsThenDistributes5050AtFinality() (gas: 431278 → 431278 | 0 0.000%)
━ CapacityBondTest::test_declaredMbps_storesValue() (gas: 37799 → 37799 | 0 0.000%)
━ CapacityBondTest::test_escrowHooks_requireSlashAppealRole() (gas: 17017 → 17017 | 0 0.000%)
━ CapacityBondTest::test_finalizeUnappealedSlash_distributes5050() (gas: 328939 → 328939 | 0 0.000%)
━ CapacityBondTest::test_firstBondedAt_immutableAcrossReBonds() (gas: 111402 → 111402 | 0 0.000%)
━ CapacityBondTest::test_firstBondedAt_setsOnFirstStake() (gas: 102556 → 102556 | 0 0.000%)
━ CapacityBondTest::test_forfeitUnvestedCredit_burnsWhenNoTreasury() (gas: 246115 → 246115 | 0 0.000%)
━ CapacityBondTest::test_forfeitUnvestedCredit_doesNotClawBackVestedUnclaimed() (gas: 281765 → 281765 | 0 0.000%)
━ CapacityBondTest::test_forfeitUnvestedCredit_onUnbond() (gas: 290510 → 290510 | 0 0.000%)
━ CapacityBondTest::test_genesisCredit_fullVestAfterDuration() (gas: 141232 → 141232 | 0 0.000%)
━ CapacityBondTest::test_genesisCredit_grantWithinWindow() (gas: 139099 → 139099 | 0 0.000%)
━ CapacityBondTest::test_genesisCredit_revertsAfterWindow() (gas: 82768 → 82768 | 0 0.000%)
━ CapacityBondTest::test_genesisCredit_vestsLinearly() (gas: 141534 → 141534 | 0 0.000%)
━ CapacityBondTest::test_markAppealOpen_blocksFinalize() (gas: 299626 → 299626 | 0 0.000%)
━ CapacityBondTest::test_pause_revertsWithoutRole() (gas: 14812 → 14812 | 0 0.000%)
━ CapacityBondTest::test_pendingCreditSlash_reducesOriginalGrant() (gas: 407094 → 407094 | 0 0.000%)
━ CapacityBondTest::test_reduceStakeAtTier_remainderClip() (gas: 5073414 → 5073414 | 0 0.000%)
━ CapacityBondTest::test_reduceStakeAtTier_unbondingOnly() (gas: 5093224 → 5093224 | 0 0.000%)
━ CapacityBondTest::test_registerNode_revertsOnInvalidEd25519Sig() (gas: 169259 → 169259 | 0 0.000%)
━ CapacityBondTest::test_registerNode_revertsWhenAlreadyActive() (gas: 376581 → 376581 | 0 0.000%)
━ CapacityBondTest::test_setClaimSlashGateEpochs_revertsWithoutRole() (gas: 14934 → 14934 | 0 0.000%)
━ CapacityBondTest::test_setMaxMultiaddrSize_revertsWithoutRole() (gas: 14823 → 14823 | 0 0.000%)
━ CapacityBondTest::test_setMinStake_revertsWithoutRole() (gas: 14792 → 14792 | 0 0.000%)
━ CapacityBondTest::test_setMultiaddrUpdateCooldown_revertsWithoutRole() (gas: 14844 → 14844 | 0 0.000%)
━ CapacityBondTest::test_setRegionStabilityWindow_revertsWithoutRole() (gas: 14822 → 14822 | 0 0.000%)
━ CapacityBondTest::test_setTreasury_revertsWithoutRole() (gas: 14925 → 14925 | 0 0.000%)
━ CapacityBondTest::test_setUnbondingPeriod_revertsWithoutRole() (gas: 14869 → 14869 | 0 0.000%)
━ CapacityBondTest::test_settleAppealGranted_clearsAndRefunds() (gas: 274970 → 274970 | 0 0.000%)
━ CapacityBondTest::test_settleAppealUpheld_distributes5050() (gas: 321105 → 321105 | 0 0.000%)
━ CapacityBondTest::test_slashHitsVestedAndUnvestedTogether() (gas: 450220 → 450220 | 0 0.000%)
━ CapacityBondTest::test_slashHitsVestedButUnclaimed() (gas: 417621 → 417621 | 0 0.000%)
━ CapacityBondTest::test_slashId_persistsRecord() (gas: 289005 → 289005 | 0 0.000%)
━ CapacityBondTest::test_slash_creditSlash_escalatesAcrossTiers() (gas: 593657 → 593657 | 0 0.000%)
━ CapacityBondTest::test_slash_escrowsWithoutDistribution() (gas: 300118 → 300118 | 0 0.000%)
━ CapacityBondTest::test_slash_stampsSlashedAtEpoch() (gas: 288730 → 288730 | 0 0.000%)
━ CapacityBondTest::test_slash_tier3_mixedStake_exhaustsActiveTapsUnbonding() (gas: 515004 → 515004 | 0 0.000%)
━ CapacityBondTest::test_slash_tierEscalation_15then50pct() (gas: 474185 → 474185 | 0 0.000%)
━ CapacityBondTest::test_slashedAtEpoch_zeroBeforeSlash() (gas: 10158 → 10158 | 0 0.000%)
━ CapacityBondTest::test_unpause_revertsWithoutRole() (gas: 94699 → 94699 | 0 0.000%)
━ CapacityBondTest::test_updateMultiaddrs_revertsWhenNodeNotActive() (gas: 15679 → 15679 | 0 0.000%)
━ CapacityBondTest::test_updateRegion_cooldownAndPrevSnapshot() (gas: 447956 → 447956 | 0 0.000%)
━ CapacityBondTest::test_updateRegion_revertsWhenNodeNotActive() (gas: 15675 → 15675 | 0 0.000%)
━ ContentBlacklistTest::test_addHashGlobal_andQuery() (gas: 38191 → 38191 | 0 0.000%)
━ ContentBlacklistTest::test_addHashGlobal_revertsWithoutGovernanceRole() (gas: 14608 → 14608 | 0 0.000%)
━ ContentBlacklistTest::test_addHashRegional_globalTakesPrecedence() (gas: 41980 → 41980 | 0 0.000%)
━ ContentBlacklistTest::test_addHashRegional_revertsWithoutRegionalBodyRole() (gas: 14684 → 14684 | 0 0.000%)
━ ContentBlacklistTest::test_addOperator_callsEjectOnCapacityBond() (gas: 91570 → 91570 | 0 0.000%)
━ ContentBlacklistTest::test_fullAppealFlow_ratifyRemovesHash() (gas: 275665 → 275665 | 0 0.000%)
━ ContentBlacklistTest::test_hasActiveAppeal_clearedOnLapseOpen() (gas: 242221 → 242221 | 0 0.000%)
━ ContentBlacklistTest::test_hasActiveAppeal_clearedOnReject() (gas: 433926 → 433926 | 0 0.000%)
━ ContentBlacklistTest::test_hasActiveAppeal_clearedOnReverse() (gas: 254985 → 254985 | 0 0.000%)
━ ContentBlacklistTest::test_openBlacklistAppeal_revertsDuplicatePerHash() (gas: 356697 → 356697 | 0 0.000%)
━ ContentBlacklistTest::test_openBlacklistAppeal_revertsOnEntryNotBlacklisted() (gas: 18635 → 18635 | 0 0.000%)
━ ContentBlacklistTest::test_openBlacklistAppeal_revertsOnZeroRegion() (gas: 16243 → 16243 | 0 0.000%)
━ ContentBlacklistTest::test_regionalCap_blocksMoreThanThreeActiveAppeals() (gas: 706667 → 706667 | 0 0.000%)
━ ContentBlacklistTest::test_registerRegionalBody_revertsWithoutGovernanceRole() (gas: 14830 → 14830 | 0 0.000%)
━ ContentBlacklistTest::test_rejectAppeal_burnsBond() (gas: 247882 → 247882 | 0 0.000%)
━ ContentBlacklistTest::test_removeHashRegional_blocksGlobalRegionEntries() (gas: 44419 → 44419 | 0 0.000%)
━ ContentBlacklistTest::test_reverseAppeal_clearsSuspendedAndBurnsBond() (gas: 261664 → 261664 | 0 0.000%)
━ ContentBlacklistTest::test_setAppealBond_revertsWithoutGovernanceRole() (gas: 14754 → 14754 | 0 0.000%)
━ DecdnGovernorTest::test_ageRampMonthsAt_preservesPriorReadAfterLaterPush() (gas: 4104760 → 4104760 | 0 0.000%)
━ DecdnGovernorTest::test_getVotes_halfRamp() (gas: 173099 → 173099 | 0 0.000%)
━ DecdnGovernorTest::test_getVotes_historicalSnapshotIgnoresFutureSlash() (gas: 221405 → 221405 | 0 0.000%)
━ DecdnGovernorTest::test_getVotes_ramp() (gas: 173020 → 173020 | 0 0.000%)
━ DecdnGovernorTest::test_getVotes_recoversAfterWindowSlidesPastSlash() (gas: 196808 → 196808 | 0 0.000%)
━ DecdnGovernorTest::test_getVotes_uncappedWhenBelowCap() (gas: 173006 → 173006 | 0 0.000%)
━ DecdnGovernorTest::test_getVotes_zeroIfNeverBonded() (gas: 93593 → 93593 | 0 0.000%)
━ DecdnGovernorTest::test_getVotes_zeroWhenSlashedInWindow() (gas: 119032 → 119032 | 0 0.000%)
━ DecdnGovernorTest::test_proposalThreshold_isPointOnePercent() (gas: 71807 → 71807 | 0 0.000%)
━ DecdnGovernorTest::test_quorum_isFourPercentOfTotalBytesInWindow() (gas: 71639 → 71639 | 0 0.000%)
━ DecdnGovernorTest::test_setAgeRampMonths_revertsWithoutTimelockCaller() (gas: 11013 → 11013 | 0 0.000%)
━ DecdnGovernorTest::test_setVoteCapBps_revertsWithoutTimelockCaller() (gas: 11066 → 11066 | 0 0.000%)
━ DecdnGovernorTest::test_voteCapBpsAt_preservesPriorReadAfterLaterPush() (gas: 4104884 → 4104884 | 0 0.000%)
━ FeeRouterTest::test_bytesInWindow_sumsTrailingWindow() (gas: 497291 → 497291 | 0 0.000%)
━ FeeRouterTest::test_bytesInWindow_zeroWindowReturnsZero() (gas: 9326 → 9326 | 0 0.000%)
━ FeeRouterTest::test_pause_revertsWithoutRole() (gas: 14609 → 14609 | 0 0.000%)
━ FeeRouterTest::test_routeSettlement_distributesThreeLegs() (gas: 232441 → 232441 | 0 0.000%)
━ FeeRouterTest::test_routeSettlement_dustRoutesToOperatorWhenBuybackUnset() (gas: 141838 → 141838 | 0 0.000%)
━ FeeRouterTest::test_routeSettlement_incrementsBytesPerEpoch() (gas: 221457 → 221457 | 0 0.000%)
━ FeeRouterTest::test_routeSettlement_revertsWithoutRouterRole() (gas: 89208 → 89208 | 0 0.000%)
━ FeeRouterTest::test_setBuybackBurner_revertsWithoutRole() (gas: 14720 → 14720 | 0 0.000%)
━ FeeRouterTest::test_setSharesAndDestinations_revertsWithoutRole() (gas: 19569 → 19569 | 0 0.000%)
━ FeeRouterTest::test_setShares_rejectsNonZeroShareWithoutDestination() (gas: 16239 → 16239 | 0 0.000%)
━ FeeRouterTest::test_setShares_rejectsSumNot10000() (gas: 14523 → 14523 | 0 0.000%)
━ FeeRouterTest::test_setShares_revertsWithoutRole() (gas: 15219 → 15219 | 0 0.000%)
━ FeeRouterTest::test_setTreasury_revertsWithoutRole() (gas: 14696 → 14696 | 0 0.000%)
━ FeeRouterTest::test_setWindowEpochs_enforcesBounds() (gas: 32780 → 32780 | 0 0.000%)
━ FeeRouterTest::test_setWindowEpochs_revertsWithoutRole() (gas: 14688 → 14688 | 0 0.000%)
━ FeeRouterTest::test_unpause_revertsWithoutRole() (gas: 72166 → 72166 | 0 0.000%)
━ PublisherRegistryTest::test_claimContent_multiClaimAcrossNamespaces() (gas: 233820 → 233820 | 0 0.000%)
━ PublisherRegistryTest::test_claimContent_recordsClaim() (gas: 134733 → 134733 | 0 0.000%)
━ PublisherRegistryTest::test_claimContent_revertsForDefaultOpenNamespace() (gas: 13756 → 13756 | 0 0.000%)
━ PublisherRegistryTest::test_claimContent_revertsIfNotOwner() (gas: 66829 → 66829 | 0 0.000%)
━ PublisherRegistryTest::test_claimContent_revertsOnDuplicateSameNamespace() (gas: 135319 → 135319 | 0 0.000%)
━ PublisherRegistryTest::test_constructor_revertsZeroAdmin() (gas: 36674 → 36674 | 0 0.000%)
━ PublisherRegistryTest::test_constructor_setsDefaultsAndRoles() (gas: 19037 → 19037 | 0 0.000%)
━ PublisherRegistryTest::test_createNamespace_assignsIdsFromOne() (gas: 92728 → 92728 | 0 0.000%)
━ PublisherRegistryTest::test_createNamespace_revertsAtCap() (gas: 98581 → 98581 | 0 0.000%)
━ PublisherRegistryTest::test_createNamespace_zeroIsNeverAssigned() (gas: 65471 → 65471 | 0 0.000%)
━ PublisherRegistryTest::test_namespaceOf_emptyForUnclaimed() (gas: 8273 → 8273 | 0 0.000%)
━ PublisherRegistryTest::test_setMaxNamespaces_revertsOutOfBounds() (gas: 17605 → 17605 | 0 0.000%)
━ PublisherRegistryTest::test_setMaxNamespaces_revertsWithoutRole() (gas: 13384 → 13384 | 0 0.000%)
━ PublisherRegistryTest::test_setMaxNamespaces_withinBounds() (gas: 20687 → 20687 | 0 0.000%)
━ PublisherRegistryTest::test_setTransferTimelock_revertsOutOfBounds() (gas: 17706 → 17706 | 0 0.000%)
━ PublisherRegistryTest::test_setTransferTimelock_revertsWithoutRole() (gas: 14763 → 14763 | 0 0.000%)
━ PublisherRegistryTest::test_setTransferTimelock_withinBounds() (gas: 20560 → 20560 | 0 0.000%)
━ PublisherRegistryTest::test_transfer_cancelByOwner() (gas: 78668 → 78668 | 0 0.000%)
━ PublisherRegistryTest::test_transfer_cancelRevertsIfNotOwner() (gas: 93302 → 93302 | 0 0.000%)
━ PublisherRegistryTest::test_transfer_finalizeRevertsIfNotPendingOwner() (gas: 93817 → 93817 | 0 0.000%)
━ PublisherRegistryTest::test_transfer_finalizeRevertsNoPending() (gas: 68544 → 68544 | 0 0.000%)
━ PublisherRegistryTest::test_transfer_fullFlow() (gas: 98658 → 98658 | 0 0.000%)
━ PublisherRegistryTest::test_transfer_initiateRevertsIfNotOwner() (gas: 66923 → 66923 | 0 0.000%)
━ PublisherRegistryTest::test_transfer_initiateRevertsZeroNewOwner() (gas: 64330 → 64330 | 0 0.000%)
━ PublisherRegistryTest::test_transfer_revertsWhenRecipientAtCap() (gas: 150145 → 150145 | 0 0.000%)
━ PublisherRegistryTest::test_transfer_selfTransferExemptFromCap() (gas: 95404 → 95404 | 0 0.000%)
━ SlashAppealTest::test_cleanup_fastTrackedLapse_grantsOperatorFavorable() (gas: 428049 → 428049 | 0 0.000%)
━ SlashAppealTest::test_cleanup_openLapse_upholds() (gas: 446574 → 446574 | 0 0.000%)
━ SlashAppealTest::test_fastTrack_requiresMultisig() (gas: 457915 → 457915 | 0 0.000%)
━ SlashAppealTest::test_frequencyCap_blocksSecondAppealWithinWindow() (gas: 556749 → 556749 | 0 0.000%)
━ SlashAppealTest::test_grant_olderAppeal_preservesNewerSlashZeroOut() (gas: 549327 → 549327 | 0 0.000%)
━ SlashAppealTest::test_grant_refundsOperatorAndBondAndClearsZeroOut() (gas: 434893 → 434893 | 0 0.000%)
━ SlashAppealTest::test_grant_requiresGovernance() (gas: 468587 → 468587 | 0 0.000%)
━ SlashAppealTest::test_grant_restoresCreditVestingNotLiquid() (gas: 548160 → 548160 | 0 0.000%)
━ SlashAppealTest::test_grant_revertsIfNotFastTracked() (gas: 460295 → 460295 | 0 0.000%)
━ SlashAppealTest::test_open_locksEscrowAndPullsBond() (gas: 464294 → 464294 | 0 0.000%)
━ SlashAppealTest::test_open_revertsAfterFilingWindow() (gas: 455166 → 455166 | 0 0.000%)
━ SlashAppealTest::test_open_revertsForNonOperator() (gas: 468952 → 468952 | 0 0.000%)
━ SlashAppealTest::test_open_revertsOnDoubleAppeal() (gas: 460120 → 460120 | 0 0.000%)
━ SlashAppealTest::test_open_revertsUnknownSlash() (gas: 23820 → 23820 | 0 0.000%)
━ SlashAppealTest::test_pause_extendsFilingWindow() (gas: 381121 → 381121 | 0 0.000%)
━ SlashAppealTest::test_reject_burnsBondAndDistributesEscrow() (gas: 451073 → 451073 | 0 0.000%)
━ SlashAppealTest::test_uphold_distributesEscrowAndSplitsBond() (gas: 487514 → 487514 | 0 0.000%)
━ SlashAppealTest::test_uphold_poolUnset_burnsFullBond() (gas: 2147444 → 2147444 | 0 0.000%)
━ TestnetFaucetTest::testFuzz_claim_atOrAboveCooldown(uint256) (gas: 91528 → 91528 | 0 0.000%)
━ TestnetFaucetTest::testFuzz_claim_belowCooldown(uint256) (gas: 85389 → 85389 | 0 0.000%)
━ TestnetFaucetTest::test_admin_canGrantAndRevokeRoles() (gas: 56401 → 56401 | 0 0.000%)
━ TestnetFaucetTest::test_claim_blocksReentrancy() (gas: 1550228 → 1550228 | 0 0.000%)
━ TestnetFaucetTest::test_claim_happyPath() (gas: 82821 → 82821 | 0 0.000%)
━ TestnetFaucetTest::test_claim_perCallerCooldownIndependence() (gas: 133478 → 133478 | 0 0.000%)
━ TestnetFaucetTest::test_claim_revertsBeforeCooldown() (gas: 83092 → 83092 | 0 0.000%)
━ TestnetFaucetTest::test_claim_revertsOnInsufficientBalance() (gas: 50715 → 50715 | 0 0.000%)
━ TestnetFaucetTest::test_claim_revertsOneSecondBeforeCooldownBoundary() (gas: 82996 → 82996 | 0 0.000%)
━ TestnetFaucetTest::test_claim_revertsWhenPaused() (gas: 39998 → 39998 | 0 0.000%)
━ TestnetFaucetTest::test_claim_succeedsAfterCooldown() (gas: 90430 → 90430 | 0 0.000%)
━ TestnetFaucetTest::test_claim_succeedsAtExactCooldownBoundary() (gas: 87103 → 87103 | 0 0.000%)
━ TestnetFaucetTest::test_constructor_allowsZeroCooldown() (gas: 1810378 → 1810378 | 0 0.000%)
━ TestnetFaucetTest::test_constructor_revertsOnCooldownExceedingMax() (gas: 1015061 → 1015061 | 0 0.000%)
━ TestnetFaucetTest::test_constructor_revertsOnMainnetChainId() (gas: 988198 → 988198 | 0 0.000%)
━ TestnetFaucetTest::test_constructor_revertsOnZeroAdmin() (gas: 985898 → 985898 | 0 0.000%)
━ TestnetFaucetTest::test_constructor_revertsOnZeroClaimAmount() (gas: 988045 → 988045 | 0 0.000%)
━ TestnetFaucetTest::test_constructor_revertsOnZeroFunding() (gas: 988061 → 988061 | 0 0.000%)
━ TestnetFaucetTest::test_constructor_revertsOnZeroGovernance() (gas: 985864 → 985864 | 0 0.000%)
━ TestnetFaucetTest::test_constructor_revertsOnZeroPauser() (gas: 985954 → 985954 | 0 0.000%)
━ TestnetFaucetTest::test_constructor_revertsOnZeroTokenAddress() (gas: 70468 → 70468 | 0 0.000%)
━ TestnetFaucetTest::test_constructor_revertsOnZeroTreasury() (gas: 987830 → 987830 | 0 0.000%)
━ TestnetFaucetTest::test_constructor_revertsWhenTreasuryNotApproved() (gas: 1110690 → 1110690 | 0 0.000%)
━ TestnetFaucetTest::test_constructor_setsStateAndRoles() (gas: 43070 → 43070 | 0 0.000%)
━ TestnetFaucetTest::test_nonAdmin_cannotGrantRoles() (gas: 17889 → 17889 | 0 0.000%)
━ TestnetFaucetTest::test_pause_blocksClaimUnpauseRestores() (gas: 91691 → 91691 | 0 0.000%)
━ TestnetFaucetTest::test_pause_revertsOnNonPauser() (gas: 14607 → 14607 | 0 0.000%)
━ TestnetFaucetTest::test_setClaimAmount_revertsOnNonGovernance() (gas: 14702 → 14702 | 0 0.000%)
━ TestnetFaucetTest::test_setClaimAmount_revertsOnZero() (gas: 13338 → 13338 | 0 0.000%)
━ TestnetFaucetTest::test_setClaimAmount_updatesAndEmits() (gas: 22083 → 22083 | 0 0.000%)
━ TestnetFaucetTest::test_setCooldown_acceptsMaxCooldown() (gas: 20228 → 20228 | 0 0.000%)
━ TestnetFaucetTest::test_setCooldown_allowsZero() (gas: 94920 → 94920 | 0 0.000%)
━ TestnetFaucetTest::test_setCooldown_revertsOnExceedingMax() (gas: 13790 → 13790 | 0 0.000%)
━ TestnetFaucetTest::test_setCooldown_revertsOnNonGovernance() (gas: 14705 → 14705 | 0 0.000%)
━ TestnetFaucetTest::test_setCooldown_updatesAndEmits() (gas: 22231 → 22231 | 0 0.000%)
━ TestnetFaucetTest::test_timeUntilNext_tracksCooldownWindow() (gas: 82615 → 82615 | 0 0.000%)
━ TestnetFaucetTest::test_timeUntilNext_zeroBeforeFirstClaim() (gas: 10099 → 10099 | 0 0.000%)
━ TestnetFaucetTest::test_unpause_revertsOnNonPauser() (gas: 43483 → 43483 | 0 0.000%)
━ TestnetFaucetTest::test_withdraw_revertsOnInsufficientBalance() (gas: 26877 → 26877 | 0 0.000%)
━ TestnetFaucetTest::test_withdraw_revertsOnNonGovernance() (gas: 17089 → 17089 | 0 0.000%)
━ TestnetFaucetTest::test_withdraw_revertsOnZeroAmount() (gas: 20838 → 20838 | 0 0.000%)
━ TestnetFaucetTest::test_withdraw_revertsOnZeroTo() (gas: 18662 → 18662 | 0 0.000%)
━ TestnetFaucetTest::test_withdraw_transfersAndEmits() (gas: 44129 → 44129 | 0 0.000%)
━ TestnetFaucetTest::test_withdraw_worksWhilePaused() (gas: 68286 → 68286 | 0 0.000%)
━ TokenTest::testFuzz_burn_reducesSupplyByExactAmount(uint256) (gas: 27700 → 27700 | 0 0.000%)
━ TokenTest::test_burnFrom_consumesAllowance() (gas: 38534 → 38534 | 0 0.000%)
━ TokenTest::test_burn_reducesTotalSupplyAndBalance() (gas: 26044 → 26044 | 0 0.000%)
━ TokenTest::test_constructor_metadata() (gas: 17896 → 17896 | 0 0.000%)
━ TokenTest::test_constructor_mintsFullSupplyToHolder() (gas: 12954 → 12954 | 0 0.000%)
━ TokenTest::test_constructor_revertsOnZeroInitialHolder() (gas: 83264 → 83264 | 0 0.000%)
━ TokenTest::test_constructor_totalSupplyConstantMatches() (gas: 9364 → 9364 | 0 0.000%)
━ TokenTest::test_noMintFunctionExposed() (gas: 10765 → 10765 | 0 0.000%)
━ TokenTest::test_noVotesSurfaceExposed() (gas: 11991 → 11991 | 0 0.000%)
━ TokenTest::test_permit_setsAllowance() (gas: 67380 → 67380 | 0 0.000%)
↑ GovernanceLifecycleTest::test_lifecycle_PublisherRegistry_setNamespaceTransferTimelock_outOfBounds() (gas: 597013 → 597036 | 23 0.004%)
↑ GovernanceLifecycleTest::test_lifecycle_DecdnGovernor_setAgeRampMonths_outOfBounds() (gas: 636195 → 636220 | 25 0.004%)
↑ GovernanceLifecycleTest::test_lifecycle_CapacityBond_setMinStake_outOfBounds() (gas: 594539 → 594563 | 24 0.004%)
↑ GovernanceLifecycleTest::test_lifecycle_FeeRouter_setTreasury_outOfBounds() (gas: 594311 → 594335 | 24 0.004%)
↑ GovernanceLifecycleTest::test_lifecycle_ContentBlacklist_addOperator_happy() (gas: 637740 → 637766 | 26 0.004%)
↑ GovernanceLifecycleTest::test_lifecycle_FeeRouter_setShares_happy() (gas: 608137 → 608162 | 25 0.004%)
↑ GovernanceLifecycleTest::test_lifecycle_DecdnGovernor_setAgeRampMonths_happy() (gas: 630476 → 630502 | 26 0.004%)
↑ GovernanceLifecycleTest::test_lifecycle_CapacityBond_setMaxMultiaddrSize_outOfBounds() (gas: 594518 → 594543 | 25 0.004%)
↑ GovernanceLifecycleTest::test_lifecycle_ContentBlacklist_addHashGlobal_happy() (gas: 609065 → 609091 | 26 0.004%)
↑ GovernanceLifecycleTest::test_lifecycle_ContentBlacklist_setOriginBlacklist_outOfBounds() (gas: 597561 → 597587 | 26 0.004%)
↑ GovernanceLifecycleTest::test_lifecycle_FeeRouter_setWindowEpochs_outOfBounds() (gas: 596833 → 596859 | 26 0.004%)
↑ GovernanceLifecycleTest::test_lifecycle_SlashAppeal_setAppealBond_happy() (gas: 591170 → 591196 | 26 0.004%)
↓ GovernanceLifecycleTest::test_lifecycle_FeeRouter_setWindowEpochs_happy() (gas: 610850 → 610809 | -41 -0.007%)
↓ GovernanceLifecycleTest::test_lifecycle_CapacityBond_setRegionStabilityWindow_outOfBounds() (gas: 594538 → 594497 | -41 -0.007%)
↓ GovernanceLifecycleTest::test_lifecycle_SlashAppeal_setChallengerIncentivePool_happy() (gas: 591586 → 591545 | -41 -0.007%)
↓ GovernanceLifecycleTest::test_lifecycle_CapacityBond_setUnbondingPeriod_happy() (gas: 588736 → 588695 | -41 -0.007%)
↓ GovernanceLifecycleTest::test_lifecycle_DecdnGovernor_setVoteCapBps_outOfBounds() (gas: 636258 → 636195 | -63 -0.010%)
↓ GovernanceLifecycleTest::test_lifecycle_DecdnGovernor_setVoteCapBps_happy() (gas: 630594 → 630531 | -63 -0.010%)
↓ GovernanceLifecycleTest::test_lifecycle_FeeRouter_setSharesAndDestinations_happy() (gas: 622058 → 621995 | -63 -0.010%)
↓ GovernanceLifecycleTest::test_lifecycle_ContentBlacklist_removeOperator_happy() (gas: 1022353 → 1022249 | -104 -0.010%)
↓ GovernanceLifecycleTest::test_lifecycle_ContentBlacklist_registerRegionalBody_happy() (gas: 610683 → 610620 | -63 -0.010%)
↓ GovernanceLifecycleTest::test_lifecycle_ContentBlacklist_setOriginBlacklist_happy() (gas: 609817 → 609754 | -63 -0.010%)
↓ GovernanceLifecycleTest::test_lifecycle_CapacityBond_setTreasury_happy() (gas: 606310 → 606247 | -63 -0.010%)
↓ GovernanceLifecycleTest::test_lifecycle_CapacityBond_setMultiaddrUpdateCooldown_happy() (gas: 605817 → 605754 | -63 -0.010%)
↓ GovernanceLifecycleTest::test_lifecycle_ContentBlacklist_removeHashGlobal_happy() (gas: 993965 → 993861 | -104 -0.010%)
↓ GovernanceLifecycleTest::test_lifecycle_ContentBlacklist_removeHashGlobal_outOfBounds() (gas: 599289 → 599226 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_FeeRouter_setSharesAndDestinations_outOfBounds() (gas: 597749 → 597686 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_ContentBlacklist_setAppealBond_outOfBounds() (gas: 597062 → 596999 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_SlashAppeal_setAppealBond_outOfBounds() (gas: 597059 → 596996 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_PublisherRegistry_setMaxNamespacesPerPublisher_outOfBounds() (gas: 597057 → 596994 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_SlashAppeal_setChallengerIncentivePool_outOfBounds() (gas: 596910 → 596847 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_ContentBlacklist_addOperator_outOfBounds() (gas: 596878 → 596815 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_ContentBlacklist_addHashGlobal_outOfBounds() (gas: 596741 → 596678 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_FeeRouter_setBuybackBurner_outOfBounds() (gas: 596566 → 596503 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_FeeRouter_setShares_outOfBounds() (gas: 596546 → 596483 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_CapacityBond_setClaimSlashGateEpochs_outOfBounds() (gas: 594692 → 594629 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_CapacityBond_setUnbondingPeriod_outOfBounds() (gas: 594631 → 594568 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_CapacityBond_setMultiaddrUpdateCooldown_outOfBounds() (gas: 594577 → 594514 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_PublisherRegistry_setMaxNamespacesPerPublisher_happy() (gas: 591479 → 591416 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_PublisherRegistry_setNamespaceTransferTimelock_happy() (gas: 591373 → 591310 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_ContentBlacklist_setAppealBond_happy() (gas: 591164 → 591101 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_FeeRouter_setTreasury_happy() (gas: 589150 → 589087 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_FeeRouter_setBuybackBurner_happy() (gas: 589124 → 589061 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_CapacityBond_setClaimSlashGateEpochs_happy() (gas: 588999 → 588936 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_CapacityBond_setMinStake_happy() (gas: 588745 → 588682 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_CapacityBond_setRegionStabilityWindow_happy() (gas: 588677 → 588614 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_lifecycle_CapacityBond_setMaxMultiaddrSize_happy() (gas: 588656 → 588593 | -63 -0.011%)
↓ GovernanceLifecycleTest::test_canary_governanceRoleHandoff() (gas: 98972 → 98950 | -22 -0.022%)
↑ GovernanceLifecycleTest::test_canary_governorVoteWeightWired() (gas: 129736 → 129803 | 67 0.052%)
↓ GovernanceLifecycleTest::test_canary_executorIsTimelock() (gas: 9905 → 9883 | -22 -0.222%)
↓ PublisherRegistryTest::testFuzz_createNamespace_idsAreSequentialAndOwned(uint8) (gas: 427148 → 400006 | -27142 -6.354%)

New tests:
  + DeployProtocolTest::test_assertNoBackDoors_revertsWhenHandoffIncomplete()
  + DeployProtocolTest::test_assertNoBackDoors_revertsWhenTimelockMissingRole()
  + DeployProtocolTest::test_crossContractWiring_capacityBondPeerRoles()
  + DeployProtocolTest::test_crossContractWiring_genesisGrantorIsTimelock()
  + DeployProtocolTest::test_crossContractWiring_slashAppealChallengerPool()
  + DeployProtocolTest::test_deployTargets_revertsOnZeroChallengerIncentivePool()
  + DeployProtocolTest::test_deployTargets_revertsOnZeroDeployer()
  + DeployProtocolTest::test_deployTargets_revertsOnZeroEd25519Verifier()
  + DeployProtocolTest::test_deployTargets_revertsOnZeroEmergencyMultisig()
  + DeployProtocolTest::test_deployTargets_revertsOnZeroInitialTokenHolder()
  + DeployProtocolTest::test_deployTargets_revertsOnZeroUsdc()
  + DeployProtocolTest::test_feeRouter_launchSharesDormantBuyback()
  + DeployProtocolTest::test_feeRouter_treasuryIsTimelock()
  + DeployProtocolTest::test_governor_openExecutor()
  + DeployProtocolTest::test_governor_timelockBinding()
  + DeployProtocolTest::test_roleMatrix_deployerHoldsNoRoleAnywhere()
  + DeployProtocolTest::test_roleMatrix_emergencyMultisigGrants()
  + DeployProtocolTest::test_roleMatrix_timelockHoldsDefaultAdminOnEveryTarget()
  + DeployProtocolTest::test_roleMatrix_timelockHoldsGovernanceOnEveryTarget()
  + DeployProtocolTest::test_token_initialHolderHoldsFullSupply()
  + DeployProtocolScriptTest::test_readConfig_appliesDefaultsForOptionalVars()
  + DeployProtocolScriptTest::test_readConfig_deployerIsTxOrigin()
  + DeployProtocolScriptTest::test_run_abortsBeforeBroadcastWhenManifestExists()
  + DeployProtocolScriptTest::test_run_revertsIfDeployerIsForgeDefaultSender()
  + DeployProtocolScriptTest::test_writeManifest_overwritesWhenForced()
  + DeployProtocolScriptTest::test_writeManifest_revertsOnExistingFile()
  + DeployProtocolScriptTest::test_writeManifest_writesAllAddresses()
  + Ed25519VerifierTest::test_MalleatedScalarRejected()
  + Ed25519VerifierTest::test_NonCanonicalYRejected()
  + Ed25519VerifierTest::test_OffCurvePubKeyRejected()
  + Ed25519VerifierTest::test_SmallOrderPubKeyRejected()
  + Ed25519VerifierTest::test_SmallOrderRRejected()
  + Ed25519VerifierTest::test_ValidVectorsAccepted()
  + Ed25519VerifierTest::test_VerifyRunsUnderStaticcall()
  + Ed25519VerifierTest::test_WrongLengthSignatureRejected()
  + Ed25519VerifierTest::test_WrongMessageRejected()
  + Ed25519VerifierTest::test_WrongPubKeyRejected()
  + Ed25519VerifierTest::test_WrongRRejected()
  + Ed25519VerifierTest::test_WrongSRejected()
  + PaymentChannelTest::testFuzz_settle_refundEqualsDepositMinusClaimed(uint256,uint256)
  + PaymentChannelTest::testFuzz_withdrawThenSettle_partitionsClaim(uint256,uint256,uint256,uint256)
  + PaymentChannelTest::test_close_afterWithdraw_settleRoutesRemainderOnly()
  + PaymentChannelTest::test_close_atWatermarkNonce_succeeds()
  + PaymentChannelTest::test_close_revertsAfterExpiry()
  + PaymentChannelTest::test_close_revertsOnAmountExceedingDeposit()
  + PaymentChannelTest::test_close_revertsOnByteOnlyAdvance()
  + PaymentChannelTest::test_close_then_settle_routesAndRefunds()
  + PaymentChannelTest::test_close_thirdPartyCannotClose()
  + PaymentChannelTest::test_constructor_revertsOnDisputeWindowOutOfBounds()
  + PaymentChannelTest::test_constructor_revertsOnEoaFeeRouter()
  + PaymentChannelTest::test_constructor_revertsOnZeroAdmin()
  + PaymentChannelTest::test_dispute_higherNonceWins()
  + PaymentChannelTest::test_dispute_revertsAfterDeadline()
  + PaymentChannelTest::test_dispute_revertsOnAmountExceedingDeposit()
  + PaymentChannelTest::test_dispute_revertsOnAmountRegression()
  + PaymentChannelTest::test_dispute_revertsOnByteOnlyAdvance()
  + PaymentChannelTest::test_dispute_revertsOnBytesRegression()
  + PaymentChannelTest::test_dispute_revertsOnStaleNonce()
  + PaymentChannelTest::test_forcedInclusion_doesNotExtendTwice()
  + PaymentChannelTest::test_forcedInclusion_extendsDeadlineOnce()
  + PaymentChannelTest::test_forcedInclusion_noExtendWhenAmpleTimeRemains()
  + PaymentChannelTest::test_getRateBounds_returnsConfigured()
  + PaymentChannelTest::test_normalDispute_doesNotExtend()
  + PaymentChannelTest::test_openChannel_derivesIdAndIncrementsNonce()
  + PaymentChannelTest::test_openChannel_distinctIdsAcrossProviders()
  + PaymentChannelTest::test_openChannel_revertsBelowMinDeposit()
  + PaymentChannelTest::test_openChannel_revertsOnInactiveProvider()
  + PaymentChannelTest::test_openChannel_revertsWhenPaused()
  + PaymentChannelTest::test_paused_exitsStillCallable()
  + PaymentChannelTest::test_reclaimExpired_refundsRemainderToClient()
  + PaymentChannelTest::test_reclaimExpired_revertsBeforeExpiry()
  + PaymentChannelTest::test_setDisputeWindow_enforcesBounds()
  + PaymentChannelTest::test_setFeeRouter_revertsOnEoaRouter()
  + PaymentChannelTest::test_setFeeRouter_revertsOnZeroAndUnchanged()
  + PaymentChannelTest::test_setFeeRouter_updatesTarget()
  + PaymentChannelTest::test_setters_onlyGovernance()
  + PaymentChannelTest::test_settle_amountEqualsDeposit_zeroRefund()
  + PaymentChannelTest::test_settle_fullyWithdrawn_noRouterCall()
  + PaymentChannelTest::test_settle_revertsBeforeDisputeDeadline()
  + PaymentChannelTest::test_topUp_increasesDeposit()
  + PaymentChannelTest::test_topUp_onlyClient()
  + PaymentChannelTest::test_voucher_rejectedOnWrongChannelId()
  + PaymentChannelTest::test_withdraw_acceptsErc1271Signature()
  + PaymentChannelTest::test_withdraw_onlyProvider()
  + PaymentChannelTest::test_withdraw_revertsOnAmountExceedingDeposit()
  + PaymentChannelTest::test_withdraw_revertsOnBadSignature()
  + PaymentChannelTest::test_withdraw_revertsOnBytesRegression()
  + PaymentChannelTest::test_withdraw_revertsOnNonMonotonicNonce()
  + PaymentChannelTest::test_withdraw_revertsWhenDeltaZero()
  + PaymentChannelTest::test_withdraw_routesDeltaAndAdvancesWatermark()
  + PaymentChannelTest::test_withdraw_secondWithdrawRoutesOnlyIncrement()
  + PaymentChannelTest::test_zeroVoucherClose_disabledAfterWithdraw()
  + PaymentChannelTest::test_zeroVoucherClose_refundsFullDeposit()

--------------------------------------------------------------------------------
Total tests: 262, ↑ 13, ↓ 38, ━ 211
Overall gas change: -29016 (-0.031%)

Run: 26668559609

@github-actions

github-actions Bot commented May 29, 2026 •

Copy link
Copy Markdown

Contracts coverage

Line coverage: 85.40% (1369/1603 lines)
▲ +0.53pp vs base (84.87% → 85.40%)
Run: 26668559609

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.

Pull request overview

Adds the ADR 003 PaymentChannel Solidity surface for USDC-denominated off-chain settlement, routing provider payouts through FeeRouter and gating channel opens on active CapacityBond operators.

Changes:

  • Introduces PaymentChannel with EIP-712 voucher verification, withdraw/close/dispute/settle/reclaim lifecycle, pause/governance controls, and FeeRouter settlement routing.
  • Adds focused consumer interfaces for FeeRouter.routeSettlement and CapacityBond.isActive.
  • Adds Foundry coverage for channel lifecycle, router delta accounting, governance setters, forced-inclusion extension seam, and settlement conservation fuzzing.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
contracts/src/PaymentChannel.sol Implements the PaymentChannel contract and lifecycle logic.
contracts/src/interfaces/IFeeRouterSettlement.sol Adds the narrow FeeRouter interface consumed by PaymentChannel.
contracts/src/interfaces/ICapacityBondActivity.sol Adds the narrow CapacityBond activity interface consumed by PaymentChannel.
contracts/test/PaymentChannel.t.sol Adds unit and fuzz tests for PaymentChannel behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread contracts/src/PaymentChannel.sol Resolved
Comment thread contracts/src/PaymentChannel.sol Resolved
Comment thread contracts/src/PaymentChannel.sol Resolved
Comment thread contracts/src/PaymentChannel.sol Resolved
…tChannel

Address review on #716:

- closeChannel now goes through _requireOpenAndUnexpired (like topUp/
  withdraw) so it reverts ChannelExpired after expiresAt. Previously a
  provider could close + settle an expired channel and route an
  un-withdrawn claim, bypassing the reclaimExpired forfeiture path that
  refunds deposit - withdrawnAmount to the client (ADR 003
  close-before-expiry obligation).
- setFeeRouter re-applies the constructor's code-size invariant
  (FeeRouterHasNoCode), so governance can't point settlement at an EOA
  where _route advances channel state while routeSettlement no-ops.

Adds test_close_revertsAfterExpiry and test_setFeeRouter_revertsOnEoaRouter.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@thiras thiras changed the title feat(contracts): PaymentChannel USDC settlement gateway (#452) feat(contracts): add PaymentChannel USDC settlement gateway (#452) May 29, 2026
… tests

From the multi-agent PR review on #716:

Contract (PaymentChannel.sol):
- Reject byte-only watermark advances at closeChannel/disputeChannel
  (new _requireBytesTrackPayment + ByteAdvanceWithoutPayment error).
  settleChannel forwards bytes only alongside a positive amount delta, so
  a voucher advancing claimedBytes without claimedAmount would otherwise
  silently drop served-byte accounting (ADR 036 vote weight).
- status uint8 constants -> enum Status { Open, Closing, Closed }, matching
  CapacityBond/SlashAppeal.
- Pack the Channel struct: uint64 timestamps + grouped status/extended
  share one slot (cuts ~27k gas on withdraw and across the lifecycle).
- Extract _advanceClaimWatermark(strictNonce) — single enforcement site for
  the monotonicity invariant previously hand-copied across withdraw/close/
  dispute (drift risk).

Tests (PaymentChannel.t.sol): +20 (34 -> 54). Cover zero-remainder settle,
close-at-watermark nonce, deposit boundary + over-deposit reverts, dispute
amount/bytes regression, withdraw zero-delta/bytes-regression, byte-only
advance rejection, ERC-1271 voucher path, cross-channel replay, constructor
reverts, paused-exits-callable, and forced-inclusion negative branches.

ADR 003: setFeeRouter Validation now documents the code-size check; corrected
the stale 3-arg constructor description to the real 8-arg surface; added
settlement-path invariant 5 (byte-only advance rejection).

Full suite: 355 pass, 0 fail.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@thiras
thiras merged commit 1bc5930 into main May 30, 2026
19 checks passed
@thiras
thiras deleted the 452-pr1-payment-channel branch May 30, 2026 00:11
thiras added a commit that referenced this pull request Jun 1, 2026
…rename (#327) (#743)

* feat(node): on-chain PaymentChannel seller settlement + CapacityBond rename (#327)

Implements the on-chain PaymentChannel client (seller/provider settlement
path) for issue #327. The CapacityBond registry read-path was already done
as ChainStakerSet; PaymentChannel.sol landed in #716, so this wires the
Rust side that drives close/withdraw/settle.

- incentive: PaymentChannel sol! bindings (reads + writes + lifecycle
  events), validated field-for-field against the compiled ABI.
- voucher: fix EIP-712 domain name "StablePaymentChannel" -> "PaymentChannel"
  to match the contract's EIP712("PaymentChannel","1") ctor — without this
  every closeChannel/withdraw reverts with InvalidVoucherSignature despite
  off-chain verification passing. Pinned with a regression test.
- store: schema v2 persists the latest voucher signature (additive trailing
  postcard segment; v1 records hydrate with an empty signature and are
  unredeemable until re-recorded). Adds a `get` point-lookup to the trait.
- node: PaymentChannelService watches ChannelOpened (provider==self) -> persist
  so the voucher handler accepts it, ChannelSettled -> forget,
  ChannelCloseInitiated -> observe-only (dispute monitor deferred, #324).
  Redeems via threshold `withdraw` (redeem hint from the voucher-accept path)
  and best-effort `closeChannel` on graceful shutdown, with on-chain v-byte
  normalization (0/1 -> 27/28).
- runtime: wallet-filled provider from the eth signer, usdc() startup
  self-check, redeem_threshold_micro_usdc config (default 1 USDC), shutdown
  close hook.

BREAKING CHANGE: renames StakingRegistry -> CapacityBond. The config TOML key
`blockchain.staking_registry_address` is now `blockchain.capacity_bond_address`,
the CLI flag `--staking-registry-address` is now `--capacity-bond-address`, and
the env var DECDN_STAKING_REGISTRY_ADDRESS is now DECDN_CAPACITY_BOND_ADDRESS.

Out of scope (deferred): buyer-side openChannel for node-to-node pulls, the
in-process dispute monitor (#324), and the live anvil e2e (no existing harness).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(node): address PR review — RPC-cache, parallel shutdown close, topUp + expiry handling (#327)

External review (gemini-code-assist, Copilot) on PR #743:

- redeemer: cache last-known on-chain `withdrawnAmount` per channel and skip
  the `getChannel` RPC when the accrued claim is provably below threshold —
  avoids per-voucher RPC spam under active streaming. The cache is always
  `<=` the true value (only our own `withdraw` advances it), so a redemption
  is never wrongly skipped.
- shutdown close: submit `closeChannel` sequentially (nonce order) but await
  receipts concurrently via `join_all` so more channels close within the
  bounded shutdown deadline. `submit_close` refactored into a free `send_close`
  returning a receipt future (`use<P>` precise capture).
- topUp (Copilot): subscribe to `ChannelToppedUp` and raise the tracked
  `ChannelState.deposit` so `apply_voucher` stops rejecting otherwise-valid
  vouchers a client signs after topping up.
- expiry (Copilot): persist the channel's on-chain `expiresAt` (schema-v2
  second trailing segment), add a periodic pre-expiry close sweep so the
  provider redeems before `reclaimExpired` can refund the client, and gate the
  voucher handler to refuse delivery once a channel is expired (defense in
  depth). Closing earns the claim; the sweep then retires (forgets) the
  channel so the node stops serving it.

Verification: clippy --workspace --all-targets -D warnings, fmt, 1264 tests,
rustdoc -D warnings — all green.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* fix(node): address comprehensive PR review — reverted-tx guard, validation, dead-field + doc fixes, tests (#327)

Multi-agent review of PR #743 (code/tests/errors/types/comments):

Critical:
- try_redeem / send_close now check `receipt.status()`. `get_receipt()`
  resolves Ok even for a reverted tx; previously a reverted `withdraw`
  poisoned the withdrawn-amount cache (channel silently never redeemed again
  until restart) and a reverted `closeChannel` made the expiry sweep forget an
  un-redeemed channel right before reclaimExpired. Both now leave state intact
  and retry.

Important:
- reject `blockchain.redeem_threshold_micro_usdc = 0` at config resolution (0
  withdraws on every voucher and reverts on zero-delta) — mirrors the
  rpc_watchdog floor pattern. Test added.
- correct the `as_bytes()` v-byte docs: alloy already emits 27/28, so
  `normalize_voucher_signature` is a defensive no-op today (not the active
  0/1->27/28 bridge the doc claimed).
- fix module docs: add `ChannelToppedUp` to the watcher's handled-events list;
  correct the "registered at startup" claim (startup is store hydration in
  ClientHandler::new, not register_open_channel); document the
  opened-during-downtime backfill gap.
- drop dead `redeem_threshold` / `self_address` fields from
  PaymentChannelService (read only in Debug; the live values are the copies
  moved into the tasks).

Tests (pure-logic gaps the review flagged):
- extract `is_expired` / `within_close_window` predicates (shared by the sweep
  and the handler expiry gate) + boundary table tests.
- register_open_channel idempotency preserves the voucher watermark (the #527
  replay-window guard) — was untested.
- update_channel_deposit raises / no-ops on non-increasing / no-ops on
  untracked.
- normalize empty signature.

Not changed (with rationale): kept the schema-v2 trailing-segment encoding —
the suggested "struct fields + version bump" breaks reading existing on-disk
v1 records (a v2 reader would read past end-of-input). Deferred to follow-ups:
observability metrics, an independent redeemer tick, shutdown-quiesce of the
redeemer, ChannelState type-strengthening, and the downtime log-backfill.

Verification: clippy --workspace --all-targets -D warnings, fmt, 1270 tests,
rustdoc -D warnings — all green.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

* feat(node): auto-settle closed PaymentChannels after the dispute window (#327)

closeChannel only opens the dispute window; the provider's un-withdrawn
remainder (claimedAmount - withdrawnAmount) is routed only when settleChannel
runs after disputeDeadline. The node never called settleChannel and the expiry
sweep forgot the channel, so when the client had no incentive to settle
(clientRefund == 0) the remainder stranded (PR #743 review by @alpergundogdu).

- Add durable PendingSettleStore (incentive trait + MemoryPendingSettleStore;
  redb-backed via a second `pending_settle_v1` table on the existing channel
  store, sharing one open file + fsync discipline).
- Record a pending-settle entry after every close (shutdown + pre-expiry sweep,
  both via send_close), keyed by channel with the on-chain disputeDeadline gate.
- Add a settle sweep (settle_pass/try_settle) that calls settleChannel once the
  window elapses, gated on the stored deadline to avoid guaranteed-revert gas;
  re-stamps the deadline if a dispute extended it, and drops the entry once a
  ChannelSettled event (from any party) confirms finalization.
- Failed-to-record paths log at error! with the manual settleChannel remedy.

No contract change (settleChannel already exists). Tests cover the store
round-trip/overwrite/forget/persistence, table independence, and the gate
boundary. clippy -D warnings, fmt, docs, and nextest all clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants