diff --git a/arbos/l1pricing/l1PricingOldVersions.go b/arbos/l1pricing/l1PricingOldVersions.go index 24b13153fd..19a0c6f07e 100644 --- a/arbos/l1pricing/l1PricingOldVersions.go +++ b/arbos/l1pricing/l1PricingOldVersions.go @@ -123,9 +123,8 @@ func (ps *L1PricingState) _preversion10_UpdateForBatchPosterSpending( if err != nil { return err } - l1PricerRewards, _ := paymentForRewards.Float64() l1RewardsDistributionCounter.Inc(1) - l1RewardsDistribution.Update(l1PricerRewards) + l1RewardsDistribution.Inc(paymentForRewards.Int64()) availableFunds = statedb.GetBalance(L1PricerFundsPoolAddress) // settle up payments owed to the batch poster, as much as possible @@ -148,9 +147,8 @@ func (ps *L1PricingState) _preversion10_UpdateForBatchPosterSpending( if err != nil { return err } - l1PricerDue, _ := balanceToTransfer.Float64() l1BaseFeeDueDistributionCounter.Inc(1) - l1BaseFeeDueDistribution.Update(l1PricerDue) + l1BaseFeeDueDistribution.Inc(balanceToTransfer.Int64()) balanceDueToPoster = am.BigSub(balanceDueToPoster, balanceToTransfer) err = posterState.SetFundsDue(balanceDueToPoster) if err != nil { @@ -308,9 +306,8 @@ func (ps *L1PricingState) _preVersion2_UpdateForBatchPosterSpending( if err != nil { return err } - l1PricerRewards, _ := paymentForRewards.Float64() l1RewardsDistributionCounter.Inc(1) - l1RewardsDistribution.Update(l1PricerRewards) + l1RewardsDistribution.Inc(paymentForRewards.Int64()) availableFunds = am.BigSub(availableFunds, paymentForRewards) // settle up our batch poster payments owed, as much as possible @@ -342,9 +339,8 @@ func (ps *L1PricingState) _preVersion2_UpdateForBatchPosterSpending( if err != nil { return err } - l1PricerDue, _ := balanceToTransfer.Float64() l1BaseFeeDueDistributionCounter.Inc(1) - l1BaseFeeDueDistribution.Update(l1PricerDue) + l1BaseFeeDueDistribution.Inc(balanceToTransfer.Int64()) availableFunds = am.BigSub(availableFunds, balanceToTransfer) balanceDueToPoster = am.BigSub(balanceDueToPoster, balanceToTransfer) err = poster.SetFundsDue(balanceDueToPoster) diff --git a/arbos/l1pricing/l1pricing.go b/arbos/l1pricing/l1pricing.go index 6a8dc280cf..b8860fd674 100644 --- a/arbos/l1pricing/l1pricing.go +++ b/arbos/l1pricing/l1pricing.go @@ -59,9 +59,9 @@ var ( var ( l1RewardsDistributionCounter = metrics.NewRegisteredCounter("arbos/l1_rewards_recipient/rewards_counter", nil) - l1RewardsDistribution = metrics.NewRegisteredGaugeFloat64("arbos/l1_rewards_recipient/rewards_distribution", nil) + l1RewardsDistribution = metrics.NewRegisteredCounter("arbos/l1_rewards_recipient/rewards_distribution", nil) l1BaseFeeDueDistributionCounter = metrics.NewRegisteredCounter("arbos/batchposter_fee_collector/due_counter", nil) - l1BaseFeeDueDistribution = metrics.NewRegisteredGaugeFloat64("arbos/batchposter_fee_collector/due_distribution", nil) + l1BaseFeeDueDistribution = metrics.NewRegisteredCounter("arbos/batchposter_fee_collector/due_distribution", nil) ) const ( @@ -422,9 +422,8 @@ func (ps *L1PricingState) UpdateForBatchPosterSpending( if err != nil { return err } - batchPosterRewards, _ := paymentForRewards.Float64() l1RewardsDistributionCounter.Inc(1) - l1RewardsDistribution.Update(batchPosterRewards) + l1RewardsDistribution.Inc(paymentForRewards.Int64()) // settle up payments owed to the batch poster, as much as possible balanceDueToPoster, err := posterState.FundsDue() @@ -446,9 +445,8 @@ func (ps *L1PricingState) UpdateForBatchPosterSpending( if err != nil { return err } - batchPosterRefunds, _ := balanceToTransfer.Float64() l1BaseFeeDueDistributionCounter.Inc(1) - l1BaseFeeDueDistribution.Update(batchPosterRefunds) + l1BaseFeeDueDistribution.Inc(balanceToTransfer.Int64()) balanceDueToPoster = am.BigSub(balanceDueToPoster, balanceToTransfer) err = posterState.SetFundsDue(balanceDueToPoster) if err != nil { diff --git a/arbos/tx_processor.go b/arbos/tx_processor.go index c495103a64..9f1e905993 100644 --- a/arbos/tx_processor.go +++ b/arbos/tx_processor.go @@ -30,9 +30,9 @@ import ( var ( infraFeeDistributionCounter = metrics.NewRegisteredCounter("arbos/infra_fee/counter", nil) - infraFeeDistribution = metrics.NewRegisteredGaugeFloat64("arbos/infra_fee/distribution", nil) + infraFeeDistribution = metrics.NewRegisteredCounter("arbos/infra_fee/distribution", nil) networkFeeDistributionCounter = metrics.NewRegisteredCounter("arbos/network_fee/counter", nil) - networkFeeDistribution = metrics.NewRegisteredGaugeFloat64("arbos/network_fee/distribution", nil) + networkFeeDistribution = metrics.NewRegisteredCounter("arbos/network_fee/distribution", nil) ) var arbosAddress = types.ArbosAddress @@ -580,14 +580,12 @@ func (p *TxProcessor) EndTxHook(gasLeft uint64, success bool) { infraRefund = takeFunds(networkRefund, infraRefund) refund(infraFeeAccount, infraRefund) infraFeeDistributionCounter.Inc(1) - infraFeeDistributed, _ := infraRefund.Float64() - infraFeeDistribution.Update(infraFeeDistributed) + infraFeeDistribution.Inc(infraRefund.Int64()) } } refund(networkFeeAccount, networkRefund) - networkFeeDistributed, _ := networkRefund.Float64() networkFeeDistributionCounter.Inc(1) - networkFeeDistribution.Update(networkFeeDistributed) + networkFeeDistribution.Inc(networkRefund.Int64()) if success { // we don't want to charge for this