Aere Network public source. Everything here can be checked against the live chain (chain id 2800, https://rpc.aere.network). Scope note, stated up front rather than buried: consensus on chain 2800 is classical secp256k1 ECDSA QBFT. The post-quantum work in this repository is at the signature, precompile, account and transport layers. Nothing here makes the consensus post-quantum, and no document in it should be read as claiming so.
26 lines
955 B
Solidity
26 lines
955 B
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity 0.8.23;
|
|
|
|
/// Mock SP1 verifier for tests — accepts only specific (vKey, proof) pairs
|
|
/// set by `setValid()`. Real SP1 verifier deployment goes through Succinct's
|
|
/// canonical artifacts.
|
|
///
|
|
/// IMPORTANT: mirrors the REAL SP1VerifierGateway semantics — verifyProof
|
|
/// RETURNS NOTHING and REVERTS on an invalid proof (it does NOT return a
|
|
/// bool). This is deliberate so tests exercise the exact code path used
|
|
/// against the production gateway.
|
|
contract MockSp1Verifier {
|
|
mapping(bytes32 => bool) public valid;
|
|
|
|
error MockInvalidProof();
|
|
|
|
function setValid(bytes32 marker, bool ok) external {
|
|
valid[marker] = ok;
|
|
}
|
|
|
|
function verifyProof(bytes32 programVKey, bytes calldata publicValues, bytes calldata proof) external view {
|
|
bytes32 marker = keccak256(abi.encode(programVKey, publicValues, proof));
|
|
if (!valid[marker]) revert MockInvalidProof();
|
|
}
|
|
}
|