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

Sequencer scan L1 and resubmit mined commitments #928

Merged
merged 6 commits into from
Jul 31, 2024

Conversation

yaziciahmet
Copy link
Contributor

Description

We already had resubmission logic for commitments in local database. We also cross-checked whether if any pending marked commitments actually made it to mempool without sequencer being able to update its local database.

This PR adds also checks the potentially mined commitments. If a sequencer:

  1. submitted a commitment
  2. valid tx nonce is found and commitment submitted to DA
  3. restarted right before it was able to update its local pending commitments database
  4. during the off time of the restart, the commitment is mined and included in a block
    this causes sequencer to double commit the same l2 heights, which is a gas expensive operation.

Now we check the last committed L1 height to the head L1 block to see if there was any commitments included and update their pending status if so.

Linked Issues

@yaziciahmet yaziciahmet self-assigned this Jul 26, 2024
@yaziciahmet
Copy link
Contributor Author

With this PR, info logs became dirty with the following logs:

2024-07-30T17:08:48.268145Z  INFO Sequencer: bitcoin_da::service: Getting block at height 6991
2024-07-30T17:08:48.269112Z  INFO Sequencer: bitcoin_da::service: Extracting relevant txs from block 0x25fefbdedc9c4245e42ef0ac78e2c42c310d7280885e4780dfa71f2720fe0992
2024-07-30T17:08:48.269174Z  INFO Sequencer: bitcoin_da::service: Getting block at height 6992
2024-07-30T17:08:48.270271Z  INFO Sequencer: bitcoin_da::service: Extracting relevant txs from block 0x07390cc5b2bc18a036f459eadaf681818eec86d3b981a7fd2d4d65207c004c7f
2024-07-30T17:08:48.270341Z  INFO Sequencer: bitcoin_da::service: Getting block at height 6993
2024-07-30T17:08:48.271296Z  INFO Sequencer: bitcoin_da::service: Extracting relevant txs from block 0x76a58428cb87985917396c53a35ecf32e75c1b2dccca4fee5c847d821813bbfc

I suggest we make this particular logs in da debug level.

@yaziciahmet yaziciahmet force-pushed the yaziciahmet/scan-l1-on-reboot branch from 886a415 to b7d3bb4 Compare July 30, 2024 19:04
Copy link

codecov bot commented Jul 30, 2024

Codecov Report

Attention: Patch coverage is 85.29412% with 5 lines in your changes missing coverage. Please review.

Project coverage is 79.5%. Comparing base (49d2f47) to head (96d09c4).
Report is 1 commits behind head on nightly.

Files Patch % Lines
crates/sequencer/src/sequencer.rs 87.5% 4 Missing ⚠️
crates/bitcoin-da/src/service.rs 0.0% 1 Missing ⚠️
Additional details and impacted files
Files Coverage Δ
...reign-sdk/full-node/db/sov-db/src/ledger_db/mod.rs 96.7% <100.0%> (+<0.1%) ⬆️
crates/bitcoin-da/src/service.rs 60.5% <0.0%> (ø)
crates/sequencer/src/sequencer.rs 90.3% <87.5%> (-0.1%) ⬇️

... and 2 files with indirect coverage changes

@yaziciahmet yaziciahmet force-pushed the yaziciahmet/scan-l1-on-reboot branch from c792c57 to 96d09c4 Compare July 31, 2024 15:47
@eyusufatik eyusufatik merged commit 9df32cc into nightly Jul 31, 2024
12 checks passed
@eyusufatik eyusufatik deleted the yaziciahmet/scan-l1-on-reboot branch July 31, 2024 21:43
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.

Sequencer scan L1 on reboot
2 participants