Skip to content

Commit

Permalink
Utilize BalanceChangeReason in tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshvanahalli committed Nov 15, 2024
1 parent ee13024 commit 10a536f
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 45 deletions.
9 changes: 5 additions & 4 deletions arbos/l1pricing/l1PricingOldVersions.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"math/big"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/tracing"
"github.com/ethereum/go-ethereum/core/vm"

"github.com/offchainlabs/nitro/arbos/util"
Expand Down Expand Up @@ -119,7 +120,7 @@ func (ps *L1PricingState) _preversion10_UpdateForBatchPosterSpending(
return err
}
err = util.TransferBalance(
&L1PricerFundsPoolAddress, &payRewardsTo, paymentForRewards, evm, scenario, "batchPosterReward",
&L1PricerFundsPoolAddress, &payRewardsTo, paymentForRewards, evm, scenario, "batchPosterReward", tracing.BalanceChangeTransferBatchposterReward,
)
if err != nil {
return err
Expand All @@ -141,7 +142,7 @@ func (ps *L1PricingState) _preversion10_UpdateForBatchPosterSpending(
return err
}
err = util.TransferBalance(
&L1PricerFundsPoolAddress, &addrToPay, balanceToTransfer, evm, scenario, "batchPosterRefund",
&L1PricerFundsPoolAddress, &addrToPay, balanceToTransfer, evm, scenario, "batchPosterRefund", tracing.BalanceChangeTransferBatchposterRefund,
)
if err != nil {
return err
Expand Down Expand Up @@ -298,7 +299,7 @@ func (ps *L1PricingState) _preVersion2_UpdateForBatchPosterSpending(
return err
}
err = util.TransferBalance(
&L1PricerFundsPoolAddress, &payRewardsTo, paymentForRewards, evm, scenario, "batchPosterReward",
&L1PricerFundsPoolAddress, &payRewardsTo, paymentForRewards, evm, scenario, "batchPosterReward", tracing.BalanceChangeTransferBatchposterReward,
)
if err != nil {
return err
Expand Down Expand Up @@ -329,7 +330,7 @@ func (ps *L1PricingState) _preVersion2_UpdateForBatchPosterSpending(
return err
}
err = util.TransferBalance(
&L1PricerFundsPoolAddress, &addrToPay, balanceToTransfer, evm, scenario, "batchPosterRefund",
&L1PricerFundsPoolAddress, &addrToPay, balanceToTransfer, evm, scenario, "batchPosterRefund", tracing.BalanceChangeTransferBatchposterRefund,
)
if err != nil {
return err
Expand Down
8 changes: 5 additions & 3 deletions arbos/l1pricing/l1pricing.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/tracing"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
Expand Down Expand Up @@ -279,8 +280,9 @@ func (ps *L1PricingState) TransferFromL1FeesAvailable(
evm *vm.EVM,
scenario util.TracingScenario,
purpose string,
reason tracing.BalanceChangeReason,
) (*big.Int, error) {
if err := util.TransferBalance(&L1PricerFundsPoolAddress, &recipient, amount, evm, scenario, purpose); err != nil {
if err := util.TransferBalance(&L1PricerFundsPoolAddress, &recipient, amount, evm, scenario, purpose, reason); err != nil {
return nil, err
}
old, err := ps.L1FeesAvailable()
Expand Down Expand Up @@ -407,7 +409,7 @@ func (ps *L1PricingState) UpdateForBatchPosterSpending(
return err
}
l1FeesAvailable, err = ps.TransferFromL1FeesAvailable(
payRewardsTo, paymentForRewards, evm, scenario, "batchPosterReward",
payRewardsTo, paymentForRewards, evm, scenario, "batchPosterReward", tracing.BalanceChangeTransferBatchposterReward,
)
if err != nil {
return err
Expand All @@ -428,7 +430,7 @@ func (ps *L1PricingState) UpdateForBatchPosterSpending(
return err
}
l1FeesAvailable, err = ps.TransferFromL1FeesAvailable(
addrToPay, balanceToTransfer, evm, scenario, "batchPosterRefund",
addrToPay, balanceToTransfer, evm, scenario, "batchPosterRefund", tracing.BalanceChangeTransferBatchposterRefund,
)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion arbos/l1pricing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func _testL1PriceEquilibration(t *testing.T, initialL1BasefeeEstimate *big.Int,
currentPricePerUnit, err := l1p.PricePerUnit()
Require(t, err)
feesToAdd := arbmath.BigMulByUint(currentPricePerUnit, unitsToAdd)
util.MintBalance(&l1PoolAddress, feesToAdd, evm, util.TracingBeforeEVM, "test")
util.MintBalance(&l1PoolAddress, feesToAdd, evm, util.TracingBeforeEVM, "test", tracing.BalanceChangeUnspecified)
err = l1p.UpdateForBatchPosterSpending(
evm.StateDB,
evm,
Expand Down
3 changes: 2 additions & 1 deletion arbos/retryables/retryable.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"math/big"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/tracing"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
Expand Down Expand Up @@ -146,7 +147,7 @@ func (rs *RetryableState) DeleteRetryable(id common.Hash, evm *vm.EVM, scenario
escrowAddress := RetryableEscrowAddress(id)
beneficiaryAddress := common.BytesToAddress(beneficiary[:])
amount := evm.StateDB.GetBalance(escrowAddress)
err = util.TransferBalance(&escrowAddress, &beneficiaryAddress, amount.ToBig(), evm, scenario, "escrow")
err = util.TransferBalance(&escrowAddress, &beneficiaryAddress, amount.ToBig(), evm, scenario, "escrow", tracing.BalanceChangeTransferRetryTxFromEscrow)
if err != nil {
return false, err
}
Expand Down
53 changes: 27 additions & 26 deletions arbos/tx_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/tracing"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/log"
Expand Down Expand Up @@ -177,7 +178,7 @@ func (p *TxProcessor) StartTxHook() (endTxNow bool, gasUsed uint64, err error, r
if to == nil {
return true, 0, errors.New("eth deposit has no To address"), nil
}
util.MintBalance(&from, value, evm, util.TracingBeforeEVM, "deposit")
util.MintBalance(&from, value, evm, util.TracingBeforeEVM, "deposit", tracing.BalanceIncreaseDeposit)
defer (startTracer())()
// We intentionally use the variant here that doesn't do tracing,
// because this transfer is represented as the outer eth transaction.
Expand Down Expand Up @@ -205,10 +206,10 @@ func (p *TxProcessor) StartTxHook() (endTxNow bool, gasUsed uint64, err error, r
// mint funds with the deposit, then charge fees later
availableRefund := new(big.Int).Set(tx.DepositValue)
takeFunds(availableRefund, tx.RetryValue)
util.MintBalance(&tx.From, tx.DepositValue, evm, scenario, "deposit")
util.MintBalance(&tx.From, tx.DepositValue, evm, scenario, "deposit", tracing.BalanceIncreaseDeposit)

transfer := func(from, to *common.Address, amount *big.Int) error {
return util.TransferBalance(from, to, amount, evm, scenario, "during evm execution")
transfer := func(from, to *common.Address, amount *big.Int, reason tracing.BalanceChangeReason) error {
return util.TransferBalance(from, to, amount, evm, scenario, "during evm execution", reason)
}

// check that the user has enough balance to pay for the max submission fee
Expand All @@ -232,7 +233,7 @@ func (p *TxProcessor) StartTxHook() (endTxNow bool, gasUsed uint64, err error, r
}

// collect the submission fee
if err := transfer(&tx.From, &networkFeeAccount, submissionFee); err != nil {
if err := transfer(&tx.From, &networkFeeAccount, submissionFee, tracing.BalanceChangeTransferRetryableToNetwork); err != nil {
// should be impossible as we just checked that they have enough balance for the max submission fee,
// and we also checked that the max submission fee is at least the actual submission fee
glog.Error("failed to transfer submissionFee", "err", err)
Expand All @@ -242,24 +243,24 @@ func (p *TxProcessor) StartTxHook() (endTxNow bool, gasUsed uint64, err error, r

// refund excess submission fee
submissionFeeRefund := takeFunds(availableRefund, arbmath.BigSub(tx.MaxSubmissionFee, submissionFee))
if err := transfer(&tx.From, &tx.FeeRefundAddr, submissionFeeRefund); err != nil {
if err := transfer(&tx.From, &tx.FeeRefundAddr, submissionFeeRefund, tracing.BalanceChangeTransferRetryableToFeeRefundAddr); err != nil {
// should never happen as from's balance should be at least availableRefund at this point
glog.Error("failed to transfer submissionFeeRefund", "err", err)
}

// move the callvalue into escrow
if callValueErr := transfer(&tx.From, &escrow, tx.RetryValue); callValueErr != nil {
if callValueErr := transfer(&tx.From, &escrow, tx.RetryValue, tracing.BalanceChangeTransferRetryableToEscrow); callValueErr != nil {
// The sender doesn't have enough balance to pay for the retryable's callvalue.
// Since we can't create the retryable, we should refund the submission fee.
// First, we give the submission fee back to the transaction sender:
if err := transfer(&networkFeeAccount, &tx.From, submissionFee); err != nil {
if err := transfer(&networkFeeAccount, &tx.From, submissionFee, tracing.BalanceChangeTransferRetryableFromNetwork); err != nil {
glog.Error("failed to refund submissionFee", "err", err)
}
// Then, as limited by availableRefund, we attempt to move the refund to the fee refund address.
// If the deposit value was lower than the submission fee, only some (or none) of the submission fee may be moved.
// In that case, any amount up to the deposit value will be refunded to the fee refund address,
// with the rest remaining in the transaction sender's address (as that's where the funds were pulled from).
if err := transfer(&tx.From, &tx.FeeRefundAddr, withheldSubmissionFee); err != nil {
if err := transfer(&tx.From, &tx.FeeRefundAddr, withheldSubmissionFee, tracing.BalanceChangeTransferRetryableToFeeRefundAddr); err != nil {
glog.Error("failed to refund withheldSubmissionFee", "err", err)
}
return true, 0, callValueErr, nil
Expand Down Expand Up @@ -297,7 +298,7 @@ func (p *TxProcessor) StartTxHook() (endTxNow bool, gasUsed uint64, err error, r
// or the specified gas limit is below the minimum transaction gas cost.
// Either way, attempt to refund the gas costs, since we're not doing the auto-redeem.
gasCostRefund := takeFunds(availableRefund, maxGasCost)
if err := transfer(&tx.From, &tx.FeeRefundAddr, gasCostRefund); err != nil {
if err := transfer(&tx.From, &tx.FeeRefundAddr, gasCostRefund, tracing.BalanceChangeTransferRetryableToFeeRefundAddr); err != nil {
// should never happen as from's balance should be at least availableRefund at this point
glog.Error("failed to transfer gasCostRefund", "err", err)
}
Expand All @@ -316,14 +317,14 @@ func (p *TxProcessor) StartTxHook() (endTxNow bool, gasUsed uint64, err error, r
infraFee := arbmath.BigMin(minBaseFee, effectiveBaseFee)
infraCost := arbmath.BigMulByUint(infraFee, usergas)
infraCost = takeFunds(networkCost, infraCost)
if err := transfer(&tx.From, &infraFeeAccount, infraCost); err != nil {
if err := transfer(&tx.From, &infraFeeAccount, infraCost, tracing.BalanceChangeTransferRetryableToInfra); err != nil {
glog.Error("failed to transfer gas cost to infrastructure fee account", "err", err)
return true, 0, nil, ticketId.Bytes()
}
}
}
if arbmath.BigGreaterThan(networkCost, common.Big0) {
if err := transfer(&tx.From, &networkFeeAccount, networkCost); err != nil {
if err := transfer(&tx.From, &networkFeeAccount, networkCost, tracing.BalanceChangeTransferRetryableToNetwork); err != nil {
// should be impossible because we just checked the tx.From balance
glog.Error("failed to transfer gas cost to network fee account", "err", err)
return true, 0, nil, ticketId.Bytes()
Expand All @@ -337,7 +338,7 @@ func (p *TxProcessor) StartTxHook() (endTxNow bool, gasUsed uint64, err error, r
gasPriceRefund.SetInt64(0)
}
gasPriceRefund = takeFunds(availableRefund, gasPriceRefund)
if err := transfer(&tx.From, &tx.FeeRefundAddr, gasPriceRefund); err != nil {
if err := transfer(&tx.From, &tx.FeeRefundAddr, gasPriceRefund, tracing.BalanceChangeTransferRetryableToFeeRefundAddr); err != nil {
glog.Error("failed to transfer gasPriceRefund", "err", err)
}
availableRefund.Add(availableRefund, withheldGasFunds)
Expand Down Expand Up @@ -388,13 +389,13 @@ func (p *TxProcessor) StartTxHook() (endTxNow bool, gasUsed uint64, err error, r
// Transfer callvalue from escrow
escrow := retryables.RetryableEscrowAddress(tx.TicketId)
scenario := util.TracingBeforeEVM
if err := util.TransferBalance(&escrow, &tx.From, tx.Value, evm, scenario, "escrow"); err != nil {
if err := util.TransferBalance(&escrow, &tx.From, tx.Value, evm, scenario, "escrow", tracing.BalanceChangeTransferRetryTxFromEscrow); err != nil {
return true, 0, err, nil
}

// The redeemer has pre-paid for this tx's gas
prepaid := arbmath.BigMulByUint(evm.Context.BaseFee, tx.Gas)
util.MintBalance(&tx.From, prepaid, evm, scenario, "prepaid")
util.MintBalance(&tx.From, prepaid, evm, scenario, "prepaid", tracing.BalanceIncreaseRetryTxPrepaid)
ticketId := tx.TicketId
refundTo := tx.RefundTo
p.CurrentRetryable = &ticketId
Expand Down Expand Up @@ -525,13 +526,13 @@ func (p *TxProcessor) EndTxHook(gasLeft uint64, success bool) {

// undo Geth's refund to the From address
gasRefund := arbmath.BigMulByUint(effectiveBaseFee, gasLeft)
err := util.BurnBalance(&inner.From, gasRefund, p.evm, scenario, "undoRefund")
err := util.BurnBalance(&inner.From, gasRefund, p.evm, scenario, "undoRefund", tracing.BalanceDecreaseRetryTxUndoRefund)
if err != nil {
log.Error("Uh oh, Geth didn't refund the user", inner.From, gasRefund)
}

maxRefund := new(big.Int).Set(inner.MaxRefund)
refund := func(refundFrom common.Address, amount *big.Int) {
refund := func(refundFrom common.Address, amount *big.Int, reason tracing.BalanceChangeReason) {
const errLog = "fee address doesn't have enough funds to give user refund"

logMissingRefund := func(err error) {
Expand All @@ -550,7 +551,7 @@ func (p *TxProcessor) EndTxHook(gasLeft uint64, success bool) {

// Refund funds to the fee refund address without overdrafting the L1 deposit.
toRefundAddr := takeFunds(maxRefund, amount)
err = util.TransferBalance(&refundFrom, &inner.RefundTo, toRefundAddr, p.evm, scenario, "refund")
err = util.TransferBalance(&refundFrom, &inner.RefundTo, toRefundAddr, p.evm, scenario, "refund", reason)
if err != nil {
// Normally the network fee address should be holding any collected fees.
// However, in theory, they could've been transferred out during the redeem attempt.
Expand All @@ -559,15 +560,15 @@ func (p *TxProcessor) EndTxHook(gasLeft uint64, success bool) {
}
// Any extra refund can't be given to the fee refund address if it didn't come from the L1 deposit.
// Instead, give the refund to the retryable from address.
err = util.TransferBalance(&refundFrom, &inner.From, arbmath.BigSub(amount, toRefundAddr), p.evm, scenario, "refund")
err = util.TransferBalance(&refundFrom, &inner.From, arbmath.BigSub(amount, toRefundAddr), p.evm, scenario, "refund", reason)
if err != nil {
logMissingRefund(err)
}
}

if success {
// If successful, refund the submission fee.
refund(networkFeeAccount, inner.SubmissionFeeRefund)
refund(networkFeeAccount, inner.SubmissionFeeRefund, tracing.BalanceChangeTransferRetryableFromNetwork)
} else {
// The submission fee is still taken from the L1 deposit earlier, even if it's not refunded.
takeFunds(maxRefund, inner.SubmissionFeeRefund)
Expand All @@ -586,10 +587,10 @@ func (p *TxProcessor) EndTxHook(gasLeft uint64, success bool) {
infraFee := arbmath.BigMin(minBaseFee, effectiveBaseFee)
infraRefund := arbmath.BigMulByUint(infraFee, gasLeft)
infraRefund = takeFunds(networkRefund, infraRefund)
refund(infraFeeAccount, infraRefund)
refund(infraFeeAccount, infraRefund, tracing.BalanceChangeTransferRetryableFromInfra)
}
}
refund(networkFeeAccount, networkRefund)
refund(networkFeeAccount, networkRefund, tracing.BalanceChangeTransferRetryableFromNetwork)

if success {
// we don't want to charge for this
Expand All @@ -599,7 +600,7 @@ func (p *TxProcessor) EndTxHook(gasLeft uint64, success bool) {
} else {
// return the Callvalue to escrow
escrow := retryables.RetryableEscrowAddress(inner.TicketId)
err := util.TransferBalance(&inner.From, &escrow, inner.Value, p.evm, scenario, "escrow")
err := util.TransferBalance(&inner.From, &escrow, inner.Value, p.evm, scenario, "escrow", tracing.BalanceChangeTransferRetryTxToEscrow)
if err != nil {
// should be impossible because geth credited the inner.Value to inner.From before the transaction
// and the transaction reverted
Expand Down Expand Up @@ -638,18 +639,18 @@ func (p *TxProcessor) EndTxHook(gasLeft uint64, success bool) {
infraFee := arbmath.BigMin(minBaseFee, basefee)
computeGas := arbmath.SaturatingUSub(gasUsed, p.posterGas)
infraComputeCost := arbmath.BigMulByUint(infraFee, computeGas)
util.MintBalance(&infraFeeAccount, infraComputeCost, p.evm, scenario, purpose)
util.MintBalance(&infraFeeAccount, infraComputeCost, p.evm, scenario, purpose, tracing.BalanceIncreaseInfraFee)
computeCost = arbmath.BigSub(computeCost, infraComputeCost)
}
}
if arbmath.BigGreaterThan(computeCost, common.Big0) {
util.MintBalance(&networkFeeAccount, computeCost, p.evm, scenario, purpose)
util.MintBalance(&networkFeeAccount, computeCost, p.evm, scenario, purpose, tracing.BalanceIncreaseNetworkFee)
}
posterFeeDestination := l1pricing.L1PricerFundsPoolAddress
if p.state.ArbOSVersion() < 2 {
posterFeeDestination = p.evm.Context.Coinbase
}
util.MintBalance(&posterFeeDestination, p.PosterFee, p.evm, scenario, purpose)
util.MintBalance(&posterFeeDestination, p.PosterFee, p.evm, scenario, purpose, tracing.BalanceIncreaseL1PosterFee)
if p.state.ArbOSVersion() >= 10 {
if _, err := p.state.L1PricingState().AddToL1FeesAvailable(p.PosterFee); err != nil {
log.Error("failed to update L1FeesAvailable: ", "err", err)
Expand Down
13 changes: 7 additions & 6 deletions arbos/util/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func TransferBalance(
evm *vm.EVM,
scenario TracingScenario,
purpose string,
reason tracing.BalanceChangeReason,
) error {
if amount.Sign() < 0 {
panic(fmt.Sprintf("Tried to transfer negative amount %v from %v to %v", amount, from, to))
Expand Down Expand Up @@ -66,27 +67,27 @@ 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)
evm.StateDB.SubBalance(*from, uint256.MustFromBig(amount), reason)
if evm.Context.ArbOSVersion >= 30 {
// ensure the from account is "touched" for EIP-161
evm.StateDB.AddBalance(*from, &uint256.Int{}, tracing.BalanceChangeTransfer)
}
}
if to != nil {
evm.StateDB.AddBalance(*to, uint256.MustFromBig(amount), tracing.BalanceChangeTransfer)
evm.StateDB.AddBalance(*to, uint256.MustFromBig(amount), reason)
}
return nil
}

// MintBalance mints funds for the user and adds them to their balance
func MintBalance(to *common.Address, amount *big.Int, evm *vm.EVM, scenario TracingScenario, purpose string) {
err := TransferBalance(nil, to, amount, evm, scenario, purpose)
func MintBalance(to *common.Address, amount *big.Int, evm *vm.EVM, scenario TracingScenario, purpose string, reason tracing.BalanceChangeReason) {
err := TransferBalance(nil, to, amount, evm, scenario, purpose, reason)
if err != nil {
panic(fmt.Sprintf("impossible error: %v", err))
}
}

// BurnBalance burns funds from a user's account
func BurnBalance(from *common.Address, amount *big.Int, evm *vm.EVM, scenario TracingScenario, purpose string) error {
return TransferBalance(from, nil, amount, evm, scenario, purpose)
func BurnBalance(from *common.Address, amount *big.Int, evm *vm.EVM, scenario TracingScenario, purpose string, reason tracing.BalanceChangeReason) error {
return TransferBalance(from, nil, amount, evm, scenario, purpose, reason)
}
2 changes: 1 addition & 1 deletion go-ethereum
Submodule go-ethereum updated 33 files
+94 −0 core/tracing/hooks.go
+11 −3 eth/tracers/internal/tracetest/calltrace_test.go
+17 −5 eth/tracers/internal/tracetest/testdata/call_tracer/blob_tx.json
+15 −1 eth/tracers/internal/tracetest/testdata/call_tracer/create.json
+22 −2 eth/tracers/internal/tracetest/testdata/call_tracer/deep_calls.json
+21 −1 eth/tracers/internal/tracetest/testdata/call_tracer/delegatecall.json
+16 −2 eth/tracers/internal/tracetest/testdata/call_tracer/inner_create_oog_outer_throw.json
+34 −12 eth/tracers/internal/tracetest/testdata/call_tracer/inner_instafail.json
+20 −0 eth/tracers/internal/tracetest/testdata/call_tracer/inner_revert_reason.json
+34 −2 eth/tracers/internal/tracetest/testdata/call_tracer/inner_throw_outer_revert.json
+15 −1 eth/tracers/internal/tracetest/testdata/call_tracer/oog.json
+22 −2 eth/tracers/internal/tracetest/testdata/call_tracer/revert.json
+22 −2 eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json
+34 −2 eth/tracers/internal/tracetest/testdata/call_tracer/selfdestruct.json
+33 −1 eth/tracers/internal/tracetest/testdata/call_tracer/simple.json
+34 −2 eth/tracers/internal/tracetest/testdata/call_tracer/simple_onlytop.json
+16 −2 eth/tracers/internal/tracetest/testdata/call_tracer/throw.json
+33 −1 eth/tracers/internal/tracetest/testdata/call_tracer_withLog/calldata.json
+21 −1 eth/tracers/internal/tracetest/testdata/call_tracer_withLog/delegatecall.json
+28 −8 eth/tracers/internal/tracetest/testdata/call_tracer_withLog/frontier_create_outofstorage.json
+57 −1 eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multi_contracts.json
+61 −29 eth/tracers/internal/tracetest/testdata/call_tracer_withLog/multilogs.json
+45 −1 eth/tracers/internal/tracetest/testdata/call_tracer_withLog/notopic.json
+21 −1 eth/tracers/internal/tracetest/testdata/call_tracer_withLog/simple.json
+27 −1 eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_failed.json
+21 −1 eth/tracers/internal/tracetest/testdata/call_tracer_withLog/tx_partial_failed.json
+33 −1 eth/tracers/internal/tracetest/testdata/call_tracer_withLog/with_onlyTopCall.json
+1 −0 eth/tracers/js/goja.go
+18 −0 eth/tracers/js/tracer_arbitrum.go
+7 −0 eth/tracers/native/call.go
+7 −0 eth/tracers/native/call_flat.go
+6 −0 eth/tracers/native/gen_callframe_json.go
+29 −0 eth/tracers/native/tracer_arbitrum.go
3 changes: 2 additions & 1 deletion precompiles/ArbSys.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"math/big"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/tracing"
"github.com/ethereum/go-ethereum/core/vm"

"github.com/offchainlabs/nitro/arbos/util"
Expand Down Expand Up @@ -141,7 +142,7 @@ func (con *ArbSys) SendTxToL1(c ctx, evm mech, value huge, destination addr, cal
}

// burn the callvalue, which was previously deposited to this precompile's account
if err := util.BurnBalance(&con.Address, value, evm, util.TracingDuringEVM, "withdraw"); err != nil {
if err := util.BurnBalance(&con.Address, value, evm, util.TracingDuringEVM, "withdraw", tracing.BalanceDecreaseWithdrawToL1); err != nil {
return nil, err
}

Expand Down
Loading

0 comments on commit 10a536f

Please sign in to comment.