mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
core/state: do not journal preimages
We do not strictly need to journal preimages: preimages are stored and served for the benefit of remote RPC users, e.g. for debugging solidity storage. There is no 'consensus requirement' for these keys to be reverted in case of reverted scopes.
This commit is contained in:
parent
dad62bc5ab
commit
66fc14ad58
2 changed files with 0 additions and 22 deletions
|
|
@ -160,10 +160,6 @@ func (j *journal) JournalLog(txHash common.Hash) {
|
|||
j.append(addLogChange{txhash: txHash})
|
||||
}
|
||||
|
||||
func (j *journal) JournalAddPreimage(hash common.Hash) {
|
||||
j.append(addPreimageChange{hash: hash})
|
||||
}
|
||||
|
||||
func (j *journal) JournalCreate(addr common.Address) {
|
||||
j.append(createObjectChange{account: &addr})
|
||||
}
|
||||
|
|
@ -265,9 +261,6 @@ type (
|
|||
addLogChange struct {
|
||||
txhash common.Hash
|
||||
}
|
||||
addPreimageChange struct {
|
||||
hash common.Hash
|
||||
}
|
||||
touchChange struct {
|
||||
account *common.Address
|
||||
}
|
||||
|
|
@ -456,20 +449,6 @@ func (ch addLogChange) copy() journalEntry {
|
|||
}
|
||||
}
|
||||
|
||||
func (ch addPreimageChange) revert(s *StateDB) {
|
||||
delete(s.preimages, ch.hash)
|
||||
}
|
||||
|
||||
func (ch addPreimageChange) dirtied() *common.Address {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ch addPreimageChange) copy() journalEntry {
|
||||
return addPreimageChange{
|
||||
hash: ch.hash,
|
||||
}
|
||||
}
|
||||
|
||||
func (ch accessListAddAccountChange) revert(s *StateDB) {
|
||||
/*
|
||||
One important invariant here, is that whenever a (addr, slot) is added, if the
|
||||
|
|
|
|||
|
|
@ -282,7 +282,6 @@ func (s *StateDB) Logs() []*types.Log {
|
|||
// AddPreimage records a SHA3 preimage seen by the VM.
|
||||
func (s *StateDB) AddPreimage(hash common.Hash, preimage []byte) {
|
||||
if _, ok := s.preimages[hash]; !ok {
|
||||
s.journal.JournalAddPreimage(hash)
|
||||
s.preimages[hash] = slices.Clone(preimage)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue