@@ -265,7 +265,7 @@ func TestBlobs(t *testing.T) {
265265 require .Equal (t , false , resp .Finalized )
266266 })
267267 t .Run ("blob index over max" , func (t * testing.T ) {
268- overLimit := params . BeaconConfig (). MaxBlobsPerBlockByVersion (version .Deneb )
268+ overLimit := maxBlobsPerBlockByVersion (version .Deneb )
269269 u := fmt .Sprintf ("http://foo.example/123?indices=%d" , overLimit )
270270 request := httptest .NewRequest ("GET" , u , nil )
271271 writer := httptest .NewRecorder ()
@@ -415,7 +415,7 @@ func TestBlobs_Electra(t *testing.T) {
415415 params .OverrideBeaconConfig (cfg )
416416
417417 db := testDB .SetupDB (t )
418- electraBlock , blobs := util .GenerateTestElectraBlockWithSidecar (t , [32 ]byte {}, 123 , params . BeaconConfig (). MaxBlobsPerBlockByVersion (version .Electra ))
418+ electraBlock , blobs := util .GenerateTestElectraBlockWithSidecar (t , [32 ]byte {}, 123 , maxBlobsPerBlockByVersion (version .Electra ))
419419 require .NoError (t , db .SaveBlock (context .Background (), electraBlock ))
420420 bs := filesystem .NewEphemeralBlobStorage (t )
421421 testSidecars := verification .FakeVerifySliceForTest (t , blobs )
@@ -451,7 +451,7 @@ func TestBlobs_Electra(t *testing.T) {
451451 assert .Equal (t , http .StatusOK , writer .Code )
452452 resp := & structs.SidecarsResponse {}
453453 require .NoError (t , json .Unmarshal (writer .Body .Bytes (), resp ))
454- require .Equal (t , params . BeaconConfig (). MaxBlobsPerBlockByVersion (version .Electra ), len (resp .Data ))
454+ require .Equal (t , maxBlobsPerBlockByVersion (version .Electra ), len (resp .Data ))
455455 sidecar := resp .Data [0 ]
456456 require .NotNil (t , sidecar )
457457 assert .Equal (t , "0" , sidecar .Index )
@@ -464,7 +464,7 @@ func TestBlobs_Electra(t *testing.T) {
464464 require .Equal (t , false , resp .Finalized )
465465 })
466466 t .Run ("requested blob index at max" , func (t * testing.T ) {
467- limit := params . BeaconConfig (). MaxBlobsPerBlockByVersion (version .Electra ) - 1
467+ limit := maxBlobsPerBlockByVersion (version .Electra ) - 1
468468 u := fmt .Sprintf ("http://foo.example/123?indices=%d" , limit )
469469 request := httptest .NewRequest ("GET" , u , nil )
470470 writer := httptest .NewRecorder ()
@@ -496,7 +496,7 @@ func TestBlobs_Electra(t *testing.T) {
496496 require .Equal (t , false , resp .Finalized )
497497 })
498498 t .Run ("blob index over max" , func (t * testing.T ) {
499- overLimit := params . BeaconConfig (). MaxBlobsPerBlockByVersion (version .Electra )
499+ overLimit := maxBlobsPerBlockByVersion (version .Electra )
500500 u := fmt .Sprintf ("http://foo.example/123?indices=%d" , overLimit )
501501 request := httptest .NewRequest ("GET" , u , nil )
502502 writer := httptest .NewRecorder ()
@@ -554,3 +554,11 @@ func Test_parseIndices(t *testing.T) {
554554 })
555555 }
556556}
557+
558+ func maxBlobsPerBlockByVersion (v int ) int {
559+ if v >= version .Electra {
560+ return params .BeaconConfig ().DeprecatedMaxBlobsPerBlockElectra
561+ }
562+
563+ return params .BeaconConfig ().DeprecatedMaxBlobsPerBlock
564+ }
0 commit comments