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

Consider changing initial L2 block number to 0 #2674

Closed
benesjan opened this issue Oct 4, 2023 · 1 comment
Closed

Consider changing initial L2 block number to 0 #2674

benesjan opened this issue Oct 4, 2023 · 1 comment
Labels
S-needs-discussion Status: Still needs more discussion before work can start.

Comments

@benesjan
Copy link
Contributor

benesjan commented Oct 4, 2023

Initial L2 block number is currently set to 1. Industry-wide standard is that the genesis block starts from number 0. This could cause issues to devs when fetching blocks etc.

Update: Bellow is a chatgpt summary of my discussion with Lasse. Not sure if it's worth it to bother with this.

"Lasse explained that starting the block number from 1 made the logic for block number validation easier. Additionally, it allowed the genesis block to be integrated into the rollup code, effectively starting "after" it. However, Jan Benes pointed out that this choice could cause awkwardness with log filtering since the industry-wide standard is for the genesis block to have number 0. Lasse acknowledged this and mentioned that a special case for the "old state" would be needed in this scenario. The computation for the old state uses the block number - 1. Lasse also noted that handling both cases (starting from 0 and starting from 1) in the circuits could be a challenge. Lasse suggested an alternative approach of storing the block number in the contract's storage, which might simplify some aspects of the process."

@github-project-automation github-project-automation bot moved this to Todo in A3 Oct 4, 2023
@benesjan benesjan changed the title Change initial L2 block number to 0 Consider changing initial L2 block number to 0 Oct 6, 2023
@benesjan benesjan added the S-needs-discussion Status: Still needs more discussion before work can start. label Oct 6, 2023
@benesjan
Copy link
Contributor Author

Closing this in favor of #411

@github-project-automation github-project-automation bot moved this from Todo to Done in A3 Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-needs-discussion Status: Still needs more discussion before work can start.
Projects
Archived in project
Development

No branches or pull requests

1 participant