@@ -3186,70 +3186,6 @@ func TestFeeVault(t *testing.T) {
31863186 }
31873187}
31883188
3189- // TestTransactionCountLimit tests that the chain reject blocks with too many transactions.
3190- func TestTransactionCountLimit (t * testing.T ) {
3191- // Create config that allows at most 1 transaction per block
3192- config := params .TestChainConfig
3193- config .Scroll .MaxTxPerBlock = new (int )
3194- * config .Scroll .MaxTxPerBlock = 1
3195- defer func () {
3196- config .Scroll .MaxTxPerBlock = nil
3197- }()
3198-
3199- var (
3200- engine = ethash .NewFaker ()
3201- db = rawdb .NewMemoryDatabase ()
3202- key , _ = crypto .HexToECDSA ("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291" )
3203- address = crypto .PubkeyToAddress (key .PublicKey )
3204- funds = big .NewInt (1000000000000000 )
3205- gspec = & Genesis {Config : config , Alloc : GenesisAlloc {address : {Balance : funds }}}
3206- genesis = gspec .MustCommit (db )
3207- )
3208-
3209- addTx := func (b * BlockGen ) {
3210- tx := types .NewTransaction (b .TxNonce (address ), address , big .NewInt (0 ), 50000 , b .header .BaseFee , nil )
3211- signed , _ := types .SignTx (tx , types.HomesteadSigner {}, key )
3212- b .AddTx (signed )
3213- }
3214-
3215- // Initialize blockchain
3216- blockchain , err := NewBlockChain (db , nil , config , engine , vm.Config {}, nil , nil )
3217- if err != nil {
3218- t .Fatalf ("failed to create new chain manager: %v" , err )
3219- }
3220- defer blockchain .Stop ()
3221-
3222- // Insert empty block
3223- block1 , _ := GenerateChain (config , genesis , ethash .NewFaker (), db , 1 , func (i int , b * BlockGen ) {
3224- // empty
3225- })
3226-
3227- if _ , err := blockchain .InsertChain (block1 ); err != nil {
3228- t .Fatalf ("failed to insert chain: %v" , err )
3229- }
3230-
3231- // Insert block with 1 transaction
3232- block2 , _ := GenerateChain (config , genesis , ethash .NewFaker (), db , 1 , func (i int , b * BlockGen ) {
3233- addTx (b )
3234- })
3235-
3236- if _ , err := blockchain .InsertChain (block2 ); err != nil {
3237- t .Fatalf ("failed to insert chain: %v" , err )
3238- }
3239-
3240- // Insert block with 2 transactions
3241- block3 , _ := GenerateChain (config , genesis , ethash .NewFaker (), db , 1 , func (i int , b * BlockGen ) {
3242- addTx (b )
3243- addTx (b )
3244- })
3245-
3246- _ , err = blockchain .InsertChain (block3 )
3247-
3248- if ! errors .Is (err , consensus .ErrInvalidTxCount ) {
3249- t .Fatalf ("error mismatch: have: %v, want: %v" , err , consensus .ErrInvalidTxCount )
3250- }
3251- }
3252-
32533189// TestInsertBlocksWithL1Messages tests that the chain accepts blocks with L1MessageTx transactions.
32543190func TestInsertBlocksWithL1Messages (t * testing.T ) {
32553191 var (
@@ -3443,69 +3379,6 @@ func TestL1MessageValidationFailure(t *testing.T) {
34433379 assert .Equal (t , uint64 (4 ), * queueIndex )
34443380}
34453381
3446- func TestBlockPayloadSizeLimit (t * testing.T ) {
3447- // Create config that allows at most 150 bytes per block payload
3448- config := params .TestChainConfig
3449- config .Scroll .MaxTxPayloadBytesPerBlock = new (int )
3450- * config .Scroll .MaxTxPayloadBytesPerBlock = 150
3451- defer func () {
3452- config .Scroll .MaxTxPayloadBytesPerBlock = nil
3453- }()
3454-
3455- var (
3456- engine = ethash .NewFaker ()
3457- db = rawdb .NewMemoryDatabase ()
3458- key , _ = crypto .HexToECDSA ("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291" )
3459- address = crypto .PubkeyToAddress (key .PublicKey )
3460- funds = big .NewInt (1000000000000000 )
3461- gspec = & Genesis {Config : config , Alloc : GenesisAlloc {address : {Balance : funds }}}
3462- genesis = gspec .MustCommit (db )
3463- )
3464-
3465- addTx := func (b * BlockGen ) {
3466- tx := types .NewTransaction (b .TxNonce (address ), address , big .NewInt (0 ), 50000 , b .header .BaseFee , nil )
3467- signed , _ := types .SignTx (tx , types.HomesteadSigner {}, key )
3468- b .AddTx (signed )
3469- }
3470-
3471- // Initialize blockchain
3472- blockchain , err := NewBlockChain (db , nil , config , engine , vm.Config {}, nil , nil )
3473- if err != nil {
3474- t .Fatalf ("failed to create new chain manager: %v" , err )
3475- }
3476- defer blockchain .Stop ()
3477-
3478- // Insert empty block
3479- block1 , _ := GenerateChain (config , genesis , ethash .NewFaker (), db , 1 , func (i int , b * BlockGen ) {
3480- // empty
3481- })
3482-
3483- if _ , err := blockchain .InsertChain (block1 ); err != nil {
3484- t .Fatalf ("failed to insert chain: %v" , err )
3485- }
3486-
3487- // Insert block with 1 transaction
3488- block2 , _ := GenerateChain (config , genesis , ethash .NewFaker (), db , 1 , func (i int , b * BlockGen ) {
3489- addTx (b )
3490- })
3491-
3492- if _ , err := blockchain .InsertChain (block2 ); err != nil {
3493- t .Fatalf ("failed to insert chain: %v" , err )
3494- }
3495-
3496- // Insert block with 2 transactions
3497- block3 , _ := GenerateChain (config , genesis , ethash .NewFaker (), db , 1 , func (i int , b * BlockGen ) {
3498- addTx (b )
3499- addTx (b )
3500- })
3501-
3502- _ , err = blockchain .InsertChain (block3 )
3503-
3504- if ! errors .Is (err , ErrInvalidBlockPayloadSize ) {
3505- t .Fatalf ("error mismatch: have: %v, want: %v" , err , ErrInvalidBlockPayloadSize )
3506- }
3507- }
3508-
35093382func TestEIP3651 (t * testing.T ) {
35103383 var (
35113384 addraa = common .HexToAddress ("0x000000000000000000000000000000000000aaaa" )
0 commit comments