Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare codebase for merging hooking tracers from upstream #53

Draft
wants to merge 23 commits into
base: branch_v1.0.16
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
02d54be
core/state: fix bug in statedb.Copy and remove unnecessary preallocat…
AaronChen0 Apr 17, 2024
d8bc276
core/state: remove account reset operation v2 (#29520)
holiman Apr 24, 2024
e2441ba
fix AccountsIntermediateRoot to use mutations
ziogaschr Feb 28, 2025
34eb447
update StateDB.deleteStateObject to accept address
ziogaschr Feb 28, 2025
bf3686e
core/state: updates for fixing the conflicts
ziogaschr Feb 28, 2025
69dfba3
core/state: blocking prefetcher on term signal, parallel updates (#29…
karalabe May 13, 2024
8520c8f
core/state: fix TestUseAfterTerminate
ziogaschr Mar 3, 2025
ba1e334
core/state: fix test
ziogaschr Mar 4, 2025
850be37
core/state: remove slot dirtyness if it's set back to origin value (#…
rjl493456442 May 10, 2024
f3a8c5e
core/state: semantic journalling (part 1) (#28880)
holiman Aug 28, 2024
9de8ded
core/state, trie/triedb/pathdb: remove storage incomplete flag (#28940)
rjl493456442 Mar 5, 2024
eb1b5c6
core/state: fixes on previous commit
ziogaschr Mar 5, 2025
222aba8
core/state: introduce stateupdate structure (#29530)
rjl493456442 Jun 3, 2024
84219bf
core/state: remove AccountsIntermediateRoot
ziogaschr Mar 5, 2025
40ff5f1
feat: remove pipecommit (#2742)
buddh0 Oct 23, 2024
963df54
core,core/state: fix statedb.Commit to return types.DiffLayer
ziogaschr Mar 5, 2025
5e31757
core/state: revert the interface of StateDB.Commit (#2774)
buddh0 Nov 28, 2024
ba99825
core,core/state: fixes on blockchain.go
ziogaschr Mar 5, 2025
caf066d
core,core/state/pruner,core/state,eth: more fixes
ziogaschr Mar 5, 2025
d8dc1b1
tests: fix state test runner
ziogaschr Mar 5, 2025
6fd59b7
cmd/evm/internal/t8ntool,cmd/evm: fix statedb.Commit interface change…
ziogaschr Mar 5, 2025
b4980a4
core,core/state,core/txpool/blobpool,eth,params: fix statedb.Commit i…
ziogaschr Mar 6, 2025
4fd1d9f
core,core/eip3529tests: params: core: core/state: fixes for tests
ziogaschr Mar 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions cmd/evm/internal/t8ntool/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
statedb.AddBalance(w.Address, uint256.MustFromBig(amount))
}
// Commit block
statedb.Finalise(chainConfig.IsEIP158(vmContext.BlockNumber))
statedb.AccountsIntermediateRoot()
root, _, err := statedb.Commit(vmContext.BlockNumber.Uint64(), nil)
root, _, err := statedb.Commit(vmContext.BlockNumber.Uint64(), chainConfig.IsEIP158(vmContext.BlockNumber))
if err != nil {
return nil, nil, nil, NewError(ErrorEVM, fmt.Errorf("could not commit state: %v", err))
}
Expand Down Expand Up @@ -369,9 +367,7 @@ func MakePreState(db ethdb.Database, accounts types.GenesisAlloc) *state.StateDB
}
}
// Commit and re-open to start with a clean state.
statedb.Finalise(false)
statedb.AccountsIntermediateRoot()
root, _, _ := statedb.Commit(0, nil)
root, _, _ := statedb.Commit(0, false)
statedb, _ = state.New(root, sdb, nil)
return statedb
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/evm/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,7 @@ func runCmd(ctx *cli.Context) error {
output, leftOverGas, stats, err := timedExec(bench, execFunc)

if ctx.Bool(DumpFlag.Name) {
statedb.IntermediateRoot(true)
statedb.Commit(genesisConfig.Number, nil)
statedb.Commit(genesisConfig.Number, true)
fmt.Println(string(statedb.Dump(nil)))
}

Expand Down
1 change: 0 additions & 1 deletion cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ var (
utils.DirectBroadcastFlag,
utils.DisableSnapProtocolFlag,
utils.EnableTrustProtocolFlag,
utils.PipeCommitFlag,
utils.RangeLimitFlag,
utils.USBFlag,
utils.SmartCardDaemonPathFlag,
Expand Down
8 changes: 0 additions & 8 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ var (
Usage: "Enable trust protocol",
Category: flags.FastNodeCategory,
}
PipeCommitFlag = &cli.BoolFlag{
Name: "pipecommit",
Usage: "Enable MPT pipeline commit, it will improve syncing performance. It is an experimental feature(default is false)",
Category: flags.DeprecatedCategory,
}
RangeLimitFlag = &cli.BoolFlag{
Name: "rangelimit",
Usage: "Enable 5000 blocks limit for range query",
Expand Down Expand Up @@ -1942,9 +1937,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
if ctx.IsSet(EnableTrustProtocolFlag.Name) {
cfg.EnableTrustProtocol = ctx.IsSet(EnableTrustProtocolFlag.Name)
}
if ctx.IsSet(PipeCommitFlag.Name) {
log.Warn("The --pipecommit flag is deprecated and could be removed in the future!")
}
if ctx.IsSet(RangeLimitFlag.Name) {
cfg.RangeLimit = ctx.Bool(RangeLimitFlag.Name)
}
Expand Down
30 changes: 6 additions & 24 deletions core/block_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,14 @@ package core
import (
"errors"
"fmt"
"time"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/consensus"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/trie"
)

const badBlockCacheExpire = 30 * time.Second

type BlockValidatorOption func(*BlockValidator) *BlockValidator

func EnableRemoteVerifyManager(remoteValidator *remoteVerifyManager) BlockValidatorOption {
Expand Down Expand Up @@ -99,9 +95,6 @@ func (v *BlockValidator) ValidateBody(block *types.Block) error {
if v.bc.HasBlockAndState(block.Hash(), block.NumberU64()) {
return ErrKnownBlock
}
if v.bc.isCachedBadBlock(block) {
return ErrKnownBadBlock
}
// Header validity is known at this point. Here we verify that uncles, transactions
// and withdrawals given in the block body match the header.
header := block.Header()
Expand Down Expand Up @@ -198,23 +191,12 @@ func (v *BlockValidator) ValidateState(block *types.Block, statedb *state.StateD
return nil
},
}
if statedb.IsPipeCommit() {
validateFuns = append(validateFuns, func() error {
if err := statedb.WaitPipeVerification(); err != nil {
return err
}
statedb.CorrectAccountsRoot(common.Hash{})
statedb.Finalise(v.config.IsEIP158(header.Number))
return nil
})
} else {
validateFuns = append(validateFuns, func() error {
if root := statedb.IntermediateRoot(v.config.IsEIP158(header.Number)); header.Root != root {
return fmt.Errorf("invalid merkle root (remote: %x local: %x) dberr: %w", header.Root, root, statedb.Error())
}
return nil
})
}
validateFuns = append(validateFuns, func() error {
if root := statedb.IntermediateRoot(v.config.IsEIP158(header.Number)); header.Root != root {
return fmt.Errorf("invalid merkle root (remote: %x local: %x) dberr: %w", header.Root, root, statedb.Error())
}
return nil
})
validateRes := make(chan error, len(validateFuns))
for _, f := range validateFuns {
tmpFunc := f
Expand Down
Loading