Skip to content

Commit 1bdc486

Browse files
committed
keep ReplayBlock unchanged
1 parent 52c08c6 commit 1bdc486

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

fvm/evm/offchain/sync/replayer.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ func NewReplayer(
4545
}
4646

4747
// ReplayBlock replays the execution of the transactions of an EVM block
48+
func (cr *Replayer) ReplayBlock(
49+
transactionEvents []events.TransactionEventPayload,
50+
blockEvent *events.BlockEventPayload,
51+
) (types.ReplayResultCollector, error) {
52+
res, _, err := cr.ReplayBlockEvents(transactionEvents, blockEvent)
53+
return res, err
54+
}
55+
56+
// ReplayBlockEvents replays the execution of the transactions of an EVM block
4857
// using the provided transactionEvents and blockEvents,
4958
// which include all the context data for re-executing the transactions, and returns
5059
// the replay result and the result of each transaction.
@@ -57,7 +66,7 @@ func NewReplayer(
5766
// Warning! the list of transaction events has to be sorted based on their
5867
// execution, sometimes the access node might return events out of order
5968
// it needs to be sorted by txIndex and eventIndex respectively.
60-
func (cr *Replayer) ReplayBlock(
69+
func (cr *Replayer) ReplayBlockEvents(
6170
transactionEvents []events.TransactionEventPayload,
6271
blockEvent *events.BlockEventPayload,
6372
) (types.ReplayResultCollector, []*types.Result, error) {

fvm/evm/offchain/sync/replayer_test.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func TestChainReplay(t *testing.T) {
164164

165165
sp := NewTestStorageProvider(snapshot, 1)
166166
cr := sync.NewReplayer(chainID, rootAddr, sp, bp, zerolog.Logger{}, nil, true)
167-
res, results, err := cr.ReplayBlock(txEventPayloads, blockEventPayload)
167+
res, results, err := cr.ReplayBlockEvents(txEventPayloads, blockEventPayload)
168168
require.NoError(t, err)
169169

170170
require.Len(t, results, totalTxCount)
@@ -173,12 +173,6 @@ func TestChainReplay(t *testing.T) {
173173

174174
err = bp.OnBlockExecuted(blockEventPayload.Height, res, proposal)
175175
require.NoError(t, err)
176-
177-
// for k, v := range bpStorage.StorageRegisterUpdates() {
178-
// ret, err := backend.GetValue([]byte(k.Owner), []byte(k.Key))
179-
// require.NoError(t, err)
180-
// require.Equal(t, ret[:], v[:])
181-
// }
182176
})
183177
})
184178
})

fvm/evm/offchain/utils/replay.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func ReplayEVMEventsToStore(
3838

3939
sp := testutils.NewTestStorageProvider(store, evmBlockEvent.Height)
4040
cr := sync.NewReplayer(chainID, rootAddr, sp, bp, log, nil, true)
41-
res, results, err := cr.ReplayBlock(evmTxEvents, evmBlockEvent)
41+
res, results, err := cr.ReplayBlockEvents(evmTxEvents, evmBlockEvent)
4242
if err != nil {
4343
return nil, nil, err
4444
}

0 commit comments

Comments
 (0)