-
Notifications
You must be signed in to change notification settings - Fork 176
fix(l1): only rebuild payload when mempool receives new transactions (Notify) #6169
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
Changes from 4 commits
cff161d
1a3a7ea
ab2a1ec
9228eef
bf7a919
424545a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -390,6 +390,14 @@ impl Blockchain { | |
| // TODO(#4997): start with an empty block | ||
| let mut res = self.build_payload(payload.clone())?; | ||
| while start.elapsed() < SECONDS_PER_SLOT && !cancel_token.is_cancelled() { | ||
| // Wait for new transactions, cancellation, or slot deadline before rebuilding | ||
| let remaining = SECONDS_PER_SLOT.saturating_sub(start.elapsed()); | ||
| let notified = self.mempool.tx_added().notified(); | ||
| tokio::select! { | ||
| _ = notified => {} | ||
| _ = cancel_token.cancelled() => break, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, but I think the branch is actually needed: without it, if |
||
| _ = tokio::time::sleep(remaining) => break, | ||
| } | ||
avilagaston9 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| let payload = payload.clone(); | ||
| let self_clone = self.clone(); | ||
| let building_task = | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.