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

chore: Use single fork for building a block in the sequencer #11000

Open
spalladino opened this issue Jan 2, 2025 · 0 comments
Open

chore: Use single fork for building a block in the sequencer #11000

spalladino opened this issue Jan 2, 2025 · 0 comments
Assignees

Comments

@spalladino
Copy link
Collaborator

spalladino commented Jan 2, 2025

The sequencer currently uses two db forks when assembling a block: one for the public processor, one for the block builder itself. This was introduced in #9634 to fix a bug and ensure that we have the correct state when starting a new tx in a block. From @MirandaWood:

Ah yep - the reason there are two is because the block builder is 'back in time' so that it can reconstruct inputs and then adds to its own db. If there was one shared db, at the time it wasn't possible to get the correct state for tx 0 to get the correct inputs for base rollup circuit 0. In other words, back then the public processor and block builder both needed to know the state at each tx at different times. A lot has changed since then so it may no longer be required.

This was done to avoid making changes to the public processor, due to a limitation introduced by blobs: we need to know the size of all tx effects before we start proving.

#9302 (comment)
Here ^ so unfortunately we need to know the number of elements a blob will have before we start proving, to initialise the poseidon sponge. This means we have to process the block's txs then start proving them. So the public processor can't go process -> add to block builder for each tx. I think because of this, and to remove messy additional code, the 'tx handler' optional input was removed.

Since we only need this info for proving and not for block building, we can fix this by having the archiver store the size of tx effects along with the rest of the block, and injecting that into the epoch proving job.

@spalladino spalladino self-assigned this Jan 2, 2025
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

No branches or pull requests

1 participant