Skip to content

Commit 56c0cf0

Browse files
authored
revert(l1, l2): revert building initially empty block (#5364)
**Description** This reverts #5337. The time between payload building and fetching in devnet turned out to not be enough for some of the L2 test cases, so we'll have to figure out a new approach to building devnet blocks.
1 parent 8825ef3 commit 56c0cf0

File tree

2 files changed

+5
-25
lines changed

2 files changed

+5
-25
lines changed

crates/blockchain/payload.rs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ impl Blockchain {
369369
let start = Instant::now();
370370
const SECONDS_PER_SLOT: Duration = Duration::from_secs(12);
371371
// Attempt to rebuild the payload as many times within the given timeframe to maximize fee revenue
372-
let mut res = self.build_empty_payload(payload.clone())?;
372+
// TODO(#4997): start with an empty block
373+
let mut res = self.build_payload(payload.clone())?;
373374
while start.elapsed() < SECONDS_PER_SLOT && !cancel_token.is_cancelled() {
374375
let payload = payload.clone();
375376
let self_clone = self.clone();
@@ -391,22 +392,8 @@ impl Blockchain {
391392
Ok(res)
392393
}
393394

394-
// We separate this into two functions, so we can build the initial empty payload and then start filling it
395-
// TODO: once we implement a mechanism to gradually fill the payload with transactions we won't need this
396-
pub fn build_payload(&self, payload: Block) -> Result<PayloadBuildResult, ChainError> {
397-
self.build_payload_inner(payload, true)
398-
}
399-
400-
pub fn build_empty_payload(&self, payload: Block) -> Result<PayloadBuildResult, ChainError> {
401-
self.build_payload_inner(payload, false)
402-
}
403-
404395
/// Completes the payload building process, return the block value
405-
pub fn build_payload_inner(
406-
&self,
407-
payload: Block,
408-
fill_transactions: bool,
409-
) -> Result<PayloadBuildResult, ChainError> {
396+
pub fn build_payload(&self, payload: Block) -> Result<PayloadBuildResult, ChainError> {
410397
let since = Instant::now();
411398
let gas_limit = payload.header.gas_limit;
412399

@@ -418,10 +405,8 @@ impl Blockchain {
418405
self.apply_system_operations(&mut context)?;
419406
}
420407
self.apply_withdrawals(&mut context)?;
421-
if fill_transactions {
422-
self.fill_transactions(&mut context)?;
423-
self.extract_requests(&mut context)?;
424-
}
408+
self.fill_transactions(&mut context)?;
409+
self.extract_requests(&mut context)?;
425410
self.finalize_payload(&mut context)?;
426411

427412
let interval = Instant::now().duration_since(since).as_millis();

tooling/reorgs/src/simulator.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,6 @@ impl Node {
277277
);
278278
let payload_id = fork_choice_response.payload_id.unwrap();
279279

280-
// We need this sleep so the get_payload call doesn't return an empty block
281-
// As of #5205 we build an empty block first before building a payload with the transactions to avoid missing slots
282-
// This can cause issues in these tests if the payload is requested too early, the sleep is there to avoid it
283-
tokio::time::sleep(Duration::from_millis(50)).await;
284-
285280
let payload_response = self
286281
.engine_client
287282
.engine_get_payload_v5(payload_id)

0 commit comments

Comments
 (0)