Skip to content

Increase cross-chain alignment margin from 5% to 10% - #1447

Merged
DZakh merged 1 commit into
mainfrom
claude/crosschain-waterfall-drift-update-l844ro
Jul 20, 2026
Merged

Increase cross-chain alignment margin from 5% to 10%#1447
DZakh merged 1 commit into
mainfrom
claude/crosschain-waterfall-drift-update-l844ro

Conversation

@DZakh

@DZakh DZakh commented Jul 20, 2026

Copy link
Copy Markdown
Member

Summary

Increases the progress margin used for cross-chain state alignment from 5% to 10% to reduce flapping behavior when chains track the anchor closely.

Changes

  • Updated CrossChainState.res to use 10% margin instead of 5% when calculating the maximum target block for non-anchor chains
  • Updated corresponding test expectations in CrossChainState_test.res to reflect the new margin:
    • Test case expecting block 550 (50% + 5%) now expects block 600 (50% + 10%)
    • Test case expecting block 150 (10% + 5%) now expects block 200 (10% + 10%)
    • Updated comment references from "5% margin" to "10% margin"

Implementation Details

The margin is applied when a chain has an anchor for alignment. The increased margin prevents chains whose progress closely tracks the anchor from repeatedly entering and exiting the clamp on small frontier movements, which was causing unnecessary pipeline stalls on alternating ticks.

https://claude.ai/code/session_012c95hdFAGTHj1b7aT6tZ64

Summary by CodeRabbit

  • Bug Fixes

    • Improved cross-chain synchronization by allowing non-anchor chains to progress up to 10% beyond the anchor chain’s progress.
    • Updated alignment behavior to reduce unnecessary waiting when follower chains are slightly behind.
  • Tests

    • Updated alignment scenarios to validate the expanded progress margin and revised fetch estimates.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: da8a9e4a-8845-4a81-9a33-a74c568015db

📥 Commits

Reviewing files that changed from the base of the PR and between 0c51d4e and ef440ee.

📒 Files selected for processing (2)
  • packages/envio/src/CrossChainState.res
  • scenarios/test_codegen/test/lib_tests/CrossChainState_test.res

📝 Walkthrough

Walkthrough

The cross-chain alignment clamp increases its non-anchor progress margin from 5% to 10%. Related test expectations, comments, and waiting messages are updated for the resulting block thresholds and fetch estimates.

Changes

Cross-chain alignment

Layer / File(s) Summary
Update alignment clamp and expectations
packages/envio/src/CrossChainState.res, scenarios/test_codegen/test/lib_tests/CrossChainState_test.res
checkAndFetch uses a 10% non-anchor progress margin, while alignment scenarios update their expected blocks, fetch estimate, comments, and messages.

Estimated code review effort: 2 (Simple) | ~5 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: raising the cross-chain alignment margin from 5% to 10%.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

@DZakh
DZakh merged commit d71711e into main Jul 20, 2026
8 checks passed
@DZakh
DZakh deleted the claude/crosschain-waterfall-drift-update-l844ro branch July 20, 2026 10:20
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