Make it possible to stop payload building loop #11783
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
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:
reth/crates/optimism/payload/src/builder.rs
Lines 149 to 151 in b814770
but we still spawn new jobs in a loop:
reth/crates/payload/basic/src/lib.rs
Lines 405 to 411 in b814770
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:
reth/crates/payload/basic/src/lib.rs
Line 703 in b814770
this is something like
and then check before we spawn a new block if the payload is frozen
reth/crates/payload/basic/src/lib.rs
Lines 407 to 410 in b814770
so we need a marker to track the state of:
reth/crates/payload/basic/src/lib.rs
Lines 324 to 325 in b814770
either a bool or an enum, like
Either
enum BestPayload {Frozen(),Current}
or similarAdditional context
No response
The text was updated successfully, but these errors were encountered: