Skip to content

Commit

Permalink
Merge pull request #731 from OffchainLabs/retry-value-field
Browse files Browse the repository at this point in the history
Fix tracing balance deltas
  • Loading branch information
PlasmaPower authored Jun 28, 2022
2 parents 12b8c3a + c75fe34 commit 6014374
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion arbos/incomingmessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ func parseSubmitRetryableMessage(rd io.Reader, header *L1IncomingMessageHeader,
GasFeeCap: maxFeePerGas.Big(),
Gas: gasLimitBig.Uint64(),
RetryTo: pRetryTo,
Value: callvalue.Big(),
RetryValue: callvalue.Big(),
Beneficiary: callvalueRefundAddress,
MaxSubmissionFee: maxSubmissionFee.Big(),
FeeRefundAddr: feeRefundAddress,
Expand Down
8 changes: 4 additions & 4 deletions arbos/tx_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ 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.Value)
takeFunds(availableRefund, tx.RetryValue)
util.MintBalance(&tx.From, tx.DepositValue, evm, scenario, "deposit")

transfer := func(from, to *common.Address, amount *big.Int) error {
Expand All @@ -170,7 +170,7 @@ func (p *TxProcessor) StartTxHook() (endTxNow bool, gasUsed uint64, err error, r
}

// move the callvalue into escrow
if err := transfer(&tx.From, &escrow, tx.Value); err != nil {
if err := transfer(&tx.From, &escrow, tx.RetryValue); err != nil {
return true, 0, err, nil
}

Expand All @@ -183,7 +183,7 @@ func (p *TxProcessor) StartTxHook() (endTxNow bool, gasUsed uint64, err error, r
timeout,
tx.From,
tx.RetryTo,
underlyingTx.Value(),
tx.RetryValue,
tx.Beneficiary,
tx.RetryData,
)
Expand Down Expand Up @@ -257,7 +257,7 @@ func (p *TxProcessor) StartTxHook() (endTxNow bool, gasUsed uint64, err error, r
if evm.Config.Debug {
redeem, err := util.PackArbRetryableTxRedeem(ticketId)
if err == nil {
tracingInfo.MockCall(redeem, usergas, from, types.ArbRetryableTxAddress, tx.Value)
tracingInfo.MockCall(redeem, usergas, from, types.ArbRetryableTxAddress, common.Big0)
} else {
glog.Error("failed to abi-encode auto-redeem", "err", err)
}
Expand Down
4 changes: 2 additions & 2 deletions arbos/util/retryable_encoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestRetryableEncoding(t *testing.T) {
GasFeeCap: big.NewInt(76456),
Gas: 37655,
RetryTo: &dest,
Value: big.NewInt(23454),
RetryValue: big.NewInt(23454),
Beneficiary: testhelpers.RandomAddress(),
MaxSubmissionFee: big.NewInt(567356),
FeeRefundAddr: testhelpers.RandomAddress(),
Expand All @@ -66,7 +66,7 @@ func TestRetryableEncoding(t *testing.T) {
innerTx.RequestId,
innerTx.L1BaseFee,
innerTx.DepositValue,
innerTx.Value,
innerTx.RetryValue,
innerTx.GasFeeCap,
innerTx.Gas,
innerTx.MaxSubmissionFee,
Expand Down
2 changes: 1 addition & 1 deletion nodeInterface/NodeInterface.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (n NodeInterface) EstimateRetryableTicket(
GasFeeCap: n.sourceMessage.GasPrice(),
Gas: n.sourceMessage.Gas(),
RetryTo: pRetryTo,
Value: l2CallValue,
RetryValue: l2CallValue,
Beneficiary: callValueRefundAddress,
MaxSubmissionFee: maxSubmissionFee,
FeeRefundAddr: excessFeeRefundAddress,
Expand Down

0 comments on commit 6014374

Please sign in to comment.