File tree Expand file tree Collapse file tree 3 files changed +35
-9
lines changed
Expand file tree Collapse file tree 3 files changed +35
-9
lines changed Original file line number Diff line number Diff line change 44
55pragma solidity >= 0.4.21 < 0.9.0 ;
66
7+ import {ArbResourceConstraintsTypes} from "./ArbResourceConstraintsTypes.sol " ;
8+
79/**
810 * @title Provides owners with tools for managing the rollup.
911 * @notice Calls by non-owners will always revert.
@@ -256,21 +258,13 @@ interface ArbOwner {
256258 bool enable
257259 ) external ;
258260
259- /// @notice A pair representing a resource kind and its weight in constraint calculations.
260- /// @param resource the resource kind (see Nitro documentation for list of resources)
261- /// @param weight the relative weight of this resource in the constraint
262- struct ResourceWeight {
263- uint8 resource;
264- uint64 weight;
265- }
266-
267261 /// @notice Adds or updates a resource constraint
268262 /// @notice Available on ArbOS version 50 and above
269263 /// @param resources an array of (resource, weight) pairs
270264 /// @param periodSecs the time window for the constraint
271265 /// @param targetPerSec allowed usage per second across weighted resources
272266 function setResourceConstraint (
273- ResourceWeight[] calldata resources ,
267+ ArbResourceConstraintsTypes. ResourceWeight[] calldata resources ,
274268 uint32 periodSecs ,
275269 uint64 targetPerSec
276270 ) external ;
Original file line number Diff line number Diff line change 44
55pragma solidity >= 0.4.21 < 0.9.0 ;
66
7+ import {ArbResourceConstraintsTypes} from "./ArbResourceConstraintsTypes.sol " ;
8+
79/// @title Provides non-owners with info about the current chain owners.
810/// @notice Precompiled contract that exists in every Arbitrum chain at 0x000000000000000000000000000000000000006b.
911interface ArbOwnerPublic {
@@ -55,4 +57,11 @@ interface ArbOwnerPublic {
5557 function isCalldataPriceIncreaseEnabled () external view returns (bool );
5658
5759 event ChainOwnerRectified (address rectifiedOwner );
60+
61+ /// @notice Lists all resource constraints currently configured in ArbOS.
62+ /// @notice Available on ArbOS version 50 and above
63+ function listResourceConstraints ()
64+ external
65+ view
66+ returns (ArbResourceConstraintsTypes.ResourceConstraint[] memory constraints );
5867}
Original file line number Diff line number Diff line change 1+ // Copyright 2025, Offchain Labs, Inc.
2+ // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
3+ // SPDX-License-Identifier: BUSL-1.1
4+
5+ pragma solidity >= 0.4.21 < 0.9.0 ;
6+
7+ /// @title ArbResourceConstraintsTypes
8+ /// @notice Resource constraints type definitions used by ArbOwner and ArbOwnerPublic precompiles.
9+ library ArbResourceConstraintsTypes {
10+ /// @notice A pair representing a resource kind and its weight in constraint calculations.
11+ struct ResourceWeight {
12+ uint8 resource;
13+ uint64 weight;
14+ }
15+
16+ /// @notice A constraint describing limits for a set of weighted resources.
17+ struct ResourceConstraint {
18+ ResourceWeight[] resources;
19+ uint32 periodSecs;
20+ uint64 targetPerSec;
21+ uint64 backlog;
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments