diff --git a/contracts/.solcover.js b/contracts/.solcover.js index e090ea00a..900f90f2a 100644 --- a/contracts/.solcover.js +++ b/contracts/.solcover.js @@ -1,10 +1,7 @@ module.exports = { skipFiles: [ - "test-contracts", - "verifiers/test", + "_testing", "proxies", - "tokenBridge/mocks", - "token/MyToken.sol", - "tokenBridge/CustomBridgedToken.sol", + "bridging/token/CustomBridgedToken.sol", ], }; diff --git a/contracts/contracts/test-contracts/TestEIP4844.sol b/contracts/contracts/test-contracts/TestEIP4844.sol deleted file mode 100644 index db3397cc6..000000000 --- a/contracts/contracts/test-contracts/TestEIP4844.sol +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.8.26; - -contract TestEIP4844 { - event BlobHashEvent(bytes32 blobHash); - - function submitData( - bytes32 _snarkHash, - uint256 _y, - bytes1[48] memory _kzgCommitment, - bytes1[48] memory _kzgProof - ) external { - bytes32 h = blobhash(0); - - bytes32 compressedDataComputedX = keccak256(abi.encode(_snarkHash, h)); - - (bool success, ) = address(0x0a).staticcall( - abi.encodePacked(h, compressedDataComputedX, _y, _kzgCommitment, _kzgProof) - ); - if (!success) { - revert("PointEvaluationFailed"); - } - - emit BlobHashEvent(h); - } -} diff --git a/contracts/contracts/test-contracts/TestPublicInputVerifier.sol b/contracts/contracts/test-contracts/TestPublicInputVerifier.sol deleted file mode 100644 index c94494aef..000000000 --- a/contracts/contracts/test-contracts/TestPublicInputVerifier.sol +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.8.26; - -import { IPlonkVerifier } from "../interfaces/l1/IPlonkVerifier.sol"; - -/// @dev Test verifier contract that returns true. -contract TestPublicInputVerifier is IPlonkVerifier { - uint256 public expectedPublicInput; - - constructor(uint256 _expectedPublicInput) { - expectedPublicInput = _expectedPublicInput; - } - - function Verify(bytes calldata, uint256[] calldata _publicInput) external view returns (bool) { - return expectedPublicInput == _publicInput[0]; - } -} diff --git a/contracts/contracts/test-contracts/TestUtils.sol b/contracts/contracts/test-contracts/TestUtils.sol deleted file mode 100644 index e21bd044f..000000000 --- a/contracts/contracts/test-contracts/TestUtils.sol +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0 -pragma solidity 0.8.26; - -import { Utils } from "../lib/Utils.sol"; - -contract TestUtils { - function efficientKeccak(bytes32 _left, bytes32 _right) external pure returns (bytes32 value) { - return Utils._efficientKeccak(_left, _right); - } -} diff --git a/contracts/contracts/tools/ProxyAdminReplica.sol b/contracts/contracts/tools/ProxyAdminReplica.sol deleted file mode 100644 index a88c32897..000000000 --- a/contracts/contracts/tools/ProxyAdminReplica.sol +++ /dev/null @@ -1,12 +0,0 @@ -// SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v4.8.3) (proxy/transparent/ProxyAdmin.sol) - -pragma solidity ^0.8.0; - -/** - * @dev This is only for operational scripts. Do not use for anything else. - @dev This generates an artefact and contract types in order to use when transferring ownership. - */ -contract ProxyAdminReplica { - function transferOwnership(address newOwner) public {} -} diff --git a/contracts/contracts/verifiers/Utils.sol b/contracts/contracts/verifiers/Utils.sol deleted file mode 100644 index 40f28ed16..000000000 --- a/contracts/contracts/verifiers/Utils.sol +++ /dev/null @@ -1,158 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -// Copyright 2023 Consensys Software Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by gnark DO NOT EDIT - -pragma solidity 0.8.19; - -/// @custom:security-contact security-report@linea.build -library Utils { - uint256 private constant r_mod = 21888242871839275222246405745257275088548364400416034343698204186575808495617; - uint256 private constant bb = 340282366920938463463374607431768211456; // 2**128 - uint256 private constant error_string_id = 0x08c379a000000000000000000000000000000000000000000000000000000000; // selector for function Error(string) - uint256 private constant zero_uint256 = 0; - - uint8 private constant lenInBytes = 48; - uint8 private constant sizeDomain = 11; - uint8 private constant one = 1; - uint8 private constant two = 2; - - /** - * @dev xmsg expands msg to a slice of lenInBytes bytes. - * https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-06#section-5 - * https://tools.ietf.org/html/rfc8017#section-4.1 (I2OSP/O2ISP) - * @dev cf https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-06#section-5.2 - * corresponds to https://github.com/ConsenSys/gnark-crypto/blob/develop/ecc/bn254/fr/element.go - */ - function hash_fr(uint256 x, uint256 y) internal view returns (uint256 res) { - assembly { - function error_sha2_256() { - let ptError := mload(0x40) - mstore(ptError, error_string_id) // selector for function Error(string) - mstore(add(ptError, 0x4), 0x20) - mstore(add(ptError, 0x24), 0x19) - mstore(add(ptError, 0x44), "error staticcall sha2-256") - revert(ptError, 0x64) - } - - // [0x00, .. , 0x00 || x, y, || 0, 48, 0, dst, sizeDomain] - // <- 64 bytes -> <-64b -> <- 1 bytes each -> - let mPtr := mload(0x40) - - // [0x00, .., 0x00] 64 bytes of zero - mstore(mPtr, zero_uint256) - mstore(add(mPtr, 0x20), zero_uint256) - - // msg = x || y , both on 32 bytes - mstore(add(mPtr, 0x40), x) - mstore(add(mPtr, 0x60), y) - - // 0 || 48 || 0 all on 1 byte - mstore8(add(mPtr, 0x80), 0) - mstore8(add(mPtr, 0x81), lenInBytes) - mstore8(add(mPtr, 0x82), 0) - - // "BSB22-Plonk" = [42, 53, 42, 32, 32, 2d, 50, 6c, 6f, 6e, 6b,] - mstore8(add(mPtr, 0x83), 0x42) - mstore8(add(mPtr, 0x84), 0x53) - mstore8(add(mPtr, 0x85), 0x42) - mstore8(add(mPtr, 0x86), 0x32) - mstore8(add(mPtr, 0x87), 0x32) - mstore8(add(mPtr, 0x88), 0x2d) - mstore8(add(mPtr, 0x89), 0x50) - mstore8(add(mPtr, 0x8a), 0x6c) - mstore8(add(mPtr, 0x8b), 0x6f) - mstore8(add(mPtr, 0x8c), 0x6e) - mstore8(add(mPtr, 0x8d), 0x6b) - - // size domain - mstore8(add(mPtr, 0x8e), sizeDomain) - - let success := staticcall(gas(), 0x2, mPtr, 0x8f, mPtr, 0x20) - if iszero(success) { - error_sha2_256() - } - - let b0 := mload(mPtr) - - // [b0 || one || dst || sizeDomain] - // <-64bytes -> <- 1 byte each -> - mstore8(add(mPtr, 0x20), one) // 1 - - mstore8(add(mPtr, 0x21), 0x42) // dst - mstore8(add(mPtr, 0x22), 0x53) - mstore8(add(mPtr, 0x23), 0x42) - mstore8(add(mPtr, 0x24), 0x32) - mstore8(add(mPtr, 0x25), 0x32) - mstore8(add(mPtr, 0x26), 0x2d) - mstore8(add(mPtr, 0x27), 0x50) - mstore8(add(mPtr, 0x28), 0x6c) - mstore8(add(mPtr, 0x29), 0x6f) - mstore8(add(mPtr, 0x2a), 0x6e) - mstore8(add(mPtr, 0x2b), 0x6b) - - mstore8(add(mPtr, 0x2c), sizeDomain) // size domain - success := staticcall(gas(), 0x2, mPtr, 0x2d, mPtr, 0x20) - if iszero(success) { - error_sha2_256() - } - - // b1 is located at mPtr. We store b2 at add(mPtr, 0x20) - - // [b0^b1 || two || dst || sizeDomain] - // <-64bytes -> <- 1 byte each -> - mstore(add(mPtr, 0x20), xor(mload(mPtr), b0)) - mstore8(add(mPtr, 0x40), two) - - mstore8(add(mPtr, 0x41), 0x42) // dst - mstore8(add(mPtr, 0x42), 0x53) - mstore8(add(mPtr, 0x43), 0x42) - mstore8(add(mPtr, 0x44), 0x32) - mstore8(add(mPtr, 0x45), 0x32) - mstore8(add(mPtr, 0x46), 0x2d) - mstore8(add(mPtr, 0x47), 0x50) - mstore8(add(mPtr, 0x48), 0x6c) - mstore8(add(mPtr, 0x49), 0x6f) - mstore8(add(mPtr, 0x4a), 0x6e) - mstore8(add(mPtr, 0x4b), 0x6b) - - mstore8(add(mPtr, 0x4c), sizeDomain) // size domain - - let offset := add(mPtr, 0x20) - success := staticcall(gas(), 0x2, offset, 0x2d, offset, 0x20) - if iszero(success) { - error_sha2_256() - } - - // 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] - res := mulmod(mload(mPtr), bb, r_mod) // <- res = 2**128 * mPtr[:32] - offset := add(mPtr, 0x10) - for { - let i := 0 - } lt(i, 0x10) { - i := add(i, 1) - } { - // mPtr <- [xx, xx, .., | 0, 0, .. 0 || b2 ] - mstore8(offset, 0x00) - offset := add(offset, 0x1) - } - let b1 := mload(add(mPtr, 0x10)) // b1 <- [0, 0, .., 0 || b2[:16] ] - res := addmod(res, b1, r_mod) - } - } -} diff --git a/contracts/deploy/09_deploy_TestEIP4844.ts b/contracts/deploy/09_deploy_TestEIP4844.ts deleted file mode 100644 index f8c53cf34..000000000 --- a/contracts/deploy/09_deploy_TestEIP4844.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { ethers } from "hardhat"; -import { DeployFunction } from "hardhat-deploy/types"; -import { deployFromFactory } from "../scripts/hardhat/utils"; -import { get1559Fees } from "../scripts/utils"; -import { LogContractDeployment } from "contracts/common/helpers"; - -const func: DeployFunction = async function () { - const contractName = "TestEIP4844"; - - const provider = ethers.provider; - - const contract = await deployFromFactory(contractName, provider, await get1559Fees(provider)); - await LogContractDeployment(contractName, contract); -}; -export default func; -func.tags = ["TestEIP4844"]; diff --git a/contracts/docs/api/tokenBridge/BridgedToken.mdx b/contracts/docs/api/bridging/token/BridgedToken.mdx similarity index 100% rename from contracts/docs/api/tokenBridge/BridgedToken.mdx rename to contracts/docs/api/bridging/token/BridgedToken.mdx diff --git a/contracts/docs/api/tokenBridge/CustomBridgedToken.mdx b/contracts/docs/api/bridging/token/CustomBridgedToken.mdx similarity index 100% rename from contracts/docs/api/tokenBridge/CustomBridgedToken.mdx rename to contracts/docs/api/bridging/token/CustomBridgedToken.mdx diff --git a/contracts/docs/api/tokenBridge/TokenBridge.mdx b/contracts/docs/api/bridging/token/TokenBridge.mdx similarity index 100% rename from contracts/docs/api/tokenBridge/TokenBridge.mdx rename to contracts/docs/api/bridging/token/TokenBridge.mdx diff --git a/contracts/docs/api/tokenBridge/interfaces/ITokenBridge.mdx b/contracts/docs/api/bridging/token/interfaces/ITokenBridge.mdx similarity index 100% rename from contracts/docs/api/tokenBridge/interfaces/ITokenBridge.mdx rename to contracts/docs/api/bridging/token/interfaces/ITokenBridge.mdx diff --git a/contracts/docs/api/tokenBridge/lib/StorageFiller39.mdx b/contracts/docs/api/bridging/token/utils/StorageFiller39.mdx similarity index 100% rename from contracts/docs/api/tokenBridge/lib/StorageFiller39.mdx rename to contracts/docs/api/bridging/token/utils/StorageFiller39.mdx diff --git a/contracts/docs/api/messageService/lib/TimeLock.mdx b/contracts/docs/api/governance/TimeLock.mdx similarity index 100% rename from contracts/docs/api/messageService/lib/TimeLock.mdx rename to contracts/docs/api/governance/TimeLock.mdx diff --git a/contracts/docs/api/interfaces/l1/IPlonkVerifier.mdx b/contracts/docs/api/interfaces/l1/IPlonkVerifier.mdx deleted file mode 100644 index ecf004e5a..000000000 --- a/contracts/docs/api/interfaces/l1/IPlonkVerifier.mdx +++ /dev/null @@ -1,23 +0,0 @@ -# `IPlonkVerifier` - -### Verify - -```solidity -function Verify(bytes _proof, uint256[] _public_inputs) external returns (bool success) -``` - -Interface for verifier contracts. - -#### Parameters - -| Name | Type | Description | -| ---- | ---- | ----------- | -| _proof | bytes | The proof used to verify. | -| _public_inputs | uint256[] | The computed public inputs for the proof verification. | - -#### Return Values - -| Name | Type | Description | -| ---- | ---- | ----------- | -| success | bool | Returns true if successfully verified. | - diff --git a/contracts/docs/api/lib/CallForwardingProxy.md b/contracts/docs/api/lib/CallForwardingProxy.md deleted file mode 100644 index 57483a27d..000000000 --- a/contracts/docs/api/lib/CallForwardingProxy.md +++ /dev/null @@ -1,26 +0,0 @@ -# Solidity API - -## CallForwardingProxy - -### target - -```solidity -address target -``` - -The underlying target address that is called. - -### constructor - -```solidity -constructor(address _target) public -``` - -### fallback - -```solidity -fallback() external payable -``` - -Defaults to, and forwards all calls to the target address. - diff --git a/contracts/docs/api/lib/CallForwardingProxy.mdx b/contracts/docs/api/lib/CallForwardingProxy.mdx deleted file mode 100644 index 1b008bce6..000000000 --- a/contracts/docs/api/lib/CallForwardingProxy.mdx +++ /dev/null @@ -1,30 +0,0 @@ -# `CallForwardingProxy` - -### TARGET - -```solidity -address TARGET -``` - -The underlying target address that is called. - -### constructor - -```solidity -constructor(address _target) public -``` - -### fallback - -```solidity -fallback() external payable -``` - -Defaults to, and forwards all calls to the target address. - -### receive - -```solidity -receive() external payable -``` - diff --git a/contracts/docs/api/libraries/EfficientLeftRightKeccak.mdx b/contracts/docs/api/libraries/EfficientLeftRightKeccak.mdx new file mode 100644 index 000000000..2bbd23f47 --- /dev/null +++ b/contracts/docs/api/libraries/EfficientLeftRightKeccak.mdx @@ -0,0 +1,32 @@ +# `EfficientLeftRightKeccak` + +### _efficientKeccak + +```solidity +function _efficientKeccak(bytes32 _left, bytes32 _right) internal pure returns (bytes32 value) +``` + +Performs a gas optimized keccak hash for two bytes32 values. + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| _left | bytes32 | Left value. | +| _right | bytes32 | Right value. | + +### _efficientKeccak + +```solidity +function _efficientKeccak(uint256 _left, address _right) internal pure returns (bytes32 value) +``` + +Performs a gas optimized keccak hash for uint256 and address. + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| _left | uint256 | Left value. | +| _right | address | Right value. | + diff --git a/contracts/docs/api/lib/Mimc.mdx b/contracts/docs/api/libraries/Mimc.mdx similarity index 100% rename from contracts/docs/api/lib/Mimc.mdx rename to contracts/docs/api/libraries/Mimc.mdx diff --git a/contracts/docs/api/lib/SparseMerkleProof.mdx b/contracts/docs/api/libraries/SparseMerkleProof.mdx similarity index 100% rename from contracts/docs/api/lib/SparseMerkleProof.mdx rename to contracts/docs/api/libraries/SparseMerkleProof.mdx diff --git a/contracts/docs/api/messageService/lib/TransientStorageHelpers.mdx b/contracts/docs/api/libraries/TransientStorageHelpers.mdx similarity index 100% rename from contracts/docs/api/messageService/lib/TransientStorageHelpers.mdx rename to contracts/docs/api/libraries/TransientStorageHelpers.mdx diff --git a/contracts/docs/api/lib/Utils.mdx b/contracts/docs/api/libraries/Utils.mdx similarity index 100% rename from contracts/docs/api/lib/Utils.mdx rename to contracts/docs/api/libraries/Utils.mdx diff --git a/contracts/docs/api/messageService/MessageServiceBase.mdx b/contracts/docs/api/messaging/MessageServiceBase.mdx similarity index 100% rename from contracts/docs/api/messageService/MessageServiceBase.mdx rename to contracts/docs/api/messaging/MessageServiceBase.mdx diff --git a/contracts/docs/api/interfaces/IMessageService.mdx b/contracts/docs/api/messaging/interfaces/IMessageService.mdx similarity index 100% rename from contracts/docs/api/interfaces/IMessageService.mdx rename to contracts/docs/api/messaging/interfaces/IMessageService.mdx diff --git a/contracts/docs/api/messageService/l1/L1MessageManager.mdx b/contracts/docs/api/messaging/l1/L1MessageManager.mdx similarity index 100% rename from contracts/docs/api/messageService/l1/L1MessageManager.mdx rename to contracts/docs/api/messaging/l1/L1MessageManager.mdx diff --git a/contracts/docs/api/messageService/l1/L1MessageService.mdx b/contracts/docs/api/messaging/l1/L1MessageService.mdx similarity index 100% rename from contracts/docs/api/messageService/l1/L1MessageService.mdx rename to contracts/docs/api/messaging/l1/L1MessageService.mdx diff --git a/contracts/docs/api/interfaces/l1/IL1MessageManager.mdx b/contracts/docs/api/messaging/l1/interfaces/IL1MessageManager.mdx similarity index 100% rename from contracts/docs/api/interfaces/l1/IL1MessageManager.mdx rename to contracts/docs/api/messaging/l1/interfaces/IL1MessageManager.mdx diff --git a/contracts/docs/api/interfaces/l1/IL1MessageService.mdx b/contracts/docs/api/messaging/l1/interfaces/IL1MessageService.mdx similarity index 100% rename from contracts/docs/api/interfaces/l1/IL1MessageService.mdx rename to contracts/docs/api/messaging/l1/interfaces/IL1MessageService.mdx diff --git a/contracts/docs/api/messageService/l1/v1/L1MessageManagerV1.mdx b/contracts/docs/api/messaging/l1/v1/L1MessageManagerV1.mdx similarity index 100% rename from contracts/docs/api/messageService/l1/v1/L1MessageManagerV1.mdx rename to contracts/docs/api/messaging/l1/v1/L1MessageManagerV1.mdx diff --git a/contracts/docs/api/messageService/l1/v1/L1MessageServiceV1.mdx b/contracts/docs/api/messaging/l1/v1/L1MessageServiceV1.mdx similarity index 100% rename from contracts/docs/api/messageService/l1/v1/L1MessageServiceV1.mdx rename to contracts/docs/api/messaging/l1/v1/L1MessageServiceV1.mdx diff --git a/contracts/docs/api/interfaces/l1/IL1MessageManagerV1.mdx b/contracts/docs/api/messaging/l1/v1/interfaces/IL1MessageManagerV1.mdx similarity index 100% rename from contracts/docs/api/interfaces/l1/IL1MessageManagerV1.mdx rename to contracts/docs/api/messaging/l1/v1/interfaces/IL1MessageManagerV1.mdx diff --git a/contracts/docs/api/messageService/l2/L2MessageManager.mdx b/contracts/docs/api/messaging/l2/L2MessageManager.mdx similarity index 100% rename from contracts/docs/api/messageService/l2/L2MessageManager.mdx rename to contracts/docs/api/messaging/l2/L2MessageManager.mdx diff --git a/contracts/docs/api/messageService/l2/L2MessageService.mdx b/contracts/docs/api/messaging/l2/L2MessageService.mdx similarity index 100% rename from contracts/docs/api/messageService/l2/L2MessageService.mdx rename to contracts/docs/api/messaging/l2/L2MessageService.mdx diff --git a/contracts/docs/api/interfaces/l2/IL2MessageManager.mdx b/contracts/docs/api/messaging/l2/interfaces/IL2MessageManager.mdx similarity index 100% rename from contracts/docs/api/interfaces/l2/IL2MessageManager.mdx rename to contracts/docs/api/messaging/l2/interfaces/IL2MessageManager.mdx diff --git a/contracts/docs/api/messageService/l2/v1/L2MessageManagerV1.mdx b/contracts/docs/api/messaging/l2/v1/L2MessageManagerV1.mdx similarity index 100% rename from contracts/docs/api/messageService/l2/v1/L2MessageManagerV1.mdx rename to contracts/docs/api/messaging/l2/v1/L2MessageManagerV1.mdx diff --git a/contracts/docs/api/messageService/l2/v1/L2MessageServiceV1.mdx b/contracts/docs/api/messaging/l2/v1/L2MessageServiceV1.mdx similarity index 100% rename from contracts/docs/api/messageService/l2/v1/L2MessageServiceV1.mdx rename to contracts/docs/api/messaging/l2/v1/L2MessageServiceV1.mdx diff --git a/contracts/docs/api/interfaces/l2/IL2MessageManagerV1.mdx b/contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageManagerV1.mdx similarity index 100% rename from contracts/docs/api/interfaces/l2/IL2MessageManagerV1.mdx rename to contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageManagerV1.mdx diff --git a/contracts/docs/api/interfaces/l2/IL2MessageServiceV1.mdx b/contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageServiceV1.mdx similarity index 100% rename from contracts/docs/api/interfaces/l2/IL2MessageServiceV1.mdx rename to contracts/docs/api/messaging/l2/v1/interfaces/IL2MessageServiceV1.mdx diff --git a/contracts/docs/api/messageService/lib/MessageHashing.mdx b/contracts/docs/api/messaging/libraries/MessageHashing.mdx similarity index 100% rename from contracts/docs/api/messageService/lib/MessageHashing.mdx rename to contracts/docs/api/messaging/libraries/MessageHashing.mdx diff --git a/contracts/docs/api/messageService/lib/SparseMerkleTreeVerifier.mdx b/contracts/docs/api/messaging/libraries/SparseMerkleTreeVerifier.mdx similarity index 100% rename from contracts/docs/api/messageService/lib/SparseMerkleTreeVerifier.mdx rename to contracts/docs/api/messaging/libraries/SparseMerkleTreeVerifier.mdx diff --git a/contracts/docs/api/LineaRollup.mdx b/contracts/docs/api/rollup/LineaRollup.mdx similarity index 100% rename from contracts/docs/api/LineaRollup.mdx rename to contracts/docs/api/rollup/LineaRollup.mdx diff --git a/contracts/docs/api/ZkEvmV2.mdx b/contracts/docs/api/rollup/ZkEvmV2.mdx similarity index 100% rename from contracts/docs/api/ZkEvmV2.mdx rename to contracts/docs/api/rollup/ZkEvmV2.mdx diff --git a/contracts/docs/api/interfaces/l1/ILineaRollup.mdx b/contracts/docs/api/rollup/interfaces/ILineaRollup.mdx similarity index 100% rename from contracts/docs/api/interfaces/l1/ILineaRollup.mdx rename to contracts/docs/api/rollup/interfaces/ILineaRollup.mdx diff --git a/contracts/docs/api/interfaces/l1/IZkEvmV2.mdx b/contracts/docs/api/rollup/interfaces/IZkEvmV2.mdx similarity index 100% rename from contracts/docs/api/interfaces/l1/IZkEvmV2.mdx rename to contracts/docs/api/rollup/interfaces/IZkEvmV2.mdx diff --git a/contracts/docs/api/lib/PermissionsManager.mdx b/contracts/docs/api/security/access/PermissionsManager.mdx similarity index 100% rename from contracts/docs/api/lib/PermissionsManager.mdx rename to contracts/docs/api/security/access/PermissionsManager.mdx diff --git a/contracts/docs/api/interfaces/IPermissionsManager.mdx b/contracts/docs/api/security/access/interfaces/IPermissionsManager.mdx similarity index 100% rename from contracts/docs/api/interfaces/IPermissionsManager.mdx rename to contracts/docs/api/security/access/interfaces/IPermissionsManager.mdx diff --git a/contracts/docs/api/messageService/lib/RateLimiter.mdx b/contracts/docs/api/security/limiting/RateLimiter.mdx similarity index 100% rename from contracts/docs/api/messageService/lib/RateLimiter.mdx rename to contracts/docs/api/security/limiting/RateLimiter.mdx diff --git a/contracts/docs/api/interfaces/IRateLimiter.mdx b/contracts/docs/api/security/limiting/interfaces/IRateLimiter.mdx similarity index 100% rename from contracts/docs/api/interfaces/IRateLimiter.mdx rename to contracts/docs/api/security/limiting/interfaces/IRateLimiter.mdx diff --git a/contracts/docs/api/lib/L2MessageServicePauseManager.mdx b/contracts/docs/api/security/pausing/L2MessageServicePauseManager.mdx similarity index 100% rename from contracts/docs/api/lib/L2MessageServicePauseManager.mdx rename to contracts/docs/api/security/pausing/L2MessageServicePauseManager.mdx diff --git a/contracts/docs/api/lib/LineaRollupPauseManager.mdx b/contracts/docs/api/security/pausing/LineaRollupPauseManager.mdx similarity index 100% rename from contracts/docs/api/lib/LineaRollupPauseManager.mdx rename to contracts/docs/api/security/pausing/LineaRollupPauseManager.mdx diff --git a/contracts/docs/api/lib/PauseManager.mdx b/contracts/docs/api/security/pausing/PauseManager.mdx similarity index 100% rename from contracts/docs/api/lib/PauseManager.mdx rename to contracts/docs/api/security/pausing/PauseManager.mdx diff --git a/contracts/docs/api/lib/TokenBridgePauseManager.mdx b/contracts/docs/api/security/pausing/TokenBridgePauseManager.mdx similarity index 100% rename from contracts/docs/api/lib/TokenBridgePauseManager.mdx rename to contracts/docs/api/security/pausing/TokenBridgePauseManager.mdx diff --git a/contracts/docs/api/interfaces/IPauseManager.mdx b/contracts/docs/api/security/pausing/interfaces/IPauseManager.mdx similarity index 100% rename from contracts/docs/api/interfaces/IPauseManager.mdx rename to contracts/docs/api/security/pausing/interfaces/IPauseManager.mdx diff --git a/contracts/docs/api/messageService/l1/TransientStorageReentrancyGuardUpgradeable.mdx b/contracts/docs/api/security/reentrancy/TransientStorageReentrancyGuardUpgradeable.mdx similarity index 100% rename from contracts/docs/api/messageService/l1/TransientStorageReentrancyGuardUpgradeable.mdx rename to contracts/docs/api/security/reentrancy/TransientStorageReentrancyGuardUpgradeable.mdx diff --git a/contracts/foundry.toml b/contracts/foundry.toml index 92a329340..c7a025b9f 100644 --- a/contracts/foundry.toml +++ b/contracts/foundry.toml @@ -1,5 +1,5 @@ [profile.default] -src = 'contracts' +src = 'src' out = 'out' libs = ['node_modules', 'lib'] cache_path = 'cache_forge' diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index c4e005952..4910756c0 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -30,6 +30,7 @@ const useViaIR = process.env.ENABLE_VIA_IR === "true"; const config: HardhatUserConfig = { paths: { artifacts: "./build", + sources: "./src", }, solidity: { // NB: double check the autoupdate shell script version complies to the latest solidity version if you add a new one. @@ -154,7 +155,7 @@ const config: HardhatUserConfig = { ], }, docgen: { - exclude: ["token", "test-contracts", "proxies", "tools", "interfaces/tools", "tokenBridge/mocks", "verifiers"], + exclude: ["tokens", "_testing", "proxies", "recovery", "verifiers"], pages: "files", outputDir: "docs/api/", // For compatibility with docs.linea.build diff --git a/contracts/scripts/tokenBridge/test/deployTokenBridges.ts b/contracts/scripts/tokenBridge/test/deployTokenBridges.ts index 576e5e6a1..ad87f9e27 100644 --- a/contracts/scripts/tokenBridge/test/deployTokenBridges.ts +++ b/contracts/scripts/tokenBridge/test/deployTokenBridges.ts @@ -3,7 +3,7 @@ import { ethers, upgrades } from "hardhat"; import { TokenBridge } from "../../../typechain-types"; import { SupportedChainIds } from "../../../common/supportedNetworks"; import { deployBridgedTokenBeacon } from "./deployBridgedTokenBeacon"; -import { pauseTypeRoles, unpauseTypeRoles } from "../../../test/common/constants"; +import { pauseTypeRoles, unpauseTypeRoles } from "../../../test/hardhat/common/constants"; import { generateRoleAssignments } from "contracts/common/helpers"; import { TOKEN_BRIDGE_ROLES } from "contracts/common/constants"; diff --git a/contracts/contracts/test-contracts/IntegrationTestTrueVerifier.sol b/contracts/src/_testing/integration/IntegrationTestTrueVerifier.sol similarity index 78% rename from contracts/contracts/test-contracts/IntegrationTestTrueVerifier.sol rename to contracts/src/_testing/integration/IntegrationTestTrueVerifier.sol index 597c55e55..f48795aa3 100644 --- a/contracts/contracts/test-contracts/IntegrationTestTrueVerifier.sol +++ b/contracts/src/_testing/integration/IntegrationTestTrueVerifier.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { IPlonkVerifier } from "../interfaces/l1/IPlonkVerifier.sol"; +import { IPlonkVerifier } from "../../verifiers/interfaces/IPlonkVerifier.sol"; contract IntegrationTestTrueVerifier is IPlonkVerifier { /// @dev Always returns true for quick turnaround testing. diff --git a/contracts/contracts/test-contracts/L2MessageServiceLineaMainnet.sol b/contracts/src/_testing/integration/L2MessageServiceLineaMainnet.sol similarity index 100% rename from contracts/contracts/test-contracts/L2MessageServiceLineaMainnet.sol rename to contracts/src/_testing/integration/L2MessageServiceLineaMainnet.sol diff --git a/contracts/contracts/test-contracts/LineaRollupV5.sol b/contracts/src/_testing/integration/LineaRollupV5.sol similarity index 100% rename from contracts/contracts/test-contracts/LineaRollupV5.sol rename to contracts/src/_testing/integration/LineaRollupV5.sol diff --git a/contracts/contracts/proxies/ProxyAdmin.sol b/contracts/src/_testing/integration/ProxyAdmin.sol similarity index 100% rename from contracts/contracts/proxies/ProxyAdmin.sol rename to contracts/src/_testing/integration/ProxyAdmin.sol diff --git a/contracts/contracts/tokenBridge/mocks/TokenBridgeFlatten.sol b/contracts/src/_testing/integration/TokenBridgeFlatten.sol similarity index 100% rename from contracts/contracts/tokenBridge/mocks/TokenBridgeFlatten.sol rename to contracts/src/_testing/integration/TokenBridgeFlatten.sol diff --git a/contracts/contracts/proxies/TransparentUpgradeableProxy.sol b/contracts/src/_testing/integration/TransparentUpgradeableProxy.sol similarity index 100% rename from contracts/contracts/proxies/TransparentUpgradeableProxy.sol rename to contracts/src/_testing/integration/TransparentUpgradeableProxy.sol diff --git a/contracts/contracts/test-contracts/RevertingVerifier.sol b/contracts/src/_testing/mocks/base/RevertingVerifier.sol similarity index 89% rename from contracts/contracts/test-contracts/RevertingVerifier.sol rename to contracts/src/_testing/mocks/base/RevertingVerifier.sol index 8fdac40d9..2347f007e 100644 --- a/contracts/contracts/test-contracts/RevertingVerifier.sol +++ b/contracts/src/_testing/mocks/base/RevertingVerifier.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { IPlonkVerifier } from "../interfaces/l1/IPlonkVerifier.sol"; +import { IPlonkVerifier } from "../../../verifiers/interfaces/IPlonkVerifier.sol"; /// @dev Test verifier contract that returns true. contract RevertingVerifier is IPlonkVerifier { diff --git a/contracts/contracts/test-contracts/TestClaimingCaller.sol b/contracts/src/_testing/mocks/base/TestClaimingCaller.sol similarity index 81% rename from contracts/contracts/test-contracts/TestClaimingCaller.sol rename to contracts/src/_testing/mocks/base/TestClaimingCaller.sol index db67b8374..96171370c 100644 --- a/contracts/contracts/test-contracts/TestClaimingCaller.sol +++ b/contracts/src/_testing/mocks/base/TestClaimingCaller.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { IMessageService } from "../interfaces/IMessageService.sol"; +import { IMessageService } from "../../../messaging/interfaces/IMessageService.sol"; contract TestClaimingCaller { address private expectedAddress; diff --git a/contracts/contracts/test-contracts/TestL1RevertContract.sol b/contracts/src/_testing/mocks/base/TestL1RevertContract.sol similarity index 100% rename from contracts/contracts/test-contracts/TestL1RevertContract.sol rename to contracts/src/_testing/mocks/base/TestL1RevertContract.sol diff --git a/contracts/contracts/test-contracts/TestReceivingContract.sol b/contracts/src/_testing/mocks/base/TestReceivingContract.sol similarity index 100% rename from contracts/contracts/test-contracts/TestReceivingContract.sol rename to contracts/src/_testing/mocks/base/TestReceivingContract.sol diff --git a/contracts/contracts/tokenBridge/mocks/MockMessageService.sol b/contracts/src/_testing/mocks/bridging/MockMessageService.sol similarity index 93% rename from contracts/contracts/tokenBridge/mocks/MockMessageService.sol rename to contracts/src/_testing/mocks/bridging/MockMessageService.sol index 1b0eeb926..b933e4315 100644 --- a/contracts/contracts/tokenBridge/mocks/MockMessageService.sol +++ b/contracts/src/_testing/mocks/bridging/MockMessageService.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.19; -import { IMessageService } from "../../interfaces/IMessageService.sol"; +import { IMessageService } from "../../../messaging/interfaces/IMessageService.sol"; contract MockMessageService is IMessageService { uint256 public constant CALL_GAS_LIMIT = 1000000; diff --git a/contracts/contracts/tokenBridge/mocks/MessageBridgeV2/MockMessageServiceV2.sol b/contracts/src/_testing/mocks/bridging/MockMessageServiceV2.sol similarity index 88% rename from contracts/contracts/tokenBridge/mocks/MessageBridgeV2/MockMessageServiceV2.sol rename to contracts/src/_testing/mocks/bridging/MockMessageServiceV2.sol index 420f78e59..07596e0c4 100644 --- a/contracts/contracts/tokenBridge/mocks/MessageBridgeV2/MockMessageServiceV2.sol +++ b/contracts/src/_testing/mocks/bridging/MockMessageServiceV2.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity >=0.8.19 <=0.8.26; -import { IMessageService } from "../../../interfaces/IMessageService.sol"; +import { IMessageService } from "../../../messaging/interfaces/IMessageService.sol"; import { IGenericErrors } from "../../../interfaces/IGenericErrors.sol"; -import { LineaRollupPauseManager } from "../../../lib/LineaRollupPauseManager.sol"; -import { L1MessageManager } from "../../../messageService/l1/L1MessageManager.sol"; +import { LineaRollupPauseManager } from "../../../security/pausing/LineaRollupPauseManager.sol"; +import { L1MessageManager } from "../../../messaging/l1/L1MessageManager.sol"; contract MockMessageServiceV2 is L1MessageManager, IMessageService, LineaRollupPauseManager, IGenericErrors { address internal messageSender = address(0); diff --git a/contracts/contracts/tokenBridge/mocks/MockTokenBridge.sol b/contracts/src/_testing/mocks/bridging/MockTokenBridge.sol similarity index 76% rename from contracts/contracts/tokenBridge/mocks/MockTokenBridge.sol rename to contracts/src/_testing/mocks/bridging/MockTokenBridge.sol index a2ff67338..5e60f5960 100644 --- a/contracts/contracts/tokenBridge/mocks/MockTokenBridge.sol +++ b/contracts/src/_testing/mocks/bridging/MockTokenBridge.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.19; -import { TokenBridge } from "../TokenBridge.sol"; +import { TokenBridge } from "../../../bridging/token/TokenBridge.sol"; contract MockTokenBridge is TokenBridge { function setNativeMappingValue(address token, address value) external { diff --git a/contracts/contracts/tokenBridge/mocks/TestTokenBridge.sol b/contracts/src/_testing/mocks/bridging/TestTokenBridge.sol similarity index 77% rename from contracts/contracts/tokenBridge/mocks/TestTokenBridge.sol rename to contracts/src/_testing/mocks/bridging/TestTokenBridge.sol index fdf8e926b..75796e338 100644 --- a/contracts/contracts/tokenBridge/mocks/TestTokenBridge.sol +++ b/contracts/src/_testing/mocks/bridging/TestTokenBridge.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.19; -import { TokenBridge } from "../TokenBridge.sol"; +import { TokenBridge } from "../../../bridging/token/TokenBridge.sol"; contract TestTokenBridge is TokenBridge { function testReturnDataToString(bytes memory _data) public pure returns (string memory) { diff --git a/contracts/contracts/tokenBridge/mocks/UpgradedBridgedToken.sol b/contracts/src/_testing/mocks/bridging/UpgradedBridgedToken.sol similarity index 72% rename from contracts/contracts/tokenBridge/mocks/UpgradedBridgedToken.sol rename to contracts/src/_testing/mocks/bridging/UpgradedBridgedToken.sol index fcdca2bcf..723a744e5 100644 --- a/contracts/contracts/tokenBridge/mocks/UpgradedBridgedToken.sol +++ b/contracts/src/_testing/mocks/bridging/UpgradedBridgedToken.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.19; -import { BridgedToken } from "../BridgedToken.sol"; +import { BridgedToken } from "../../../bridging/token/BridgedToken.sol"; contract UpgradedBridgedToken is BridgedToken { function isUpgraded() external pure returns (bool) { diff --git a/contracts/contracts/tokenBridge/mocks/Reentrancy/MaliciousERC777.sol b/contracts/src/_testing/mocks/security/reentrancy/MaliciousERC777.sol similarity index 100% rename from contracts/contracts/tokenBridge/mocks/Reentrancy/MaliciousERC777.sol rename to contracts/src/_testing/mocks/security/reentrancy/MaliciousERC777.sol diff --git a/contracts/contracts/tokenBridge/mocks/Reentrancy/ReentrancyContract.sol b/contracts/src/_testing/mocks/security/reentrancy/ReentrancyContract.sol similarity index 92% rename from contracts/contracts/tokenBridge/mocks/Reentrancy/ReentrancyContract.sol rename to contracts/src/_testing/mocks/security/reentrancy/ReentrancyContract.sol index 9a071b18b..9868204cf 100644 --- a/contracts/contracts/tokenBridge/mocks/Reentrancy/ReentrancyContract.sol +++ b/contracts/src/_testing/mocks/security/reentrancy/ReentrancyContract.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; -import { TokenBridge } from "../../TokenBridge.sol"; +import { TokenBridge } from "../../../../bridging/token/TokenBridge.sol"; contract ReentrancyContract { // The Linea `TokenBridge` contract diff --git a/contracts/contracts/tokenBridge/mocks/ERC20MintBurn.sol b/contracts/src/_testing/mocks/tokens/ERC20MintBurn.sol similarity index 100% rename from contracts/contracts/tokenBridge/mocks/ERC20MintBurn.sol rename to contracts/src/_testing/mocks/tokens/ERC20MintBurn.sol diff --git a/contracts/contracts/tokenBridge/mocks/ERC20NoNameMintBurn.sol b/contracts/src/_testing/mocks/tokens/ERC20NoNameMintBurn.sol similarity index 100% rename from contracts/contracts/tokenBridge/mocks/ERC20NoNameMintBurn.sol rename to contracts/src/_testing/mocks/tokens/ERC20NoNameMintBurn.sol diff --git a/contracts/contracts/tokenBridge/mocks/ERC20UnknownDecimals.sol b/contracts/src/_testing/mocks/tokens/ERC20UnknownDecimals.sol similarity index 100% rename from contracts/contracts/tokenBridge/mocks/ERC20UnknownDecimals.sol rename to contracts/src/_testing/mocks/tokens/ERC20UnknownDecimals.sol diff --git a/contracts/contracts/tokenBridge/mocks/ERC20WeirdNameSymbol.sol b/contracts/src/_testing/mocks/tokens/ERC20WeirdNameSymbol.sol similarity index 100% rename from contracts/contracts/tokenBridge/mocks/ERC20WeirdNameSymbol.sol rename to contracts/src/_testing/mocks/tokens/ERC20WeirdNameSymbol.sol diff --git a/contracts/contracts/tokenBridge/mocks/ERCFees.sol b/contracts/src/_testing/mocks/tokens/ERCFees.sol similarity index 100% rename from contracts/contracts/tokenBridge/mocks/ERCFees.sol rename to contracts/src/_testing/mocks/tokens/ERCFees.sol diff --git a/contracts/contracts/tokenBridge/mocks/TestERC20.sol b/contracts/src/_testing/mocks/tokens/TestERC20.sol similarity index 100% rename from contracts/contracts/tokenBridge/mocks/TestERC20.sol rename to contracts/src/_testing/mocks/tokens/TestERC20.sol diff --git a/contracts/contracts/test-contracts/TestExternalCalls.sol b/contracts/src/_testing/unit/TestExternalCalls.sol similarity index 100% rename from contracts/contracts/test-contracts/TestExternalCalls.sol rename to contracts/src/_testing/unit/TestExternalCalls.sol diff --git a/contracts/src/_testing/unit/libraries/TestEfficientLeftRightKeccak.sol b/contracts/src/_testing/unit/libraries/TestEfficientLeftRightKeccak.sol new file mode 100644 index 000000000..2cbd0e049 --- /dev/null +++ b/contracts/src/_testing/unit/libraries/TestEfficientLeftRightKeccak.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: AGPL-3.0 +pragma solidity 0.8.26; + +import { EfficientLeftRightKeccak } from "../../../libraries/EfficientLeftRightKeccak.sol"; + +contract TestEfficientLeftRightKeccak { + function efficientKeccak(bytes32 _left, bytes32 _right) external pure returns (bytes32 value) { + return EfficientLeftRightKeccak._efficientKeccak(_left, _right); + } +} diff --git a/contracts/contracts/test-contracts/TestL1MessageManager.sol b/contracts/src/_testing/unit/messaging/TestL1MessageManager.sol similarity index 94% rename from contracts/contracts/test-contracts/TestL1MessageManager.sol rename to contracts/src/_testing/unit/messaging/TestL1MessageManager.sol index 5b0705f5e..91f1a2614 100644 --- a/contracts/contracts/test-contracts/TestL1MessageManager.sol +++ b/contracts/src/_testing/unit/messaging/TestL1MessageManager.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { L1MessageManager } from "../messageService/l1/L1MessageManager.sol"; +import { L1MessageManager } from "../../../messaging/l1/L1MessageManager.sol"; contract TestL1MessageManager is L1MessageManager { /** diff --git a/contracts/contracts/test-contracts/TestL1MessageService.sol b/contracts/src/_testing/unit/messaging/TestL1MessageService.sol similarity index 94% rename from contracts/contracts/test-contracts/TestL1MessageService.sol rename to contracts/src/_testing/unit/messaging/TestL1MessageService.sol index b4032bc4c..61ff28806 100644 --- a/contracts/contracts/test-contracts/TestL1MessageService.sol +++ b/contracts/src/_testing/unit/messaging/TestL1MessageService.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { L1MessageService } from "../messageService/l1/L1MessageService.sol"; -import { TestSetPauseTypeRoles } from "./TestSetPauseTypeRoles.sol"; +import { L1MessageService } from "../../../messaging/l1/L1MessageService.sol"; +import { TestSetPauseTypeRoles } from "../security/TestSetPauseTypeRoles.sol"; contract TestL1MessageService is L1MessageService, TestSetPauseTypeRoles { /** diff --git a/contracts/contracts/test-contracts/TestL1MessageServiceMerkleProof.sol b/contracts/src/_testing/unit/messaging/TestL1MessageServiceMerkleProof.sol similarity index 91% rename from contracts/contracts/test-contracts/TestL1MessageServiceMerkleProof.sol rename to contracts/src/_testing/unit/messaging/TestL1MessageServiceMerkleProof.sol index 456bd01d5..b53f31853 100644 --- a/contracts/contracts/test-contracts/TestL1MessageServiceMerkleProof.sol +++ b/contracts/src/_testing/unit/messaging/TestL1MessageServiceMerkleProof.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { L1MessageService } from "../messageService/l1/L1MessageService.sol"; -import { IL1MessageService } from "../interfaces/l1/IL1MessageService.sol"; -import { TestSetPauseTypeRoles } from "./TestSetPauseTypeRoles.sol"; +import { L1MessageService } from "../../../messaging/l1/L1MessageService.sol"; +import { IL1MessageService } from "../../../messaging/l1/interfaces/IL1MessageService.sol"; +import { TestSetPauseTypeRoles } from "../security/TestSetPauseTypeRoles.sol"; interface ITestL1MessageService { function claimMessageWithProof(IL1MessageService.ClaimMessageWithProofParams calldata _params) external; diff --git a/contracts/contracts/test-contracts/TestL2MessageManager.sol b/contracts/src/_testing/unit/messaging/TestL2MessageManager.sol similarity index 85% rename from contracts/contracts/test-contracts/TestL2MessageManager.sol rename to contracts/src/_testing/unit/messaging/TestL2MessageManager.sol index 435f2c97e..1b64df924 100644 --- a/contracts/contracts/test-contracts/TestL2MessageManager.sol +++ b/contracts/src/_testing/unit/messaging/TestL2MessageManager.sol @@ -2,9 +2,9 @@ pragma solidity 0.8.19; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; -import { L2MessageManager } from "../messageService/l2/L2MessageManager.sol"; -import { IGenericErrors } from "../interfaces/IGenericErrors.sol"; -import { TestSetPauseTypeRoles } from "./TestSetPauseTypeRoles.sol"; +import { L2MessageManager } from "../../../messaging/l2/L2MessageManager.sol"; +import { IGenericErrors } from "../../../interfaces/IGenericErrors.sol"; +import { TestSetPauseTypeRoles } from "../security/TestSetPauseTypeRoles.sol"; contract TestL2MessageManager is Initializable, L2MessageManager, IGenericErrors, TestSetPauseTypeRoles { /// @custom:oz-upgrades-unsafe-allow constructor diff --git a/contracts/contracts/test-contracts/TestL2MessageService.sol b/contracts/src/_testing/unit/messaging/TestL2MessageService.sol similarity index 96% rename from contracts/contracts/test-contracts/TestL2MessageService.sol rename to contracts/src/_testing/unit/messaging/TestL2MessageService.sol index cf7e5b16f..9b1f4bce6 100644 --- a/contracts/contracts/test-contracts/TestL2MessageService.sol +++ b/contracts/src/_testing/unit/messaging/TestL2MessageService.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.19; -import { L2MessageService } from "../messageService/l2/L2MessageService.sol"; +import { L2MessageService } from "../../../messaging/l2/L2MessageService.sol"; contract TestL2MessageService is L2MessageService { address public originalSender; diff --git a/contracts/contracts/test-contracts/TestMessageServiceBase.sol b/contracts/src/_testing/unit/messaging/TestMessageServiceBase.sol similarity index 90% rename from contracts/contracts/test-contracts/TestMessageServiceBase.sol rename to contracts/src/_testing/unit/messaging/TestMessageServiceBase.sol index 63b548b9f..2c7a3c10b 100644 --- a/contracts/contracts/test-contracts/TestMessageServiceBase.sol +++ b/contracts/src/_testing/unit/messaging/TestMessageServiceBase.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity >=0.8.19 <=0.8.26; -import { MessageServiceBase } from "../messageService/MessageServiceBase.sol"; +import { MessageServiceBase } from "../../../messaging/MessageServiceBase.sol"; contract TestMessageServiceBase is MessageServiceBase { function initialize(address _messageService, address _remoteSender) external initializer { diff --git a/contracts/contracts/test-contracts/TestSparseMerkleTreeVerifier.sol b/contracts/src/_testing/unit/messaging/TestSparseMerkleTreeVerifier.sol similarity index 75% rename from contracts/contracts/test-contracts/TestSparseMerkleTreeVerifier.sol rename to contracts/src/_testing/unit/messaging/TestSparseMerkleTreeVerifier.sol index b595b7872..09e1c94bd 100644 --- a/contracts/contracts/test-contracts/TestSparseMerkleTreeVerifier.sol +++ b/contracts/src/_testing/unit/messaging/TestSparseMerkleTreeVerifier.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { SparseMerkleTreeVerifier } from "../messageService/lib/SparseMerkleTreeVerifier.sol"; -import { Utils } from "../lib/Utils.sol"; +import { SparseMerkleTreeVerifier } from "../../../messaging/libraries/SparseMerkleTreeVerifier.sol"; +import { EfficientLeftRightKeccak } from "../../../libraries/EfficientLeftRightKeccak.sol"; contract TestSparseMerkleTreeVerifier { using SparseMerkleTreeVerifier for *; - using Utils for *; + using EfficientLeftRightKeccak for *; function verifyMerkleProof( bytes32 _leafHash, @@ -18,7 +18,7 @@ contract TestSparseMerkleTreeVerifier { } function efficientKeccak(bytes32 _left, bytes32 _right) external pure returns (bytes32 value) { - return Utils._efficientKeccak(_left, _right); + return EfficientLeftRightKeccak._efficientKeccak(_left, _right); } function testSafeCastToUint32(uint256 _value) external pure returns (uint32) { diff --git a/contracts/contracts/test-contracts/ErrorAndDestructionTesting.sol b/contracts/src/_testing/unit/opcodes/ErrorAndDestructionTesting.sol similarity index 100% rename from contracts/contracts/test-contracts/ErrorAndDestructionTesting.sol rename to contracts/src/_testing/unit/opcodes/ErrorAndDestructionTesting.sol diff --git a/contracts/contracts/test-contracts/LondonEvmCodes.yul b/contracts/src/_testing/unit/opcodes/LondonEvmCodes.yul similarity index 100% rename from contracts/contracts/test-contracts/LondonEvmCodes.yul rename to contracts/src/_testing/unit/opcodes/LondonEvmCodes.yul diff --git a/contracts/contracts/test-contracts/OpcodeTestContract.sol b/contracts/src/_testing/unit/opcodes/OpcodeTestContract.sol similarity index 100% rename from contracts/contracts/test-contracts/OpcodeTestContract.sol rename to contracts/src/_testing/unit/opcodes/OpcodeTestContract.sol diff --git a/contracts/contracts/test-contracts/OpcodeTester.sol b/contracts/src/_testing/unit/opcodes/OpcodeTester.sol similarity index 100% rename from contracts/contracts/test-contracts/OpcodeTester.sol rename to contracts/src/_testing/unit/opcodes/OpcodeTester.sol diff --git a/contracts/contracts/test-contracts/TestLineaRollup.sol b/contracts/src/_testing/unit/rollup/TestLineaRollup.sol similarity index 96% rename from contracts/contracts/test-contracts/TestLineaRollup.sol rename to contracts/src/_testing/unit/rollup/TestLineaRollup.sol index 17083ba45..823a82381 100644 --- a/contracts/contracts/test-contracts/TestLineaRollup.sol +++ b/contracts/src/_testing/unit/rollup/TestLineaRollup.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { LineaRollup } from "../LineaRollup.sol"; +import { LineaRollup } from "../../../rollup/LineaRollup.sol"; contract TestLineaRollup is LineaRollup { function addRollingHash(uint256 _messageNumber, bytes32 _messageHash) external { diff --git a/contracts/contracts/test-contracts/TestLineaRollupV5.sol b/contracts/src/_testing/unit/rollup/TestLineaRollupV5.sol similarity index 83% rename from contracts/contracts/test-contracts/TestLineaRollupV5.sol rename to contracts/src/_testing/unit/rollup/TestLineaRollupV5.sol index 6c880cb7d..6388810be 100644 --- a/contracts/contracts/test-contracts/TestLineaRollupV5.sol +++ b/contracts/src/_testing/unit/rollup/TestLineaRollupV5.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.24; -import { LineaRollupV5 } from "./LineaRollupV5.sol"; +import { LineaRollupV5 } from "../../integration/LineaRollupV5.sol"; contract TestLineaRollupV5 is LineaRollupV5 { function setDefaultShnarfExistValue(bytes32 _shnarf) external { diff --git a/contracts/contracts/test-contracts/TestPauseManager.sol b/contracts/src/_testing/unit/security/TestPauseManager.sol similarity index 86% rename from contracts/contracts/test-contracts/TestPauseManager.sol rename to contracts/src/_testing/unit/security/TestPauseManager.sol index 5e7084f1a..756225ba8 100644 --- a/contracts/contracts/test-contracts/TestPauseManager.sol +++ b/contracts/src/_testing/unit/security/TestPauseManager.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity >=0.8.19 <=0.8.26; -import { PauseManager } from "../lib/PauseManager.sol"; +import { PauseManager } from "../../../security/pausing/PauseManager.sol"; import { TestSetPauseTypeRoles } from "./TestSetPauseTypeRoles.sol"; contract TestPauseManager is PauseManager, TestSetPauseTypeRoles { diff --git a/contracts/contracts/test-contracts/TestRateLimiter.sol b/contracts/src/_testing/unit/security/TestRateLimiter.sol similarity index 91% rename from contracts/contracts/test-contracts/TestRateLimiter.sol rename to contracts/src/_testing/unit/security/TestRateLimiter.sol index b60cde25b..1d0b9c738 100644 --- a/contracts/contracts/test-contracts/TestRateLimiter.sol +++ b/contracts/src/_testing/unit/security/TestRateLimiter.sol @@ -2,7 +2,7 @@ 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"; +import { RateLimiter } from "../../../security/limiting/RateLimiter.sol"; contract TestRateLimiter is Initializable, RateLimiter { // we need eth to test the limits with diff --git a/contracts/contracts/test-contracts/TestSetPauseTypeRoles.sol b/contracts/src/_testing/unit/security/TestSetPauseTypeRoles.sol similarity index 82% rename from contracts/contracts/test-contracts/TestSetPauseTypeRoles.sol rename to contracts/src/_testing/unit/security/TestSetPauseTypeRoles.sol index cd384c022..643ab63cd 100644 --- a/contracts/contracts/test-contracts/TestSetPauseTypeRoles.sol +++ b/contracts/src/_testing/unit/security/TestSetPauseTypeRoles.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity >=0.8.19 <=0.8.26; -import { PauseManager } from "../lib/PauseManager.sol"; +import { PauseManager } from "../../../security/pausing/PauseManager.sol"; contract TestSetPauseTypeRoles is PauseManager { function initializePauseTypesAndPermissions( diff --git a/contracts/contracts/test-contracts/TestLineaSurgeXP.sol b/contracts/src/_testing/unit/tokens/TestLineaSurgeXP.sol similarity index 100% rename from contracts/contracts/test-contracts/TestLineaSurgeXP.sol rename to contracts/src/_testing/unit/tokens/TestLineaSurgeXP.sol diff --git a/contracts/contracts/verifiers/test/TestPlonkVerifierForDataAggregation.sol b/contracts/src/_testing/unit/verifiers/TestPlonkVerifierForDataAggregation.sol similarity index 100% rename from contracts/contracts/verifiers/test/TestPlonkVerifierForDataAggregation.sol rename to contracts/src/_testing/unit/verifiers/TestPlonkVerifierForDataAggregation.sol diff --git a/contracts/contracts/tokenBridge/BridgedToken.sol b/contracts/src/bridging/token/BridgedToken.sol similarity index 100% rename from contracts/contracts/tokenBridge/BridgedToken.sol rename to contracts/src/bridging/token/BridgedToken.sol diff --git a/contracts/contracts/tokenBridge/CustomBridgedToken.sol b/contracts/src/bridging/token/CustomBridgedToken.sol similarity index 100% rename from contracts/contracts/tokenBridge/CustomBridgedToken.sol rename to contracts/src/bridging/token/CustomBridgedToken.sol diff --git a/contracts/contracts/tokenBridge/TokenBridge.sol b/contracts/src/bridging/token/TokenBridge.sol similarity index 97% rename from contracts/contracts/tokenBridge/TokenBridge.sol rename to contracts/src/bridging/token/TokenBridge.sol index 8c0bad578..175443740 100644 --- a/contracts/contracts/tokenBridge/TokenBridge.sol +++ b/contracts/src/bridging/token/TokenBridge.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.19; import { ITokenBridge } from "./interfaces/ITokenBridge.sol"; -import { IMessageService } from "../interfaces/IMessageService.sol"; +import { IMessageService } from "../../messaging/interfaces/IMessageService.sol"; import { IERC20PermitUpgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol"; import { IERC20MetadataUpgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol"; @@ -12,14 +12,14 @@ import { BeaconProxy } from "@openzeppelin/contracts/proxy/beacon/BeaconProxy.so import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import { BridgedToken } from "./BridgedToken.sol"; -import { MessageServiceBase } from "../messageService/MessageServiceBase.sol"; +import { MessageServiceBase } from "../../messaging/MessageServiceBase.sol"; -import { TokenBridgePauseManager } from "../lib/TokenBridgePauseManager.sol"; +import { TokenBridgePauseManager } from "../../security/pausing/TokenBridgePauseManager.sol"; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; -import { StorageFiller39 } from "./lib/StorageFiller39.sol"; -import { PermissionsManager } from "../lib/PermissionsManager.sol"; +import { StorageFiller39 } from "./utils/StorageFiller39.sol"; +import { PermissionsManager } from "../../security/access/PermissionsManager.sol"; -import { Utils } from "../lib/Utils.sol"; +import { EfficientLeftRightKeccak } from "../../libraries/EfficientLeftRightKeccak.sol"; /** * @title Linea Canonical Token Bridge * @notice Contract to manage cross-chain ERC20 bridging. @@ -35,7 +35,7 @@ contract TokenBridge is PermissionsManager, StorageFiller39 { - using Utils for *; + using EfficientLeftRightKeccak for *; using SafeERC20Upgradeable for IERC20Upgradeable; /// @dev This is the ABI version and not the reinitialize version. @@ -444,7 +444,7 @@ contract TokenBridge is uint256 _chainId ) internal returns (address bridgedTokenAddress) { bridgedTokenAddress = address( - new BeaconProxy{ salt: Utils._efficientKeccak(_chainId, _nativeToken) }(tokenBeacon, "") + new BeaconProxy{ salt: EfficientLeftRightKeccak._efficientKeccak(_chainId, _nativeToken) }(tokenBeacon, "") ); (string memory name, string memory symbol, uint8 decimals) = abi.decode(_tokenMetadata, (string, string, uint8)); diff --git a/contracts/contracts/tokenBridge/interfaces/ITokenBridge.sol b/contracts/src/bridging/token/interfaces/ITokenBridge.sol similarity index 98% rename from contracts/contracts/tokenBridge/interfaces/ITokenBridge.sol rename to contracts/src/bridging/token/interfaces/ITokenBridge.sol index 7efdfd817..4bb6cccde 100644 --- a/contracts/contracts/tokenBridge/interfaces/ITokenBridge.sol +++ b/contracts/src/bridging/token/interfaces/ITokenBridge.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.19; -import { IPauseManager } from "../../interfaces/IPauseManager.sol"; -import { IPermissionsManager } from "../../interfaces/IPermissionsManager.sol"; +import { IPauseManager } from "../../../security/pausing/interfaces/IPauseManager.sol"; +import { IPermissionsManager } from "../../../security/access/interfaces/IPermissionsManager.sol"; /** * @title Interface declaring Canonical Token Bridge struct, functions, events and errors. diff --git a/contracts/contracts/tokenBridge/lib/StorageFiller39.sol b/contracts/src/bridging/token/utils/StorageFiller39.sol similarity index 100% rename from contracts/contracts/tokenBridge/lib/StorageFiller39.sol rename to contracts/src/bridging/token/utils/StorageFiller39.sol diff --git a/contracts/contracts/messageService/lib/TimeLock.sol b/contracts/src/governance/TimeLock.sol similarity index 100% rename from contracts/contracts/messageService/lib/TimeLock.sol rename to contracts/src/governance/TimeLock.sol diff --git a/contracts/contracts/interfaces/IGenericErrors.sol b/contracts/src/interfaces/IGenericErrors.sol similarity index 100% rename from contracts/contracts/interfaces/IGenericErrors.sol rename to contracts/src/interfaces/IGenericErrors.sol diff --git a/contracts/contracts/lib/Utils.sol b/contracts/src/libraries/EfficientLeftRightKeccak.sol similarity index 96% rename from contracts/contracts/lib/Utils.sol rename to contracts/src/libraries/EfficientLeftRightKeccak.sol index 4174a1073..1bbdbaa8c 100644 --- a/contracts/contracts/lib/Utils.sol +++ b/contracts/src/libraries/EfficientLeftRightKeccak.sol @@ -6,7 +6,7 @@ pragma solidity >=0.8.19 <=0.8.26; * @author ConsenSys Software Inc. * @custom:security-contact security-report@linea.build */ -library Utils { +library EfficientLeftRightKeccak { /** * @notice Performs a gas optimized keccak hash for two bytes32 values. * @param _left Left value. diff --git a/contracts/contracts/lib/Mimc.sol b/contracts/src/libraries/Mimc.sol similarity index 100% rename from contracts/contracts/lib/Mimc.sol rename to contracts/src/libraries/Mimc.sol diff --git a/contracts/contracts/lib/SparseMerkleProof.sol b/contracts/src/libraries/SparseMerkleProof.sol similarity index 100% rename from contracts/contracts/lib/SparseMerkleProof.sol rename to contracts/src/libraries/SparseMerkleProof.sol diff --git a/contracts/contracts/messageService/lib/TransientStorageHelpers.sol b/contracts/src/libraries/TransientStorageHelpers.sol similarity index 100% rename from contracts/contracts/messageService/lib/TransientStorageHelpers.sol rename to contracts/src/libraries/TransientStorageHelpers.sol diff --git a/contracts/contracts/messageService/MessageServiceBase.sol b/contracts/src/messaging/MessageServiceBase.sol similarity index 97% rename from contracts/contracts/messageService/MessageServiceBase.sol rename to contracts/src/messaging/MessageServiceBase.sol index 77c2957aa..7434e6d16 100644 --- a/contracts/contracts/messageService/MessageServiceBase.sol +++ b/contracts/src/messaging/MessageServiceBase.sol @@ -2,7 +2,7 @@ pragma solidity >=0.8.19 <=0.8.26; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; -import { IMessageService } from "../interfaces/IMessageService.sol"; +import { IMessageService } from "./interfaces/IMessageService.sol"; import { IGenericErrors } from "../interfaces/IGenericErrors.sol"; /** diff --git a/contracts/contracts/interfaces/IMessageService.sol b/contracts/src/messaging/interfaces/IMessageService.sol similarity index 100% rename from contracts/contracts/interfaces/IMessageService.sol rename to contracts/src/messaging/interfaces/IMessageService.sol diff --git a/contracts/contracts/messageService/l1/L1MessageManager.sol b/contracts/src/messaging/l1/L1MessageManager.sol similarity index 92% rename from contracts/contracts/messageService/l1/L1MessageManager.sol rename to contracts/src/messaging/l1/L1MessageManager.sol index 1afe831ae..3256beacf 100644 --- a/contracts/contracts/messageService/l1/L1MessageManager.sol +++ b/contracts/src/messaging/l1/L1MessageManager.sol @@ -3,8 +3,8 @@ pragma solidity 0.8.26; import { BitMaps } from "@openzeppelin/contracts/utils/structs/BitMaps.sol"; import { L1MessageManagerV1 } from "./v1/L1MessageManagerV1.sol"; -import { IL1MessageManager } from "../../interfaces/l1/IL1MessageManager.sol"; -import { Utils } from "../../lib/Utils.sol"; +import { IL1MessageManager } from "./interfaces/IL1MessageManager.sol"; +import { EfficientLeftRightKeccak } from "../../libraries/EfficientLeftRightKeccak.sol"; /** * @title Contract to manage cross-chain message rolling hash computation and storage on L1. @@ -13,7 +13,7 @@ import { Utils } from "../../lib/Utils.sol"; */ abstract contract L1MessageManager is L1MessageManagerV1, IL1MessageManager { using BitMaps for BitMaps.BitMap; - using Utils for *; + using EfficientLeftRightKeccak for *; /// @notice Contains the L1 to L2 messaging rolling hashes mapped to message number computed on L1. mapping(uint256 messageNumber => bytes32 rollingHash) public rollingHashes; @@ -35,7 +35,7 @@ abstract contract L1MessageManager is L1MessageManagerV1, IL1MessageManager { */ function _addRollingHash(uint256 _messageNumber, bytes32 _messageHash) internal { unchecked { - bytes32 newRollingHash = Utils._efficientKeccak(rollingHashes[_messageNumber - 1], _messageHash); + bytes32 newRollingHash = EfficientLeftRightKeccak._efficientKeccak(rollingHashes[_messageNumber - 1], _messageHash); rollingHashes[_messageNumber] = newRollingHash; emit RollingHashUpdated(_messageNumber, newRollingHash, _messageHash); diff --git a/contracts/contracts/messageService/l1/L1MessageService.sol b/contracts/src/messaging/l1/L1MessageService.sol similarity index 94% rename from contracts/contracts/messageService/l1/L1MessageService.sol rename to contracts/src/messaging/l1/L1MessageService.sol index a8e18f897..5a02ecb0c 100644 --- a/contracts/contracts/messageService/l1/L1MessageService.sol +++ b/contracts/src/messaging/l1/L1MessageService.sol @@ -4,11 +4,11 @@ pragma solidity 0.8.26; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import { L1MessageServiceV1 } from "./v1/L1MessageServiceV1.sol"; import { L1MessageManager } from "./L1MessageManager.sol"; -import { IL1MessageService } from "../../interfaces/l1/IL1MessageService.sol"; +import { IL1MessageService } from "./interfaces/IL1MessageService.sol"; import { IGenericErrors } from "../../interfaces/IGenericErrors.sol"; -import { SparseMerkleTreeVerifier } from "../lib/SparseMerkleTreeVerifier.sol"; -import { TransientStorageHelpers } from "../lib/TransientStorageHelpers.sol"; -import { MessageHashing } from "../lib/MessageHashing.sol"; +import { SparseMerkleTreeVerifier } from "../libraries/SparseMerkleTreeVerifier.sol"; +import { TransientStorageHelpers } from "../../libraries/TransientStorageHelpers.sol"; +import { MessageHashing } from "../libraries/MessageHashing.sol"; /** * @title Contract to manage cross-chain messaging on L1. diff --git a/contracts/contracts/interfaces/l1/IL1MessageManager.sol b/contracts/src/messaging/l1/interfaces/IL1MessageManager.sol similarity index 100% rename from contracts/contracts/interfaces/l1/IL1MessageManager.sol rename to contracts/src/messaging/l1/interfaces/IL1MessageManager.sol diff --git a/contracts/contracts/interfaces/l1/IL1MessageService.sol b/contracts/src/messaging/l1/interfaces/IL1MessageService.sol similarity index 100% rename from contracts/contracts/interfaces/l1/IL1MessageService.sol rename to contracts/src/messaging/l1/interfaces/IL1MessageService.sol diff --git a/contracts/contracts/messageService/l1/v1/L1MessageManagerV1.sol b/contracts/src/messaging/l1/v1/L1MessageManagerV1.sol similarity index 96% rename from contracts/contracts/messageService/l1/v1/L1MessageManagerV1.sol rename to contracts/src/messaging/l1/v1/L1MessageManagerV1.sol index ca808b53e..1c98962f9 100644 --- a/contracts/contracts/messageService/l1/v1/L1MessageManagerV1.sol +++ b/contracts/src/messaging/l1/v1/L1MessageManagerV1.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { IL1MessageManagerV1 } from "../../../interfaces/l1/IL1MessageManagerV1.sol"; +import { IL1MessageManagerV1 } from "./interfaces/IL1MessageManagerV1.sol"; /** * @title Contract to manage cross-chain message hashes storage and status on L1. diff --git a/contracts/contracts/messageService/l1/v1/L1MessageServiceV1.sol b/contracts/src/messaging/l1/v1/L1MessageServiceV1.sol similarity index 90% rename from contracts/contracts/messageService/l1/v1/L1MessageServiceV1.sol rename to contracts/src/messaging/l1/v1/L1MessageServiceV1.sol index fce768940..7dc946a9d 100644 --- a/contracts/contracts/messageService/l1/v1/L1MessageServiceV1.sol +++ b/contracts/src/messaging/l1/v1/L1MessageServiceV1.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { LineaRollupPauseManager } from "../../../lib/LineaRollupPauseManager.sol"; -import { RateLimiter } from "../../lib/RateLimiter.sol"; +import { LineaRollupPauseManager } from "../../../security/pausing/LineaRollupPauseManager.sol"; +import { RateLimiter } from "../../../security/limiting/RateLimiter.sol"; import { L1MessageManagerV1 } from "./L1MessageManagerV1.sol"; -import { TransientStorageReentrancyGuardUpgradeable } from "../TransientStorageReentrancyGuardUpgradeable.sol"; -import { IMessageService } from "../../../interfaces/IMessageService.sol"; -import { TransientStorageHelpers } from "../../lib/TransientStorageHelpers.sol"; -import { MessageHashing } from "../../lib/MessageHashing.sol"; +import { TransientStorageReentrancyGuardUpgradeable } from "../../../security/reentrancy/TransientStorageReentrancyGuardUpgradeable.sol"; +import { IMessageService } from "../../interfaces/IMessageService.sol"; +import { TransientStorageHelpers } from "../../../libraries/TransientStorageHelpers.sol"; +import { MessageHashing } from "../../libraries/MessageHashing.sol"; /** * @title Contract to manage cross-chain messaging on L1. diff --git a/contracts/contracts/interfaces/l1/IL1MessageManagerV1.sol b/contracts/src/messaging/l1/v1/interfaces/IL1MessageManagerV1.sol similarity index 100% rename from contracts/contracts/interfaces/l1/IL1MessageManagerV1.sol rename to contracts/src/messaging/l1/v1/interfaces/IL1MessageManagerV1.sol diff --git a/contracts/contracts/messageService/l2/L2MessageManager.sol b/contracts/src/messaging/l2/L2MessageManager.sol similarity index 92% rename from contracts/contracts/messageService/l2/L2MessageManager.sol rename to contracts/src/messaging/l2/L2MessageManager.sol index 8869daa68..f63ec46a5 100644 --- a/contracts/contracts/messageService/l2/L2MessageManager.sol +++ b/contracts/src/messaging/l2/L2MessageManager.sol @@ -3,8 +3,8 @@ pragma solidity 0.8.19; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import { L2MessageManagerV1 } from "./v1/L2MessageManagerV1.sol"; -import { IL2MessageManager } from "../../interfaces/l2/IL2MessageManager.sol"; -import { Utils } from "../../lib/Utils.sol"; +import { IL2MessageManager } from "./interfaces/IL2MessageManager.sol"; +import { EfficientLeftRightKeccak } from "../../libraries/EfficientLeftRightKeccak.sol"; /** * @title Contract to manage cross-chain message hashes storage and statuses on L2. @@ -12,7 +12,7 @@ import { Utils } from "../../lib/Utils.sol"; * @custom:security-contact security-report@linea.build */ abstract contract L2MessageManager is AccessControlUpgradeable, IL2MessageManager, L2MessageManagerV1 { - using Utils for *; + using EfficientLeftRightKeccak for *; /// @notice The role required to anchor L1 to L2 message hashes. bytes32 public constant L1_L2_MESSAGE_SETTER_ROLE = keccak256("L1_L2_MESSAGE_SETTER_ROLE"); @@ -70,7 +70,7 @@ abstract contract L2MessageManager is AccessControlUpgradeable, IL2MessageManage if (inboxL1L2MessageStatus[messageHash] == INBOX_STATUS_UNKNOWN) { inboxL1L2MessageStatus[messageHash] = INBOX_STATUS_RECEIVED; - rollingHash = Utils._efficientKeccak(rollingHash, messageHash); + rollingHash = EfficientLeftRightKeccak._efficientKeccak(rollingHash, messageHash); ++currentL1MessageNumber; } diff --git a/contracts/contracts/messageService/l2/L2MessageService.sol b/contracts/src/messaging/l2/L2MessageService.sol similarity index 97% rename from contracts/contracts/messageService/l2/L2MessageService.sol rename to contracts/src/messaging/l2/L2MessageService.sol index c6568e78c..8a2c99bcd 100644 --- a/contracts/contracts/messageService/l2/L2MessageService.sol +++ b/contracts/src/messaging/l2/L2MessageService.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.19; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import { L2MessageServiceV1 } from "./v1/L2MessageServiceV1.sol"; import { L2MessageManager } from "./L2MessageManager.sol"; -import { PermissionsManager } from "../../lib/PermissionsManager.sol"; +import { PermissionsManager } from "../../security/access/PermissionsManager.sol"; /** * @title Contract to manage cross-chain messaging on L2. diff --git a/contracts/contracts/interfaces/l2/IL2MessageManager.sol b/contracts/src/messaging/l2/interfaces/IL2MessageManager.sol similarity index 100% rename from contracts/contracts/interfaces/l2/IL2MessageManager.sol rename to contracts/src/messaging/l2/interfaces/IL2MessageManager.sol diff --git a/contracts/contracts/messageService/l2/v1/L2MessageManagerV1.sol b/contracts/src/messaging/l2/v1/L2MessageManagerV1.sol similarity index 90% rename from contracts/contracts/messageService/l2/v1/L2MessageManagerV1.sol rename to contracts/src/messaging/l2/v1/L2MessageManagerV1.sol index ffd6150c8..93245f4ff 100644 --- a/contracts/contracts/messageService/l2/v1/L2MessageManagerV1.sol +++ b/contracts/src/messaging/l2/v1/L2MessageManagerV1.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.19; import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; -import { IL2MessageManagerV1 } from "../../../interfaces/l2/IL2MessageManagerV1.sol"; -import { L2MessageServicePauseManager } from "../../../lib/L2MessageServicePauseManager.sol"; +import { IL2MessageManagerV1 } from "./interfaces/IL2MessageManagerV1.sol"; +import { L2MessageServicePauseManager } from "../../../security/pausing/L2MessageServicePauseManager.sol"; /** * @title Contract to manage cross-chain message hashes storage and statuses on L2. diff --git a/contracts/contracts/messageService/l2/v1/L2MessageServiceV1.sol b/contracts/src/messaging/l2/v1/L2MessageServiceV1.sol similarity index 96% rename from contracts/contracts/messageService/l2/v1/L2MessageServiceV1.sol rename to contracts/src/messaging/l2/v1/L2MessageServiceV1.sol index c14969cef..3697fc11c 100644 --- a/contracts/contracts/messageService/l2/v1/L2MessageServiceV1.sol +++ b/contracts/src/messaging/l2/v1/L2MessageServiceV1.sol @@ -2,12 +2,12 @@ pragma solidity 0.8.19; import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; -import { IMessageService } from "../../../interfaces/IMessageService.sol"; -import { IL2MessageServiceV1 } from "../../../interfaces/l2/IL2MessageServiceV1.sol"; +import { IMessageService } from "../../interfaces/IMessageService.sol"; +import { IL2MessageServiceV1 } from "./interfaces/IL2MessageServiceV1.sol"; import { IGenericErrors } from "../../../interfaces/IGenericErrors.sol"; -import { RateLimiter } from "../../lib/RateLimiter.sol"; +import { RateLimiter } from "../../../security/limiting/RateLimiter.sol"; import { L2MessageManagerV1 } from "./L2MessageManagerV1.sol"; -import { MessageHashing } from "../../lib/MessageHashing.sol"; +import { MessageHashing } from "../../libraries/MessageHashing.sol"; /** * @title Contract to manage cross-chain messaging on L2. diff --git a/contracts/contracts/interfaces/l2/IL2MessageManagerV1.sol b/contracts/src/messaging/l2/v1/interfaces/IL2MessageManagerV1.sol similarity index 100% rename from contracts/contracts/interfaces/l2/IL2MessageManagerV1.sol rename to contracts/src/messaging/l2/v1/interfaces/IL2MessageManagerV1.sol diff --git a/contracts/contracts/interfaces/l2/IL2MessageServiceV1.sol b/contracts/src/messaging/l2/v1/interfaces/IL2MessageServiceV1.sol similarity index 100% rename from contracts/contracts/interfaces/l2/IL2MessageServiceV1.sol rename to contracts/src/messaging/l2/v1/interfaces/IL2MessageServiceV1.sol diff --git a/contracts/contracts/messageService/lib/MessageHashing.sol b/contracts/src/messaging/libraries/MessageHashing.sol similarity index 100% rename from contracts/contracts/messageService/lib/MessageHashing.sol rename to contracts/src/messaging/libraries/MessageHashing.sol diff --git a/contracts/contracts/messageService/lib/SparseMerkleTreeVerifier.sol b/contracts/src/messaging/libraries/SparseMerkleTreeVerifier.sol similarity index 87% rename from contracts/contracts/messageService/lib/SparseMerkleTreeVerifier.sol rename to contracts/src/messaging/libraries/SparseMerkleTreeVerifier.sol index 0f07ad829..9b769e919 100644 --- a/contracts/contracts/messageService/lib/SparseMerkleTreeVerifier.sol +++ b/contracts/src/messaging/libraries/SparseMerkleTreeVerifier.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { Utils } from "../../lib/Utils.sol"; +import { EfficientLeftRightKeccak } from "../../libraries/EfficientLeftRightKeccak.sol"; /** * @title Library to verify sparse merkle proofs and to get the leaf hash value @@ -9,7 +9,7 @@ import { Utils } from "../../lib/Utils.sol"; * @custom:security-contact security-report@linea.build */ library SparseMerkleTreeVerifier { - using Utils for *; + using EfficientLeftRightKeccak for *; /** * @dev Value doesn't fit in a uint of `bits` size. @@ -47,9 +47,9 @@ library SparseMerkleTreeVerifier { for (uint256 height; height < _proof.length; ++height) { if (((_leafIndex >> height) & 1) == 1) { - node = Utils._efficientKeccak(_proof[height], node); + node = EfficientLeftRightKeccak._efficientKeccak(_proof[height], node); } else { - node = Utils._efficientKeccak(node, _proof[height]); + node = EfficientLeftRightKeccak._efficientKeccak(node, _proof[height]); } } proofIsValid = node == _root; diff --git a/contracts/contracts/lib/CallForwardingProxy.sol b/contracts/src/proxies/CallForwardingProxy.sol similarity index 100% rename from contracts/contracts/lib/CallForwardingProxy.sol rename to contracts/src/proxies/CallForwardingProxy.sol diff --git a/contracts/contracts/tools/RecoverFunds.sol b/contracts/src/recovery/RecoverFunds.sol similarity index 96% rename from contracts/contracts/tools/RecoverFunds.sol rename to contracts/src/recovery/RecoverFunds.sol index 36210aa18..c6e2f172d 100644 --- a/contracts/contracts/tools/RecoverFunds.sol +++ b/contracts/src/recovery/RecoverFunds.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.26; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import { IGenericErrors } from "../interfaces/IGenericErrors.sol"; -import { IRecoverFunds } from "../interfaces/tools/IRecoverFunds.sol"; +import { IRecoverFunds } from "./interfaces/IRecoverFunds.sol"; /** * @title Contract to recover funds sent to the message service address on the alternate chain. diff --git a/contracts/contracts/interfaces/tools/IRecoverFunds.sol b/contracts/src/recovery/interfaces/IRecoverFunds.sol similarity index 100% rename from contracts/contracts/interfaces/tools/IRecoverFunds.sol rename to contracts/src/recovery/interfaces/IRecoverFunds.sol diff --git a/contracts/contracts/LineaRollup.sol b/contracts/src/rollup/LineaRollup.sol similarity index 98% rename from contracts/contracts/LineaRollup.sol rename to contracts/src/rollup/LineaRollup.sol index 17b7526c2..e95f00084 100644 --- a/contracts/contracts/LineaRollup.sol +++ b/contracts/src/rollup/LineaRollup.sol @@ -2,19 +2,19 @@ pragma solidity 0.8.26; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; -import { L1MessageService } from "./messageService/l1/L1MessageService.sol"; +import { L1MessageService } from "../messaging/l1/L1MessageService.sol"; import { ZkEvmV2 } from "./ZkEvmV2.sol"; -import { ILineaRollup } from "./interfaces/l1/ILineaRollup.sol"; -import { PermissionsManager } from "./lib/PermissionsManager.sol"; +import { ILineaRollup } from "./interfaces/ILineaRollup.sol"; +import { PermissionsManager } from "../security/access/PermissionsManager.sol"; -import { Utils } from "./lib/Utils.sol"; +import { EfficientLeftRightKeccak } from "../libraries/EfficientLeftRightKeccak.sol"; /** * @title Contract to manage cross-chain messaging on L1, L2 data submission, and rollup proof verification. * @author ConsenSys Software Inc. * @custom:security-contact security-report@linea.build */ contract LineaRollup is AccessControlUpgradeable, ZkEvmV2, L1MessageService, PermissionsManager, ILineaRollup { - using Utils for *; + using EfficientLeftRightKeccak for *; /// @notice This is the ABI version and not the reinitialize version. string public constant CONTRACT_VERSION = "6.0"; @@ -286,7 +286,7 @@ contract LineaRollup is AccessControlUpgradeable, ZkEvmV2, L1MessageService, Per bytes32 snarkHash = blobSubmission.snarkHash; - currentDataEvaluationPoint = Utils._efficientKeccak(snarkHash, currentDataHash); + currentDataEvaluationPoint = EfficientLeftRightKeccak._efficientKeccak(snarkHash, currentDataHash); _verifyPointEvaluation( currentDataHash, @@ -341,7 +341,7 @@ contract LineaRollup is AccessControlUpgradeable, ZkEvmV2, L1MessageService, Per bytes32 currentDataHash = keccak256(_submission.compressedData); - bytes32 dataEvaluationPoint = Utils._efficientKeccak(_submission.snarkHash, currentDataHash); + bytes32 dataEvaluationPoint = EfficientLeftRightKeccak._efficientKeccak(_submission.snarkHash, currentDataHash); bytes32 computedShnarf = _computeShnarf( _parentShnarf, diff --git a/contracts/contracts/ZkEvmV2.sol b/contracts/src/rollup/ZkEvmV2.sol similarity index 93% rename from contracts/contracts/ZkEvmV2.sol rename to contracts/src/rollup/ZkEvmV2.sol index 24a1fef1d..3504bc339 100644 --- a/contracts/contracts/ZkEvmV2.sol +++ b/contracts/src/rollup/ZkEvmV2.sol @@ -2,9 +2,9 @@ pragma solidity 0.8.26; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; -import { L1MessageServiceV1 } from "./messageService/l1/v1/L1MessageServiceV1.sol"; -import { IZkEvmV2 } from "./interfaces/l1/IZkEvmV2.sol"; -import { IPlonkVerifier } from "./interfaces/l1/IPlonkVerifier.sol"; +import { L1MessageServiceV1 } from "../messaging/l1/v1/L1MessageServiceV1.sol"; +import { IZkEvmV2 } from "./interfaces/IZkEvmV2.sol"; +import { IPlonkVerifier } from "../verifiers/interfaces/IPlonkVerifier.sol"; /** * @title Contract to manage cross-chain L1 rollup proving. * @author ConsenSys Software Inc. diff --git a/contracts/contracts/interfaces/l1/ILineaRollup.sol b/contracts/src/rollup/interfaces/ILineaRollup.sol similarity index 98% rename from contracts/contracts/interfaces/l1/ILineaRollup.sol rename to contracts/src/rollup/interfaces/ILineaRollup.sol index 841143ecb..efc671326 100644 --- a/contracts/contracts/interfaces/l1/ILineaRollup.sol +++ b/contracts/src/rollup/interfaces/ILineaRollup.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.26; -import { IPauseManager } from "../../interfaces/IPauseManager.sol"; -import { IPermissionsManager } from "../../interfaces/IPermissionsManager.sol"; +import { IPauseManager } from "../../security/pausing/interfaces/IPauseManager.sol"; +import { IPermissionsManager } from "../../security/access/interfaces/IPermissionsManager.sol"; /** * @title LineaRollup interface for current functions, structs, events and errors. diff --git a/contracts/contracts/interfaces/l1/IZkEvmV2.sol b/contracts/src/rollup/interfaces/IZkEvmV2.sol similarity index 100% rename from contracts/contracts/interfaces/l1/IZkEvmV2.sol rename to contracts/src/rollup/interfaces/IZkEvmV2.sol diff --git a/contracts/contracts/lib/PermissionsManager.sol b/contracts/src/security/access/PermissionsManager.sol similarity index 87% rename from contracts/contracts/lib/PermissionsManager.sol rename to contracts/src/security/access/PermissionsManager.sol index 0e19cf849..c20b2a86f 100644 --- a/contracts/contracts/lib/PermissionsManager.sol +++ b/contracts/src/security/access/PermissionsManager.sol @@ -2,8 +2,8 @@ pragma solidity >=0.8.19 <=0.8.26; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; -import { IGenericErrors } from "../interfaces/IGenericErrors.sol"; -import { IPermissionsManager } from "../interfaces/IPermissionsManager.sol"; +import { IGenericErrors } from "../../interfaces/IGenericErrors.sol"; +import { IPermissionsManager } from "./interfaces/IPermissionsManager.sol"; /** * @title Contract to manage permissions initialization. diff --git a/contracts/contracts/interfaces/IPermissionsManager.sol b/contracts/src/security/access/interfaces/IPermissionsManager.sol similarity index 100% rename from contracts/contracts/interfaces/IPermissionsManager.sol rename to contracts/src/security/access/interfaces/IPermissionsManager.sol diff --git a/contracts/contracts/messageService/lib/RateLimiter.sol b/contracts/src/security/limiting/RateLimiter.sol similarity index 98% rename from contracts/contracts/messageService/lib/RateLimiter.sol rename to contracts/src/security/limiting/RateLimiter.sol index b6eb3bf31..590592f21 100644 --- a/contracts/contracts/messageService/lib/RateLimiter.sol +++ b/contracts/src/security/limiting/RateLimiter.sol @@ -2,7 +2,7 @@ pragma solidity >=0.8.19 <=0.8.26; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; -import { IRateLimiter } from "../../interfaces/IRateLimiter.sol"; +import { IRateLimiter } from "./interfaces/IRateLimiter.sol"; /** * @title Rate Limiter by period and amount using the block timestamp. diff --git a/contracts/contracts/interfaces/IRateLimiter.sol b/contracts/src/security/limiting/interfaces/IRateLimiter.sol similarity index 100% rename from contracts/contracts/interfaces/IRateLimiter.sol rename to contracts/src/security/limiting/interfaces/IRateLimiter.sol diff --git a/contracts/contracts/lib/L2MessageServicePauseManager.sol b/contracts/src/security/pausing/L2MessageServicePauseManager.sol similarity index 100% rename from contracts/contracts/lib/L2MessageServicePauseManager.sol rename to contracts/src/security/pausing/L2MessageServicePauseManager.sol diff --git a/contracts/contracts/lib/LineaRollupPauseManager.sol b/contracts/src/security/pausing/LineaRollupPauseManager.sol similarity index 100% rename from contracts/contracts/lib/LineaRollupPauseManager.sol rename to contracts/src/security/pausing/LineaRollupPauseManager.sol diff --git a/contracts/contracts/lib/PauseManager.sol b/contracts/src/security/pausing/PauseManager.sol similarity index 99% rename from contracts/contracts/lib/PauseManager.sol rename to contracts/src/security/pausing/PauseManager.sol index d6c151411..cf3a2112b 100644 --- a/contracts/contracts/lib/PauseManager.sol +++ b/contracts/src/security/pausing/PauseManager.sol @@ -2,7 +2,7 @@ pragma solidity >=0.8.19 <=0.8.26; import { AccessControlUpgradeable } from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; -import { IPauseManager } from "../interfaces/IPauseManager.sol"; +import { IPauseManager } from "./interfaces/IPauseManager.sol"; /** * @title Contract to manage cross-chain function pausing. diff --git a/contracts/contracts/lib/TokenBridgePauseManager.sol b/contracts/src/security/pausing/TokenBridgePauseManager.sol similarity index 100% rename from contracts/contracts/lib/TokenBridgePauseManager.sol rename to contracts/src/security/pausing/TokenBridgePauseManager.sol diff --git a/contracts/contracts/interfaces/IPauseManager.sol b/contracts/src/security/pausing/interfaces/IPauseManager.sol similarity index 100% rename from contracts/contracts/interfaces/IPauseManager.sol rename to contracts/src/security/pausing/interfaces/IPauseManager.sol diff --git a/contracts/contracts/messageService/l1/TransientStorageReentrancyGuardUpgradeable.sol b/contracts/src/security/reentrancy/TransientStorageReentrancyGuardUpgradeable.sol similarity index 94% rename from contracts/contracts/messageService/l1/TransientStorageReentrancyGuardUpgradeable.sol rename to contracts/src/security/reentrancy/TransientStorageReentrancyGuardUpgradeable.sol index d635384a0..b60f0274e 100644 --- a/contracts/contracts/messageService/l1/TransientStorageReentrancyGuardUpgradeable.sol +++ b/contracts/src/security/reentrancy/TransientStorageReentrancyGuardUpgradeable.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.26; -import { TransientStorageHelpers } from "../lib/TransientStorageHelpers.sol"; +import { TransientStorageHelpers } from "../../libraries/TransientStorageHelpers.sol"; /** * @title Contract that helps prevent reentrant calls. diff --git a/contracts/contracts/token/LineaSurgeXP.sol b/contracts/src/tokens/LineaSurgeXP.sol similarity index 100% rename from contracts/contracts/token/LineaSurgeXP.sol rename to contracts/src/tokens/LineaSurgeXP.sol diff --git a/contracts/contracts/token/LineaVoyageXP.sol b/contracts/src/tokens/LineaVoyageXP.sol similarity index 100% rename from contracts/contracts/token/LineaVoyageXP.sol rename to contracts/src/tokens/LineaVoyageXP.sol diff --git a/contracts/contracts/token/TokenMintingRateLimiter.sol b/contracts/src/tokens/TokenMintingRateLimiter.sol similarity index 97% rename from contracts/contracts/token/TokenMintingRateLimiter.sol rename to contracts/src/tokens/TokenMintingRateLimiter.sol index 60356b138..b877ffd75 100644 --- a/contracts/contracts/token/TokenMintingRateLimiter.sol +++ b/contracts/src/tokens/TokenMintingRateLimiter.sol @@ -2,8 +2,8 @@ pragma solidity 0.8.19; import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol"; -import { ITokenMinter } from "./ITokenMinter.sol"; -import { ITokenMintingRateLimiter } from "./ITokenMintingRateLimiter.sol"; +import { ITokenMinter } from "./interfaces/ITokenMinter.sol"; +import { ITokenMintingRateLimiter } from "./interfaces/ITokenMintingRateLimiter.sol"; /** * @title Token minting rate limiter. diff --git a/contracts/contracts/token/ITokenMinter.sol b/contracts/src/tokens/interfaces/ITokenMinter.sol similarity index 100% rename from contracts/contracts/token/ITokenMinter.sol rename to contracts/src/tokens/interfaces/ITokenMinter.sol diff --git a/contracts/contracts/token/ITokenMintingRateLimiter.sol b/contracts/src/tokens/interfaces/ITokenMintingRateLimiter.sol similarity index 100% rename from contracts/contracts/token/ITokenMintingRateLimiter.sol rename to contracts/src/tokens/interfaces/ITokenMintingRateLimiter.sol diff --git a/contracts/contracts/verifiers/PlonkVerifierDev.sol b/contracts/src/verifiers/PlonkVerifierDev.sol similarity index 100% rename from contracts/contracts/verifiers/PlonkVerifierDev.sol rename to contracts/src/verifiers/PlonkVerifierDev.sol diff --git a/contracts/contracts/verifiers/PlonkVerifierForDataAggregation.sol b/contracts/src/verifiers/PlonkVerifierForDataAggregation.sol similarity index 89% rename from contracts/contracts/verifiers/PlonkVerifierForDataAggregation.sol rename to contracts/src/verifiers/PlonkVerifierForDataAggregation.sol index 8670ce2a4..b7bbee3bf 100644 --- a/contracts/contracts/verifiers/PlonkVerifierForDataAggregation.sol +++ b/contracts/src/verifiers/PlonkVerifierForDataAggregation.sol @@ -19,29 +19,28 @@ pragma solidity 0.8.26; contract PlonkVerifierForDataAggregation { + uint256 private constant R_MOD = 21888242871839275222246405745257275088548364400416034343698204186575808495617; - uint256 private constant R_MOD_MINUS_ONE = - 21888242871839275222246405745257275088548364400416034343698204186575808495616; + uint256 private constant R_MOD_MINUS_ONE = 21888242871839275222246405745257275088548364400416034343698204186575808495616; uint256 private constant P_MOD = 21888242871839275222246405745257275088696311157297823662689037894645226208583; - + uint256 private constant G2_SRS_0_X_0 = 11559732032986387107991004021392285783925812861821192530917403151452391805634; uint256 private constant G2_SRS_0_X_1 = 10857046999023057135944570762232829481370756359578518086990519993285655852781; uint256 private constant G2_SRS_0_Y_0 = 4082367875863433681332203403145435568316851327593401208105741076214120093531; uint256 private constant G2_SRS_0_Y_1 = 8495653923123431417604973247489272438418190587263600148770280649306958101930; - + uint256 private constant G2_SRS_1_X_0 = 15805639136721018565402881920352193254830339253282065586954346329754995870280; uint256 private constant G2_SRS_1_X_1 = 19089565590083334368588890253123139704298730990782503769911324779715431555531; uint256 private constant G2_SRS_1_Y_0 = 9779648407879205346559610309258181044130619080926897934572699915909528404984; uint256 private constant G2_SRS_1_Y_1 = 6779728121489434657638426458390319301070371227460768374343986326751507916979; - + uint256 private constant G1_SRS_X = 14312776538779914388377568895031746459131577658076416373430523308756343304251; uint256 private constant G1_SRS_Y = 11763105256161367503191792604679297387056316997144156930871823008787082098465; // ----------------------- vk --------------------- uint256 private constant VK_NB_PUBLIC_INPUTS = 1; uint256 private constant VK_DOMAIN_SIZE = 16; - uint256 private constant VK_INV_DOMAIN_SIZE = - 20520227692349320520856005386178695395514091625390032197217066424914820464641; + uint256 private constant VK_INV_DOMAIN_SIZE = 20520227692349320520856005386178695395514091625390032197217066424914820464641; uint256 private constant VK_OMEGA = 14940766826517323942636479241147756311199852622225275649687664389641784935947; uint256 private constant VK_QL_COM_X = 3767637989833674092151354229632559107224950590673664856842061399469467338879; uint256 private constant VK_QL_COM_Y = 18545409996679466114224178746162553880737296402729089689774308937082946761979; @@ -53,21 +52,23 @@ contract PlonkVerifierForDataAggregation { uint256 private constant VK_QO_COM_Y = 10782414695040549646706468913781794882209258381887890407509684555513355143197; uint256 private constant VK_QK_COM_X = 309591480144351325314158474719361148480191595146291661238142838254651436989; uint256 private constant VK_QK_COM_Y = 12063173869829536468830946547606069911666129778788708678515573607390482939756; - + uint256 private constant VK_S1_COM_X = 12287072751694848944507699577006619791724925439540371477056092891137357229312; uint256 private constant VK_S1_COM_Y = 2469356406782415219782253630635766217009619642857495098799013714324696399305; - + uint256 private constant VK_S2_COM_X = 17261757720471042341269061128759148572672168808566386603388432325173708264418; uint256 private constant VK_S2_COM_Y = 20976565876611279190744172824963243461988367679364518747954008723085439460611; - + uint256 private constant VK_S3_COM_X = 18758025488249277181117376239193628449359868741625564388668468130204669284937; uint256 private constant VK_S3_COM_Y = 15566903578741238761792344329051427316196307361197991677131114502821508927172; - + uint256 private constant VK_COSET_SHIFT = 5; - + + uint256 private constant VK_QCP_0_X = 4559262075452024065272338216146989708834054079507534161096300708463935456394; uint256 private constant VK_QCP_0_Y = 1898950104727986554890445533779776634695458253078091580309593009754027486622; - + + uint256 private constant VK_INDEX_COMMIT_API_0 = 5; uint256 private constant VK_NB_CUSTOM_GATES = 1; @@ -77,7 +78,7 @@ contract PlonkVerifierForDataAggregation { uint256 private constant FIXED_PROOF_SIZE = 0x300; // offset proof - + uint256 private constant PROOF_L_COM_X = 0x0; uint256 private constant PROOF_L_COM_Y = 0x20; uint256 private constant PROOF_R_COM_X = 0x40; @@ -121,7 +122,7 @@ contract PlonkVerifierForDataAggregation { // -------- offset state // challenges to check the claimed quotient - + uint256 private constant STATE_ALPHA = 0x0; uint256 private constant STATE_BETA = 0x20; uint256 private constant STATE_GAMMA = 0x40; @@ -152,13 +153,15 @@ contract PlonkVerifierForDataAggregation { // -------- errors uint256 private constant ERROR_STRING_ID = 0x08c379a000000000000000000000000000000000000000000000000000000000; // selector for function Error(string) + // -------- utils (for hash_fr) - uint256 private constant HASH_FR_BB = 340282366920938463463374607431768211456; // 2**128 - uint256 private constant HASH_FR_ZERO_UINT256 = 0; - uint8 private constant HASH_FR_LEN_IN_BYTES = 48; - uint8 private constant HASH_FR_SIZE_DOMAIN = 11; - uint8 private constant HASH_FR_ONE = 1; - uint8 private constant HASH_FR_TWO = 2; + uint256 private constant HASH_FR_BB = 340282366920938463463374607431768211456; // 2**128 + uint256 private constant HASH_FR_ZERO_UINT256 = 0; + uint8 private constant HASH_FR_LEN_IN_BYTES = 48; + uint8 private constant HASH_FR_SIZE_DOMAIN = 11; + uint8 private constant HASH_FR_ONE = 1; + uint8 private constant HASH_FR_TWO = 2; + // -------- precompiles uint8 private constant SHA2 = 0x2; @@ -166,14 +169,17 @@ contract PlonkVerifierForDataAggregation { uint8 private constant EC_ADD = 0x6; uint8 private constant EC_MUL = 0x7; uint8 private constant EC_PAIR = 0x8; - + /// Verify a Plonk proof. /// Reverts if the proof or the public inputs are malformed. /// @param proof serialised plonk proof (using gnark's MarshalSolidity) /// @param public_inputs (must be reduced) /// @return success true if the proof passes false otherwise - function Verify(bytes calldata proof, uint256[] calldata public_inputs) public view returns (bool success) { + function Verify(bytes calldata proof, uint256[] calldata public_inputs) + public view returns(bool success) { + assembly { + let mem := mload(0x40) let freeMem := add(mem, STATE_LAST_MEM) @@ -305,23 +311,20 @@ contract PlonkVerifierForDataAggregation { // end errors ------------------------------------------------- // Beginning checks ------------------------------------------------- - + /// @param s actual number of public inputs function check_number_of_public_inputs(s) { if iszero(eq(s, VK_NB_PUBLIC_INPUTS)) { error_nb_public_inputs() } } - + /// Checks that the public inputs are < R_MOD. /// @param s number of public inputs /// @param p pointer to the public inputs array function check_inputs_size(s, p) { - for { - let i - } lt(i, s) { - i := add(i, 1) - } { + for {let i} lt(i, s) {i:=add(i,1)} + { if gt(calldataload(p), R_MOD_MINUS_ONE) { error_inputs_size() } @@ -332,16 +335,17 @@ 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(FIXED_PROOF_SIZE, 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() + error_proof_size() } } - + /// Checks if the multiple openings of the polynomials are < R_MOD. /// @param aproof pointer to the beginning of the proof /// @dev the 'a' prepending proof is to have a local name function check_proof_openings_size(aproof) { + // PROOF_L_AT_ZETA let p := add(aproof, PROOF_L_AT_ZETA) if gt(calldataload(p), R_MOD_MINUS_ONE) { @@ -365,7 +369,7 @@ contract PlonkVerifierForDataAggregation { if gt(calldataload(p), R_MOD_MINUS_ONE) { error_proof_openings_size() } - + // PROOF_S2_AT_ZETA p := add(aproof, PROOF_S2_AT_ZETA) if gt(calldataload(p), R_MOD_MINUS_ONE) { @@ -379,18 +383,16 @@ contract PlonkVerifierForDataAggregation { } // PROOF_OPENING_QCP_AT_ZETA - + p := add(aproof, PROOF_OPENING_QCP_AT_ZETA) - for { - let i := 0 - } lt(i, VK_NB_CUSTOM_GATES) { - i := add(i, 1) - } { + for {let i:=0} lt(i, VK_NB_CUSTOM_GATES) {i:=add(i,1)} + { if gt(calldataload(p), R_MOD_MINUS_ONE) { error_proof_openings_size() } p := add(p, 0x20) } + } // end checks ------------------------------------------------- @@ -412,32 +414,34 @@ contract PlonkVerifierForDataAggregation { /// and is encoded as a uint256 number n. In basis b = 256, the number looks like this /// [0 0 0 .. 0x67 0x61 0x6d, 0x6d, 0x61]. The first non zero entry is at position 27=0x1b /// Gamma reduced (the actual challenge) is stored at add(state, state_gamma) - function derive_gamma(aproof, nb_pi, pi) -> gamma_not_reduced { + function derive_gamma(aproof, nb_pi, pi)->gamma_not_reduced { + let state := mload(0x40) let mPtr := add(state, STATE_LAST_MEM) mstore(mPtr, FS_GAMMA) // "gamma" - mstore(add(mPtr, 0x20), VK_S1_COM_X) - mstore(add(mPtr, 0x40), VK_S1_COM_Y) - mstore(add(mPtr, 0x60), VK_S2_COM_X) - mstore(add(mPtr, 0x80), VK_S2_COM_Y) - mstore(add(mPtr, 0xa0), VK_S3_COM_X) - mstore(add(mPtr, 0xc0), VK_S3_COM_Y) - mstore(add(mPtr, 0xe0), VK_QL_COM_X) - mstore(add(mPtr, 0x100), VK_QL_COM_Y) - mstore(add(mPtr, 0x120), VK_QR_COM_X) - mstore(add(mPtr, 0x140), VK_QR_COM_Y) - mstore(add(mPtr, 0x160), VK_QM_COM_X) - mstore(add(mPtr, 0x180), VK_QM_COM_Y) - mstore(add(mPtr, 0x1a0), VK_QO_COM_X) - mstore(add(mPtr, 0x1c0), VK_QO_COM_Y) - mstore(add(mPtr, 0x1e0), VK_QK_COM_X) - mstore(add(mPtr, 0x200), VK_QK_COM_Y) - - mstore(add(mPtr, 0x220), VK_QCP_0_X) - mstore(add(mPtr, 0x240), VK_QCP_0_Y) - + + mstore(add(mPtr, 0x20), VK_S1_COM_X) + mstore(add(mPtr, 0x40), VK_S1_COM_Y) + mstore(add(mPtr, 0x60), VK_S2_COM_X) + mstore(add(mPtr, 0x80), VK_S2_COM_Y) + mstore(add(mPtr, 0xa0), VK_S3_COM_X) + mstore(add(mPtr, 0xc0), VK_S3_COM_Y) + mstore(add(mPtr, 0xe0), VK_QL_COM_X) + mstore(add(mPtr, 0x100), VK_QL_COM_Y) + mstore(add(mPtr, 0x120), VK_QR_COM_X) + mstore(add(mPtr, 0x140), VK_QR_COM_Y) + mstore(add(mPtr, 0x160), VK_QM_COM_X) + mstore(add(mPtr, 0x180), VK_QM_COM_Y) + mstore(add(mPtr, 0x1a0), VK_QO_COM_X) + mstore(add(mPtr, 0x1c0), VK_QO_COM_Y) + mstore(add(mPtr, 0x1e0), VK_QK_COM_X) + mstore(add(mPtr, 0x200), VK_QK_COM_Y) + + mstore(add(mPtr, 0x220), VK_QCP_0_X) + mstore(add(mPtr, 0x240), VK_QCP_0_Y) + // public inputs let _mPtr := add(mPtr, 0x260) let size_pi_in_bytes := mul(nb_pi, 0x20) @@ -454,7 +458,7 @@ contract PlonkVerifierForDataAggregation { // + nb_public_inputs*0x20 // + nb_custom gates*0x40 let size := add(0x2c5, size_pi_in_bytes) - + size := add(size, mul(VK_NB_CUSTOM_GATES, 0x40)) let l_success := staticcall(gas(), SHA2, add(mPtr, 0x1b), size, mPtr, 0x20) //0x1b -> 000.."gamma" if iszero(l_success) { @@ -469,7 +473,8 @@ contract PlonkVerifierForDataAggregation { /// @return beta_not_reduced the next challenge, beta, not reduced /// @notice the transcript consists of the previous challenge only. /// The reduced version of beta is stored at add(state, state_beta) - function derive_beta(gamma_not_reduced) -> beta_not_reduced { + function derive_beta(gamma_not_reduced)->beta_not_reduced{ + let state := mload(0x40) let mPtr := add(mload(0x40), STATE_LAST_MEM) @@ -490,8 +495,9 @@ contract PlonkVerifierForDataAggregation { /// @return alpha_not_reduced the next challenge, alpha, not reduced /// @notice the transcript consists of the previous challenge (beta) /// not reduced, the commitments to the wires associated to the QCP_i, - /// and the commitment to the grand product polynomial - function derive_alpha(aproof, beta_not_reduced) -> alpha_not_reduced { + /// and the commitment to the grand product polynomial + function derive_alpha(aproof, beta_not_reduced)->alpha_not_reduced { + let state := mload(0x40) let mPtr := add(mload(0x40), STATE_LAST_MEM) let full_size := 0x65 // size("alpha") + 0x20 (previous challenge) @@ -501,14 +507,14 @@ contract PlonkVerifierForDataAggregation { let _mPtr := add(mPtr, 0x20) mstore(_mPtr, beta_not_reduced) _mPtr := add(_mPtr, 0x20) - + // Bsb22Commitments let proof_bsb_commitments := add(aproof, PROOF_BSB_COMMITMENTS) let size_bsb_commitments := mul(0x40, VK_NB_CUSTOM_GATES) calldatacopy(_mPtr, proof_bsb_commitments, size_bsb_commitments) _mPtr := add(_mPtr, size_bsb_commitments) full_size := add(full_size, size_bsb_commitments) - + // [Z], the commitment to the grand product polynomial calldatacopy(_mPtr, add(aproof, PROOF_GRAND_PRODUCT_COMMITMENT_X), 0x40) let l_success := staticcall(gas(), SHA2, add(mPtr, 0x1b), full_size, mPtr, 0x20) @@ -526,6 +532,7 @@ contract PlonkVerifierForDataAggregation { /// The transcript consists of the previous challenge and the commitment to /// the quotient polynomial h. function derive_zeta(aproof, alpha_not_reduced) { + let state := mload(0x40) let mPtr := add(mload(0x40), STATE_LAST_MEM) @@ -550,7 +557,8 @@ contract PlonkVerifierForDataAggregation { /// @param n number of public inputs /// @param mPtr free memory /// @return pi_wo_commit public inputs contribution (except the public inputs coming from the custom gate) - function sum_pi_wo_api_commit(ins, n, mPtr) -> pi_wo_commit { + function sum_pi_wo_api_commit(ins, n, mPtr)->pi_wo_commit { + let state := mload(0x40) let z := mload(add(state, STATE_ZETA)) let zpnmo := mload(add(state, STATE_ZETA_POWER_N_MINUS_ONE)) @@ -559,16 +567,14 @@ contract PlonkVerifierForDataAggregation { batch_compute_lagranges_at_z(z, zpnmo, n, li) let tmp := 0 - for { - let i := 0 - } lt(i, n) { - i := add(i, 1) - } { + for {let i:=0} lt(i,n) {i:=add(i,1)} + { tmp := mulmod(mload(li), calldataload(ins), R_MOD) pi_wo_commit := addmod(pi_wo_commit, tmp, R_MOD) li := add(li, 0x20) ins := add(ins, 0x20) } + } /// batch_compute_lagranges_at_z computes [L_0(z), .., L_{n-1}(z)] @@ -577,32 +583,27 @@ contract PlonkVerifierForDataAggregation { /// @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_pub, mPtr) { - let zn := mulmod(zpnmo, VK_INV_DOMAIN_SIZE, R_MOD) // 1/n * (ζⁿ - 1) + 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_pub) { - i := add(i, 1) - } { - mstore(_mPtr, addmod(z, sub(R_MOD, _w), R_MOD)) + for {let i:=0} 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_pub, _mPtr) _mPtr := mPtr _w := 1 - for { - let i := 0 - } lt(i, n_pub) { - i := add(i, 1) - } { - mstore(_mPtr, mulmod(mulmod(mload(_mPtr), zn, R_MOD), _w, R_MOD)) + for {let i:=0} lt(i,n_pub) {i:=add(i,1)} + { + mstore(_mPtr, mulmod(mulmod(mload(_mPtr), zn , R_MOD), _w, R_MOD)) _mPtr := add(_mPtr, 0x20) _w := mulmod(_w, VK_OMEGA, R_MOD) } - } + } /// @notice Montgomery trick for batch inversion mod R_MOD /// @param ins pointer to the data to batch invert @@ -611,11 +612,8 @@ contract PlonkVerifierForDataAggregation { function batch_invert(ins, nb_ins, mPtr) { mstore(mPtr, 1) let offset := 0 - for { - let i := 0 - } lt(i, nb_ins) { - i := add(i, 1) - } { + for {let i:=0} lt(i, nb_ins) {i:=add(i,1)} + { let prev := mload(add(mPtr, offset)) let cur := mload(add(ins, offset)) cur := mulmod(prev, cur, R_MOD) @@ -624,12 +622,9 @@ contract PlonkVerifierForDataAggregation { } ins := add(ins, sub(offset, 0x20)) mPtr := add(mPtr, offset) - let inv := pow(mload(mPtr), sub(R_MOD, 2), add(mPtr, 0x20)) - for { - let i := 0 - } lt(i, nb_ins) { - i := add(i, 1) - } { + let inv := pow(mload(mPtr), sub(R_MOD,2), add(mPtr, 0x20)) + for {let i:=0} lt(i, nb_ins) {i:=add(i,1)} + { mPtr := sub(mPtr, 0x20) let tmp := mload(ins) let cur := mulmod(inv, mload(mPtr), R_MOD) @@ -639,12 +634,14 @@ contract PlonkVerifierForDataAggregation { } } + /// Public inputs (the ones coming from the custom gate) contribution /// @param aproof pointer to the proof /// @param nb_public_inputs number of public inputs /// @param mPtr pointer to free memory /// @return pi_commit custom gate public inputs contribution - function sum_pi_commit(aproof, nb_public_inputs, mPtr) -> pi_commit { + function sum_pi_commit(aproof, nb_public_inputs, mPtr)->pi_commit { + let state := mload(0x40) let z := mload(add(state, STATE_ZETA)) let zpnmo := mload(add(state, STATE_ZETA_POWER_N_MINUS_ONE)) @@ -652,10 +649,14 @@ contract PlonkVerifierForDataAggregation { let p := add(aproof, PROOF_BSB_COMMITMENTS) let h_fr, ith_lagrange - + + 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) + + + } /// Computes L_i(zeta) = ωⁱ/n * (ζⁿ-1)/(ζ-ωⁱ) where: @@ -663,14 +664,16 @@ contract PlonkVerifierForDataAggregation { /// @param zpmno ζⁿ-1 /// @param i i-th lagrange /// @param mPtr free memory - /// @return res = ωⁱ/n * (ζⁿ-1)/(ζ-ωⁱ) - function compute_ith_lagrange_at_z(z, zpnmo, i, mPtr) -> res { + /// @return res = ωⁱ/n * (ζⁿ-1)/(ζ-ωⁱ) + function compute_ith_lagrange_at_z(z, zpnmo, i, mPtr)->res { + let w := pow(VK_OMEGA, i, mPtr) // w**i i := addmod(z, sub(R_MOD, w), R_MOD) // z-w**i w := mulmod(w, VK_INV_DOMAIN_SIZE, R_MOD) // w**i/n - i := pow(i, sub(R_MOD, 2), mPtr) // (z-w**i)**-1 + i := pow(i, sub(R_MOD,2), mPtr) // (z-w**i)**-1 w := mulmod(w, i, R_MOD) // w**i/n*(z-w)**-1 res := mulmod(w, zpnmo, R_MOD) + } /// @dev https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-06#section-5.2 @@ -678,14 +681,15 @@ contract PlonkVerifierForDataAggregation { /// @param y y coordinate of a point on Bn254(𝔽_p) /// @param mPtr free memory /// @return res an element mod R_MOD - function hash_fr(x, y, mPtr) -> res { + function hash_fr(x, y, mPtr)->res { + // [0x00, .. , 0x00 || x, y, || 0, 48, 0, dst, HASH_FR_SIZE_DOMAIN] // <- 64 bytes -> <-64b -> <- 1 bytes each -> // [0x00, .., 0x00] 64 bytes of zero mstore(mPtr, HASH_FR_ZERO_UINT256) mstore(add(mPtr, 0x20), HASH_FR_ZERO_UINT256) - + // msg = x || y , both on 32 bytes mstore(add(mPtr, 0x40), x) mstore(add(mPtr, 0x60), y) @@ -721,7 +725,7 @@ contract PlonkVerifierForDataAggregation { // [b0 || one || dst || HASH_FR_SIZE_DOMAIN] // <-64bytes -> <- 1 byte each -> mstore8(add(mPtr, 0x20), HASH_FR_ONE) // 1 - + mstore8(add(mPtr, 0x21), 0x42) // dst mstore8(add(mPtr, 0x22), 0x53) mstore8(add(mPtr, 0x23), 0x42) @@ -773,8 +777,9 @@ contract PlonkVerifierForDataAggregation { 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) - } + } + // END compute_pi ------------------------------------------------- /// @notice compute α² * 1/n * (ζ{n}-1)/(ζ - 1) where @@ -782,7 +787,7 @@ contract PlonkVerifierForDataAggregation { /// * n = vk_domain_size /// * ω = vk_omega (generator of the multiplicative cyclic group of order n in (ℤ/rℤ)*) /// * ζ = zeta (challenge derived with Fiat Shamir) - function compute_alpha_square_lagrange_0() { + function compute_alpha_square_lagrange_0() { let state := mload(0x40) let mPtr := add(mload(0x40), STATE_LAST_MEM) @@ -822,7 +827,7 @@ contract PlonkVerifierForDataAggregation { mstore(add(mPtr, 0x100), mload(add(state, STATE_ZETA))) mstore(add(mPtr, 0x120), mload(add(state, STATE_GAMMA_KZG))) let random := staticcall(gas(), SHA2, mPtr, 0x140, mPtr, 0x20) - if iszero(random) { + if iszero(random){ error_random_generation() } random := mod(mload(mPtr), R_MOD) // use the same variable as we are one variable away from getting stack-too-deep error... @@ -871,18 +876,18 @@ 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) - mstore(add(mPtr, 0x80), G2_SRS_0_Y_0) - mstore(add(mPtr, 0xa0), G2_SRS_0_Y_1) - mstore(add(mPtr, 0xc0), mload(folded_quotients)) - mstore(add(mPtr, 0xe0), mload(add(folded_quotients, 0x20))) - mstore(add(mPtr, 0x100), G2_SRS_1_X_0) - mstore(add(mPtr, 0x120), G2_SRS_1_X_1) - mstore(add(mPtr, 0x140), G2_SRS_1_Y_0) - mstore(add(mPtr, 0x160), G2_SRS_1_Y_1) + + 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) + mstore(add(mPtr, 0x80), G2_SRS_0_Y_0) + mstore(add(mPtr, 0xa0), G2_SRS_0_Y_1) + mstore(add(mPtr, 0xc0), mload(folded_quotients)) + mstore(add(mPtr, 0xe0), mload(add(folded_quotients, 0x20))) + mstore(add(mPtr, 0x100), G2_SRS_1_X_0) + mstore(add(mPtr, 0x120), G2_SRS_1_X_1) + mstore(add(mPtr, 0x140), G2_SRS_1_Y_0) + mstore(add(mPtr, 0x160), G2_SRS_1_Y_1) check_pairing_kzg(mPtr) } @@ -907,6 +912,7 @@ contract PlonkVerifierForDataAggregation { /// @param aproof pointer to the proof /// acc_gamma stores the γⁱ function fold_state(aproof) { + let state := mload(0x40) let mPtr := add(mload(0x40), STATE_LAST_MEM) let mPtr20 := add(mPtr, 0x20) @@ -943,14 +949,15 @@ contract PlonkVerifierForDataAggregation { point_acc_mul(state_folded_digests, mPtr, acc_gamma, mPtr40) fr_acc_mul_calldata(add(state, STATE_FOLDED_CLAIMED_VALUES), add(aproof, PROOF_S2_AT_ZETA), acc_gamma) let poqaz := add(aproof, PROOF_OPENING_QCP_AT_ZETA) - + acc_gamma := mulmod(acc_gamma, l_gamma_kzg, R_MOD) mstore(mPtr, VK_QCP_0_X) mstore(mPtr20, VK_QCP_0_Y) point_acc_mul(state_folded_digests, mPtr, acc_gamma, mPtr40) fr_acc_mul_calldata(add(state, STATE_FOLDED_CLAIMED_VALUES), poqaz, acc_gamma) poqaz := add(poqaz, 0x20) - } + + } /// @notice generate the challenge (using Fiat Shamir) to fold the opening proofs /// at ζ. @@ -968,22 +975,23 @@ contract PlonkVerifierForDataAggregation { /// * Z(ζω) /// @param aproof pointer to the proof function compute_gamma_kzg(aproof) { + let state := mload(0x40) let mPtr := add(mload(0x40), STATE_LAST_MEM) mstore(mPtr, FS_GAMMA_KZG) // "gamma" mstore(add(mPtr, 0x20), mload(add(state, STATE_ZETA))) - mstore(add(mPtr, 0x40), mload(add(state, STATE_LINEARISED_POLYNOMIAL_X))) - mstore(add(mPtr, 0x60), mload(add(state, STATE_LINEARISED_POLYNOMIAL_Y))) + mstore(add(mPtr,0x40), mload(add(state, STATE_LINEARISED_POLYNOMIAL_X))) + mstore(add(mPtr,0x60), mload(add(state, STATE_LINEARISED_POLYNOMIAL_Y))) calldatacopy(add(mPtr, 0x80), add(aproof, PROOF_L_COM_X), 0xc0) - mstore(add(mPtr, 0x140), VK_S1_COM_X) - mstore(add(mPtr, 0x160), VK_S1_COM_Y) - mstore(add(mPtr, 0x180), VK_S2_COM_X) - mstore(add(mPtr, 0x1a0), VK_S2_COM_Y) - + mstore(add(mPtr,0x140), VK_S1_COM_X) + mstore(add(mPtr,0x160), VK_S1_COM_Y) + mstore(add(mPtr,0x180), VK_S2_COM_X) + mstore(add(mPtr,0x1a0), VK_S2_COM_Y) + let offset := 0x1c0 - - mstore(add(mPtr, offset), VK_QCP_0_X) - mstore(add(mPtr, add(offset, 0x20)), VK_QCP_0_Y) + + mstore(add(mPtr,offset), VK_QCP_0_X) + mstore(add(mPtr,add(offset, 0x20)), VK_QCP_0_Y) offset := add(offset, 0x40) mstore(add(mPtr, offset), mload(add(state, STATE_OPENING_LINEARISED_POLYNOMIAL_ZETA))) mstore(add(mPtr, add(offset, 0x20)), calldataload(add(aproof, PROOF_L_AT_ZETA))) @@ -994,23 +1002,18 @@ contract PlonkVerifierForDataAggregation { let _mPtr := add(mPtr, add(offset, 0xc0)) + let _poqaz := add(aproof, PROOF_OPENING_QCP_AT_ZETA) calldatacopy(_mPtr, _poqaz, mul(VK_NB_CUSTOM_GATES, 0x20)) _mPtr := add(_mPtr, mul(VK_NB_CUSTOM_GATES, 0x20)) + 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 = 0x14 (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(), - SHA2, - add(mPtr, start_input), - size_input, - add(state, STATE_GAMMA_KZG), - 0x20 - ) + let check_staticcall := staticcall(gas(), SHA2, add(mPtr,start_input), size_input, add(state, STATE_GAMMA_KZG), 0x20) if iszero(check_staticcall) { error_verify() } @@ -1018,6 +1021,7 @@ contract PlonkVerifierForDataAggregation { } function compute_commitment_linearised_polynomial_ec(aproof, s1, s2) { + let state := mload(0x40) let mPtr := add(mload(0x40), STATE_LAST_MEM) @@ -1062,6 +1066,7 @@ contract PlonkVerifierForDataAggregation { add(mPtr, 0x40) ) + let qcp_opening_at_zeta := add(aproof, PROOF_OPENING_QCP_AT_ZETA) let bsb_commitments := add(aproof, PROOF_BSB_COMMITMENTS) for { @@ -1080,6 +1085,7 @@ contract PlonkVerifierForDataAggregation { qcp_opening_at_zeta := add(qcp_opening_at_zeta, 0x20) bsb_commitments := add(bsb_commitments, 0x40) } + mstore(mPtr, VK_S3_COM_X) mstore(add(mPtr, 0x20), VK_S3_COM_Y) @@ -1090,11 +1096,10 @@ contract PlonkVerifierForDataAggregation { point_acc_mul(add(state, STATE_LINEARISED_POLYNOMIAL_X), mPtr, s2, add(mPtr, 0x40)) point_add( - add(state, STATE_LINEARISED_POLYNOMIAL_X), - add(state, STATE_LINEARISED_POLYNOMIAL_X), - add(state, STATE_FOLDED_H_X), - mPtr - ) + add(state, STATE_LINEARISED_POLYNOMIAL_X), + add(state, STATE_LINEARISED_POLYNOMIAL_X), + add(state, STATE_FOLDED_H_X), + mPtr) } /// @notice Compute the commitment to the linearized polynomial equal to @@ -1161,25 +1166,10 @@ contract PlonkVerifierForDataAggregation { 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_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_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_COM_X), - mPtr - ) - point_mul( - add(state, STATE_FOLDED_H_X), - add(state, STATE_FOLDED_H_X), - mload(add(state, STATE_ZETA_POWER_N_MINUS_ONE)), - 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), mload(add(state, STATE_ZETA_POWER_N_MINUS_ONE)), mPtr) let folded_h_y := mload(add(state, STATE_FOLDED_H_Y)) folded_h_y := sub(P_MOD, folded_h_y) mstore(add(state, STATE_FOLDED_H_Y), folded_h_y) @@ -1189,6 +1179,7 @@ contract PlonkVerifierForDataAggregation { /// - [ PI(ζ) - α²*L₁(ζ) + α(l(ζ)+β*s1(ζ)+γ)(r(ζ)+β*s2(ζ)+γ)(o(ζ)+γ)*z(ωζ) ] /// @param aproof pointer to the proof function compute_opening_linearised_polynomial(aproof) { + let state := mload(0x40) // (l(ζ)+β*s1(ζ)+γ) @@ -1224,7 +1215,7 @@ contract PlonkVerifierForDataAggregation { } // BEGINNING utils math functions ------------------------------------------------- - + /// @param dst pointer storing the result /// @param p pointer to the first point /// @param q pointer to the second point @@ -1234,7 +1225,7 @@ contract PlonkVerifierForDataAggregation { mstore(add(mPtr, 0x20), mload(add(p, 0x20))) mstore(add(mPtr, 0x40), mload(q)) mstore(add(mPtr, 0x60), mload(add(q, 0x20))) - let l_success := staticcall(gas(), EC_ADD, mPtr, 0x80, dst, 0x40) + let l_success := staticcall(gas(),EC_ADD,mPtr,0x80,dst,0x40) if iszero(l_success) { error_ec_op() } @@ -1259,11 +1250,11 @@ contract PlonkVerifierForDataAggregation { /// @param src pointer to a point on Bn254(𝔽_p) /// @param s scalar /// @param mPtr free memory - function point_mul(dst, src, s, mPtr) { - mstore(mPtr, mload(src)) - mstore(add(mPtr, 0x20), mload(add(src, 0x20))) - mstore(add(mPtr, 0x40), s) - let l_success := staticcall(gas(), EC_MUL, mPtr, 0x60, dst, 0x40) + function point_mul(dst,src,s, mPtr) { + mstore(mPtr,mload(src)) + mstore(add(mPtr,0x20),mload(add(src,0x20))) + mstore(add(mPtr,0x40),s) + let l_success := staticcall(gas(),EC_MUL,mPtr,0x60,dst,0x40) if iszero(l_success) { error_ec_op() } @@ -1288,14 +1279,14 @@ contract PlonkVerifierForDataAggregation { /// @param src pointer to the point to multiply and add /// @param s scalar /// @param mPtr free memory - function point_acc_mul(dst, src, s, mPtr) { - mstore(mPtr, mload(src)) - mstore(add(mPtr, 0x20), mload(add(src, 0x20))) - mstore(add(mPtr, 0x40), s) - let l_success := staticcall(gas(), 7, mPtr, 0x60, mPtr, 0x40) - mstore(add(mPtr, 0x40), mload(dst)) - mstore(add(mPtr, 0x60), mload(add(dst, 0x20))) - l_success := and(l_success, staticcall(gas(), EC_ADD, mPtr, 0x80, dst, 0x40)) + function point_acc_mul(dst,src,s, mPtr) { + mstore(mPtr,mload(src)) + mstore(add(mPtr,0x20),mload(add(src,0x20))) + mstore(add(mPtr,0x40),s) + let l_success := staticcall(gas(),7,mPtr,0x60,mPtr,0x40) + mstore(add(mPtr,0x40),mload(dst)) + mstore(add(mPtr,0x60),mload(add(dst,0x20))) + l_success := and(l_success, staticcall(gas(),EC_ADD,mPtr,0x80,dst, 0x40)) if iszero(l_success) { error_ec_op() } @@ -1324,7 +1315,7 @@ contract PlonkVerifierForDataAggregation { /// @param src pointer to the scalar to multiply and add (on calldata) /// @param s scalar function fr_acc_mul_calldata(dst, src, s) { - let tmp := mulmod(calldataload(src), s, R_MOD) + let tmp := mulmod(calldataload(src), s, R_MOD) mstore(dst, addmod(mload(dst), tmp, R_MOD)) } @@ -1332,16 +1323,16 @@ contract PlonkVerifierForDataAggregation { /// @param e exponent /// @param mPtr free memory /// @return res x ** e mod r - function pow(x, e, mPtr) -> res { + function pow(x, e, mPtr)->res { mstore(mPtr, 0x20) mstore(add(mPtr, 0x20), 0x20) mstore(add(mPtr, 0x40), 0x20) mstore(add(mPtr, 0x60), x) mstore(add(mPtr, 0x80), e) mstore(add(mPtr, 0xa0), R_MOD) - let check_staticcall := staticcall(gas(), MOD_EXP, mPtr, 0xc0, mPtr, 0x20) + let check_staticcall := staticcall(gas(),MOD_EXP,mPtr,0xc0,mPtr,0x20) if eq(check_staticcall, 0) { - error_mod_exp() + error_mod_exp() } res := mload(mPtr) } diff --git a/contracts/contracts/verifiers/PlonkVerifierForMultiTypeDataAggregation.sol b/contracts/src/verifiers/PlonkVerifierForMultiTypeDataAggregation.sol similarity index 100% rename from contracts/contracts/verifiers/PlonkVerifierForMultiTypeDataAggregation.sol rename to contracts/src/verifiers/PlonkVerifierForMultiTypeDataAggregation.sol diff --git a/contracts/contracts/interfaces/l1/IPlonkVerifier.sol b/contracts/src/verifiers/interfaces/IPlonkVerifier.sol similarity index 100% rename from contracts/contracts/interfaces/l1/IPlonkVerifier.sol rename to contracts/src/verifiers/interfaces/IPlonkVerifier.sol diff --git a/contracts/test/common/constants/submissionData.ts b/contracts/test/common/constants/submissionData.ts deleted file mode 100644 index 79f62ea7c..000000000 --- a/contracts/test/common/constants/submissionData.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { HASH_ZERO } from "./general"; - -import firstCompressedDataContent from "../../testData/compressedData/blocks-1-46.json"; -import fourthCompressedDataContent from "../../testData/compressedData/blocks-115-155.json"; -import secondCompressedDataContent from "../../testData/compressedData/blocks-47-81.json"; -import thirdCompressedDataContent from "../../testData/compressedData/blocks-82-114.json"; -import fourthBlobDataContent from "../../testData/compressedDataEip4844/blocks-115-155.json"; -import thirdBlobDataContent from "../../testData/compressedDataEip4844/blocks-82-114.json"; -import secondBlobDataContent from "../../testData/compressedDataEip4844/blocks-47-81.json"; -import firstBlobDataContent from "../../testData/compressedDataEip4844/blocks-1-46.json"; - -import firstCompressedDataContent_multiple from "../../testData/compressedData/multipleProofs/blocks-1-46.json"; -import secondCompressedDataContent_multiple from "../../testData/compressedData/multipleProofs/blocks-47-81.json"; -import thirdCompressedDataContent_multiple from "../../testData/compressedData/multipleProofs/blocks-82-119.json"; -import fourthCompressedDataContent_multiple from "../../testData/compressedData/multipleProofs/blocks-120-153.json"; - -import firstBlobContent_multiple from "../../testData/compressedDataEip4844/multipleProofs/blocks-1-46.json"; -import secondBlobContent_multiple from "../../testData/compressedDataEip4844/multipleProofs/blocks-47-81.json"; -import thirdBlobContent_multiple from "../../testData/compressedDataEip4844/multipleProofs/blocks-82-119.json"; -import fourthBlobContent_multiple from "../../testData/compressedDataEip4844/multipleProofs/blocks-120-153.json"; - -export const DEFAULT_SUBMISSION_DATA = { - dataParentHash: HASH_ZERO, - compressedData: "0x", - finalBlockInData: 0n, - firstBlockInData: 0n, - parentStateRootHash: HASH_ZERO, - finalStateRootHash: HASH_ZERO, - snarkHash: HASH_ZERO, -}; - -export const COMPRESSED_SUBMISSION_DATA = [ - firstCompressedDataContent, - secondCompressedDataContent, - thirdCompressedDataContent, - fourthCompressedDataContent, -]; - -export const BLOB_SUBMISSION_DATA = [ - firstBlobDataContent, - secondBlobDataContent, - thirdBlobDataContent, - fourthBlobDataContent, -]; - -export const COMPRESSED_SUBMISSION_DATA_MULTIPLE_PROOF = [ - firstCompressedDataContent_multiple, - secondCompressedDataContent_multiple, - thirdCompressedDataContent_multiple, - fourthCompressedDataContent_multiple, -]; - -export const BLOB_SUBMISSION_DATA_MULTIPLE_PROOF = [ - firstBlobContent_multiple, - secondBlobContent_multiple, - thirdBlobContent_multiple, - fourthBlobContent_multiple, -]; diff --git a/contracts/test/L1MessageService.ts b/contracts/test/hardhat/L1MessageService.ts similarity index 99% rename from contracts/test/L1MessageService.ts rename to contracts/test/hardhat/L1MessageService.ts index 599b2b23c..410cbb1ab 100644 --- a/contracts/test/L1MessageService.ts +++ b/contracts/test/hardhat/L1MessageService.ts @@ -8,7 +8,7 @@ import { TestL1MessageServiceMerkleProof, TestL1RevertContract, TestReceivingContract, -} from "../typechain-types"; +} from "../../typechain-types"; import { ADDRESS_ZERO, DEFAULT_ADMIN_ROLE, diff --git a/contracts/test/upgrades/verify_L2MessageService_Upgrade.ts b/contracts/test/hardhat/_manualTesting/verify_L2MessageService_Upgrade.ts similarity index 100% rename from contracts/test/upgrades/verify_L2MessageService_Upgrade.ts rename to contracts/test/hardhat/_manualTesting/verify_L2MessageService_Upgrade.ts diff --git a/contracts/test/upgrades/verify_LineaRollup_Upgrade.ts b/contracts/test/hardhat/_manualTesting/verify_LineaRollup_Upgrade.ts similarity index 100% rename from contracts/test/upgrades/verify_LineaRollup_Upgrade.ts rename to contracts/test/hardhat/_manualTesting/verify_LineaRollup_Upgrade.ts diff --git a/contracts/test/hardhat/_testData/compressedData/aggregatedProof-1-155.json b/contracts/test/hardhat/_testData/compressedData/aggregatedProof-1-155.json new file mode 100644 index 000000000..d792dfe3c --- /dev/null +++ b/contracts/test/hardhat/_testData/compressedData/aggregatedProof-1-155.json @@ -0,0 +1,27 @@ +{ + "finalShnarf": "0xdf1e9f621e3a89f02d44dbc266056d50d5d1524dc4d135f93b81619f3d674b7c", + "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", + "aggregatedProof": "0x0fca908fdabf2e4a48549b3169fc32f03d9bead71a949b3f321fe015368eda2907dd0c4d0ca22989d6beb8e98e379c2e6e26d5f92a7fc174e794b01f19f5a0260f846571ee911b857ea377e1d6e97d8667c32772db9bd5c771f26a5f0307d8d90627bd4efe26fa407774622155acc312139da21e89675c461198443312215ec2303185e66a815aadd406bd85cad499ba0f36ecbdc0cd5d85442f0045d5e5e51d1089fb10695fed82746e83ce265c8bc5aabe5562358dccb22f0e98f5254aef25157cbc8f0acef75219e160c6d42ce666e65b3850118a9fa062ada9d7fb65c0b22eedd8fa728240b123bb4e232f1951b531b3f09fb708b8ce33928e197c90b6b5060dcf56d254007fe6886a5bef306026d4a6a962792e00de026acef0210fbe280b89934a94d8c37ac6012f0ee450204f626b7ffdde445ae90f83b710e901ec6a255159d6288f7af1e49b681873fccbf5e4191bfe1fd91624b3758e4aedfa437a002211100d1137847c898064cf479ed33acc9e68e61459e17c35be140a7b5aac2942e9f7a6902a1994a4330e1285fa248ee831a0a795251c0e9aaad7e0b23c892f4856540c1459cfb4eb27b210556239e13542d8e4cdfdf988f00761c1c9f76c13d3fe61d4896cb390d059ce129cc848690f777b951e455a5a278066112379042e5dd006fab14bbf02c513ffdd0c747e7a4769b2588b22dc8515c535f0a2c22c1cc227e0a77e206dc101f13fdb7b59968a2a70b9554a51b7e947cd27ab1f2250014d38be63992958204464c1f6de4df648b8493316946716ea4250aaccbff1301c4f79b96aa50114e5b155d2c5769a8ac95f80c62b830e1c5b262989e0de85352cfbf1bd633464a1df637c46af8b5575031d3c9348bd7a95b02b6570b8ad15270b53a0fc81183f77a2ce3e7f84323a7a340d94334faf21ea7652573f4e83d0e61b8509d5a83ebba7afb2b87009df8ace4f4d6baf0f16fe7a553db7110e712a3802c6ef7efc484495b967658d9021f89229462885bafc010e47599a1fd5c22d9e26ded2cdbb3450b23cc5a2522d569e3e49bca65c2c343b4c702782efe74e3477131df957b4fd0757eee471f960cecd3affc1b58194715fa90566f12c462cbc592b2cbaeec63e45ea428cba04a2e512bb37988517b47b58bd9774ffa93475d92a02f8e1993616392ae12210e957603a83709f0601e9c4e55d246c63496f237c47", + "aggregatedProverVersion": "test", + "aggregatedVerifierIndex": 1, + "aggregatedProofPublicInput": "0x233fd3d94f86264d6b666cdcb455c1cb144d3dc399edc9d17bd50aa42ae789a2", + "dataHashes": [ + "0x7126453ddb4c09537a505a70bae0dd57a3f5daba4522fa1f79b760fb28efb35c", + "0x82694a9670032c50548d42dbf6f0d9d09febc4f2454796997ec9a4edc7f87106", + "0x08a70f876b12e010a0c34fe2bb03389fbeaf1749e9528359b7196df67a8c76fc", + "0x93eb7218f429a6efeb1ce6931a3915e0a032131ca9ff6ccc5c8428178221aa4c" + ], + "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", + "parentAggregationLastBlockTimestamp": 1683325137, + "lastFinalizedBlockNumber": 0, + "finalTimestamp": 1683335137, + "finalBlockNumber": 155, + "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", + "l1RollingHashMessageNumber": 1, + "l2MerkleRoots": [ + "0x8c11bf3dd28eeb8e951be357df5c22d4de2500ac61ecb04da92971c71b55585c" + ], + "l2MerkleTreesDepth": 5, + "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" +} \ No newline at end of file diff --git a/contracts/test/testData/compressedData/blocks-1-46.json b/contracts/test/hardhat/_testData/compressedData/blocks-1-46.json similarity index 100% rename from contracts/test/testData/compressedData/blocks-1-46.json rename to contracts/test/hardhat/_testData/compressedData/blocks-1-46.json diff --git a/contracts/test/testData/compressedData/blocks-115-155.json b/contracts/test/hardhat/_testData/compressedData/blocks-115-155.json similarity index 100% rename from contracts/test/testData/compressedData/blocks-115-155.json rename to contracts/test/hardhat/_testData/compressedData/blocks-115-155.json diff --git a/contracts/test/testData/compressedData/blocks-47-81.json b/contracts/test/hardhat/_testData/compressedData/blocks-47-81.json similarity index 100% rename from contracts/test/testData/compressedData/blocks-47-81.json rename to contracts/test/hardhat/_testData/compressedData/blocks-47-81.json diff --git a/contracts/test/testData/compressedData/blocks-82-114.json b/contracts/test/hardhat/_testData/compressedData/blocks-82-114.json similarity index 100% rename from contracts/test/testData/compressedData/blocks-82-114.json rename to contracts/test/hardhat/_testData/compressedData/blocks-82-114.json diff --git a/contracts/test/hardhat/_testData/compressedData/multipleProofs/aggregatedProof-1-81.json b/contracts/test/hardhat/_testData/compressedData/multipleProofs/aggregatedProof-1-81.json new file mode 100644 index 000000000..5ff9ee4ec --- /dev/null +++ b/contracts/test/hardhat/_testData/compressedData/multipleProofs/aggregatedProof-1-81.json @@ -0,0 +1,25 @@ +{ + "finalShnarf": "0x6d2b3535e06f4778e03c8439145dd9b8e4ae312953b9ccc154ef73b8a00c26c1", + "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", + "aggregatedProof": "0x30313033438c42faf4016734dade2d11b2c8372525f7b60a71d0a4bccfe3833607ff64adef856f488a5d6191332dbad346c74e8737094e038510a772270b94ce2c793adeed38658e33aa53af2f3c45eca455eb9fff8021336c82b01888f4cbaf0bf6b936b576d83c17b240e9b86daa7e27a841064d3fcb2711e49288c179fd66047fbadced4bfc6a74876d6123c0f0d88692329b433bd1a684e0f6554ea82aea02137b6b2c819906123960e5c9bdb8b8ba2919dba14891b0820892060f55e5ea1a453a2e09a07924e0118b28ee331d78452eb3c2366fba758cbcbdeac1ac724b1dffcef65d461efb0faea23561735399155a3b373002d1b6ae85cd184c9bfe540f0721d02a1d64901b31f614523948790e7ada89ed76818017c248f8522a75d62f04dbe225b6dfbbb4296beed9a6141beeaa87ab64bf9bbe698391ab3a3cff782a691bfbe9ff2efa56bb22ee886ff542a9ff5fb373a862d50f5aeb5c2fbc199708d4894e927cacf2775052d647da284d26edfb266cb92813a77a6f0c1dacf19314d1bee7aa56293f89dce7227f97d819b5c784d6624dee655e046a199a1b625c23db82a0683847d0755be3456d6af915c063d0076c63c3ee43fa4b2534ce955510715048a073ff6a9447c9c91472e1c24d77de85ffaa4b988a789a64b56a100220b095962e7da48d8d319bd90c544b915d5542b5f9d6629046f3902c0d9532cf0b7dcd5b8e005bdb6e0023ac7a4b20081d87171d7224d6351ca3bc6ec6c6d3462537b527eacccc92813d01ed29cda62df3adc0d3dcda55f8b0fce45fab6e7067251dea1b40f4d3853c174054672529fe8547130da71e6188d2d44ea6a3bba3370f75ab406764cf80d980534708547b044a794b56759e64eec2b6f11722beb749048141e22a568ae1ef5ee180c1af59ad5196918852f8390e1739b5ffbf778ff109989bb8768d2c37ec41337318a50e6daed527e9d6b9e17d042f5242ec99d8da24d863eb866aad9f0bd91ff5999b5673ced7321a525c2af47f66d78132bad769223ffbc303fcea302190912a8947ca7a298f7930b75a49ff3c5d755d94292e88104d5affe82c7bbf18cd35861075968ad1f95b0b55f09ade5ba44153899fcf8a09c9e28b1035beb3a493b34585b5095561166d094283a4ce6427590f0c3bfe261ca5336d739f9a56c0386c7323c41faeee3e811c4a9266c52eddab877efbfc22", + "aggregatedProverVersion": "test", + "aggregatedVerifierIndex": 1, + "aggregatedProofPublicInput": "0x216ea864c4d4392d0315997af776dbc1856686e376a07c85ed67f8509c14328e", + "dataHashes": [ + "0x7126453ddb4c09537a505a70bae0dd57a3f5daba4522fa1f79b760fb28efb35c", + "0x82694a9670032c50548d42dbf6f0d9d09febc4f2454796997ec9a4edc7f87106" + ], + "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", + "parentAggregationLastBlockTimestamp": 1683325137, + "lastFinalizedBlockNumber": 0, + "finalTimestamp": 1683335137, + "finalBlockNumber": 81, + "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", + "l1RollingHashMessageNumber": 1, + "l2MerkleRoots": [ + "0x6de197db892fd7d3fe0a389452dae0c5d0520e23d18ad20327546e2189a7e3f1" + ], + "l2MerkleTreesDepth": 5, + "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" +} \ No newline at end of file diff --git a/contracts/test/hardhat/_testData/compressedData/multipleProofs/aggregatedProof-82-153.json b/contracts/test/hardhat/_testData/compressedData/multipleProofs/aggregatedProof-82-153.json new file mode 100644 index 000000000..3781a95dd --- /dev/null +++ b/contracts/test/hardhat/_testData/compressedData/multipleProofs/aggregatedProof-82-153.json @@ -0,0 +1,25 @@ +{ + "finalShnarf": "0x4b7f110cbe7fcab315cd99683b2c7864bff2615903a3230d5bf2222b7a71a756", + "parentAggregationFinalShnarf": "0x6d2b3535e06f4778e03c8439145dd9b8e4ae312953b9ccc154ef73b8a00c26c1", + "aggregatedProof": "0x02e41bca53d5e1bf8b0ec55fb1c0fddc9d3d15d17ca10d6d9f7c5df01a30e3a307973b320ac40a80dc1c477b66d0e8309afeef3cbf9ba0fe5bbdbc209808665500b85bff38c9a4282e7856dd28fb5c927f9f333f9d9b7d047cd83461d757366d0738c665bbbd51f638809e31137c96b9762f4618ac6a692023a97a32b79b7cc715185be875358a46b9368ee6d93b6ff2188c438a53bd9063df9d89ae59dafb552cc4b719a800bdde6151a1de1714ad0fce697c8ba7f2be87686843c0caf76bef3007d80de9b305ca1d2ab62becbf8a7d2941590767c2bd548e9693309e33abdb24929a28df52816e1ebbe6e41918daa403fc41f344ad498027ffa7a822978e39217dc16adfeeababe6944025dc46a8a96fd323242d2d1eaf820cfcb7e8ca878200495bfd3d1956beb18706aa06063d8941f5276f1a81f6c976527c97f9d9d3a22f71ff3c0350dea7c87677bed824774203d4c760e0541db17e7c83b8dc0687d20adf52de3bc87a6b64dc64a4ea63ab5066e8d8e289e1abc1a776ee67ddeda9511a3b360a51822865d213c7738c4bdbed78dd9525a9a8bbaa57387d5c7e1651881bb0a5c1dd9044a987b746bd1e343d3a3f72701d2d1de04157013988770b4af4145d768e3054e9627d538d5002a93768b84c6248c6777d77cd9a22f8e63b0d302f77e5902a68ab5ff3121caf3985299f0c3527fc77468e6a86e48b85edaaa76d11a7549e00f916793361956c440cc44ff8a546aa770f8c654c669694411c35fd2e9bea56c5746d00a93ca4f8c4150e366a176bb0a5ec8bd4c595cce8b3dc9bd21b4d812ccc92f4e24b6536028fcb0fba77ac59b0196a495489a551546b2e07fb1407535d02080b425445fbac0fd02ce48b29652aaa7948dbd1f7e0fe46816164173e3ea2c8a909a9e2299950c9fa9d17dc77f87aa24df14bbd33d8714c70788c0088b322369fa5a4792726b1f45364c959d19b01d1c1baaed98dc17c03fc0e2125b0f151c66e1640a956a6cb2815edeacf0a417e1bf7dc4a8e281f79991cc9ce2bf0b60c2aec641622c8617d79aefe26cfffa10a7d3fd69bc99d67cb24209ed4055f625e0b4b45423d49c3332401ca6d83fd9fcad279dd64ec426e4b502554b9152232491ddbb32b219f3ef8f303574005b7a7d0fbf13c9a854a4ac233609d532044a1a7e87d38e3843fe9220554d52a291100d0a9a6e6e1c921215f0da10c23", + "aggregatedProverVersion": "test", + "aggregatedVerifierIndex": 1, + "aggregatedProofPublicInput": "0x0ecda6d6b122aa50210c937e14351066a6e98db71c066ace19abb75a3abdfda8", + "dataHashes": [ + "0xd1ef92f67e60ec41ee3b2f448024802d1608c138d4770ab1d3ada17facd6f0cc", + "0xa54a0666ba33710a751591da5edb268dc309934de83a5efa03eefc6e2e384737" + ], + "dataParentHash": "0x82694a9670032c50548d42dbf6f0d9d09febc4f2454796997ec9a4edc7f87106", + "parentStateRootHash": "0xf0f26782f7afb93f926cacb145f55530714f20b1356725e3971dc99e0ef8b591", + "parentAggregationLastBlockTimestamp": 1683335137, + "lastFinalizedBlockNumber": 81, + "finalTimestamp": 1683355137, + "finalBlockNumber": 153, + "l1RollingHash": "0xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "l1RollingHashMessageNumber": 14, + "l2MerkleRoots": [ + "0xf82d0ea8590489e98ca4279f30bd4b32a4fd62e6574ddc4f606d6496096b3721" + ], + "l2MerkleTreesDepth": 5, + "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" +} \ No newline at end of file diff --git a/contracts/test/testData/compressedData/multipleProofs/blocks-1-46.json b/contracts/test/hardhat/_testData/compressedData/multipleProofs/blocks-1-46.json similarity index 100% rename from contracts/test/testData/compressedData/multipleProofs/blocks-1-46.json rename to contracts/test/hardhat/_testData/compressedData/multipleProofs/blocks-1-46.json diff --git a/contracts/test/testData/compressedData/multipleProofs/blocks-120-153.json b/contracts/test/hardhat/_testData/compressedData/multipleProofs/blocks-120-153.json similarity index 100% rename from contracts/test/testData/compressedData/multipleProofs/blocks-120-153.json rename to contracts/test/hardhat/_testData/compressedData/multipleProofs/blocks-120-153.json diff --git a/contracts/test/testData/compressedData/multipleProofs/blocks-47-81.json b/contracts/test/hardhat/_testData/compressedData/multipleProofs/blocks-47-81.json similarity index 100% rename from contracts/test/testData/compressedData/multipleProofs/blocks-47-81.json rename to contracts/test/hardhat/_testData/compressedData/multipleProofs/blocks-47-81.json diff --git a/contracts/test/testData/compressedData/multipleProofs/blocks-82-119.json b/contracts/test/hardhat/_testData/compressedData/multipleProofs/blocks-82-119.json similarity index 100% rename from contracts/test/testData/compressedData/multipleProofs/blocks-82-119.json rename to contracts/test/hardhat/_testData/compressedData/multipleProofs/blocks-82-119.json diff --git a/contracts/test/hardhat/_testData/compressedData/test/aggregatedProof-1-46.json b/contracts/test/hardhat/_testData/compressedData/test/aggregatedProof-1-46.json new file mode 100644 index 000000000..f571cb582 --- /dev/null +++ b/contracts/test/hardhat/_testData/compressedData/test/aggregatedProof-1-46.json @@ -0,0 +1,24 @@ +{ + "finalShnarf": "0x9562fa89830a0ba0063a636ca96e52ce2f032b855336c95dd788321f4e193419", + "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", + "aggregatedProof": "0x19aab25faace24e8e145a1b0bfd39a16d64dd3c25e38f366e818e03e55ac05d20b0fb1301da772825a8154088acad5274012a8a71309c5946ff67823c6af507e2d1ea9aeaabbecc81b0b8738487551d59ea40d3fbf921d4021a060a355bbdf112a49c1eb9274529c85771f8b63b43677bca4944a04ae9f1625097106646ee63b1914d5ad67d01ca17939f70928d6479359c140fa56c2f2a9f5c52a8bb4cab9541c9938c7f3806753fe3e894581191a197bb5ec27ddfe8d05c0de190800aa5bc2186904597890bfcc70b23336d8e8683cd366a94aec8879c1a15500e6ab6b05d410083f0529116156338903222587a4d7ca36b1bdf277219bfa9daa043386db820711eb3413b5277ec42c69b95e0f4e46f55c312abd3cc544d2c69d59965be71f013e0fb72adc4e1fd983ec9f1c1bd5998e3a0ac513ba2e929ae248faf944a1d613f18c9d815f576bac14c1d5a0840c0266f2cb497bb0af762598c6154933075d2f7d4ba04fc7c0cf38cf09f681b3d48299e2d1f5e9cdf9e8a575a1f9df2548e007496b104947579a80f2781c62b3b6c8895532786806d0e179118f18b4a6af28041e13e09169bb323e11664b956933d4767955ad17e0e2254fcd0459e48ef31124b7c84d983c0c447fcacff16301ff544b814533a20fd78840843335f50f92d805d2c5604a8d85719b71194d2d39efea2b22eb7b3121b7486a13ea8e0ebc18e90efc462348ae8f0062a2f7504bc7c5197c5a899375b854206cda2bdd1ceedab42afb04ce57e7adc01f4490bcfb274be404c3646c331b8bf4d6cba0dff1aae0440b3bf6d54890ec9dd014518cffe85027afb3f820456ef3434762b5d1b30b96b813129cacfa233be272f82629ec0ad8ca5d6915aa9dae66e084f90feea2a575840bf9983bbaa2b091b801a6f16bffd37c16612c8da12ca883b20c84cfe6d3471d0e47f74aae689ec3d5cec1fea21910233ed6c1ae384fca1ed7c496448350a3860da912be5019b67c38c63919f04aead40276af6b7c0f9ac1889bdd91c0802dff17cd402c0cbed112d67e2ee9d4472e81cccbfc3caedb92cf03ff1a977bd7e513262d10e1beef18632fdcdf0ee01dc92c7dc1aa877516c0533788d0b3e3333e812d8dfe633a2073ab3377e1943596be47c00f894d41a08eea403118cf1909a0510197ac2a260e913e0728b015fd568141af83b0a6d2eec3639bdebcab139159fa", + "aggregatedProverVersion": "test", + "aggregatedVerifierIndex": 1, + "aggregatedProofPublicInput": "0x1e77e4d1bba517cf992e7788a104fc5612e539ea2b459b532d69efe6c416235a", + "dataHashes": [ + "0x7126453ddb4c09537a505a70bae0dd57a3f5daba4522fa1f79b760fb28efb35c" + ], + "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", + "parentAggregationLastBlockTimestamp": 1683325137, + "lastFinalizedBlockNumber": 0, + "finalTimestamp": 1683335137, + "finalBlockNumber": 46, + "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", + "l1RollingHashMessageNumber": 1, + "l2MerkleRoots": [ + "0x97cd1539d08f7c0ba06ad836b2690eef50afd86609a0672517ec0ef8c1f94796" + ], + "l2MerkleTreesDepth": 5, + "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" +} \ No newline at end of file diff --git a/contracts/test/testData/compressedData/test/blocks-1-46.json b/contracts/test/hardhat/_testData/compressedData/test/blocks-1-46.json similarity index 100% rename from contracts/test/testData/compressedData/test/blocks-1-46.json rename to contracts/test/hardhat/_testData/compressedData/test/blocks-1-46.json diff --git a/contracts/test/hardhat/_testData/compressedDataEip4844/aggregatedProof-1-155.json b/contracts/test/hardhat/_testData/compressedDataEip4844/aggregatedProof-1-155.json new file mode 100644 index 000000000..d1e4d6fab --- /dev/null +++ b/contracts/test/hardhat/_testData/compressedDataEip4844/aggregatedProof-1-155.json @@ -0,0 +1,27 @@ +{ + "finalShnarf": "0x602c8eeedd7f6dbb7bc0348da1b0dced846acf09586c9f27aa06b494a1c49249", + "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", + "aggregatedProof": "0x01b8eedfd19a973d0750c42ba4d969ebc42ebbd3db56d891e61ab42035771477015671a6fdd0e82fb20b1648f18d87435bc7847f1d138aadc8ab5edc683b271e15d7314d73c422bd3f7e508b0b10c5db59a4f7471f915526038ab31d9a47b4c827ecac6f15aabfa78f686ff94cba2232a74cbd3c6b10be7b92c28d8b74cb4f490ab3d4b37b0dbfb59676448b23388168e8308d1d478d03834437c830b1777679235e6fa08f028c188c070b9c07d9fb46eb387755d517fe28a804d501c021da2c169a99586e804c34578b198a299d948bdbf89a065cdc7e5f7e601e195794071f14e81f8e7dd222937b101485d332a3ac8c2f8bf6a6d46d942ad37b7467ddc4f11e13ba64f9c7d19866258eef37769bfc963e5b5ac4475a92348ab167360377f02c1f9b720dc2783951e06d616d00218f6504b3cbfa833103ee8e5359a21854b512d6721687a315f497deb9c65fc770d21f9b5e097db201b7340d0edbf9d2fd042b6f5ad716592c0626a77bd68024b1fceb6cc12a1072bdb2449c2c8b0c78def10210596f2ea17ffd12b8f4c45d9bfa8c17461dbe9d4a8af75a20a9c9b2ac90880d413b6dce475a9cad4790f2d682fd3f31d53f13c7add0d81aa3d4fff8bd0e962fe0c07b58cbf5ae3b52b3850549ab9f03cc1c0cb762f6325919d3f1e08b726b24472472c96bdcd7df8fbc8f43b6220603ca59cde518787c7df3836ffe0d7b0626da07c2c556cfa2fc40347b6bb81aa5ba02281c5f58370f257273a4ba369e09057784e031a3e245e5ad5c190ff694f4eebafcacc47d22b09d367739375afb9e214f6110d4e27c5ef42c24d725f9757c2dee7aa7e0207d473562801a6ab114650dd58b43cd7bc3e03cebb39e3fdb56d0ddee5ea5db19fe5874e8bb6d0d0d7fba09b194160c583e95ba6795e226373124ff28be6cc0956560c4d2e326c772dab2118db10e8926bc2a8da6e65aeecfc94636897d2695165aa287532f3e617bba1c01894ba5545f8f187bca11e65688241617a46cfd2b999dc5c6295228b2d93ec11512741ad3ae4d4512efad1e9fb14121896888f27cd55514af42388037cb1dbb225644640fa654a8184c3d8826a855a2ad54477b51e33ce33cb01ce5e648fe1b2e794ee1a3972982fca964f11c65a4b35eecd4d77869a0f6e8d5748601bc58e8091d6bdd480528aa4a1b0b99454e24024b4f72a0b6ea0193b811fe28ef5222b8", + "aggregatedProverVersion": "test", + "aggregatedVerifierIndex": 1, + "aggregatedProofPublicInput": "0x1538dc88156cbdf280326f52e33192924ff311be4abc0dede43a14fbfb160a55", + "dataHashes": [ + "0x01f5853fa56ab910be0933f2ee811bbc437500dba4e38acbae17eab00eec9f95", + "0x01a142b35ad91719145a4e3bf1d5402e6a73818db67312ade7a73ad5130ac618", + "0x017b1d49c6c7947f83855cc16063ef19d02369540b97867855427b56cdaea487", + "0x012cab32c78df416fe59f8f123e2ded2466a64e201bacddc8396231f335d2088" + ], + "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", + "parentAggregationLastBlockTimestamp": 1683325137, + "lastFinalizedBlockNumber": 0, + "finalTimestamp": 1683335137, + "finalBlockNumber": 155, + "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", + "l1RollingHashMessageNumber": 1, + "l2MerkleRoots": [ + "0x8c11bf3dd28eeb8e951be357df5c22d4de2500ac61ecb04da92971c71b55585c" + ], + "l2MerkleTreesDepth": 5, + "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" +} \ No newline at end of file diff --git a/contracts/test/testData/compressedDataEip4844/blocks-1-46.json b/contracts/test/hardhat/_testData/compressedDataEip4844/blocks-1-46.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/blocks-1-46.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/blocks-1-46.json diff --git a/contracts/test/testData/compressedDataEip4844/blocks-115-155.json b/contracts/test/hardhat/_testData/compressedDataEip4844/blocks-115-155.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/blocks-115-155.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/blocks-115-155.json diff --git a/contracts/test/testData/compressedDataEip4844/blocks-47-81.json b/contracts/test/hardhat/_testData/compressedDataEip4844/blocks-47-81.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/blocks-47-81.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/blocks-47-81.json diff --git a/contracts/test/testData/compressedDataEip4844/blocks-82-114.json b/contracts/test/hardhat/_testData/compressedDataEip4844/blocks-82-114.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/blocks-82-114.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/blocks-82-114.json diff --git a/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json b/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json new file mode 100644 index 000000000..0d85961fc --- /dev/null +++ b/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json @@ -0,0 +1,25 @@ +{ + "finalShnarf": "0xfd910670a8da6aaaf2431ce7345a605dc15dc41298b9410065d2f7bb1ba99fea", + "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", + "aggregatedProof": "0x204f16273856ff81bac2e62d7841efe1d89f1b756746befee1835b0f23add0391e6a5c7648f07ab179ad0af3be93f52b981641e95da794c6f3495f8bccefba692938c8c5c809a6c6b195a755fefd6ba94c6d9aafe4cfb2d0592f31ebe6b5b41f13d131c6bf9ddcfa526bee005f89a9b430b6239281d0646fe0e519243b1c89fb081bd3bc1e75dcf70db4dc0a82dd697df4a685c57bb037f2aaed2d9a44df36a51f56d26ff700797930a559d109348b6bfe519066450652ffda155b4a1883cc0e19e38253931546be3143b28eee17968bae69cff96be2af8d4fcb5bf903a7ae931a7f467531a1c599c166a64d175fe0a4c8f2cf28df322d34c494268def7e2d72180a7477bc6c7c63dd8ffceee6cbd87641e774164cc49383d1576d08ae8919f31160e7be139f6a49bd6bad7094e2d5bf6bb275646dcc71b5fce10720205682700b19829de6760df255b6a9b6766d40a77c33570131af7319579a4b125266c5542d2be76197e67687a4c6958fc5a1e06685f42a4729c07b54bfa75efafa3766fa05f1c2bea07da865eae383d779a3482bf93dd09b0c1cc8ff1fc928af24afca8d243b3678fc8c7c461fdc15540e3f69cb22bf017cff888fa1e0efd27c00511cc72fb1c3d4989efb96cae362f3601497aa776e30a36b02001890fcd5b131a15d250952e2312ee6c9e9d5221d4179cc78c3d4ac8ef15eadb9dbafd563704440deb6250187725d5319969850055d2c1de2a2814918c297251d33afcf103c30ea37d0204fb81d73056b53476db411ed59019370d48262f33ac4c9a556b304b60c14fe009b3c747e9bcd285eea97b7997ae5b1a9d517ee1d9a422a28a3c7b914dc6eca0810a198b219689b36752fe7e64a98771c3fd7bbdde9403e16594a55da4728d92dcc717675970eca07a72082f9e4ea9a4a9909593dfcc52f72463fac1fe184992ee3c84e4bc9680ce19f7ca8e8173e366ca665360f5344d3206149492b17a9ca2431d782069f0bb6e0f2f596da8ef2e8d5374f8fa8fb426718f4ec6a389d7f202ef740cb19053f726419238eff09605ff37f9abcc360b569fe9579d0a77b7a0905f3a705e390b13b8951e59a7cc5f41b1b7b5c7c8f3383382485b715f2a7bd900fcf788b75c1b5c9c8cc619d969b6dd081b5d618facb54cb5fe46a1fc41622292a93210d9fbcfc703d87aeb3e25e72f0a312794fa4038737830d04ba214a1311", + "aggregatedProverVersion": "test", + "aggregatedVerifierIndex": 1, + "aggregatedProofPublicInput": "0x02df9c4f607afe80ac52003978e4a9e197a7a0b61b6601d5e0788a6fdec1c08d", + "dataHashes": [ + "0x01f5853fa56ab910be0933f2ee811bbc437500dba4e38acbae17eab00eec9f95", + "0x01a142b35ad91719145a4e3bf1d5402e6a73818db67312ade7a73ad5130ac618" + ], + "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", + "parentAggregationLastBlockTimestamp": 1683325137, + "lastFinalizedBlockNumber": 0, + "finalTimestamp": 1683335137, + "finalBlockNumber": 81, + "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", + "l1RollingHashMessageNumber": 1, + "l2MerkleRoots": [ + "0x6de197db892fd7d3fe0a389452dae0c5d0520e23d18ad20327546e2189a7e3f1" + ], + "l2MerkleTreesDepth": 5, + "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" +} \ No newline at end of file diff --git a/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/aggregatedProof-82-153.json b/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/aggregatedProof-82-153.json new file mode 100644 index 000000000..6675d2c13 --- /dev/null +++ b/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/aggregatedProof-82-153.json @@ -0,0 +1,25 @@ +{ + "finalShnarf": "0x42d7511a7a880ac5c3a61a0f480e95ec7b0e2cfff1aa106ea0256aa94bf2b865", + "parentAggregationFinalShnarf": "0xfd910670a8da6aaaf2431ce7345a605dc15dc41298b9410065d2f7bb1ba99fea", + "aggregatedProof": "0x033557c5d13a30ca1669875ffb80a1be98d6c167e438189af0fb73d54151f94e0b0955070468945895898f7f1c3a77a0a6afff34227b352fc49678e4db78c4a602caf4c3ad916ca9ad06ca3d02e3a3b3dc2eeeef17d8708f2d2f0dd73820e7220228e23d2ed96859bc5602f9070c7ea4ab25de390c518d93fbd5a573518c3a5b1b87fceb317d63198839d5447a466d19096673cde01c025ae78960aab89010130aff9b2feb5c17665d7055db4722beee2b8bb4a36754bc1aceee949078926576113b6b00be25c5e3ab5e8b32481709ee6ed8953349b84128337e07f468e39e5f23d6ddb6ab6d01d253bcfd00cf763a02023d0a1a2b72a2f024e9b1704a93c0d50afb34279f71c35cb8d0dcf5fe23c8edc24740b768ed6b679199c104427cd05418b64479bb825e12c417afd127b0a869a82e30c1b4e4494be464db3518e54bcf22e3f2a2f1e6d6473d8cc1a65a5cd3b1a88fed0b18e9c8b999cd7151b5b9c14d28889db5eafe3f7fc10bc28803927d10cfc65d4c6c402c3f3dca4009e1d3b704284d77530c241580cf668c188c666a2986a6b2a41ebc75e5474fd0e7435fb23e1e812e9a77cc2a5c593ed996f2e9b7d400fb30b684cafb1803a2d780053f27ed0a4a1428d13f9ea2d6ae6bfbd520f0bf18013e6d404aba036729ff95e34a59ce1a4f8a250b11936c0ef81c220a1c4225f32209990d2d2dc13e2b32c4c02535c416a3e2c11d6346a2a509567e83e96767fc21de7cc2ab8e067bea77beed78a7442f3615040638385346edb1389508b48ae7666a35e559facb9ebc498bf4c25ce40ee15e0ba2445d251457ef2e596ff67653d5de839ee4d7aadc5f05d5577c1b5d267386e5389b2056485a84c72ac4be2a2141c6660e372107c3ccdf3944df36b201f3be39dce41c79eb49c605db28e24ae3a42e3762e3794a0ebcaf59dd3d70100820bd55fdb3237a404e7d3097ebb85c0faf3a83662bd28ff663765c9adef9c60c7686c5b4bcb20e535483e032e0ec61de4d4b5630e78918a0b21b7e47ce1ac925a364c5e25148715c7f70e9019f08c2e36f8d27ed7f0de8773e3a7867ff3a9306b89a0500eb45f6eb563fc52c64e2edc497660f9c4e2fc263771b3815b6b16b2dffc656e03aacc8c9874fcc859cb0cd1cecad6e0671f8d6f4ebb146a9fa30111749ac08641ec8b0f7891c876da368b7a4acb088996f3e71e631035945c3dbf7", + "aggregatedProverVersion": "test", + "aggregatedVerifierIndex": 1, + "aggregatedProofPublicInput": "0x23151dfee9756b7eb4a018d5ef30730f20e05edfd3ce67a8f898c46cb2d79341", + "dataHashes": [ + "0x01bdfef0d1ddb163bf8431ea63ad7166bcd69a72a4fa30342138335d7fac96f4", + "0x0112b6fcf15707263de267fdc63c78cf9881654e88455b94fb8f9f7623223365" + ], + "dataParentHash": "0x01a142b35ad91719145a4e3bf1d5402e6a73818db67312ade7a73ad5130ac618", + "parentStateRootHash": "0xf0f26782f7afb93f926cacb145f55530714f20b1356725e3971dc99e0ef8b591", + "parentAggregationLastBlockTimestamp": 1683335137, + "lastFinalizedBlockNumber": 81, + "finalTimestamp": 1683355137, + "finalBlockNumber": 153, + "l1RollingHash": "0xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "l1RollingHashMessageNumber": 14, + "l2MerkleRoots": [ + "0xf82d0ea8590489e98ca4279f30bd4b32a4fd62e6574ddc4f606d6496096b3721" + ], + "l2MerkleTreesDepth": 5, + "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" +} \ No newline at end of file diff --git a/contracts/test/testData/compressedDataEip4844/multipleProofs/blocks-1-46.json b/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/blocks-1-46.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/multipleProofs/blocks-1-46.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/blocks-1-46.json diff --git a/contracts/test/testData/compressedDataEip4844/multipleProofs/blocks-120-153.json b/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/blocks-120-153.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/multipleProofs/blocks-120-153.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/blocks-120-153.json diff --git a/contracts/test/testData/compressedDataEip4844/multipleProofs/blocks-47-81.json b/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/blocks-47-81.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/multipleProofs/blocks-47-81.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/blocks-47-81.json diff --git a/contracts/test/testData/compressedDataEip4844/multipleProofs/blocks-82-119.json b/contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/blocks-82-119.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/multipleProofs/blocks-82-119.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/multipleProofs/blocks-82-119.json diff --git a/contracts/test/testData/compressedDataEip4844/test/aggregatedProof-1-155.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/aggregatedProof-1-155.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/test/aggregatedProof-1-155.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/test/aggregatedProof-1-155.json diff --git a/contracts/test/testData/compressedDataEip4844/test/aggregatedProof-1-206.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/aggregatedProof-1-206.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/test/aggregatedProof-1-206.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/test/aggregatedProof-1-206.json diff --git a/contracts/test/hardhat/_testData/compressedDataEip4844/test/aggregatedProof-1-46.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/aggregatedProof-1-46.json new file mode 100644 index 000000000..c4603dc81 --- /dev/null +++ b/contracts/test/hardhat/_testData/compressedDataEip4844/test/aggregatedProof-1-46.json @@ -0,0 +1,24 @@ +{ + "finalShnarf": "0x4e584b910dc758442e58e56e0bb46c001addaffe770fb740ea0e1b90c0e2b056", + "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", + "aggregatedProof": "0x11cd421a70428e11749089cfa09f497f97c48b11869fbcf6392497e257b5511f06b2e71e1d8a101dd197884bdd82d85e017694efe4fcccfea89a08485fba307a11cd3d439d22d3bc71962037c2300a3df1941a443eaba2fea8fbaf7d33e7822d182b87d1921b56dd51ee4540e2f57353f517311aa37cfc50291860c3bf33977809f875d199ff26840859191d8d742ec987f17b7e2d7643d0620cde28c0968cc906ca504d6bbccd9a22e7becf62591ab80b306d40644d262a1ffc31ec91438b281386adb22420decebd13e6a902f2515e4a75a44925d4ea208d2fb6c6f58567d7189f301d2a08badc647852dda3c51ea84e32f0f3207d013abcee0e705c4bde9b21cb81cfda904568c3d3aa6d5349038c0fd11efc90c127291968e390e2d9b52a0b93dcadb97bf4b8ce6a76b3606349611556ae2f4c8747a9b5fe317a93173afd278dd2e50791089ca6f2b0b1541beb6ce6b90e2b8350e05313b44e70821e74270669d00462ecdfa5955a0b58bfff42f7f729d3801817d02bb6842cc5aec17caf268aba200e1f7d48935ecb23920b037a62ae719fe5aa17f2ffd2b5b89523cad204127a42cb96c648c7a560c66c08fa2f9e9615aa71316f06f055088b28738ac8120e0c3a1bbe339f499d0cb62540effac69832b7bdc9f2b3527ef5c8e82ea5ce181a5793cb5378a71c0a7ad4bdbdae0863427ed1e49cc90ea9dc1ec9fcb7a4072fc9297f4013d5315a418a6e829cabb33a23cd7417a19ccb57e4ba210d2057ad06d16e28060e14c447b01e06ec83972ad2d1f4d07cf077a66a9c538e10deaa19171dae203d7ae5d43a9ba37e6c3d05acb7fd63dfa64c1b2d33b2c580ff5ed97a070ba28b4acb73c73b489e10f2f99164131a92eae79719617bc7ac34e6f4e2370b280a0227c2d225662509fbff12aeaaeeed14f888b963ad770a1a4b81549ab103a0a09290510a90e353f6ee519bfade3d55a30e6d4a9f1fde1a3ec2b4f46af003ded1ab46f68a2279e927966d019084d4a9b128618448b31b74a99725b202af161aca24bba201b9e6f822c8b8a7f8acdc35162dfe6478706c58c8e11b38ffcf04bec2d0fc995b97aca6e5c5454167ee36acc63c62b3d25d396e9135e9d3ed430b9ddf6d97622ed424bf4e789fbce736186bee2ad9514c383315c4da53a6e8c00b490f5f45eb6115b11c1a5ea4f57e6bb6b25892b63f318b4cf0c40266ad90e2", + "aggregatedProverVersion": "test", + "aggregatedVerifierIndex": 1, + "aggregatedProofPublicInput": "0x0c16c609b50fbc6f660b3fe38c5989ce059ea171048c99c0dad306cea570df61", + "dataHashes": [ + "0x01f5853fa56ab910be0933f2ee811bbc437500dba4e38acbae17eab00eec9f95" + ], + "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", + "parentAggregationLastBlockTimestamp": 1683325137, + "lastFinalizedBlockNumber": 0, + "finalTimestamp": 1683335137, + "finalBlockNumber": 46, + "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", + "l1RollingHashMessageNumber": 1, + "l2MerkleRoots": [ + "0x97cd1539d08f7c0ba06ad836b2690eef50afd86609a0672517ec0ef8c1f94796" + ], + "l2MerkleTreesDepth": 5, + "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" +} \ No newline at end of file diff --git a/contracts/test/testData/compressedDataEip4844/test/blocks-1-46.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-1-46.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/test/blocks-1-46.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-1-46.json diff --git a/contracts/test/testData/compressedDataEip4844/test/blocks-115-155.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-115-155.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/test/blocks-115-155.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-115-155.json diff --git a/contracts/test/testData/compressedDataEip4844/test/blocks-156-175.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-156-175.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/test/blocks-156-175.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-156-175.json diff --git a/contracts/test/testData/compressedDataEip4844/test/blocks-176-206.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-176-206.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/test/blocks-176-206.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-176-206.json diff --git a/contracts/test/testData/compressedDataEip4844/test/blocks-47-81.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-47-81.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/test/blocks-47-81.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-47-81.json diff --git a/contracts/test/testData/compressedDataEip4844/test/blocks-82-114.json b/contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-82-114.json similarity index 100% rename from contracts/test/testData/compressedDataEip4844/test/blocks-82-114.json rename to contracts/test/hardhat/_testData/compressedDataEip4844/test/blocks-82-114.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000501-1000503-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000501-1000503-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000501-1000503-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000501-1000503-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000504-1000505-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000504-1000505-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000504-1000505-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000504-1000505-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000506-1000507-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000506-1000507-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000506-1000507-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000506-1000507-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000508-1000512-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000508-1000512-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000508-1000512-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000508-1000512-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000513-1000518-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000513-1000518-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000513-1000518-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000513-1000518-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000519-1000522-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000519-1000522-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000519-1000522-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000519-1000522-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000523-1000528-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000523-1000528-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000523-1000528-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000523-1000528-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000529-1000530-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000529-1000530-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000529-1000530-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000529-1000530-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000531-1000536-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000531-1000536-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000531-1000536-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000531-1000536-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000537-1000538-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000537-1000538-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000537-1000538-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000537-1000538-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000539-1000544-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000539-1000544-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000539-1000544-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000539-1000544-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000545-1000548-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000545-1000548-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000545-1000548-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000545-1000548-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000549-1000550-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000549-1000550-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000549-1000550-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000549-1000550-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000551-1000554-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000551-1000554-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000551-1000554-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000551-1000554-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000555-1000560-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000555-1000560-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000555-1000560-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000555-1000560-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000561-1000563-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000561-1000563-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000561-1000563-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000561-1000563-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000564-1000565-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000564-1000565-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000564-1000565-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000564-1000565-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000566-1000571-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000566-1000571-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000566-1000571-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000566-1000571-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000572-1000576-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000572-1000576-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000572-1000576-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000572-1000576-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000577-1000580-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000577-1000580-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000577-1000580-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000577-1000580-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000581-1000586-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000581-1000586-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000581-1000586-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000581-1000586-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000587-1000588-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000587-1000588-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000587-1000588-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000587-1000588-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000589-1000592-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000589-1000592-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000589-1000592-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000589-1000592-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000593-1000594-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000593-1000594-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000593-1000594-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000593-1000594-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/blobSubmissions/1000595-1000599-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json b/contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000595-1000599-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json similarity index 100% rename from contracts/test/testData/integrationWithProver/blobSubmissions/1000595-1000599-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json rename to contracts/test/hardhat/_testData/integrationWithProver/blobSubmissions/1000595-1000599-bcv0.0.0-ccv0.0.0-getZkBlobCompressionProof.json diff --git a/contracts/test/testData/integrationWithProver/rolling-hash-history.json b/contracts/test/hardhat/_testData/integrationWithProver/rolling-hash-history.json similarity index 100% rename from contracts/test/testData/integrationWithProver/rolling-hash-history.json rename to contracts/test/hardhat/_testData/integrationWithProver/rolling-hash-history.json diff --git a/contracts/test/testData/merkle-proof-data.json b/contracts/test/hardhat/_testData/merkle-proof-data.json similarity index 100% rename from contracts/test/testData/merkle-proof-data.json rename to contracts/test/hardhat/_testData/merkle-proof-data.json diff --git a/contracts/test/testData/mimc-test-data.json b/contracts/test/hardhat/_testData/mimc-test-data.json similarity index 100% rename from contracts/test/testData/mimc-test-data.json rename to contracts/test/hardhat/_testData/mimc-test-data.json diff --git a/contracts/test/testData/test-transactions.json b/contracts/test/hardhat/_testData/test-transactions.json similarity index 100% rename from contracts/test/testData/test-transactions.json rename to contracts/test/hardhat/_testData/test-transactions.json diff --git a/contracts/test/testData/trusted_setup.txt b/contracts/test/hardhat/_testData/trusted_setup.txt similarity index 100% rename from contracts/test/testData/trusted_setup.txt rename to contracts/test/hardhat/_testData/trusted_setup.txt diff --git a/contracts/test/tokenBridge/BridgedToken.ts b/contracts/test/hardhat/bridging/token/BridgedToken.ts similarity index 98% rename from contracts/test/tokenBridge/BridgedToken.ts rename to contracts/test/hardhat/bridging/token/BridgedToken.ts index 3aeef1616..0ecb0f8dd 100644 --- a/contracts/test/tokenBridge/BridgedToken.ts +++ b/contracts/test/hardhat/bridging/token/BridgedToken.ts @@ -1,7 +1,7 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers, upgrades } from "hardhat"; -import { BridgedToken, UpgradedBridgedToken } from "../../typechain-types"; +import { BridgedToken, UpgradedBridgedToken } from "../../../../typechain-types"; const initialUserBalance = 10000; diff --git a/contracts/test/tokenBridge/E2E.ts b/contracts/test/hardhat/bridging/token/MockedE2E.ts similarity index 98% rename from contracts/test/tokenBridge/E2E.ts rename to contracts/test/hardhat/bridging/token/MockedE2E.ts index d24b16c59..4c410c372 100644 --- a/contracts/test/tokenBridge/E2E.ts +++ b/contracts/test/hardhat/bridging/token/MockedE2E.ts @@ -2,20 +2,20 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { deployTokenBridgeWithMockMessaging } from "../../scripts/tokenBridge/test/deployTokenBridges"; -import { deployTokens } from "../../scripts/tokenBridge/test/deployTokens"; -import { BridgedToken, ERC20Fees, MockERC20MintBurn } from "../../typechain-types"; +import { deployTokenBridgeWithMockMessaging } from "../../../../scripts/tokenBridge/test/deployTokenBridges"; +import { deployTokens } from "../../../../scripts/tokenBridge/test/deployTokens"; +import { BridgedToken, ERC20Fees, MockERC20MintBurn } from "../../../../typechain-types"; import { buildAccessErrorMessage, expectEvent, expectRevertWithCustomError, expectRevertWithReason, -} from "../common/helpers"; +} from "../../common/helpers"; import { COMPLETE_TOKEN_BRIDGING_PAUSE_TYPE, INITIATE_TOKEN_BRIDGING_PAUSE_TYPE, SET_MESSAGE_SERVICE_ROLE, -} from "../common/constants"; +} from "../../common/constants"; const initialUserBalance = BigInt(10 ** 9); const RESERVED_STATUS = ethers.getAddress("0x0000000000000000000000000000000000000111"); @@ -25,7 +25,7 @@ const mockName = "L1 DAI"; const mockSymbol = "L1DAI"; const mockDecimals = 18; -describe("E2E tests", function () { +describe("Mocked E2E tests", function () { async function deployContractsFixture() { const [deployer, user] = await ethers.getSigners(); diff --git a/contracts/test/tokenBridge/TokenBridge.ts b/contracts/test/hardhat/bridging/token/TokenBridge.ts similarity index 99% rename from contracts/test/tokenBridge/TokenBridge.ts rename to contracts/test/hardhat/bridging/token/TokenBridge.ts index cf1eaf947..2f70f5ca3 100644 --- a/contracts/test/tokenBridge/TokenBridge.ts +++ b/contracts/test/hardhat/bridging/token/TokenBridge.ts @@ -1,9 +1,9 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers, upgrades } from "hardhat"; -import { deployTokenBridgeWithMockMessaging } from "../../scripts/tokenBridge/test/deployTokenBridges"; -import { deployTokens } from "../../scripts/tokenBridge/test/deployTokens"; -import { BridgedToken, TestTokenBridge, TokenBridge, ProxyAdmin } from "../../typechain-types"; +import { deployTokenBridgeWithMockMessaging } from "../../../../scripts/tokenBridge/test/deployTokenBridges"; +import { deployTokens } from "../../../../scripts/tokenBridge/test/deployTokens"; +import { BridgedToken, TestTokenBridge, TokenBridge, ProxyAdmin } from "../../../../typechain-types"; import { getPermitData } from "./utils/permitHelper"; import { Contract, ZeroAddress } from "ethers"; import { @@ -23,13 +23,13 @@ import { PAUSE_ALL_ROLE, UNPAUSE_ALL_ROLE, HASH_ZERO, -} from "../common/constants"; +} from "../../common/constants"; import { buildAccessErrorMessage, expectEvent, expectRevertWithCustomError, expectRevertWithReason, -} from "../common/helpers"; +} from "../../common/helpers"; import { DEFAULT_ADMIN_ROLE } from "contracts/common/constants"; import { SupportedChainIds } from "contracts/common/supportedNetworks"; @@ -1046,7 +1046,7 @@ describe("TokenBridge", function () { const { owner, messageService, chainIds } = await loadFixture(deployContractsFixture); const TokenBridgeV1 = await ethers.getContractFactory( - "contracts/tokenBridge/mocks/TokenBridgeFlatten.sol:TokenBridgeFlatten", + "src/_testing/integration/TokenBridgeFlatten.sol:TokenBridgeFlatten", ); const tokenBridgeV1 = (await upgrades.deployProxy(TokenBridgeV1, [ owner.address, @@ -1141,7 +1141,7 @@ describe("TokenBridge", function () { const { owner, messageService, chainIds } = await loadFixture(deployContractsFixture); const TokenBridgeV1 = await ethers.getContractFactory( - "contracts/tokenBridge/mocks/TokenBridgeFlatten.sol:TokenBridgeFlatten", + "src/_testing/integration/TokenBridgeFlatten.sol:TokenBridgeFlatten", ); const tokenBridgeV1 = (await upgrades.deployProxy(TokenBridgeV1, [ owner.address, diff --git a/contracts/test/tokenBridge/utils/permitHelper.ts b/contracts/test/hardhat/bridging/token/utils/permitHelper.ts similarity index 95% rename from contracts/test/tokenBridge/utils/permitHelper.ts rename to contracts/test/hardhat/bridging/token/utils/permitHelper.ts index 90ff61539..fa31f1c2e 100644 --- a/contracts/test/tokenBridge/utils/permitHelper.ts +++ b/contracts/test/hardhat/bridging/token/utils/permitHelper.ts @@ -1,6 +1,6 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { ethers } from "ethers"; -import { BridgedToken } from "../../../typechain-types"; +import { BridgedToken } from "../../../../../typechain-types"; const Permit = [ { name: "owner", type: "address" }, diff --git a/contracts/test/common/constants/calldata.ts b/contracts/test/hardhat/common/constants/calldata.ts similarity index 100% rename from contracts/test/common/constants/calldata.ts rename to contracts/test/hardhat/common/constants/calldata.ts diff --git a/contracts/test/common/constants/errorMessages.ts b/contracts/test/hardhat/common/constants/errorMessages.ts similarity index 100% rename from contracts/test/common/constants/errorMessages.ts rename to contracts/test/hardhat/common/constants/errorMessages.ts diff --git a/contracts/test/common/constants/fees.ts b/contracts/test/hardhat/common/constants/fees.ts similarity index 100% rename from contracts/test/common/constants/fees.ts rename to contracts/test/hardhat/common/constants/fees.ts diff --git a/contracts/test/common/constants/general.ts b/contracts/test/hardhat/common/constants/general.ts similarity index 100% rename from contracts/test/common/constants/general.ts rename to contracts/test/hardhat/common/constants/general.ts diff --git a/contracts/test/common/constants/index.ts b/contracts/test/hardhat/common/constants/index.ts similarity index 100% rename from contracts/test/common/constants/index.ts rename to contracts/test/hardhat/common/constants/index.ts diff --git a/contracts/test/common/constants/merkleTree.ts b/contracts/test/hardhat/common/constants/merkleTree.ts similarity index 100% rename from contracts/test/common/constants/merkleTree.ts rename to contracts/test/hardhat/common/constants/merkleTree.ts diff --git a/contracts/test/common/constants/messageStatuses.ts b/contracts/test/hardhat/common/constants/messageStatuses.ts similarity index 100% rename from contracts/test/common/constants/messageStatuses.ts rename to contracts/test/hardhat/common/constants/messageStatuses.ts diff --git a/contracts/test/common/constants/pauseTypes.ts b/contracts/test/hardhat/common/constants/pauseTypes.ts similarity index 100% rename from contracts/test/common/constants/pauseTypes.ts rename to contracts/test/hardhat/common/constants/pauseTypes.ts diff --git a/contracts/test/common/constants/roles.ts b/contracts/test/hardhat/common/constants/roles.ts similarity index 100% rename from contracts/test/common/constants/roles.ts rename to contracts/test/hardhat/common/constants/roles.ts diff --git a/contracts/test/hardhat/common/constants/submissionData.ts b/contracts/test/hardhat/common/constants/submissionData.ts new file mode 100644 index 000000000..f4949ae29 --- /dev/null +++ b/contracts/test/hardhat/common/constants/submissionData.ts @@ -0,0 +1,58 @@ +import { HASH_ZERO } from "./general"; + +import firstCompressedDataContent from "../../_testData/compressedData/blocks-1-46.json"; +import fourthCompressedDataContent from "../../_testData/compressedData/blocks-115-155.json"; +import secondCompressedDataContent from "../../_testData/compressedData/blocks-47-81.json"; +import thirdCompressedDataContent from "../../_testData/compressedData/blocks-82-114.json"; +import fourthBlobDataContent from "../../_testData/compressedDataEip4844/blocks-115-155.json"; +import thirdBlobDataContent from "../../_testData/compressedDataEip4844/blocks-82-114.json"; +import secondBlobDataContent from "../../_testData/compressedDataEip4844/blocks-47-81.json"; +import firstBlobDataContent from "../../_testData/compressedDataEip4844/blocks-1-46.json"; + +import firstCompressedDataContent_multiple from "../../_testData/compressedData/multipleProofs/blocks-1-46.json"; +import secondCompressedDataContent_multiple from "../../_testData/compressedData/multipleProofs/blocks-47-81.json"; +import thirdCompressedDataContent_multiple from "../../_testData/compressedData/multipleProofs/blocks-82-119.json"; +import fourthCompressedDataContent_multiple from "../../_testData/compressedData/multipleProofs/blocks-120-153.json"; + +import firstBlobContent_multiple from "../../_testData/compressedDataEip4844/multipleProofs/blocks-1-46.json"; +import secondBlobContent_multiple from "../../_testData/compressedDataEip4844/multipleProofs/blocks-47-81.json"; +import thirdBlobContent_multiple from "../../_testData/compressedDataEip4844/multipleProofs/blocks-82-119.json"; +import fourthBlobContent_multiple from "../../_testData/compressedDataEip4844/multipleProofs/blocks-120-153.json"; + +export const DEFAULT_SUBMISSION_DATA = { + dataParentHash: HASH_ZERO, + compressedData: "0x", + finalBlockInData: 0n, + firstBlockInData: 0n, + parentStateRootHash: HASH_ZERO, + finalStateRootHash: HASH_ZERO, + snarkHash: HASH_ZERO, +}; + +export const COMPRESSED_SUBMISSION_DATA = [ + firstCompressedDataContent, + secondCompressedDataContent, + thirdCompressedDataContent, + fourthCompressedDataContent, +]; + +export const BLOB_SUBMISSION_DATA = [ + firstBlobDataContent, + secondBlobDataContent, + thirdBlobDataContent, + fourthBlobDataContent, +]; + +export const COMPRESSED_SUBMISSION_DATA_MULTIPLE_PROOF = [ + firstCompressedDataContent_multiple, + secondCompressedDataContent_multiple, + thirdCompressedDataContent_multiple, + fourthCompressedDataContent_multiple, +]; + +export const BLOB_SUBMISSION_DATA_MULTIPLE_PROOF = [ + firstBlobContent_multiple, + secondBlobContent_multiple, + thirdBlobContent_multiple, + fourthBlobContent_multiple, +]; diff --git a/contracts/test/common/constants/time.ts b/contracts/test/hardhat/common/constants/time.ts similarity index 100% rename from contracts/test/common/constants/time.ts rename to contracts/test/hardhat/common/constants/time.ts diff --git a/contracts/test/common/deployment.ts b/contracts/test/hardhat/common/deployment.ts similarity index 100% rename from contracts/test/common/deployment.ts rename to contracts/test/hardhat/common/deployment.ts diff --git a/contracts/test/common/helpers/dataGeneration.ts b/contracts/test/hardhat/common/helpers/dataGeneration.ts similarity index 100% rename from contracts/test/common/helpers/dataGeneration.ts rename to contracts/test/hardhat/common/helpers/dataGeneration.ts diff --git a/contracts/test/common/helpers/dataLoader.ts b/contracts/test/hardhat/common/helpers/dataLoader.ts similarity index 100% rename from contracts/test/common/helpers/dataLoader.ts rename to contracts/test/hardhat/common/helpers/dataLoader.ts diff --git a/contracts/test/common/helpers/encoding.ts b/contracts/test/hardhat/common/helpers/encoding.ts similarity index 100% rename from contracts/test/common/helpers/encoding.ts rename to contracts/test/hardhat/common/helpers/encoding.ts diff --git a/contracts/test/common/helpers/expectations.ts b/contracts/test/hardhat/common/helpers/expectations.ts similarity index 100% rename from contracts/test/common/helpers/expectations.ts rename to contracts/test/hardhat/common/helpers/expectations.ts diff --git a/contracts/test/common/helpers/general.ts b/contracts/test/hardhat/common/helpers/general.ts similarity index 100% rename from contracts/test/common/helpers/general.ts rename to contracts/test/hardhat/common/helpers/general.ts diff --git a/contracts/test/common/helpers/hashing.ts b/contracts/test/hardhat/common/helpers/hashing.ts similarity index 100% rename from contracts/test/common/helpers/hashing.ts rename to contracts/test/hardhat/common/helpers/hashing.ts diff --git a/contracts/test/common/helpers/index.ts b/contracts/test/hardhat/common/helpers/index.ts similarity index 100% rename from contracts/test/common/helpers/index.ts rename to contracts/test/hardhat/common/helpers/index.ts diff --git a/contracts/test/common/helpers/messaging.ts b/contracts/test/hardhat/common/helpers/messaging.ts similarity index 100% rename from contracts/test/common/helpers/messaging.ts rename to contracts/test/hardhat/common/helpers/messaging.ts diff --git a/contracts/test/common/types.ts b/contracts/test/hardhat/common/types.ts similarity index 100% rename from contracts/test/common/types.ts rename to contracts/test/hardhat/common/types.ts diff --git a/contracts/test/messageService/lib/Timelock.ts b/contracts/test/hardhat/governance/Timelock.ts similarity index 94% rename from contracts/test/messageService/lib/Timelock.ts rename to contracts/test/hardhat/governance/Timelock.ts index 52f459daf..0a9d0dafe 100644 --- a/contracts/test/messageService/lib/Timelock.ts +++ b/contracts/test/hardhat/governance/Timelock.ts @@ -3,8 +3,8 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; import { TimeLock } from "../../../typechain-types"; -import { CANCELLER_ROLE, EXECUTOR_ROLE, PROPOSER_ROLE, TIMELOCK_ADMIN_ROLE } from "../../common/constants"; -import { deployFromFactory } from "../../common/deployment"; +import { CANCELLER_ROLE, EXECUTOR_ROLE, PROPOSER_ROLE, TIMELOCK_ADMIN_ROLE } from "../common/constants"; +import { deployFromFactory } from "../common/deployment"; describe("Timelock", () => { let contract: TimeLock; diff --git a/contracts/test/lib/Utils.ts b/contracts/test/hardhat/libraries/EfficientLeftRightKeccak.ts similarity index 62% rename from contracts/test/lib/Utils.ts rename to contracts/test/hardhat/libraries/EfficientLeftRightKeccak.ts index 4acd6e878..5b9fe4a47 100644 --- a/contracts/test/lib/Utils.ts +++ b/contracts/test/hardhat/libraries/EfficientLeftRightKeccak.ts @@ -1,17 +1,17 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; -import { TestUtils } from "../../typechain-types"; +import { TestEfficientLeftRightKeccak } from "../../../typechain-types"; import { deployFromFactory } from "../common/deployment"; import { generateKeccak256, generateRandomBytes } from "../common/helpers"; -describe("Utils Library", () => { - let contract: TestUtils; +describe("EfficientLeftRightKeccak Library", () => { + let contract: TestEfficientLeftRightKeccak; - async function deployTestUtilsFixture() { - return deployFromFactory("TestUtils"); + async function deployTestEfficientLeftRightKeccakFixture() { + return deployFromFactory("TestEfficientLeftRightKeccak"); } beforeEach(async () => { - contract = (await loadFixture(deployTestUtilsFixture)) as TestUtils; + contract = (await loadFixture(deployTestEfficientLeftRightKeccakFixture)) as TestEfficientLeftRightKeccak; }); describe("efficientKeccak", () => { diff --git a/contracts/test/lib/mimc.ts b/contracts/test/hardhat/libraries/Mimc.ts similarity index 92% rename from contracts/test/lib/mimc.ts rename to contracts/test/hardhat/libraries/Mimc.ts index e97ddf9fc..ea6c31314 100644 --- a/contracts/test/lib/mimc.ts +++ b/contracts/test/hardhat/libraries/Mimc.ts @@ -1,8 +1,8 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { Mimc } from "../../typechain-types"; -import mimcTestData from "../testData/mimc-test-data.json"; +import { Mimc } from "../../../typechain-types"; +import mimcTestData from "../_testData/mimc-test-data.json"; import { deployFromFactory } from "../common/deployment"; import { expectRevertWithCustomError } from "../common/helpers"; diff --git a/contracts/test/lib/SparseMerkleProof.ts b/contracts/test/hardhat/libraries/SparseMerkleProof.ts similarity index 98% rename from contracts/test/lib/SparseMerkleProof.ts rename to contracts/test/hardhat/libraries/SparseMerkleProof.ts index 3a47f45ea..30f1a10de 100644 --- a/contracts/test/lib/SparseMerkleProof.ts +++ b/contracts/test/hardhat/libraries/SparseMerkleProof.ts @@ -1,8 +1,8 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { Mimc, SparseMerkleProof } from "../../typechain-types"; -import merkleProofTestData from "../testData/merkle-proof-data.json"; +import { Mimc, SparseMerkleProof } from "../../../typechain-types"; +import merkleProofTestData from "../_testData/merkle-proof-data.json"; import { deployFromFactory } from "../common/deployment"; import { expectRevertWithCustomError } from "../common/helpers"; diff --git a/contracts/test/messageService/MessageServiceBase.ts b/contracts/test/hardhat/messaging/MessageServiceBase.ts similarity index 99% rename from contracts/test/messageService/MessageServiceBase.ts rename to contracts/test/hardhat/messaging/MessageServiceBase.ts index 281450076..7bd301b7b 100644 --- a/contracts/test/messageService/MessageServiceBase.ts +++ b/contracts/test/hardhat/messaging/MessageServiceBase.ts @@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { TestL2MessageService, TestMessageServiceBase } from "../../typechain-types"; +import { TestL2MessageService, TestMessageServiceBase } from "../../../typechain-types"; import { INITIALIZED_ERROR_MESSAGE, INITIAL_WITHDRAW_LIMIT, diff --git a/contracts/test/messageService/l1/L1MessageManager.ts b/contracts/test/hardhat/messaging/l1/L1MessageManager.ts similarity index 98% rename from contracts/test/messageService/l1/L1MessageManager.ts rename to contracts/test/hardhat/messaging/l1/L1MessageManager.ts index b5a0b0e65..30d638b2f 100644 --- a/contracts/test/messageService/l1/L1MessageManager.ts +++ b/contracts/test/hardhat/messaging/l1/L1MessageManager.ts @@ -1,6 +1,6 @@ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; -import { TestL1MessageManager } from "../../../typechain-types"; +import { TestL1MessageManager } from "../../../../typechain-types"; import { INBOX_STATUS_UNKNOWN } from "../../common/constants"; import { deployFromFactory } from "../../common/deployment"; import { diff --git a/contracts/test/messageService/l2/L2MessageManager.ts b/contracts/test/hardhat/messaging/l2/L2MessageManager.ts similarity index 99% rename from contracts/test/messageService/l2/L2MessageManager.ts rename to contracts/test/hardhat/messaging/l2/L2MessageManager.ts index 51f75a147..36bb60a49 100644 --- a/contracts/test/messageService/l2/L2MessageManager.ts +++ b/contracts/test/hardhat/messaging/l2/L2MessageManager.ts @@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { TestL2MessageManager } from "../../../typechain-types"; +import { TestL2MessageManager } from "../../../../typechain-types"; import { DEFAULT_ADMIN_ROLE, GENERAL_PAUSE_TYPE, diff --git a/contracts/test/messageService/l2/L2MessageService.ts b/contracts/test/hardhat/messaging/l2/L2MessageService.ts similarity index 99% rename from contracts/test/messageService/l2/L2MessageService.ts rename to contracts/test/hardhat/messaging/l2/L2MessageService.ts index 18aeaba0a..19cff34c5 100644 --- a/contracts/test/messageService/l2/L2MessageService.ts +++ b/contracts/test/hardhat/messaging/l2/L2MessageService.ts @@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers, upgrades } from "hardhat"; -import { TestL2MessageService, TestReceivingContract } from "../../../typechain-types"; +import { TestL2MessageService, TestReceivingContract } from "../../../../typechain-types"; import { ADDRESS_ZERO, BLOCK_COINBASE, @@ -41,7 +41,7 @@ import { generateKeccak256Hash, } from "../../common/helpers"; import { ZeroAddress } from "ethers"; -import { generateRoleAssignments } from "../../../common/helpers"; +import { generateRoleAssignments } from "../../../../common/helpers"; import { L2_MESSAGE_SERVICE_PAUSE_TYPES_ROLES, L2_MESSAGE_SERVICE_ROLES, @@ -50,7 +50,7 @@ import { PAUSE_L2_L1_ROLE, UNPAUSE_L1_L2_ROLE, UNPAUSE_L2_L1_ROLE, -} from "../../../common/constants"; +} from "../../../../common/constants"; describe("L2MessageService", () => { let l2MessageService: TestL2MessageService; @@ -1431,7 +1431,7 @@ describe("L2MessageService", () => { async function deployL2MessageServiceFixture() { return deployUpgradableFromFactory( - "contracts/test-contracts/L2MessageServiceLineaMainnet.sol:L2MessageServiceLineaMainnet", + "src/_testing/integration/L2MessageServiceLineaMainnet.sol:L2MessageServiceLineaMainnet", [securityCouncil.address, l1l2MessageSetter.address, ONE_DAY_IN_SECONDS, INITIAL_WITHDRAW_LIMIT], ) as unknown as Promise; } @@ -1460,7 +1460,7 @@ describe("L2MessageService", () => { // Deploy new implementation const newL2MessageServiceFactory = await ethers.getContractFactory( - "contracts/messageService/l2/L2MessageService.sol:L2MessageService", + "src/messaging/l2/L2MessageService.sol:L2MessageService", ); const newL2MessageService = await upgrades.upgradeProxy(l2MessageService, newL2MessageServiceFactory); @@ -1476,7 +1476,7 @@ describe("L2MessageService", () => { it("Should revert with ZeroAddressNotAllowed when addressWithRole is zero address in reinitializePauseTypesAndPermissions", async () => { // Deploy new implementation const newL2MessageServiceFactory = await ethers.getContractFactory( - "contracts/messageService/l2/L2MessageService.sol:L2MessageService", + "src/messaging/l2/L2MessageService.sol:L2MessageService", ); const newL2MessageService = await upgrades.upgradeProxy(l2MessageService, newL2MessageServiceFactory); @@ -1496,7 +1496,7 @@ describe("L2MessageService", () => { it("Should set all permissions", async () => { // Deploy new implementation const newL2MessageServiceFactory = await ethers.getContractFactory( - "contracts/messageService/l2/L2MessageService.sol:L2MessageService", + "src/messaging/l2/L2MessageService.sol:L2MessageService", ); const newL2MessageService = await upgrades.upgradeProxy(l2MessageService, newL2MessageServiceFactory); @@ -1514,7 +1514,7 @@ describe("L2MessageService", () => { it("Should set all pause types and unpause types in mappings and emit events", async () => { // Deploy new implementation const newL2MessageServiceFactory = await ethers.getContractFactory( - "contracts/messageService/l2/L2MessageService.sol:L2MessageService", + "src/messaging/l2/L2MessageService.sol:L2MessageService", ); const newL2MessageService = await upgrades.upgradeProxy(l2MessageService, newL2MessageServiceFactory); diff --git a/contracts/test/messageService/lib/SparseMerkleTreeVerifier.ts b/contracts/test/hardhat/messaging/libraries/SparseMerkleTreeVerifier.ts similarity index 98% rename from contracts/test/messageService/lib/SparseMerkleTreeVerifier.ts rename to contracts/test/hardhat/messaging/libraries/SparseMerkleTreeVerifier.ts index cf5426bc8..302a06e28 100644 --- a/contracts/test/messageService/lib/SparseMerkleTreeVerifier.ts +++ b/contracts/test/hardhat/messaging/libraries/SparseMerkleTreeVerifier.ts @@ -2,10 +2,10 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { TestSparseMerkleTreeVerifier } from "../../../typechain-types"; +import { TestSparseMerkleTreeVerifier } from "../../../../typechain-types"; import { MAX_UINT32, MAX_UINT33, MESSAGE_FEE, MESSAGE_VALUE_1ETH } from "../../common/constants"; import { deployFromFactory } from "../../common/deployment"; -import { expectRevertWithCustomError, generateRandomBytes, range } from "contracts/test/common/helpers"; +import { expectRevertWithCustomError, generateRandomBytes, range } from "../../common/helpers"; describe("SparseMerkleTreeVerifier", () => { let sparseMerkleTreeVerifier: TestSparseMerkleTreeVerifier; diff --git a/contracts/test/tools/RecoverFunds.ts b/contracts/test/hardhat/recovery/RecoverFunds.ts similarity index 98% rename from contracts/test/tools/RecoverFunds.ts rename to contracts/test/hardhat/recovery/RecoverFunds.ts index 267909865..30a67118d 100644 --- a/contracts/test/tools/RecoverFunds.ts +++ b/contracts/test/hardhat/recovery/RecoverFunds.ts @@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { RecoverFunds, TestExternalCalls } from "../../typechain-types"; +import { RecoverFunds, TestExternalCalls } from "../../../typechain-types"; import { ADDRESS_ZERO, DEFAULT_ADMIN_ROLE, diff --git a/contracts/test/LineaRollup.ts b/contracts/test/hardhat/rollup/LineaRollup.ts similarity index 98% rename from contracts/test/LineaRollup.ts rename to contracts/test/hardhat/rollup/LineaRollup.ts index 327ddae60..6f60c1e88 100644 --- a/contracts/test/LineaRollup.ts +++ b/contracts/test/hardhat/rollup/LineaRollup.ts @@ -4,14 +4,14 @@ import { expect } from "chai"; import { config, ethers, upgrades } from "hardhat"; import { HardhatNetworkHDAccountsConfig } from "hardhat/types"; import { BaseContract, Contract, HDNodeWallet, Transaction, Wallet, ZeroAddress } from "ethers"; -import { CallForwardingProxy, TestLineaRollup, TestLineaRollupV5 } from "../typechain-types"; -import calldataAggregatedProof1To155 from "./testData/compressedData/aggregatedProof-1-155.json"; -import blobAggregatedProof1To155 from "./testData/compressedDataEip4844/aggregatedProof-1-155.json"; -import blobMultipleAggregatedProof1To81 from "./testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json"; -import firstCompressedDataContent from "./testData/compressedData/blocks-1-46.json"; -import secondCompressedDataContent from "./testData/compressedData/blocks-47-81.json"; -import fourthCompressedDataContent from "./testData/compressedData/blocks-115-155.json"; -import fourthMultipleCompressedDataContent from "./testData/compressedData/multipleProofs/blocks-120-153.json"; +import { CallForwardingProxy, TestLineaRollup, TestLineaRollupV5 } from "../../../typechain-types"; +import calldataAggregatedProof1To155 from "../_testData/compressedData/aggregatedProof-1-155.json"; +import blobAggregatedProof1To155 from "../_testData/compressedDataEip4844/aggregatedProof-1-155.json"; +import blobMultipleAggregatedProof1To81 from "../_testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json"; +import firstCompressedDataContent from "../_testData/compressedData/blocks-1-46.json"; +import secondCompressedDataContent from "../_testData/compressedData/blocks-47-81.json"; +import fourthCompressedDataContent from "../_testData/compressedData/blocks-115-155.json"; +import fourthMultipleCompressedDataContent from "../_testData/compressedData/multipleProofs/blocks-120-153.json"; import { ADDRESS_ZERO, GENERAL_PAUSE_TYPE, @@ -45,8 +45,8 @@ import { UNPAUSE_L1_L2_ROLE, UNPAUSE_L2_L1_ROLE, LINEA_ROLLUP_INITIALIZE_SIGNATURE, -} from "./common/constants"; -import { deployUpgradableFromFactory } from "./common/deployment"; +} from "../common/constants"; +import { deployUpgradableFromFactory } from "../common/deployment"; import { calculateRollingHash, encodeData, @@ -68,10 +68,10 @@ import { calculateLastFinalizedState, expectEvents, expectEventDirectFromReceiptData, -} from "./common/helpers"; -import { CalldataSubmissionData, ShnarfDataGenerator } from "./common/types"; -import aggregatedProof1To81 from "./testData/compressedData/multipleProofs/aggregatedProof-1-81.json"; -import aggregatedProof82To153 from "./testData/compressedData/multipleProofs/aggregatedProof-82-153.json"; +} from "../common/helpers"; +import { CalldataSubmissionData, ShnarfDataGenerator } from "../common/types"; +import aggregatedProof1To81 from "../_testData/compressedData/multipleProofs/aggregatedProof-1-81.json"; +import aggregatedProof82To153 from "../_testData/compressedData/multipleProofs/aggregatedProof-82-153.json"; import * as kzg from "c-kzg"; import { LINEA_ROLLUP_PAUSE_TYPES_ROLES, @@ -80,7 +80,7 @@ import { } from "contracts/common/constants"; import { generateRoleAssignments } from "contracts/common/helpers"; -kzg.loadTrustedSetup(`${__dirname}/testData/trusted_setup.txt`); +kzg.loadTrustedSetup(`${__dirname}/../_testData/trusted_setup.txt`); describe("Linea Rollup contract", () => { let lineaRollup: TestLineaRollup; @@ -196,7 +196,7 @@ describe("Linea Rollup contract", () => { defaultAdmin: securityCouncil.address, }; - const deployCall = deployUpgradableFromFactory("contracts/LineaRollup.sol:LineaRollup", [initializationData], { + const deployCall = deployUpgradableFromFactory("src/rollup/LineaRollup.sol:LineaRollup", [initializationData], { initializer: LINEA_ROLLUP_INITIALIZE_SIGNATURE, unsafeAllow: ["constructor"], }); @@ -309,7 +309,7 @@ describe("Linea Rollup contract", () => { }; const lineaRollup = await deployUpgradableFromFactory( - "contracts/LineaRollup.sol:LineaRollup", + "src/rollup/LineaRollup.sol:LineaRollup", [initializationData], { initializer: LINEA_ROLLUP_INITIALIZE_SIGNATURE, @@ -336,7 +336,7 @@ describe("Linea Rollup contract", () => { }; const lineaRollup = await deployUpgradableFromFactory( - "contracts/LineaRollup.sol:LineaRollup", + "src/rollup/LineaRollup.sol:LineaRollup", [initializationData], { initializer: LINEA_ROLLUP_INITIALIZE_SIGNATURE, @@ -1852,7 +1852,6 @@ describe("Linea Rollup contract", () => { maxFeePerGas: maxFeePerGas!, to: lineaRollupAddress, chainId: 31337, - nonce: 4, value: 0, gasLimit: 5_000_000, }; @@ -1891,7 +1890,6 @@ describe("Linea Rollup contract", () => { maxFeePerGas: maxFeePerGas!, to: lineaRollupAddress, chainId: 31337, - nonce: 4, value: 0, gasLimit: 5_000_000, }; @@ -2428,7 +2426,7 @@ describe("Linea Rollup contract", () => { verifier = await plonkVerifier.getAddress(); const lineaRollup = (await deployUpgradableFromFactory( - "contracts/test-contracts/TestLineaRollupV5.sol:TestLineaRollupV5", + "src/_testing/unit/rollup/TestLineaRollupV5.sol:TestLineaRollupV5", [ parentStateRootHash, 0, @@ -2486,7 +2484,7 @@ describe("Linea Rollup contract", () => { // Deploy new implementation const newLineaRollupFactory = await ethers.getContractFactory( - "contracts/test-contracts/TestLineaRollup.sol:TestLineaRollup", + "src/_testing/unit/rollup/TestLineaRollup.sol:TestLineaRollup", ); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, @@ -2526,7 +2524,7 @@ describe("Linea Rollup contract", () => { // Deploy new LineaRollup implementation const newLineaRollupFactory = await ethers.getContractFactory( - "contracts/test-contracts/TestLineaRollup.sol:TestLineaRollup", + "src/_testing/unit/rollup/TestLineaRollup.sol:TestLineaRollup", ); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, @@ -2573,7 +2571,7 @@ describe("Linea Rollup contract", () => { expect(await lineaRollupV5.currentL2BlockNumber()).to.equal(0); // Deploy new implementation - const newLineaRollupFactory = await ethers.getContractFactory("contracts/LineaRollup.sol:LineaRollup"); + const newLineaRollupFactory = await ethers.getContractFactory("src/rollup/LineaRollup.sol:LineaRollup"); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, }); @@ -2599,7 +2597,7 @@ describe("Linea Rollup contract", () => { expect(await lineaRollupV5.currentL2BlockNumber()).to.equal(0); // Deploy new implementation - const newLineaRollupFactory = await ethers.getContractFactory("contracts/LineaRollup.sol:LineaRollup"); + const newLineaRollupFactory = await ethers.getContractFactory("src/rollup/LineaRollup.sol:LineaRollup"); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, }); @@ -2621,7 +2619,7 @@ describe("Linea Rollup contract", () => { expect(await lineaRollupV5.currentL2BlockNumber()).to.equal(0); // Deploy new implementation - const newLineaRollupFactory = await ethers.getContractFactory("contracts/LineaRollup.sol:LineaRollup"); + const newLineaRollupFactory = await ethers.getContractFactory("src/rollup/LineaRollup.sol:LineaRollup"); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, }); @@ -2645,7 +2643,7 @@ describe("Linea Rollup contract", () => { it("Should revert with ZeroAddressNotAllowed when addressWithRole is zero address in reinitializeLineaRollupV6", async () => { // Deploy new implementation - const newLineaRollupFactory = await ethers.getContractFactory("contracts/LineaRollup.sol:LineaRollup"); + const newLineaRollupFactory = await ethers.getContractFactory("src/rollup/LineaRollup.sol:LineaRollup"); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, }); @@ -2666,7 +2664,7 @@ describe("Linea Rollup contract", () => { it("Should set all permissions", async () => { // Deploy new implementation - const newLineaRollupFactory = await ethers.getContractFactory("contracts/LineaRollup.sol:LineaRollup"); + const newLineaRollupFactory = await ethers.getContractFactory("src/rollup/LineaRollup.sol:LineaRollup"); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, }); @@ -2686,7 +2684,7 @@ describe("Linea Rollup contract", () => { it("Should set all pause types and unpause types in mappings and emit events", async () => { // Deploy new implementation - const newLineaRollupFactory = await ethers.getContractFactory("contracts/LineaRollup.sol:LineaRollup"); + const newLineaRollupFactory = await ethers.getContractFactory("src/rollup/LineaRollup.sol:LineaRollup"); const newLineaRollup = await upgrades.upgradeProxy(lineaRollupV5, newLineaRollupFactory, { unsafeAllowRenames: true, }); diff --git a/contracts/test/lib/PauseManager.ts b/contracts/test/hardhat/security/PauseManager.ts similarity index 86% rename from contracts/test/lib/PauseManager.ts rename to contracts/test/hardhat/security/PauseManager.ts index d2cb3614e..c7ea888e9 100644 --- a/contracts/test/lib/PauseManager.ts +++ b/contracts/test/hardhat/security/PauseManager.ts @@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { TestPauseManager } from "../../typechain-types"; +import { TestPauseManager } from "../../../typechain-types"; import { DEFAULT_ADMIN_ROLE, GENERAL_PAUSE_TYPE, @@ -27,7 +27,12 @@ import { UNUSED_PAUSE_TYPE, } from "../common/constants"; import { deployUpgradableFromFactory } from "../common/deployment"; -import { buildAccessErrorMessage, expectEvent, expectRevertWithCustomError, expectRevertWithReason } from "../common/helpers"; +import { + buildAccessErrorMessage, + expectEvent, + expectRevertWithCustomError, + expectRevertWithReason, +} from "../common/helpers"; async function deployTestPauseManagerFixture(): Promise { return deployUpgradableFromFactory("TestPauseManager", [ @@ -103,33 +108,58 @@ describe("PauseManager", () => { }); it("should fail updateUnpauseTypeRole if roles are not different", async () => { - const updateCall = pauseManager.connect(pauseManagerAccount).updatePauseTypeRole(GENERAL_PAUSE_TYPE, PAUSE_ALL_ROLE); + const updateCall = pauseManager + .connect(pauseManagerAccount) + .updatePauseTypeRole(GENERAL_PAUSE_TYPE, PAUSE_ALL_ROLE); await expectRevertWithCustomError(pauseManager, updateCall, "RolesNotDifferent"); }); it("should fail updateUnpauseTypeRole if roles are not different", async () => { - const updateCall = pauseManager.connect(pauseManagerAccount).updateUnpauseTypeRole(GENERAL_PAUSE_TYPE, UNPAUSE_ALL_ROLE); + const updateCall = pauseManager + .connect(pauseManagerAccount) + .updateUnpauseTypeRole(GENERAL_PAUSE_TYPE, UNPAUSE_ALL_ROLE); await expectRevertWithCustomError(pauseManager, updateCall, "RolesNotDifferent"); }); it("should update pause type role with pausing working", async () => { - const updateCall = pauseManager.connect(pauseManagerAccount).updatePauseTypeRole(GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE); - await expectEvent(pauseManager, updateCall, "PauseTypeRoleUpdated", [GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE, PAUSE_ALL_ROLE]) + const updateCall = pauseManager + .connect(pauseManagerAccount) + .updatePauseTypeRole(GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE); + await expectEvent(pauseManager, updateCall, "PauseTypeRoleUpdated", [ + GENERAL_PAUSE_TYPE, + DEFAULT_ADMIN_ROLE, + PAUSE_ALL_ROLE, + ]); await pauseManager.connect(defaultAdmin).pauseByType(GENERAL_PAUSE_TYPE); expect(await pauseManager.isPaused(GENERAL_PAUSE_TYPE)).to.be.true; }); it("should fail to pause with old role", async () => { - const updateCall = pauseManager.connect(pauseManagerAccount).updatePauseTypeRole(GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE); - await expectEvent(pauseManager, updateCall, "PauseTypeRoleUpdated", [GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE, PAUSE_ALL_ROLE]) + const updateCall = pauseManager + .connect(pauseManagerAccount) + .updatePauseTypeRole(GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE); + await expectEvent(pauseManager, updateCall, "PauseTypeRoleUpdated", [ + GENERAL_PAUSE_TYPE, + DEFAULT_ADMIN_ROLE, + PAUSE_ALL_ROLE, + ]); - await expectRevertWithReason(pauseManager.connect(pauseManagerAccount).pauseByType(GENERAL_PAUSE_TYPE), buildAccessErrorMessage(pauseManagerAccount, DEFAULT_ADMIN_ROLE)); + await expectRevertWithReason( + pauseManager.connect(pauseManagerAccount).pauseByType(GENERAL_PAUSE_TYPE), + buildAccessErrorMessage(pauseManagerAccount, DEFAULT_ADMIN_ROLE), + ); }); it("should update unpause type role with unpausing working", async () => { - const updateCall = pauseManager.connect(pauseManagerAccount).updateUnpauseTypeRole(GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE); - await expectEvent(pauseManager, updateCall, "UnPauseTypeRoleUpdated", [GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE, UNPAUSE_ALL_ROLE]) + const updateCall = pauseManager + .connect(pauseManagerAccount) + .updateUnpauseTypeRole(GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE); + await expectEvent(pauseManager, updateCall, "UnPauseTypeRoleUpdated", [ + GENERAL_PAUSE_TYPE, + DEFAULT_ADMIN_ROLE, + UNPAUSE_ALL_ROLE, + ]); // pause with non-modified pausing account await pauseManager.connect(pauseManagerAccount).pauseByType(GENERAL_PAUSE_TYPE); @@ -140,14 +170,23 @@ describe("PauseManager", () => { }); it("should fail to unpause with old role", async () => { - const updateCall = pauseManager.connect(pauseManagerAccount).updateUnpauseTypeRole(GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE); - await expectEvent(pauseManager, updateCall, "UnPauseTypeRoleUpdated", [GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE, UNPAUSE_ALL_ROLE]) + const updateCall = pauseManager + .connect(pauseManagerAccount) + .updateUnpauseTypeRole(GENERAL_PAUSE_TYPE, DEFAULT_ADMIN_ROLE); + await expectEvent(pauseManager, updateCall, "UnPauseTypeRoleUpdated", [ + GENERAL_PAUSE_TYPE, + DEFAULT_ADMIN_ROLE, + UNPAUSE_ALL_ROLE, + ]); // pause with non-modified pausing account await pauseManager.connect(pauseManagerAccount).pauseByType(GENERAL_PAUSE_TYPE); expect(await pauseManager.isPaused(GENERAL_PAUSE_TYPE)).to.be.true; - await expectRevertWithReason(pauseManager.connect(pauseManagerAccount).unPauseByType(GENERAL_PAUSE_TYPE), buildAccessErrorMessage(pauseManagerAccount, DEFAULT_ADMIN_ROLE)); + await expectRevertWithReason( + pauseManager.connect(pauseManagerAccount).unPauseByType(GENERAL_PAUSE_TYPE), + buildAccessErrorMessage(pauseManagerAccount, DEFAULT_ADMIN_ROLE), + ); }); }); @@ -204,11 +243,19 @@ describe("PauseManager", () => { describe("Specific type pausing", () => { describe("Unused pause type", () => { it("should revert when pausing with the unused pause type", async () => { - await expectRevertWithCustomError(pauseManager, pauseManager.pauseByType(UNUSED_PAUSE_TYPE), "PauseTypeNotUsed"); + await expectRevertWithCustomError( + pauseManager, + pauseManager.pauseByType(UNUSED_PAUSE_TYPE), + "PauseTypeNotUsed", + ); }); it("should revert when unpausing with the unused pause type", async () => { - await expectRevertWithCustomError(pauseManager, pauseManager.unPauseByType(UNUSED_PAUSE_TYPE), "PauseTypeNotUsed"); + await expectRevertWithCustomError( + pauseManager, + pauseManager.unPauseByType(UNUSED_PAUSE_TYPE), + "PauseTypeNotUsed", + ); }); }); diff --git a/contracts/test/messageService/lib/RateLimiter.ts b/contracts/test/hardhat/security/RateLimiter.ts similarity index 98% rename from contracts/test/messageService/lib/RateLimiter.ts rename to contracts/test/hardhat/security/RateLimiter.ts index c142030fa..2f3d96a01 100644 --- a/contracts/test/messageService/lib/RateLimiter.ts +++ b/contracts/test/hardhat/security/RateLimiter.ts @@ -9,14 +9,14 @@ import { ONE_DAY_IN_SECONDS, RATE_LIMIT_SETTER_ROLE, USED_RATE_LIMIT_RESETTER_ROLE, -} from "../../common/constants"; -import { deployUpgradableFromFactory } from "../../common/deployment"; +} from "../common/constants"; +import { deployUpgradableFromFactory } from "../common/deployment"; import { buildAccessErrorMessage, expectEvent, expectRevertWithCustomError, expectRevertWithReason, -} from "../../common/helpers"; +} from "../common/helpers"; describe("Rate limiter", () => { let testRateLimiter: TestRateLimiter; diff --git a/contracts/test/token/LineaSurgeXP.ts b/contracts/test/hardhat/tokens/LineaSurgeXP.ts similarity index 99% rename from contracts/test/token/LineaSurgeXP.ts rename to contracts/test/hardhat/tokens/LineaSurgeXP.ts index c642520d4..5adefbb4a 100644 --- a/contracts/test/token/LineaSurgeXP.ts +++ b/contracts/test/hardhat/tokens/LineaSurgeXP.ts @@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { LineaSurgeXP, TestLineaSurgeXP } from "../../typechain-types"; +import { LineaSurgeXP, TestLineaSurgeXP } from "../../../typechain-types"; import { ADDRESS_ZERO, DEFAULT_ADMIN_ROLE, MINTER_ROLE, TRANSFER_ROLE } from "../common/constants"; import { deployFromFactory } from "../common/deployment"; diff --git a/contracts/test/token/LineaVoyageXP.ts b/contracts/test/hardhat/tokens/LineaVoyageXP.ts similarity index 99% rename from contracts/test/token/LineaVoyageXP.ts rename to contracts/test/hardhat/tokens/LineaVoyageXP.ts index 4130f7be6..00cad3df9 100644 --- a/contracts/test/token/LineaVoyageXP.ts +++ b/contracts/test/hardhat/tokens/LineaVoyageXP.ts @@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; import { expect } from "chai"; import { ethers } from "hardhat"; -import { LineaVoyageXP } from "../../typechain-types"; +import { LineaVoyageXP } from "../../../typechain-types"; import { DEFAULT_ADMIN_ROLE, MINTER_ROLE } from "../common/constants"; import { deployFromFactory } from "../common/deployment"; import { buildAccessErrorMessage, expectRevertWithCustomError, expectRevertWithReason } from "../common/helpers"; diff --git a/contracts/test/token/TokenMintingRateLimiter.ts b/contracts/test/hardhat/tokens/TokenMintingRateLimiter.ts similarity index 98% rename from contracts/test/token/TokenMintingRateLimiter.ts rename to contracts/test/hardhat/tokens/TokenMintingRateLimiter.ts index 94c574b68..834c6074b 100644 --- a/contracts/test/token/TokenMintingRateLimiter.ts +++ b/contracts/test/hardhat/tokens/TokenMintingRateLimiter.ts @@ -10,9 +10,8 @@ import { RATE_LIMIT_SETTER_ROLE, } from "../common/constants"; import { deployFromFactory } from "../common/deployment"; -import { TokenMintingRateLimiter } from "../../typechain-types/contracts/token/TokenMintingRateLimiter"; -import { LineaVoyageXP } from "../../typechain-types"; import { buildAccessErrorMessage, expectRevertWithCustomError, expectRevertWithReason } from "../common/helpers"; +import { LineaVoyageXP, TokenMintingRateLimiter } from "../../../typechain-types"; describe("Token Minting Rate Limiter", () => { let tokenMintingRateLimiter: TokenMintingRateLimiter; diff --git a/contracts/test/testData/compressedData/aggregatedProof-1-155.json b/contracts/test/testData/compressedData/aggregatedProof-1-155.json deleted file mode 100644 index 7b39731f1..000000000 --- a/contracts/test/testData/compressedData/aggregatedProof-1-155.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "finalShnarf": "0xdf1e9f621e3a89f02d44dbc266056d50d5d1524dc4d135f93b81619f3d674b7c", - "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", - "aggregatedProof": "0x2e6431c2cbb8021cc213885d08b39ccb38215789c2fdced773bd4d46d41a6b8217d476fbffa85477a18981fe0ec8c776171a656b8a12a746a3319e2b54c87a400f102032e51da42427391a70286fbc85fd0dd0a49c5ae890e485ff64c0b8ab9d14ec859fdf2eaeff4997e0eb0f429bda9cdf4afef98021dab7853ede9bf3983d28d3b6b08cc253e8ac6dfd36da607ac729f97bfe52da6722c9b9b994db805934143c5c006b101df5174557240204dec4a34cacf76108e7899304c565ac4d6a18086d779a0f60c70925556824c13ac6c269eefc7aa1c1c71b9d534c5e3da6663b04d66f0539ba5396c86e1a823874b7930cd5e5e724456401bc4ec78fef893f7603312b8200ff4885183eb18caa39f3cc5addf3fa269ac3779d2e3147ef8c2e3b2e8a57e79f5817343b1a003c3aff6a8c1472b43c7bb4294ef21e8c6b32e374f901f8067adb88e2fa5acfab716e76c16c25ab3b65cbfcb45b20c376de1b52849316fdca7b5b33aa27b93047fabd81c90de25f77af21746e9323857db6c2228bf12e642cdee60640d21c1fa93085a188757e4d1af7979797c8009d2e94ae08201712498ebb4ba0dd28ce715c09af2849d9b5f3b52f366be9f677291a7adc16e13127a5d239e8a0f92ee532763c46ea4736067653048c57e2b195a73abbdbdf487f2c5fd68152c9df7e5f1bfe20c650b3db1c2c0a595df56221295092bc5847326c1779d7179390ee89f6167e3ab5af2e7183fab9e9e7790c78f0068ee2c958b20f05a975167f7e6b69c1a780b05e9b0dd82ed462bde24a9e0aee2efcbc6c28f4bb199070367e57150fcb771669cf4ba8bc68085ab13e92f1866fba6c3bea5b2e2201a4de8bece0731c62ee90a9d701ac99645f15ead828cb880f8b35f6036e463e12cc0a7c346ba3b8803e53d119d8543569d743723d88e99a4154871153d37399173bd6539f441ca603501f8f402e7b5836c7960550e137dbef5bc7c8c20d7da823aa871781f2f61565ef75bbcb703f3d7dff21322921d93e5c7a071778576aa3180c347201bfcac60ffe35ee3b5054ddf149af7a841a05fcdc7b554cbea8d6362635ba41d6b779fc01e850b450f576a34c528e850868d43764dd71755d4fe770010928c3f6c62450523d5bdfbdda93586d6dfc3ec9e685e2d247502d3836fc7910db1865595094ec3c49a5ab8f84b9c432bc1d6191354dfed12feb07415fc3fa", - "aggregatedProverVersion": "test", - "aggregatedVerifierIndex": 1, - "aggregatedProofPublicInput": "0x233fd3d94f86264d6b666cdcb455c1cb144d3dc399edc9d17bd50aa42ae789a2", - "dataHashes": [ - "0x7126453ddb4c09537a505a70bae0dd57a3f5daba4522fa1f79b760fb28efb35c", - "0x82694a9670032c50548d42dbf6f0d9d09febc4f2454796997ec9a4edc7f87106", - "0x08a70f876b12e010a0c34fe2bb03389fbeaf1749e9528359b7196df67a8c76fc", - "0x93eb7218f429a6efeb1ce6931a3915e0a032131ca9ff6ccc5c8428178221aa4c" - ], - "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", - "parentAggregationLastBlockTimestamp": 1683325137, - "lastFinalizedBlockNumber": 0, - "finalTimestamp": 1683335137, - "finalBlockNumber": 155, - "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", - "l1RollingHashMessageNumber": 1, - "l2MerkleRoots": [ - "0x8c11bf3dd28eeb8e951be357df5c22d4de2500ac61ecb04da92971c71b55585c" - ], - "l2MerkleTreesDepth": 5, - "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" -} \ No newline at end of file diff --git a/contracts/test/testData/compressedData/multipleProofs/aggregatedProof-1-81.json b/contracts/test/testData/compressedData/multipleProofs/aggregatedProof-1-81.json deleted file mode 100644 index 289db3244..000000000 --- a/contracts/test/testData/compressedData/multipleProofs/aggregatedProof-1-81.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "finalShnarf": "0x6d2b3535e06f4778e03c8439145dd9b8e4ae312953b9ccc154ef73b8a00c26c1", - "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", - "aggregatedProof": "0x008e483358dc0ac1d3f6a27b43f6332e88c4196151b2a1ce6c8575013cec2cbe2f666e5649165dfc5a88ede985203341f5910ec2f4e3d4e9fa2a0a2621e4b0a70a91e0f995a8d754a3ddec1698800be83da8815650488540d2ffb699eaf3518d14bff479974f1f5f8bef7687f89c6301247cd92a4ccfa76a868bd24090a670f20eb06513431e74411648ab8c02a270353146bc759451d00cf2a59477d6106b9d11df3e18bca0d3a36951e31699b21a73e22a77fb7fe43a33b717a23dd06a889a102e4143d1e024e053e4318f903c3dbd0ec0f6e49672dd0ccb10749ac00adaf311149a24bf2c2ee4cfe7ed1db713526c6f7c0893f2ec153e5f55a4b390ce135a0d3ebe372c1beea8142afebdc96fe2764b8b5a33efc0457b9ad65f678c8b9ede196eb1fe34a82e0f370fe1d53e5cfc34bc77f38a64eddbb74f6530a82feb0e0a148de4d309b179697ff8a3c97a5516a1bbffc36d8cf153e9f5ee8fdc98002fd1136a2a12603aa1c7a985b34c5dc6774a5efd6270eac180406b4f03c7ef08eee428bb45d04a3c6635a0225aae76c0522049df5080045629cd6a686c2d50d8b7fe10e6facded652c8d75d4a67d5f8f4c3c6b491f44cc23c307064ec94f7c3a44eb1d1dcd369464960e54a88ad3f9edbdd818f2ac711d6c8f49efe224fb2616f2ac0005ca0c753c801d9e2df1133cdd4de5e54554197ac3e2f42d0b140261a12796050d64ec14bb22355173d157a7a2a9a5c0a20d47430819b4c106fda54923f9bf273cbc4145962e07b853279e64e198d3da5919814935c4cf12ffc03128d0e4fc24e8f35180d257253c0ce33725cb665a81141f16418fb20cf2abb96fa65a03bc0fa8e1e842123e2a2590f423e34c1db2c51c9e872ea41942d44d94d735cf8b4b0ccc265c6bdc41dd6f1167da133450a5ea0c07ea4704c9ca377cd201d8a63f932f7d4c9edb88269008bfe08d91d576cbf1a46c2da88b13d2a38e68f66f330552114f37a226c38ed3a9acd35b75f5852e6879eb3c8746ed2676f9e3957d32bbee1493ac055f03a56e964c4ea278d323abde55b36439b5460897771bf5ef3be1992448a5479f3515d5605d403a51391c6c6db94a90b3353aa956a5ba6f7b951fee2b7657ab431f90220c84820c2db8e4b57eaa5c3ea13e8d1f4ed31b9434c5df5c083dbb24fdf9dc5a64ba7416e6d154e6b17727a3acaa9f59820e926196efd232", - "aggregatedProverVersion": "test", - "aggregatedVerifierIndex": 1, - "aggregatedProofPublicInput": "0x216ea864c4d4392d0315997af776dbc1856686e376a07c85ed67f8509c14328e", - "dataHashes": [ - "0x7126453ddb4c09537a505a70bae0dd57a3f5daba4522fa1f79b760fb28efb35c", - "0x82694a9670032c50548d42dbf6f0d9d09febc4f2454796997ec9a4edc7f87106" - ], - "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", - "parentAggregationLastBlockTimestamp": 1683325137, - "lastFinalizedBlockNumber": 0, - "finalTimestamp": 1683335137, - "finalBlockNumber": 81, - "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", - "l1RollingHashMessageNumber": 1, - "l2MerkleRoots": [ - "0x6de197db892fd7d3fe0a389452dae0c5d0520e23d18ad20327546e2189a7e3f1" - ], - "l2MerkleTreesDepth": 5, - "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" -} \ No newline at end of file diff --git a/contracts/test/testData/compressedData/multipleProofs/aggregatedProof-82-153.json b/contracts/test/testData/compressedData/multipleProofs/aggregatedProof-82-153.json deleted file mode 100644 index c2c7f80b2..000000000 --- a/contracts/test/testData/compressedData/multipleProofs/aggregatedProof-82-153.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "finalShnarf": "0x4b7f110cbe7fcab315cd99683b2c7864bff2615903a3230d5bf2222b7a71a756", - "parentAggregationFinalShnarf": "0x6d2b3535e06f4778e03c8439145dd9b8e4ae312953b9ccc154ef73b8a00c26c1", - "aggregatedProof": "0x2ccd7bc052a4a3347fd0fc9134d62c37208cbf5af79ceda0a62bde3861db8329195f5d25f8fee76a7d37c45055766e059dd3750dec0b903783b5928b8a5e8c830a5336cd5876cb7c1a4cb5cf329f1f6c932a38121778a56a2a80d41cf75da03013a32e6ef9159e335e8943fd9daba6d58f48a68f47dd24585cf59e50ce79cf300d84d08f9db0c62db91f0b00f410acd88e1f6217ae3565db6535a086b781038d15bdb30229a0e1a191d5ea26f38cc27bec2ac3b9ddc00ca88ce0b27a745a7b271eb64a673306440b812ac79c53c345adb2c4a7d6d983dab3e8b00e83fc36e0ba3018527b30a861d10944d6d05b295a3dcfe956da4a6b42610ec703ffe74248fb0154a0dfc7bdc8dedcfc4e6bc884a10ba3aa3073efcacd66cf7d59e38a74aa1000a36354762974e610be1ee6988f91f58ea4fa7f3335736a8af7075ffb10ea2a0bede1074f138237a509373679a8d781308401b1ac283772ce163ad1efc5af2216899a8499375154809be8367318d7916933a34f02cf76d20d7715a289c174580229d78df12a39593212751e2e70f26909f7fafc6d63bc877d28278049406f3104b870a14218cf11b2422bb46dafb11aa4fecac8d7bd8570eb72b955688bbfc80cb0fb367fddb4826b6ff2285ddf6d147f38ba068e3d35cf0568a8141e3871b61eeabdbab18df69f0e8087484c2fa7eb15241b8d0e40d2883daf1addff7691e3241ad52968445fb97749bbe4ab7ab2e31717ed545c9d078a57eab2de9cd9db982377d1ba338e35fe231a05a1b81b4c9d4d1332c97cdfc1d0b6e3c6f190c932f201e8814a714bff8c37e80b1aac4ae26c8fe4fa68ca041713aacd705b3306926617503f4eca6c1893e6f5ced6ece0614e66624b9b817c664bc26e3bda711501980cf48324ee61112ac8105e1d645dd72ea6f99312a9f99f37e156b54f4d07f65c2d2dea5a66368fe0d42efbeb6983c81622c5e25eae779dd9ae3be074ca9772be1e65c0906da0e0f408b3daee7d505b99cfabaa3427a9a1abbfe78d273275fe2606f9e57936aad44f500f8ade2e3c0c350dcfbbeba3218205ee74818376bc87f70d0bb1ba55e09ba360aa28037bd8d99ba3ff700045c525b6c8a08acddbaf75d12e3a7863068be75c7e889962d10b6e0d40e0ae9c8334be7597e45936a12249ea0578371f6f0bc77cffeb47527760fcd3ead96ec5349779e8142b8cf6a9304eba", - "aggregatedProverVersion": "test", - "aggregatedVerifierIndex": 1, - "aggregatedProofPublicInput": "0x0ecda6d6b122aa50210c937e14351066a6e98db71c066ace19abb75a3abdfda8", - "dataHashes": [ - "0xd1ef92f67e60ec41ee3b2f448024802d1608c138d4770ab1d3ada17facd6f0cc", - "0xa54a0666ba33710a751591da5edb268dc309934de83a5efa03eefc6e2e384737" - ], - "dataParentHash": "0x82694a9670032c50548d42dbf6f0d9d09febc4f2454796997ec9a4edc7f87106", - "parentStateRootHash": "0xf0f26782f7afb93f926cacb145f55530714f20b1356725e3971dc99e0ef8b591", - "parentAggregationLastBlockTimestamp": 1683335137, - "lastFinalizedBlockNumber": 81, - "finalTimestamp": 1683355137, - "finalBlockNumber": 153, - "l1RollingHash": "0xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", - "l1RollingHashMessageNumber": 14, - "l2MerkleRoots": [ - "0xf82d0ea8590489e98ca4279f30bd4b32a4fd62e6574ddc4f606d6496096b3721" - ], - "l2MerkleTreesDepth": 5, - "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" -} \ No newline at end of file diff --git a/contracts/test/testData/compressedData/test/aggregatedProof-1-46.json b/contracts/test/testData/compressedData/test/aggregatedProof-1-46.json deleted file mode 100644 index 8d8e761ab..000000000 --- a/contracts/test/testData/compressedData/test/aggregatedProof-1-46.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "finalShnarf": "0x9562fa89830a0ba0063a636ca96e52ce2f032b855336c95dd788321f4e193419", - "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", - "aggregatedProof": "0x2b8a08e4b319c731ae97081a486f1194d72740fa1bc4a4bdcd310ddf50a75c2f02e6ae770debd31337489d9655d16ab026af7219695762a2475a4875263aa2c120fc987bcfb7e9fdeac64a1db6bc5c9d4d7731a583d84a5d8db3e69132b5583116bb7a6ac8f081a1c33fecf42b51b7f8f827066b79e19d45d587d368ebfee5421e6a8a0d63a2fe696e647088d81c1b6c96190432f42bf5f7cdedddc3fd0698581dc557b353523782c2f137f71cd76f790f4b8be7c5d3f200befaaca4cf95366328cc64b4c98566701bde2e5710cc84dbbaa50e2d1f29147bcbc506924adfd30e016218b1f40bcc6a0bac3faa9023f6855e217a5d98ac9fc7f14005adfc18d52c1368b188aaacf77ec4bbf81a6ebc567330eb405db0effdc9447f744d0595732b19322fcdba4be23e05844ecbda382ba93730fc21d9d12200f0bc625a2f5350840348893f7a0600fdd932e86a2b6c28500fb40eb578563061ce1a27bb401eb7f128233c28ecf4e3e35ed53657aaf820a4cfe9a4057c496e95fc23031c2717bf761fb7a6e471e57990f36187c93c8159929a0141ed568eb05b68dad58fc826c3f90364821de7e0cefeff209bcd7f5250efed7cb3d6ad435fc774161cfb6787916a0f669b7c1668e79d160c0e680d674279217c40b662ee91b5165f94d6939e2a5a05ab12b274c697e35d60943be8aa53ff762c1d52d3390a80f76664737de582e72430b98e07146717df294d8eb5ca704444917c6c9c3f819b929af0e44e34e9dd23c7fd04a541107fb3c74bd1fb583aaf401b6fde6a48e4d8fcb0347d04d73a280c7c5f2807c540474634d323d23d8fde9173b98008d03273a55a1d023093c4730a6ce93a60ee79aa6942c159a3ddf086311e51eafbc90fb81b919a0d588c8c6529f0df37ab008b965e10f1c6560063f0b07bc2299d519bfed68b7c45953726e90997da2b84436f4906546770fe651041208734586c090efa87488dd09ccec05b12f68cfa5f2984f4970801179d5335b2f28dc9303375811736d12041580abc0b10d35acfe032f08ead34481e70668c0efed88d5461529d24352fd6f6071e363703661d460e7edec53cc933b778ddabfab152a4d7aa736b3a361534aece194b15258a67556f07fe55fe84206331187ed3bc909775fb5b4174f16475fdba91a1e9037b49216246e4658fcf5a0b026a70a6316fa0c93f196c6b4cd4eea3904067d3", - "aggregatedProverVersion": "test", - "aggregatedVerifierIndex": 1, - "aggregatedProofPublicInput": "0x1e77e4d1bba517cf992e7788a104fc5612e539ea2b459b532d69efe6c416235a", - "dataHashes": [ - "0x7126453ddb4c09537a505a70bae0dd57a3f5daba4522fa1f79b760fb28efb35c" - ], - "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", - "parentAggregationLastBlockTimestamp": 1683325137, - "lastFinalizedBlockNumber": 0, - "finalTimestamp": 1683335137, - "finalBlockNumber": 46, - "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", - "l1RollingHashMessageNumber": 1, - "l2MerkleRoots": [ - "0x97cd1539d08f7c0ba06ad836b2690eef50afd86609a0672517ec0ef8c1f94796" - ], - "l2MerkleTreesDepth": 5, - "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" -} \ No newline at end of file diff --git a/contracts/test/testData/compressedDataEip4844/aggregatedProof-1-155.json b/contracts/test/testData/compressedDataEip4844/aggregatedProof-1-155.json deleted file mode 100644 index 59db1f159..000000000 --- a/contracts/test/testData/compressedDataEip4844/aggregatedProof-1-155.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "finalShnarf": "0x602c8eeedd7f6dbb7bc0348da1b0dced846acf09586c9f27aa06b494a1c49249", - "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", - "aggregatedProof": "0x1ef8ad12dc4e4b2e4e8979994ab16e0e907e3d594600fe66dff8cc3c25be910508ed51fed1de1cbc4d07869125eb137ede8f908cba8a1a97e26fb666a8ac1db02480bb12080c5ff9900b12963e3dd8a7d5719b3339326232465b232a4ba53c740860893232dc4545ad6b03bb56229a56dcc186710cf398525c18caa05f915459128d2f40878e15c9911904e3c3248d259993386f56c9929d81a3f4cf4b3305931e01e03e83334d62d8581fd5b510a37403e6f53d7b6ec7299ff1bba9f2b110812de395d4b19022f90760db5046e7305620dc64f52c4096d46729b01a397bb7b72cd3d6c66c24a5eef10d3ce870f0486d83c8ec0a9817ce0af0a1b9aa9c5792230469e2cf6d693e10d8a17d60985c9e3782f33fecbd6ed02a251815da2f4e2fc4147df40a7d4e2ceea00758ccd3df17cc20585327a9820d0108dd574f1fcf896c170deac4012eb89e3540a39f3a2b73bb449e9a46bfb9c991819cdf2905398ae00e6958a50ea58f137ec3c99d1a8877e3507920f55c317d6a5fc6718ea3bc255300f1d6325be2b5a5399562a4ffbd5059a483dfc807125d7cd75dd6d668b052cf2dbe0cd5dc3a93b6d9800bde7ba796a080a5281e7b42c38963e7a1e6647ec1eb219587e94ce96c3c258828fadaa0b76bc13f9194e120c3fa8f56847b136fcdd712851a384d0d3b5975152df354ec74847395dd3f6dd4c853f258d7a855fdb12c120c46b74b715273386a5ed3c44407797fbd09f0985c177137957a1342f38e9b090be0e96f7397b6eb380544923497f8dab1c0ef4fc1553bdbcc0fcdbcda8e8604ac0162ee8c60145e4b2fa05b4d3a0e748b6e4128a29842cbffd2992f6520a0163cac4f3fe3af4f901841db9b0a22f5882d3736a498aea2c787269fbc4589c42d71fd3a43dd1b31e8f2be1af62d75172daf970241448b44a91015a7ae4e18250cf54afc8cf67756f524a1bc245c72e2dc48cece0a18f810242f37ea2d9d26460f42e555df9e183031499fd813e666939759661eb772e077150bdfc4e5d1565a2e1e957b787fdda6b1defede8aa1405a9e376212f1be6a685f2bca487440d6f20141d2969b8a40a4144675c0eea6e13512d9c85bea1d6da212f50c5ee5b4e97e29f5131c114e0a3ef0e5702c56f61c0c6fee904aa873fd7d34301d909e9dfbe306ee6a593c2e33a691b3cc62b548c35fedf1761d856e54cf9483cc32b9849ecd", - "aggregatedProverVersion": "test", - "aggregatedVerifierIndex": 1, - "aggregatedProofPublicInput": "0x1538dc88156cbdf280326f52e33192924ff311be4abc0dede43a14fbfb160a55", - "dataHashes": [ - "0x01f5853fa56ab910be0933f2ee811bbc437500dba4e38acbae17eab00eec9f95", - "0x01a142b35ad91719145a4e3bf1d5402e6a73818db67312ade7a73ad5130ac618", - "0x017b1d49c6c7947f83855cc16063ef19d02369540b97867855427b56cdaea487", - "0x012cab32c78df416fe59f8f123e2ded2466a64e201bacddc8396231f335d2088" - ], - "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", - "parentAggregationLastBlockTimestamp": 1683325137, - "lastFinalizedBlockNumber": 0, - "finalTimestamp": 1683335137, - "finalBlockNumber": 155, - "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", - "l1RollingHashMessageNumber": 1, - "l2MerkleRoots": [ - "0x8c11bf3dd28eeb8e951be357df5c22d4de2500ac61ecb04da92971c71b55585c" - ], - "l2MerkleTreesDepth": 5, - "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" -} \ No newline at end of file diff --git a/contracts/test/testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json b/contracts/test/testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json deleted file mode 100644 index 600960d2b..000000000 --- a/contracts/test/testData/compressedDataEip4844/multipleProofs/aggregatedProof-1-81.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "finalShnarf": "0xfd910670a8da6aaaf2431ce7345a605dc15dc41298b9410065d2f7bb1ba99fea", - "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", - "aggregatedProof": "0x1bf64c1edf68a488be4029c17e6237e73300a294e09230f0d91265f00645526c2a1c08eaa28e37ac60621b21a3b592a7c65fd9809ef8ddec93050b384c78a03b253f40adaf8ec9ea0993ffbdb305ca570117c90f5b77b810f9f2fc46613dd7010ca7906b191f1658bcc6de9f22867053f26cc13dc34861a7a3934bcd328c97380c785972db98482eaf11c2f48acbb2e5e4291e77c81fe880a1eae39aa7e9b3640c3671c11caf5a72acefbd4455c8a329c7960149a9f87f71a9277a086820dd21074cca6872707e321a20dc2d9e4cca74e7e3be89035b131f8c8686510d369551120eab67ad7ab41337d4c497f7fa19f52ae643b5a5d5fe7bb4bd24f8721bbecc1d12fc89733af07f053d734e4224ed3e456eb4e3a77a0670521106792120c2451407b05a4a6848f0493e1d6e23042ca01eae8f8dfb8b2428482de113e6aa42901ce2a8417b812c67ece9a691e7cf663daa87f5453cd3dc2d738ec604fe6d7d5d0d71f96cb9df2cecd6b1cb0cc35bca85b464dac2c8f28580fe40399fa16488f00dfaacdf58ffc8e28d4a814a2ba70daad9f97c5d693a0e8bedbca897f3aa296907dfb6d1aa8b6803c5bf6d0feb7c2626719b752f0431961c5e16691a296da61a04d6253f5385c32144b0823c31b3fa6be1b6482b89941ceb5dc1ac128a36b7432cbd7de4f3acfb2aaf0e5621dd426882efbfb5b3552c079a0428fe0b0dd5b32e168db05568b22a25aa60b6f4601c918e76e7d508f32e88477f16dbff877acb6e13d99b4015b3b72255294f45b3b1d1ecad980ba0965e69ed99d5ae91d8284db00a387835b71a2afb1a3a9f0efec6c1e377229b1916a1a57b0f559bab41e7813113551b91607348eabfbfe6c4c465caad663e58b200cf8be71bdbb6f47571a94c2863bc18f4b1a7efa4f4be94400047414bf124d0f3a6c62bb329e28ee8c4bf2915b943a77934996c61a4bce84fd66ad709d30c6dfa32735bd502dad08cdf8ecd163615f6a5b1f1cbfe593aaed6dd393bcd9161ffdb8ee755035e033dc2b20d32043f12a37dd340e31d7caf70772766d83e643e3f28f0182180189911c2ba4c7f1184dfbc48d8a49f61b4447f07e3f3d7ebb35632c52de7c953a25d9643b560be02146a8064709ff90f5aee2e0cd9177442788f4548708817d3e6352078dd8a6f2fa628982fb431153c1a2b71f86627ab10026f46a35409bde3da57650eae74ae", - "aggregatedProverVersion": "test", - "aggregatedVerifierIndex": 1, - "aggregatedProofPublicInput": "0x02df9c4f607afe80ac52003978e4a9e197a7a0b61b6601d5e0788a6fdec1c08d", - "dataHashes": [ - "0x01f5853fa56ab910be0933f2ee811bbc437500dba4e38acbae17eab00eec9f95", - "0x01a142b35ad91719145a4e3bf1d5402e6a73818db67312ade7a73ad5130ac618" - ], - "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", - "parentAggregationLastBlockTimestamp": 1683325137, - "lastFinalizedBlockNumber": 0, - "finalTimestamp": 1683335137, - "finalBlockNumber": 81, - "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", - "l1RollingHashMessageNumber": 1, - "l2MerkleRoots": [ - "0x6de197db892fd7d3fe0a389452dae0c5d0520e23d18ad20327546e2189a7e3f1" - ], - "l2MerkleTreesDepth": 5, - "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" -} \ No newline at end of file diff --git a/contracts/test/testData/compressedDataEip4844/multipleProofs/aggregatedProof-82-153.json b/contracts/test/testData/compressedDataEip4844/multipleProofs/aggregatedProof-82-153.json deleted file mode 100644 index 63b5ef67b..000000000 --- a/contracts/test/testData/compressedDataEip4844/multipleProofs/aggregatedProof-82-153.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "finalShnarf": "0x42d7511a7a880ac5c3a61a0f480e95ec7b0e2cfff1aa106ea0256aa94bf2b865", - "parentAggregationFinalShnarf": "0xfd910670a8da6aaaf2431ce7345a605dc15dc41298b9410065d2f7bb1ba99fea", - "aggregatedProof": "0x004d079dc1a3b7ab15b4180dfb1248061c53baf123b0b01cb317dfc6a79ede6104ae63614c13729ff4e937991ca9484d493750ed188427fbf2f80666289623fc1ef6e53c9123bccb4c4a3cf72f62d1e45b01b9d90e5b860c683523c108eeaa1c0364e7a18f985c6db601f25830015918cb61d5bac4f167d9180497242cda9e7315067a4af58faffdc88c8dd1ea503fb97a37b83821bc5c2c5abf2335680468810f3d56de44a398f6b81afc44cb088cf146d03570fed3a3e2fcbdafe62a1febd2211f6c32e6ccf9aabac8dfd8a45be5826e5275ff5e1ff5ee48055fd7f0d050881db23c024fe39e1e774dc5cc697bbe8340f84a1fdbbd4ca898067b51a69f7737017f66c55bb7caef98d7074c6abe644b45ce4d6b9e409f8be2bc75c8d6aa85d110413355c49ca3dd62221d4a8f0719ec633d9a6dcdaafeb2a8ddd93443302b9914b94cce67a74fe652760599efc1791dee4d81aad1244a02dc532340f0a1b31f1be9ca611ee98ba83d730ebcc68547926ce95cf6f9cc26ef67492f97d6f98dd229b9d895c6fd268ffab58751b60a3cb48db3b76f985923fef11e1de0a635616724c69edd2854429298d41e9c46c9282dbb503e26463b19d28a1d05958247899408e549c63032890a253b4c0baa0e34d89c66333ec7dbbbb3aeee1e910fba34ec01b0e31aa1a8b825f794b7f7acb0b6cbbe881ee99aa24fa1bca50f59ab5f31e7259ff3c6b279b2bc1f86e1e5d04d67feee7a4fd338fa0c1d9e1911582347c76317696ecc2a8ae3bf70b666636eb9f1ba0a4422757104c991f6f60d3454bb5fad222e14b451d5d5a0b217582cfd72e3f60e5b748d7b3ba9038cdeffae11170c062dd588da6de561ef8173474a2ac39b73e47fec9968773dec18875754ed40e91021d40b19f9a97bb95ff5531f5addb0331b70e8550614b209a2667ada653a6a18189bff192b99c946dd54dabc4f6c836c28750770484d2dd84b28cad3b2e2dd5b2d8536e48921ad151cc05fe0b9412b95dbbe631cf7484ad7f114e2222339d4fe0555cf70048fc7e1658fbf306e8c4d58b9a8e70707588a7ac8e4b393f13dba5e25b2070532365c46ad698e16b979f96cab0026c5c47fd8cbc1b2365fa94857780c5f581a30150ee802fd84ec53cf6a74ba390746d42147eb0e7132a8a61408f9016202b8704661389696d88ff769f9eaf48e84b0e3988e541e8a9d687a0d3910", - "aggregatedProverVersion": "test", - "aggregatedVerifierIndex": 1, - "aggregatedProofPublicInput": "0x23151dfee9756b7eb4a018d5ef30730f20e05edfd3ce67a8f898c46cb2d79341", - "dataHashes": [ - "0x01bdfef0d1ddb163bf8431ea63ad7166bcd69a72a4fa30342138335d7fac96f4", - "0x0112b6fcf15707263de267fdc63c78cf9881654e88455b94fb8f9f7623223365" - ], - "dataParentHash": "0x01a142b35ad91719145a4e3bf1d5402e6a73818db67312ade7a73ad5130ac618", - "parentStateRootHash": "0xf0f26782f7afb93f926cacb145f55530714f20b1356725e3971dc99e0ef8b591", - "parentAggregationLastBlockTimestamp": 1683335137, - "lastFinalizedBlockNumber": 81, - "finalTimestamp": 1683355137, - "finalBlockNumber": 153, - "l1RollingHash": "0xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", - "l1RollingHashMessageNumber": 14, - "l2MerkleRoots": [ - "0xf82d0ea8590489e98ca4279f30bd4b32a4fd62e6574ddc4f606d6496096b3721" - ], - "l2MerkleTreesDepth": 5, - "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" -} \ No newline at end of file diff --git a/contracts/test/testData/compressedDataEip4844/test/aggregatedProof-1-46.json b/contracts/test/testData/compressedDataEip4844/test/aggregatedProof-1-46.json deleted file mode 100644 index 8b0eb4976..000000000 --- a/contracts/test/testData/compressedDataEip4844/test/aggregatedProof-1-46.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "finalShnarf": "0x4e584b910dc758442e58e56e0bb46c001addaffe770fb740ea0e1b90c0e2b056", - "parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f", - "aggregatedProof": "0x22d33dbcffa57ac78ac3b3b3a2ff52d9304eecb1073c3675fcf8225048b47aa1123499604ff2c96d334772b6d94e661c7a1fbf7e99b3b4fa1f0b8a3febca98762a5734908afa886b37351314dd68ba2f7ceaf08bef33f52d463d64a23f8523572505e5aedf7e24f132e5f21c1e0577b19081113824788bc47e3fe90d5b3da24a0f9270bd3bcac9309b715f64336c1d124a177fee676d52ef87a76bcf71d3f6a8043d5203fd92a92f2a9590e93cdf904228ebf5589c2afe45014398f5035a07c4076050fab21846b77729fdfef13d0903a4baac5a30abf986f08e11d00fa64fd420247c7ae09b7cecca8e8ca928c8ce80689a8c90d86cc3c1494d98fdf37436000c9e5d3389ac4961e8b8e9ffe1059eb34c74d61d94e23c492f24b2199f18bd180f985d8108884282fec6aeee6d59821d2186978bda855f85cd265c56903a814a2975c552578b532a84e41d71cf78cbecbef72dc374862bc692d5959b84f595612b4d55bd40e8d7261eade62c2a1bba2af2c7ba507abda5cc5f09c625ff4746d92b4588f864863a1f7806aebebc5b09bbd845d200f6a1811fb82867c8ada8656422a312841a269a6a4e628ab52eb5b0cf7329c7f876116b178ff28c4c6f0768871eea9236e28a1142df986b01fbce5c7aedd0ccd27a87a4321321c9bf1bf28f7e1365c364a0e2b4806926a18df6ca43f69b967c0473b55d74a1866bb33bc292a4006487ecb843bd209697f55dcc96ee8e15199c988f9abea42d4ddf00204627891f56f82954d1021bf869508fc3c7d0459dc9ab3bbe8b7e0a8e02675bd59a583c234417b8ac05872b5015ef665da3fca0f966d40d6988777c5def1dd834b94da10d95547edf4d56dccbbaf06f0d24ffb20799e3679a06d4748b16c5dafe7c9ba300ed0e4d01ea54fa447318721bf1e3931b9c6e059bee4bbad9976f28f531a420244395e60823940a36bd202d82578420bce7e97b2edc3021e9951c54953a4f2119d6c8912675f81fcd4a3e679f6c88e4be02cfa91f7d311e140736b8b26ceb500c7e6439c1220d645711e9017027f5a078bfffb612a9bce540229148411804d621af256389ef537ace447641bf21b5ea16d0ccf290f6979d2cdd1b26d2f8c20b047cd1d430cd6a77512006fa547193400a34561883693dda58980cbd770af4a22b132ea5302357e3ad0daf767c7b7c4106ff9e33463ccf4feff85933c87faac0", - "aggregatedProverVersion": "test", - "aggregatedVerifierIndex": 1, - "aggregatedProofPublicInput": "0x0c16c609b50fbc6f660b3fe38c5989ce059ea171048c99c0dad306cea570df61", - "dataHashes": [ - "0x01f5853fa56ab910be0933f2ee811bbc437500dba4e38acbae17eab00eec9f95" - ], - "dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd", - "parentAggregationLastBlockTimestamp": 1683325137, - "lastFinalizedBlockNumber": 0, - "finalTimestamp": 1683335137, - "finalBlockNumber": 46, - "l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697", - "l1RollingHashMessageNumber": 1, - "l2MerkleRoots": [ - "0x97cd1539d08f7c0ba06ad836b2690eef50afd86609a0672517ec0ef8c1f94796" - ], - "l2MerkleTreesDepth": 5, - "l2MessagingBlocksOffsets": "0x00000000000000000000000fffff" -} \ No newline at end of file diff --git a/prover/cmd/dev-tools/testcase-gen/compression-aggregation/autoupdate.sh b/prover/cmd/dev-tools/testcase-gen/compression-aggregation/autoupdate.sh index 94279f70f..23d31dd29 100755 --- a/prover/cmd/dev-tools/testcase-gen/compression-aggregation/autoupdate.sh +++ b/prover/cmd/dev-tools/testcase-gen/compression-aggregation/autoupdate.sh @@ -16,8 +16,8 @@ bin/compression-aggregation-sample --odir .samples-simple-eip4844/ --spec ./cmd/ bin/compression-aggregation-sample --odir .samples-multiproof-eip4844/ --spec ./cmd/dev-tools/testcase-gen/compression-aggregation/spec-comp-eip4844-1.json --spec ./cmd/dev-tools/testcase-gen/compression-aggregation/spec-comp-eip4844-1.json --spec ./cmd/dev-tools/testcase-gen/compression-aggregation/spec-agg.json bin/compression-aggregation-sample --odir .samples-multiproof-eip4844/ --spec ./cmd/dev-tools/testcase-gen/compression-aggregation/spec-comp-eip4844-2.json --spec ./cmd/dev-tools/testcase-gen/compression-aggregation/spec-comp-eip4844-2.json --spec ./cmd/dev-tools/testcase-gen/compression-aggregation/spec-agg-2.json -SOLTESTDIR=../contracts/test/testData/compressedData -SOLTESTDIR_EIP4844=../contracts/test/testData/compressedDataEip4844 +SOLTESTDIR=../contracts/test/hardhat/_testData/compressedData +SOLTESTDIR_EIP4844=../contracts/test/hardhat/_testData/compressedDataEip4844 mkdir -p ${SOLTESTDIR} ${SOLTESTDIR}/multipleProofs ${SOLTESTDIR}/test mkdir -p ${SOLTESTDIR_EIP4844} ${SOLTESTDIR_EIP4844}/multipleProofs ${SOLTESTDIR_EIP4844}/test @@ -37,17 +37,17 @@ 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.24;/pragma solidity 0.8.26;/g' ../contracts/test/testData/compressedData/Verifier1.sol +sed -i.bak 's/pragma solidity \0.8.24;/pragma solidity 0.8.26;/g' ../contracts/test/hardhat/_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 +cp ../contracts/test/hardhat/_testData/compressedData/Verifier1.sol ../contracts/src/verifiers/PlonkVerifierForDataAggregation.sol +sed -i.bak 's/contract PlonkVerifier /contract PlonkVerifierForDataAggregation /g' ../contracts/src/verifiers/PlonkVerifierForDataAggregation.sol -cp ../contracts/test/testData/compressedData/Verifier1.sol ../contracts/contracts/verifiers/test/TestPlonkVerifierForDataAggregation.sol -sed -i.bak 's/contract PlonkVerifier /contract TestPlonkVerifierForDataAggregation /g' ../contracts/contracts/verifiers/test/TestPlonkVerifierForDataAggregation.sol +cp ../contracts/test/hardhat/_testData/compressedData/Verifier1.sol ../contracts/src/_testing/unit/verifiers/TestPlonkVerifierForDataAggregation.sol +sed -i.bak 's/contract PlonkVerifier /contract TestPlonkVerifierForDataAggregation /g' ../contracts/src/_testing/unit/verifiers/TestPlonkVerifierForDataAggregation.sol -rm ../contracts/contracts/verifiers/test/TestPlonkVerifierForDataAggregation.sol.bak -rm ../contracts/contracts/verifiers/PlonkVerifierForDataAggregation.sol.bak +rm ../contracts/src/_testing/unit/verifiers/TestPlonkVerifierForDataAggregation.sol.bak +rm ../contracts/src/verifiers/PlonkVerifierForDataAggregation.sol.bak # Remove this artefact from the code. This litters the contracts tests -rm ../contracts/test/testData/**/Verifier1.* -rm ../contracts/test/testData/**/**/Verifier1.* \ No newline at end of file +rm ../contracts/test/hardhat/_testData/**/Verifier1.* +rm ../contracts/test/hardhat/_testData/**/**/Verifier1.* \ No newline at end of file