mirror of
https://github.com/vacp2p/linea-monorepo.git
synced 2026-01-08 03:43:56 -05:00
chore(3704): Bump solidity version to 0.8.26 across the repository (#64)
* Bump solidity version to 0.8.26 across the repository * Regenerated Verifiers * bump solidity for other merged PRs --------- Co-authored-by: thedarkjester <grant.southey@consensys.net> Co-authored-by: The Dark Jester <thedarkjester@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
||||
import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { LineaRollup } from "./LineaRollup.sol";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
||||
import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
/**
|
||||
* @title Interface declaring generic errors.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
/**
|
||||
* @title Interface declaring pre-existing cross-chain messaging functions, events and errors.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
/**
|
||||
* @title Interface declaring pre-existing pausing functions, events and errors.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
/**
|
||||
* @title Interface declaring permissions manager related data types.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
/**
|
||||
* @title Interface declaring rate limiting messaging functions, events and errors.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title L1 Message manager interface for current functions, events and errors.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title L1 Message manager V1 interface for pre-existing functions, events and errors.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title L1 Message Service interface for pre-existing functions, events and errors.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { IPauseManager } from "../../interfaces/IPauseManager.sol";
|
||||
import { IPermissionsManager } from "../../interfaces/IPermissionsManager.sol";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title Interface declaring verifier functions.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title ZkEvm rollup interface for pre-existing functions, events and errors.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title Interface declaring IRecoverFunds errors and functions.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
||||
import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
||||
import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
library Utils {
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
||||
import { IMessageService } from "../interfaces/IMessageService.sol";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { BitMaps } from "@openzeppelin/contracts/utils/structs/BitMaps.sol";
|
||||
import { L1MessageManagerV1 } from "./v1/L1MessageManagerV1.sol";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
|
||||
import { L1MessageServiceV1 } from "./v1/L1MessageServiceV1.sol";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { TransientStorageHelpers } from "../lib/TransientStorageHelpers.sol";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { IL1MessageManagerV1 } from "../../../interfaces/l1/IL1MessageManagerV1.sol";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
||||
import { PauseManager } from "../../../lib/PauseManager.sol";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
/**
|
||||
* @title Library to hash messages.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
||||
import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title Library to verify sparse merkle proofs and to get the leaf hash value
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
import { TimelockController } from "@openzeppelin/contracts/governance/TimelockController.sol";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title Library that provides helper functions to interact with transient storage.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { IPlonkVerifier } from "../interfaces/l1/IPlonkVerifier.sol";
|
||||
|
||||
|
||||
@@ -1440,7 +1440,7 @@ abstract contract ReentrancyGuardUpgradeable is Initializable {
|
||||
// File contracts/interfaces/l1/ILineaRollup.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: Apache-2.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title LineaRollup interface for current functions, events and errors.
|
||||
@@ -1745,7 +1745,7 @@ interface ILineaRollup {
|
||||
// File contracts/interfaces/IGenericErrors.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: Apache-2.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
/**
|
||||
* @title Interface declaring generic errors.
|
||||
@@ -1762,7 +1762,7 @@ interface IGenericErrors {
|
||||
// File contracts/interfaces/l1/IL1MessageService.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: Apache-2.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title L1 Message Service interface for pre-existing functions, events and errors.
|
||||
@@ -1873,7 +1873,7 @@ library BitMaps {
|
||||
// File contracts/interfaces/l1/IL1MessageManager.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title L1 Message manager interface for current functions, events and errors.
|
||||
@@ -1929,7 +1929,7 @@ interface IL1MessageManager {
|
||||
// File contracts/lib/Utils.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: AGPL-3.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
library Utils {
|
||||
/**
|
||||
@@ -1950,7 +1950,7 @@ library Utils {
|
||||
// File contracts/interfaces/l1/IL1MessageManagerV1.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: Apache-2.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title L1 Message manager V1 interface for pre-existing functions, events and errors.
|
||||
@@ -1991,7 +1991,7 @@ interface IL1MessageManagerV1 {
|
||||
// File contracts/messageService/l1/v1/L1MessageManagerV1.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title Contract to manage cross-chain message hashes storage and status on L1.
|
||||
@@ -2041,7 +2041,7 @@ abstract contract L1MessageManagerV1 is IL1MessageManagerV1 {
|
||||
// File contracts/messageService/l1/L1MessageManager.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title Contract to manage cross-chain message rolling hash computation and storage on L1.
|
||||
@@ -2138,7 +2138,7 @@ abstract contract L1MessageManager is L1MessageManagerV1, IL1MessageManager {
|
||||
// File contracts/interfaces/IMessageService.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: Apache-2.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
/**
|
||||
* @title Interface declaring pre-existing cross-chain messaging functions, events and errors.
|
||||
@@ -2236,7 +2236,7 @@ interface IMessageService {
|
||||
// File contracts/interfaces/IPauseManager.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: Apache-2.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
/**
|
||||
* @title Interface declaring pre-existing pausing functions, events and errors.
|
||||
@@ -2272,7 +2272,7 @@ interface IPauseManager {
|
||||
// File contracts/messageService/lib/PauseManager.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: AGPL-3.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
/**
|
||||
* @title Contract to manage cross-chain function pausing.
|
||||
@@ -2390,7 +2390,7 @@ abstract contract PauseManager is Initializable, IPauseManager, AccessControlUpg
|
||||
// File contracts/interfaces/IRateLimiter.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: Apache-2.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
/**
|
||||
* @title Interface declaring rate limiting messaging functions, events and errors.
|
||||
@@ -2458,7 +2458,7 @@ interface IRateLimiter {
|
||||
// File contracts/messageService/lib/RateLimiter.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: AGPL-3.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
/**
|
||||
* @title Rate Limiter by period and amount using the block timestamp.
|
||||
@@ -2575,7 +2575,7 @@ contract RateLimiter is Initializable, IRateLimiter, AccessControlUpgradeable {
|
||||
// File contracts/messageService/l1/v1/L1MessageServiceV1.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title Contract to manage cross-chain messaging on L1.
|
||||
@@ -2710,7 +2710,7 @@ abstract contract L1MessageServiceV1 is
|
||||
// File contracts/messageService/lib/SparseMerkleTreeVerifier.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title Library to verify sparse merkle proofs and to get the leaf hash value
|
||||
@@ -2760,7 +2760,7 @@ library SparseMerkleTreeVerifier {
|
||||
// File contracts/messageService/l1/L1MessageService.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title Contract to manage cross-chain messaging on L1.
|
||||
@@ -2919,7 +2919,7 @@ abstract contract L1MessageService is
|
||||
// File contracts/interfaces/l1/IPlonkVerifier.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: Apache-2.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title Interface declaring verifier functions.
|
||||
@@ -2938,7 +2938,7 @@ interface IPlonkVerifier {
|
||||
// File contracts/interfaces/l1/IZkEvmV2.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: Apache-2.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title ZkEvm rollup interface for pre-existing functions, events and errors.
|
||||
@@ -2987,7 +2987,7 @@ interface IZkEvmV2 {
|
||||
// File contracts/ZkEvmV2.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title Contract to manage cross-chain messaging on L1 and rollup proving.
|
||||
@@ -3049,7 +3049,7 @@ abstract contract ZkEvmV2 is Initializable, AccessControlUpgradeable, L1MessageS
|
||||
// File contracts/LineaRollup.sol
|
||||
|
||||
// Original license: SPDX_License_Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
/**
|
||||
* @title Contract to manage cross-chain messaging on L1 and rollup proving.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { IPlonkVerifier } from "../interfaces/l1/IPlonkVerifier.sol";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { IMessageService } from "../interfaces/IMessageService.sol";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
contract TestEIP4844 {
|
||||
event BlobHashEvent(bytes32 blobHash);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
interface ITestExternalCalls {
|
||||
function revertWithError() external pure;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { L1MessageManager } from "../messageService/l1/L1MessageManager.sol";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { L1MessageService } from "../messageService/l1/L1MessageService.sol";
|
||||
import { TestSetPauseTypeRoles } from "./TestSetPauseTypeRoles.sol";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { L1MessageService } from "../messageService/l1/L1MessageService.sol";
|
||||
import { IL1MessageService } from "../interfaces/l1/IL1MessageService.sol";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
contract TestL1RevertContract {
|
||||
function errorWithMessage() external pure {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { LineaRollup } from "../LineaRollup.sol";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
import { MessageServiceBase } from "../messageService/MessageServiceBase.sol";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
import { PauseManager } from "../lib/PauseManager.sol";
|
||||
import { TestSetPauseTypeRoles } from "./TestSetPauseTypeRoles.sol";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { IPlonkVerifier } from "../interfaces/l1/IPlonkVerifier.sol";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
||||
import { RateLimiter } from "../messageService/lib/RateLimiter.sol";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
import { PauseManager } from "../lib/PauseManager.sol";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { SparseMerkleTreeVerifier } from "../messageService/lib/SparseMerkleTreeVerifier.sol";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { Utils } from "../lib/Utils.sol";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
pragma solidity >=0.8.19 <=0.8.24;
|
||||
pragma solidity >=0.8.19 <=0.8.26;
|
||||
|
||||
import { IMessageService } from "../../../interfaces/IMessageService.sol";
|
||||
import { IGenericErrors } from "../../../interfaces/IGenericErrors.sol";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
|
||||
import { IGenericErrors } from "../interfaces/IGenericErrors.sol";
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
// Code generated by gnark DO NOT EDIT
|
||||
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
contract PlonkVerifierDev {
|
||||
uint256 private constant R_MOD = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
// Code generated by gnark DO NOT EDIT
|
||||
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
contract PlonkVerifierForDataAggregation {
|
||||
uint256 private constant R_MOD = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
@@ -73,6 +73,9 @@ contract PlonkVerifierForDataAggregation {
|
||||
|
||||
// ------------------------------------------------
|
||||
|
||||
// size of the proof without call custom gate
|
||||
uint256 private constant FIXED_PROOF_SIZE = 0x300;
|
||||
|
||||
// offset proof
|
||||
|
||||
uint256 private constant PROOF_L_COM_X = 0x0;
|
||||
@@ -83,14 +86,14 @@ contract PlonkVerifierForDataAggregation {
|
||||
uint256 private constant PROOF_O_COM_Y = 0xa0;
|
||||
|
||||
// h = h_0 + x^{n+2}h_1 + x^{2(n+2)}h_2
|
||||
uint256 private constant PROOF_H_0_X = 0xc0;
|
||||
uint256 private constant PROOF_H_0_Y = 0xe0;
|
||||
uint256 private constant PROOF_H_1_X = 0x100;
|
||||
uint256 private constant PROOF_H_1_Y = 0x120;
|
||||
uint256 private constant PROOF_H_2_X = 0x140;
|
||||
uint256 private constant PROOF_H_2_Y = 0x160;
|
||||
uint256 private constant PROOF_H_0_COM_X = 0xc0;
|
||||
uint256 private constant PROOF_H_0_COM_Y = 0xe0;
|
||||
uint256 private constant PROOF_H_1_COM_X = 0x100;
|
||||
uint256 private constant PROOF_H_1_COM_Y = 0x120;
|
||||
uint256 private constant PROOF_H_2_COM_X = 0x140;
|
||||
uint256 private constant PROOF_H_2_COM_Y = 0x160;
|
||||
|
||||
// wire values at zeta
|
||||
// "evaluations of wire polynomials at zeta
|
||||
uint256 private constant PROOF_L_AT_ZETA = 0x180;
|
||||
uint256 private constant PROOF_R_AT_ZETA = 0x1a0;
|
||||
uint256 private constant PROOF_O_AT_ZETA = 0x1c0;
|
||||
@@ -115,9 +118,6 @@ contract PlonkVerifierForDataAggregation {
|
||||
uint256 private constant PROOF_OPENING_QCP_AT_ZETA = 0x300;
|
||||
uint256 private constant PROOF_BSB_COMMITMENTS = 0x320;
|
||||
|
||||
// -> next part of proof is
|
||||
// [ openings_selector_commits || commitments_wires_commit_api]
|
||||
|
||||
// -------- offset state
|
||||
|
||||
// challenges to check the claimed quotient
|
||||
@@ -133,7 +133,7 @@ contract PlonkVerifierForDataAggregation {
|
||||
uint256 private constant STATE_LINEARISED_POLYNOMIAL_Y = 0x100;
|
||||
uint256 private constant STATE_OPENING_LINEARISED_POLYNOMIAL_ZETA = 0x120;
|
||||
uint256 private constant STATE_FOLDED_CLAIMED_VALUES = 0x140; // Folded proof for the opening of H, linearised poly, l, r, o, s_1, s_2, qcp
|
||||
uint256 private constant STATE_FOLDED_DIGESTS_X = 0x160; // folded digests of H, linearised poly, l, r, o, s_1, s_2, qcp
|
||||
uint256 private constant STATE_FOLDED_DIGESTS_X = 0x160; // linearised poly, l, r, o, s_1, s_2, qcp
|
||||
uint256 private constant STATE_FOLDED_DIGESTS_Y = 0x180;
|
||||
uint256 private constant STATE_PI = 0x1a0;
|
||||
uint256 private constant STATE_ZETA_POWER_N_MINUS_ONE = 0x1c0;
|
||||
@@ -161,6 +161,7 @@ contract PlonkVerifierForDataAggregation {
|
||||
uint8 private constant HASH_FR_TWO = 2;
|
||||
|
||||
// -------- precompiles
|
||||
uint8 private constant SHA2 = 0x2;
|
||||
uint8 private constant MOD_EXP = 0x5;
|
||||
uint8 private constant EC_ADD = 0x6;
|
||||
uint8 private constant EC_MUL = 0x7;
|
||||
@@ -201,7 +202,7 @@ contract PlonkVerifierForDataAggregation {
|
||||
mstore(add(mem, STATE_PI), l_pi)
|
||||
|
||||
compute_alpha_square_lagrange_0()
|
||||
verify_opening_linearised_polynomial(proof.offset)
|
||||
compute_opening_linearised_polynomial(proof.offset)
|
||||
fold_h(proof.offset)
|
||||
compute_commitment_linearised_polynomial(proof.offset)
|
||||
compute_gamma_kzg(proof.offset)
|
||||
@@ -221,6 +222,16 @@ contract PlonkVerifierForDataAggregation {
|
||||
revert(ptError, 0x64)
|
||||
}
|
||||
|
||||
/// Called when an exponentiation mod r fails
|
||||
function error_mod_exp() {
|
||||
let ptError := mload(0x40)
|
||||
mstore(ptError, ERROR_STRING_ID) // selector for function Error(string)
|
||||
mstore(add(ptError, 0x4), 0x20)
|
||||
mstore(add(ptError, 0x24), 0xc)
|
||||
mstore(add(ptError, 0x44), "error mod exp")
|
||||
revert(ptError, 0x64)
|
||||
}
|
||||
|
||||
/// Called when an operation on Bn254 fails
|
||||
/// @dev for instance when calling EcMul on a point not on Bn254.
|
||||
function error_ec_op() {
|
||||
@@ -321,7 +332,7 @@ contract PlonkVerifierForDataAggregation {
|
||||
/// Checks if the proof is of the correct size
|
||||
/// @param actual_proof_size size of the proof (not the expected size)
|
||||
function check_proof_size(actual_proof_size) {
|
||||
let expected_proof_size := add(0x300, mul(VK_NB_CUSTOM_GATES, 0x60))
|
||||
let expected_proof_size := add(FIXED_PROOF_SIZE, mul(VK_NB_CUSTOM_GATES, 0x60))
|
||||
if iszero(eq(actual_proof_size, expected_proof_size)) {
|
||||
error_proof_size()
|
||||
}
|
||||
@@ -405,9 +416,6 @@ contract PlonkVerifierForDataAggregation {
|
||||
let state := mload(0x40)
|
||||
let mPtr := add(state, STATE_LAST_MEM)
|
||||
|
||||
// gamma
|
||||
// gamma in ascii is [0x67,0x61,0x6d, 0x6d, 0x61]
|
||||
// (same for alpha, beta, zeta)
|
||||
mstore(mPtr, FS_GAMMA) // "gamma"
|
||||
|
||||
mstore(add(mPtr, 0x20), VK_S1_COM_X)
|
||||
@@ -448,7 +456,7 @@ contract PlonkVerifierForDataAggregation {
|
||||
let size := add(0x2c5, size_pi_in_bytes)
|
||||
|
||||
size := add(size, mul(VK_NB_CUSTOM_GATES, 0x40))
|
||||
let l_success := staticcall(gas(), 0x2, add(mPtr, 0x1b), size, mPtr, 0x20) //0x1b -> 000.."gamma"
|
||||
let l_success := staticcall(gas(), SHA2, add(mPtr, 0x1b), size, mPtr, 0x20) //0x1b -> 000.."gamma"
|
||||
if iszero(l_success) {
|
||||
error_verify()
|
||||
}
|
||||
@@ -468,7 +476,7 @@ contract PlonkVerifierForDataAggregation {
|
||||
// beta
|
||||
mstore(mPtr, FS_BETA) // "beta"
|
||||
mstore(add(mPtr, 0x20), gamma_not_reduced)
|
||||
let l_success := staticcall(gas(), 0x2, add(mPtr, 0x1c), 0x24, mPtr, 0x20) //0x1b -> 000.."gamma"
|
||||
let l_success := staticcall(gas(), SHA2, add(mPtr, 0x1c), 0x24, mPtr, 0x20) //0x1b -> 000.."gamma"
|
||||
if iszero(l_success) {
|
||||
error_verify()
|
||||
}
|
||||
@@ -503,7 +511,7 @@ contract PlonkVerifierForDataAggregation {
|
||||
|
||||
// [Z], the commitment to the grand product polynomial
|
||||
calldatacopy(_mPtr, add(aproof, PROOF_GRAND_PRODUCT_COMMITMENT_X), 0x40)
|
||||
let l_success := staticcall(gas(), 0x2, add(mPtr, 0x1b), full_size, mPtr, 0x20)
|
||||
let l_success := staticcall(gas(), SHA2, add(mPtr, 0x1b), full_size, mPtr, 0x20)
|
||||
if iszero(l_success) {
|
||||
error_verify()
|
||||
}
|
||||
@@ -524,8 +532,8 @@ contract PlonkVerifierForDataAggregation {
|
||||
// zeta
|
||||
mstore(mPtr, FS_ZETA) // "zeta"
|
||||
mstore(add(mPtr, 0x20), alpha_not_reduced)
|
||||
calldatacopy(add(mPtr, 0x40), add(aproof, PROOF_H_0_X), 0xc0)
|
||||
let l_success := staticcall(gas(), 0x2, add(mPtr, 0x1c), 0xe4, mPtr, 0x20)
|
||||
calldatacopy(add(mPtr, 0x40), add(aproof, PROOF_H_0_COM_X), 0xc0)
|
||||
let l_success := staticcall(gas(), SHA2, add(mPtr, 0x1c), 0xe4, mPtr, 0x20)
|
||||
if iszero(l_success) {
|
||||
error_verify()
|
||||
}
|
||||
@@ -566,28 +574,28 @@ contract PlonkVerifierForDataAggregation {
|
||||
/// batch_compute_lagranges_at_z computes [L_0(z), .., L_{n-1}(z)]
|
||||
/// @param z point at which the Lagranges are evaluated
|
||||
/// @param zpnmo ζⁿ-1
|
||||
/// @param n number of public inputs (number of Lagranges to compute)
|
||||
/// @param n_pub number of public inputs (number of Lagranges to compute)
|
||||
/// @param mPtr pointer to which the results are stored
|
||||
function batch_compute_lagranges_at_z(z, zpnmo, n, mPtr) {
|
||||
function batch_compute_lagranges_at_z(z, zpnmo, n_pub, mPtr) {
|
||||
let zn := mulmod(zpnmo, VK_INV_DOMAIN_SIZE, R_MOD) // 1/n * (ζⁿ - 1)
|
||||
|
||||
let _w := 1
|
||||
let _mPtr := mPtr
|
||||
for {
|
||||
let i := 0
|
||||
} lt(i, n) {
|
||||
} lt(i, n_pub) {
|
||||
i := add(i, 1)
|
||||
} {
|
||||
mstore(_mPtr, addmod(z, sub(R_MOD, _w), R_MOD))
|
||||
_w := mulmod(_w, VK_OMEGA, R_MOD)
|
||||
_mPtr := add(_mPtr, 0x20)
|
||||
}
|
||||
batch_invert(mPtr, n, _mPtr)
|
||||
batch_invert(mPtr, n_pub, _mPtr)
|
||||
_mPtr := mPtr
|
||||
_w := 1
|
||||
for {
|
||||
let i := 0
|
||||
} lt(i, n) {
|
||||
} lt(i, n_pub) {
|
||||
i := add(i, 1)
|
||||
} {
|
||||
mstore(_mPtr, mulmod(mulmod(mload(_mPtr), zn, R_MOD), _w, R_MOD))
|
||||
@@ -648,7 +656,6 @@ contract PlonkVerifierForDataAggregation {
|
||||
h_fr := hash_fr(calldataload(p), calldataload(add(p, 0x20)), mPtr)
|
||||
ith_lagrange := compute_ith_lagrange_at_z(z, zpnmo, add(nb_public_inputs, VK_INDEX_COMMIT_API_0), mPtr)
|
||||
pi_commit := addmod(pi_commit, mulmod(h_fr, ith_lagrange, R_MOD), R_MOD)
|
||||
p := add(p, 0x40)
|
||||
}
|
||||
|
||||
/// Computes L_i(zeta) = ωⁱ/n * (ζⁿ-1)/(ζ-ωⁱ) where:
|
||||
@@ -704,7 +711,7 @@ contract PlonkVerifierForDataAggregation {
|
||||
// size domain
|
||||
mstore8(add(mPtr, 0x8e), HASH_FR_SIZE_DOMAIN)
|
||||
|
||||
let l_success := staticcall(gas(), 0x2, mPtr, 0x8f, mPtr, 0x20)
|
||||
let l_success := staticcall(gas(), SHA2, mPtr, 0x8f, mPtr, 0x20)
|
||||
if iszero(l_success) {
|
||||
error_verify()
|
||||
}
|
||||
@@ -728,7 +735,7 @@ contract PlonkVerifierForDataAggregation {
|
||||
mstore8(add(mPtr, 0x2b), 0x6b)
|
||||
|
||||
mstore8(add(mPtr, 0x2c), HASH_FR_SIZE_DOMAIN) // size domain
|
||||
l_success := staticcall(gas(), 0x2, mPtr, 0x2d, mPtr, 0x20)
|
||||
l_success := staticcall(gas(), SHA2, mPtr, 0x2d, mPtr, 0x20)
|
||||
if iszero(l_success) {
|
||||
error_verify()
|
||||
}
|
||||
@@ -755,14 +762,14 @@ contract PlonkVerifierForDataAggregation {
|
||||
mstore8(add(mPtr, 0x4c), HASH_FR_SIZE_DOMAIN) // size domain
|
||||
|
||||
let offset := add(mPtr, 0x20)
|
||||
l_success := staticcall(gas(), 0x2, offset, 0x2d, offset, 0x20)
|
||||
l_success := staticcall(gas(), SHA2, offset, 0x2d, offset, 0x20)
|
||||
if iszero(l_success) {
|
||||
error_verify()
|
||||
}
|
||||
|
||||
// at this point we have mPtr = [ b1 || b2] where b1 is on 32byes and b2 in 16bytes.
|
||||
// we interpret it as a big integer mod r in big endian (similar to regular decimal notation)
|
||||
// the result is then 2**(8*16)*mPtr[32:] + mPtr[32:48]
|
||||
// the result is then 2**(8*16)*mPtr[:32] + mPtr[32:48]
|
||||
res := mulmod(mload(mPtr), HASH_FR_BB, R_MOD) // <- res = 2**128 * mPtr[:32]
|
||||
let b1 := shr(128, mload(add(mPtr, 0x20))) // b1 <- [0, 0, .., 0 || b2[:16] ]
|
||||
res := addmod(res, b1, R_MOD)
|
||||
@@ -802,7 +809,7 @@ contract PlonkVerifierForDataAggregation {
|
||||
|
||||
// derive a random number. As there is no random generator, we
|
||||
// do an FS like challenge derivation, depending on both digests and
|
||||
// ζ to ensure that the prover cannot control the random numger.
|
||||
// ζ to ensure that the prover cannot control the random number.
|
||||
// Note: adding the other point ζω is not needed, as ω is known beforehand.
|
||||
mstore(mPtr, mload(add(state, STATE_FOLDED_DIGESTS_X)))
|
||||
mstore(add(mPtr, 0x20), mload(add(state, STATE_FOLDED_DIGESTS_Y)))
|
||||
@@ -814,7 +821,7 @@ contract PlonkVerifierForDataAggregation {
|
||||
mstore(add(mPtr, 0xe0), calldataload(add(aproof, PROOF_OPENING_AT_ZETA_OMEGA_Y)))
|
||||
mstore(add(mPtr, 0x100), mload(add(state, STATE_ZETA)))
|
||||
mstore(add(mPtr, 0x120), mload(add(state, STATE_GAMMA_KZG)))
|
||||
let random := staticcall(gas(), 0x2, mPtr, 0x140, mPtr, 0x20)
|
||||
let random := staticcall(gas(), SHA2, mPtr, 0x140, mPtr, 0x20)
|
||||
if iszero(random) {
|
||||
error_random_generation()
|
||||
}
|
||||
@@ -864,6 +871,7 @@ contract PlonkVerifierForDataAggregation {
|
||||
mstore(folded_quotients_y, sub(P_MOD, mload(folded_quotients_y)))
|
||||
|
||||
mstore(mPtr, mload(folded_digests))
|
||||
|
||||
mstore(add(mPtr, 0x20), mload(add(folded_digests, 0x20)))
|
||||
mstore(add(mPtr, 0x40), G2_SRS_0_X_0) // the 4 lines are the canonical G2 point on BN254
|
||||
mstore(add(mPtr, 0x60), G2_SRS_0_X_1)
|
||||
@@ -895,7 +903,7 @@ contract PlonkVerifierForDataAggregation {
|
||||
|
||||
/// @notice Fold the opening proofs at ζ:
|
||||
/// * at state+state_folded_digest we store: [Linearised_polynomial]+γ[L] + γ²[R] + γ³[O] + γ⁴[S₁] +γ⁵[S₂] + ∑ᵢγ⁵⁺ⁱ[Pi_{i}]
|
||||
/// * at state+state_folded_claimed_values we store: H(ζ) + γLinearised_polynomial(ζ)+γ²L(ζ) + γ³R(ζ)+ γ⁴O(ζ) + γ⁵S₁(ζ) +γ⁶S₂(ζ) + ∑ᵢγ⁶⁺ⁱPi_{i}(ζ)
|
||||
/// * at state+state_folded_claimed_values we store: Linearised_polynomial(ζ)+γL(ζ) + γ²R(ζ)+ γ³O(ζ) + γ⁴S₁(ζ) +γ⁵S₂(ζ) + ∑ᵢγ⁵⁺ⁱPi_{i}(ζ)
|
||||
/// @param aproof pointer to the proof
|
||||
/// acc_gamma stores the γⁱ
|
||||
function fold_state(aproof) {
|
||||
@@ -908,11 +916,11 @@ contract PlonkVerifierForDataAggregation {
|
||||
let acc_gamma := l_gamma_kzg
|
||||
let state_folded_digests := add(state, STATE_FOLDED_DIGESTS_X)
|
||||
|
||||
mstore(add(state, STATE_FOLDED_DIGESTS_X), mload(add(state, STATE_LINEARISED_POLYNOMIAL_X)))
|
||||
mstore(state_folded_digests, mload(add(state, STATE_LINEARISED_POLYNOMIAL_X)))
|
||||
mstore(add(state, STATE_FOLDED_DIGESTS_Y), mload(add(state, STATE_LINEARISED_POLYNOMIAL_Y)))
|
||||
mstore(add(state, STATE_FOLDED_CLAIMED_VALUES), mload(add(state, STATE_OPENING_LINEARISED_POLYNOMIAL_ZETA)))
|
||||
|
||||
point_acc_mul_calldata(add(state, STATE_FOLDED_DIGESTS_X), add(aproof, PROOF_L_COM_X), acc_gamma, mPtr)
|
||||
point_acc_mul_calldata(state_folded_digests, add(aproof, PROOF_L_COM_X), acc_gamma, mPtr)
|
||||
fr_acc_mul_calldata(add(state, STATE_FOLDED_CLAIMED_VALUES), add(aproof, PROOF_L_AT_ZETA), acc_gamma)
|
||||
|
||||
acc_gamma := mulmod(acc_gamma, l_gamma_kzg, R_MOD)
|
||||
@@ -993,11 +1001,11 @@ contract PlonkVerifierForDataAggregation {
|
||||
mstore(_mPtr, calldataload(add(aproof, PROOF_GRAND_PRODUCT_AT_ZETA_OMEGA)))
|
||||
|
||||
let start_input := 0x1b // 00.."gamma"
|
||||
let size_input := add(0x14, mul(VK_NB_CUSTOM_GATES, 3)) // number of 32bytes elmts = 0x17 (zeta+3*6 for the digests+openings) + 3*VK_NB_CUSTOM_GATES (for the commitments of the selectors) + 1 (opening of Z at ζω)
|
||||
let size_input := add(0x14, mul(VK_NB_CUSTOM_GATES, 3)) // number of 32bytes elmts = 0x14 (zeta+3*6 for the digests+openings) + 3*VK_NB_CUSTOM_GATES (for the commitments of the selectors) + 1 (opening of Z at ζω)
|
||||
size_input := add(0x5, mul(size_input, 0x20)) // size in bytes: 15*32 bytes + 5 bytes for gamma
|
||||
let check_staticcall := staticcall(
|
||||
gas(),
|
||||
0x2,
|
||||
SHA2,
|
||||
add(mPtr, start_input),
|
||||
size_input,
|
||||
add(state, STATE_GAMMA_KZG),
|
||||
@@ -1144,7 +1152,7 @@ contract PlonkVerifierForDataAggregation {
|
||||
compute_commitment_linearised_polynomial_ec(aproof, s1, s2)
|
||||
}
|
||||
|
||||
/// @notice compute -z_h(ζ)*([H₁] + ζᵐ⁺²[H₂] + ζ²⁽ᵐ⁺²⁾[H₃]) and store the result at
|
||||
/// @notice compute -z_h(ζ)*([H₁] + ζⁿ⁺²[H₂] + ζ²⁽ⁿ⁺²⁾[H₃]) and store the result at
|
||||
/// state + state_folded_h
|
||||
/// @param aproof pointer to the proof
|
||||
function fold_h(aproof) {
|
||||
@@ -1152,10 +1160,20 @@ contract PlonkVerifierForDataAggregation {
|
||||
let n_plus_two := add(VK_DOMAIN_SIZE, 2)
|
||||
let mPtr := add(mload(0x40), STATE_LAST_MEM)
|
||||
let zeta_power_n_plus_two := pow(mload(add(state, STATE_ZETA)), n_plus_two, mPtr)
|
||||
point_mul_calldata(add(state, STATE_FOLDED_H_X), add(aproof, PROOF_H_2_X), zeta_power_n_plus_two, mPtr)
|
||||
point_add_calldata(add(state, STATE_FOLDED_H_X), add(state, STATE_FOLDED_H_X), add(aproof, PROOF_H_1_X), mPtr)
|
||||
point_mul_calldata(add(state, STATE_FOLDED_H_X), add(aproof, PROOF_H_2_COM_X), zeta_power_n_plus_two, mPtr)
|
||||
point_add_calldata(
|
||||
add(state, STATE_FOLDED_H_X),
|
||||
add(state, STATE_FOLDED_H_X),
|
||||
add(aproof, PROOF_H_1_COM_X),
|
||||
mPtr
|
||||
)
|
||||
point_mul(add(state, STATE_FOLDED_H_X), add(state, STATE_FOLDED_H_X), zeta_power_n_plus_two, mPtr)
|
||||
point_add_calldata(add(state, STATE_FOLDED_H_X), add(state, STATE_FOLDED_H_X), add(aproof, PROOF_H_0_X), mPtr)
|
||||
point_add_calldata(
|
||||
add(state, STATE_FOLDED_H_X),
|
||||
add(state, STATE_FOLDED_H_X),
|
||||
add(aproof, PROOF_H_0_COM_X),
|
||||
mPtr
|
||||
)
|
||||
point_mul(
|
||||
add(state, STATE_FOLDED_H_X),
|
||||
add(state, STATE_FOLDED_H_X),
|
||||
@@ -1170,7 +1188,7 @@ contract PlonkVerifierForDataAggregation {
|
||||
/// @notice check that the opening of the linearised polynomial at zeta is equal to
|
||||
/// - [ PI(ζ) - α²*L₁(ζ) + α(l(ζ)+β*s1(ζ)+γ)(r(ζ)+β*s2(ζ)+γ)(o(ζ)+γ)*z(ωζ) ]
|
||||
/// @param aproof pointer to the proof
|
||||
function verify_opening_linearised_polynomial(aproof) {
|
||||
function compute_opening_linearised_polynomial(aproof) {
|
||||
let state := mload(0x40)
|
||||
|
||||
// (l(ζ)+β*s1(ζ)+γ)
|
||||
@@ -1289,7 +1307,6 @@ contract PlonkVerifierForDataAggregation {
|
||||
/// @param s scalar
|
||||
/// @mPtr free memory
|
||||
function point_acc_mul_calldata(dst, src, s, mPtr) {
|
||||
let state := mload(0x40)
|
||||
mstore(mPtr, calldataload(src))
|
||||
mstore(add(mPtr, 0x20), calldataload(add(src, 0x20)))
|
||||
mstore(add(mPtr, 0x40), s)
|
||||
@@ -1324,7 +1341,7 @@ contract PlonkVerifierForDataAggregation {
|
||||
mstore(add(mPtr, 0xa0), R_MOD)
|
||||
let check_staticcall := staticcall(gas(), MOD_EXP, mPtr, 0xc0, mPtr, 0x20)
|
||||
if eq(check_staticcall, 0) {
|
||||
|
||||
error_mod_exp()
|
||||
}
|
||||
res := mload(mPtr)
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
// Code generated by gnark DO NOT EDIT
|
||||
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
contract PlonkVerifierForMultiTypeDataAggregation {
|
||||
uint256 private constant R_MOD = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
// Code generated by gnark DO NOT EDIT
|
||||
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
contract TestPlonkVerifierForDataAggregation {
|
||||
uint256 private constant R_MOD = 21888242871839275222246405745257275088548364400416034343698204186575808495617;
|
||||
@@ -73,6 +73,9 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
|
||||
// ------------------------------------------------
|
||||
|
||||
// size of the proof without call custom gate
|
||||
uint256 private constant FIXED_PROOF_SIZE = 0x300;
|
||||
|
||||
// offset proof
|
||||
|
||||
uint256 private constant PROOF_L_COM_X = 0x0;
|
||||
@@ -83,14 +86,14 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
uint256 private constant PROOF_O_COM_Y = 0xa0;
|
||||
|
||||
// h = h_0 + x^{n+2}h_1 + x^{2(n+2)}h_2
|
||||
uint256 private constant PROOF_H_0_X = 0xc0;
|
||||
uint256 private constant PROOF_H_0_Y = 0xe0;
|
||||
uint256 private constant PROOF_H_1_X = 0x100;
|
||||
uint256 private constant PROOF_H_1_Y = 0x120;
|
||||
uint256 private constant PROOF_H_2_X = 0x140;
|
||||
uint256 private constant PROOF_H_2_Y = 0x160;
|
||||
uint256 private constant PROOF_H_0_COM_X = 0xc0;
|
||||
uint256 private constant PROOF_H_0_COM_Y = 0xe0;
|
||||
uint256 private constant PROOF_H_1_COM_X = 0x100;
|
||||
uint256 private constant PROOF_H_1_COM_Y = 0x120;
|
||||
uint256 private constant PROOF_H_2_COM_X = 0x140;
|
||||
uint256 private constant PROOF_H_2_COM_Y = 0x160;
|
||||
|
||||
// wire values at zeta
|
||||
// "evaluations of wire polynomials at zeta
|
||||
uint256 private constant PROOF_L_AT_ZETA = 0x180;
|
||||
uint256 private constant PROOF_R_AT_ZETA = 0x1a0;
|
||||
uint256 private constant PROOF_O_AT_ZETA = 0x1c0;
|
||||
@@ -115,9 +118,6 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
uint256 private constant PROOF_OPENING_QCP_AT_ZETA = 0x300;
|
||||
uint256 private constant PROOF_BSB_COMMITMENTS = 0x320;
|
||||
|
||||
// -> next part of proof is
|
||||
// [ openings_selector_commits || commitments_wires_commit_api]
|
||||
|
||||
// -------- offset state
|
||||
|
||||
// challenges to check the claimed quotient
|
||||
@@ -133,7 +133,7 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
uint256 private constant STATE_LINEARISED_POLYNOMIAL_Y = 0x100;
|
||||
uint256 private constant STATE_OPENING_LINEARISED_POLYNOMIAL_ZETA = 0x120;
|
||||
uint256 private constant STATE_FOLDED_CLAIMED_VALUES = 0x140; // Folded proof for the opening of H, linearised poly, l, r, o, s_1, s_2, qcp
|
||||
uint256 private constant STATE_FOLDED_DIGESTS_X = 0x160; // folded digests of H, linearised poly, l, r, o, s_1, s_2, qcp
|
||||
uint256 private constant STATE_FOLDED_DIGESTS_X = 0x160; // linearised poly, l, r, o, s_1, s_2, qcp
|
||||
uint256 private constant STATE_FOLDED_DIGESTS_Y = 0x180;
|
||||
uint256 private constant STATE_PI = 0x1a0;
|
||||
uint256 private constant STATE_ZETA_POWER_N_MINUS_ONE = 0x1c0;
|
||||
@@ -161,6 +161,7 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
uint8 private constant HASH_FR_TWO = 2;
|
||||
|
||||
// -------- precompiles
|
||||
uint8 private constant SHA2 = 0x2;
|
||||
uint8 private constant MOD_EXP = 0x5;
|
||||
uint8 private constant EC_ADD = 0x6;
|
||||
uint8 private constant EC_MUL = 0x7;
|
||||
@@ -201,7 +202,7 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
mstore(add(mem, STATE_PI), l_pi)
|
||||
|
||||
compute_alpha_square_lagrange_0()
|
||||
verify_opening_linearised_polynomial(proof.offset)
|
||||
compute_opening_linearised_polynomial(proof.offset)
|
||||
fold_h(proof.offset)
|
||||
compute_commitment_linearised_polynomial(proof.offset)
|
||||
compute_gamma_kzg(proof.offset)
|
||||
@@ -221,6 +222,16 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
revert(ptError, 0x64)
|
||||
}
|
||||
|
||||
/// Called when an exponentiation mod r fails
|
||||
function error_mod_exp() {
|
||||
let ptError := mload(0x40)
|
||||
mstore(ptError, ERROR_STRING_ID) // selector for function Error(string)
|
||||
mstore(add(ptError, 0x4), 0x20)
|
||||
mstore(add(ptError, 0x24), 0xc)
|
||||
mstore(add(ptError, 0x44), "error mod exp")
|
||||
revert(ptError, 0x64)
|
||||
}
|
||||
|
||||
/// Called when an operation on Bn254 fails
|
||||
/// @dev for instance when calling EcMul on a point not on Bn254.
|
||||
function error_ec_op() {
|
||||
@@ -321,7 +332,7 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
/// Checks if the proof is of the correct size
|
||||
/// @param actual_proof_size size of the proof (not the expected size)
|
||||
function check_proof_size(actual_proof_size) {
|
||||
let expected_proof_size := add(0x300, mul(VK_NB_CUSTOM_GATES, 0x60))
|
||||
let expected_proof_size := add(FIXED_PROOF_SIZE, mul(VK_NB_CUSTOM_GATES, 0x60))
|
||||
if iszero(eq(actual_proof_size, expected_proof_size)) {
|
||||
error_proof_size()
|
||||
}
|
||||
@@ -405,9 +416,6 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
let state := mload(0x40)
|
||||
let mPtr := add(state, STATE_LAST_MEM)
|
||||
|
||||
// gamma
|
||||
// gamma in ascii is [0x67,0x61,0x6d, 0x6d, 0x61]
|
||||
// (same for alpha, beta, zeta)
|
||||
mstore(mPtr, FS_GAMMA) // "gamma"
|
||||
|
||||
mstore(add(mPtr, 0x20), VK_S1_COM_X)
|
||||
@@ -448,7 +456,7 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
let size := add(0x2c5, size_pi_in_bytes)
|
||||
|
||||
size := add(size, mul(VK_NB_CUSTOM_GATES, 0x40))
|
||||
let l_success := staticcall(gas(), 0x2, add(mPtr, 0x1b), size, mPtr, 0x20) //0x1b -> 000.."gamma"
|
||||
let l_success := staticcall(gas(), SHA2, add(mPtr, 0x1b), size, mPtr, 0x20) //0x1b -> 000.."gamma"
|
||||
if iszero(l_success) {
|
||||
error_verify()
|
||||
}
|
||||
@@ -468,7 +476,7 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
// beta
|
||||
mstore(mPtr, FS_BETA) // "beta"
|
||||
mstore(add(mPtr, 0x20), gamma_not_reduced)
|
||||
let l_success := staticcall(gas(), 0x2, add(mPtr, 0x1c), 0x24, mPtr, 0x20) //0x1b -> 000.."gamma"
|
||||
let l_success := staticcall(gas(), SHA2, add(mPtr, 0x1c), 0x24, mPtr, 0x20) //0x1b -> 000.."gamma"
|
||||
if iszero(l_success) {
|
||||
error_verify()
|
||||
}
|
||||
@@ -503,7 +511,7 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
|
||||
// [Z], the commitment to the grand product polynomial
|
||||
calldatacopy(_mPtr, add(aproof, PROOF_GRAND_PRODUCT_COMMITMENT_X), 0x40)
|
||||
let l_success := staticcall(gas(), 0x2, add(mPtr, 0x1b), full_size, mPtr, 0x20)
|
||||
let l_success := staticcall(gas(), SHA2, add(mPtr, 0x1b), full_size, mPtr, 0x20)
|
||||
if iszero(l_success) {
|
||||
error_verify()
|
||||
}
|
||||
@@ -524,8 +532,8 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
// zeta
|
||||
mstore(mPtr, FS_ZETA) // "zeta"
|
||||
mstore(add(mPtr, 0x20), alpha_not_reduced)
|
||||
calldatacopy(add(mPtr, 0x40), add(aproof, PROOF_H_0_X), 0xc0)
|
||||
let l_success := staticcall(gas(), 0x2, add(mPtr, 0x1c), 0xe4, mPtr, 0x20)
|
||||
calldatacopy(add(mPtr, 0x40), add(aproof, PROOF_H_0_COM_X), 0xc0)
|
||||
let l_success := staticcall(gas(), SHA2, add(mPtr, 0x1c), 0xe4, mPtr, 0x20)
|
||||
if iszero(l_success) {
|
||||
error_verify()
|
||||
}
|
||||
@@ -566,28 +574,28 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
/// batch_compute_lagranges_at_z computes [L_0(z), .., L_{n-1}(z)]
|
||||
/// @param z point at which the Lagranges are evaluated
|
||||
/// @param zpnmo ζⁿ-1
|
||||
/// @param n number of public inputs (number of Lagranges to compute)
|
||||
/// @param n_pub number of public inputs (number of Lagranges to compute)
|
||||
/// @param mPtr pointer to which the results are stored
|
||||
function batch_compute_lagranges_at_z(z, zpnmo, n, mPtr) {
|
||||
function batch_compute_lagranges_at_z(z, zpnmo, n_pub, mPtr) {
|
||||
let zn := mulmod(zpnmo, VK_INV_DOMAIN_SIZE, R_MOD) // 1/n * (ζⁿ - 1)
|
||||
|
||||
let _w := 1
|
||||
let _mPtr := mPtr
|
||||
for {
|
||||
let i := 0
|
||||
} lt(i, n) {
|
||||
} lt(i, n_pub) {
|
||||
i := add(i, 1)
|
||||
} {
|
||||
mstore(_mPtr, addmod(z, sub(R_MOD, _w), R_MOD))
|
||||
_w := mulmod(_w, VK_OMEGA, R_MOD)
|
||||
_mPtr := add(_mPtr, 0x20)
|
||||
}
|
||||
batch_invert(mPtr, n, _mPtr)
|
||||
batch_invert(mPtr, n_pub, _mPtr)
|
||||
_mPtr := mPtr
|
||||
_w := 1
|
||||
for {
|
||||
let i := 0
|
||||
} lt(i, n) {
|
||||
} lt(i, n_pub) {
|
||||
i := add(i, 1)
|
||||
} {
|
||||
mstore(_mPtr, mulmod(mulmod(mload(_mPtr), zn, R_MOD), _w, R_MOD))
|
||||
@@ -648,7 +656,6 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
h_fr := hash_fr(calldataload(p), calldataload(add(p, 0x20)), mPtr)
|
||||
ith_lagrange := compute_ith_lagrange_at_z(z, zpnmo, add(nb_public_inputs, VK_INDEX_COMMIT_API_0), mPtr)
|
||||
pi_commit := addmod(pi_commit, mulmod(h_fr, ith_lagrange, R_MOD), R_MOD)
|
||||
p := add(p, 0x40)
|
||||
}
|
||||
|
||||
/// Computes L_i(zeta) = ωⁱ/n * (ζⁿ-1)/(ζ-ωⁱ) where:
|
||||
@@ -704,7 +711,7 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
// size domain
|
||||
mstore8(add(mPtr, 0x8e), HASH_FR_SIZE_DOMAIN)
|
||||
|
||||
let l_success := staticcall(gas(), 0x2, mPtr, 0x8f, mPtr, 0x20)
|
||||
let l_success := staticcall(gas(), SHA2, mPtr, 0x8f, mPtr, 0x20)
|
||||
if iszero(l_success) {
|
||||
error_verify()
|
||||
}
|
||||
@@ -728,7 +735,7 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
mstore8(add(mPtr, 0x2b), 0x6b)
|
||||
|
||||
mstore8(add(mPtr, 0x2c), HASH_FR_SIZE_DOMAIN) // size domain
|
||||
l_success := staticcall(gas(), 0x2, mPtr, 0x2d, mPtr, 0x20)
|
||||
l_success := staticcall(gas(), SHA2, mPtr, 0x2d, mPtr, 0x20)
|
||||
if iszero(l_success) {
|
||||
error_verify()
|
||||
}
|
||||
@@ -755,14 +762,14 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
mstore8(add(mPtr, 0x4c), HASH_FR_SIZE_DOMAIN) // size domain
|
||||
|
||||
let offset := add(mPtr, 0x20)
|
||||
l_success := staticcall(gas(), 0x2, offset, 0x2d, offset, 0x20)
|
||||
l_success := staticcall(gas(), SHA2, offset, 0x2d, offset, 0x20)
|
||||
if iszero(l_success) {
|
||||
error_verify()
|
||||
}
|
||||
|
||||
// at this point we have mPtr = [ b1 || b2] where b1 is on 32byes and b2 in 16bytes.
|
||||
// we interpret it as a big integer mod r in big endian (similar to regular decimal notation)
|
||||
// the result is then 2**(8*16)*mPtr[32:] + mPtr[32:48]
|
||||
// the result is then 2**(8*16)*mPtr[:32] + mPtr[32:48]
|
||||
res := mulmod(mload(mPtr), HASH_FR_BB, R_MOD) // <- res = 2**128 * mPtr[:32]
|
||||
let b1 := shr(128, mload(add(mPtr, 0x20))) // b1 <- [0, 0, .., 0 || b2[:16] ]
|
||||
res := addmod(res, b1, R_MOD)
|
||||
@@ -802,7 +809,7 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
|
||||
// derive a random number. As there is no random generator, we
|
||||
// do an FS like challenge derivation, depending on both digests and
|
||||
// ζ to ensure that the prover cannot control the random numger.
|
||||
// ζ to ensure that the prover cannot control the random number.
|
||||
// Note: adding the other point ζω is not needed, as ω is known beforehand.
|
||||
mstore(mPtr, mload(add(state, STATE_FOLDED_DIGESTS_X)))
|
||||
mstore(add(mPtr, 0x20), mload(add(state, STATE_FOLDED_DIGESTS_Y)))
|
||||
@@ -814,7 +821,7 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
mstore(add(mPtr, 0xe0), calldataload(add(aproof, PROOF_OPENING_AT_ZETA_OMEGA_Y)))
|
||||
mstore(add(mPtr, 0x100), mload(add(state, STATE_ZETA)))
|
||||
mstore(add(mPtr, 0x120), mload(add(state, STATE_GAMMA_KZG)))
|
||||
let random := staticcall(gas(), 0x2, mPtr, 0x140, mPtr, 0x20)
|
||||
let random := staticcall(gas(), SHA2, mPtr, 0x140, mPtr, 0x20)
|
||||
if iszero(random) {
|
||||
error_random_generation()
|
||||
}
|
||||
@@ -864,6 +871,7 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
mstore(folded_quotients_y, sub(P_MOD, mload(folded_quotients_y)))
|
||||
|
||||
mstore(mPtr, mload(folded_digests))
|
||||
|
||||
mstore(add(mPtr, 0x20), mload(add(folded_digests, 0x20)))
|
||||
mstore(add(mPtr, 0x40), G2_SRS_0_X_0) // the 4 lines are the canonical G2 point on BN254
|
||||
mstore(add(mPtr, 0x60), G2_SRS_0_X_1)
|
||||
@@ -895,7 +903,7 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
|
||||
/// @notice Fold the opening proofs at ζ:
|
||||
/// * at state+state_folded_digest we store: [Linearised_polynomial]+γ[L] + γ²[R] + γ³[O] + γ⁴[S₁] +γ⁵[S₂] + ∑ᵢγ⁵⁺ⁱ[Pi_{i}]
|
||||
/// * at state+state_folded_claimed_values we store: H(ζ) + γLinearised_polynomial(ζ)+γ²L(ζ) + γ³R(ζ)+ γ⁴O(ζ) + γ⁵S₁(ζ) +γ⁶S₂(ζ) + ∑ᵢγ⁶⁺ⁱPi_{i}(ζ)
|
||||
/// * at state+state_folded_claimed_values we store: Linearised_polynomial(ζ)+γL(ζ) + γ²R(ζ)+ γ³O(ζ) + γ⁴S₁(ζ) +γ⁵S₂(ζ) + ∑ᵢγ⁵⁺ⁱPi_{i}(ζ)
|
||||
/// @param aproof pointer to the proof
|
||||
/// acc_gamma stores the γⁱ
|
||||
function fold_state(aproof) {
|
||||
@@ -908,11 +916,11 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
let acc_gamma := l_gamma_kzg
|
||||
let state_folded_digests := add(state, STATE_FOLDED_DIGESTS_X)
|
||||
|
||||
mstore(add(state, STATE_FOLDED_DIGESTS_X), mload(add(state, STATE_LINEARISED_POLYNOMIAL_X)))
|
||||
mstore(state_folded_digests, mload(add(state, STATE_LINEARISED_POLYNOMIAL_X)))
|
||||
mstore(add(state, STATE_FOLDED_DIGESTS_Y), mload(add(state, STATE_LINEARISED_POLYNOMIAL_Y)))
|
||||
mstore(add(state, STATE_FOLDED_CLAIMED_VALUES), mload(add(state, STATE_OPENING_LINEARISED_POLYNOMIAL_ZETA)))
|
||||
|
||||
point_acc_mul_calldata(add(state, STATE_FOLDED_DIGESTS_X), add(aproof, PROOF_L_COM_X), acc_gamma, mPtr)
|
||||
point_acc_mul_calldata(state_folded_digests, add(aproof, PROOF_L_COM_X), acc_gamma, mPtr)
|
||||
fr_acc_mul_calldata(add(state, STATE_FOLDED_CLAIMED_VALUES), add(aproof, PROOF_L_AT_ZETA), acc_gamma)
|
||||
|
||||
acc_gamma := mulmod(acc_gamma, l_gamma_kzg, R_MOD)
|
||||
@@ -993,11 +1001,11 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
mstore(_mPtr, calldataload(add(aproof, PROOF_GRAND_PRODUCT_AT_ZETA_OMEGA)))
|
||||
|
||||
let start_input := 0x1b // 00.."gamma"
|
||||
let size_input := add(0x14, mul(VK_NB_CUSTOM_GATES, 3)) // number of 32bytes elmts = 0x17 (zeta+3*6 for the digests+openings) + 3*VK_NB_CUSTOM_GATES (for the commitments of the selectors) + 1 (opening of Z at ζω)
|
||||
let size_input := add(0x14, mul(VK_NB_CUSTOM_GATES, 3)) // number of 32bytes elmts = 0x14 (zeta+3*6 for the digests+openings) + 3*VK_NB_CUSTOM_GATES (for the commitments of the selectors) + 1 (opening of Z at ζω)
|
||||
size_input := add(0x5, mul(size_input, 0x20)) // size in bytes: 15*32 bytes + 5 bytes for gamma
|
||||
let check_staticcall := staticcall(
|
||||
gas(),
|
||||
0x2,
|
||||
SHA2,
|
||||
add(mPtr, start_input),
|
||||
size_input,
|
||||
add(state, STATE_GAMMA_KZG),
|
||||
@@ -1144,7 +1152,7 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
compute_commitment_linearised_polynomial_ec(aproof, s1, s2)
|
||||
}
|
||||
|
||||
/// @notice compute -z_h(ζ)*([H₁] + ζᵐ⁺²[H₂] + ζ²⁽ᵐ⁺²⁾[H₃]) and store the result at
|
||||
/// @notice compute -z_h(ζ)*([H₁] + ζⁿ⁺²[H₂] + ζ²⁽ⁿ⁺²⁾[H₃]) and store the result at
|
||||
/// state + state_folded_h
|
||||
/// @param aproof pointer to the proof
|
||||
function fold_h(aproof) {
|
||||
@@ -1152,10 +1160,20 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
let n_plus_two := add(VK_DOMAIN_SIZE, 2)
|
||||
let mPtr := add(mload(0x40), STATE_LAST_MEM)
|
||||
let zeta_power_n_plus_two := pow(mload(add(state, STATE_ZETA)), n_plus_two, mPtr)
|
||||
point_mul_calldata(add(state, STATE_FOLDED_H_X), add(aproof, PROOF_H_2_X), zeta_power_n_plus_two, mPtr)
|
||||
point_add_calldata(add(state, STATE_FOLDED_H_X), add(state, STATE_FOLDED_H_X), add(aproof, PROOF_H_1_X), mPtr)
|
||||
point_mul_calldata(add(state, STATE_FOLDED_H_X), add(aproof, PROOF_H_2_COM_X), zeta_power_n_plus_two, mPtr)
|
||||
point_add_calldata(
|
||||
add(state, STATE_FOLDED_H_X),
|
||||
add(state, STATE_FOLDED_H_X),
|
||||
add(aproof, PROOF_H_1_COM_X),
|
||||
mPtr
|
||||
)
|
||||
point_mul(add(state, STATE_FOLDED_H_X), add(state, STATE_FOLDED_H_X), zeta_power_n_plus_two, mPtr)
|
||||
point_add_calldata(add(state, STATE_FOLDED_H_X), add(state, STATE_FOLDED_H_X), add(aproof, PROOF_H_0_X), mPtr)
|
||||
point_add_calldata(
|
||||
add(state, STATE_FOLDED_H_X),
|
||||
add(state, STATE_FOLDED_H_X),
|
||||
add(aproof, PROOF_H_0_COM_X),
|
||||
mPtr
|
||||
)
|
||||
point_mul(
|
||||
add(state, STATE_FOLDED_H_X),
|
||||
add(state, STATE_FOLDED_H_X),
|
||||
@@ -1170,7 +1188,7 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
/// @notice check that the opening of the linearised polynomial at zeta is equal to
|
||||
/// - [ PI(ζ) - α²*L₁(ζ) + α(l(ζ)+β*s1(ζ)+γ)(r(ζ)+β*s2(ζ)+γ)(o(ζ)+γ)*z(ωζ) ]
|
||||
/// @param aproof pointer to the proof
|
||||
function verify_opening_linearised_polynomial(aproof) {
|
||||
function compute_opening_linearised_polynomial(aproof) {
|
||||
let state := mload(0x40)
|
||||
|
||||
// (l(ζ)+β*s1(ζ)+γ)
|
||||
@@ -1289,7 +1307,6 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
/// @param s scalar
|
||||
/// @mPtr free memory
|
||||
function point_acc_mul_calldata(dst, src, s, mPtr) {
|
||||
let state := mload(0x40)
|
||||
mstore(mPtr, calldataload(src))
|
||||
mstore(add(mPtr, 0x20), calldataload(add(src, 0x20)))
|
||||
mstore(add(mPtr, 0x40), s)
|
||||
@@ -1324,7 +1341,7 @@ contract TestPlonkVerifierForDataAggregation {
|
||||
mstore(add(mPtr, 0xa0), R_MOD)
|
||||
let check_staticcall := staticcall(gas(), MOD_EXP, mPtr, 0xc0, mPtr, 0x20)
|
||||
if eq(check_staticcall, 0) {
|
||||
|
||||
error_mod_exp()
|
||||
}
|
||||
res := mload(mPtr)
|
||||
}
|
||||
|
||||
@@ -28,7 +28,19 @@ const config: HardhatUserConfig = {
|
||||
artifacts: "./build",
|
||||
},
|
||||
solidity: {
|
||||
// NB: double check the autoupdate shell script version complies to the latest solidity version if you add a new one.
|
||||
compilers: [
|
||||
{
|
||||
version: "0.8.26",
|
||||
settings: {
|
||||
viaIR: useViaIR,
|
||||
optimizer: {
|
||||
enabled: true,
|
||||
runs: 50_000,
|
||||
},
|
||||
evmVersion: "cancun",
|
||||
},
|
||||
},
|
||||
{
|
||||
version: "0.8.25",
|
||||
settings: {
|
||||
@@ -81,18 +93,10 @@ const config: HardhatUserConfig = {
|
||||
accounts: [process.env.SEPOLIA_PRIVATE_KEY || EMPTY_HASH],
|
||||
url: "https://sepolia.infura.io/v3/" + process.env.INFURA_API_KEY,
|
||||
},
|
||||
goerli: {
|
||||
accounts: [process.env.GOERLI_PRIVATE_KEY || EMPTY_HASH],
|
||||
url: "https://goerli.infura.io/v3/" + process.env.INFURA_API_KEY,
|
||||
},
|
||||
linea_mainnet: {
|
||||
accounts: [process.env.LINEA_MAINNET_PRIVATE_KEY || EMPTY_HASH],
|
||||
url: "https://linea-mainnet.infura.io/v3/" + process.env.INFURA_API_KEY,
|
||||
},
|
||||
linea_goerli: {
|
||||
accounts: [process.env.LINEA_GOERLI_PRIVATE_KEY || EMPTY_HASH],
|
||||
url: "https://linea-goerli.infura.io/v3/" + process.env.INFURA_API_KEY,
|
||||
},
|
||||
linea_sepolia: {
|
||||
accounts: [process.env.LINEA_SEPOLIA_PRIVATE_KEY || EMPTY_HASH],
|
||||
url: "https://linea-sepolia.infura.io/v3/" + process.env.INFURA_API_KEY,
|
||||
@@ -122,21 +126,11 @@ const config: HardhatUserConfig = {
|
||||
etherscan: {
|
||||
apiKey: {
|
||||
mainnet: process.env.ETHERSCAN_API_KEY ?? "",
|
||||
goerli: process.env.ETHERSCAN_API_KEY ?? "",
|
||||
sepolia: process.env.ETHERSCAN_API_KEY ?? "",
|
||||
linea_sepolia: process.env.LINEASCAN_API_KEY ?? "",
|
||||
linea_goerli: process.env.LINEASCAN_API_KEY ?? "",
|
||||
linea_mainnet: process.env.LINEASCAN_API_KEY ?? "",
|
||||
},
|
||||
customChains: [
|
||||
{
|
||||
network: "linea_goerli",
|
||||
chainId: 59140,
|
||||
urls: {
|
||||
apiURL: "https://api-goerli.lineascan.build/api",
|
||||
browserURL: "https://goerli.lineascan.build/",
|
||||
},
|
||||
},
|
||||
{
|
||||
network: "linea_sepolia",
|
||||
chainId: 59141,
|
||||
|
||||
@@ -57,7 +57,7 @@ describe("Token Minting Rate Limiter", () => {
|
||||
beforeEach(async () => {
|
||||
xpToken = await loadFixture(deployLineaVoyageXPFixture);
|
||||
tokenMintingRateLimiter = await loadFixture(deployTokenMintingRateLimiterFixture);
|
||||
xpToken.connect(minter).grantRole(MINTER_ROLE, await tokenMintingRateLimiter.getAddress());
|
||||
await xpToken.connect(minter).grantRole(MINTER_ROLE, await tokenMintingRateLimiter.getAddress());
|
||||
});
|
||||
|
||||
describe("Initialization and roles", () => {
|
||||
|
||||
@@ -37,7 +37,7 @@ mv -f .samples-test-eip4844/* ${SOLTESTDIR_EIP4844}/test
|
||||
rm -rf .samples-simple-calldata .samples-multiproof-calldata .samples-test-calldata
|
||||
rm -rf .samples-simple-eip4844 .samples-multiproof-eip4844 .samples-test-eip4844
|
||||
|
||||
sed -i.bak 's/pragma solidity \^0.8.19;/pragma solidity 0.8.24;/g' ../contracts/test/testData/compressedData/Verifier1.sol
|
||||
sed -i.bak 's/pragma solidity \0.8.24;/pragma solidity 0.8.26;/g' ../contracts/test/testData/compressedData/Verifier1.sol
|
||||
|
||||
cp ../contracts/test/testData/compressedData/Verifier1.sol ../contracts/contracts/verifiers/PlonkVerifierForDataAggregation.sol
|
||||
sed -i.bak 's/contract PlonkVerifier /contract PlonkVerifierForDataAggregation /g' ../contracts/contracts/verifiers/PlonkVerifierForDataAggregation.sol
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
// Code generated by gnark DO NOT EDIT
|
||||
|
||||
pragma solidity 0.8.24;
|
||||
pragma solidity 0.8.26;
|
||||
|
||||
contract PlonkVerifier {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user