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.
This commit is contained in:
Jerry 2023-06-05 22:10:48 -07:00 committed by GitHub
parent f1c8226839
commit 3d30c341c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -169,7 +169,6 @@ func (ch suicideChange) revert(s *StateDB) {
obj.suicided = ch.prev obj.suicided = ch.prev
obj.setBalance(ch.prevbalance) obj.setBalance(ch.prevbalance)
RevertWrite(s, blockstm.NewSubpathKey(*ch.account, SuicidePath)) 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) { func (ch balanceChange) revert(s *StateDB) {
s.getStateObject(*ch.account).setBalance(ch.prev) s.getStateObject(*ch.account).setBalance(ch.prev)
RevertWrite(s, blockstm.NewSubpathKey(*ch.account, BalancePath))
} }
func (ch balanceChange) dirtied() *common.Address { func (ch balanceChange) dirtied() *common.Address {
@ -197,7 +195,6 @@ func (ch balanceChange) dirtied() *common.Address {
func (ch nonceChange) revert(s *StateDB) { func (ch nonceChange) revert(s *StateDB) {
s.getStateObject(*ch.account).setNonce(ch.prev) s.getStateObject(*ch.account).setNonce(ch.prev)
RevertWrite(s, blockstm.NewSubpathKey(*ch.account, NoncePath))
} }
func (ch nonceChange) dirtied() *common.Address { func (ch nonceChange) dirtied() *common.Address {