Skip to content

fix: init v1 tree with custom forester#2319

Open
ananas-block wants to merge 1 commit intomainfrom
jorrit/fix-init-v1-tree-with-custom-forester
Open

fix: init v1 tree with custom forester#2319
ananas-block wants to merge 1 commit intomainfrom
jorrit/fix-init-v1-tree-with-custom-forester

Conversation

@ananas-block
Copy link
Contributor

@ananas-block ananas-block commented Mar 1, 2026

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Enhanced validation to enforce network fee eligibility constraints for registered foresters
    • Improved error handling for tree initialization with network fees
    • Strengthened consistency checks between forester presence and network fee configuration

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b5f7f10 and 2aefe89.

⛔ Files ignored due to path filters (1)
  • program-tests/registry-test/tests/tests.rs is excluded by none and included by none
📒 Files selected for processing (1)
  • programs/registry/src/lib.rs

📝 Walkthrough

Walkthrough

The change adds validation constraints to enforce consistency between forester registration state and network fee configuration in the registry module. Guard conditions are introduced to prevent invalid combinations during initialization and forester status updates.

Changes

Cohort / File(s) Summary
Forester & Network Fee Validation
programs/registry/src/lib.rs
Added guard clauses enforcing that registered foresters must have non-zero network fees, unregistered authorities with forester claims must have zero fees, and initialization logic prevents foresters from being paired with non-zero fees.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🌳 Guards now stand at the fee-forester gate,
No mismatched pairs shall seal a tree's fate,
Zero or present—the rules must align,
Registry constraints, now crystal and fine! 🔐

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: init v1 tree with custom forester' directly describes the main change: enabling initialization of v1 trees with a custom forester, which aligns with the core validation enhancements around forester/network_fee consistency.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 70.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jorrit/fix-init-v1-tree-with-custom-forester

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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