feat(consensus): pin testnet SIP-6 activation at h=6_026_000 + bump v2.2.24 (SIP-6, PR 5/N)#759
Conversation
…2.2.24 (SIP-6, PR 5/N)
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Warning Review limit reached
More reviews will be available in 53 minutes and 40 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 selected for processing (1)
📝 WalkthroughWalkthroughThis PR includes a workspace version bump from 2.2.23 to 2.2.24 in Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/sentrix-core/src/fork_heights.rs`:
- Around line 393-399: Add regression tests covering the new chain-aware
STATE_IN_TRIE_HEIGHT fallback: create a test (e.g.,
state_in_trie_height_defaults) that ensures read_height("STATE_IN_TRIE_HEIGHT",
chain_default(STATE_IN_TRIE_HEIGHT_DEFAULT,
STATE_IN_TRIE_HEIGHT_TESTNET_DEFAULT)) yields u64::MAX for mainnet and 6_026_000
for testnet when no env vars are set (ensure the env is cleared in the test),
and add boundary tests (e.g., is_state_in_trie_height_boundaries) that exercise
the is_state_in_trie_height predicate around the gate (one below, at, and one
above the threshold) to assert true/false behavior; reference the read_height
function, chain_default helper, STATE_IN_TRIE_HEIGHT constant(s), and
is_state_in_trie_height in these tests so the behavior is explicitly pinned.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 106e2bfa-35bf-4710-b181-b6907b08c445
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock,!**/*.lock
📒 Files selected for processing (2)
Cargo.tomlcrates/sentrix-core/src/fork_heights.rs
Summary
Final code-side PR in the SIP-6 series. Pins testnet `STATE_IN_TRIE_HEIGHT` activation to 6,026,000 (~46 min buffer past the v2.2.24 deploy window at h≈6,020,400 on 2026-06-01). Mainnet default stays `u64::MAX` until the canonical-override design lands. Workspace version bumped to 2.2.24.
Pre-activation finding — drift IS already present
Direct read of `/staking/validators` against all 3 active testnet val ports confirms pending_rewards has already drifted across the active set:
This is the exact activation hazard PRs #756 / #757 / #758 documented. Naïvely flipping the gate would fork the chain at the first post-activation block.
Mitigation — option C (chain.db harmonize)
Deploy will land via a single halt-all window doing all three steps in lockstep:
All 3 vals reload identical in-memory state from val2's snapshot — the same recovery mechanism that worked for testnet val3 on 2026-05-30. After ~50 blocks (~25 s) the activation height crosses and SIP-6 captures the (now harmonized) state into the trie. Drift accumulation window between cp restart and activation is tiny enough to be negligible (~600 sentri max, 6e-6 SRX).
Rationale for option C over A (env canonical override) / B (reset to 0) / D (skip): option C has 0 env coordination risk, 0 financial loss (rewards preserved via val2 snapshot), and proven recovery mechanism. See sip-6 design doc for the full comparison.
What this PR changes
Self-review (per
feedback_smoke_test_and_code_review_every_change)Post-merge sequence
This PR contains ONLY the code change. The actual deploy steps (halt-all, cp, binary swap, simul-start) happen out-of-band against the merged main, building v2.2.24 binary via the bullseye docker pattern documented in [[project-v2-2-23-testnet-deploy]]. Activation crosses ~46 minutes after deploy completion.
After activation crosses cleanly + a brief bake (~24 h on testnet to start, then ≥1 week per SIP-6 § Activation Plan), this SIP moves to "Last Call" status. Mainnet activation height is picked separately during the next operator window with a canonical-override env override (still to be designed).
Summary by CodeRabbit
Chores
New Features