Skip to content

Commit

Permalink
chore: use new payload validator in tree
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Nov 28, 2024
1 parent aea5613 commit 5b68f58
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions crates/engine/tree/src/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use reth_errors::{ConsensusError, ProviderResult};
use reth_evm::execute::BlockExecutorProvider;
use reth_payload_builder::PayloadBuilderHandle;
use reth_payload_builder_primitives::PayloadBuilder;
use reth_payload_primitives::{PayloadAttributes, PayloadBuilderAttributes};
use reth_payload_primitives::PayloadBuilderAttributes;
use reth_primitives::{
Block, EthPrimitives, GotExpected, NodePrimitives, SealedBlock, SealedBlockWithSenders,
SealedHeader,
Expand Down Expand Up @@ -2532,12 +2532,8 @@ where
state: ForkchoiceState,
version: EngineApiMessageVersion,
) -> OnForkChoiceUpdated {
// 7. Client software MUST ensure that payloadAttributes.timestamp is greater than timestamp
// of a block referenced by forkchoiceState.headBlockHash. If this condition isn't held
// client software MUST respond with -38003: `Invalid payload attributes` and MUST NOT
// begin a payload build process. In such an event, the forkchoiceState update MUST NOT
// be rolled back.
if attrs.timestamp() <= head.timestamp {
if let Err(err) = self.payload_validator.validate_payload_attributes_against_header(&attrs, head) {
warn!(target: "engine::tree", %err, ?head, "Invalid payload attributes");
return OnForkChoiceUpdated::invalid_payload_attributes()
}

Expand Down

0 comments on commit 5b68f58

Please sign in to comment.