Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions ArbAggregator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ interface ArbAggregator {
/// This reverts unless called by the batch poster, its fee collector, or a chain owner
/// @param batchPoster The batch poster to set the fee collector for
/// @param newFeeCollector The new fee collector to set
function setFeeCollector(address batchPoster, address newFeeCollector) external;
function setFeeCollector(
address batchPoster,
address newFeeCollector
) external;

/// @notice Deprecated, always returns zero
/// @notice Get the tx base fee (in approximate L1 gas) for aggregator
Expand All @@ -56,5 +59,8 @@ interface ArbAggregator {
/// Revert if feeInL1Gas is outside the chain's allowed bounds
/// @param aggregator The aggregator to set the fee for
/// @param feeInL1Gas The base fee in L1 gas
function setTxBaseFee(address aggregator, uint256 feeInL1Gas) external;
function setTxBaseFee(
address aggregator,
uint256 feeInL1Gas
) external;
}
5 changes: 4 additions & 1 deletion ArbDebug.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ interface ArbDebug {
function becomeChainOwner() external;

/// @notice Emit events with values based on the args provided
function events(bool flag, bytes32 value) external payable returns (address, uint256);
function events(
bool flag,
bytes32 value
) external payable returns (address, uint256);

/// @notice Tries (and fails) to emit logs in a view context
function eventsView() external view;
Expand Down
5 changes: 4 additions & 1 deletion ArbFunctionTable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ interface ArbFunctionTable {
) external view returns (uint256);

/// @notice No-op
function get(address addr, uint256 index) external view returns (uint256, bool, uint256);
function get(
address addr,
uint256 index
) external view returns (uint256, bool, uint256);
}
13 changes: 13 additions & 0 deletions ArbGasInfo.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ interface ArbGasInfo {

/// @notice Get the gas accounting parameters. `gasPoolMax` is always zero, as the exponential pricing model has no such notion.
/// @return (speedLimitPerSecond, gasPoolMax, maxBlockGasLimit)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the other two values gasPoolMax, maxBlockGasLimit, should we add methods for them?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that for the new model all these fields should be zeros. If confirmed, I'll update the comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See OffchainLabs/nitro#3860 (comment)

I think we should have another method that returns just the maxBlockGasLimit.

    /// @notice Get the maxBlockGasLimit
    /// @notice Available in ArbOS version 50 and above
    function getMaxBlockGasLimit() external view returns (uint256);

/// @dev Deprecated starting from ArbOS version 50.
function getGasAccountingParams() external view returns (uint256, uint256, uint256);

/// @notice Get the maxTxGasLimit
Expand Down Expand Up @@ -80,12 +81,15 @@ interface ArbGasInfo {
function getCurrentTxL1GasFees() external view returns (uint256);

/// @notice Get the backlogged amount of gas burnt in excess of the speed limit
/// @dev Deprecated starting from ArbOS version 50.
function getGasBacklog() external view returns (uint64);

/// @notice Get how slowly ArbOS updates the L2 basefee in response to backlogged gas
/// @dev Deprecated starting from ArbOS version 50.
function getPricingInertia() external view returns (uint64);

/// @notice Get the forgivable amount of backlogged gas ArbOS will ignore when raising the basefee
/// @dev Deprecated starting from ArbOS version 50.
function getGasBacklogTolerance() external view returns (uint64);

/// @notice Returns the surplus of funds for L1 batch posting payments (may be negative).
Expand Down Expand Up @@ -120,4 +124,13 @@ interface ArbGasInfo {
/// @notice Returns the L1 pricing surplus as of the last update (may be negative).
/// @notice Available in ArbOS version 20 and above
function getLastL1PricingSurplus() external view returns (int256);

/// @notice Get the current gas pricing constraints used by the Multi-Constraint Pricer.
/// @notice Each constraint contains:
/// - uint64 gas_target (in gas/second)
/// - uint64 time_constant (in seconds)
/// - uint64 backlog (in gas units)
/// @return constraints Array of triples (gas_target_per_second, time_constant_seconds, backlog)
/// @notice Available in ArbOS version 50 and above.
function getGasPricingConstraints() external view returns (uint64[3][] memory constraints);
}
24 changes: 22 additions & 2 deletions ArbOwner.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ interface ArbOwner {
) external;

/// @notice Set the computational speed limit for the chain
/// @dev Deprecated starting from ArbOS version 50.
/// Replaced by `setGasPricingConstraints`, which supports multiple constraints.
function setSpeedLimit(
uint64 limit
) external;
Expand All @@ -93,11 +95,15 @@ interface ArbOwner {
) external;

/// @notice Set the L2 gas pricing inertia
/// @dev Deprecated starting from ArbOS version 50.
/// Replaced by `setGasPricingConstraints`, which supports multiple constraints.
function setL2GasPricingInertia(
uint64 sec
) external;

/// @notice Set the L2 gas backlog tolerance
/// @dev Deprecated starting from ArbOS version 50.
/// Ignored by the Multi-Constraint Pricer model.
function setL2GasBacklogTolerance(
uint64 sec
) external;
Expand All @@ -121,7 +127,10 @@ interface ArbOwner {
) external;

/// @notice Upgrades ArbOS to the requested version at the requested timestamp
function scheduleArbOSUpgrade(uint64 newVersion, uint64 timestamp) external;
function scheduleArbOSUpgrade(
uint64 newVersion,
uint64 timestamp
) external;

/// @notice Sets equilibration units parameter for L1 price adjustment algorithm
function setL1PricingEquilibrationUnits(
Expand Down Expand Up @@ -217,7 +226,10 @@ interface ArbOwner {
/// @notice Available in ArbOS version 30 and above
/// @param gas amount of gas paid in increments of 256 when not the program is not cached
/// @param cached amount of gas paid in increments of 64 when the program is cached
function setWasmMinInitGas(uint8 gas, uint16 cached) external;
function setWasmMinInitGas(
uint8 gas,
uint16 cached
) external;

/// @notice Sets the linear adjustment made to program init costs.
/// @notice Available in ArbOS version 30 and above
Expand Down Expand Up @@ -268,6 +280,14 @@ interface ArbOwner {
bool enable
) external;

/// @notice Sets the list of gas pricing constraints for the Multi-Constraint Pricer.
/// @notice Replaces existing constraints configuration and resets all backlogs to zero.
/// @notice Available in ArbOS version 50 and above.
/// @param constraints Array of pairs (gas_target_per_second, time_constant_seconds)
function setGasPricingConstraints(
uint64[2][] calldata constraints
) external;

/// Emitted when a successful call is made to this precompile
event OwnerActs(bytes4 indexed method, address indexed owner, bytes data);
}
5 changes: 1 addition & 4 deletions ArbStatistics.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@ interface ArbStatistics {
/// Number of transaction receipt issued,
/// Number of contracts created,
/// )
function getStats()
external
view
returns (uint256, uint256, uint256, uint256, uint256, uint256);
function getStats() external view returns (uint256, uint256, uint256, uint256, uint256, uint256);
}