Skip to content

Commit

Permalink
Merge pull request #9 from OffchainLabs/call-scalar
Browse files Browse the repository at this point in the history
Add `setWasmCallScalar`
  • Loading branch information
rachel-bousfield authored Aug 13, 2023
2 parents 671960b + 3dd01da commit a8c564e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/precompiles/ArbOwner.sol
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ interface ArbOwner {
function setInkPrice(uint32 price) external;

// @notice sets the maximum depth (in wasm words) a wasm stack may grow
function setWasmMaxDepth(uint32 depth) external;
function setWasmMaxStackDepth(uint32 depth) external;

// @notice sets the number of free wasm pages a tx gets
function setWasmFreePages(uint16 pages) external;
Expand All @@ -105,6 +105,9 @@ interface ArbOwner {
// @notice sets the maximum number of pages a wasm may allocate
function setWasmPageLimit(uint16 limit) external view;

// @notice sets the added wasm call cost based on binary size
function setWasmCallScalar(uint16 gas) external view;

/// @notice Sets serialized chain config in ArbOS state
function setChainConfig(string calldata chainConfig) external;

Expand Down
6 changes: 5 additions & 1 deletion src/precompiles/ArbWasm.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface ArbWasm {

// @notice gets the wasm stack size limit
// @return depth the maximum depth (in wasm words) a wasm stack may grow
function wasmMaxDepth() external view returns (uint32 depth);
function maxStackDepth() external view returns (uint32 depth);

// @notice gets the number of free wasm pages a program gets
// @return pages the number of wasm pages (2^16 bytes)
Expand All @@ -46,6 +46,10 @@ interface ArbWasm {
// @return limit the number of pages
function pageLimit() external view returns (uint16 limit);

// @notice gets the added wasm call cost based on binary size
// @return gas cost paid per half kb uncompressed.
function callScalar() external view returns (uint16 gas);

error ProgramNotCompiled();
error ProgramOutOfDate(uint16 version);
error ProgramUpToDate();
Expand Down

0 comments on commit a8c564e

Please sign in to comment.