8000 feat(decentralization): Adjust business rules calculation for proposal 135700 by sasa-tomic · Pull Request #1358 · dfinity/dre · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(decentralization): Adjust business rules calculation for proposal 135700 #1358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 12, 2025

Conversation

sasa-tomic
Copy link
Member
@sasa-tomic sasa-tomic commented Mar 11, 2025

Changes in business rules calculation for decentralization

  • Refactor Subnet Identification:

    • Consolidate subnet identification logic using is_european_subnet and is_nns_subnet to enhance clarity and reduce redundancy.
  • Introduce allowances for DFINITY on the NNS subnet:

### Changes Made
- Removed redundant string dereferencing in subnet ID checks.
- Introduced `is_nns_subnet` boolean for clarity and reuse.
- Refactored `target_dfinity_owned_nodes_count` calculation using `is_nns_subnet`.
- Added DFINITY node provider and data center exemptions for NNS subnets based on proposal #135700.
- Used `AHashSet` for efficient lookups of data centers and owners related to the `dfinity_np` principal.
- Updated conditions to exclude exempted DFINITY nodes from standard `max_nodes_per_np_and_dc` checks.
- Slight reordering of logic to enhance readability and maintainability.
@sasa-tomic sasa-tomic self-assigned this Mar 11, 2025
@sasa-tomic sasa-tomic changed the title refactor: streamline subnet verification logic feat(decentralization): Adjust business rules calculation for proposal 135700 Mar 11, 2025
@sasa-tomic sasa-tomic marked this pull request as ready for review March 11, 2025 17:49
@sasa-tomic sasa-tomic requested a review from a team as a code owner March 11, 2025 17:49
@sasa-tomic sasa-tomic merged commit 4832ecc into main Mar 12, 2025
7 checks passed
@sasa-tomic sasa-tomic deleted the refactor/subnet-checks branch March 12, 2025 09:08
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.

2 participants
0