Skip to content

Commit

Permalink
Fix rom ooc error detection (#2527) (#2529)
Browse files Browse the repository at this point in the history
* Fix rom ooc error detection

* remove check
  • Loading branch information
ARR552 authored Sep 8, 2023
1 parent d505253 commit 7d9550c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion state/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ type ProcessBatchResponse struct {
UsedZkCounters ZKCounters
Responses []*ProcessTransactionResponse
ExecutorError error
IsBatchProcessed bool
ReadWriteAddresses map[common.Address]*InfoReadWrite
IsRomLevelError bool
IsExecutorLevelError bool
Expand Down
9 changes: 6 additions & 3 deletions synchronizer/synchronizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1472,13 +1472,16 @@ func (s *ClientSynchronizer) processAndStoreTxs(trustedBatch *types.Batch, reque

log.Debugf("Storing transactions %d for batch %v", len(processBatchResp.Responses), trustedBatch.Number)
if processBatchResp.IsExecutorLevelError {
log.Warn("ExecutorLevelError detected. Avoid store txs...")
log.Warn("executorLevelError detected. Avoid store txs...")
return processBatchResp, nil
} else if processBatchResp.IsRomOOCError {
log.Warn("romOOCError detected. Avoid store txs...")
return processBatchResp, nil
}
for _, tx := range processBatchResp.Responses {
if state.IsStateRootChanged(executor.RomErrorCode(tx.RomError)) {
log.Info("TrustedBatch info: %+v", processBatchResp)
log.Info("Storing trusted tx %+v", tx)
log.Infof("TrustedBatch info: %+v", processBatchResp)
log.Infof("Storing trusted tx %+v", tx)
if err = s.state.StoreTransaction(s.ctx, uint64(trustedBatch.Number), tx, trustedBatch.Coinbase, uint64(trustedBatch.Timestamp), dbTx); err != nil {
log.Errorf("failed to store transactions for batch: %v. Tx: %s", trustedBatch.Number, tx.TxHash.String())
return nil, err
Expand Down

0 comments on commit 7d9550c

Please sign in to comment.