-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
maint: add interfaces for cannon contracts
- Loading branch information
1 parent
ebdae42
commit e66cdd6
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
packages/contracts-bedrock/src/cannon/interfaces/IMIPS.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.15; | ||
|
||
import { ISemver } from "src/universal/ISemver.sol"; | ||
import { IPreimageOracle } from "src/cannon/interfaces/IPreimageOracle.sol"; | ||
|
||
/// @title IMIPS | ||
/// @notice Interface for MIPS. | ||
interface IMIPS is ISemver { | ||
/// @notice Getter for the pre-image oracle contract. | ||
/// @return oracle_ The PreimageOracle contract. | ||
function oracle() external view returns (IPreimageOracle oracle_); | ||
|
||
/// @notice Executes a single step of the VM. | ||
/// Will revert if any required input state is missing. | ||
/// @param _stateData The encoded state witness data. | ||
/// @param _proof The encoded proof data for leaves within the MIPS VM's memory. | ||
/// @param _localContext The local key context for the preimage oracle. Optional, can be set as a constant | ||
/// if the caller only requires one set of local keys. | ||
/// @return The hashed MIPS state. | ||
function step(bytes calldata _stateData, bytes calldata _proof, bytes32 _localContext) external returns (bytes32); | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/contracts-bedrock/src/cannon/interfaces/IMIPS2.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.15; | ||
|
||
import { ISemver } from "src/universal/ISemver.sol"; | ||
|
||
/// @title IMIPS2 | ||
/// @notice Interface for MIPS2. | ||
interface IMIPS2 is ISemver { | ||
/// @notice Executes a single step of the multi-threaded vm. | ||
/// Will revert if any required input state is missing. | ||
/// @param _stateData The encoded state witness data. | ||
/// @param _proof The encoded proof data: <<thread_context, inner_root>, <memory proof>. | ||
/// Contains the thread context witness and the memory proof data for leaves within the MIPS VM's memory. | ||
/// The thread context witness is a packed tuple of the thread context and the immediate inner root of the current thread stack. | ||
/// @param _localContext The local key context for the preimage oracle. Optional, can be set as a constant | ||
/// if the caller only requires one set of local keys. | ||
function step(bytes calldata _stateData, bytes calldata _proof, bytes32 _localContext) external returns (bytes32); | ||
} |