Skip to content

fix(sequencer): submit genesis block to Bedrock on fresh start#409

Open
0x-r4bbit wants to merge 1 commit intomainfrom
fix/sequencer-test
Open

fix(sequencer): submit genesis block to Bedrock on fresh start#409
0x-r4bbit wants to merge 1 commit intomainfrom
fix/sequencer-test

Conversation

@0x-r4bbit
Copy link
Copy Markdown
Contributor

The sequencer created the genesis block's inscribe transaction but discarded it (_tx), never posting it to Bedrock. The indexer's search_for_channel_start scans backward through L1 blocks looking for an L2 block with block_id == 1 to locate the channel start. Since genesis was never on L1, the search looped indefinitely, clearing its buffer on every cycle, and current_state was never updated past genesis.

On a fresh DB start, submit the genesis block to Bedrock immediately after creating it, mirroring what produce_new_block does for all subsequent blocks. On restart the genesis block is already on Bedrock from the initial run, so submission is skipped.

Fixes the indexer_state_consistency integration test.

The sequencer created the genesis block's inscribe transaction but
discarded it (`_tx`), never posting it to Bedrock. The indexer's
`search_for_channel_start` scans backward through L1 blocks looking
for an L2 block with `block_id == 1` to locate the channel start. Since
genesis was never on L1, the search looped indefinitely, clearing its
buffer on every cycle, and `current_state` was never updated past genesis.

On a fresh DB start, submit the genesis block to Bedrock immediately
after creating it, mirroring what `produce_new_block` does for all
subsequent blocks. On restart the genesis block is already on Bedrock
from the initial run, so submission is skipped.

Fixes the `indexer_state_consistency` integration test.
@0x-r4bbit 0x-r4bbit requested a review from Arjentix March 26, 2026 08:17
Copy link
Copy Markdown
Collaborator

@Arjentix Arjentix left a comment

Choose a reason for hiding this comment

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

Hey, thanks for the PR. IMO this is a good addition, but not a fix, because we actually have a thread which retries pending blocks, so it should immediately retry genesis.

Also you can see that indexer tests are still failing. We concluded that this is probably something on bedrock side and currently we disabled this tests in CI while we're waiting for the fix. When you rebase to main you'll see it's removed from CI.

Anyway I'd not merge without @Pravdyvy 's approval.

Copy link
Copy Markdown
Collaborator

@Pravdyvy Pravdyvy left a comment

Choose a reason for hiding this comment

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

lgtm. Latest main should fix the tests.

@0x-r4bbit
Copy link
Copy Markdown
Contributor Author

You want me to rebase this, or you guys wanna close this one?

@Pravdyvy
Copy link
Copy Markdown
Collaborator

You want me to rebase this, or you guys wanna close this one?

It is useful. You can rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants