refactor(core): extract fork-heights into its own crate#797
Conversation
Move fork_heights.rs (pure consts + env + chain-id selection, no consensus-state coupling) out of the sentrix-core monolith into a standalone sentrix-fork-heights crate — separate compile unit (faster incremental builds), clearer boundary. sentrix-core re-exports it as `pub use sentrix_fork_heights as fork_heights`, so all fleet-wide `sentrix_core::fork_heights::*` / `crate::fork_heights::*` call sites resolve unchanged (zero call-site edits). Pure motion: fork-schedule consts/logic byte-identical; only the in-crate env-test lock is inlined and one intra-doc-link to a sentrix-core type is plain-texted (would be circular). cargo check --workspace -D warnings clean; tests conserved: sentrix-core 263 + sentrix-fork-heights 10 = 273 (was 273), 0 failed.
d886a23 to
bc87fc1
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Looking for one thing? Review this PR in Change Stack to search files, summaries, diffs, and code without losing your place. Warning Review limit reached
More reviews will be available in 53 minutes and 25 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR extracts fork-height predicates and constants from sentrix-core into a new independent crate, sentrix-fork-heights. The workspace Cargo.toml is updated to include the new crate and version is bumped to 2.2.37. sentrix-core adds sentrix-fork-heights as a path dependency and re-exports its public interface as Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Step 2 of breaking up the sentrix-core monolith. A pure, peripheral crate extraction:
fork_heightsis consts + env reads + chain-id selection with no consensus-state coupling, so it lifts out cleanly.What moved
crates/sentrix-core/src/fork_heights.rs→ new cratesentrix-fork-heights(crates/sentrix-fork-heights/src/lib.rs, viagit mvso history follows). sentrix-core re-exports it:so every fleet-wide
sentrix_core::fork_heights::*/crate::fork_heights::*call site (37 across core/network/bin) resolves unchanged — zero call-site edits.Why
Separate compile unit (faster incremental builds when iterating fork schedule), clearer boundary, independently auditable/publishable. BUSL-1.1 +
publish = falselike the rest of the consensus crates.Safety (pure motion)
crate::test_util), and one intra-doc-link to a sentrix-core type is plain-texted (would be circular: core depends on this crate, not vice versa).tracing(onewarn!).Verification
cargo check --workspace -D warningsclean (all 37 call sites resolve via the re-export).Summary by CodeRabbit