From b13351237007064a1a46a6a1753f6d97791394db Mon Sep 17 00:00:00 2001 From: Rachel Bousfield Date: Wed, 9 Aug 2023 21:29:53 -0600 Subject: [PATCH] updates the types used to configure stylus parameters --- src/precompiles/ArbOwner.sol | 10 ++++------ src/precompiles/ArbWasm.sol | 18 +++++++----------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/precompiles/ArbOwner.sol b/src/precompiles/ArbOwner.sol index 42c7a991..4c59e686 100644 --- a/src/precompiles/ArbOwner.sol +++ b/src/precompiles/ArbOwner.sol @@ -86,20 +86,18 @@ interface ArbOwner { // @notice Releases surplus funds from L1PricerFundsPoolAddress for use function releaseL1PricerSurplusFunds(uint256 maxWeiToRelease) external returns (uint256); - // @notice sets the price (in evm gas basis points) of ink - function setInkPrice(uint64 price) external; + // @notice sets the amount of ink 1 gas buys + // @param price the conversion rate (must fit in a uint24) + function setInkPrice(uint32 price) external; // @notice sets the maximum depth (in wasm words) a wasm stack may grow function setWasmMaxDepth(uint32 depth) external; - // @notice sets the cost of starting a stylus hostio call - function setWasmHostioInk(uint64 ink) external; - // @notice sets the number of free wasm pages a tx gets function setWasmFreePages(uint16 pages) external; // @notice sets the base cost of each additional wasm page - function setWasmPageGas(uint32 gas) external; + function setWasmPageGas(uint16 gas) external; // @notice sets the ramp that drives exponential wasm memory costs function setWasmPageRamp(uint64 ramp) external; diff --git a/src/precompiles/ArbWasm.sol b/src/precompiles/ArbWasm.sol index 18dabead..f1a364df 100644 --- a/src/precompiles/ArbWasm.sol +++ b/src/precompiles/ArbWasm.sol @@ -12,35 +12,31 @@ interface ArbWasm { // @notice compile a wasm program // @param program the program to compile // @return version the stylus version the program was compiled against - function compileProgram(address program) external returns (uint32 version); + function compileProgram(address program) external returns (uint16 version); // @notice gets the latest stylus version // @return version the stylus version - function stylusVersion() external view returns (uint32 version); + function stylusVersion() external view returns (uint16 version); // @notice gets the stylus version the program was most recently compiled against. // @return version the program version (0 for EVM contracts) - function programVersion(address program) external view returns (uint32 version); + function programVersion(address program) external view returns (uint16 version); // @notice gets the conversion rate between gas and ink - // @return price the price (in evm gas basis points) of ink - function inkPrice() external view returns (uint64 price); + // @return price the amount of ink 1 gas buys + function inkPrice() external view returns (uint32 price); // @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); - // @notice gets the fixed-cost overhead needed to initiate a hostio call - // @return ink the cost of starting a stylus hostio call - function wasmHostioInk() external view returns (uint64 ink); - // @notice gets the number of free wasm pages a program gets // @return pages the number of wasm pages (2^16 bytes) function freePages() external view returns (uint16 pages); // @notice gets the base cost of each additional wasm page (2^16 bytes) // @return gas base amount of gas needed to grow another wasm page - function pageGas() external view returns (uint32 gas); + function pageGas() external view returns (uint16 gas); // @notice gets the ramp that drives exponential memory costs // @return ramp bits representing the floating point value @@ -51,6 +47,6 @@ interface ArbWasm { function pageLimit() external view returns (uint16 limit); error ProgramNotCompiled(); - error ProgramOutOfDate(uint32 version); + error ProgramOutOfDate(uint16 version); error ProgramUpToDate(); }