Skip to content
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

Fix intersecting l2 commitment blocks #853

Merged
merged 6 commits into from
Jul 4, 2024

Conversation

yaziciahmet
Copy link
Contributor

Description

The issue was caused by the fact that when the sequencer is restarted, the sync of ledger db from postgres was problematic. This PR fixes the compare_commitments_from_db method.

Linked Issues

Testing

Existing test sequencer_crash_and_replace_full_node works now.

@yaziciahmet yaziciahmet added the T - bug Something isn't working label Jul 4, 2024
@yaziciahmet yaziciahmet self-assigned this Jul 4, 2024
@yaziciahmet yaziciahmet requested a review from eyusufatik July 4, 2024 13:55
Copy link
Contributor

@rakanalh rakanalh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since compare_commitments_from_db isn't really just comparing anymore, i suggest calling it, adjust_commitments_from_db or moving the set logic outside of the compare_ method.

crates/sequencer/src/sequencer.rs Show resolved Hide resolved
crates/sequencer/src/sequencer.rs Outdated Show resolved Hide resolved
crates/sequencer/src/sequencer.rs Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jul 4, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Project coverage is 78.3%. Comparing base (f43cae1) to head (41df0da).
Report is 5 commits behind head on nightly.

Additional details and impacted files
Files Coverage Δ
crates/sequencer/src/sequencer.rs 91.1% <93.7%> (+<0.1%) ⬆️

... and 11 files with indirect coverage changes

@rakanalh
Copy link
Contributor

rakanalh commented Jul 4, 2024

Question: We re-initialize the sequencer ledger db on startup from postgres... i believe the proper bug fix would be for the sequencer ledger DB to not be out of sync to begin with. Why does postgres have information ledger db doesn't have?

@yaziciahmet
Copy link
Contributor Author

@rakanalh what would you say to naming it sync_commitments_from_db?

@rakanalh
Copy link
Contributor

rakanalh commented Jul 4, 2024

@rakanalh what would you say to naming it sync_commitments_from_db?

Yea that works i guess.

@yaziciahmet
Copy link
Contributor Author

Question: We re-initialize the sequencer ledger db on startup from postgres... i believe the proper bug fix would be for the sequencer ledger DB to not be out of sync to begin with. Why does postgres have information ledger db doesn't have?

If you restart a sequencer, there is no problem. The problem is when full node is upgraded to be a sequencer. Full node does not track commitment related stuff in its LedgerDB. That is why this type of sync is necessary.

Copy link
Contributor

@rakanalh rakanalh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Approving.

Please wait for @eyusufatik to review as well before merging.

crates/sequencer/src/sequencer.rs Outdated Show resolved Hide resolved
@eyusufatik eyusufatik merged commit 8672a72 into nightly Jul 4, 2024
11 checks passed
@eyusufatik eyusufatik deleted the yaziciahmet/fix-intersecting-l2-commitments branch July 4, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T - bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Commitments are created on intersecting L2 ranges
3 participants