-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: call verifier gateway, add deployment instructions, example env for prover network #13
Merged
Merged
Changes from 3 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b30e416
feat: call verifier, update sp1 version
mattstam 5383962
update sp1
mattstam 650f525
update sp1 2
mattstam d12975a
new api
mattstam 2718dc8
evm message
mattstam 9430fb3
use dev api
mattstam 45c46d8
vkey script + deployment steps
mattstam 01fb7d1
comment
mattstam 79555ec
cleanup
mattstam bd96076
default-run
mattstam 327b36e
nit
mattstam f86d7f9
example env for prover network
mattstam 8cc050d
default mock
mattstam 02c819b
reset to tag = "v1.0.7-testnet"
mattstam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
[submodule "contracts/lib/forge-std"] | ||
path = contracts/lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
tag = v1.8.2 | ||
[submodule "contracts/lib/sp1-contracts"] | ||
path = contracts/lib/sp1-contracts | ||
url = https://github.com/succinctlabs/sp1-contracts | ||
tag = main |
Submodule forge-std
updated
13 files
+6 −12 | .github/workflows/ci.yml | |
+3 −1 | .github/workflows/sync.yml | |
+2 −2 | foundry.toml | |
+1 −1 | package.json | |
+1 −1 | src/StdAssertions.sol | |
+17 −8 | src/StdChains.sol | |
+18 −3 | src/StdInvariant.sol | |
+1 −1 | src/StdUtils.sol | |
+131 −6 | src/Vm.sol | |
+1 −5 | src/mocks/MockERC721.sol | |
+12 −7 | test/StdChains.t.sol | |
+1 −1 | test/StdCheats.t.sol | |
+2 −2 | test/Vm.t.sol |
Submodule sp1-contracts
updated
31 files
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 |
---|---|---|
@@ -1,32 +1,39 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.13; | ||
pragma solidity ^0.8.20; | ||
|
||
import {SP1Verifier} from "@sp1-contracts/SP1Verifier.sol"; | ||
import {ISP1Verifier} from "@sp1-contracts/ISP1Verifier.sol"; | ||
|
||
/// @title Fibonacci. | ||
/// @author Succinct Labs | ||
/// @notice This contract implements a simple example of verifying the proof of a computing a | ||
/// fibonacci number. | ||
contract Fibonacci is SP1Verifier { | ||
contract Fibonacci { | ||
/// @notice The address of the SP1 verifier contract. | ||
/// @dev This can either be a specific SP1Verifier for a specific version, or the | ||
/// SP1VerifierGateway which can be used to verify proofs for any version of SP1. | ||
/// For the list of supported verifiers on each chain, see: | ||
/// https://github.com/succinctlabs/sp1-contracts/tree/main/contracts/deployments | ||
address public verifier; | ||
|
||
/// @notice The verification key for the fibonacci program. | ||
bytes32 public fibonacciProgramVkey; | ||
|
||
constructor(bytes32 _fibonacciProgramVkey) { | ||
constructor(address _verifier, bytes32 _fibonacciProgramVkey) { | ||
verifier = _verifier; | ||
fibonacciProgramVkey = _fibonacciProgramVkey; | ||
} | ||
|
||
/// @notice The entrypoint for verifying the proof of a fibonacci number. | ||
/// @param proof The encoded proof. | ||
/// @param publicValues The encoded public values. | ||
function verifyFibonacciProof( | ||
bytes memory proof, | ||
bytes memory publicValues | ||
) public view returns (uint32, uint32, uint32) { | ||
this.verifyProof(fibonacciProgramVkey, publicValues, proof); | ||
(uint32 n, uint32 a, uint32 b) = abi.decode( | ||
publicValues, | ||
(uint32, uint32, uint32) | ||
); | ||
function verifyFibonacciProof(bytes calldata proof, bytes calldata publicValues) | ||
public | ||
view | ||
returns (uint32, uint32, uint32) | ||
{ | ||
// this.verifyProof(fibonacciProgramVkey, publicValues, proof); | ||
ISP1Verifier(verifier).verifyProof(fibonacciProgramVkey, publicValues, proof); | ||
(uint32 n, uint32 a, uint32 b) = abi.decode(publicValues, (uint32, uint32, uint32)); | ||
return (n, a, b); | ||
} | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove?