Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

statedb revert to snapshot for ignored batches #1742

Merged
merged 2 commits into from
Jan 16, 2024
Merged
Changes from 1 commit
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
9 changes: 5 additions & 4 deletions go/enclave/components/batch_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (executor *batchExecutor) ComputeBatch(context *BatchExecutionContext, fail
if err != nil {
return nil, fmt.Errorf("could not create stateDB. Cause: %w", err)
}
// snap := stateDB.Snapshot()
snap := stateDB.Snapshot()

var messages common.CrossChainMessages
var transfers common.ValueTransferEvents
Expand Down Expand Up @@ -222,9 +222,10 @@ func (executor *batchExecutor) ComputeBatch(context *BatchExecutionContext, fail
len(crossChainTransactions) == 0 &&
len(messages) == 0 &&
len(transfers) == 0 {
// todo review why this is failing deployment with "panic: revision id 0 cannot be reverted" - https://github.com/ten-protocol/ten-internal/issues/2654
//// revert any unexpected mutation to the statedb
//stateDB.RevertToSnapshot(snap)
if snap > 0 {
//// revert any unexpected mutation to the statedb
stateDB.RevertToSnapshot(snap)
}
return nil, ErrNoTransactionsToProcess
}

Expand Down
Loading