Skip to content

Open tier staking with separate APY - #85

Draft
mlukanova wants to merge 1 commit into
mainfrom
feat/staking-open-tier-public
Draft

Open tier staking with separate APY#85
mlukanova wants to merge 1 commit into
mainfrom
feat/staking-open-tier-public

Conversation

@mlukanova

Copy link
Copy Markdown
Collaborator

Summary

Closes #

Surface areas touched

  • Consensus protocol (primary / worker / network / state-sync)
  • Execution / EVM
  • JSON-RPC (eth_*, rayls_*, faucet)
  • Middleware (orchestrator / processor / bridge)
  • Infrastructure (types / storage / config / network-cli)
  • On-chain contracts (rayls-contracts/)
  • Operations (etc/, scripts, Docker, compose)
  • CI / build (.github/workflows/, Makefile)
  • Documentation only (doc/, in-crate READMEs, root docs)
  • Tests only

Breaking / compatibility

None.

Test plan

  • [ ]
  • [ ]

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Claude finished @mlukanova's task in 4m 21s —— View job


PR Review: Open tier staking with separate APY

  • Gather context and understand PR changes
  • Review DelegationPool.sol changes
  • Review RewardDistributor.sol changes
  • Review interface changes (IDelegationPool.sol, IRewardDistributor.sol)
  • Review test changes
  • Post comprehensive review feedback

Summary

This PR introduces a dual-track delegation model: Track A (whitelisted) and Track B (open-tier), each with independent reward accumulators and a configurable APY. The refactoring of _settleArithmetic is clean and reduces duplication. The core accounting logic is sound. Below are the issues found, from most to least critical.


Issues

[Medium] Reward dilution when openTierTargetApyBps is 0

_splitPoolShare in RewardDistributor.sol (L~300) computes weights as trackADelegated * targetApyBps and trackBDelegated * openTierTargetApyBps. When openTierTargetApyBps = 0 but targetApyBps > 0:

  • totalWeight = trackADelegated * targetApyBps > 0
  • trackAShare = poolShare, trackBShare = 0

