From 6f3bd638247d01be24b41de3aca456248561dd6e Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Wed, 22 May 2024 20:16:51 -0600 Subject: [PATCH 1/3] use new runmode --- arbos/tx_processor.go | 12 ++++++------ execution/nodeInterface/NodeInterface.go | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/arbos/tx_processor.go b/arbos/tx_processor.go index 65762fd2d1..222c8ef316 100644 --- a/arbos/tx_processor.go +++ b/arbos/tx_processor.go @@ -286,7 +286,7 @@ func (p *TxProcessor) StartTxHook() (endTxNow bool, gasUsed uint64, err error, r effectiveBaseFee := evm.Context.BaseFee usergas := p.msg.GasLimit - if p.msg.TxRunMode != core.MessageCommitMode && p.msg.GasFeeCap.BitLen() == 0 { + if !p.msg.TxRunMode.ExecutedOnChain() && p.msg.GasFeeCap.BitLen() == 0 { // In gas estimation or eth_call mode, we permit a zero gas fee cap. // This matches behavior with normal tx gas estimation and eth_call. effectiveBaseFee = common.Big0 @@ -436,13 +436,13 @@ func (p *TxProcessor) GasChargingHook(gasRemaining *uint64) (common.Address, err basefee := p.evm.Context.BaseFee var poster common.Address - if p.msg.TxRunMode != core.MessageCommitMode { + if !p.msg.TxRunMode.ExecutedOnChain() { poster = l1pricing.BatchPosterAddress } else { poster = p.evm.Context.Coinbase } - if p.msg.TxRunMode == core.MessageCommitMode { + if p.msg.TxRunMode.ExecutedOnChain() { p.msg.SkipL1Charging = false } if basefee.Sign() > 0 && !p.msg.SkipL1Charging { @@ -509,7 +509,7 @@ func (p *TxProcessor) EndTxHook(gasLeft uint64, success bool) { if underlyingTx != nil && underlyingTx.Type() == types.ArbitrumRetryTxType { inner, _ := underlyingTx.GetInner().(*types.ArbitrumRetryTx) effectiveBaseFee := inner.GasFeeCap - if p.msg.TxRunMode == core.MessageCommitMode && !arbmath.BigEquals(effectiveBaseFee, p.evm.Context.BaseFee) { + if p.msg.TxRunMode.ExecutedOnChain() && !arbmath.BigEquals(effectiveBaseFee, p.evm.Context.BaseFee) { log.Error( "ArbitrumRetryTx GasFeeCap doesn't match basefee in commit mode", "txHash", underlyingTx.Hash(), @@ -659,7 +659,7 @@ func (p *TxProcessor) ScheduledTxes() types.Transactions { effectiveBaseFee := p.evm.Context.BaseFee chainID := p.evm.ChainConfig().ChainID - if p.msg.TxRunMode != core.MessageCommitMode && p.msg.GasFeeCap.BitLen() == 0 { + if !p.msg.TxRunMode.ExecutedOnChain() && p.msg.GasFeeCap.BitLen() == 0 { // In gas estimation or eth_call mode, we permit a zero gas fee cap. // This matches behavior with normal tx gas estimation and eth_call. effectiveBaseFee = common.Big0 @@ -739,7 +739,7 @@ func (p *TxProcessor) GetPaidGasPrice() *big.Int { version := p.state.ArbOSVersion() if version != 9 { gasPrice = p.evm.Context.BaseFee - if p.msg.TxRunMode != core.MessageCommitMode && p.msg.GasFeeCap.Sign() == 0 { + if !p.msg.TxRunMode.ExecutedOnChain() && p.msg.GasFeeCap.Sign() == 0 { gasPrice = common.Big0 } } diff --git a/execution/nodeInterface/NodeInterface.go b/execution/nodeInterface/NodeInterface.go index 7e524731d0..9179a52718 100644 --- a/execution/nodeInterface/NodeInterface.go +++ b/execution/nodeInterface/NodeInterface.go @@ -213,12 +213,11 @@ func (n NodeInterface) EstimateRetryableTicket( } // ArbitrumSubmitRetryableTx is unsigned so the following won't panic - msg, err := core.TransactionToMessage(types.NewTx(submitTx), types.NewArbitrumSigner(nil), nil) + msg, err := core.TransactionToMessage(types.NewTx(submitTx), types.NewArbitrumSigner(nil), nil, core.MessageGasEstimationMode) if err != nil { return err } - msg.TxRunMode = core.MessageGasEstimationMode *n.returnMessage.message = *msg *n.returnMessage.changed = true return nil From 8463fe1a9db42b82e42a3d411909015dc052ed0c Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Wed, 22 May 2024 20:17:17 -0600 Subject: [PATCH 2/3] geth: update pin for runmode --- go-ethereum | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go-ethereum b/go-ethereum index b8d4ced531..a19d794fbc 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit b8d4ced5316c987d095ef1fc3ecb5e8ae0df094d +Subproject commit a19d794fbc7ebe21669a31ad31bdbca208c5597c From 923f3ccde5294f436b60e772612c29a4c8da099d Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Tue, 28 May 2024 17:50:58 -0600 Subject: [PATCH 3/3] geth: update pin --- go-ethereum | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go-ethereum b/go-ethereum index 569933582b..de513a2b2c 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit 569933582bbe8f492bf9d488e58dd0a873f32945 +Subproject commit de513a2b2c8e9e1239190992fcdaccef81cd387c