-
Notifications
You must be signed in to change notification settings - Fork 78
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
feat: asynchronous and configurable block sealing #392
Conversation
Looking good 👍 - Apologies on the conflicts 😅 |
Alright I have added unit tests for the new functionality introduced in this PR, so IMO it's ready for review. @popzxc need your opinion on e2e tests for intervaled block sealing (i.e. Looking a bit ahead, the number of parameters will only continue to rise: we will be adding a couple more modes of block sealing, alternative modes of batch sealing, tx order etc. So it feels like there should be a separate mechanism for testing them - like a suite akin to |
My 2 cents here, I think we should proceed with the initial thought of running a subsection of e2e tests in the meantime, and then plan for updating e2e tests as you've described. We likely will need to prioritize the e2e test refactor sooner rather then later but well worth it. For the refactor, can we make use of e.g.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address the conflicts, otherwise LGTM. Let's merge this after the alpha.33 release?
@itegulov I would probably go with module test approach. Somewhat similar to what @dutterbutter proposed -- use |
badc548
to
78d0c47
Compare
f7f9e5f
to
25375b2
Compare
25375b2
to
7900968
Compare
6ba9d7b
to
767f5c5
Compare
tokio = { version = "1", features = ["time", "rt", "process"] } | ||
|
||
[dev-dependencies] | ||
alloy-zksync = { git = "https://github.com/itegulov/alloy-zksync.git", rev = "b433d2d64e0f7d939891064b00d8a7991a427682" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using my own branch for now as this needs popzxc/alloy-zksync#28 to be upstreamed
Merging as is for now, as there is a cyclic dependency between this PR and popzxc/alloy-zksync#28 😬 |
What 💻
This PR introduces several new components:
TxPool
- a very very basic version for now, essentially a mempool where we treat all txs to be ready at all timesBlockSealer
- component that takes txs from TxPool and decides whether it is time to seal the block (supports two modes of operation - immediate and intervaled)BlockProducer
- polls BlockSealer for new block that got sealed and actually applies them in the nodeCLI supports
--block-time
now (matching anvil's behaviour) andmax_transactions
config param (also matching anvil).One caveat here is that the new behaviour means that transactions are not included in a block immediately after submission which might be something people relied on. That being said this was never a guarantee and was pretty much an implementation detail.
Still need to add e2e tests for the new functionality (intervaled sealing) and cover components with unit tests, but opening a draft now to collect early feedback.(UPD: Unit tests are done, e2e tests are being discussed)Closes #362
Why ✋
See #362 for motivation