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

Make it possible to stop payload building loop #11783

Open
mattsse opened this issue Oct 16, 2024 · 1 comment · May be fixed by #11790
Open

Make it possible to stop payload building loop #11783

mattsse opened this issue Oct 16, 2024 · 1 comment · May be fixed by #11790
Assignees
Labels
A-block-building Related to block building C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started

Comments

@mattsse
Copy link
Collaborator

mattsse commented Oct 16, 2024

Describe the feature

currently the basic payload builder tries to build better and better blocks.

this makes sense for eth and op in sequencer mode but not for op if no txs from the pool should be included because then the block is predetermined:

/// Payload attributes by the sequencer. If the `no_tx_pool` argument is passed in
/// the payload attributes, the transaction pool will be ignored and the only transactions
/// included in the payload will be those sent through the attributes.

but we still spawn new jobs in a loop:

// check if the interval is reached
while this.interval.poll_tick(cx).is_ready() {
// start a new job if there is no pending block and we haven't reached the deadline
if this.pending_block.is_none() {
this.spawn_build_job();
}
}

we need a way for the job to tell the builder to not schedule any more jobs.

we can do this by introducing a new outcome variant here:

this is something like

Freeze(Payload)

and then check before we spawn a new block if the payload is frozen

// start a new job if there is no pending block and we haven't reached the deadline
if this.pending_block.is_none() {
this.spawn_build_job();
}

so we need a marker to track the state of:

/// The best payload so far.
best_payload: Option<Builder::BuiltPayload>,

either a bool or an enum, like Either enum BestPayload {Frozen(),Current} or similar

Additional context

No response

@mattsse mattsse added C-enhancement New feature or request S-needs-triage This issue needs to be labelled D-good-first-issue Nice and easy! A great choice to get started A-block-building Related to block building and removed S-needs-triage This issue needs to be labelled D-good-first-issue Nice and easy! A great choice to get started labels Oct 16, 2024
@hoank101
Copy link

Hey sir, I'd like to work on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-block-building Related to block building C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants