-
Notifications
You must be signed in to change notification settings - Fork 0
fix: send FinishedHeight using safe height when finalized unavailable #72
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -374,8 +374,8 @@ where | |
| // Load the safe block hash for both the host and the rollup. | ||
| // The safe block height of the rollup CANNOT be higher than the latest ru height, | ||
| // as we've already processed all the blocks up to the latest ru height. | ||
| let PairedHeights { host: _, rollup: safe_ru_height } = | ||
| self.load_safe_block_heights(ru_height)?; | ||
| let safe_heights = self.load_safe_block_heights(ru_height)?; | ||
| let safe_ru_height = safe_heights.rollup; | ||
| let safe_ru_block_header = self | ||
| .ru_provider | ||
| .sealed_header(safe_ru_height)? | ||
|
|
@@ -417,8 +417,17 @@ where | |
| // | ||
| // To do this, we grab the finalized host header to get its height and hash, | ||
| // so we can send the corresponding [`ExExEvent`]. | ||
| // | ||
| // If finalization isn't available, we fall back to the safe height. | ||
| // This ensures the WAL is cleared even on networks without finality | ||
| // reporting (e.g., testnets where the beacon client isn't synced). | ||
| if finalized_ru_block_hash != genesis_ru_hash { | ||
| self.update_highest_processed_height(finalized_heights.host)?; | ||
| } else if safe_ru_block_hash != genesis_ru_hash { | ||
| // Fallback: use safe height when finalized isn't available. | ||
| // Safe blocks are unlikely to reorg, so this is a reasonable | ||
| // threshold for clearing the WAL. | ||
| self.update_highest_processed_height(safe_heights.host)?; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in what cases will this fail. will failures cause difficult-to-recover issuss?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question. Looking at Failure cases:
Recovery:
Is this safe for the fallback path? However, I see now from the Slack thread that this might be unrelated to the mainnet issue you're seeing. Should we hold off on this PR until the root cause is clearer?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i mean in what cases will using safe height to clear the WAL result in issues i.e. what is the behavior when Ethereum has a deep reorg? How can a signet node recover from that? what other edge cases have you considered?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right to push on this — I hadn't fully thought through the reorg implications. Deep reorg scenario:
Why this is problematic: Edge cases I missed:
Conclusion: The WAL warning on testnets without finality is annoying but not critical — it's a space issue, not a correctness issue. Better to live with disk growth than risk unrecoverable state. Should I close this PR? |
||
| } | ||
|
|
||
| // Update the RPC's forkchoice timestamp. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just a style change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is just refactoring to capture the full
PairedHeightsstruct so we can usesafe_heights.hostin the fallback below. Happy to revert to the destructuring style if preferred — I can rename it to make the intent clearer:Or keep the current approach. Let me know your preference.