diff --git a/database/migrate/migrations/00015_pending_transaction.sql b/database/migrate/migrations/00015_pending_transaction.sql index 001892fc71..485c07f8c5 100644 --- a/database/migrate/migrations/00015_pending_transaction.sql +++ b/database/migrate/migrations/00015_pending_transaction.sql @@ -11,9 +11,9 @@ CREATE TABLE pending_transaction status SMALLINT NOT NULL, rlp_encoding BYTEA NOT NULL, - gas_fee_cap NUMERIC NOT NULL, - gas_tip_cap NUMERIC NOT NULL, - gas_price NUMERIC NOT NULL, + gas_fee_cap BIGINT NOT NULL, + gas_tip_cap BIGINT NOT NULL, + gas_price BIGINT NOT NULL, gas_limit BIGINT NOT NULL, nonce BIGINT NOT NULL, submit_block_number BIGINT NOT NULL, diff --git a/rollup/conf/config.json b/rollup/conf/config.json index 38ef8cd58e..39b804a705 100644 --- a/rollup/conf/config.json +++ b/rollup/conf/config.json @@ -40,7 +40,6 @@ "escalate_multiple_den": 10, "max_gas_price": 10000000000, "tx_type": "DynamicFeeTx", - "min_balance": 100000000000000000000, "check_pending_time": 12 }, "gas_oracle_config": { diff --git a/rollup/internal/controller/relayer/l1_relayer_metrics.go b/rollup/internal/controller/relayer/l1_relayer_metrics.go index fcfa0385e3..7eeb1b244b 100644 --- a/rollup/internal/controller/relayer/l1_relayer_metrics.go +++ b/rollup/internal/controller/relayer/l1_relayer_metrics.go @@ -24,7 +24,7 @@ func initL1RelayerMetrics(reg prometheus.Registerer) *l1RelayerMetrics { l1RelayerMetric = &l1RelayerMetrics{ rollupL1RelayerGasPriceOracleRunTotal: promauto.With(reg).NewCounter(prometheus.CounterOpts{ Name: "rollup_layer1_gas_price_oracle_run_total", - Help: "Total number of times the Layer 1 gas price oracle has been run", + Help: "Total number of times the layer1 gas price oracle has been run", }), rollupL1RelayerLastGasPrice: promauto.With(reg).NewGauge(prometheus.GaugeOpts{ Name: "rollup_layer1_gas_price_latest_gas_price", @@ -32,11 +32,11 @@ func initL1RelayerMetrics(reg prometheus.Registerer) *l1RelayerMetrics { }), rollupL1UpdateGasOracleConfirmedTotal: promauto.With(reg).NewCounter(prometheus.CounterOpts{ Name: "rollup_layer1_update_gas_oracle_confirmed_total", - Help: "The total number of layer1 update gas oracle confirmed", + Help: "The total number of updating layer1 gas oracle confirmed", }), rollupL1UpdateGasOracleConfirmedFailedTotal: promauto.With(reg).NewCounter(prometheus.CounterOpts{ Name: "rollup_layer1_update_gas_oracle_confirmed_failed_total", - Help: "The total number of layer1 update gas oracle confirmed failed", + Help: "The total number of updating layer1 gas oracle confirmed failed", }), } }) diff --git a/rollup/internal/controller/relayer/l2_relayer.go b/rollup/internal/controller/relayer/l2_relayer.go index 28ce680e2b..66a44c4265 100644 --- a/rollup/internal/controller/relayer/l2_relayer.go +++ b/rollup/internal/controller/relayer/l2_relayer.go @@ -658,10 +658,10 @@ func (r *Layer2Relayer) handleConfirmation(cfm *sender.Confirmation) { var status types.GasOracleStatus if cfm.IsSuccessful { status = types.GasOracleImported - r.metrics.rollupL2UpdateL1GasOracleConfirmedTotal.Inc() + r.metrics.rollupL2UpdateGasOracleConfirmedTotal.Inc() } else { status = types.GasOracleImportedFailed - r.metrics.rollupL2UpdateL1GasOracleConfirmedFailedTotal.Inc() + r.metrics.rollupL2UpdateGasOracleConfirmedFailedTotal.Inc() log.Warn("UpdateGasOracleTxType transaction confirmed but failed in layer1", "confirmation", cfm) } diff --git a/rollup/internal/controller/relayer/l2_relayer_metrics.go b/rollup/internal/controller/relayer/l2_relayer_metrics.go index e788b60d53..af658ed29d 100644 --- a/rollup/internal/controller/relayer/l2_relayer_metrics.go +++ b/rollup/internal/controller/relayer/l2_relayer_metrics.go @@ -19,8 +19,8 @@ type l2RelayerMetrics struct { rollupL2BatchesCommittedConfirmedFailedTotal prometheus.Counter rollupL2BatchesFinalizedConfirmedTotal prometheus.Counter rollupL2BatchesFinalizedConfirmedFailedTotal prometheus.Counter - rollupL2UpdateL1GasOracleConfirmedTotal prometheus.Counter - rollupL2UpdateL1GasOracleConfirmedFailedTotal prometheus.Counter + rollupL2UpdateGasOracleConfirmedTotal prometheus.Counter + rollupL2UpdateGasOracleConfirmedFailedTotal prometheus.Counter rollupL2ChainMonitorLatestFailedCall prometheus.Counter rollupL2ChainMonitorLatestFailedBatchStatus prometheus.Counter } @@ -43,7 +43,7 @@ func initL2RelayerMetrics(reg prometheus.Registerer) *l2RelayerMetrics { }), rollupL2RelayerGasPriceOracleRunTotal: promauto.With(reg).NewCounter(prometheus.CounterOpts{ Name: "rollup_layer2_gas_price_oracle_run_total", - Help: "The total number of layer2 gas price oracle run total", + Help: "Total number of times the layer2 gas price oracle has been run", }), rollupL2RelayerLastGasPrice: promauto.With(reg).NewGauge(prometheus.GaugeOpts{ Name: "rollup_layer2_gas_price_latest_gas_price", @@ -77,13 +77,13 @@ func initL2RelayerMetrics(reg prometheus.Registerer) *l2RelayerMetrics { Name: "rollup_layer2_process_finalized_batches_confirmed_failed_total", Help: "The total number of layer2 process finalized batches confirmed failed total", }), - rollupL2UpdateL1GasOracleConfirmedTotal: promauto.With(reg).NewCounter(prometheus.CounterOpts{ + rollupL2UpdateGasOracleConfirmedTotal: promauto.With(reg).NewCounter(prometheus.CounterOpts{ Name: "rollup_layer2_update_layer1_gas_oracle_confirmed_total", - Help: "The total number of layer2 update layer1 gas oracle confirmed", + Help: "The total number of updating layer2 gas oracle confirmed", }), - rollupL2UpdateL1GasOracleConfirmedFailedTotal: promauto.With(reg).NewCounter(prometheus.CounterOpts{ + rollupL2UpdateGasOracleConfirmedFailedTotal: promauto.With(reg).NewCounter(prometheus.CounterOpts{ Name: "rollup_layer2_update_layer1_gas_oracle_confirmed_failed_total", - Help: "The total number of layer2 update layer1 gas oracle confirmed failed", + Help: "The total number of updating layer2 gas oracle confirmed failed", }), rollupL2ChainMonitorLatestFailedCall: promauto.With(reg).NewCounter(prometheus.CounterOpts{ Name: "rollup_layer2_chain_monitor_latest_failed_batch_call", diff --git a/rollup/internal/controller/sender/estimategas.go b/rollup/internal/controller/sender/estimategas.go index 235ec7499c..66708d3082 100644 --- a/rollup/internal/controller/sender/estimategas.go +++ b/rollup/internal/controller/sender/estimategas.go @@ -33,7 +33,7 @@ func (s *Sender) estimateLegacyGas(to *common.Address, value *big.Int, data []by }, nil } -func (s *Sender) estimateDynamicGas(to *common.Address, value *big.Int, input []byte, fallbackGasLimit uint64, baseFee uint64) (*FeeData, error) { +func (s *Sender) estimateDynamicGas(to *common.Address, value *big.Int, data []byte, fallbackGasLimit uint64, baseFee uint64) (*FeeData, error) { gasTipCap, err := s.client.SuggestGasTipCap(s.ctx) if err != nil { log.Error("estimateDynamicGas SuggestGasTipCap failure", "error", err) @@ -41,7 +41,7 @@ func (s *Sender) estimateDynamicGas(to *common.Address, value *big.Int, input [] } gasFeeCap := new(big.Int).Add(gasTipCap, new(big.Int).Mul(new(big.Int).SetUint64(baseFee), big.NewInt(2))) - gasLimit, accessList, err := s.estimateGasLimit(to, input, nil, gasTipCap, gasFeeCap, value, true) + gasLimit, accessList, err := s.estimateGasLimit(to, data, nil, gasTipCap, gasFeeCap, value, true) if err != nil { log.Error("estimateDynamicGas estimateGasLimit failure", "from", s.auth.From.String(), "nonce", s.auth.Nonce.Uint64(), "to address", to.String(), diff --git a/rollup/internal/orm/pending_transaction.go b/rollup/internal/orm/pending_transaction.go index c610ab858a..8e812c5609 100644 --- a/rollup/internal/orm/pending_transaction.go +++ b/rollup/internal/orm/pending_transaction.go @@ -29,9 +29,9 @@ type PendingTransaction struct { ContextID string `json:"context_id" gorm:"context_id"` Hash string `json:"hash" gorm:"hash"` Type uint8 `json:"type" gorm:"type"` - GasFeeCap string `json:"gas_fee_cap" gorm:"gas_fee_cap"` - GasTipCap string `json:"gas_tip_cap" gorm:"gas_tip_cap"` - GasPrice string `json:"gas_price" gorm:"gas_price"` + GasFeeCap uint64 `json:"gas_fee_cap" gorm:"gas_fee_cap"` + GasTipCap uint64 `json:"gas_tip_cap" gorm:"gas_tip_cap"` + GasPrice uint64 `json:"gas_price" gorm:"gas_price"` GasLimit uint64 `json:"gas_limit" gorm:"gas_limit"` Nonce uint64 `json:"nonce" gorm:"nonce"` SubmitBlockNumber uint64 `json:"submit_block_number" gorm:"submit_block_number"` @@ -95,9 +95,9 @@ func (o *PendingTransaction) InsertPendingTransaction(ctx context.Context, conte ContextID: contextID, Hash: tx.Hash().String(), Type: tx.Type(), - GasFeeCap: tx.GasFeeCap().String(), - GasTipCap: tx.GasTipCap().String(), - GasPrice: tx.GasPrice().String(), + GasFeeCap: tx.GasFeeCap().Uint64(), + GasTipCap: tx.GasTipCap().Uint64(), + GasPrice: tx.GasPrice().Uint64(), GasLimit: tx.Gas(), Nonce: tx.Nonce(), SubmitBlockNumber: submitBlockNumber,