Skip to content

Commit edd0528

Browse files
Add backlog to setGasPricingConstraints and improve comments
1 parent f169671 commit edd0528

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

ArbGasInfo.sol

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ interface ArbGasInfo {
4949
function getPricesInArbGas() external view returns (uint256, uint256, uint256);
5050

5151
/// @notice Get the gas accounting parameters. `gasPoolMax` is always zero, as the exponential pricing model has no such notion.
52+
/// @notice Starting from ArbOS version 50, returns `speedLimitPerSecond` as the target from the longest-period constraint.
53+
/// @notice For new integrations, prefer `getMaxBlockGasLimit` and `getGasPricingConstraints`.
5254
/// @return (speedLimitPerSecond, gasPoolMax, maxBlockGasLimit)
5355
/// @dev Deprecated starting from ArbOS version 50.
5456
function getGasAccountingParams() external view returns (uint256, uint256, uint256);
@@ -81,14 +83,20 @@ interface ArbGasInfo {
8183
function getCurrentTxL1GasFees() external view returns (uint256);
8284

8385
/// @notice Get the backlogged amount of gas burnt in excess of the speed limit
86+
/// @notice Starting from ArbOS version 50, returns the backlog of the longest-period constraint among all configured constraints.
87+
/// @notice For new integrations, prefer `getGasPricingConstraints`.
8488
/// @dev Deprecated starting from ArbOS version 50.
8589
function getGasBacklog() external view returns (uint64);
8690

8791
/// @notice Get how slowly ArbOS updates the L2 basefee in response to backlogged gas
92+
/// @notice Starting from ArbOS version 50, returns the inertia value derived from the longest-period constraint
93+
/// @notice For new integrations, prefer `getGasPricingConstraints`.
8894
/// @dev Deprecated starting from ArbOS version 50.
8995
function getPricingInertia() external view returns (uint64);
9096

9197
/// @notice Get the forgivable amount of backlogged gas ArbOS will ignore when raising the basefee
98+
/// @notice Starting from ArbOS version 50, this function always returns zero.
99+
/// @notice There is no tolerance for backlogged gas in the new pricing model.
92100
/// @dev Deprecated starting from ArbOS version 50.
93101
function getGasBacklogTolerance() external view returns (uint64);
94102

@@ -130,10 +138,10 @@ interface ArbGasInfo {
130138
function getMaxBlockGasLimit() external view returns (uint64);
131139

132140
/// @notice Get the current gas pricing constraints used by the Multi-Constraint Pricer.
133-
/// @notice Each constraint contains:
134-
/// - uint64 gas_target (in gas/second)
135-
/// - uint64 time_constant (in seconds)
136-
/// - uint64 backlog (in gas units)
141+
/// @notice Each constraint contains the following values:
142+
/// - `uint64 gas_target_per_second`: target gas usage per second
143+
/// - `uint64 time_constant_seconds`: time constant in seconds
144+
/// - `uint64 backlog`: current backlog in gas units
137145
/// @return constraints Array of triples (gas_target_per_second, time_constant_seconds, backlog)
138146
/// @notice Available in ArbOS version 50 and above.
139147
function getGasPricingConstraints() external view returns (uint64[3][] memory constraints);

ArbOwner.sol

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ interface ArbOwner {
7777
) external;
7878

7979
/// @notice Set the computational speed limit for the chain
80+
/// @notice Starting from ArbOS version 50, this function always returns an error.
81+
/// @notice Use `setGasPricingConstraints` instead, which supports configuring multiple constraints.
8082
/// @dev Deprecated starting from ArbOS version 50.
81-
/// Replaced by `setGasPricingConstraints`, which supports multiple constraints.
8283
function setSpeedLimit(
8384
uint64 limit
8485
) external;
@@ -95,15 +96,17 @@ interface ArbOwner {
9596
) external;
9697

9798
/// @notice Set the L2 gas pricing inertia
99+
/// @notice Starting from ArbOS version 50, this function always returns an error.
100+
/// @notice Use `setGasPricingConstraints` instead, which supports configuring multiple constraints.
98101
/// @dev Deprecated starting from ArbOS version 50.
99-
/// Replaced by `setGasPricingConstraints`, which supports multiple constraints.
100102
function setL2GasPricingInertia(
101103
uint64 sec
102104
) external;
103105

104106
/// @notice Set the L2 gas backlog tolerance
107+
/// @notice Starting from ArbOS version 50, this function always returns an error.
108+
/// @notice Use `setGasPricingConstraints` instead, which supports configuring multiple constraints.
105109
/// @dev Deprecated starting from ArbOS version 50.
106-
/// Ignored by the Multi-Constraint Pricer model.
107110
function setL2GasBacklogTolerance(
108111
uint64 sec
109112
) external;
@@ -281,11 +284,15 @@ interface ArbOwner {
281284
) external;
282285

283286
/// @notice Sets the list of gas pricing constraints for the Multi-Constraint Pricer.
284-
/// @notice Replaces existing constraints configuration and resets all backlogs to zero.
287+
/// @notice Replaces the existing constraints configuration and sets each constraint's starting backlog value.
288+
/// @notice All existing backlogs are replaced by the provided values.
289+
/// @notice Any changes to gas targets, periods, or starting backlogs may cause immediate price fluctuations.
290+
/// @notice Operators are fully responsible for the resulting behavior and should adjust parameters carefully.
291+
/// @notice Use ArbGasInfo.getGasPricingConstraints() to retrieve the current configuration.
285292
/// @notice Available in ArbOS version 50 and above.
286-
/// @param constraints Array of pairs (gas_target_per_second, time_constant_seconds)
293+
/// @param constraints Array of triples (gas_target_per_second, period_seconds, starting_backlog_value)
287294
function setGasPricingConstraints(
288-
uint64[2][] calldata constraints
295+
uint64[3][] calldata constraints
289296
) external;
290297

291298
/// Emitted when a successful call is made to this precompile

0 commit comments

Comments
 (0)