Skip to content

Commit 44494b0

Browse files
Remove count limit for gas constraints
1 parent fcdc746 commit 44494b0

4 files changed

Lines changed: 16 additions & 18 deletions

File tree

arbos/l2pricing/l2pricing.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ var multigasConstraintsKey []byte = []byte{1}
4646

4747
const GethBlockGasLimit = 1 << 50
4848

49-
// TODO(NIT-4152): Number of constraints limited because of retryable redeem gas cost calculation.
50-
const GasConstraintsMaxNum = 20
51-
const MultiGasConstraintsMaxNum = 15
52-
5349
// MaxPricingExponentBips caps the basefee growth: exp(8.5) ~= x5,000 min base fee.
5450
const MaxPricingExponentBips = arbmath.Bips(85_000)
5551

precompiles/ArbOwner.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -467,13 +467,6 @@ func (con ArbOwner) SetGasPricingConstraints(c ctx, evm mech, constraints [][3]u
467467
return fmt.Errorf("failed to clear existing constraints: %w", err)
468468
}
469469

470-
if c.State.ArbOSVersion() >= params.ArbosVersion_MultiConstraintFix {
471-
limit := l2pricing.GasConstraintsMaxNum
472-
if len(constraints) > limit {
473-
return fmt.Errorf("too many constraints. Max: %d", limit)
474-
}
475-
}
476-
477470
for _, constraint := range constraints {
478471
gasTargetPerSecond := constraint[0]
479472
adjustmentWindowSeconds := constraint[1]
@@ -497,11 +490,6 @@ func (con ArbOwner) SetMultiGasPricingConstraints(
497490
evm mech,
498491
constraints []MultiGasConstraint,
499492
) error {
500-
limit := l2pricing.MultiGasConstraintsMaxNum
501-
if len(constraints) > limit {
502-
return fmt.Errorf("too many constraints. Max: %d", limit)
503-
}
504-
505493
if err := c.State.L2PricingState().ClearMultiGasConstraints(); err != nil {
506494
return fmt.Errorf("failed to clear existing multi-gas constraints: %w", err)
507495
}

precompiles/ArbRetryableTx_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func TestRetryableRedeemWithSingleGasConstraints(t *testing.T) {
120120
evm := newMockEVMForTesting()
121121
precompileCtx := testContext(common.Address{}, evm)
122122

123-
for i := range l2pricing.GasConstraintsMaxNum {
123+
for i := range 20 {
124124
// #nosec G115
125125
target0 := uint64((i + 1) * 1000000)
126126
// #nosec G115
@@ -155,7 +155,7 @@ func TestRetryableRedeemWithMultiGasConstraints(t *testing.T) {
155155
err := sto.SetByUint64(versionSlot, common.BigToHash(version))
156156
Require(t, err)
157157

158-
for i := range l2pricing.MultiGasConstraintsMaxNum {
158+
for i := range 100 {
159159
// #nosec G115
160160
target := uint64((i + 1) * 1000000)
161161
// #nosec G115

system_tests/retryable_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,8 +1297,22 @@ func TestL1FundedUnsignedTransaction(t *testing.T) {
12971297
}
12981298

12991299
func TestRetryableSubmissionAndRedeemFees(t *testing.T) {
1300+
testRetryableSubmissionAndRedeemFees(t, nil)
1301+
}
1302+
1303+
func TestRetryableSubmissionAndRedeemFeesArbOS60(t *testing.T) {
1304+
version := params.ArbosVersion_60
1305+
testRetryableSubmissionAndRedeemFees(t, &version)
1306+
}
1307+
1308+
func testRetryableSubmissionAndRedeemFees(t *testing.T, arbosVersion *uint64) {
1309+
t.Helper()
1310+
13001311
builder, delayedInbox, lookupL2Tx, ctx, teardown := retryableSetup(t, func(b *NodeBuilder) {
13011312
b.WithDatabase(rawdb.DBPebble)
1313+
if arbosVersion != nil {
1314+
b.WithArbOSVersion(*arbosVersion)
1315+
}
13021316
})
13031317
defer teardown()
13041318
infraFeeAddr, networkFeeAddr := setupFeeAddresses(t, ctx, builder)

0 commit comments

Comments
 (0)