catalyst: runs every transaction in a snapshot in assembleBlock handler (#7) (#22989)

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Mikhail Kalinin <noblesse.knight@gmail.com>
This commit is contained in:
gary rong 2021-06-03 23:12:47 +08:00 committed by GitHub
parent 216ed05c6e
commit 3094e7f3b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,8 +79,10 @@ type blockExecutionEnv struct {
func (env *blockExecutionEnv) commitTransaction(tx *types.Transaction, coinbase common.Address) error {
vmconfig := *env.chain.GetVMConfig()
snap := env.state.Snapshot()
receipt, err := core.ApplyTransaction(env.chain.Config(), env.chain, &coinbase, env.gasPool, env.state, env.header, tx, &env.header.GasUsed, vmconfig)
if err != nil {
env.state.RevertToSnapshot(snap)
return err
}
env.txs = append(env.txs, tx)