Skip to content

Conversation

@shamil-gadelshin
Copy link
Collaborator

Description

This PR introduces a batch of root claim upgrades:

  • expands RootClaimTypeEnum with a new setting KeepSubnets. It enables an option to set Keep only to specific subnets and to treat all other subnets as Swap
  • adds set_root_claim_type to proxy filter
  • introduces RootAlphaDividendsPerSubnet storage map for bookkeeping

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run ./scripts/fix_rust.sh to ensure my code is formatted and linted correctly
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@shamil-gadelshin shamil-gadelshin self-assigned this Nov 18, 2025
@shamil-gadelshin shamil-gadelshin added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Nov 18, 2025
@sam0x17 sam0x17 requested a review from a team November 20, 2025 17:03
Comment on lines +1612 to +1620
let validator_take_percent = 0.18f64;
let estimated_root_claim_dividends =
(pending_root_alpha as f64) * (1f64 - validator_take_percent);

assert_abs_diff_eq!(
estimated_root_claim_dividends as u64,
u64::from(root_claim_dividends1),
epsilon = 100u64,
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to avoid precision loss, you could use Percent. This is only a test though

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep it. Conversion operations seem simpler.

l0r1s
l0r1s previously approved these changes Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-cargo-audit This PR fails cargo audit but needs to be merged anyway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants