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

Boba bedrock hardfork v2 #58

Open
wants to merge 27 commits into
base: boba-develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f3066d4
Add RPC to StageMiningExecCfg
boyuan-chen Oct 18, 2023
65f4d86
Insert RPC to StageMiningFinishCfg
boyuan-chen Oct 18, 2023
c37f722
Add RPCTimeout
boyuan-chen Oct 19, 2023
f069ed7
Insert RPC call to applyTransaction
boyuan-chen Oct 19, 2023
2fba0c1
Merge branch 'boba-develop' into bedrock-migration
boyuan-chen Oct 19, 2023
e62d92e
Fix test
boyuan-chen Oct 20, 2023
e5a0eec
Disable historical RPC tests
boyuan-chen Oct 20, 2023
5776957
Merge branch 'boba-develop' into bedrock-migration
boyuan-chen Oct 20, 2023
c45b5dc
Update genesis write
boyuan-chen Oct 20, 2023
348ac4f
Disable state root check
boyuan-chen Oct 20, 2023
25aea1e
Add IsLegacyDepositTx and fix baseFee
boyuan-chen Oct 24, 2023
0289e04
Merge branch 'boba-develop' into bedrock-migration
boyuan-chen Oct 24, 2023
210ff72
Fix package
boyuan-chen Oct 24, 2023
5c3ed2f
Remove extra bedrockBlock flag
boyuan-chen Oct 24, 2023
8edf1f6
Fix receipt
boyuan-chen Oct 24, 2023
5ae62bf
Restore historicalRPC test
boyuan-chen Oct 24, 2023
a8804b9
Fix lint
boyuan-chen Oct 24, 2023
af70dab
Merge branch 'boba-develop' into bedrock-migration
boyuan-chen Nov 3, 2023
16752b5
Merge branch 'bedrock-migration' into develop
boyuan-chen Dec 18, 2023
3c8a095
Merge pull request #70 from bobanetwork/develop
boyuan-chen Jan 3, 2024
858cce9
Remove Goerli and add Sepolia
boyuan-chen Jan 10, 2024
2ecc493
Merge branch 'boba-develop' into bedrock-migration
boyuan-chen Jan 10, 2024
8f00b99
Merge branch 'boba-develop' into bedrock-migration
boyuan-chen Jan 11, 2024
37100a3
Update sepolia genesis root
boyuan-chen Jan 17, 2024
9d91331
Add Optimism mainnet
boyuan-chen Apr 11, 2024
75d03a6
Update Op mainnet
boyuan-chen Apr 11, 2024
62054e6
Add bnb testnet genesis info
boyuan-chen Jun 14, 2024
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
2 changes: 1 addition & 1 deletion accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx types.Transac
b.pendingState, state.NewNoopWriter(),
b.pendingHeader, tx,
&b.pendingHeader.GasUsed, b.pendingHeader.BlobGasUsed,
vm.Config{}); err != nil {
vm.Config{}, nil, nil); err != nil {
return err
}
//fmt.Printf("==== Start producing block %d\n", (b.prependBlock.NumberU64() + 1))
Expand Down
19 changes: 11 additions & 8 deletions cl/phase1/execution_client/execution_client_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ func (cc *ExecutionClientRpc) NewPayload(payload *cltypes.Eth1Block, beaconParen
if payload == nil {
return
}

reversedBaseFeePerGas := libcommon.Copy(payload.BaseFeePerGas[:])
for i, j := 0, len(reversedBaseFeePerGas)-1; i < j; i, j = i+1, j-1 {
reversedBaseFeePerGas[i], reversedBaseFeePerGas[j] = reversedBaseFeePerGas[j], reversedBaseFeePerGas[i]
}
baseFee := new(big.Int).SetBytes(reversedBaseFeePerGas)
var engineMethod string
// determine the engine method
switch payload.Version() {
Expand Down Expand Up @@ -92,8 +86,17 @@ func (cc *ExecutionClientRpc) NewPayload(payload *cltypes.Eth1Block, beaconParen
BlockHash: payload.BlockHash,
}

request.BaseFeePerGas = new(hexutil.Big)
*request.BaseFeePerGas = hexutil.Big(*baseFee)
request.BaseFeePerGas = nil
if payload.BaseFeePerGas == (libcommon.Hash{}) {
reversedBaseFeePerGas := libcommon.Copy(payload.BaseFeePerGas[:])
for i, j := 0, len(reversedBaseFeePerGas)-1; i < j; i, j = i+1, j-1 {
reversedBaseFeePerGas[i], reversedBaseFeePerGas[j] = reversedBaseFeePerGas[j], reversedBaseFeePerGas[i]
}
baseFee := new(big.Int).SetBytes(reversedBaseFeePerGas)
request.BaseFeePerGas = new(hexutil.Big)
*request.BaseFeePerGas = hexutil.Big(*baseFee)
}

payloadBody := payload.Body()
// Setup transactionbody
request.Withdrawals = payloadBody.Withdrawals
Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/internal/t8ntool/transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func Main(ctx *cli.Context) error {

t8logger := log.New("t8ntool")
chainReader := stagedsync.NewChainReaderImpl(chainConfig, tx, nil, t8logger)
result, err := core.ExecuteBlockEphemerally(chainConfig, &vmConfig, getHash, engine, block, reader, writer, chainReader, getTracer, t8logger)
result, err := core.ExecuteBlockEphemerally(chainConfig, &vmConfig, getHash, engine, block, reader, writer, chainReader, getTracer, nil, nil, t8logger)

if hashError != nil {
return NewError(ErrorMissingBlockhash, fmt.Errorf("blockhash error: %v", err))
Expand Down
9 changes: 5 additions & 4 deletions cmd/integration/commands/stages.go
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ func stageExec(db kv.RwDB, ctx context.Context, logger log.Logger) error {
br, _ := blocksIO(db, logger)
cfg := stagedsync.StageExecuteBlocksCfg(db, pm, batchSize, nil, chainConfig, engine, vmConfig, nil,
/*stateStream=*/ false,
/*badBlockHalt=*/ false, historyV3, dirs, br, nil, genesis, syncCfg, agg, nil)
/*badBlockHalt=*/ false, historyV3, dirs, br, nil, genesis, syncCfg, agg, nil, "", time.Second*10)

var tx kv.RwTx //nil - means lower-level code (each stage) will manage transactions
if noCommit {
Expand Down Expand Up @@ -967,6 +967,7 @@ func stageTrie(db kv.RwDB, ctx context.Context, logger log.Logger) error {
defer agg.Close()
_, _, sync, _, _ := newSync(ctx, db, nil /* miningConfig */, logger)
must(sync.SetCurrentStage(stages.IntermediateHashes))
chainConfig := fromdb.ChainConfig(db)

if warmup {
return reset2.Warmup(ctx, db, log.LvlInfo, stages.IntermediateHashes)
Expand Down Expand Up @@ -1009,7 +1010,7 @@ func stageTrie(db kv.RwDB, ctx context.Context, logger log.Logger) error {
return err
}
} else {
if _, err := stagedsync.SpawnIntermediateHashesStage(s, sync /* Unwinder */, tx, cfg, ctx, logger); err != nil {
if _, err := stagedsync.SpawnIntermediateHashesStage(s, sync /* Unwinder */, tx, cfg, ctx, chainConfig, logger); err != nil {
return err
}
}
Expand Down Expand Up @@ -1581,10 +1582,10 @@ func newSync(ctx context.Context, db kv.RwDB, miningConfig *params.MiningConfig,
stagedsync.MiningStages(ctx,
stagedsync.StageMiningCreateBlockCfg(db, miner, *chainConfig, engine, nil, nil, dirs.Tmp, blockReader),
stagedsync.StageBorHeimdallCfg(db, snapDb, miner, *chainConfig, heimdallClient, blockReader, nil, nil, recents, signatures),
stagedsync.StageMiningExecCfg(db, miner, events, *chainConfig, engine, &vm.Config{}, dirs.Tmp, nil, 0, nil, nil, blockReader),
stagedsync.StageMiningExecCfg(db, miner, events, *chainConfig, engine, &vm.Config{}, dirs.Tmp, nil, 0, nil, nil, blockReader, nil, nil),
stagedsync.StageHashStateCfg(db, dirs, historyV3),
stagedsync.StageTrieCfg(db, false, true, false, dirs.Tmp, blockReader, nil, historyV3, agg),
stagedsync.StageMiningFinishCfg(db, *chainConfig, engine, miner, miningCancel, blockReader, builder.NewLatestBlockBuiltStore()),
stagedsync.StageMiningFinishCfg(db, *chainConfig, engine, miner, miningCancel, blockReader, builder.NewLatestBlockBuiltStore(), nil, nil),
),
stagedsync.MiningUnwindOrder,
stagedsync.MiningPruneOrder,
Expand Down
6 changes: 3 additions & 3 deletions cmd/integration/commands/state_stages.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import (
var stateStages = &cobra.Command{
Use: "state_stages",
Short: `Run all StateStages (which happen after senders) in loop.
Examples:
Examples:
--unwind=1 --unwind.every=10 # 10 blocks forward, 1 block back, 10 blocks forward, ...
--unwind=10 --unwind.every=1 # 1 block forward, 10 blocks back, 1 blocks forward, ...
--unwind=10 # 10 blocks back, then stop
Expand Down Expand Up @@ -222,7 +222,7 @@ func syncBySmallSteps(db kv.RwDB, miningConfig params.MiningConfig, ctx context.

br, _ := blocksIO(db, logger1)
execCfg := stagedsync.StageExecuteBlocksCfg(db, pm, batchSize, changeSetHook, chainConfig, engine, vmConfig, changesAcc, false, false, historyV3, dirs,
br, nil, genesis, syncCfg, agg, nil)
br, nil, genesis, syncCfg, agg, nil, "", time.Second*10)

execUntilFunc := func(execToBlock uint64) func(firstCycle bool, badBlockUnwind bool, stageState *stagedsync.StageState, unwinder stagedsync.Unwinder, tx kv.RwTx, logger log.Logger) error {
return func(firstCycle bool, badBlockUnwind bool, s *stagedsync.StageState, unwinder stagedsync.Unwinder, tx kv.RwTx, logger log.Logger) error {
Expand Down Expand Up @@ -560,7 +560,7 @@ func loopExec(db kv.RwDB, ctx context.Context, unwind uint64, logger log.Logger)
br, _ := blocksIO(db, logger)
cfg := stagedsync.StageExecuteBlocksCfg(db, pm, batchSize, nil, chainConfig, engine, vmConfig, nil,
/*stateStream=*/ false,
/*badBlockHalt=*/ false, historyV3, dirs, br, nil, genesis, syncCfg, agg, nil)
/*badBlockHalt=*/ false, historyV3, dirs, br, nil, genesis, syncCfg, agg, nil, "", time.Second*10)

// set block limit of execute stage
sync.MockExecFunc(stages.Execution, func(firstCycle bool, badBlockUnwind bool, stageState *stagedsync.StageState, unwinder stagedsync.Unwinder, tx kv.RwTx, logger log.Logger) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/state/commands/opcode_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ func runBlock(engine consensus.Engine, ibs *state.IntraBlockState, txnWriter sta
rules := chainConfig.Rules(block.NumberU64(), block.Time())
for i, tx := range block.Transactions() {
ibs.SetTxContext(tx.Hash(), block.Hash(), i)
receipt, _, err := core.ApplyTransaction(chainConfig, core.GetHashFn(header, getHeader), engine, nil, gp, ibs, txnWriter, header, tx, usedGas, usedBlobGas, vmConfig)
receipt, _, err := core.ApplyTransaction(chainConfig, core.GetHashFn(header, getHeader), engine, nil, gp, ibs, txnWriter, header, tx, usedGas, usedBlobGas, vmConfig, nil, nil)
if err != nil {
return nil, fmt.Errorf("could not apply tx %d [%x] failed: %w", i, tx.Hash(), err)
}
Expand Down
18 changes: 11 additions & 7 deletions consensus/ethash/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ func VerifyHeaderBasics(chain consensus.ChainHeaderReader, header, parent *types
return consensus.ErrFutureBlock
}
}
if header.Time <= parent.Time {
return errOlderBlockTime
if !chain.Config().IsOptimismPreBedrock(header.Number.Uint64()) {
if header.Time <= parent.Time {
return errOlderBlockTime
}
}
// Verify that the gas limit is <= 2^63-1
if header.GasLimit > params.MaxGasLimit {
Expand Down Expand Up @@ -662,11 +664,13 @@ func AccumulateRewards(config *chain.Config, header *types.Header, uncles []*typ

// accumulateRewards retrieves rewards for a block and applies them to the coinbase accounts for miner and uncle miners
func accumulateRewards(config *chain.Config, state *state.IntraBlockState, header *types.Header, uncles []*types.Header) {
minerReward, uncleRewards := AccumulateRewards(config, header, uncles)
for i, uncle := range uncles {
if i < len(uncleRewards) {
state.AddBalance(uncle.Coinbase, &uncleRewards[i])
if !config.IsOptimismPreBedrock(header.Number.Uint64()) {
minerReward, uncleRewards := AccumulateRewards(config, header, uncles)
for i, uncle := range uncles {
if i < len(uncleRewards) {
state.AddBalance(uncle.Coinbase, &uncleRewards[i])
}
}
state.AddBalance(header.Coinbase, &minerReward)
}
state.AddBalance(header.Coinbase, &minerReward)
}
24 changes: 14 additions & 10 deletions consensus/merge/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,18 @@ func (s *Merge) CalcDifficulty(chain consensus.ChainHeaderReader, time, parentTi
// stock Ethereum consensus engine with EIP-3675 modifications.
func (s *Merge) verifyHeader(chain consensus.ChainHeaderReader, header, parent *types.Header) error {

if uint64(len(header.Extra)) > params.MaximumExtraDataSize {
return fmt.Errorf("extra-data longer than %d bytes (%d)", params.MaximumExtraDataSize, len(header.Extra))
}
if !chain.Config().IsOptimismPreBedrock(header.Number.Uint64()) {
if uint64(len(header.Extra)) > params.MaximumExtraDataSize {
return fmt.Errorf("extra-data longer than %d bytes (%d)", params.MaximumExtraDataSize, len(header.Extra))
}

if header.Time <= parent.Time {
return errOlderBlockTime
}
if header.Time <= parent.Time {
return errOlderBlockTime
}

if header.Difficulty.Cmp(ProofOfStakeDifficulty) != 0 {
return errInvalidDifficulty
if header.Difficulty.Cmp(ProofOfStakeDifficulty) != 0 {
return errInvalidDifficulty
}
}

if !bytes.Equal(header.Nonce[:], ProofOfStakeNonce[:]) {
Expand All @@ -229,8 +231,10 @@ func (s *Merge) verifyHeader(chain consensus.ChainHeaderReader, header, parent *
return errInvalidUncleHash
}

if err := misc.VerifyEip1559Header(chain.Config(), parent, header, false); err != nil {
return err
if !chain.Config().IsOptimismPreBedrock(header.Number.Uint64()) {
if err := misc.VerifyEip1559Header(chain.Config(), parent, header, false); err != nil {
return err
}
}

// Verify existence / non-existence of withdrawalsHash
Expand Down
6 changes: 5 additions & 1 deletion consensus/merge/merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import (
type readerMock struct{}

func (r readerMock) Config() *chain.Config {
return nil
return &chain.Config{
BedrockBlock: libcommon.Big0,
}
}

func (r readerMock) CurrentHeader() *types.Header {
Expand Down Expand Up @@ -49,6 +51,7 @@ func (r readerMock) BorSpan(spanId uint64) []byte {
// and nonce so we are gonna test those
func TestVerifyHeaderDifficulty(t *testing.T) {
header := &types.Header{
Number: big.NewInt(1),
Difficulty: big.NewInt(1),
Time: 1,
}
Expand All @@ -70,6 +73,7 @@ func TestVerifyHeaderDifficulty(t *testing.T) {

func TestVerifyHeaderNonce(t *testing.T) {
header := &types.Header{
Number: big.NewInt(1),
Nonce: types.BlockNonce{1, 0, 0, 0, 0, 0, 0, 0},
Difficulty: big.NewInt(0),
Time: 1,
Expand Down
5 changes: 3 additions & 2 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
"github.com/ledgerwatch/erigon/core/vm"
"github.com/ledgerwatch/erigon/core/vm/evmtypes"
"github.com/ledgerwatch/erigon/rlp"
"github.com/ledgerwatch/erigon/rpc"
)

var (
Expand Down Expand Up @@ -84,7 +85,7 @@ func ExecuteBlockEphemerally(
engine consensus.Engine, block *types.Block,
stateReader state.StateReader, stateWriter state.WriterWithChangeSets,
chainReader consensus.ChainReader, getTracer func(txIndex int, txHash libcommon.Hash) (vm.EVMLogger, error),
logger log.Logger,
historicalRPCService *rpc.Client, historicalRPCTimeout *time.Duration, logger log.Logger,
) (*EphemeralExecResult, error) {

defer BlockExecutionTimer.UpdateDuration(time.Now())
Expand Down Expand Up @@ -123,7 +124,7 @@ func ExecuteBlockEphemerally(
vmConfig.Tracer = tracer
writeTrace = true
}
receipt, _, err := ApplyTransaction(chainConfig, blockHashFunc, engine, nil, gp, ibs, noop, header, tx, usedGas, usedBlobGas, *vmConfig)
receipt, _, err := ApplyTransaction(chainConfig, blockHashFunc, engine, nil, gp, ibs, noop, header, tx, usedGas, usedBlobGas, *vmConfig, historicalRPCService, historicalRPCTimeout)
if writeTrace {
if ftracer, ok := vmConfig.Tracer.(vm.FlushableTracer); ok {
ftracer.Flush(tx)
Expand Down
4 changes: 2 additions & 2 deletions core/chain_makers.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (b *BlockGen) AddTxWithChain(getHeader func(hash libcommon.Hash, number uin
b.SetCoinbase(libcommon.Address{})
}
b.ibs.SetTxContext(tx.Hash(), libcommon.Hash{}, len(b.txs))
receipt, _, err := ApplyTransaction(b.config, GetHashFn(b.header, getHeader), engine, &b.header.Coinbase, b.gasPool, b.ibs, state.NewNoopWriter(), b.header, tx, &b.header.GasUsed, b.header.BlobGasUsed, vm.Config{})
receipt, _, err := ApplyTransaction(b.config, GetHashFn(b.header, getHeader), engine, &b.header.Coinbase, b.gasPool, b.ibs, state.NewNoopWriter(), b.header, tx, &b.header.GasUsed, b.header.BlobGasUsed, vm.Config{}, nil, nil)
if err != nil {
panic(err)
}
Expand All @@ -135,7 +135,7 @@ func (b *BlockGen) AddFailedTxWithChain(getHeader func(hash libcommon.Hash, numb
b.SetCoinbase(libcommon.Address{})
}
b.ibs.SetTxContext(tx.Hash(), libcommon.Hash{}, len(b.txs))
receipt, _, err := ApplyTransaction(b.config, GetHashFn(b.header, getHeader), engine, &b.header.Coinbase, b.gasPool, b.ibs, state.NewNoopWriter(), b.header, tx, &b.header.GasUsed, b.header.BlobGasUsed, vm.Config{})
receipt, _, err := ApplyTransaction(b.config, GetHashFn(b.header, getHeader), engine, &b.header.Coinbase, b.gasPool, b.ibs, state.NewNoopWriter(), b.header, tx, &b.header.GasUsed, b.header.BlobGasUsed, vm.Config{}, nil, nil)
_ = err // accept failed transactions
b.txs = append(b.txs, tx)
b.receipts = append(b.receipts, receipt)
Expand Down
37 changes: 31 additions & 6 deletions core/genesis_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,12 @@ func write(tx kv.RwTx, g *types.Genesis, tmpDir string) (*types.Block, *state.In
if err := rawdb.WriteBlock(tx, block); err != nil {
return nil, nil, err
}
if err := rawdb.WriteTd(tx, block.Hash(), block.NumberU64(), g.Difficulty); err != nil {

difficulty := g.Difficulty
if g.Config.IsBobaLegacyBlock(block.NumberU64()) {
difficulty = libcommon.Big1
}
if err := rawdb.WriteTd(tx, block.Hash(), block.NumberU64(), difficulty); err != nil {
return nil, nil, err
}
if err := rawdbv3.TxNums.WriteForGenesis(tx, 1); err != nil {
Expand Down Expand Up @@ -545,6 +550,13 @@ func DeveloperGenesisBlock(period uint64, faucet libcommon.Address) *types.Genes
func GenesisToBlock(g *types.Genesis, tmpDir string) (*types.Block, *state.IntraBlockState, error) {
_ = g.Alloc //nil-check

baseFee := g.BaseFee
isBobaLegacyBlock := false
if g.Config.IsBobaLegacyBlock(g.Number) {
isBobaLegacyBlock = true
baseFee = nil
}

head := &types.Header{
Number: new(big.Int).SetUint64(g.Number),
Nonce: types.EncodeNonce(g.Nonce),
Expand All @@ -556,7 +568,7 @@ func GenesisToBlock(g *types.Genesis, tmpDir string) (*types.Block, *state.Intra
Difficulty: g.Difficulty,
MixDigest: g.Mixhash,
Coinbase: g.Coinbase,
BaseFee: g.BaseFee,
BaseFee: baseFee,
BlobGasUsed: g.BlobGasUsed,
ExcessBlobGas: g.ExcessBlobGas,
AuRaStep: g.AuRaStep,
Expand All @@ -568,7 +580,7 @@ func GenesisToBlock(g *types.Genesis, tmpDir string) (*types.Block, *state.Intra
if g.Difficulty == nil {
head.Difficulty = params.GenesisDifficulty
}
if g.Config != nil && g.Config.IsLondon(0) {
if g.Config != nil && g.Config.IsLondon(0) && !isBobaLegacyBlock {
if g.BaseFee != nil {
head.BaseFee = g.BaseFee
} else {
Expand Down Expand Up @@ -599,6 +611,13 @@ func GenesisToBlock(g *types.Genesis, tmpDir string) (*types.Block, *state.Intra
}
}

if isBobaLegacyBlock && g.Number == 0 {
head.Time = 0
head.Difficulty = big.NewInt(1)
head.Extra = libcommon.Hex2Bytes(g.Config.GetBobaGenesisExtraData())
head.Coinbase = libcommon.HexToAddress(g.Config.GetBobaGenesisCoinbase())
}

var root libcommon.Hash
var statedb *state.IntraBlockState
wg := sync.WaitGroup{}
Expand Down Expand Up @@ -662,16 +681,22 @@ func GenesisToBlock(g *types.Genesis, tmpDir string) (*types.Block, *state.Intra
if err = statedb.FinalizeTx(&chain.Rules{}, w); err != nil {
return
}
if root, err = trie.CalcRoot("genesis", tx); err != nil {
return
if !isBobaLegacyBlock {
if root, err = trie.CalcRoot("genesis", tx); err != nil {
return
}
}
}()
wg.Wait()
if err != nil {
return nil, nil, err
}

head.Root = root
if isBobaLegacyBlock && g.Number == 0 {
head.Root = libcommon.HexToHash(g.Config.GetBobaGenesisRoot())
} else {
head.Root = root
}

return types.NewBlock(head, nil, nil, nil, withdrawals), statedb, nil
}
Expand Down
Loading