Open tier staking with separate APY - #85
Conversation
|
Claude finished @mlukanova's task in 4m 21s —— View job PR Review: Open tier staking with separate APY
SummaryThis 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 Issues[Medium] Reward dilution when
Track B delegators contribute to [Medium] Performance-weight path excludes Track B from validator weight In the fallback path ( This creates an inconsistency: validators with Track B delegators earn proportionally more in the fallback path but not in the performance-weight path. The 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] trackB = $.delegationPool.getTotalOpenTierDelegatedStake(validator);
trackA = $.delegationPool.getTotalDelegatedStake(validator) - trackB;
[Low] The existing [Low] Missing cross-track reward distribution test The fuzz test
This is the most novel and complex piece of the change and deserves dedicated coverage. [Nit] Single-arg 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 What looks good
|
Security Scan - CodeSeverity: HIGH, CRITICAL Vulnerabilities found: View scan results |
Contracts Tests (Foundry)Package: ✅ All tests passed View forge test results |
Summary
Closes #
Surface areas touched
eth_*,rayls_*, faucet)rayls-contracts/)etc/, scripts, Docker, compose).github/workflows/,Makefile)doc/, in-crate READMEs, root docs)Breaking / compatibility
None.
Test plan