@@ -245,8 +245,9 @@ func (api *ConsensusAPI) ForkchoiceUpdatedV3(update engine.ForkchoiceStateV1, pa
245
245
if params .BeaconRoot == nil {
246
246
return engine .STATUS_INVALID , engine .InvalidPayloadAttributes .With (errors .New ("missing beacon root" ))
247
247
}
248
- if api .eth .BlockChain ().Config ().LatestFork (params .Timestamp ) != forks .Cancun && api .eth .BlockChain ().Config ().LatestFork (params .Timestamp ) != forks .Prague {
249
- return engine .STATUS_INVALID , engine .UnsupportedFork .With (errors .New ("forkchoiceUpdatedV3 must only be called for cancun payloads" ))
248
+ latestFork := api .eth .BlockChain ().Config ().LatestFork (params .Timestamp )
249
+ if latestFork != forks .Cancun && latestFork != forks .Prague && latestFork != forks .Osaka {
250
+ return engine .STATUS_INVALID , engine .UnsupportedFork .With (errors .New ("forkchoiceUpdatedV3 must only be called for cancun, prague and osaka payloads" ))
250
251
}
251
252
}
252
253
// TODO(matt): the spec requires that fcu is applied when called on a valid
@@ -303,8 +304,9 @@ func (api *ConsensusAPI) ForkchoiceUpdatedWithWitnessV3(update engine.Forkchoice
303
304
if params .BeaconRoot == nil {
304
305
return engine .STATUS_INVALID , engine .InvalidPayloadAttributes .With (errors .New ("missing beacon root" ))
305
306
}
306
- if api .eth .BlockChain ().Config ().LatestFork (params .Timestamp ) != forks .Cancun && api .eth .BlockChain ().Config ().LatestFork (params .Timestamp ) != forks .Prague {
307
- return engine .STATUS_INVALID , engine .UnsupportedFork .With (errors .New ("forkchoiceUpdatedV3 must only be called for cancun payloads" ))
307
+ latestFork := api .eth .BlockChain ().Config ().LatestFork (params .Timestamp )
308
+ if latestFork != forks .Cancun && latestFork != forks .Prague && latestFork != forks .Osaka {
309
+ return engine .STATUS_INVALID , engine .UnsupportedFork .With (errors .New ("forkchoiceUpdatedV3 must only be called for cancun, prague and osaka payloads" ))
308
310
}
309
311
}
310
312
// TODO(matt): the spec requires that fcu is applied when called on a valid
@@ -666,8 +668,9 @@ func (api *ConsensusAPI) NewPayloadV4(params engine.ExecutableData, versionedHas
666
668
return engine.PayloadStatusV1 {Status : engine .INVALID }, engine .InvalidParams .With (errors .New ("nil executionRequests post-prague" ))
667
669
}
668
670
669
- if api .eth .BlockChain ().Config ().LatestFork (params .Timestamp ) != forks .Prague {
670
- return engine.PayloadStatusV1 {Status : engine .INVALID }, engine .UnsupportedFork .With (errors .New ("newPayloadV4 must only be called for prague payloads" ))
671
+ latestFork := api .eth .BlockChain ().Config ().LatestFork (params .Timestamp )
672
+ if latestFork != forks .Prague && latestFork != forks .Osaka {
673
+ return engine.PayloadStatusV1 {Status : engine .INVALID }, engine .UnsupportedFork .With (errors .New ("newPayloadV4 must only be called for prague or osaka payloads" ))
671
674
}
672
675
requests := convertRequests (executionRequests )
673
676
if err := validateRequests (requests ); err != nil {
@@ -788,8 +791,9 @@ func (api *ConsensusAPI) NewPayloadWithWitnessV4(params engine.ExecutableData, v
788
791
return engine.PayloadStatusV1 {Status : engine .INVALID }, engine .InvalidParams .With (errors .New ("nil executionRequests post-prague" ))
789
792
}
790
793
791
- if api .eth .BlockChain ().Config ().LatestFork (params .Timestamp ) != forks .Prague {
792
- return engine.PayloadStatusV1 {Status : engine .INVALID }, engine .UnsupportedFork .With (errors .New ("newPayloadWithWitnessV4 must only be called for prague payloads" ))
794
+ latestFork := api .eth .BlockChain ().Config ().LatestFork (params .Timestamp )
795
+ if latestFork != forks .Prague && latestFork != forks .Osaka {
796
+ return engine.PayloadStatusV1 {Status : engine .INVALID }, engine .UnsupportedFork .With (errors .New ("newPayloadWithWitnessV4 must only be called for prague or osaka payloads" ))
793
797
}
794
798
requests := convertRequests (executionRequests )
795
799
if err := validateRequests (requests ); err != nil {
0 commit comments