diff --git a/cmd/flags/proposer.go b/cmd/flags/proposer.go index a04e966b9..80754460a 100644 --- a/cmd/flags/proposer.go +++ b/cmd/flags/proposer.go @@ -59,12 +59,6 @@ var ( Category: proposerCategory, Value: 3, } - MaxTierFee = &cli.Uint64Flag{ - Name: "tierFee.max", - Usage: "Fee max limit for all tier types. 0 means unlimited", - Value: 0, - Category: proposerCategory, - } // Proposing epoch related. ProposeInterval = &cli.DurationFlag{ Name: "epoch.interval", @@ -160,5 +154,4 @@ var ProposerFlags = MergeFlags(CommonFlags, []cli.Flag{ ProposerAssignmentHookAddress, BlobAllowed, L1BlockBuilderTip, - MaxTierFee, }, TxmgrFlags) diff --git a/proposer/config.go b/proposer/config.go index 33287ef42..bd5215abb 100644 --- a/proposer/config.go +++ b/proposer/config.go @@ -43,7 +43,6 @@ type Config struct { BlobAllowed bool TxmgrConfigs *txmgr.CLIConfig L1BlockBuilderTip *big.Int - MaxTierFee *big.Int } // NewConfigFromCliContext initializes a Config instance from @@ -121,6 +120,5 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { l1ProposerPrivKey, c, ), - MaxTierFee: new(big.Int).SetUint64(c.Uint64(flags.MaxTierFee.Name)), }, nil } diff --git a/proposer/proposer.go b/proposer/proposer.go index 5cb5ea79b..86ac048c0 100644 --- a/proposer/proposer.go +++ b/proposer/proposer.go @@ -124,7 +124,6 @@ func (p *Proposer) InitFromConfig(ctx context.Context, cfg *Config) (err error) cfg.MaxTierFeePriceBumps, proverAssignmentTimeout, requestProverServerTimeout, - cfg.MaxTierFee, ); err != nil { return err } diff --git a/proposer/prover_selector/eth_fee_eoa_selector.go b/proposer/prover_selector/eth_fee_eoa_selector.go index ce9e3dd5a..cd3a02fe1 100644 --- a/proposer/prover_selector/eth_fee_eoa_selector.go +++ b/proposer/prover_selector/eth_fee_eoa_selector.go @@ -41,7 +41,6 @@ type ETHFeeEOASelector struct { maxTierFeePriceBumpIterations uint64 proposalExpiry time.Duration requestTimeout time.Duration - MaxTierFee *big.Int } // NewETHFeeEOASelector creates a new ETHFeeEOASelector instance. @@ -57,7 +56,6 @@ func NewETHFeeEOASelector( maxTierFeePriceBumpIterations uint64, proposalExpiry time.Duration, requestTimeout time.Duration, - MaxTierFee *big.Int, ) (*ETHFeeEOASelector, error) { if len(proverEndpoints) == 0 { return nil, errEmptyProverEndpoints @@ -81,7 +79,6 @@ func NewETHFeeEOASelector( maxTierFeePriceBumpIterations, proposalExpiry, requestTimeout, - MaxTierFee, }, nil } @@ -101,7 +98,7 @@ func (s *ETHFeeEOASelector) AssignProver( maxProverFee = common.Big0 ) - // Deep copy + // Deep copy the tierFees slice. for i, fee := range tierFees { fees[i] = encoding.TierFee{Tier: fee.Tier, Fee: fee.Fee} } @@ -110,23 +107,19 @@ func (s *ETHFeeEOASelector) AssignProver( // If it is denied, we continue on to the next endpoint. // If we do not find a prover, we can increase the fee up to a point, or give up. for i := 0; i < int(s.maxTierFeePriceBumpIterations); i++ { - // Bump tier fee on each failed loop + // Bump tier fee on each failed loop. cumulativeBumpPercent := new(big.Int).Mul(s.tierFeePriceBump, new(big.Int).SetUint64(uint64(i))) for idx := range fees { if i > 0 { fee := new(big.Int).Mul(fees[idx].Fee, cumulativeBumpPercent) - tempFee := fees[idx].Fee.Add(fees[idx].Fee, fee.Div(fee, big100)) - if s.MaxTierFee.Cmp(common.Big0) > 0 && tempFee.Cmp(s.MaxTierFee) > 0 { - fees[idx].Fee = s.MaxTierFee - } else { - fees[idx].Fee = tempFee - } + fees[idx].Fee = fees[idx].Fee.Add(fees[idx].Fee, fee.Div(fee, big100)) } if fees[idx].Fee.Cmp(maxProverFee) > 0 { maxProverFee = fees[idx].Fee } } + // Try to assign a prover from all given endpoints. for _, endpoint := range s.shuffleProverEndpoints() { encodedAssignment, proverAddress, err := assignProver( ctx, diff --git a/proposer/prover_selector/eth_fee_eoa_selector_test.go b/proposer/prover_selector/eth_fee_eoa_selector_test.go index 00d087d5f..b108fd655 100644 --- a/proposer/prover_selector/eth_fee_eoa_selector_test.go +++ b/proposer/prover_selector/eth_fee_eoa_selector_test.go @@ -46,7 +46,6 @@ func (s *ProverSelectorTestSuite) SetupTest() { 32, 1*time.Minute, 1*time.Minute, - common.Big32, ) s.Nil(err) } diff --git a/proposer/transaction_builder/common_test.go b/proposer/transaction_builder/common_test.go index 091819a0e..034236d2d 100644 --- a/proposer/transaction_builder/common_test.go +++ b/proposer/transaction_builder/common_test.go @@ -43,7 +43,6 @@ func (s *TransactionBuilderTestSuite) SetupTest() { 32, 1*time.Minute, 1*time.Minute, - common.Big0, ) s.Nil(err) s.calldataTxBuilder = NewCalldataTransactionBuilder(