Track B delegators contribute to totalValidatorStake (reducing the validator's own-reward share), but receive zero organic pool rewards. The NatSpec says "Falls back to pure stake proportion when both APYs are zero" but doesn't cover the case where only openTierTargetApyBps = 0. Until an admin explicitly calls setOpenTierTargetApyBps, open-tier stakers subsidise Track A rewards without earning anything. At minimum the docstring should call this out; ideally add a fallback to stake-proportion when openTierTargetApyBps == 0 && targetApyBps != 0. Fix this →


[Medium] Performance-weight path excludes Track B from validator weight

In the fallback path (totalWeight == 0 from perf), validator weights include Track B: weights[i] = os + ta + tb. In the performance-weight path, perf.weights are computed externally by ConsensusRegistry and historically only reflect stake × headerCount for the validator's own + Track A stake.

This creates an inconsistency: validators with Track B delegators earn proportionally more in the fallback path but not in the performance-weight path. The totalPriorityStake/totalOpenTierStake values correctly feed the APY top-up in both paths, but the per-validator reward allocation diverges.

This may be intentional (performance metrics don't change with Track B entry), but it needs a comment explaining the design choice. Fix this →


[Low] _fetchValidatorStakes makes two external calls to compute Track A

trackB = $.delegationPool.getTotalOpenTierDelegatedStake(validator);
trackA = $.delegationPool.getTotalDelegatedStake(validator) - trackB;

getTotalDelegatedStake now returns totalDelegated + openTierDelegated, so this is correct — but it makes two cross-contract calls where one could do. A dedicated getTotalTrackADelegatedStake view function (or a combined getStakeTotals returning all three values) would halve the gas for this frequently-called path. Fix this →


[Low] Delegated event doesn't expose tier assignment

The existing Delegated event is emitted for both Track A and Track B delegations with no way for off-chain monitors to distinguish them. Adding a bool openTier field (or a separate DelegatedOpenTier event) would allow indexers and explorers to track each pool's TVL split. Fix this →


[Low] Missing cross-track reward distribution test

The fuzz test testFuzz_distributePoolRewards_splitConservesAndProportional tests three delegators but none are open-tier (the whitelist isn't enabled). There is no test that:

  1. Delegates some stake as Track A and some as Track B
  2. Calls distributePoolRewards(validator, trackAAmount, trackBAmount) with non-zero amounts for both tracks
  3. Verifies each track's rewardPerShareAccum is updated independently and pending rewards settle correctly

This is the most novel and complex piece of the change and deserves dedicated coverage.


[Nit] Single-arg distributePoolRewards commission split

In the single-arg overload (used by ConsensusRegistry):

uint256 trackAAmount = (amount * pool.totalDelegated) / totalAll;
uint256 trackBAmount = amount - trackAAmount;

This is proportional by stake, not by APY-weighted stake. It produces a different split than the 3-arg path (which calls _splitPoolShare using APY weights). The two code paths will give different results for the same reward amount when openTierTargetApyBps != targetApyBps. This seems intentional (the single-arg path is a "legacy" proportional split) but should be documented to avoid confusion. Fix this →


What looks good

  • _settleArithmetic refactor cleanly eliminates the duplicated slash+reward logic between _settlePosition and _getEffectivePosition. The four-tuple return and the slash-first ordering are preserved correctly.
  • Tier locking (if (pos.amount > 0) isOpenTier = pos.openTier) is a sensible UX choice so existing open-tier holders can top up without the whitelist reverting on them after it's disabled.
  • Storage upgrade safety is correct: new fields appended to the end of structs in ERC-7201 diamond storage, compatible with UUPS upgrades.
  • The accumulator top-up computation correctly handles the case where only one APY is non-zero.
  • onlyRewardSources modifier correctly guards the 3-arg overload; proof-based delegation correctly always routes to Track A (_delegate(..., false)).
  • NotWhitelisted error is still correctly used in delegateWithProof for invalid Merkle proofs — its removal from the delegate path is the intentional behavior change.

@github-actions

Copy link
Copy Markdown
Contributor

Security Scan - Code

Severity: HIGH, CRITICAL

Vulnerabilities found:

View scan results

Report Summary

┌─────────────────────────────────────────────┬────────────┬─────────────────┬───────────────────┐
│                   Target                    │    Type    │ Vulnerabilities │ Misconfigurations │
├─────────────────────────────────────────────┼────────────┼─────────────────┼───────────────────┤
│ Cargo.lock                                  │   cargo    │        1        │         -         │
├─────────────────────────────────────────────┼────────────┼─────────────────┼───────────────────┤
│ crates/testing/fuzz-targets/Cargo.lock      │   cargo    │        0        │         -         │
├─────────────────────────────────────────────┼────────────┼─────────────────┼───────────────────┤
│ crates/testing/fuzz-targets/fuzz/Cargo.lock │   cargo    │        0        │         -         │
├─────────────────────────────────────────────┼────────────┼─────────────────┼───────────────────┤
│ etc/state-sum/Cargo.lock                    │   cargo    │        0        │         -         │
├─────────────────────────────────────────────┼────────────┼─────────────────┼───────────────────┤
│ etc/tps/package-lock.json                   │    npm     │        0        │         -         │
├─────────────────────────────────────────────┼────────────┼─────────────────┼───────────────────┤
│ rayls-contracts/package-lock.json           │    npm     │        0        │         -         │
├─────────────────────────────────────────────┼────────────┼─────────────────┼───────────────────┤
│ etc/chaos-network/Dockerfile                │ dockerfile │        -        │         0         │
├─────────────────────────────────────────────┼────────────┼─────────────────┼───────────────────┤
│ etc/docker-network/Dockerfile               │ dockerfile │        -        │         0         │
├─────────────────────────────────────────────┼────────────┼─────────────────┼───────────────────┤
│ etc/docker-replay/Dockerfile                │ dockerfile │        -        │         0         │
└─────────────────────────────────────────────┴────────────┴─────────────────┴───────────────────┘
Legend:
- '-': Not scanned
- '0': Clean (no security findings detected)


For OSS Maintainers: VEX Notice
--------------------------------
If you're an OSS maintainer and Trivy has detected vulnerabilities in your project that you believe are not actually exploitable, consider issuing a VEX (Vulnerability Exploitability eXchange) statement.
VEX allows you to communicate the actual status of vulnerabilities in your project, improving security transparency and reducing false positives for your users.
Learn more and start using VEX: https://trivy.dev/docs/v0.70/guide/supply-chain/vex/repo#publishing-vex-documents

To disable this notice, set the TRIVY_DISABLE_VEX_NOTICE environment variable.


Cargo.lock (cargo)
==================
Total: 1 (HIGH: 1, CRITICAL: 0)

┌─────────────┬─────────────────────┬──────────┬────────┬───────────────────┬───────────────┬─────────────────────────────────────────────────────┐
│   Library   │    Vulnerability    │ Severity │ Status │ Installed Version │ Fixed Version │                        Title                        │
├─────────────┼─────────────────────┼──────────┼────────┼───────────────────┼───────────────┼─────────────────────────────────────────────────────┤
│ quinn-proto │ GHSA-4w2j-m93h-cj5j │ HIGH     │ fixed  │ 0.11.14           │ 0.11.15       │ Quinn: Remote memory exhaustion in quinn-proto from │
│             │                     │          │        │                   │               │ unbounded out-of-order stream reassembly            │
│             │                     │          │        │                   │               │ https://github.com/advisories/GHSA-4w2j-m93h-cj5j   │
└─────────────┴─────────────────────┴──────────┴────────┴───────────────────┴───────────────┴─────────────────────────────────────────────────────┘

@github-actions

Copy link
Copy Markdown
Contributor

Contracts Tests (Foundry)

Package: rayls-contracts

All tests passed

View forge test results
Compiling 112 files with Solc 0.8.26
Solc 0.8.26 finished in 16.97s
Compiler run successful with warnings:
Warning (2072): Unused local variable.
    --> test/consensus/DelegationPoolTest.t.sol:1121:9:
     |
1121 |         uint256 poolBalanceBefore = rls.balanceOf(address(pool));
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^

Warning (2072): Unused local variable.
   --> test/fees/FeeAggregatorTest.t.sol:922:9:
    |
922 |         uint256 rls2 = _swapToRls(amount2);
    |         ^^^^^^^^^^^^

Warning (2072): Unused local variable.
   --> test/fees/RewardDistributorTest.t.sol:546:9:
    |
546 |         uint256 expectedTarget = (totalStaked * 5000 * 86400) / (365 days * 10_000);
    |         ^^^^^^^^^^^^^^^^^^^^^^

Warning (2018): Function state mutability can be restricted to pure
  --> test/consensus/DelegationPoolExtendedTest.t.sol:74:5:
   |
74 |     function getValidators(uint8) external view returns (IConsensusRegistry.ValidatorInfo[] memory) {
   |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to pure
  --> test/consensus/DelegationPoolTest.t.sol:75:5:
   |
75 |     function getValidators(uint8) external view returns (IConsensusRegistry.ValidatorInfo[] memory) {
   |     ^ (Relevant source part starts here and spans across multiple lines).


Ran 11 tests for test/mocks/MockAlgebraDexTest.t.sol:MockAlgebraDexTest
[PASS] test_availableRls() (gas: 13831)
[PASS] test_pool_admin_only() (gas: 13183)
[PASS] test_pool_globalState_returns_configured_price() (gas: 11100)
[PASS] test_pool_setPriceFromRatio() (gas: 42740)
[PASS] test_router_admin_only() (gas: 15482)
[PASS] test_swap_basic() (gas: 126588)
[PASS] test_swap_rate_change() (gas: 129469)
[PASS] test_swap_respects_minOut() (gas: 95542)
[PASS] test_swap_reverts_on_expired_deadline() (gas: 92433)
[PASS] test_swap_reverts_when_insufficient_rls() (gas: 105213)
[PASS] test_withdraw() (gas: 50320)
Suite result: ok. 11 passed; 0 failed; 0 skipped; finished in 1.79ms (876.44µs CPU time)

Ran 4 tests for test/fees/FeeAggregatorStorageSlotTest.t.sol:FeeAggregatorStorageSlotTest
[PASS] test_delegationPool_storageSlot_isCorrect() (gas: 3326)
[PASS] test_feeAggregator_storageSlot_isNotStandardDerivation() (gas: 4020)
[PASS] test_rewardDistributor_storageSlot_isCorrect() (gas: 3370)
[PASS] test_rlsAccumulator_storageSlot_isCorrect() (gas: 3348)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 304.81µs (92.74µs CPU time)

Ran 64 tests for test/fees/FeeAggregatorTest.t.sol:FeeAggregatorTest
[PASS] testRevert_addStablecoin_alreadySupported() (gas: 22825)
[PASS] testRevert_addStablecoin_notAdmin() (gas: 566218)
[PASS] testRevert_emergencyWithdrawNative_notAdmin() (gas: 16583)
[PASS] testRevert_emergencyWithdrawNative_zeroAddress() (gas: 16700)
[PASS] testRevert_emergencyWithdraw_notAdmin() (gas: 70461)
[PASS] testRevert_initialize_twice() (gas: 29774)
[PASS] testRevert_receiveFee_unsupportedStablecoin() (gas: 643429)
[PASS] testRevert_receiveFee_zeroAmount() (gas: 23003)
[PASS] testRevert_removeStablecoin_cannotRemoveUsdrToken() (gas: 24936)
[PASS] testRevert_resetPendingDistribution_notAdmin() (gas: 18356)
[PASS] testRevert_setConfig_invalidTotal() (gas: 19143)
[PASS] testRevert_setEcosystemTreasury_zeroAddress() (gas: 18393)
[PASS] testRevert_setRecipient_zeroAddress() (gas: 18371)
[PASS] testRevert_setUsdrToken_poolNotConfigured() (gas: 621588)
[PASS] testRevert_setUsdrToken_unsupportedStablecoin() (gas: 20707)
[PASS] testRevert_setUsdrToken_zeroAddress() (gas: 18494)
[PASS] testRevert_swapToRls_aboveMaxSwap() (gas: 87143)
[PASS] testRevert_swapToRls_belowMinRlsOut_adversePrice() (gas: 178544)
[PASS] testRevert_swapToRls_belowMinSwap() (gas: 79446)
[PASS] testRevert_swapToRls_insufficientBalance() (gas: 82775)
[PASS] testRevert_swapToRls_insufficientSlippage() (gas: 161015)
[PASS] testRevert_swapToRls_notKeeper() (gas: 68283)
[PASS] testRevert_swapToRls_whenPaused() (gas: 98126)
[PASS] test_addStablecoin() (gas: 618695)
[PASS] test_burnBridge_insufficientNativeFee_retainsAndRetries() (gas: 1051447)
[PASS] test_burnBridge_quoteSendReverts_retainsSlice() (gas: 620538)
[PASS] test_burnBridge_sendReverts_retainsSlice() (gas: 612077)
[PASS] test_directRlsTransfer_notDistributed() (gas: 86783)
[PASS] test_distributeEpochFees_burnSliceBridged() (gas: 1006709)
[PASS] test_distributeEpochFees_ecosystemLegFails_retainsAndRetries() (gas: 429725)
[PASS] test_distributeEpochFees_emitsCorrectEvents() (gas: 386886)
[PASS] test_distributeEpochFees_multipleRounds() (gas: 546547)
[PASS] test_distributeEpochFees_onlyKeeper() (gas: 393644)
[PASS] test_distributeEpochFees_revertingRecipientDoesNotBlock() (gas: 429352)
[PASS] test_distributeEpochFees_success() (gas: 387382)
[PASS] test_distributeEpochFees_whenPaused_reverts() (gas: 254211)
[PASS] test_distributeEpochFees_zeroBalance_skipsWithEvent() (gas: 35176)
[PASS] test_emergencyWithdraw() (gas: 94968)
[PASS] test_emergencyWithdrawNative() (gas: 52790)
[PASS] test_emergencyWithdrawNative_emitsEvent() (gas: 53937)
[PASS] test_emergencyWithdrawRls_thenResetPending_resumesNextCycle() (gas: 625121)
[PASS] test_emergencyWithdraw_emitsEvent() (gas: 95727)
[PASS] test_failedDistribution_partialAccounting() (gas: 426714)
[PASS] test_getStats() (gas: 389152)
[PASS] test_getSupportedStablecoins() (gas: 31464)
[PASS] test_initialize() (gas: 41819)
[PASS] test_initialize_defaultConfig() (gas: 21032)
[PASS] test_initialize_defaultSwapLimits() (gas: 18188)
[PASS] test_multipleStablecoinsProcessed() (gas: 354008)
[PASS] test_pause() (gas: 43062)
[PASS] test_pendingRlsForDistribution_trackedBySwap() (gas: 394658)
[PASS] test_receiveFee() (gas: 68225)
[PASS] test_receiveFee_multiple() (gas: 76408)
[PASS] test_removeStablecoin() (gas: 40075)
[PASS] test_removeStablecoin_afterChangingUsdrToken() (gas: 764949)
[PASS] test_setBurnAddress() (gas: 26536)
[PASS] test_setEcosystemTreasury() (gas: 26506)
[PASS] test_setRewardDistributor() (gas: 26375)
[PASS] test_setSwapLimits() (gas: 30346)
[PASS] test_setUsdrToken() (gas: 767740)
[PASS] test_swapToRls() (gas: 228132)
[PASS] test_swapToRls_respectsMinRlsOut_whenSatisfiable() (gas: 230084)
[PASS] test_unpause() (gas: 33112)
[PASS] test_updateConfig_viaTimelock() (gas: 38317)
Suite result: ok. 64 passed; 0 failed; 0 skipped; finished in 17.03ms (15.44ms CPU time)

Ran 30 tests for test/native/NativeTokenControllerTest.t.sol:NativeTokenControllerTest
[PASS] testFuzz_burn_anyAmount(address,uint256) (runs: 250, μ: 22503, ~: 22503)
[PASS] testFuzz_mint_anyAmount(uint256) (runs: 250, μ: 24264, ~: 24264)
[PASS] test_addMinter() (gas: 46272)
[PASS] test_addMinter_revertsOnZeroAddress() (gas: 18351)
[PASS] test_burn_revertsOnPrecompileFailure() (gas: 21846)
[PASS] test_burn_revertsOnZeroAddress() (gas: 18528)
[PASS] test_burn_revertsOnZeroAmount() (gas: 20706)
[PASS] test_burn_success() (gas: 25324)
[PASS] test_constants_precompile() (gas: 13504)
[PASS] test_constants_roles() (gas: 13487)
[PASS] test_implementation_cannotBeInitialized() (gas: 13022)
[PASS] test_initialize_cannotReinitialize() (gas: 17940)
[PASS] test_initialize_revertsOnZeroAdmin() (gas: 1027618)
[PASS] test_initialize_setsAdmin() (gas: 17892)
[PASS] test_initialize_setsUpgraderRole() (gas: 17838)
[PASS] test_isMinter() (gas: 24265)
[PASS] test_mint_revertsOnPrecompileFailure() (gas: 21912)
[PASS] test_mint_revertsOnZeroAddress() (gas: 18549)
[PASS] test_mint_revertsOnZeroAmount() (gas: 20683)
[PASS] test_mint_success() (gas: 26252)
[PASS] test_nonAdminCannotAddMinter() (gas: 19032)
[PASS] test_removeMinter() (gas: 24918)
[PASS] test_roles_adminCanGrantAndRevoke() (gas: 40289)
[PASS] test_roles_minterCanBurn() (gas: 23804)
[PASS] test_roles_minterCanMint() (gas: 23726)
[PASS] test_roles_nonAdminCannotGrant() (gas: 21343)
[PASS] test_roles_nonMinterCannotBurn() (gas: 21275)
[PASS] test_roles_nonMinterCannotMint() (gas: 21230)
[PASS] test_upgrade_nonUpgraderCannotUpgrade() (gas: 963620)
[PASS] test_upgrade_upgraderCanUpgrade() (gas: 968018)
Suite result: ok. 30 passed; 0 failed; 0 skipped; finished in 55.02ms (54.08ms CPU time)

Ran 25 tests for test/fees/RLSAccumulatorTest.t.sol:RLSAccumulatorTest
[PASS] testRevert_deposit_zeroAmount() (gas: 13357)
[PASS] testRevert_initialize_zeroAdmin() (gas: 1244821)
[PASS] testRevert_initialize_zeroDistributor() (gas: 1244758)
[PASS] testRevert_initialize_zeroRls() (gas: 1244787)
[PASS] testRevert_recoverTokens_notAdmin() (gas: 20841)
[PASS] testRevert_recoverTokens_zeroAddress() (gas: 20780)
[PASS] testRevert_revokeApproval_notAdmin() (gas: 18275)
[PASS] testRevert_setRewardDistributor_notAdmin() (gas: 18379)
[PASS] testRevert_setRewardDistributor_zeroAddress() (gas: 18373)
[PASS] testRevert_setRlsToken_notAdmin() (gas: 18333)
[PASS] testRevert_setRlsToken_zeroAddress() (gas: 18405)
[PASS] test_deposit() (gas: 65037)
[PASS] test_deposit_permissionless() (gas: 82864)
[PASS] test_initialize() (gas: 36256)
[PASS] test_initialize_approvesRewardDistributor() (gas: 15222)
[PASS] test_nonDistributorCannotPull() (gas: 46229)
[PASS] test_recoverTokens() (gas: 515262)
[PASS] test_recoverTokens_canDrainRls() (gas: 65187)
[PASS] test_refreshApproval() (gas: 37546)
[PASS] test_revokeApproval() (gas: 68621)
[PASS] test_revokeApproval_thenRefresh() (gas: 105606)
[PASS] test_rewardDistributorCanPull() (gas: 83751)
[PASS] test_setRewardDistributor() (gas: 67899)
[PASS] test_setRlsToken() (gas: 510357)
[PASS] test_setRlsToken_depositAndPullWithNewToken() (gas: 598477)
Suite result: ok. 25 passed; 0 failed; 0 skipped; finished in 2.25ms (1.71ms CPU time)

Ran 53 tests for test/token/RLSTest.t.sol:RLSTest
[PASS] testFuzz_burnFrom_bridge_no_allowance(uint256) (runs: 250, μ: 45373, ~: 45220)
[PASS] testFuzz_mint_burn_supply_invariant(uint256,uint256) (runs: 250, μ: 76770, ~: 77694)
[PASS] testRevert_permit_expiredDeadlineReverts() (gas: 30629)
[PASS] testRevert_permit_forgedSignatureReverts() (gas: 58310)
[PASS] testRevert_permit_replayedSignatureReverts() (gas: 129912)
[PASS] test_admin_grants_all_roles() (gas: 150313)
[PASS] test_admin_grants_minter_role() (gas: 93294)
[PASS] test_admin_revokes_minter_role() (gas: 34432)
[PASS] test_bothPaused_blocksEverything() (gas: 83916)
[PASS] test_bridgePause_blocksBurnFrom() (gas: 91426)
[PASS] test_bridgePause_blocksMint() (gas: 52727)
[PASS] test_bridgePause_doesNotBlockRegularTransfers() (gas: 80831)
[PASS] test_burnFrom_by_burner_bypasses_pause() (gas: 69648)
[PASS] test_burnFrom_by_burner_role_no_allowance() (gas: 41827)
[PASS] test_burnFrom_by_minter_bypasses_pause() (gas: 66946)
[PASS] test_burnFrom_by_minter_role_no_allowance() (gas: 39094)
[PASS] test_burnFrom_non_bridge_requires_allowance() (gas: 25489)
[PASS] test_burnFrom_non_bridge_with_allowance() (gas: 69789)
[PASS] test_burn_own_tokens() (gas: 38895)
[PASS] test_burn_reverts_insufficient_balance() (gas: 25363)
[PASS] test_burn_reverts_zero_amount() (gas: 15899)
[PASS] test_decimals() (gas: 13524)
[PASS] test_initial_supply_in_treasury() (gas: 21628)
[PASS] test_initialize_cannot_be_called_twice() (gas: 20386)
[PASS] test_initialize_reverts_over_max_supply() (gas: 2364683)
[PASS] test_initialize_reverts_zero_admin() (gas: 2142024)
[PASS] test_initialize_reverts_zero_treasury() (gas: 2142022)
[PASS] test_initialize_with_zero_supply() (gas: 2393585)
[PASS] test_mint_bypasses_pause() (gas: 87564)
[PASS] test_mint_emits_event() (gas: 56015)
[PASS] test_mint_reverts_exceeding_max_supply() (gas: 24476)
[PASS] test_mint_reverts_for_burner_role() (gas: 20643)
[PASS] test_mint_reverts_without_minter_role() (gas: 18718)
[PASS] test_mint_reverts_zero_address() (gas: 18665)
[PASS] test_mint_reverts_zero_amount() (gas: 20709)
[PASS] test_mint_up_to_max_supply() (gas: 57230)
[PASS] test_mint_with_minter_role() (gas: 58012)
[PASS] test_name_and_symbol() (gas: 22504)
[PASS] test_non_admin_cannot_grant_roles() (gas: 25002)
[PASS] test_pauseBridge_requiresPauserRole() (gas: 18376)
[PASS] test_pause_reverts_without_pauser_role() (gas: 18351)
[PASS] test_permit_grantsAllowanceAndEnablesTransferFrom() (gas: 137322)
[PASS] test_regularPause_doesNotBlockBridge() (gas: 85689)
[PASS] test_self_burn_blocked_when_paused() (gas: 50501)
[PASS] test_state_preserved_after_upgrade() (gas: 2146028)
[PASS] test_transferFrom_blocked_when_paused() (gas: 115907)
[PASS] test_transfer_blocked_when_paused() (gas: 88431)
[PASS] test_transfer_works_after_unpause() (gas: 98581)
[PASS] test_unpauseBridge_restoresBridgeOps() (gas: 66204)
[PASS] test_unpause_reverts_without_pauser_role() (gas: 47884)
[PASS] test_upgrade_reverts_without_upgrader_role() (gas: 2086178)
[PASS] test_upgrade_with_upgrader_role() (gas: 2114242)
[PASS] test_version() (gas: 14396)
Suite result: ok. 53 passed; 0 failed; 0 skipped; finished in 98.18ms (96.10ms CPU time)

Ran 7 tests for test/EIP2537/BlsG1.t.sol:BlsG1Test
[PASS] test_invalidPubkeyLength_fuzzed(uint8) (runs: 250, μ: 20995, ~: 16076)
[PASS] test_invalidPubkeyLength_tooLong() (gas: 30892)
[PASS] test_invalidPubkeyLength_tooShort() (gas: 12241)
[PASS] test_invalidPubkeyLength_truncatedValidKey() (gas: 41572)
[PASS] test_verifyProofOfPossessionG1(address,uint256) (runs: 10, μ: 412416, ~: 412416)
[PASS] test_verifyProofOfPossessionG1_negative(address,uint256) (runs: 10, μ: 924789, ~: 924789)
[PASS] test_verifyProofOfPossessionG1_zeroPoint() (gas: 37270)
Suite result: ok. 7 passed; 0 failed; 0 skipped; finished in 205.90ms (205.48ms CPU time)

Ran 65 tests for test/consensus/ConsensusRegistryTest.t.sol:ConsensusRegistryTest
[PASS] testRevert_allowlistValidator_notOwner() (gas: 2239)
[PASS] testRevert_allowlistValidator_zeroAddress() (gas: 2235)
[PASS] testRevert_applySlashes_notSystemCall() (gas: 2959)
[PASS] testRevert_beginExit_lastActiveCannotExit() (gas: 184505)
[PASS] testRevert_beginExit_nonValidator() (gas: 2531)
[PASS] testRevert_beginExit_notActive() (gas: 990761)
[PASS] testRevert_claimStakeRewards_insufficientRewards() (gas: 24251)
[PASS] testRevert_claimStakeRewards_nonValidator() (gas: 22932)
[PASS] testRevert_concludeEpoch_OnlySystemCall() (gas: 3901)
[PASS] testRevert_delegateStake_notAllowlisted() (gas: 881394)
[PASS] testRevert_delegateStake_ownerCannotBypassAllowlist() (gas: 875865)
[PASS] testRevert_pause_notOwner() (gas: 2097)
[PASS] testRevert_setDelegationPool_notOwner() (gas: 2283)
[PASS] testRevert_stake_insufficientAllowance() (gas: 757402)
[PASS] testRevert_stake_invalidPoint() (gas: 12158)
[PASS] testRevert_stake_notAllowlisted() (gas: 294770)
[PASS] testRevert_stake_whenPaused() (gas: 302720)
[PASS] testRevert_unpause_notOwner() (gas: 7761)
[PASS] testRevert_unstake_nonValidator() (gas: 23888)
[PASS] testRevert_unstake_notStakedOrExited() (gas: 1022769)
[PASS] testRevert_unstake_pendingExitReturnsIneligible() (gas: 62363)
[PASS] testRevert_updateAllowlistBatch_lengthMismatch() (gas: 3848)
[PASS] testRevert_updateAllowlistBatch_zeroAddress() (gas: 3885)
[PASS] testRevert_upgradeStakeVersion_notOwner() (gas: 5231)
[PASS] testRevert_upgradeStakeVersion_whenPaused() (gas: 8504)
[PASS] testRevert_upgradeStakeVersion_zeroDuration() (gas: 5950)
[PASS] testRevert_withdrawSlashedFunds_insufficientFunds() (gas: 2633)
[PASS] testRevert_withdrawSlashedFunds_notOwner() (gas: 2285)
[PASS] testRevert_withdrawSlashedFunds_zeroAmount() (gas: 2499)
[PASS] test_activate() (gas: 1228143)
[PASS] test_allowlistValidator() (gas: 26533)
[PASS] test_allowlistValidator_idempotent() (gas: 26639)
[PASS] test_applySlashes_fullSlash_burns() (gas: 111315)
[PASS] test_applySlashes_partialSlash() (gas: 16056)
[PASS] test_beginExit() (gas: 1572064)
[PASS] test_concludeEpoch_updatesEpochInfo() (gas: 219664)
[PASS] test_delegateStake() (gas: 1074065)
[PASS] test_delegateStake_ownerBypassesSignature() (gas: 1149047)
[PASS] test_delegationDigest() (gas: 32039)
[PASS] test_delistValidator() (gas: 4957)
[PASS] test_delistValidator_doesNotAffectExistingValidator() (gas: 7852)
[PASS] test_genesisValidatorsAllowlisted() (gas: 9686)
[PASS] test_getBalanceBreakdown() (gas: 6306)
[PASS] test_getCommitteeValidators() (gas: 26917)
[PASS] test_getCurrentEpoch() (gas: 4252)
[PASS] test_getCurrentEpochInfo() (gas: 8963)
[PASS] test_getCurrentStakeVersion() (gas: 6225)
[PASS] test_getEpochInfo() (gas: 9447)
[PASS] test_getRewards() (gas: 4889)
[PASS] test_getValidator() (gas: 9147)
[PASS] test_getValidators() (gas: 29881)
[PASS] test_isRetired() (gas: 4882)
[PASS] test_nonGenesisNotAllowlisted() (gas: 4393)
[PASS] test_pause() (gas: 7300)
[PASS] test_proofOfPossessionMessage() (gas: 97066)
[PASS] test_setDelegationPool() (gas: 25089)
[PASS] test_setUp() (gas: 154740)
[PASS] test_stake() (gas: 996712)
[PASS] test_stake_afterAllowlist() (gas: 974561)
[PASS] test_unpause() (gas: 8728)
[PASS] test_unstake_exited() (gas: 697642)
[PASS] test_unstake_staked() (gas: 926886)
[PASS] test_updateAllowlistBatch() (gas: 51809)
[PASS] test_upgradeStakeVersion() (gas: 92904)
[PASS] test_withdrawSlashedFunds() (gas: 100971)
Suite result: ok. 65 passed; 0 failed; 0 skipped; finished in 197.81ms (132.80ms CPU time)

Ran 9 tests for test/fees/RewardDistributorExtendedTest.t.sol:RewardDistributorExtendedTest
[PASS] testFuzz_distributeRewards_noRemainder(uint8,uint128) (runs: 250, μ: 1058597, ~: 821101)
[PASS] testFuzz_distributeRewards_proportionalToStake(uint256,uint256,uint256,uint256) (runs: 250, μ: 561124, ~: 561344)
[PASS] test_accumulatorTopUp_exactTargetAPYFormula() (gas: 1916815)
[PASS] test_distributeRewards_largeValidatorSet() (gas: 1738380)
[PASS] test_distributeRewards_multipleEpochs() (gas: 519529)
[PASS] test_distributeRewards_performanceWeighted_2xBlocks() (gas: 567394)
[PASS] test_distributeRewards_performanceWeighted_2xStake() (gas: 567437)
[PASS] test_distributeRewards_withDelegations_splitCorrectly() (gas: 363907)
[PASS] test_distributeRewards_zeroPendingRewards_noRevert() (gas: 199639)
Suite result: ok. 9 passed; 0 failed; 0 skipped; finished in 362.93ms (361.98ms CPU time)

Ran 43 tests for test/fees/RewardDistributorTest.t.sol:RewardDistributorTest
[PASS] testRevert_claimRewards_noPending() (gas: 40463)
[PASS] testRevert_distributeRewards_notSystemCall() (gas: 84271)
[PASS] testRevert_initialize_zeroAdmin() (gas: 2620402)
[PASS] testRevert_initialize_zeroRegistry() (gas: 2620303)
[PASS] testRevert_initialize_zeroRls() (gas: 2620321)
[PASS] testRevert_receiveRewards_notFeeDistributor() (gas: 59234)
[PASS] testRevert_receiveRewards_zeroAmount() (gas: 18072)
[PASS] testRevert_recoverTokens_pendingRewards() (gas: 92707)
[PASS] testRevert_setFeeAggregator_notOwner() (gas: 18329)
[PASS] testRevert_setFeeAggregator_zeroAddress() (gas: 18424)
[PASS] test_accumulatorTopUp_emptyAccumulator_noRevert() (gas: 1743241)
[PASS] test_accumulatorTopUp_noShortfallWhenFeesExceedTarget() (gas: 1764418)
[PASS] test_accumulatorTopUp_notConfigured_noEffect() (gas: 299282)
[PASS] test_accumulatorTopUp_partialShortfall() (gas: 1772263)
[PASS] test_accumulatorTopUp_pullsShortfall() (gas: 1765328)
[PASS] test_accumulatorTopUp_zeroApyBps_noEffect() (gas: 1751061)
[PASS] test_claimRewards() (gas: 282209)
[PASS] test_claimRewards_toCustomRecipient() (gas: 308661)
[PASS] test_distributeRewards_dustFreedFromTotalPending() (gas: 277785)
[PASS] test_distributeRewards_equalStake() (gas: 275102)
[PASS] test_distributeRewards_inProgress_silentReturn() (gas: 120601)
[PASS] test_distributeRewards_noRewards_silentReturn() (gas: 120555)
[PASS] test_distributeRewards_noValidators_reverts() (gas: 133107)
[PASS] test_distributeRewards_noValidators_silentReturn() (gas: 131331)
[PASS] test_distributeRewards_postSlash_splitUsesInitialStake() (gas: 359374)
[PASS] test_distributeRewards_unequalStake() (gas: 310057)
[PASS] test_distributeRewards_withDelegations() (gas: 398816)
[PASS] test_getRewardRecipient_defaultSelf() (gas: 18043)
[PASS] test_initialize() (gas: 48341)
[PASS] test_receiveRewards() (gas: 83009)
[PASS] test_receiveRewards_multiple() (gas: 90207)
[PASS] test_receiveRewards_reverts_inflatedAmount() (gas: 79110)
[PASS] test_recoverTokens() (gas: 70261)
[PASS] test_recoverTokens_cannotDrainUnclaimedRewards() (gas: 321903)
[PASS] test_recoverTokens_excessRLS() (gas: 129439)
[PASS] test_setAccumulator() (gas: 43641)
[PASS] test_setConsensusRegistry() (gas: 26551)
[PASS] test_setDelegationPool() (gas: 26516)
[PASS] test_setFeeAggregator() (gas: 26485)
[PASS] test_setRewardRecipient() (gas: 41958)
[PASS] test_setRewardRecipient_resetToZero() (gas: 34424)
[PASS] test_setTargetApyBps_cappedAt100Percent() (gas: 18350)
[PASS] test_setTargetApyBps_maxAllowed() (gas: 43150)
Suite result: ok. 43 passed; 0 failed; 0 skipped; finished in 9.30ms (8.09ms CPU time)

Ran 18 tests for test/fees/TokenomicsAccessControlTest.t.sol:TokenomicsAccessControlTest
[PASS] test_delegationPool_applyPoolSlash_onlyConsensusRegistry() (gas: 20414)
[PASS] test_delegationPool_distributePoolRewards_onlyRewardSources() (gas: 22607)
[PASS] test_feeAggregator_addStablecoin_onlyAdmin() (gas: 485907)
[PASS] test_feeAggregator_distributeEpochFees_onlyKeeper() (gas: 18872)
[PASS] test_feeAggregator_distributionRecipientFailure_noBlock() (gas: 355935)
[PASS] test_feeAggregator_emergencyWithdrawNative() (gas: 53619)
[PASS] test_feeAggregator_emergencyWithdraw_onlyAdmin() (gas: 21398)
[PASS] test_feeAggregator_emergencyWithdraw_stablecoins() (gas: 58105)
[PASS] test_feeAggregator_pauseUnpause_systemCallsUnaffected() (gas: 213450)
[PASS] test_feeAggregator_setAlgebraRouter_onlyAdmin() (gas: 18894)
[PASS] test_feeAggregator_swapToRls_onlyKeeper() (gas: 21330)
[PASS] test_rewardDistributor_claimRewards_onlyValidator() (gas: 231438)
[PASS] test_rewardDistributor_distributeRewards_onlySystemCall() (gas: 16350)
[PASS] test_rewardDistributor_distributeRewards_zeroPending_noRevert() (gas: 115330)
[PASS] test_rewardDistributor_receiveRewards_onlyFeeAggregator() (gas: 18086)
[PASS] test_rewardDistributor_recoverTokens_cannotStealPending() (gas: 87902)
[PASS] test_rewardDistributor_recoverTokens_nonPending() (gas: 69496)
[PASS] test_systemAddress_concludeEpoch_onlySystem() (gas: 16348)
Suite result: ok. 18 passed; 0 failed; 0 skipped; finished in 3.81ms (1.88ms CPU time)

Ran 10 tests for test/consensus/DelegationPoolExtendedTest.t.sol:DelegationPoolExtendedTest
[PASS] testFuzz_delegateUndelegate_totalDelegatedInvariant(uint256,uint256,uint256,uint256) (runs: 250, μ: 462817, ~: 462813)
[PASS] test_commissionDecrease_immediateEffect() (gas: 348283)
[PASS] test_commissionIncrease_delayedActivation() (gas: 414202)
[PASS] test_earlyExiter_noNewRewards() (gas: 469756)
[PASS] test_lateDelegator_noRetroactiveRewards() (gas: 415306)
[PASS] test_multipleDelegators_proportionalRewards() (gas: 416213)
[PASS] test_partialUndelegation_remainingEarnsRewards() (gas: 376839)
[PASS] test_rounding_minimumDelegation_smallReward() (gas: 331631)
[PASS] test_slashDuringActiveDelegation_positionSettled() (gas: 416438)
[PASS] test_unbondingDelegator_protectedFromSlash() (gas: 384061)
Suite result: ok. 10 passed; 0 failed; 0 skipped; finished in 162.15ms (161.11ms CPU time)

Ran 2 tests for test/fees/RewardPipelineInvariant.t.sol:RewardPipelineConservationInvariant
[PASS] invariant_faStablecoinMatchesPending() (runs: 256, calls: 128000, reverts: 17215)

╭-----------------+----------------------+-------+---------+----------╮
| Contract        | Selector             | Calls | Reverts | Discards |
+=====================================================================+
| PipelineHandler | advanceEpoch         | 11749 | 0       | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | claimCommission      | 11756 | 0       | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | claimRewards         | 11543 | 0       | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | completeUndelegation | 11825 | 0       | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | delegate             | 11556 | 15      | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | distributeFees       | 11603 | 0       | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | distributeRewards    | 11612 | 0       | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | receiveFee           | 11582 | 11582   | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | requestUndelegation  | 11435 | 5618    | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | slash                | 11588 | 0       | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | swap                 | 11751 | 0       | 0        |
╰-----------------+----------------------+-------+---------+----------╯

[PASS] invariant_pipelineConservesRls() (runs: 256, calls: 128000, reverts: 17228)

╭-----------------+----------------------+-------+---------+----------╮
| Contract        | Selector             | Calls | Reverts | Discards |
+=====================================================================+
| PipelineHandler | advanceEpoch         | 11749 | 0       | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | claimCommission      | 11756 | 0       | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | claimRewards         | 11543 | 0       | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | completeUndelegation | 11825 | 0       | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | delegate             | 11556 | 26      | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | distributeFees       | 11603 | 0       | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | distributeRewards    | 11612 | 0       | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | receiveFee           | 11582 | 11582   | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | requestUndelegation  | 11435 | 5620    | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | slash                | 11588 | 0       | 0        |
|-----------------+----------------------+-------+---------+----------|
| PipelineHandler | swap                 | 11751 | 0       | 0        |
╰-----------------+----------------------+-------+---------+----------╯

Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 54.53s (54.53s CPU time)

Ran 119 tests for test/consensus/DelegationPoolTest.t.sol:DelegationPoolTest
[PASS] testFuzz_applyPoolSlash_reducesProportionallyAndStaysSolvent(uint256,uint256,uint256,uint256) (runs: 250, μ: 503449, ~: 503980)
[PASS] testFuzz_distributePoolRewards_splitConservesAndProportional(uint256,uint256,uint256,uint256,uint256) (runs: 250, μ: 651300, ~: 651966)
[PASS] testRevert_activatePendingCommission_noPending() (gas: 115332)
[PASS] testRevert_activatePendingCommission_tooEarly() (gas: 193249)
[PASS] testRevert_applyPoolSlash_notConsensusRegistry() (gas: 115374)
[PASS] testRevert_cancelPendingCommission_noPending() (gas: 115332)
[PASS] testRevert_claimCommission_noCommission() (gas: 135470)
[PASS] testRevert_claimCommission_notRegistered() (gas: 40752)
[PASS] testRevert_claimDelegationRewards_noPending() (gas: 249362)
[PASS] testRevert_claimDelegationRewards_notRegistered() (gas: 42953)
[PASS] testRevert_commissionIncreaseExceedsLimit() (gas: 113932)
[PASS] testRevert_completeUndelegation_nothingToUndelegate() (gas: 42611)
[PASS] testRevert_completeUndelegation_unbondingNotComplete() (gas: 288086)
[PASS] testRevert_delegate_belowMinimum() (gas: 143995)
[PASS] testRevert_delegate_exceedsMaxDelegation() (gas: 148718)
[PASS] testRevert_delegate_exceedsMaxValidatorDelegation() (gas: 4299173)
[PASS] testRevert_delegate_poolNotAccepting() (gas: 125434)
[PASS] testRevert_delegate_poolNotRegistered() (gas: 45359)
[PASS] testRevert_delegate_validatorNotAllowlisted() (gas: 142742)
[PASS] testRevert_delegate_zeroAddress() (gas: 40417)
[PASS] testRevert_delegate_zeroAmount() (gas: 139588)
[PASS] testRevert_distributePoolRewards_notAuthorized() (gas: 117588)
[PASS] testRevert_initialize_invalidConfig_maxDelegation() (gas: 3818448)
[PASS] testRevert_initialize_invalidConfig_maxDelegationExceedsValidator() (gas: 3816370)
[PASS] testRevert_initialize_invalidConfig_maxValidatorDelegation() (gas: 3818415)
[PASS] testRevert_initialize_invalidConfig_minDelegation() (gas: 3818411)
[PASS] testRevert_initialize_invalidConfig_unbondingEpochs() (gas: 3820652)
[PASS] testRevert_initialize_zeroAdmin() (gas: 3818131)
[PASS] testRevert_initialize_zeroRegistry() (gas: 3818168)
[PASS] testRevert_initialize_zeroRls() (gas: 3818106)
[PASS] testRevert_registerPool_alreadyRegistered() (gas: 113586)
[PASS] testRevert_registerPool_invalidCommission() (gas: 18495)
[PASS] testRevert_registerPool_notActiveValidator() (gas: 74267)
[PASS] testRevert_registerPool_notAllowlisted() (gas: 49356)
[PASS] testRevert_requestUndelegation_insufficientBalance() (gas: 250120)
[PASS] testRevert_requestUndelegation_pendingExists() (gas: 325777)
[PASS] testRevert_requestUndelegation_zeroAmount() (gas: 40396)
[PASS] testRevert_setAcceptingDelegations_notRegistered() (gas: 18621)
[PASS] testRevert_setCommissionRecipient_notRegistered() (gas: 18679)
[PASS] testRevert_setRewardDistributor_notOwner() (gas: 18461)
[PASS] testRevert_setRewardDistributor_zeroAddress() (gas: 18424)
[PASS] testRevert_setRewardRecipient_notRegistered() (gas: 21024)
[PASS] testRevert_updateCommission_invalidBps() (gas: 113547)
[PASS] testRevert_updateCommission_notRegistered() (gas: 18626)
[PASS] testRevert_updateCommission_pendingExists() (gas: 191280)
[PASS] testRevert_updateConfig_notOwner() (gas: 26957)
[PASS] testRevert_whitelist_disable_notAdmin() (gas: 20222)
[PASS] testRevert_whitelist_emptyProof() (gas: 196135)
[PASS] testRevert_whitelist_garbageProof() (gas: 197050)
[PASS] testRevert_whitelist_outsider() (gas: 201314)
[PASS] testRevert_whitelist_proofForDifferentAddress() (gas: 201244)
[PASS] testRevert_whitelist_setRoot_notAdmin() (gas: 22220)
[PASS] testRevert_whitelist_wrongBalanceInLeaf() (gas: 201296)
[PASS] test_activatePendingCommission() (gas: 161618)
[PASS] test_applyPoolSlash() (gas: 309189)
[PASS] test_applyPoolSlash_multipleSlashesAllWithdrawSucceed() (gas: 624312)
[PASS] test_applyPoolSlash_roundingDustKeepsSolvent() (gas: 302800)
[PASS] test_cancelPendingCommission() (gas: 158931)
[PASS] test_claimCommission() (gas: 340242)
[PASS] test_claimDelegationRewards() (gas: 365148)
[PASS] test_commissionDecreaseCancelsPending() (gas: 160996)
[PASS] test_commissionIncreaseFullFlow() (gas: 197737)
[PASS] test_completeUndelegation() (gas: 271449)
[PASS] test_consensusRegistry() (gas: 17831)
[PASS] test_constants() (gas: 16735)
[PASS] test_delegate() (gas: 257033)
[PASS] test_delegate_additionalStake() (gas: 271713)
[PASS] test_delegate_multipleDelegators() (gas: 315586)
[PASS] test_distributePoolRewards_multipleDelegators() (gas: 397071)
[PASS] test_distributePoolRewards_noDelegators() (gas: 204116)
[PASS] test_distributePoolRewards_singleDelegator() (gas: 337393)
[PASS] test_getCommissionRecipient() (gas: 138777)
[PASS] test_getCommissionRecipient_default() (gas: 115136)
[PASS] test_getDelegationConfig() (gas: 24416)
[PASS] test_getDelegatorPosition() (gas: 251916)
[PASS] test_getEffectivePosition() (gas: 333957)
[PASS] test_getPendingRewards() (gas: 339226)
[PASS] test_getRewardRecipient() (gas: 141908)
[PASS] test_getRewardRecipient_default() (gas: 117528)
[PASS] test_getTotalDelegatedStake() (gas: 245382)
[PASS] test_getValidatorPool() (gas: 245373)
[PASS] test_initialize() (gas: 49183)
[PASS] test_poolRegistered() (gas: 115049)
[PASS] test_registerPool() (gas: 117729)
[PASS] test_registerPool_pendingActivation() (gas: 155101)
[PASS] test_requestUndelegation() (gas: 291984)
[PASS] test_requestUndelegation_partial() (gas: 331270)
[PASS] test_rewardDebt_correctAfterAdditionalDeposit() (gas: 384947)
[PASS] test_rewardDebt_correctAfterPartialWithdrawal() (gas: 404787)
[PASS] test_rewardDebt_multipleDepositRounds() (gas: 414064)
[PASS] test_rewardDebt_newRewardsAfterAdditionalDeposit() (gas: 384694)
[PASS] test_rewardDebt_twoDelegators() (gas: 407574)
[PASS] test_rlsToken() (gas: 17887)
[PASS] test_setAcceptingDelegations() (gas: 125968)
[PASS] test_setCommissionRecipient() (gas: 362638)
[PASS] test_setRewardDistributor() (gas: 26584)
[PASS] test_setRewardRecipient() (gas: 410230)
[PASS] test_slashDuringUnbonding() (gas: 378669)
[PASS] test_updateCommission_decrease() (gas: 120936)
[PASS] test_updateCommission_increaseScheduled() (gas: 194704)
[PASS] test_updateConfig() (gas: 45425)
[PASS] test_whitelist_cachedAllowsFourArgWithEmptyProof() (gas: 352700)
[PASS] test_whitelist_cachedAllowsTwoArgOverload() (gas: 352145)
[PASS] test_whitelist_cachedEntrySurvivesGateToggle() (gas: 363198)
[PASS] test_whitelist_defaults() (gas: 25664)
[PASS] test_whitelist_disable_adminOnly() (gas: 56603)
[PASS] test_whitelist_disable_emitsEvent() (gas: 53502)
[PASS] test_whitelist_disable_whenAlreadyDisabled_noEvent() (gas: 21281)
[PASS] test_whitelist_gateDisabled_fourArg_proofIgnored() (gas: 255758)
[PASS] test_whitelist_gateDisabled_twoArg_worksForAnyone() (gas: 255279)
[PASS] test_whitelist_multipleStakesOverTime() (gas: 387988)
[PASS] test_whitelist_multipleUsersIndependent() (gas: 574304)
[PASS] test_whitelist_rootRotation_doesNotInvalidateCachedUsers() (gas: 369732)
[PASS] test_whitelist_setRoot_adminOnly_andEnables() (gas: 70596)
[PASS] test_whitelist_setRoot_emitsBothEvents() (gas: 70650)
[PASS] test_whitelist_setRoot_rotation_skipsEnableEvent() (gas: 75018)
[PASS] test_whitelist_toggleGateOff_tierAssignmentFollowsGate() (gas: 343646)
[PASS] test_whitelist_twoArgNotVerified_delegatesAsOpenTier() (gas: 328836)
[PASS] test_whitelist_validProof_cachesAndDelegates() (gas: 337868)
Suite result: ok. 119 passed; 0 failed; 0 skipped; finished in 378.21ms (376.13ms CPU time)

Ran 1 test for test/consensus/DelegationPoolInvariant.t.sol:DelegationPoolSolvencyInvariant
[PASS] invariant_poolIsSolvent() (runs: 256, calls: 128000, reverts: 4950)

╭-----------------------+----------------------+-------+---------+----------╮
| Contract              | Selector             | Calls | Reverts | Discards |
+===========================================================================+
| DelegationPoolHandler | advanceEpoch         | 15864 | 0       | 0        |
|-----------------------+----------------------+-------+---------+----------|
| DelegationPoolHandler | claimCommission      | 16009 | 0       | 0        |
|-----------------------+----------------------+-------+---------+----------|
| DelegationPoolHandler | claimRewards         | 15799 | 0       | 0        |
|-----------------------+----------------------+-------+---------+----------|
| DelegationPoolHandler | completeUndelegation | 15979 | 0       | 0        |
|-----------------------+----------------------+-------+---------+----------|
| DelegationPoolHandler | delegate             | 16030 | 0       | 0        |
|-----------------------+----------------------+-------+---------+----------|
| DelegationPoolHandler | distributeRewards    | 16191 | 0       | 0        |
|-----------------------+----------------------+-------+---------+----------|
| DelegationPoolHandler | requestUndelegation  | 16078 | 4950    | 0        |
|-----------------------+----------------------+-------+---------+----------|
| DelegationPoolHandler | slash                | 16050 | 0       | 0        |
╰-----------------------+----------------------+-------+---------+----------╯

Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 99.85s (99.85s CPU time)

Ran 3 tests for test/consensus/ConsensusRegistryTestFuzz.t.sol:ConsensusRegistryTestFuzz
[PASS] testFuzz_applyIncentives(uint24,uint24) (runs: 250, μ: 315930930, ~: 280356374)
[PASS] testFuzz_claimStakeRewards_reverts_noRewards(uint24,uint24) (runs: 250, μ: 318546396, ~: 281518595)
[PASS] testFuzz_concludeEpoch(uint24) (runs: 250, μ: 339443678, ~: 306393067)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 654.63s (1828.72s CPU time)

╭-------------------------------------+--------+--------+---------╮
| Test Suite                          | Passed | Failed | Skipped |
+=================================================================+
| BlsG1Test                           | 7      | 0      | 0       |
|-------------------------------------+--------+--------+---------|
| ConsensusRegistryTest               | 65     | 0      | 0       |
|-------------------------------------+--------+--------+---------|
| ConsensusRegistryTestFuzz           | 3      | 0      | 0       |
|-------------------------------------+--------+--------+---------|
| DelegationPoolExtendedTest          | 10     | 0      | 0       |
|-------------------------------------+--------+--------+---------|
| DelegationPoolSolvencyInvariant     | 1      | 0      | 0       |
|-------------------------------------+--------+--------+---------|
| DelegationPoolTest                  | 119    | 0      | 0       |
|-------------------------------------+--------+--------+---------|
| FeeAggregatorStorageSlotTest        | 4      | 0      | 0       |
|-------------------------------------+--------+--------+---------|
| FeeAggregatorTest                   | 64     | 0      | 0       |
|-------------------------------------+--------+--------+---------|
| RLSAccumulatorTest                  | 25     | 0      | 0       |
|-------------------------------------+--------+--------+---------|
| RewardDistributorExtendedTest       | 9      | 0      | 0       |
|-------------------------------------+--------+--------+---------|
| RewardDistributorTest               | 43     | 0      | 0       |
|-------------------------------------+--------+--------+---------|
| RewardPipelineConservationInvariant | 2      | 0      | 0       |
|-------------------------------------+--------+--------+---------|
| TokenomicsAccessControlTest         | 18     | 0      | 0       |
|-------------------------------------+--------+--------+---------|
| MockAlgebraDexTest                  | 11     | 0      | 0       |
|-------------------------------------+--------+--------+---------|
| NativeTokenControllerTest           | 30     | 0      | 0       |
|-------------------------------------+--------+--------+---------|
| RLSTest                             | 53     | 0      | 0       |
╰-------------------------------------+--------+--------+---------╯

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.

1 participant