diff --git a/arbos/arbosState/initialize.go b/arbos/arbosState/initialize.go index e98ab08485..8cd96fe199 100644 --- a/arbos/arbosState/initialize.go +++ b/arbos/arbosState/initialize.go @@ -142,7 +142,7 @@ func InitializeArbosInDatabase(db ethdb.Database, initData statetransfer.InitDat if err != nil { return common.Hash{}, err } - statedb.SetBalance(account.Addr, account.EthBalance) + statedb.SetBalance(account.Addr, account.EthBalance, state.BalanceChangeGenesisBalance) statedb.SetNonce(account.Addr, account.Nonce) if account.ContractInfo != nil { statedb.SetCode(account.Addr, account.ContractInfo.Code) @@ -173,7 +173,7 @@ func initializeRetryables(statedb *state.StateDB, rs *retryables.RetryableState, return err } if r.Timeout <= currentTimestamp { - statedb.AddBalance(r.Beneficiary, r.Callvalue) + statedb.AddBalance(r.Beneficiary, r.Callvalue, state.BalanceChangeGenesisBalance) continue } retryablesList = append(retryablesList, r) @@ -191,7 +191,7 @@ func initializeRetryables(statedb *state.StateDB, rs *retryables.RetryableState, if r.To != (common.Address{}) { to = &r.To } - statedb.AddBalance(retryables.RetryableEscrowAddress(r.Id), r.Callvalue) + statedb.AddBalance(retryables.RetryableEscrowAddress(r.Id), r.Callvalue, state.BalanceChangeGenesisBalance) _, err := rs.CreateRetryable(r.Id, r.Timeout, r.From, to, r.Callvalue, r.Beneficiary, r.Calldata) if err != nil { return err diff --git a/arbos/tx_processor.go b/arbos/tx_processor.go index d0f999d0de..2691d64baa 100644 --- a/arbos/tx_processor.go +++ b/arbos/tx_processor.go @@ -116,7 +116,7 @@ func (p *TxProcessor) StartTxHook() (endTxNow bool, gasUsed uint64, err error, r evm.IncrementDepth() // fake a call tracer := evm.Config.Tracer from := p.msg.From - tracer.CaptureStart(evm, from, *p.msg.To, false, p.msg.Data, p.msg.GasLimit, p.msg.Value) + tracer.CaptureStart(from, *p.msg.To, false, p.msg.Data, p.msg.GasLimit, p.msg.Value) tracingInfo = util.NewTracingInfo(evm, from, *p.msg.To, util.TracingDuringEVM) p.state = arbosState.OpenSystemArbosStateOrPanic(evm.StateDB, tracingInfo, false) diff --git a/arbos/util/transfer.go b/arbos/util/transfer.go index 6f05c2e5e1..23787fa80f 100644 --- a/arbos/util/transfer.go +++ b/arbos/util/transfer.go @@ -10,6 +10,7 @@ import ( "math/big" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/log" "github.com/offchainlabs/nitro/util/arbmath" @@ -32,10 +33,10 @@ func TransferBalance( if arbmath.BigLessThan(balance, amount) { return fmt.Errorf("%w: addr %v have %v want %v", vm.ErrInsufficientBalance, *from, balance, amount) } - evm.StateDB.SubBalance(*from, amount) + evm.StateDB.SubBalance(*from, amount, state.BalanceChangeTransfer) } if to != nil { - evm.StateDB.AddBalance(*to, amount) + evm.StateDB.AddBalance(*to, amount, state.BalanceChangeTransfer) } if evm.Config.Debug { tracer := evm.Config.Tracer