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

Eagerly compute witness when sequencing (fork12) #1326

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

cffls
Copy link

@cffls cffls commented Oct 15, 2024

Before this change, the witness of a batch is computed only right before being sent to an executor. This mechanism can result in a longer time in chain unwinding if the witness to be computed is far away from the head. For example, if the batch to be verified is 1000 batches behind the tip of the sequencer, the sequencer will need to unwind the same amount batches before computing the witness. Overall, the unnecessary computation complexity of this behavior is O(n^2), where n is the number of pending batches to be verified.
We can remove this redundant computation by always eagerly computing the witness when a batch is closed, without delaying to the verification promise and therefore avoid chain unwinding overall.

@cla-bot cla-bot bot added the cla-signed label Oct 15, 2024
@cffls cffls requested review from kstoykov and hexoscott October 15, 2024 23:23
@cffls cffls force-pushed the fix/fast_witness_generation branch from 0d66b3f to 9805008 Compare October 16, 2024 00:07
@cffls cffls changed the title Eagerly compute witness when sequencing Eagerly compute witness when sequencing (fork12) Oct 16, 2024
Before this change, the witness of a batch is computed only right before being sent to an executor. This mechanism can result in a longer time in chain unwinding if the witness to be computed is far away from the head. For example, if the batch to be verified is 1000 batches behind the tip of the sequencer, the sequencer will need to unwind the same amount batches before computing the witness. Overall, the unnecessary computation complexity of this behavior is O(n^2), where n is the number of pending batches to be verified.
We can remove this redundant computation by always eagerly computing the witness when a batch is closed, without delaying to the verification promise and therefore avoid chain unwinding overall.
@cffls cffls force-pushed the fix/fast_witness_generation branch from 9805008 to 8d1f0d9 Compare October 16, 2024 19:01
Copy link

sonarcloud bot commented Oct 16, 2024

@cffls cffls merged commit d930066 into fork12 Oct 17, 2024
7 checks passed
@cffls cffls deleted the fix/fast_witness_generation branch October 17, 2024 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants