From 3d30c341c410415eff7dba42c779f63c45eaf3ab Mon Sep 17 00:00:00 2001 From: Jerry Date: Mon, 5 Jun 2023 22:10:48 -0700 Subject: [PATCH] Keep nonce and balance in write list even if the transaction is reverted (#889) An address's nonce and balance will get updated even if its transaction is reverted. Therefore, we need to keep balance and nonce in write list in order to check the transaction's validity in parallel execution. --- core/state/journal.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/core/state/journal.go b/core/state/journal.go index 2a0c81dcb6..8d55e75b90 100644 --- a/core/state/journal.go +++ b/core/state/journal.go @@ -169,7 +169,6 @@ func (ch suicideChange) revert(s *StateDB) { obj.suicided = ch.prev obj.setBalance(ch.prevbalance) RevertWrite(s, blockstm.NewSubpathKey(*ch.account, SuicidePath)) - RevertWrite(s, blockstm.NewSubpathKey(*ch.account, BalancePath)) } } @@ -188,7 +187,6 @@ func (ch touchChange) dirtied() *common.Address { func (ch balanceChange) revert(s *StateDB) { s.getStateObject(*ch.account).setBalance(ch.prev) - RevertWrite(s, blockstm.NewSubpathKey(*ch.account, BalancePath)) } func (ch balanceChange) dirtied() *common.Address { @@ -197,7 +195,6 @@ func (ch balanceChange) dirtied() *common.Address { func (ch nonceChange) revert(s *StateDB) { s.getStateObject(*ch.account).setNonce(ch.prev) - RevertWrite(s, blockstm.NewSubpathKey(*ch.account, NoncePath)) } func (ch nonceChange) dirtied() *common.Address {