Skip to content

Commit 3094e7f

Browse files
catalyst: runs every transaction in a snapshot in assembleBlock handler (#7) (#22989)
Co-authored-by: Gary Rong <[email protected]> Co-authored-by: Mikhail Kalinin <[email protected]>
1 parent 216ed05 commit 3094e7f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

eth/catalyst/api.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ type blockExecutionEnv struct {
7979

8080
func (env *blockExecutionEnv) commitTransaction(tx *types.Transaction, coinbase common.Address) error {
8181
vmconfig := *env.chain.GetVMConfig()
82+
snap := env.state.Snapshot()
8283
receipt, err := core.ApplyTransaction(env.chain.Config(), env.chain, &coinbase, env.gasPool, env.state, env.header, tx, &env.header.GasUsed, vmconfig)
8384
if err != nil {
85+
env.state.RevertToSnapshot(snap)
8486
return err
8587
}
8688
env.txs = append(env.txs, tx)

0 commit comments

Comments
 (0)