diff --git a/sequencer/datastreamer.go b/sequencer/datastreamer.go index 8330c8b11c..0766ed348e 100644 --- a/sequencer/datastreamer.go +++ b/sequencer/datastreamer.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/go-ethereum/common" ) -func (f *finalizer) DSSendL2Block(ctx context.Context, batchNumber uint64, blockResponse *state.ProcessBlockResponse, l1InfoTreeIndex uint32, minTimestamp uint64) error { +func (f *finalizer) DSSendL2Block(ctx context.Context, batchNumber uint64, blockResponse *state.ProcessBlockResponse, l1InfoTreeIndex uint32, minTimestamp uint64, blockHash common.Hash) error { forkID := f.stateIntf.GetForkIDByBatchNumber(batchNumber) // Send data to streamer @@ -18,17 +18,21 @@ func (f *finalizer) DSSendL2Block(ctx context.Context, batchNumber uint64, block BatchNumber: batchNumber, L2BlockNumber: blockResponse.BlockNumber, Timestamp: blockResponse.Timestamp, - Min_timestamp: minTimestamp, + MinTimestamp: minTimestamp, L1InfoTreeIndex: l1InfoTreeIndex, L1BlockHash: blockResponse.BlockHashL1, GlobalExitRoot: blockResponse.GlobalExitRoot, Coinbase: f.l2Coinbase, ForkID: forkID, - BlockHash: blockResponse.BlockHash, + BlockHash: blockHash, StateRoot: blockResponse.BlockHash, //From etrog, the blockhash is the block root BlockInfoRoot: blockResponse.BlockInfoRoot, } + if l2Block.ForkID >= state.FORKID_ETROG && l2Block.L1InfoTreeIndex == 0 { + l2Block.MinTimestamp = 0 + } + l2Transactions := []state.DSL2Transaction{} for i, txResponse := range blockResponse.TransactionResponses { diff --git a/sequencer/forcedbatch.go b/sequencer/forcedbatch.go index a9707fd8db..de1082c347 100644 --- a/sequencer/forcedbatch.go +++ b/sequencer/forcedbatch.go @@ -180,7 +180,7 @@ func (f *finalizer) handleProcessForcedBatchResponse(ctx context.Context, newBat // process L2 blocks responses for the forced batch for _, forcedL2BlockResponse := range batchResponse.BlockResponses { // Store forced L2 blocks in the state - err := f.stateIntf.StoreL2Block(ctx, newBatchNumber, forcedL2BlockResponse, nil, dbTx) + blockHash, err := f.stateIntf.StoreL2Block(ctx, newBatchNumber, forcedL2BlockResponse, nil, dbTx) if err != nil { return fmt.Errorf("database error on storing L2 block %d, error: %v", forcedL2BlockResponse.BlockNumber, err) } @@ -198,7 +198,7 @@ func (f *finalizer) handleProcessForcedBatchResponse(ctx context.Context, newBat } // Send L2 block to data streamer - err = f.DSSendL2Block(ctx, newBatchNumber, forcedL2BlockResponse, 0, forcedL2BlockResponse.Timestamp) + err = f.DSSendL2Block(ctx, newBatchNumber, forcedL2BlockResponse, 0, forcedL2BlockResponse.Timestamp, blockHash) if err != nil { //TODO: we need to halt/rollback the L2 block if we had an error sending to the data streamer? log.Errorf("error sending L2 block %d to data streamer, error: %v", forcedL2BlockResponse.BlockNumber, err) diff --git a/sequencer/interfaces.go b/sequencer/interfaces.go index c92f502e10..72beb71578 100644 --- a/sequencer/interfaces.go +++ b/sequencer/interfaces.go @@ -72,7 +72,7 @@ type stateInterface interface { GetDSL2Blocks(ctx context.Context, firstBatchNumber, lastBatchNumber uint64, dbTx pgx.Tx) ([]*state.DSL2Block, error) GetDSL2Transactions(ctx context.Context, firstL2Block, lastL2Block uint64, dbTx pgx.Tx) ([]*state.DSL2Transaction, error) GetStorageAt(ctx context.Context, address common.Address, position *big.Int, root common.Hash) (*big.Int, error) - StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *state.ProcessBlockResponse, txsEGPLog []*state.EffectiveGasPriceLog, dbTx pgx.Tx) error + StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *state.ProcessBlockResponse, txsEGPLog []*state.EffectiveGasPriceLog, dbTx pgx.Tx) (common.Hash, error) BuildChangeL2Block(deltaTimestamp uint32, l1InfoTreeIndex uint32) []byte GetL1InfoTreeDataFromBatchL2Data(ctx context.Context, batchL2Data []byte, dbTx pgx.Tx) (map[uint32]state.L1DataV2, common.Hash, common.Hash, error) GetBlockByNumber(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (*state.Block, error) diff --git a/sequencer/l2block.go b/sequencer/l2block.go index c260867166..7cc21fc928 100644 --- a/sequencer/l2block.go +++ b/sequencer/l2block.go @@ -423,7 +423,7 @@ func (f *finalizer) storeL2Block(ctx context.Context, l2Block *L2Block) error { } // Store L2 block in the state - err = f.stateIntf.StoreL2Block(ctx, l2Block.batch.batchNumber, blockResponse, txsEGPLog, dbTx) + blockHash, err := f.stateIntf.StoreL2Block(ctx, l2Block.batch.batchNumber, blockResponse, txsEGPLog, dbTx) if err != nil { return rollbackOnError(fmt.Errorf("database error on storing L2 block %d [%d], error: %v", blockResponse.BlockNumber, l2Block.trackingNum, err)) } @@ -490,7 +490,7 @@ func (f *finalizer) storeL2Block(ctx context.Context, l2Block *L2Block) error { } // Send L2 block to data streamer - err = f.DSSendL2Block(ctx, l2Block.batch.batchNumber, blockResponse, l2Block.getL1InfoTreeIndex(), l2Block.timestamp) + err = f.DSSendL2Block(ctx, l2Block.batch.batchNumber, blockResponse, l2Block.getL1InfoTreeIndex(), l2Block.timestamp, blockHash) if err != nil { //TODO: we need to halt/rollback the L2 block if we had an error sending to the data streamer? log.Errorf("error sending L2 block %d [%d] to data streamer, error: %v", blockResponse.BlockNumber, l2Block.trackingNum, err) diff --git a/sequencer/mock_state.go b/sequencer/mock_state.go index f7f3861d4b..0c1edc59e5 100644 --- a/sequencer/mock_state.go +++ b/sequencer/mock_state.go @@ -1019,21 +1019,33 @@ func (_m *StateMock) ProcessBatchV2(ctx context.Context, request state.ProcessRe } // StoreL2Block provides a mock function with given fields: ctx, batchNumber, l2Block, txsEGPLog, dbTx -func (_m *StateMock) StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *state.ProcessBlockResponse, txsEGPLog []*state.EffectiveGasPriceLog, dbTx pgx.Tx) error { +func (_m *StateMock) StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *state.ProcessBlockResponse, txsEGPLog []*state.EffectiveGasPriceLog, dbTx pgx.Tx) (common.Hash, error) { ret := _m.Called(ctx, batchNumber, l2Block, txsEGPLog, dbTx) if len(ret) == 0 { panic("no return value specified for StoreL2Block") } - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, uint64, *state.ProcessBlockResponse, []*state.EffectiveGasPriceLog, pgx.Tx) error); ok { + var r0 common.Hash + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, *state.ProcessBlockResponse, []*state.EffectiveGasPriceLog, pgx.Tx) (common.Hash, error)); ok { + return rf(ctx, batchNumber, l2Block, txsEGPLog, dbTx) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, *state.ProcessBlockResponse, []*state.EffectiveGasPriceLog, pgx.Tx) common.Hash); ok { r0 = rf(ctx, batchNumber, l2Block, txsEGPLog, dbTx) } else { - r0 = ret.Error(0) + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Hash) + } } - return r0 + if rf, ok := ret.Get(1).(func(context.Context, uint64, *state.ProcessBlockResponse, []*state.EffectiveGasPriceLog, pgx.Tx) error); ok { + r1 = rf(ctx, batchNumber, l2Block, txsEGPLog, dbTx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 } // UpdateBatchAsChecked provides a mock function with given fields: ctx, batchNumber, dbTx diff --git a/sequencer/sequencer.go b/sequencer/sequencer.go index 9eda30cee3..c573c09924 100644 --- a/sequencer/sequencer.go +++ b/sequencer/sequencer.go @@ -318,7 +318,7 @@ func (s *Sequencer) sendDataToStreamer(chainID uint64) { BatchNumber: l2Block.BatchNumber, Timestamp: l2Block.Timestamp, DeltaTimestamp: uint32(l2Block.Timestamp - previousL2Block.Timestamp), - MinTimestamp: l2Block.Min_timestamp, + MinTimestamp: l2Block.MinTimestamp, L1Blockhash: l2Block.L1BlockHash.Bytes(), L1InfotreeIndex: l2Block.L1InfoTreeIndex, Hash: l2Block.BlockHash.Bytes(), diff --git a/state/batchV2.go b/state/batchV2.go index 32f6fd856b..7674347e6e 100644 --- a/state/batchV2.go +++ b/state/batchV2.go @@ -401,7 +401,7 @@ func (s *State) ProcessAndStoreClosedBatchV2(ctx context.Context, processingCtx if len(processedBatch.BlockResponses) > 0 && !processedBatch.IsRomOOCError && processedBatch.RomError_V2 == nil { for _, blockResponse := range processedBatch.BlockResponses { - err = s.StoreL2Block(ctx, processingCtx.BatchNumber, blockResponse, nil, dbTx) + _, err = s.StoreL2Block(ctx, processingCtx.BatchNumber, blockResponse, nil, dbTx) if err != nil { log.Errorf("%s error StoreL2Block: %v", debugPrefix, err) return common.Hash{}, noFlushID, noProverID, err diff --git a/state/datastream.go b/state/datastream.go index 90c7ff3211..09fa7184b1 100644 --- a/state/datastream.go +++ b/state/datastream.go @@ -49,7 +49,7 @@ type DSL2Block struct { BatchNumber uint64 L2BlockNumber uint64 Timestamp uint64 - Min_timestamp uint64 + MinTimestamp uint64 L1InfoTreeIndex uint32 L1BlockHash common.Hash GlobalExitRoot common.Hash @@ -512,14 +512,22 @@ func GenerateDataStreamFile(ctx context.Context, streamServer *datastreamer.Stre BlockGasLimit: l2Block.BlockGasLimit, } - if l2Block.ForkID >= FORKID_ETROG { - streamL2Block.Hash = l2Block.StateRoot.Bytes() - } + // Keep the l2 block hash as it is, as the state root can be found in the StateRoot field + // So disable this + /* + if l2Block.ForkID >= FORKID_ETROG { + streamL2Block.Hash = l2Block.StateRoot.Bytes() + } + */ if l2Block.ForkID == FORKID_ETROG && batch.EtrogTimestamp != nil { streamL2Block.MinTimestamp = uint64(batch.EtrogTimestamp.Unix()) } + if l2Block.ForkID >= FORKID_ETROG && l2Block.L1InfoTreeIndex == 0 { + streamL2Block.MinTimestamp = 0 + } + previousTimestamp = l2Block.Timestamp bookMark := &datastream.BookMark{ diff --git a/state/transaction.go b/state/transaction.go index 1c2e0e11da..d9c044b33d 100644 --- a/state/transaction.go +++ b/state/transaction.go @@ -208,9 +208,9 @@ func (s *State) StoreTransactions(ctx context.Context, batchNumber uint64, proce } // StoreL2Block stores a l2 block into the state -func (s *State) StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *ProcessBlockResponse, txsEGPLog []*EffectiveGasPriceLog, dbTx pgx.Tx) error { +func (s *State) StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *ProcessBlockResponse, txsEGPLog []*EffectiveGasPriceLog, dbTx pgx.Tx) (common.Hash, error) { if dbTx == nil { - return ErrDBTxNil + return common.Hash{}, ErrDBTxNil } log.Debugf("storing l2 block %d, txs %d, hash %s", l2Block.BlockNumber, len(l2Block.TransactionResponses), l2Block.BlockHash.String()) @@ -218,7 +218,7 @@ func (s *State) StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *P prevL2BlockHash, err := s.GetL2BlockHashByNumber(ctx, l2Block.BlockNumber-1, dbTx) if err != nil { - return err + return common.Hash{}, err } forkID := s.GetForkIDByBatchNumber(batchNumber) @@ -289,12 +289,12 @@ func (s *State) StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *P // Store L2 block and its transactions if err := s.AddL2Block(ctx, batchNumber, block, receipts, txsL2Hash, storeTxsEGPData, imStateRoots, dbTx); err != nil { - return err + return common.Hash{}, err } log.Debugf("stored L2 block %d for batch %d, storing time %v", header.Number, batchNumber, time.Since(start)) - return nil + return block.Hash(), nil } // PreProcessUnsignedTransaction processes the unsigned transaction in order to calculate its zkCounters diff --git a/synchronizer/common/syncinterfaces/mocks/state_full_interface.go b/synchronizer/common/syncinterfaces/mocks/state_full_interface.go index ec779c4854..248c817fa6 100644 --- a/synchronizer/common/syncinterfaces/mocks/state_full_interface.go +++ b/synchronizer/common/syncinterfaces/mocks/state_full_interface.go @@ -2799,21 +2799,33 @@ func (_c *StateFullInterface_SetLastBatchInfoSeenOnEthereum_Call) RunAndReturn(r } // StoreL2Block provides a mock function with given fields: ctx, batchNumber, l2Block, txsEGPLog, dbTx -func (_m *StateFullInterface) StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *state.ProcessBlockResponse, txsEGPLog []*state.EffectiveGasPriceLog, dbTx pgx.Tx) error { +func (_m *StateFullInterface) StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *state.ProcessBlockResponse, txsEGPLog []*state.EffectiveGasPriceLog, dbTx pgx.Tx) (common.Hash, error) { ret := _m.Called(ctx, batchNumber, l2Block, txsEGPLog, dbTx) if len(ret) == 0 { panic("no return value specified for StoreL2Block") } - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, uint64, *state.ProcessBlockResponse, []*state.EffectiveGasPriceLog, pgx.Tx) error); ok { + var r0 common.Hash + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, *state.ProcessBlockResponse, []*state.EffectiveGasPriceLog, pgx.Tx) (common.Hash, error)); ok { + return rf(ctx, batchNumber, l2Block, txsEGPLog, dbTx) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, *state.ProcessBlockResponse, []*state.EffectiveGasPriceLog, pgx.Tx) common.Hash); ok { r0 = rf(ctx, batchNumber, l2Block, txsEGPLog, dbTx) } else { - r0 = ret.Error(0) + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Hash) + } } - return r0 + if rf, ok := ret.Get(1).(func(context.Context, uint64, *state.ProcessBlockResponse, []*state.EffectiveGasPriceLog, pgx.Tx) error); ok { + r1 = rf(ctx, batchNumber, l2Block, txsEGPLog, dbTx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 } // StateFullInterface_StoreL2Block_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StoreL2Block' @@ -2838,12 +2850,12 @@ func (_c *StateFullInterface_StoreL2Block_Call) Run(run func(ctx context.Context return _c } -func (_c *StateFullInterface_StoreL2Block_Call) Return(_a0 error) *StateFullInterface_StoreL2Block_Call { - _c.Call.Return(_a0) +func (_c *StateFullInterface_StoreL2Block_Call) Return(_a0 common.Hash, _a1 error) *StateFullInterface_StoreL2Block_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *StateFullInterface_StoreL2Block_Call) RunAndReturn(run func(context.Context, uint64, *state.ProcessBlockResponse, []*state.EffectiveGasPriceLog, pgx.Tx) error) *StateFullInterface_StoreL2Block_Call { +func (_c *StateFullInterface_StoreL2Block_Call) RunAndReturn(run func(context.Context, uint64, *state.ProcessBlockResponse, []*state.EffectiveGasPriceLog, pgx.Tx) (common.Hash, error)) *StateFullInterface_StoreL2Block_Call { _c.Call.Return(run) return _c } diff --git a/synchronizer/common/syncinterfaces/state.go b/synchronizer/common/syncinterfaces/state.go index 2fb9ea2f16..41d7acbedc 100644 --- a/synchronizer/common/syncinterfaces/state.go +++ b/synchronizer/common/syncinterfaces/state.go @@ -66,7 +66,7 @@ type StateFullInterface interface { GetForkIDByBlockNumber(blockNumber uint64) uint64 GetStoredFlushID(ctx context.Context) (uint64, string, error) AddL1InfoTreeLeaf(ctx context.Context, L1InfoTreeLeaf *state.L1InfoTreeLeaf, dbTx pgx.Tx) (*state.L1InfoTreeExitRootStorageEntry, error) - StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *state.ProcessBlockResponse, txsEGPLog []*state.EffectiveGasPriceLog, dbTx pgx.Tx) error + StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *state.ProcessBlockResponse, txsEGPLog []*state.EffectiveGasPriceLog, dbTx pgx.Tx) (common.Hash, error) GetL1InfoRootLeafByL1InfoRoot(ctx context.Context, l1InfoRoot common.Hash, dbTx pgx.Tx) (state.L1InfoTreeExitRootStorageEntry, error) UpdateWIPBatch(ctx context.Context, receipt state.ProcessingReceipt, dbTx pgx.Tx) error GetL1InfoTreeDataFromBatchL2Data(ctx context.Context, batchL2Data []byte, dbTx pgx.Tx) (map[uint32]state.L1DataV2, common.Hash, common.Hash, error) diff --git a/synchronizer/l2_sync/l2_sync_etrog/executor_trusted_batch_sync.go b/synchronizer/l2_sync/l2_sync_etrog/executor_trusted_batch_sync.go index 75aebc942c..b7e7e34122 100644 --- a/synchronizer/l2_sync/l2_sync_etrog/executor_trusted_batch_sync.go +++ b/synchronizer/l2_sync/l2_sync_etrog/executor_trusted_batch_sync.go @@ -37,7 +37,7 @@ type StateInterface interface { ResetTrustedState(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) error OpenBatch(ctx context.Context, processingContext state.ProcessingContext, dbTx pgx.Tx) error ProcessBatchV2(ctx context.Context, request state.ProcessRequest, updateMerkleTree bool) (*state.ProcessBatchResponse, string, error) - StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *state.ProcessBlockResponse, txsEGPLog []*state.EffectiveGasPriceLog, dbTx pgx.Tx) error + StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *state.ProcessBlockResponse, txsEGPLog []*state.EffectiveGasPriceLog, dbTx pgx.Tx) (common.Hash, error) GetL1InfoTreeDataFromBatchL2Data(ctx context.Context, batchL2Data []byte, dbTx pgx.Tx) (map[uint32]state.L1DataV2, common.Hash, common.Hash, error) GetLastVirtualBatchNum(ctx context.Context, dbTx pgx.Tx) (uint64, error) } @@ -392,7 +392,7 @@ func (b *SyncTrustedBatchExecutorForEtrog) processAndStoreTxs(ctx context.Contex } for _, block := range processBatchResp.BlockResponses { log.Debugf("%s Storing trusted tx %d", debugPrefix, block.BlockNumber) - if err = b.state.StoreL2Block(ctx, request.BatchNumber, block, nil, dbTx); err != nil { + if _, err = b.state.StoreL2Block(ctx, request.BatchNumber, block, nil, dbTx); err != nil { newErr := fmt.Errorf("%s failed to store l2block: %v err:%w", debugPrefix, block.BlockNumber, err) log.Error(newErr.Error()) return nil, newErr diff --git a/synchronizer/l2_sync/l2_sync_etrog/mocks/state_interface.go b/synchronizer/l2_sync/l2_sync_etrog/mocks/state_interface.go index 43e84ffba5..0b4d85bce7 100644 --- a/synchronizer/l2_sync/l2_sync_etrog/mocks/state_interface.go +++ b/synchronizer/l2_sync/l2_sync_etrog/mocks/state_interface.go @@ -538,21 +538,33 @@ func (_c *StateInterface_ResetTrustedState_Call) RunAndReturn(run func(context.C } // StoreL2Block provides a mock function with given fields: ctx, batchNumber, l2Block, txsEGPLog, dbTx -func (_m *StateInterface) StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *state.ProcessBlockResponse, txsEGPLog []*state.EffectiveGasPriceLog, dbTx pgx.Tx) error { +func (_m *StateInterface) StoreL2Block(ctx context.Context, batchNumber uint64, l2Block *state.ProcessBlockResponse, txsEGPLog []*state.EffectiveGasPriceLog, dbTx pgx.Tx) (common.Hash, error) { ret := _m.Called(ctx, batchNumber, l2Block, txsEGPLog, dbTx) if len(ret) == 0 { panic("no return value specified for StoreL2Block") } - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, uint64, *state.ProcessBlockResponse, []*state.EffectiveGasPriceLog, pgx.Tx) error); ok { + var r0 common.Hash + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, *state.ProcessBlockResponse, []*state.EffectiveGasPriceLog, pgx.Tx) (common.Hash, error)); ok { + return rf(ctx, batchNumber, l2Block, txsEGPLog, dbTx) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, *state.ProcessBlockResponse, []*state.EffectiveGasPriceLog, pgx.Tx) common.Hash); ok { r0 = rf(ctx, batchNumber, l2Block, txsEGPLog, dbTx) } else { - r0 = ret.Error(0) + if ret.Get(0) != nil { + r0 = ret.Get(0).(common.Hash) + } } - return r0 + if rf, ok := ret.Get(1).(func(context.Context, uint64, *state.ProcessBlockResponse, []*state.EffectiveGasPriceLog, pgx.Tx) error); ok { + r1 = rf(ctx, batchNumber, l2Block, txsEGPLog, dbTx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 } // StateInterface_StoreL2Block_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StoreL2Block' @@ -577,12 +589,12 @@ func (_c *StateInterface_StoreL2Block_Call) Run(run func(ctx context.Context, ba return _c } -func (_c *StateInterface_StoreL2Block_Call) Return(_a0 error) *StateInterface_StoreL2Block_Call { - _c.Call.Return(_a0) +func (_c *StateInterface_StoreL2Block_Call) Return(_a0 common.Hash, _a1 error) *StateInterface_StoreL2Block_Call { + _c.Call.Return(_a0, _a1) return _c } -func (_c *StateInterface_StoreL2Block_Call) RunAndReturn(run func(context.Context, uint64, *state.ProcessBlockResponse, []*state.EffectiveGasPriceLog, pgx.Tx) error) *StateInterface_StoreL2Block_Call { +func (_c *StateInterface_StoreL2Block_Call) RunAndReturn(run func(context.Context, uint64, *state.ProcessBlockResponse, []*state.EffectiveGasPriceLog, pgx.Tx) (common.Hash, error)) *StateInterface_StoreL2Block_Call { _c.Call.Return(run) return _c } diff --git a/synchronizer/synchronizer_test.go b/synchronizer/synchronizer_test.go index da99ca4e18..ce0c27e280 100644 --- a/synchronizer/synchronizer_test.go +++ b/synchronizer/synchronizer_test.go @@ -901,7 +901,7 @@ func expectedCallsForsyncTrustedState(t *testing.T, m *mocks, sync *ClientSynchr m.State.EXPECT().ProcessBatchV2(mock.Anything, mock.Anything, mock.Anything). Return(&processedBatch, "", nil).Times(1) m.State.EXPECT().StoreL2Block(mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything). - Return(nil).Times(1) + Return(common.Hash{}, nil).Times(1) m.State.EXPECT().UpdateWIPBatch(mock.Anything, mock.Anything, mock.Anything). Return(nil).Times(1) m.State.EXPECT().GetBatchByNumber(mock.Anything, mock.Anything, mock.Anything).