From d58f72dec3dd2e0abad1552b1723e6d5c1bb695b Mon Sep 17 00:00:00 2001 From: CHAMI Rachid Date: Fri, 11 Aug 2023 09:47:07 +0200 Subject: [PATCH 1/2] feat: Increase namespace size (#171) ## Overview Closes https://github.com/celestiaorg/quantum-gravity-bridge/issues/148 ## Checklist - [ ] New and updated code has appropriate documentation - [ ] New and updated code has new and/or updated testing - [ ] Required CI checks are passing - [ ] Visual proof for any user facing features like CLI or documentation updates - [ ] Linked issues closed with keywords --- src/lib/tree/Constants.sol | 3 +- src/lib/tree/Types.sol | 2 +- .../test/NamespaceMerkleMultiproof.t.sol | 68 +++--- .../namespace/test/NamespaceMerkleTree.t.sol | 198 +++++++++--------- src/lib/tree/namespace/test/TreeHasher.t.sol | 20 +- src/lib/verifier/test/DAVerifier.t.sol | 119 +++++------ wrappers/QuantumGravityBridge.sol/wrapper.go | 2 +- 7 files changed, 210 insertions(+), 202 deletions(-) diff --git a/src/lib/tree/Constants.sol b/src/lib/tree/Constants.sol index 83be5cdd..ab36d809 100644 --- a/src/lib/tree/Constants.sol +++ b/src/lib/tree/Constants.sol @@ -16,5 +16,6 @@ library Constants { bytes1 internal constant NODE_PREFIX = 0x01; /// @dev Parity share namespace ID - NamespaceID internal constant PARITY_SHARE_NAMESPACE_ID = NamespaceID.wrap(0xFFFFFFFFFFFFFFFF); + NamespaceID internal constant PARITY_SHARE_NAMESPACE_ID = + NamespaceID.wrap(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); } diff --git a/src/lib/tree/Types.sol b/src/lib/tree/Types.sol index 2ac2ad81..2185f71e 100644 --- a/src/lib/tree/Types.sol +++ b/src/lib/tree/Types.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.19; -type NamespaceID is bytes8; +type NamespaceID is bytes29; using {equality as ==} for NamespaceID global; using {lessthan as <} for NamespaceID global; diff --git a/src/lib/tree/namespace/test/NamespaceMerkleMultiproof.t.sol b/src/lib/tree/namespace/test/NamespaceMerkleMultiproof.t.sol index 95c20f3c..540a8c97 100644 --- a/src/lib/tree/namespace/test/NamespaceMerkleMultiproof.t.sol +++ b/src/lib/tree/namespace/test/NamespaceMerkleMultiproof.t.sol @@ -12,37 +12,37 @@ import "../NamespaceMerkleTree.sol"; * TEST VECTORS * * Data blocks: namespace id, data - * 0x0000000000000010 0x01 - * 0x0000000000000010 0x02 - * 0x0000000000000010 0x03 - * 0x0000000000000010 0x04 - * 0xffffffffffffffff 0x05 - * 0xffffffffffffffff 0x06 - * 0xffffffffffffffff 0x07 - * 0xffffffffffffffff 0x08 + * 0x0000000000000000000000000000000000000000000000000000000010 0x01 + * 0x0000000000000000000000000000000000000000000000000000000010 0x02 + * 0x0000000000000000000000000000000000000000000000000000000010 0x03 + * 0x0000000000000000000000000000000000000000000000000000000010 0x04 + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x05 + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x06 + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x07 + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x08 * * Leaf nodes: min namespace, max namespace, data - * 0x0000000000000010 0x0000000000000010 0x531d57c729081d903721f7584b2fa031c8308918779e47d9ef68991b7a30eadf - * 0x0000000000000010 0x0000000000000010 0x95fd61ffb03e598ac50a5e203026c357595efc47e45d27334269a5e1d68212ed - * 0x0000000000000010 0x0000000000000010 0xf052f0755203a9d6c1714cc99e1d4a06433bb2427ae55a2a213b9b5f9f7b36ff - * 0x0000000000000010 0x0000000000000010 0x47ea271b50de032f8b021550f19350a09dc8d0e2372d1c2d876794487517f16e - * 0xffffffffffffffff 0xffffffffffffffff 0x19628f21c9871b13b730e4f0c3f1eb0a033e5ea36e2d928e5580dce8276f3a1f - * 0xffffffffffffffff 0xffffffffffffffff 0x2041097752c4838ed7649383808636798c3bbd9dcb7c70054a833536eca57509 - * 0xffffffffffffffff 0xffffffffffffffff 0x6d9dfdf16675fe8a327bbf048a8496686ceb1444268965477c00a73720ec743a - * 0xffffffffffffffff 0xffffffffffffffff 0x22efe732017c70f7ef831b3c0b841d11fdf2230cfabf178d9560e0e4beb5adcd + * 0x0000000000000000000000000000000000000000000000000000000010 0x0000000000000000000000000000000000000000000000000000000010 0xfdb4e3c872666aa9869a1d46c8a5a0e735becdf17c62b9c3ccf4258449475bda + * 0x0000000000000000000000000000000000000000000000000000000010 0x0000000000000000000000000000000000000000000000000000000010 0x01a346b5c14a1b37e6c019eaff190f7a49718fb3036ec51360ee31de6ef58771 + * 0x0000000000000000000000000000000000000000000000000000000010 0x0000000000000000000000000000000000000000000000000000000010 0x80cb31e074d15b09950610d26b9447d82a4c9beb04499fb51be9549c1a67f09f + * 0x0000000000000000000000000000000000000000000000000000000010 0x0000000000000000000000000000000000000000000000000000000010 0xc350aeddd5ada629057034f15d4545065213a7a28f9f9b77bdc71c4225145920 + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x1617cc7010feae70f9ff07028da463c65ec19b1d6bafde31c7543718025e5efb + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x671157a4e268f7060abbdc4b48f091589555a0775a2694e6899833ec98fdb296 + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x2669e36b48e95bd9903300e50c27c53984fc439f6235fade08e3f14e78a42aac + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x655790e24d376e9556a3cba9908a5d97f27faa050806ecfcb481861a83240bd5 * * Inner nodes(depth = 2): min namespace, max namespace, data - * 0x0000000000000010 0x0000000000000010 0x0f9f4a39c2b64182463d0f3165d0ab513afcc9cbcb4ac561dffaf4c9ef54170f - * 0x0000000000000010 0x0000000000000010 0xd23ad50046b8fe83a22580c52ffe259d257863196574fd69d3e27968401eb99a - * 0xffffffffffffffff 0xffffffffffffffff 0xf11ca80de48fa801927a8061e234a29b8ab63b8239a9ea1efecf92688999602d - * 0xffffffffffffffff 0xffffffffffffffff 0xca4e971ee703d46a64ff78d8abf98618e79ce7d3c95e08f41806d3fb96c2bf0a + * 0x0000000000000000000000000000000000000000000000000000000010 0x0000000000000000000000000000000000000000000000000000000010 0x0ba8a1c0dcf8798d617eeed351a350d4d68792b6c42e9beaf54dd30136ca7e38 + * 0x0000000000000000000000000000000000000000000000000000000010 0x0000000000000000000000000000000000000000000000000000000010 0x6d43651bd68866cb3fc8d00512fa2ab570da16c2c5254a6a7671c0400b96441a + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x055a3ea75c438d752aeabbba94ed8fac93e0b32321256a65fde176dba14f5186 + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x1b79ffd74644e8c287fe5f1dd70bc8ea02738697cebf2810ffb2dc5157485c40 * * Inner nodes(depth = 1): min namespace, max namespace, data - * 0x0000000000000010 0x0000000000000010 0x31cb53b761143d0a1b6b7f096b64c6c0543266fda00654070a2d485d0a66b281 - * 0xffffffffffffffff 0xffffffffffffffff 0xb3da10c55a205c40528dd8a65e5be607e8a08d5a02198fdd6407419ae3c373c9 + * 0x0000000000000000000000000000000000000000000000000000000010 0x0000000000000000000000000000000000000000000000000000000010 0x23fcbabf97fa3bbef73038559ca480d0de5237762e42cac08090c48713eef910 + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x5aa3e7ea31995fdd38f41015275229b290a8ee4810521db766ad457b9a8373d6 * * Root node: min namespace, max namespace, data - * 0x0000000000000010 0x0000000000000010 0x02f1d195cf45f96f9bf0875cb3a8aedff5df35605fb3f50ce52a272c30822466 + * 0x0000000000000000000000000000000000000000000000000000000010 0x0000000000000000000000000000000000000000000000000000000010 0x5b3328b03a538d627db78668034089cb395f63d05b24fdf99558d36fe991d268 * */ @@ -57,27 +57,27 @@ contract NamespaceMerkleMultiproofTest is DSTest { /// @notice Verify inclusion of leaves 0 and 1. function testVerifyMulti01() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000010); + NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010); NamespaceNode memory root = NamespaceNode( - NamespaceID.wrap(0x0000000000000010), - NamespaceID.wrap(0x0000000000000010), - 0x02f1d195cf45f96f9bf0875cb3a8aedff5df35605fb3f50ce52a272c30822466 + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + 0x5b3328b03a538d627db78668034089cb395f63d05b24fdf99558d36fe991d268 ); NamespaceNode[] memory sideNodes = new NamespaceNode[](3); sideNodes[0] = NamespaceNode( - NamespaceID.wrap(0x0000000000000010), - NamespaceID.wrap(0x0000000000000010), - 0x531d57c729081d903721f7584b2fa031c8308918779e47d9ef68991b7a30eadf + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + 0xfdb4e3c872666aa9869a1d46c8a5a0e735becdf17c62b9c3ccf4258449475bda ); sideNodes[1] = NamespaceNode( - NamespaceID.wrap(0x0000000000000010), - NamespaceID.wrap(0x0000000000000010), - 0x47ea271b50de032f8b021550f19350a09dc8d0e2372d1c2d876794487517f16e + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + 0xc350aeddd5ada629057034f15d4545065213a7a28f9f9b77bdc71c4225145920 ); sideNodes[2] = NamespaceNode( Constants.PARITY_SHARE_NAMESPACE_ID, Constants.PARITY_SHARE_NAMESPACE_ID, - 0xb3da10c55a205c40528dd8a65e5be607e8a08d5a02198fdd6407419ae3c373c9 + 0x5aa3e7ea31995fdd38f41015275229b290a8ee4810521db766ad457b9a8373d6 ); uint256 beginKey = 1; diff --git a/src/lib/tree/namespace/test/NamespaceMerkleTree.t.sol b/src/lib/tree/namespace/test/NamespaceMerkleTree.t.sol index fb1d35cc..efc46341 100644 --- a/src/lib/tree/namespace/test/NamespaceMerkleTree.t.sol +++ b/src/lib/tree/namespace/test/NamespaceMerkleTree.t.sol @@ -11,37 +11,37 @@ import "../NamespaceMerkleTree.sol"; * TEST VECTORS * * Data blocks: namespace id, data - * 0x0000000000000010 0x01 - * 0x0000000000000020 0x02 - * 0x0000000000000030 0x03 - * 0x0000000000000040 0x04 - * 0xffffffffffffffff 0x05 - * 0xffffffffffffffff 0x06 - * 0xffffffffffffffff 0x07 - * 0xffffffffffffffff 0x08 + * 0x0000000000000000000000000000000000000000000000000000000010 0x01 + * 0x0000000000000000000000000000000000000000000000000000000020 0x02 + * 0x0000000000000000000000000000000000000000000000000000000030 0x03 + * 0x0000000000000000000000000000000000000000000000000000000040 0x04 + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x05 + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x06 + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x07 + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x08 * * Leaf nodes: min namespace, max namespace, data - * 0x0000000000000010 0x0000000000000010 0x531d57c729081d903721f7584b2fa031c8308918779e47d9ef68991b7a30eadf - * 0x0000000000000020 0x0000000000000020 0xd3e46dc7795fef402ede7504a037e43af169f19b76cbdb2c7abb12252b6b2ecc - * 0x0000000000000030 0x0000000000000030 0x78c554db7e421f683df27a171146ca2aa4659e1ec01e6c61fc7291b28f8da6dd - * 0x0000000000000040 0x0000000000000040 0xa8bcefebd33001489fc678d3891c6fe71ce7ec0b5cbd2fc37fb5178c41a23ac3 - * 0xffffffffffffffff 0xffffffffffffffff 0x19628f21c9871b13b730e4f0c3f1eb0a033e5ea36e2d928e5580dce8276f3a1f - * 0xffffffffffffffff 0xffffffffffffffff 0x2041097752c4838ed7649383808636798c3bbd9dcb7c70054a833536eca57509 - * 0xffffffffffffffff 0xffffffffffffffff 0x6d9dfdf16675fe8a327bbf048a8496686ceb1444268965477c00a73720ec743a - * 0xffffffffffffffff 0xffffffffffffffff 0x22efe732017c70f7ef831b3c0b841d11fdf2230cfabf178d9560e0e4beb5adcd + * 0x0000000000000000000000000000000000000000000000000000000010 0x0000000000000000000000000000000000000000000000000000000010 0xfdb4e3c872666aa9869a1d46c8a5a0e735becdf17c62b9c3ccf4258449475bda + * 0x0000000000000000000000000000000000000000000000000000000020 0x0000000000000000000000000000000000000000000000000000000020 0xc5fd5617b70207108c8d9bcf624b1eedf39b763af86f660255947674e043cd2c + * 0x0000000000000000000000000000000000000000000000000000000030 0x0000000000000000000000000000000000000000000000000000000030 0x35e864d3e196ef0986fcf18eea2782c7e68794c7106dacc2a4f7e40d6d7c7069 + * 0x0000000000000000000000000000000000000000000000000000000040 0x0000000000000000000000000000000000000000000000000000000040 0xecdeb08b04dd92a17fec560e20c53269f65beff5a2626fa64f61bfa45b09119d + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x1617cc7010feae70f9ff07028da463c65ec19b1d6bafde31c7543718025e5efb + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x671157a4e268f7060abbdc4b48f091589555a0775a2694e6899833ec98fdb296 + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x2669e36b48e95bd9903300e50c27c53984fc439f6235fade08e3f14e78a42aac + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x655790e24d376e9556a3cba9908a5d97f27faa050806ecfcb481861a83240bd5 * * Inner nodes(depth = 2): min namespace, max namespace, data - * 0x0000000000000010 0x0000000000000020 0x8985f8bdc931cbae27e6ce4851ffe91f30f3c5c54c785aa9beac6e1b8494e63c - * 0x0000000000000030 0x0000000000000040 0xbbd409114c569aa80cbc35146b183ac85f6e218f6345d59b7f6822ae440a7f9c - * 0xffffffffffffffff 0xffffffffffffffff 0xf11ca80de48fa801927a8061e234a29b8ab63b8239a9ea1efecf92688999602d - * 0xffffffffffffffff 0xffffffffffffffff 0xca4e971ee703d46a64ff78d8abf98618e79ce7d3c95e08f41806d3fb96c2bf0a + * 0x0000000000000000000000000000000000000000000000000000000010 0x0000000000000000000000000000000000000000000000000000000020 0x1dae5c3d39a8bf31ea33ba368238a52f816cd50485c580565609554cf360c91f + * 0x0000000000000000000000000000000000000000000000000000000030 0x0000000000000000000000000000000000000000000000000000000040 0x2aa20c7587b009772a9a88402b7cc8fcb82edc9e31754e95544a670a696f55a7 + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x055a3ea75c438d752aeabbba94ed8fac93e0b32321256a65fde176dba14f5186 + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x1b79ffd74644e8c287fe5f1dd70bc8ea02738697cebf2810ffb2dc5157485c40 * * Inner nodes(depth = 1): min namespace, max namespace, data - * 0x0000000000000010 0x0000000000000040 0x31cb53b761143d0a1b6b7f096b64c6c0543266fda00654070a2d485d0a66b281 - * 0xffffffffffffffff 0xffffffffffffffff 0xb3da10c55a205c40528dd8a65e5be607e8a08d5a02198fdd6407419ae3c373c9 + * 0x0000000000000000000000000000000000000000000000000000000010 0x0000000000000000000000000000000000000000000000000000000040 0xa8dcd9f365fb64aa6d72b5027fe74db0fc7d009c2d75c7b9b9656927281cb35e + * 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x5aa3e7ea31995fdd38f41015275229b290a8ee4810521db766ad457b9a8373d6 * * Root node: min namespace, max namespace, data - * 0x0000000000000010 0x0000000000000040 0x135fc2adb4f8569783f67b463d2245d95ea98046523a02ce015edaa292a92085 + * 0x0000000000000000000000000000000000000000000000000000000010 0x0000000000000000000000000000000000000000000000000000000040 0x34e6541306dc4e57a5a2a9ef57a46d5705ed09efb8c6a02580d3a972922b6862 * */ @@ -55,7 +55,7 @@ contract NamespaceMerkleTreeTest is DSTest { } function testVerifyNone() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000); + NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000000); NamespaceNode memory root = NamespaceNode(nid, nid, sha256("")); NamespaceNode[] memory sideNodes; uint256 key = 0; @@ -67,9 +67,9 @@ contract NamespaceMerkleTreeTest is DSTest { } function testVerifyOneLeafEmpty() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000); + NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000000); NamespaceNode memory root = - NamespaceNode(nid, nid, 0x3e7077fd2f66d689e0cee6a7cf5b37bf2dca7c979af356d0a31cbc5c85605c7d); + NamespaceNode(nid, nid, 0x0679246d6c4216de0daa08e5523fb2674db2b6599c3b72ff946b488a15290b62); NamespaceNode[] memory sideNodes; uint256 key = 0; uint256 numLeaves = 1; @@ -80,9 +80,9 @@ contract NamespaceMerkleTreeTest is DSTest { } function testVerifyOneLeafSome() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000); + NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000000); NamespaceNode memory root = - NamespaceNode(nid, nid, 0xaa96931c3a623dc18aa70c476c74ef95fc8a828c5c0d664f5f64963a2f02be13); + NamespaceNode(nid, nid, 0x56d8381cfe28e8eb21da620145b7b977a74837720da5147b00bfab6f1b4af24d); NamespaceNode[] memory sideNodes; uint256 key = 0; uint256 numLeaves = 1; @@ -93,9 +93,9 @@ contract NamespaceMerkleTreeTest is DSTest { } function testVerifyOneLeaf01() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000); + NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000000); NamespaceNode memory root = - NamespaceNode(nid, nid, 0x52807a4607ea5debf0b7d4ccb452f4af03e16b06a8e0aa0dfe177db1ff02123d); + NamespaceNode(nid, nid, 0x353857cdb4c745eb9fdebbd8ec44093fabb9f08d437e2298d9e6afa1a409b30c); NamespaceNode[] memory sideNodes; uint256 key = 0; uint256 numLeaves = 1; @@ -107,103 +107,109 @@ contract NamespaceMerkleTreeTest is DSTest { function testVerifyLeafOneOfTwo() external { NamespaceNode memory root = NamespaceNode( - NamespaceID.wrap(0x0000000000000010), - NamespaceID.wrap(0x0000000000000020), - 0x8985f8bdc931cbae27e6ce4851ffe91f30f3c5c54c785aa9beac6e1b8494e63c + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020), + 0x1dae5c3d39a8bf31ea33ba368238a52f816cd50485c580565609554cf360c91f ); NamespaceNode[] memory sideNodes = new NamespaceNode[](1); sideNodes[0] = NamespaceNode( - NamespaceID.wrap(0x0000000000000020), - NamespaceID.wrap(0x0000000000000020), - 0xd3e46dc7795fef402ede7504a037e43af169f19b76cbdb2c7abb12252b6b2ecc + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020), + 0xc5fd5617b70207108c8d9bcf624b1eedf39b763af86f660255947674e043cd2c ); uint256 key = 0; uint256 numLeaves = 2; NamespaceMerkleProof memory proof = NamespaceMerkleProof(sideNodes, key, numLeaves); bytes memory data = hex"01"; - bool isValid = NamespaceMerkleTree.verify(root, proof, NamespaceID.wrap(0x0000000000000010), data); + bool isValid = NamespaceMerkleTree.verify( + root, proof, NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), data + ); assertTrue(isValid); } function testVerifyLeafOneOfFour() external { NamespaceNode memory root = NamespaceNode( - NamespaceID.wrap(0x0000000000000010), - NamespaceID.wrap(0x0000000000000040), - 0x31cb53b761143d0a1b6b7f096b64c6c0543266fda00654070a2d485d0a66b281 + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + 0xa8dcd9f365fb64aa6d72b5027fe74db0fc7d009c2d75c7b9b9656927281cb35e ); NamespaceNode[] memory sideNodes = new NamespaceNode[](2); sideNodes[0] = NamespaceNode( - NamespaceID.wrap(0x0000000000000020), - NamespaceID.wrap(0x0000000000000020), - 0xd3e46dc7795fef402ede7504a037e43af169f19b76cbdb2c7abb12252b6b2ecc + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020), + 0xc5fd5617b70207108c8d9bcf624b1eedf39b763af86f660255947674e043cd2c ); sideNodes[1] = NamespaceNode( - NamespaceID.wrap(0x0000000000000030), - NamespaceID.wrap(0x0000000000000040), - 0xbbd409114c569aa80cbc35146b183ac85f6e218f6345d59b7f6822ae440a7f9c + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000030), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + 0x2aa20c7587b009772a9a88402b7cc8fcb82edc9e31754e95544a670a696f55a7 ); uint256 key = 0; uint256 numLeaves = 4; NamespaceMerkleProof memory proof = NamespaceMerkleProof(sideNodes, key, numLeaves); bytes memory data = hex"01"; - bool isValid = NamespaceMerkleTree.verify(root, proof, NamespaceID.wrap(0x0000000000000010), data); + bool isValid = NamespaceMerkleTree.verify( + root, proof, NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), data + ); assertTrue(isValid); } function testVerifyLeafOneOfEight() external { NamespaceNode memory root = NamespaceNode( - NamespaceID.wrap(0x0000000000000010), - NamespaceID.wrap(0x0000000000000040), - 0x135fc2adb4f8569783f67b463d2245d95ea98046523a02ce015edaa292a92085 + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + 0x34e6541306dc4e57a5a2a9ef57a46d5705ed09efb8c6a02580d3a972922b6862 ); NamespaceNode[] memory sideNodes = new NamespaceNode[](3); sideNodes[0] = NamespaceNode( - NamespaceID.wrap(0x0000000000000020), - NamespaceID.wrap(0x0000000000000020), - 0xd3e46dc7795fef402ede7504a037e43af169f19b76cbdb2c7abb12252b6b2ecc + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020), + 0xc5fd5617b70207108c8d9bcf624b1eedf39b763af86f660255947674e043cd2c ); sideNodes[1] = NamespaceNode( - NamespaceID.wrap(0x0000000000000030), - NamespaceID.wrap(0x0000000000000040), - 0xbbd409114c569aa80cbc35146b183ac85f6e218f6345d59b7f6822ae440a7f9c + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000030), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + 0x2aa20c7587b009772a9a88402b7cc8fcb82edc9e31754e95544a670a696f55a7 ); sideNodes[2] = NamespaceNode( Constants.PARITY_SHARE_NAMESPACE_ID, Constants.PARITY_SHARE_NAMESPACE_ID, - 0xb3da10c55a205c40528dd8a65e5be607e8a08d5a02198fdd6407419ae3c373c9 + 0x5aa3e7ea31995fdd38f41015275229b290a8ee4810521db766ad457b9a8373d6 ); uint256 key = 0; uint256 numLeaves = 8; NamespaceMerkleProof memory proof = NamespaceMerkleProof(sideNodes, key, numLeaves); bytes memory data = hex"01"; - bool isValid = NamespaceMerkleTree.verify(root, proof, NamespaceID.wrap(0x0000000000000010), data); + bool isValid = NamespaceMerkleTree.verify( + root, proof, NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), data + ); assertTrue(isValid); } function testVerifyLeafSevenOfEight() external { NamespaceNode memory root = NamespaceNode( - NamespaceID.wrap(0x0000000000000010), - NamespaceID.wrap(0x0000000000000040), - 0x135fc2adb4f8569783f67b463d2245d95ea98046523a02ce015edaa292a92085 + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + 0x34e6541306dc4e57a5a2a9ef57a46d5705ed09efb8c6a02580d3a972922b6862 ); NamespaceNode[] memory sideNodes = new NamespaceNode[](3); sideNodes[0] = NamespaceNode( Constants.PARITY_SHARE_NAMESPACE_ID, Constants.PARITY_SHARE_NAMESPACE_ID, - 0x22efe732017c70f7ef831b3c0b841d11fdf2230cfabf178d9560e0e4beb5adcd + 0x655790e24d376e9556a3cba9908a5d97f27faa050806ecfcb481861a83240bd5 ); sideNodes[1] = NamespaceNode( Constants.PARITY_SHARE_NAMESPACE_ID, Constants.PARITY_SHARE_NAMESPACE_ID, - 0xf11ca80de48fa801927a8061e234a29b8ab63b8239a9ea1efecf92688999602d + 0x055a3ea75c438d752aeabbba94ed8fac93e0b32321256a65fde176dba14f5186 ); sideNodes[2] = NamespaceNode( - NamespaceID.wrap(0x0000000000000010), - NamespaceID.wrap(0x0000000000000040), - 0x31cb53b761143d0a1b6b7f096b64c6c0543266fda00654070a2d485d0a66b281 + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + 0xa8dcd9f365fb64aa6d72b5027fe74db0fc7d009c2d75c7b9b9656927281cb35e ); uint256 key = 6; @@ -216,25 +222,25 @@ contract NamespaceMerkleTreeTest is DSTest { function testVerifyLeafEightOfEight() external { NamespaceNode memory root = NamespaceNode( - NamespaceID.wrap(0x0000000000000010), - NamespaceID.wrap(0x0000000000000040), - 0x135fc2adb4f8569783f67b463d2245d95ea98046523a02ce015edaa292a92085 + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + 0x34e6541306dc4e57a5a2a9ef57a46d5705ed09efb8c6a02580d3a972922b6862 ); NamespaceNode[] memory sideNodes = new NamespaceNode[](3); sideNodes[0] = NamespaceNode( Constants.PARITY_SHARE_NAMESPACE_ID, Constants.PARITY_SHARE_NAMESPACE_ID, - 0x6d9dfdf16675fe8a327bbf048a8496686ceb1444268965477c00a73720ec743a + 0x2669e36b48e95bd9903300e50c27c53984fc439f6235fade08e3f14e78a42aac ); sideNodes[1] = NamespaceNode( Constants.PARITY_SHARE_NAMESPACE_ID, Constants.PARITY_SHARE_NAMESPACE_ID, - 0xf11ca80de48fa801927a8061e234a29b8ab63b8239a9ea1efecf92688999602d + 0x055a3ea75c438d752aeabbba94ed8fac93e0b32321256a65fde176dba14f5186 ); sideNodes[2] = NamespaceNode( - NamespaceID.wrap(0x0000000000000010), - NamespaceID.wrap(0x0000000000000040), - 0x31cb53b761143d0a1b6b7f096b64c6c0543266fda00654070a2d485d0a66b281 + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + 0xa8dcd9f365fb64aa6d72b5027fe74db0fc7d009c2d75c7b9b9656927281cb35e ); uint256 key = 7; @@ -246,7 +252,7 @@ contract NamespaceMerkleTreeTest is DSTest { } function testVerifyInnerLeafIsRoot() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000); + NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000000); NamespaceNode memory root = NamespaceNode(nid, nid, 0xc59fa9c4ec515726c2b342544433f844c7b930cf7a5e7abab593332453ceaf70); NamespaceNode[] memory sideNodes; @@ -261,7 +267,7 @@ contract NamespaceMerkleTreeTest is DSTest { } function testVerifyInnerFalseForStartingHeightZero() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000); + NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020); NamespaceNode memory root = NamespaceNode(nid, nid, 0xc59fa9c4ec515726c2b342544433f844c7b930cf7a5e7abab593332453ceaf70); NamespaceNode[] memory sideNodes; @@ -276,7 +282,7 @@ contract NamespaceMerkleTreeTest is DSTest { } function testVerifyInnerFalseForTooLargeKey() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000); + NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020); NamespaceNode memory root = NamespaceNode(nid, nid, 0xc59fa9c4ec515726c2b342544433f844c7b930cf7a5e7abab593332453ceaf70); NamespaceNode[] memory sideNodes; @@ -291,7 +297,7 @@ contract NamespaceMerkleTreeTest is DSTest { } function testVerifyInnerFalseForIncorrectProofLength() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000); + NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020); NamespaceNode memory root = NamespaceNode(nid, nid, 0xc59fa9c4ec515726c2b342544433f844c7b930cf7a5e7abab593332453ceaf70); NamespaceNode[] memory sideNodes = new NamespaceNode[](1); @@ -312,25 +318,25 @@ contract NamespaceMerkleTreeTest is DSTest { function testVerifyInnerOneOfEight() external { NamespaceNode memory root = NamespaceNode( - NamespaceID.wrap(0x0000000000000010), - NamespaceID.wrap(0x0000000000000040), - 0x16c760661bc5ed683d27dc2f045a81a67e837928527e0de209a195b6db60f462 + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + 0x34e6541306dc4e57a5a2a9ef57a46d5705ed09efb8c6a02580d3a972922b6862 ); NamespaceNode[] memory sideNodes = new NamespaceNode[](2); sideNodes[0] = NamespaceNode( - NamespaceID.wrap(0x0000000000000030), - NamespaceID.wrap(0x0000000000000040), - 0x3f8ded56b6a8d4e1e36832e8be93234e2e3a18c1a42edfb505ecc09f0039a10f + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000030), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + 0x2aa20c7587b009772a9a88402b7cc8fcb82edc9e31754e95544a670a696f55a7 ); sideNodes[1] = NamespaceNode( Constants.PARITY_SHARE_NAMESPACE_ID, Constants.PARITY_SHARE_NAMESPACE_ID, - 0x27209d167edf7ea1463f462b850471ce31b124b0b3405c33f9c39e692c9170da + 0x5aa3e7ea31995fdd38f41015275229b290a8ee4810521db766ad457b9a8373d6 ); NamespaceNode memory node = NamespaceNode( - NamespaceID.wrap(0x0000000000000010), - NamespaceID.wrap(0x0000000000000020), - 0xe0a6f55a5c2d86e0057b89d79bf5c6c3fdc5a40061566c39e93077556e2e3482 + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020), + 0x1dae5c3d39a8bf31ea33ba368238a52f816cd50485c580565609554cf360c91f ); uint256 key = 0; @@ -342,25 +348,25 @@ contract NamespaceMerkleTreeTest is DSTest { function testVerifyInnerSevenOfEight() external { NamespaceNode memory root = NamespaceNode( - NamespaceID.wrap(0x0000000000000010), - NamespaceID.wrap(0x0000000000000040), - 0x16c760661bc5ed683d27dc2f045a81a67e837928527e0de209a195b6db60f462 + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + 0x34e6541306dc4e57a5a2a9ef57a46d5705ed09efb8c6a02580d3a972922b6862 ); NamespaceNode[] memory sideNodes = new NamespaceNode[](2); sideNodes[0] = NamespaceNode( Constants.PARITY_SHARE_NAMESPACE_ID, Constants.PARITY_SHARE_NAMESPACE_ID, - 0x61d6762ff063c2008a412246bc6bb370885c4e1a935ca28ed8699dc5c68ff28a + 0x055a3ea75c438d752aeabbba94ed8fac93e0b32321256a65fde176dba14f5186 ); sideNodes[1] = NamespaceNode( - NamespaceID.wrap(0x0000000000000010), - NamespaceID.wrap(0x0000000000000040), - 0xed6a82bfecd113f693065e3b1f271f21150b6d793917402f6c05a01feb6b3eb8 + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + 0xa8dcd9f365fb64aa6d72b5027fe74db0fc7d009c2d75c7b9b9656927281cb35e ); NamespaceNode memory node = NamespaceNode( Constants.PARITY_SHARE_NAMESPACE_ID, Constants.PARITY_SHARE_NAMESPACE_ID, - 0x9086b06cbc327959e3c34546aadc886300aff3e5c8f96a328267abf64ca5d25b + 0x1b79ffd74644e8c287fe5f1dd70bc8ea02738697cebf2810ffb2dc5157485c40 ); uint256 key = 6; diff --git a/src/lib/tree/namespace/test/TreeHasher.t.sol b/src/lib/tree/namespace/test/TreeHasher.t.sol index 64d469bf..142710e4 100644 --- a/src/lib/tree/namespace/test/TreeHasher.t.sol +++ b/src/lib/tree/namespace/test/TreeHasher.t.sol @@ -18,28 +18,28 @@ contract TreeHasherTest is DSTest { } function testLeafDigestEmpty() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000); + NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000000); NamespaceNode memory expected = - NamespaceNode(nid, nid, 0x3e7077fd2f66d689e0cee6a7cf5b37bf2dca7c979af356d0a31cbc5c85605c7d); + NamespaceNode(nid, nid, 0x0679246d6c4216de0daa08e5523fb2674db2b6599c3b72ff946b488a15290b62); bytes memory data; NamespaceNode memory node = leafDigest(nid, data); assertEqNamespaceNode(node, expected); } function testLeafDigestSome() external { - NamespaceID nid = NamespaceID.wrap(0xdeadbeefdeadbeef); + NamespaceID nid = NamespaceID.wrap(0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde); NamespaceNode memory expected = - NamespaceNode(nid, nid, 0x7c5146e5a2fe11d16375bfebe907722d77fad468411a2704f3863e41993186bb); + NamespaceNode(nid, nid, 0x3624c7f7169cb5bbd0d010b851ebd0edca10b2a1b126f5fb1a6d5e0d98356e63); bytes memory data = hex"69"; NamespaceNode memory node = leafDigest(nid, data); assertEqNamespaceNode(node, expected); } function testNodeDigest() external { - NamespaceID nidLeft = NamespaceID.wrap(0x0000000000000000); - NamespaceID nidRight = NamespaceID.wrap(0xdeadbeefdeadbeef); + NamespaceID nidLeft = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000000); + NamespaceID nidRight = NamespaceID.wrap(0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde); NamespaceNode memory expected = - NamespaceNode(nidLeft, nidRight, 0xc09cccb48cbc3a3ce4b19b9f25da11325d4fdf823ba56e990006fbc1eb8ddaf2); + NamespaceNode(nidLeft, nidRight, 0x95cad48bc181484c851004cf772abe767391e19549d3b8192b55b1d654a71bcd); NamespaceNode memory left = NamespaceNode(nidLeft, nidLeft, 0xdb55da3fc3098e9c42311c6013304ff36b19ef73d12ea932054b5ad51df4f49d); NamespaceNode memory right = @@ -49,10 +49,10 @@ contract TreeHasherTest is DSTest { } function testNodeParity() external { - NamespaceID nidMin = NamespaceID.wrap(0x0000000000000000); - NamespaceID nidMax = NamespaceID.wrap(0xdeadbeefdeadbeef); + NamespaceID nidMin = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000000); + NamespaceID nidMax = NamespaceID.wrap(0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde); NamespaceNode memory expected = - NamespaceNode(nidMin, nidMax, 0xb16c8e95fa3655fa06d2ccf09f8351443c5a838a1f1b8d5cf2cb1ec00adf2662); + NamespaceNode(nidMin, nidMax, 0xc6960f535d4ab0aed075aed34a116725e8035012ceffe5405ae72abe3bcaa28f); NamespaceNode memory left = NamespaceNode(nidMin, nidMax, 0xdb55da3fc3098e9c42311c6013304ff36b19ef73d12ea932054b5ad51df4f49d); NamespaceNode memory right = NamespaceNode( diff --git a/src/lib/verifier/test/DAVerifier.t.sol b/src/lib/verifier/test/DAVerifier.t.sol index bb679643..1cc46357 100644 --- a/src/lib/verifier/test/DAVerifier.t.sol +++ b/src/lib/verifier/test/DAVerifier.t.sol @@ -23,34 +23,35 @@ interface CheatCodes { The data used to generate the proof: The block used contains a single share: -0x0000000000000001010000014300000011c1020a95010a92010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412720a2f63656c65737469613165383064747a75387a38786739676d7333716d346c34336639757a6c306174767473766a3564122f63656c65737469613167616b61646d63386a73667873646c676e6d64643867773736346739796165776e32726d386d1a0e0a0475746961120631303030303012650a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2102207a8037a3a1dac112f77d982feaca3d8930e468b835a11ff176a159588334f312040a020801180112110a0b0a0475746961120335303010d0e80c1a40c19753445b3de4d70d6c25707d082968e8fd8c8b8fb4e135a570c8d291e90a7b30219bf5ab4840081c1479d8295a5d73ef1d635faf40467bbe7658398d24f1d600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +0x0000000000000000000000000000000000000000000000000000000001010000014500000026c3020a95010a92010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412720a2f63656c657374696131746b376c776a77336676616578657770687237687833333472766b67646b736d636537666b66122f63656c65737469613167616b61646d63386a73667873646c676e6d64643867773736346739796165776e32726d386d1a0e0a0475746961120631303030303012670a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103f3e16481ff7c9c2a677f08a30a887e5f9c14313cb624b8c5f7f955d143c81d9212040a020801180112130a0d0a04757469611205323230303010d0e80c1a4068f074601f1bb923f6d6e69d2e3fc3af145c9252eceeb0ac4fba9f661ca0428326f0080478cc969129c0074c3d97ae925de34c5f9d98a458cd47a565a2bb08cc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 The extended block is: -0x0000000000000001010000014300000011c1020a95010a92010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412720a2f63656c65737469613165383064747a75387a38786739676d7333716d346c34336639757a6c306174767473766a3564122f63656c65737469613167616b61646d63386a73667873646c676e6d64643867773736346739796165776e32726d386d1a0e0a0475746961120631303030303012650a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2102207a8037a3a1dac112f77d982feaca3d8930e468b835a11ff176a159588334f312040a020801180112110a0b0a0475746961120335303010d0e80c1a40c19753445b3de4d70d6c25707d082968e8fd8c8b8fb4e135a570c8d291e90a7b30219bf5ab4840081c1479d8295a5d73ef1d635faf40467bbe7658398d24f1d600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -0x0000000000000001010000014300000011c1020a95010a92010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412720a2f63656c65737469613165383064747a75387a38786739676d7333716d346c34336639757a6c306174767473766a3564122f63656c65737469613167616b61646d63386a73667873646c676e6d64643867773736346739796165776e32726d386d1a0e0a0475746961120631303030303012650a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2102207a8037a3a1dac112f77d982feaca3d8930e468b835a11ff176a159588334f312040a020801180112110a0b0a0475746961120335303010d0e80c1a40c19753445b3de4d70d6c25707d082968e8fd8c8b8fb4e135a570c8d291e90a7b30219bf5ab4840081c1479d8295a5d73ef1d635faf40467bbe7658398d24f1d600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -0x0000000000000001010000014300000011c1020a95010a92010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412720a2f63656c65737469613165383064747a75387a38786739676d7333716d346c34336639757a6c306174767473766a3564122f63656c65737469613167616b61646d63386a73667873646c676e6d64643867773736346739796165776e32726d386d1a0e0a0475746961120631303030303012650a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2102207a8037a3a1dac112f77d982feaca3d8930e468b835a11ff176a159588334f312040a020801180112110a0b0a0475746961120335303010d0e80c1a40c19753445b3de4d70d6c25707d082968e8fd8c8b8fb4e135a570c8d291e90a7b30219bf5ab4840081c1479d8295a5d73ef1d635faf40467bbe7658398d24f1d600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -0x0000000000000001010000014300000011c1020a95010a92010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412720a2f63656c65737469613165383064747a75387a38786739676d7333716d346c34336639757a6c306174767473766a3564122f63656c65737469613167616b61646d63386a73667873646c676e6d64643867773736346739796165776e32726d386d1a0e0a0475746961120631303030303012650a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2102207a8037a3a1dac112f77d982feaca3d8930e468b835a11ff176a159588334f312040a020801180112110a0b0a0475746961120335303010d0e80c1a40c19753445b3de4d70d6c25707d082968e8fd8c8b8fb4e135a570c8d291e90a7b30219bf5ab4840081c1479d8295a5d73ef1d635faf40467bbe7658398d24f1d600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +0x0000000000000000000000000000000000000000000000000000000001010000014500000026c3020a95010a92010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412720a2f63656c657374696131746b376c776a77336676616578657770687237687833333472766b67646b736d636537666b66122f63656c65737469613167616b61646d63386a73667873646c676e6d64643867773736346739796165776e32726d386d1a0e0a0475746961120631303030303012670a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103f3e16481ff7c9c2a677f08a30a887e5f9c14313cb624b8c5f7f955d143c81d9212040a020801180112130a0d0a04757469611205323230303010d0e80c1a4068f074601f1bb923f6d6e69d2e3fc3af145c9252eceeb0ac4fba9f661ca0428326f0080478cc969129c0074c3d97ae925de34c5f9d98a458cd47a565a2bb08cc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +0x0000000000000000000000000000000000000000000000000000000001010000014500000026c3020a95010a92010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412720a2f63656c657374696131746b376c776a77336676616578657770687237687833333472766b67646b736d636537666b66122f63656c65737469613167616b61646d63386a73667873646c676e6d64643867773736346739796165776e32726d386d1a0e0a0475746961120631303030303012670a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103f3e16481ff7c9c2a677f08a30a887e5f9c14313cb624b8c5f7f955d143c81d9212040a020801180112130a0d0a04757469611205323230303010d0e80c1a4068f074601f1bb923f6d6e69d2e3fc3af145c9252eceeb0ac4fba9f661ca0428326f0080478cc969129c0074c3d97ae925de34c5f9d98a458cd47a565a2bb08cc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +0x0000000000000000000000000000000000000000000000000000000001010000014500000026c3020a95010a92010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412720a2f63656c657374696131746b376c776a77336676616578657770687237687833333472766b67646b736d636537666b66122f63656c65737469613167616b61646d63386a73667873646c676e6d64643867773736346739796165776e32726d386d1a0e0a0475746961120631303030303012670a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103f3e16481ff7c9c2a677f08a30a887e5f9c14313cb624b8c5f7f955d143c81d9212040a020801180112130a0d0a04757469611205323230303010d0e80c1a4068f074601f1bb923f6d6e69d2e3fc3af145c9252eceeb0ac4fba9f661ca0428326f0080478cc969129c0074c3d97ae925de34c5f9d98a458cd47a565a2bb08cc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +0x0000000000000000000000000000000000000000000000000000000001010000014500000026c3020a95010a92010a1c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e6412720a2f63656c657374696131746b376c776a77336676616578657770687237687833333472766b67646b736d636537666b66122f63656c65737469613167616b61646d63386a73667873646c676e6d64643867773736346739796165776e32726d386d1a0e0a0475746961120631303030303012670a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103f3e16481ff7c9c2a677f08a30a887e5f9c14313cb624b8c5f7f955d143c81d9212040a020801180112130a0d0a04757469611205323230303010d0e80c1a4068f074601f1bb923f6d6e69d2e3fc3af145c9252eceeb0ac4fba9f661ca0428326f0080478cc969129c0074c3d97ae925de34c5f9d98a458cd47a565a2bb08cc0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 The row roots: -0x000000000000000100000000000000018c8732952e0c3e3f0adf0a43665e30bc554cfad53635caccb52c7d38cc078af8 -0xffffffffffffffffffffffffffffffff8a27b3798dc3f14c183597cdfa738c94758cbf0665fa96242672d65cf72881a9 +0x00000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000001787bf77b567506b6e1d0048bfd89edd352a4fbc102e62f07cc9fe6b4cbe5ee69 +0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7329c7d336d0140840837fc0d8eafa2403f4f6b019b602581cd9f04e28026eae The column roots: -0x000000000000000100000000000000018c8732952e0c3e3f0adf0a43665e30bc554cfad53635caccb52c7d38cc078af8 -0xffffffffffffffffffffffffffffffff8a27b3798dc3f14c183597cdfa738c94758cbf0665fa96242672d65cf72881a9 +0x00000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000001787bf77b567506b6e1d0048bfd89edd352a4fbc102e62f07cc9fe6b4cbe5ee69 +0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7329c7d336d0140840837fc0d8eafa2403f4f6b019b602581cd9f04e28026eae -The data root: 0x1108C0D8079563116167A66BE596DBE222E438C273ECC3B48E290465FC6093B2 +The data root: 0x55cfc29fc0cd263906122d5cb859091224495b141fc0c51529612d7ab8962950 -The height: 2 +The height: 3 The blocks data roots used to create the commitment: -1. 0x257760461993F8F197B421EC7435F3C36C3734923E3DA9A42DC73B05F07B3D08 -2. 0x1108C0D8079563116167A66BE596DBE222E438C273ECC3B48E290465FC6093B2 -3. 0x257760461993F8F197B421EC7435F3C36C3734923E3DA9A42DC73B05F07B3D08 +1. 0x3d96b7d238e7e0456f6af8e7cdf0a67bd6cf9c2089ecb559c659dcaa1f880353 +2. 0x3d96b7d238e7e0456f6af8e7cdf0a67bd6cf9c2089ecb559c659dcaa1f880353 +3. 0x55cfc29fc0cd263906122d5cb859091224495b141fc0c51529612d7ab8962950 +4. 0x3d96b7d238e7e0456f6af8e7cdf0a67bd6cf9c2089ecb559c659dcaa1f880353 The nonce: 2 -The data root tuple root: 0x81A5323C06C5CF0EE22752CC01597F16E93A1C6CCA71625AAEE9D918D09345ED +The data root tuple root: 0xf89859a09c0f2b1bbb039618d0fe60432b8c247f7ccde97814655f2acffb3434 */ contract DAVerifierTest is DSTest { @@ -207,18 +208,18 @@ contract DAVerifierTest is DSTest { contract TestFixture { /// @notice the share containing the blob that was published to Celestia. bytes public shareData = abi.encodePacked( - hex"0000000000000001010000014300000011c1020a95010a92010a1c2f636f736d", - hex"6f732e62616e6b2e763162657461312e4d736753656e6412720a2f63656c6573", - hex"7469613165383064747a75387a38786739676d7333716d346c34336639757a6c", - hex"306174767473766a3564122f63656c65737469613167616b61646d63386a7366", - hex"7873646c676e6d64643867773736346739796165776e32726d386d1a0e0a0475", - hex"746961120631303030303012650a500a460a1f2f636f736d6f732e6372797074", - hex"6f2e736563703235366b312e5075624b657912230a2102207a8037a3a1dac112", - hex"f77d982feaca3d8930e468b835a11ff176a159588334f312040a020801180112", - hex"110a0b0a0475746961120335303010d0e80c1a40c19753445b3de4d70d6c2570", - hex"7d082968e8fd8c8b8fb4e135a570c8d291e90a7b30219bf5ab4840081c1479d8", - hex"295a5d73ef1d635faf40467bbe7658398d24f1d6000000000000000000000000", - hex"0000000000000000000000000000000000000000000000000000000000000000", + hex"0000000000000000000000000000000000000000000000000000000001010000", + hex"014500000026c3020a95010a92010a1c2f636f736d6f732e62616e6b2e763162", + hex"657461312e4d736753656e6412720a2f63656c657374696131746b376c776a77", + hex"336676616578657770687237687833333472766b67646b736d636537666b6612", + hex"2f63656c65737469613167616b61646d63386a73667873646c676e6d64643867", + hex"773736346739796165776e32726d386d1a0e0a04757469611206313030303030", + hex"12670a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b31", + hex"2e5075624b657912230a2103f3e16481ff7c9c2a677f08a30a887e5f9c14313c", + hex"b624b8c5f7f955d143c81d9212040a020801180112130a0d0a04757469611205", + hex"323230303010d0e80c1a4068f074601f1bb923f6d6e69d2e3fc3af145c9252ec", + hex"eeb0ac4fba9f661ca0428326f0080478cc969129c0074c3d97ae925de34c5f9d", + hex"98a458cd47a565a2bb08cc000000000000000000000000000000000000000000", hex"0000000000000000000000000000000000000000000000000000000000000000", hex"0000000000000000000000000000000000000000000000000000000000000000", hex"0000000000000000000000000000000000000000000000000000000000000000", @@ -226,59 +227,59 @@ contract TestFixture { ); /// @notice the share's namespace ID. - NamespaceID public minimaxNID = NamespaceID.wrap(0x0000000000000001); + NamespaceID public minimaxNID = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000001); /// @notice the first EDS row root. bytes public firstRowRoot = abi.encodePacked( - hex"000000000000000100000000000000018c8732952e0c3e3f0adf0a43665e30bc554cfad53635caccb52c7d38cc078af8" + hex"00000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000001787bf77b567506b6e1d0048bfd89edd352a4fbc102e62f07cc9fe6b4cbe5ee69" ); /// @notice the second EDS row root. bytes public secondRowRoot = abi.encodePacked( - hex"ffffffffffffffffffffffffffffffff8a27b3798dc3f14c183597cdfa738c94758cbf0665fa96242672d65cf72881a9" + hex"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7329c7d336d0140840837fc0d8eafa2403f4f6b019b602581cd9f04e28026eae" ); /// @notice the first EDS column root. bytes public firstColumnRoot = abi.encodePacked( - hex"000000000000000100000000000000018c8732952e0c3e3f0adf0a43665e30bc554cfad53635caccb52c7d38cc078af8" + hex"00000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000001787bf77b567506b6e1d0048bfd89edd352a4fbc102e62f07cc9fe6b4cbe5ee69" ); /// @notice the second EDS column root. bytes public secondColumnRoot = abi.encodePacked( - hex"ffffffffffffffffffffffffffffffff8a27b3798dc3f14c183597cdfa738c94758cbf0665fa96242672d65cf72881a9" + hex"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7329c7d336d0140840837fc0d8eafa2403f4f6b019b602581cd9f04e28026eae" ); /// @notice the data root of the block containing the submitted blob. - bytes32 public dataRoot = 0x1108C0D8079563116167A66BE596DBE222E438C273ECC3B48E290465FC6093B2; + bytes32 public dataRoot = 0x55cfc29fc0cd263906122d5cb859091224495b141fc0c51529612d7ab8962950; /// @notice the height of the block containing the submitted blob. - uint256 public height = 2; + uint256 public height = 3; /// @notice the data root tuple root committing to the Celestia block. - bytes32 public dataRootTupleRoot = 0x81A5323C06C5CF0EE22752CC01597F16E93A1C6CCA71625AAEE9D918D09345ED; + bytes32 public dataRootTupleRoot = 0xf89859a09c0f2b1bbb039618d0fe60432b8c247f7ccde97814655f2acffb3434; /// @notice the data root tuple root nonce in the QGB contract. uint256 public dataRootTupleRootNonce = 2; /// @notice the data root tuple to data root tuple root proof side nodes. bytes32[] public dataRootProofSideNodes = [ - bytes32(0xD380873912E163B240C72D2AED926CCED511A34467BE9E697F49465A7DF8F3BE), - bytes32(0x055B7998D838C5846E1751A6C8BA8822459C492549AC7EA33ADDA48E4861C78F) + bytes32(0xb5d4d27ec6b206a205bf09dde3371ffba62e5b53d27bbec4255b7f4f27ef5d90), + bytes32(0x406e22ba94989ca721453057a1391fc531edb342c86a0ab4cc722276b54036ec) ]; /// @notice shares to data root proof side nodes. NamespaceNode[] public shareToDataRootProofSideNodes = [ NamespaceNode( - NamespaceID.wrap(0xffffffffffffffff), - NamespaceID.wrap(0xffffffffffffffff), - 0x99ff60ce3818df2d1601a5a6a7d7bac82aa79d1726bca4e05b94e4ce38f06ffe + NamespaceID.wrap(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff), + NamespaceID.wrap(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff), + 0x0ec8148c743a4a4db384f40f487cae2fd1ca0d18442d1f162916bdf1cc61b679 ) ]; /// @notice row root to data root proof side nodes. bytes32[] public rowRootToDataRootProofSideNodes = [ - bytes32(0x3d9568eda3d860f78af0b605066eb6f90495b87d2081bf875e6a88ede0a1f6bc), - bytes32(0xbf6d9e948bc2e4bc32a791135385bbc2a3b8f426d33d212c9f755e8f2dd964ad) + bytes32(0x5bc0cf3322dd5c9141a2dcd76947882351690c9aec61015802efc6742992643f), + bytes32(0xff576381b02abadc50e414f6b4efcae31091cd40a5aba75f56be52d1bb2efcae) ]; /// @notice the data root tuple of the block containing the submitted blob. @@ -288,42 +289,42 @@ contract TestFixture { /// @notice the data root tuple to data root tuple root proof. function getDataRootTupleProof() public view returns (BinaryMerkleProof memory) { - return BinaryMerkleProof(dataRootProofSideNodes, 1, 4); + return BinaryMerkleProof(dataRootProofSideNodes, 2, 4); } /// @notice the first EDS row root. - function getFirstRowRootNode() public view returns (NamespaceNode memory) { + function getFirstRowRootNode() public pure returns (NamespaceNode memory) { return NamespaceNode( - NamespaceID.wrap(0x0000000000000001), - NamespaceID.wrap(0x0000000000000001), - 0x8C8732952E0C3E3F0ADF0A43665E30BC554CFAD53635CACCB52C7D38CC078AF8 + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000001), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000001), + 0x787bf77b567506b6e1d0048bfd89edd352a4fbc102e62f07cc9fe6b4cbe5ee69 ); } /// @notice the second EDS row root. - function getSecondRowRootNode() public view returns (NamespaceNode memory) { + function getSecondRowRootNode() public pure returns (NamespaceNode memory) { return NamespaceNode( - NamespaceID.wrap(0x0000000000000001), - NamespaceID.wrap(0xffffffffffffffff), - 0x8C8732952E0C3E3F0ADF0A43665E30BC554CFAD53635CACCB52C7D38CC078AF8 + NamespaceID.wrap(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff), + NamespaceID.wrap(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff), + 0x7329c7d336d0140840837fc0d8eafa2403f4f6b019b602581cd9f04e28026eae ); } /// @notice the first EDS column root. - function getFirstColumnRootNode() public view returns (NamespaceNode memory) { + function getFirstColumnRootNode() public pure returns (NamespaceNode memory) { return NamespaceNode( - NamespaceID.wrap(0x0000000000000001), - NamespaceID.wrap(0xffffffffffffffff), - 0x8C8732952E0C3E3F0ADF0A43665E30BC554CFAD53635CACCB52C7D38CC078AF8 + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000001), + NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000001), + 0x787bf77b567506b6e1d0048bfd89edd352a4fbc102e62f07cc9fe6b4cbe5ee69 ); } /// @notice the second EDS column root. - function getSecondColumnRootNode() public view returns (NamespaceNode memory) { + function getSecondColumnRootNode() public pure returns (NamespaceNode memory) { return NamespaceNode( - NamespaceID.wrap(0x0000000000000001), - NamespaceID.wrap(0xffffffffffffffff), - 0x8C8732952E0C3E3F0ADF0A43665E30BC554CFAD53635CACCB52C7D38CC078AF8 + NamespaceID.wrap(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff), + NamespaceID.wrap(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff), + 0x7329c7d336d0140840837fc0d8eafa2403f4f6b019b602581cd9f04e28026eae ); } diff --git a/wrappers/QuantumGravityBridge.sol/wrapper.go b/wrappers/QuantumGravityBridge.sol/wrapper.go index f17f87d5..fa70aef0 100644 --- a/wrappers/QuantumGravityBridge.sol/wrapper.go +++ b/wrappers/QuantumGravityBridge.sol/wrapper.go @@ -58,7 +58,7 @@ type Validator struct { // WrappersMetaData contains all meta data concerning the Wrappers contract. var WrappersMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_powerThreshold\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_validatorSetHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InsufficientVotingPower\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDataRootTupleRootNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidValidatorSetNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MalformedCurrentValidatorSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SuppliedValidatorSetInvalid\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"dataRootTupleRoot\",\"type\":\"bytes32\"}],\"name\":\"DataRootTupleRootEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"powerThreshold\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"validatorSetHash\",\"type\":\"bytes32\"}],\"name\":\"ValidatorSetUpdatedEvent\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"state_dataRootTupleRoots\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_eventNonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_lastValidatorSetCheckpoint\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_powerThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_validatorSetNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_dataRootTupleRoot\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"power\",\"type\":\"uint256\"}],\"internalType\":\"structValidator[]\",\"name\":\"_currentValidatorSet\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structSignature[]\",\"name\":\"_sigs\",\"type\":\"tuple[]\"}],\"name\":\"submitDataRootTupleRoot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_oldNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_newPowerThreshold\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_newValidatorSetHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"power\",\"type\":\"uint256\"}],\"internalType\":\"structValidator[]\",\"name\":\"_currentValidatorSet\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structSignature[]\",\"name\":\"_sigs\",\"type\":\"tuple[]\"}],\"name\":\"updateValidatorSet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_tupleRootNonce\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"height\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"dataRoot\",\"type\":\"bytes32\"}],\"internalType\":\"structDataRootTuple\",\"name\":\"_tuple\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"sideNodes\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"key\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numLeaves\",\"type\":\"uint256\"}],\"internalType\":\"structBinaryMerkleProof\",\"name\":\"_proof\",\"type\":\"tuple\"}],\"name\":\"verifyAttestation\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x6080346100ed57601f61103b38819003918201601f1916830192916001600160401b0391828511848610176100d75781606092859260409788528339810103126100ed5781519183602082015191015191845192602084016918da1958dadc1bda5b9d60b21b815285878601528360608601528160808601526080855260a0850192858410908411176100d7577fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c94879460c09285875282519020886002556000558060015584520152a251610f4890816100f38239f35b634e487b7160e01b600052604160045260246000fd5b600080fdfe608060408181526004918236101561001657600080fd5b600092833560e01c91826305d85c131461039f575081631f3302a9146102545781635433218c14610237578163817f985b1461020f578163cdade866146101f0578163e23eb32614610093575063e5a2b5d21461007257600080fd5b3461008f578160031936011261008f576020906001549051908152f35b5080fd5b9050346101ec5760a03660031901126101ec578035916044359167ffffffffffffffff6064358181116101e8576100cd90369084016104cc565b90916084359081116101e4576100e69036908501610502565b916002549460015495600181018091116101d15789036101c3578382036101b55761011d61011483876105d4565b87602435610654565b8a54036101a757509261018f927f6614d037bde4905e31ca5ff05de61964c267f28b0320ed49e59f7d99752e1c4f979592879560209851898101906f0e8e4c2dce6c2c6e8d2dedc84c2e8c6d60831b82528c898201528960608201526060815261018681610533565b519020936106d7565b8460025584865260038352818187205551908152a280f35b8651630bbdaec960e11b8152fd5b865163c6617b7b60e01b8152fd5b865163e869766d60e01b8152fd5b634e487b7160e01b8b526011825260248bfd5b8780fd5b8680fd5b8280fd5b50503461008f578160031936011261008f576020906002549051908152f35b9050346101ec5760203660031901126101ec5760209282913581526003845220549051908152f35b50503461008f578160031936011261008f57602091549051908152f35b83833461008f576003199160803684011261035d578160231936011261035d57815167ffffffffffffffff948184018681118382101761038c57845260248035835260209660443588850152606435968188116103885760609088360301126103845785519460608601918683108184111761037257828852888501358181116101ec578901366023820112156101ec5785810135918211610360578160051b916103018c840186610581565b84528460808901928201019236841161035d575090848b9201905b83821061034e575050505095604491610345969786528101358886015201358584015235610a81565b90519015158152f35b8135815290820190820161031c565b80fd5b634e487b7160e01b8352604186528483fd5b634e487b7160e01b8252604185528382fd5b8480fd5b8580fd5b634e487b7160e01b845260418252602484fd5b848285346101ec5760c03660031901126101ec57813591604435906064359067ffffffffffffffff6084358181116101e4576103de90369084016104cc565b92909160a4359081116104c8576103f89036908301610502565b916002549a6001549b600181018091116104b5578a036104a9575082850361049b5761043061042786866105d4565b8c602435610654565b8a540361048d575091879899916104759361046d87897fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c9c610654565b9586936106d7565b8655816001558460025582519182526020820152a280f35b8751630bbdaec960e11b8152fd5b875163c6617b7b60e01b8152fd5b6368a35ffd60e11b8152fd5b634e487b7160e01b8c526011835260248cfd5b8880fd5b9181601f840112156104fd5782359167ffffffffffffffff83116104fd576020808501948460061b0101116104fd57565b600080fd5b9181601f840112156104fd5782359167ffffffffffffffff83116104fd57602080850194606085020101116104fd57565b6080810190811067ffffffffffffffff82111761054f57604052565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff82111761054f57604052565b90601f8019910116810190811067ffffffffffffffff82111761054f57604052565b60010190816001116105b157565b634e487b7160e01b600052601160045260246000fd5b919082018092116105b157565b60409182518092602092838301958181850186895252606084019294600090815b84831061061a575050505050610614925003601f198101835282610581565b51902090565b919395509193863560018060a01b0381168091036101ec578582819260019452858a013586820152019701930190918795939694926105f5565b916040519160208301936918da1958dadc1bda5b9d60b21b85526040840152606083015260808201526080815260a0810181811067ffffffffffffffff82111761054f5760405251902090565b91908110156106b1576060020190565b634e487b7160e01b600052603260045260246000fd5b91908110156106b15760061b0190565b93919060009485935b828510610707575b505050505050106106f557565b60405163cabeb65560e01b8152600490fd5b909192939497969561071a868a876106a1565b6020908181013515908161083f575b8161082a575b506108235761073f8786866106c7565b6001600160a01b039035818116908190036104fd5761075f898d8a6106a1565b916107c66107be6040948551878101907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008252603c8b8183015281526107a481610565565b5190206107b08261084c565b8888840135930135916109cc565b91909161085a565b16036108135750906107e5916107dd8887876106c7565b0135906105c7565b9486861015610809575b60001981146105b1576001019392919097949596976106e0565b85969798506106e8565b51638baa579f60e01b8152600490fd5b50946107ef565b60ff91506108379061084c565b16153861072f565b6040810135159150610729565b3560ff811681036104fd5790565b60058110156109b6578061086b5750565b600181036108b85760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b600281036109055760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b6003810361095d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b60041461096657565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311610a755760ff16601b81141580610a6a575b610a5e579160809493916020936040519384528484015260408301526060820152600093849182805260015afa15610a515781516001600160a01b03811615610a4b579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600490565b50601c811415610a04565b50505050600090600390565b916002548311610ac557610ac29260005260036020526040600020546020604051938051828601520151604084015260408352610abd83610565565b610b0d565b90565b505050600090565b906101009182039182116105b157565b6000198101919082116105b157565b919082039182116105b157565b80518210156106b15760209160051b010190565b6040820180519193909291600190818111610dd45750825151610dca575b6020830192835185511115610dbf576020610b5e93610b78604051610b6c81600098899586888401526021830190610e9d565b03601f198101835282610581565b60405191828092610e9d565b039060025afa15610db45782519481515115610d9c57829081958051925b610c97575b505160001991828201918211610c835703610c36575b8293925b610bc3575b50505050501490565b9091929394818601868111610c225783518051821015610c1a57610bf19291610beb91610af9565b51610ec8565b94848101809111610c06579392919083610bb5565b634e487b7160e01b84526011600452602484fd5b505094610bba565b634e487b7160e01b85526011600452602485fd5b9091939482515182870190878211610c8357811015610c785790610c5e610c65928551610af9565b5190610ec8565b94848101809111610c0657939190610bb1565b505050509250505090565b634e487b7160e01b86526011600452602486fd5b9091819793949697519387891b948515610d8857891c94858a1b95808704821490151715610d7457610cc990866105c7565b60001992818401918211610d52578551821015610d66575094865151928a01928a8411610d5257831015610d4457610d02908451610aec565b88831b1115610d3057610c5e610d19928751610af9565b965b868101809111610c8357959392919084610b96565b610beb610d3e928751610af9565b96610d1b565b505050505050509250505090565b634e487b7160e01b89526011600452602489fd5b949350509796949350610b9b565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b88526012600452602488fd5b519495949293505003610dae57501490565b91505090565b6040513d84823e3d90fd5b505050505050600090565b5050505050600090565b610de5845151916020860151610df4565b14610b2b575050505050600090565b909160005b60018481831b1015610e2557810180911115610df957634e487b7160e01b600052601160045260246000fd5b50929190926101009081039081116105b157610e4090610acd565b916001610e4c84610add565b1b91610e5783610add565b8111610e635750505090565b9192509060018303610e7757505050600190565b82610e88610e9494610e8e93610aec565b92610aec565b90610df4565b610ac2906105a3565b9081519160005b838110610eb5575050016000815290565b8060208092840101518185015201610ea4565b610ef560009160209360405191600160f81b868401526021830152604182015260418152610b6c81610533565b039060025afa15610f065760005190565b6040513d6000823e3d90fdfea26469706673582212207e1dc090e15369c581a3ce61b283a07cb3b7221aaff9b9c2967da208c8df4bdd64736f6c63430008140033", + Bin: "0x6080346100ed57601f61103b38819003918201601f1916830192916001600160401b0391828511848610176100d75781606092859260409788528339810103126100ed5781519183602082015191015191845192602084016918da1958dadc1bda5b9d60b21b815285878601528360608601528160808601526080855260a0850192858410908411176100d7577fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c94879460c09285875282519020886002556000558060015584520152a251610f4890816100f38239f35b634e487b7160e01b600052604160045260246000fd5b600080fdfe608060408181526004918236101561001657600080fd5b600092833560e01c91826305d85c131461039f575081631f3302a9146102545781635433218c14610237578163817f985b1461020f578163cdade866146101f0578163e23eb32614610093575063e5a2b5d21461007257600080fd5b3461008f578160031936011261008f576020906001549051908152f35b5080fd5b9050346101ec5760a03660031901126101ec578035916044359167ffffffffffffffff6064358181116101e8576100cd90369084016104cc565b90916084359081116101e4576100e69036908501610502565b916002549460015495600181018091116101d15789036101c3578382036101b55761011d61011483876105d4565b87602435610654565b8a54036101a757509261018f927f6614d037bde4905e31ca5ff05de61964c267f28b0320ed49e59f7d99752e1c4f979592879560209851898101906f0e8e4c2dce6c2c6e8d2dedc84c2e8c6d60831b82528c898201528960608201526060815261018681610533565b519020936106d7565b8460025584865260038352818187205551908152a280f35b8651630bbdaec960e11b8152fd5b865163c6617b7b60e01b8152fd5b865163e869766d60e01b8152fd5b634e487b7160e01b8b526011825260248bfd5b8780fd5b8680fd5b8280fd5b50503461008f578160031936011261008f576020906002549051908152f35b9050346101ec5760203660031901126101ec5760209282913581526003845220549051908152f35b50503461008f578160031936011261008f57602091549051908152f35b83833461008f576003199160803684011261035d578160231936011261035d57815167ffffffffffffffff948184018681118382101761038c57845260248035835260209660443588850152606435968188116103885760609088360301126103845785519460608601918683108184111761037257828852888501358181116101ec578901366023820112156101ec5785810135918211610360578160051b916103018c840186610581565b84528460808901928201019236841161035d575090848b9201905b83821061034e575050505095604491610345969786528101358886015201358584015235610a81565b90519015158152f35b8135815290820190820161031c565b80fd5b634e487b7160e01b8352604186528483fd5b634e487b7160e01b8252604185528382fd5b8480fd5b8580fd5b634e487b7160e01b845260418252602484fd5b848285346101ec5760c03660031901126101ec57813591604435906064359067ffffffffffffffff6084358181116101e4576103de90369084016104cc565b92909160a4359081116104c8576103f89036908301610502565b916002549a6001549b600181018091116104b5578a036104a9575082850361049b5761043061042786866105d4565b8c602435610654565b8a540361048d575091879899916104759361046d87897fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c9c610654565b9586936106d7565b8655816001558460025582519182526020820152a280f35b8751630bbdaec960e11b8152fd5b875163c6617b7b60e01b8152fd5b6368a35ffd60e11b8152fd5b634e487b7160e01b8c526011835260248cfd5b8880fd5b9181601f840112156104fd5782359167ffffffffffffffff83116104fd576020808501948460061b0101116104fd57565b600080fd5b9181601f840112156104fd5782359167ffffffffffffffff83116104fd57602080850194606085020101116104fd57565b6080810190811067ffffffffffffffff82111761054f57604052565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff82111761054f57604052565b90601f8019910116810190811067ffffffffffffffff82111761054f57604052565b60010190816001116105b157565b634e487b7160e01b600052601160045260246000fd5b919082018092116105b157565b60409182518092602092838301958181850186895252606084019294600090815b84831061061a575050505050610614925003601f198101835282610581565b51902090565b919395509193863560018060a01b0381168091036101ec578582819260019452858a013586820152019701930190918795939694926105f5565b916040519160208301936918da1958dadc1bda5b9d60b21b85526040840152606083015260808201526080815260a0810181811067ffffffffffffffff82111761054f5760405251902090565b91908110156106b1576060020190565b634e487b7160e01b600052603260045260246000fd5b91908110156106b15760061b0190565b93919060009485935b828510610707575b505050505050106106f557565b60405163cabeb65560e01b8152600490fd5b909192939497969561071a868a876106a1565b6020908181013515908161083f575b8161082a575b506108235761073f8786866106c7565b6001600160a01b039035818116908190036104fd5761075f898d8a6106a1565b916107c66107be6040948551878101907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008252603c8b8183015281526107a481610565565b5190206107b08261084c565b8888840135930135916109cc565b91909161085a565b16036108135750906107e5916107dd8887876106c7565b0135906105c7565b9486861015610809575b60001981146105b1576001019392919097949596976106e0565b85969798506106e8565b51638baa579f60e01b8152600490fd5b50946107ef565b60ff91506108379061084c565b16153861072f565b6040810135159150610729565b3560ff811681036104fd5790565b60058110156109b6578061086b5750565b600181036108b85760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b600281036109055760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b6003810361095d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b60041461096657565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311610a755760ff16601b81141580610a6a575b610a5e579160809493916020936040519384528484015260408301526060820152600093849182805260015afa15610a515781516001600160a01b03811615610a4b579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600490565b50601c811415610a04565b50505050600090600390565b916002548311610ac557610ac29260005260036020526040600020546020604051938051828601520151604084015260408352610abd83610565565b610b0d565b90565b505050600090565b906101009182039182116105b157565b6000198101919082116105b157565b919082039182116105b157565b80518210156106b15760209160051b010190565b6040820180519193909291600190818111610dd45750825151610dca575b6020830192835185511115610dbf576020610b5e93610b78604051610b6c81600098899586888401526021830190610e9d565b03601f198101835282610581565b60405191828092610e9d565b039060025afa15610db45782519481515115610d9c57829081958051925b610c97575b505160001991828201918211610c835703610c36575b8293925b610bc3575b50505050501490565b9091929394818601868111610c225783518051821015610c1a57610bf19291610beb91610af9565b51610ec8565b94848101809111610c06579392919083610bb5565b634e487b7160e01b84526011600452602484fd5b505094610bba565b634e487b7160e01b85526011600452602485fd5b9091939482515182870190878211610c8357811015610c785790610c5e610c65928551610af9565b5190610ec8565b94848101809111610c0657939190610bb1565b505050509250505090565b634e487b7160e01b86526011600452602486fd5b9091819793949697519387891b948515610d8857891c94858a1b95808704821490151715610d7457610cc990866105c7565b60001992818401918211610d52578551821015610d66575094865151928a01928a8411610d5257831015610d4457610d02908451610aec565b88831b1115610d3057610c5e610d19928751610af9565b965b868101809111610c8357959392919084610b96565b610beb610d3e928751610af9565b96610d1b565b505050505050509250505090565b634e487b7160e01b89526011600452602489fd5b949350509796949350610b9b565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b88526012600452602488fd5b519495949293505003610dae57501490565b91505090565b6040513d84823e3d90fd5b505050505050600090565b5050505050600090565b610de5845151916020860151610df4565b14610b2b575050505050600090565b909160005b60018481831b1015610e2557810180911115610df957634e487b7160e01b600052601160045260246000fd5b50929190926101009081039081116105b157610e4090610acd565b916001610e4c84610add565b1b91610e5783610add565b8111610e635750505090565b9192509060018303610e7757505050600190565b82610e88610e9494610e8e93610aec565b92610aec565b90610df4565b610ac2906105a3565b9081519160005b838110610eb5575050016000815290565b8060208092840101518185015201610ea4565b610ef560009160209360405191600160f81b868401526021830152604182015260418152610b6c81610533565b039060025afa15610f065760005190565b6040513d6000823e3d90fdfea26469706673582212200c3187622365c82480a03883264cc046b3d34bea50f1b808111f7cea6896febf64736f6c63430008140033", } // WrappersABI is the input ABI used to generate the binding from. From 24703f17fe76cd5d7968a1ce20f309ced74e74ac Mon Sep 17 00:00:00 2001 From: CHAMI Rachid Date: Tue, 22 Aug 2023 10:40:12 +0200 Subject: [PATCH 2/2] chore: use the same environment as CI (#179) ## Overview This is using the same environment as the CI for wrapper generation. Previously, it was using latest ethereum dev tools and a different go version w which was resulting in a different wrapper ## Checklist - [ ] New and updated code has appropriate documentation - [ ] New and updated code has new and/or updated testing - [ ] Required CI checks are passing - [ ] Visual proof for any user facing features like CLI or documentation updates - [ ] Linked issues closed with keywords --- scripts/Dockerfile_Environment | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/Dockerfile_Environment b/scripts/Dockerfile_Environment index 0d96e6f2..1b714118 100644 --- a/scripts/Dockerfile_Environment +++ b/scripts/Dockerfile_Environment @@ -25,13 +25,13 @@ RUN apt update && apt install -y git build-essential software-properties-common RUN curl -L https://foundry.paradigm.xyz | bash && . /root/.bashrc && foundryup # install solc -RUN wget https://github.com/ethereum/solidity/releases/download/v0.8.20/solc-static-linux -O /usr/bin/solc && chmod +x /usr/bin/solc +RUN wget https://github.com/ethereum/solidity/releases/download/v0.8.19/solc-static-linux -O /usr/bin/solc && chmod +x /usr/bin/solc # install go -RUN wget https://go.dev/dl/go1.20.6.linux-amd64.tar.gz && rm -rf /usr/local/go && tar -C /usr/local -xzf go1.20.6.linux-amd64.tar.gz && echo 'PATH=$PATH:/usr/local/go/bin:/root/go/bin' >> ~/.bashrc +RUN wget https://go.dev/dl/go1.19.linux-amd64.tar.gz && rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.linux-amd64.tar.gz && echo 'PATH=$PATH:/usr/local/go/bin:/root/go/bin' >> ~/.bashrc # install abigen -RUN git clone https://github.com/ethereum/go-ethereum.git && cd go-ethereum && PATH=$PATH:/usr/local/go/bin make devtools +RUN git clone --depth 1 --branch v1.12.0 https://github.com/ethereum/go-ethereum.git && cd go-ethereum && PATH=$PATH:/usr/local/go/bin make devtools WORKDIR /root ENTRYPOINT bash