@@ -492,6 +492,12 @@ func (api *ConsensusAPI) getPayload(payloadID engine.PayloadID, full bool) (*eng
492
492
// Client software MAY return an array of all null entries if syncing or otherwise
493
493
// unable to serve blob pool data.
494
494
func (api * ConsensusAPI ) GetBlobsV1 (hashes []common.Hash ) ([]* engine.BlobAndProofV1 , error ) {
495
+ // Reject the request if Osaka has been activated.
496
+ // follow https://github.com/ethereum/execution-apis/blob/main/src/engine/osaka.md#cancun-api
497
+ head := api .eth .BlockChain ().CurrentHeader ()
498
+ if ! api .checkFork (head .Time , forks .Cancun , forks .Prague ) {
499
+ return nil , unsupportedForkErr ("engine_getBlobsV1 is only available at Cancun/Prague fork" )
500
+ }
495
501
if len (hashes ) > 128 {
496
502
return nil , engine .TooLargeRequest .With (fmt .Errorf ("requested blob count too large: %v" , len (hashes )))
497
503
}
@@ -532,16 +538,17 @@ func (api *ConsensusAPI) GetBlobsV1(hashes []common.Hash) ([]*engine.BlobAndProo
532
538
// - if the request is [A_versioned_hash_for_blob_with_blob_proof], the response
533
539
// MUST be null as well.
534
540
//
535
- // Note, geth internally make the conversion from old version to new one, so the
536
- // data will be returned normally.
537
- //
538
541
// Client software MUST support request sizes of at least 128 blob versioned
539
542
// hashes. The client MUST return -38004: Too large request error if the number
540
543
// of requested blobs is too large.
541
544
//
542
545
// Client software MUST return null if syncing or otherwise unable to serve
543
546
// blob pool data.
544
547
func (api * ConsensusAPI ) GetBlobsV2 (hashes []common.Hash ) ([]* engine.BlobAndProofV2 , error ) {
548
+ head := api .eth .BlockChain ().CurrentHeader ()
549
+ if api .config ().LatestFork (head .Time ) < forks .Osaka {
550
+ return nil , unsupportedForkErr ("engine_getBlobsV2 is not available before Osaka fork" )
551
+ }
545
552
if len (hashes ) > 128 {
546
553
return nil , engine .TooLargeRequest .With (fmt .Errorf ("requested blob count too large: %v" , len (hashes )))
547
554
}
0 commit comments