mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(reth-bench): return error on invalid range (#14198)
This commit is contained in:
@ -83,7 +83,7 @@ impl Command {
|
|||||||
let (payload, _) =
|
let (payload, _) =
|
||||||
ExecutionPayload::from_block_unchecked(block.hash(), &block.into_block());
|
ExecutionPayload::from_block_unchecked(block.hash(), &block.into_block());
|
||||||
|
|
||||||
debug!(?block_number, "Sending payload",);
|
debug!(target: "reth-bench", ?block_number, "Sending payload",);
|
||||||
|
|
||||||
// construct fcu to call
|
// construct fcu to call
|
||||||
let forkchoice_state = ForkchoiceState {
|
let forkchoice_state = ForkchoiceState {
|
||||||
|
|||||||
@ -70,6 +70,7 @@ impl Command {
|
|||||||
let block_number = payload.block_number();
|
let block_number = payload.block_number();
|
||||||
|
|
||||||
debug!(
|
debug!(
|
||||||
|
target: "reth-bench",
|
||||||
number=?payload.block_number(),
|
number=?payload.block_number(),
|
||||||
"Sending payload to engine",
|
"Sending payload to engine",
|
||||||
);
|
);
|
||||||
|
|||||||
@ -119,6 +119,11 @@ where
|
|||||||
);
|
);
|
||||||
panic!("Invalid newPayloadV3: {status:?}");
|
panic!("Invalid newPayloadV3: {status:?}");
|
||||||
}
|
}
|
||||||
|
if status.is_syncing() {
|
||||||
|
return Err(alloy_json_rpc::RpcError::UnsupportedFeature(
|
||||||
|
"invalid range: no canonical state found for parent of requested block",
|
||||||
|
))
|
||||||
|
}
|
||||||
status = self
|
status = self
|
||||||
.new_payload_v3(payload.clone(), versioned_hashes.clone(), parent_beacon_block_root)
|
.new_payload_v3(payload.clone(), versioned_hashes.clone(), parent_beacon_block_root)
|
||||||
.await?;
|
.await?;
|
||||||
@ -144,6 +149,11 @@ where
|
|||||||
);
|
);
|
||||||
panic!("Invalid forkchoiceUpdatedV1: {status:?}");
|
panic!("Invalid forkchoiceUpdatedV1: {status:?}");
|
||||||
}
|
}
|
||||||
|
if status.is_syncing() {
|
||||||
|
return Err(alloy_json_rpc::RpcError::UnsupportedFeature(
|
||||||
|
"invalid range: no canonical state found for parent of requested block",
|
||||||
|
))
|
||||||
|
}
|
||||||
status =
|
status =
|
||||||
self.fork_choice_updated_v1(fork_choice_state, payload_attributes.clone()).await?;
|
self.fork_choice_updated_v1(fork_choice_state, payload_attributes.clone()).await?;
|
||||||
}
|
}
|
||||||
@ -169,6 +179,11 @@ where
|
|||||||
);
|
);
|
||||||
panic!("Invalid forkchoiceUpdatedV2: {status:?}");
|
panic!("Invalid forkchoiceUpdatedV2: {status:?}");
|
||||||
}
|
}
|
||||||
|
if status.is_syncing() {
|
||||||
|
return Err(alloy_json_rpc::RpcError::UnsupportedFeature(
|
||||||
|
"invalid range: no canonical state found for parent of requested block",
|
||||||
|
))
|
||||||
|
}
|
||||||
status =
|
status =
|
||||||
self.fork_choice_updated_v2(fork_choice_state, payload_attributes.clone()).await?;
|
self.fork_choice_updated_v2(fork_choice_state, payload_attributes.clone()).await?;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user