Skip to content

Commit 605cc25

Browse files
committed
core/state: make journalling set-based
core/state: add handling for DiscardSnapshot core/state: use new journal core/state, genesis: fix flaw re discard/commit. In case the state is committed, the journal is reset, thus it is not correct to Discard/Revert snapshots at that point. core/state: fix nil defer in merge core/state: fix bugs in setjournal core/state: journal api changes core/state: bugfixes in sparse journal core/state: journal tests core/state: improve post-state check in journal-fuzzing test core/state: post-rebase fixups miner: remove discard-snapshot call, it's not needed since journal will be reset in Finalize core/state: fix tests core/state: lint core/state: supply origin-value when reverting storage change Update core/genesis.go core/state: fix erroneous comments core/state: review-nits regarding the journal
1 parent 850a332 commit 605cc25

File tree

14 files changed

+1280
-574
lines changed

14 files changed

+1280
-574
lines changed

cmd/evm/internal/t8ntool/execution.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
279279
}
280280
continue
281281
}
282+
statedb.DiscardSnapshot(snapshot)
282283
includedTxs = append(includedTxs, tx)
283284
if hashError != nil {
284285
return nil, nil, nil, NewError(ErrorMissingBlockhash, hashError)

cmd/evm/runner.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ func runCmd(ctx *cli.Context) error {
176176
sdb := state.NewDatabase(triedb, nil)
177177
statedb, _ = state.New(genesis.Root(), sdb)
178178
chainConfig = genesisConfig.Config
179-
179+
id := statedb.Snapshot()
180+
defer statedb.DiscardSnapshot(id)
180181
if ctx.String(SenderFlag.Name) != "" {
181182
sender = common.HexToAddress(ctx.String(SenderFlag.Name))
182183
}

0 commit comments

Comments
 (0)