Skip to content

Reproduction Unknown Payload #187

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,11 @@ impl EngineApiServer for RollupBoostServer {
let span = tracing::Span::current();
if let Some(payload_id) = l2_response.payload_id {
span.record("payload_id", payload_id.to_string());

info!(
"received fork_choice_updated_v3, payload_id: {}",
payload_id
);
}

// TODO: Use _is_block_building_call to log the correct message during the async call to builder
Expand Down Expand Up @@ -322,7 +327,7 @@ impl EngineApiServer for RollupBoostServer {
&self,
payload_id: PayloadId,
) -> RpcResult<OpExecutionPayloadEnvelopeV3> {
info!("received get_payload_v3");
info!("received get_payload_v3, payload_id: {}", payload_id);

match self.get_payload(payload_id, Version::V3).await? {
OpExecutionPayloadEnvelope::V3(v3) => Ok(v3),
Expand Down
11 changes: 9 additions & 2 deletions tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ pub struct SimpleBlockGenerator {
latest_hash: B256,
timestamp: u64,
version: Version,
set_block_time: u64,
}

impl SimpleBlockGenerator {
Expand All @@ -320,9 +321,15 @@ impl SimpleBlockGenerator {
latest_hash: B256::ZERO, // temporary value
timestamp: 0, // temporary value
version: Version::V3,
set_block_time: 1,
}
}

/// Set the block time for the block generator
pub fn set_block_time(&mut self, block_time: u64) {
self.set_block_time = block_time;
}

/// Initialize the block generator by fetching the latest block
pub async fn init(&mut self) -> eyre::Result<()> {
let latest_block = self.engine_api.latest().await?.expect("block not found");
Expand Down Expand Up @@ -368,8 +375,8 @@ impl SimpleBlockGenerator {

let payload_id = result.payload_id.expect("missing payload id");

if !empty_blocks {
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;
if !empty_blocks && self.set_block_time != 0 {
tokio::time::sleep(tokio::time::Duration::from_secs(self.set_block_time)).await;
}

let payload = self
Expand Down
20 changes: 20 additions & 0 deletions tests/fcu_precedes_get_payload.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
mod common;

use crate::common::RollupBoostTestHarnessBuilder;

#[tokio::test]
async fn fcu_precedes_get_payload() -> eyre::Result<()> {
let harness = RollupBoostTestHarnessBuilder::new("fcu_precedes_get_payload")
.build()
.await?;
let mut block_generator = harness.block_generator().await?;
block_generator.set_block_time(0);

for _ in 0..100 {
let (_block, _block_creator) = block_generator.generate_block(false).await?;
}

// Unknwon payload appears on logs.

Ok(())
}
Loading