Skip to content

Commit 4cbe87f

Browse files
authored
feat(engine): respond unsupported for payload v5 pre-osaka (#16268)
1 parent e57992a commit 4cbe87f

File tree

1 file changed

+13
-0
lines changed
  • crates/payload/primitives/src

1 file changed

+13
-0
lines changed

crates/payload/primitives/src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,19 @@ pub fn validate_payload_timestamp(
133133
// the payload does not fall within the time frame of the Prague fork.
134134
return Err(EngineObjectValidationError::UnsupportedFork)
135135
}
136+
137+
let is_osaka = chain_spec.is_osaka_active_at_timestamp(timestamp);
138+
if version.is_v5() && !is_osaka {
139+
// From the Engine API spec:
140+
// <https://github.com/ethereum/execution-apis/blob/15399c2e2f16a5f800bf3f285640357e2c245ad9/src/engine/osaka.md#specification>
141+
//
142+
// For `engine_getPayloadV5`
143+
//
144+
// 1. Client software MUST return -38005: Unsupported fork error if the timestamp of the
145+
// built payload does not fall within the time frame of the Osaka fork.
146+
return Err(EngineObjectValidationError::UnsupportedFork)
147+
}
148+
136149
Ok(())
137150
}
138151

0 commit comments

Comments
 (0)