Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions sequencer/finalizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,6 @@ func (f *finalizer) finalizeBatches(ctx context.Context) {
tx := f.worker.GetBestFittingTx(f.batch.remainingResources)
metrics.WorkerProcessingTime(time.Since(start))
if tx != nil {
// Timestamp resolution
if f.batch.isEmpty() {
f.batch.timestamp = now()
}

log.Debugf("processing tx: %s", tx.Hash.Hex())

// reset the count of effective GasPrice process attempts (since the tx may have been tried to be processed before)
Expand Down
10 changes: 3 additions & 7 deletions sequencer/finalizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,6 @@ func TestFinalizer_newWIPBatch(t *testing.T) {
dbManagerMock.On("GetBatchByNumber", ctx, f.batch.batchNumber, nil).Return(tc.batches[0], nilErr).Once()
dbManagerMock.On("GetForkIDByBatchNumber", f.batch.batchNumber).Return(uint64(5)).Once()
dbManagerMock.On("GetTransactionsByBatchNumber", ctx, f.batch.batchNumber).Return(currTxs, constants.EffectivePercentage, nilErr).Once()
dbManagerMock.On("GetForkIDByBatchNumber", f.batch.batchNumber).Return(uint64(5)).Once()
if tc.forcedBatches != nil && len(tc.forcedBatches) > 0 {
processRequest := f.processRequest
processRequest.BatchNumber = f.processRequest.BatchNumber + 1
Expand Down Expand Up @@ -1966,15 +1965,12 @@ func TestFinalizer_reprocessFullBatch(t *testing.T) {
// arrange
f := setupFinalizer(true)
dbManagerMock.On("GetBatchByNumber", context.Background(), tc.batchNum, nil).Return(tc.mockGetBatchByNumber, tc.mockGetBatchByNumberErr).Once()
if tc.mockGetBatchByNumberErr == nil {
dbManagerMock.On("GetForkIDByBatchNumber", tc.batchNum).Return(uint64(4)).Once()
if tc.expectedDecodeErr == nil {
executorMock.On("ProcessBatch", context.Background(), mock.Anything, false).Return(tc.expectedExecutorResponse, tc.expectedExecutorErr)
}
}
if tc.name != "Error while getting batch by number" {
dbManagerMock.On("GetForkIDByBatchNumber", f.batch.batchNumber).Return(uint64(5)).Once()
}
if tc.mockGetBatchByNumberErr == nil && tc.expectedDecodeErr == nil {
executorMock.On("ProcessBatch", context.Background(), mock.Anything, false).Return(tc.expectedExecutorResponse, tc.expectedExecutorErr)
}

// act
result, err := f.reprocessFullBatch(context.Background(), tc.batchNum, newHash)
Expand Down