Skip to content

Commit

Permalink
Merge branch 'master' into bold-review
Browse files Browse the repository at this point in the history
  • Loading branch information
rauljordan authored Nov 25, 2024
2 parents e9ecd45 + 56865a9 commit bd7bd35
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion arbos/arbosState/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func MakeGenesisBlock(parentHash common.Hash, blockNumber uint64, timestamp uint
}
genesisHeaderInfo.UpdateHeaderWithInfo(head)

return types.NewBlock(head, nil, nil, nil, trie.NewStackTrie(nil))
return types.NewBlock(head, nil, nil, trie.NewStackTrie(nil))
}

func InitializeArbosInDatabase(db ethdb.Database, cacheConfig *core.CacheConfig, initData statetransfer.InitDataReader, chainConfig *params.ChainConfig, initMessage *arbostypes.ParsedInitMessage, timestamp uint64, accountsPerSync uint) (root common.Hash, err error) {
Expand Down
4 changes: 2 additions & 2 deletions arbos/block_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ func ProduceBlockAdvanced(
FinalizeBlock(header, complete, statedb, chainConfig)

// Touch up the block hashes in receipts
tmpBlock := types.NewBlock(header, complete, nil, receipts, trie.NewStackTrie(nil))
tmpBlock := types.NewBlock(header, &types.Body{Transactions: complete}, receipts, trie.NewStackTrie(nil))
blockHash := tmpBlock.Hash()

for _, receipt := range receipts {
Expand All @@ -470,7 +470,7 @@ func ProduceBlockAdvanced(
}
}

block := types.NewBlock(header, complete, nil, receipts, trie.NewStackTrie(nil))
block := types.NewBlock(header, &types.Body{Transactions: complete}, receipts, trie.NewStackTrie(nil))

if len(block.Transactions()) != len(receipts) {
return nil, nil, fmt.Errorf("block has %d txes but %d receipts", len(block.Transactions()), len(receipts))
Expand Down
2 changes: 1 addition & 1 deletion arbos/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (e Engine) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *t

e.Finalize(chain, header, state, body)

block := types.NewBlock(header, body.Transactions, nil, receipts, trie.NewStackTrie(nil))
block := types.NewBlock(header, &types.Body{Transactions: body.Transactions}, receipts, trie.NewStackTrie(nil))
return block, nil
}

Expand Down
7 changes: 3 additions & 4 deletions arbos/util/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,10 @@ func TransferBalance(
if arbmath.BigLessThan(balance.ToBig(), amount) {
return fmt.Errorf("%w: addr %v have %v want %v", vm.ErrInsufficientBalance, *from, balance, amount)
}
evm.StateDB.SubBalance(*from, uint256.MustFromBig(amount), tracing.BalanceChangeTransfer)
if evm.Context.ArbOSVersion >= 30 {
// ensure the from account is "touched" for EIP-161
evm.StateDB.AddBalance(*from, &uint256.Int{}, tracing.BalanceChangeTransfer)
if evm.Context.ArbOSVersion < 30 && amount.Sign() == 0 {
evm.StateDB.CreateZombieIfDeleted(*from)
}
evm.StateDB.SubBalance(*from, uint256.MustFromBig(amount), tracing.BalanceChangeTransfer)
}
if to != nil {
evm.StateDB.AddBalance(*to, uint256.MustFromBig(amount), tracing.BalanceChangeTransfer)
Expand Down
2 changes: 1 addition & 1 deletion go-ethereum
Submodule go-ethereum updated 121 files

0 comments on commit bd7bd35

Please sign in to comment.