Skip to content

Commit

Permalink
Merge pull request ethereum#68 from OffchainLabs/retryable-pricing
Browse files Browse the repository at this point in the history
Retryable Pricing
  • Loading branch information
rachel-bousfield authored Mar 16, 2022
2 parents e78889f + 0621513 commit 1c09e7f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func IntrinsicGas(data []byte, accessList types.AccessList, isContractCreation b
}

var ReadyEVMForL2 func(evm *vm.EVM, msg Message)
var InterceptRPCMessage func(msg types.Message) (types.Message, error)
var InterceptRPCMessage func(msg types.Message, statedb *state.StateDB) (types.Message, error)
var InterceptRPCGasCap func(gascap *uint64, msg types.Message, header *types.Header, statedb *state.StateDB)

// NewStateTransition initialises and returns a new state transition object.
Expand Down
50 changes: 26 additions & 24 deletions core/types/arb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,34 +197,36 @@ type ArbitrumSubmitRetryableTx struct {
ChainId *big.Int
RequestId common.Hash
From common.Address

DepositValue *big.Int
GasFeeCap *big.Int // wei per gas
Gas uint64 // gas limit
To *common.Address `rlp:"nil"` // nil means contract creation
Value *big.Int // wei amount
Beneficiary common.Address
SubmissionFeePaid *big.Int
FeeRefundAddr common.Address
Data []byte // contract invocation input data
L1BaseFee *big.Int

DepositValue *big.Int
GasFeeCap *big.Int // wei per gas
Gas uint64 // gas limit
To *common.Address `rlp:"nil"` // nil means contract creation
Value *big.Int // wei amount
Beneficiary common.Address
MaxSubmissionFee *big.Int
FeeRefundAddr common.Address
Data []byte // contract invocation input data
}

func (tx *ArbitrumSubmitRetryableTx) txType() byte { return ArbitrumSubmitRetryableTxType }

func (tx *ArbitrumSubmitRetryableTx) copy() TxData {
cpy := &ArbitrumSubmitRetryableTx{
ChainId: new(big.Int),
RequestId: tx.RequestId,
DepositValue: new(big.Int),
GasFeeCap: new(big.Int),
Gas: tx.Gas,
From: tx.From,
To: tx.To,
Value: new(big.Int),
Beneficiary: tx.Beneficiary,
SubmissionFeePaid: new(big.Int),
FeeRefundAddr: tx.FeeRefundAddr,
Data: common.CopyBytes(tx.Data),
ChainId: new(big.Int),
RequestId: tx.RequestId,
DepositValue: new(big.Int),
L1BaseFee: tx.L1BaseFee,
GasFeeCap: new(big.Int),
Gas: tx.Gas,
From: tx.From,
To: tx.To,
Value: new(big.Int),
Beneficiary: tx.Beneficiary,
MaxSubmissionFee: new(big.Int),
FeeRefundAddr: tx.FeeRefundAddr,
Data: common.CopyBytes(tx.Data),
}
if tx.ChainId != nil {
cpy.ChainId.Set(tx.ChainId)
Expand All @@ -242,8 +244,8 @@ func (tx *ArbitrumSubmitRetryableTx) copy() TxData {
if tx.Value != nil {
cpy.Value.Set(tx.Value)
}
if tx.SubmissionFeePaid != nil {
cpy.SubmissionFeePaid.Set(tx.SubmissionFeePaid)
if tx.MaxSubmissionFee != nil {
cpy.MaxSubmissionFee.Set(tx.MaxSubmissionFee)
}
return cpy
}
Expand Down
2 changes: 1 addition & 1 deletion internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ func DoCall(ctx context.Context, b Backend, args TransactionArgs, blockNrOrHash

// Arbitrum: support NodeInterface.sol by swapping out the message if needed
if core.InterceptRPCMessage != nil {
msg, err = core.InterceptRPCMessage(msg)
msg, err = core.InterceptRPCMessage(msg, state)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 1c09e7f

Please sign in to comment.