From 19c6fcb93eaa67a86dcc5d7788b5ddf7c1091132 Mon Sep 17 00:00:00 2001 From: "dcbuilder.eth" Date: Wed, 25 Oct 2023 21:03:56 +0100 Subject: [PATCH 01/26] add test --- Cargo.lock | 1 + .../abi/MockWorldIDIdentityManager.json | 1010 ++++++++++++++--- crates/tree_availability/Cargo.toml | 1 + .../tests/inclusion_proof.rs | 87 +- 4 files changed, 948 insertions(+), 151 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b4cd9338..07b5c1e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4940,6 +4940,7 @@ version = "0.1.0" dependencies = [ "axum", "clap 4.4.6", + "common", "ethers", "eyre", "futures", diff --git a/crates/common/src/test_utilities/abi/MockWorldIDIdentityManager.json b/crates/common/src/test_utilities/abi/MockWorldIDIdentityManager.json index 0c4981b8..c8c63565 100644 --- a/crates/common/src/test_utilities/abi/MockWorldIDIdentityManager.json +++ b/crates/common/src/test_utilities/abi/MockWorldIDIdentityManager.json @@ -36,6 +36,34 @@ "name": "TreeChanged", "type": "event" }, + { + "inputs": [ + { + "internalType": "uint256[8]", + "name": "deletionProof", + "type": "uint256[8]" + }, + { + "internalType": "bytes", + "name": "packedDeletionIndices", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "preRoot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "postRoot", + "type": "uint256" + } + ], + "name": "deleteIdentities", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -61,23 +89,58 @@ ], "stateMutability": "view", "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[8]", + "name": "insertionProof", + "type": "uint256[8]" + }, + { + "internalType": "uint256", + "name": "preRoot", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "startIndex", + "type": "uint32" + }, + { + "internalType": "uint256[]", + "name": "identityCommitments", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "postRoot", + "type": "uint256" + } + ], + "name": "registerIdentities", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" } ], "bytecode": { - "object": "0x608060405234801561001057600080fd5b5060405161011938038061011983398101604081905261002f91610037565b600055610050565b60006020828403121561004957600080fd5b5051919050565b60bb8061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c8063c46d227a146037578063d7b0fef1146048575b600080fd5b604660423660046096565b605d565b005b60005460405190815260200160405180910390f35b6000805482825590829060405183907f25f6d5cc356ee0b49cf708c13c68197947f5740a878a298765e4b18e4afdaf0490600090a45050565b60006020828403121560a757600080fd5b503591905056fea164736f6c634300080f000a", - "sourceMap": "381:1053:36:-:0;;;1071:69;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1111:11;:22;381:1053;;14:184:44;84:6;137:2;125:9;116:7;112:23;108:32;105:52;;;153:1;150;143:12;105:52;-1:-1:-1;176:16:44;;14:184;-1:-1:-1;14:184:44:o;:::-;381:1053:36;;;;;;", + "object": "0x608060405234801561001057600080fd5b5060405161033338038061033383398101604081905261002f91610037565b600055610050565b60006020828403121561004957600080fd5b5051919050565b6102d48061005f6000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80632217b21114610051578063c46d227a14610066578063d7b0fef114610079578063ea10fbbe1461008e575b600080fd5b61006461005f36600461015d565b6100a1565b005b610064610074366004610217565b6100d7565b60005460405190815260200160405180910390f35b61006461009c366004610230565b610110565b80600060405187907f25f6d5cc356ee0b49cf708c13c68197947f5740a878a298765e4b18e4afdaf0490600090a4505050505050565b6000805482825590829060405183907f25f6d5cc356ee0b49cf708c13c68197947f5740a878a298765e4b18e4afdaf0490600090a45050565b80600160405184907f25f6d5cc356ee0b49cf708c13c68197947f5740a878a298765e4b18e4afdaf0490600090a45050505050565b80610100810183101561015757600080fd5b92915050565b600080600080600080610180878903121561017757600080fd5b6101818888610145565b9550610100870135945061012087013563ffffffff811681146101a357600080fd5b935061014087013567ffffffffffffffff808211156101c157600080fd5b818901915089601f8301126101d557600080fd5b8135818111156101e457600080fd5b8a60208260051b85010111156101f957600080fd5b60208301955080945050505061016087013590509295509295509295565b60006020828403121561022957600080fd5b5035919050565b6000806000806000610160868803121561024957600080fd5b6102538787610145565b945061010086013567ffffffffffffffff8082111561027157600080fd5b818801915088601f83011261028557600080fd5b81358181111561029457600080fd5b8960208285010111156102a657600080fd5b9699602092909201985095966101208101359650610140013594509250505056fea164736f6c634300080f000a", + "sourceMap": "381:4386:36:-:0;;;1071:69;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1111:11;:22;381:4386;;14:184:43;84:6;137:2;125:9;116:7;112:23;108:32;105:52;;;153:1;150;143:12;105:52;-1:-1:-1;176:16:43;;14:184;-1:-1:-1;14:184:43:o;:::-;381:4386:36;;;;;;", "linkReferences": {} }, "deployedBytecode": { - "object": "0x6080604052348015600f57600080fd5b506004361060325760003560e01c8063c46d227a146037578063d7b0fef1146048575b600080fd5b604660423660046096565b605d565b005b60005460405190815260200160405180910390f35b6000805482825590829060405183907f25f6d5cc356ee0b49cf708c13c68197947f5740a878a298765e4b18e4afdaf0490600090a45050565b60006020828403121560a757600080fd5b503591905056fea164736f6c634300080f000a", - "sourceMap": "381:1053:36:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1146:191;;;;;;:::i;:::-;;:::i;:::-;;1343:89;1388:7;1414:11;1343:89;;345:25:44;;;333:2;318:18;1343:89:36;;;;;;;1146:191;1201:15;1219:11;;1240:22;;;1219:11;1254:8;;1278:52;;1290:7;;1278:52;;;;;1191:146;1146:191;:::o;14:180:44:-;73:6;126:2;114:9;105:7;101:23;97:32;94:52;;;142:1;139;132:12;94:52;-1:-1:-1;165:23:44;;14:180;-1:-1:-1;14:180:44:o", + "object": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80632217b21114610051578063c46d227a14610066578063d7b0fef114610079578063ea10fbbe1461008e575b600080fd5b61006461005f36600461015d565b6100a1565b005b610064610074366004610217565b6100d7565b60005460405190815260200160405180910390f35b61006461009c366004610230565b610110565b80600060405187907f25f6d5cc356ee0b49cf708c13c68197947f5740a878a298765e4b18e4afdaf0490600090a4505050505050565b6000805482825590829060405183907f25f6d5cc356ee0b49cf708c13c68197947f5740a878a298765e4b18e4afdaf0490600090a45050565b80600160405184907f25f6d5cc356ee0b49cf708c13c68197947f5740a878a298765e4b18e4afdaf0490600090a45050505050565b80610100810183101561015757600080fd5b92915050565b600080600080600080610180878903121561017757600080fd5b6101818888610145565b9550610100870135945061012087013563ffffffff811681146101a357600080fd5b935061014087013567ffffffffffffffff808211156101c157600080fd5b818901915089601f8301126101d557600080fd5b8135818111156101e457600080fd5b8a60208260051b85010111156101f957600080fd5b60208301955080945050505061016087013590509295509295509295565b60006020828403121561022957600080fd5b5035919050565b6000806000806000610160868803121561024957600080fd5b6102538787610145565b945061010086013567ffffffffffffffff8082111561027157600080fd5b818801915088601f83011261028557600080fd5b81358181111561029457600080fd5b8960208285010111156102a657600080fd5b9699602092909201985095966101208101359650610140013594509250505056fea164736f6c634300080f000a", + "sourceMap": "381:4386:36:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2634:285;;;;;;:::i;:::-;;:::i;:::-;;4479:191;;;;;;:::i;:::-;;:::i;4676:89::-;4721:7;4747:11;4676:89;;1562:25:43;;;1550:2;1535:18;4676:89:36;;;;;;;4221:252;;;;;;:::i;:::-;;:::i;2634:285::-;2903:8;2881:20;2860:52;;2872:7;;2860:52;;;;;2634:285;;;;;;:::o;4479:191::-;4534:15;4552:11;;4573:22;;;4552:11;4587:8;;4611:52;;4623:7;;4611:52;;;;;4524:146;4479:191;:::o;4221:252::-;4457:8;4436:19;4415:51;;4427:7;;4415:51;;;;;4221:252;;;;;:::o;14:160:43:-;108:6;141:3;129:16;;126:25;-1:-1:-1;123:45:43;;;164:1;161;154:12;123:45;14:160;;;;:::o;179:1047::-;325:6;333;341;349;357;365;418:3;406:9;397:7;393:23;389:33;386:53;;;435:1;432;425:12;386:53;458;503:7;492:9;458:53;:::i;:::-;448:63;;558:3;547:9;543:19;530:33;520:43;;613:3;602:9;598:19;585:33;658:10;651:5;647:22;640:5;637:33;627:61;;684:1;681;674:12;627:61;707:5;-1:-1:-1;763:3:43;748:19;;735:33;787:18;817:14;;;814:34;;;844:1;841;834:12;814:34;882:6;871:9;867:22;857:32;;927:7;920:4;916:2;912:13;908:27;898:55;;949:1;946;939:12;898:55;989:2;976:16;1015:2;1007:6;1004:14;1001:34;;;1031:1;1028;1021:12;1001:34;1086:7;1079:4;1069:6;1066:1;1062:14;1058:2;1054:23;1050:34;1047:47;1044:67;;;1107:1;1104;1097:12;1044:67;1138:4;1134:2;1130:13;1120:23;;1162:6;1152:16;;;;;1215:3;1204:9;1200:19;1187:33;1177:43;;179:1047;;;;;;;;:::o;1231:180::-;1290:6;1343:2;1331:9;1322:7;1318:23;1314:32;1311:52;;;1359:1;1356;1349:12;1311:52;-1:-1:-1;1382:23:43;;1231:180;-1:-1:-1;1231:180:43:o;1598:858::-;1720:6;1728;1736;1744;1752;1805:3;1793:9;1784:7;1780:23;1776:33;1773:53;;;1822:1;1819;1812:12;1773:53;1845;1890:7;1879:9;1845:53;:::i;:::-;1835:63;;1949:3;1938:9;1934:19;1921:33;1973:18;2014:2;2006:6;2003:14;2000:34;;;2030:1;2027;2020:12;2000:34;2068:6;2057:9;2053:22;2043:32;;2113:7;2106:4;2102:2;2098:13;2094:27;2084:55;;2135:1;2132;2125:12;2084:55;2175:2;2162:16;2201:2;2193:6;2190:14;2187:34;;;2217:1;2214;2207:12;2187:34;2264:7;2257:4;2248:6;2244:2;2240:15;2236:26;2233:39;2230:59;;;2285:1;2282;2275:12;2230:59;1598:858;;2316:4;2308:13;;;;;-1:-1:-1;2340:6:43;;2393:3;2378:19;;2365:33;;-1:-1:-1;2445:3:43;2430:19;2417:33;;-1:-1:-1;1598:858:43;-1:-1:-1;;;1598:858:43:o", "linkReferences": {} }, "methodIdentifiers": { + "deleteIdentities(uint256[8],bytes,uint256,uint256)": "ea10fbbe", "insertRoot(uint256)": "c46d227a", - "latestRoot()": "d7b0fef1" + "latestRoot()": "d7b0fef1", + "registerIdentities(uint256[8],uint256,uint32,uint256[],uint256)": "2217b211" }, - "rawMetadata": "{\"compiler\":{\"version\":\"0.8.15+commit.e14f2714\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"initRoot\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"preRoot\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"enum MockWorldIDIdentityManager.TreeChange\",\"name\":\"kind\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"postRoot\",\"type\":\"uint256\"}],\"name\":\"TreeChanged\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"postRoot\",\"type\":\"uint256\"}],\"name\":\"insertRoot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestRoot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Worldcoin\",\"details\":\"deployed through make mock and make local-mock\",\"events\":{\"TreeChanged(uint256,uint8,uint256)\":{\"params\":{\"kind\":\"Either \\\"insertion\\\" or \\\"update\\\", the kind of alteration that was made to the tree.\",\"postRoot\":\"The value of the tree's root after the update.\",\"preRoot\":\"The value of the tree's root before the update.\"}}},\"kind\":\"dev\",\"methods\":{},\"title\":\"WorldID Identity Manager Mock\",\"version\":1},\"userdoc\":{\"events\":{\"TreeChanged(uint256,uint8,uint256)\":{\"notice\":\"Emitted when the current root of the tree is updated.\"}},\"kind\":\"user\",\"methods\":{\"latestRoot()\":{\"notice\":\"returns the latest root\"}},\"notice\":\"Mock of the WorldID Identity Manager contract (world-id-contracts) to test functionality on a local chain\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/mock/MockWorldIDIdentityManager.sol\":\"MockWorldIDIdentityManager\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[\":@eth-optimism/contracts-bedrock/=node_modules/@eth-optimism/contracts-bedrock/\",\":@eth-optimism/contracts/=node_modules/@eth-optimism/contracts/\",\":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/\",\":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/\",\":@prb/test/=lib/prb-test/src/\",\":@rari-capital/solmate/=lib/solmate/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\",\":fx-portal/contracts/=lib/contracts/contracts/\",\":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":prb-test/=lib/prb-test/src/\",\":solmate/=lib/solmate/\",\":src/=src/\"]},\"sources\":{\"src/interfaces/IWorldIDIdentityManager.sol\":{\"keccak256\":\"0xf088e152bce5d5dbf7ec47aeaf3e942bbea4f55a1f0b6422688dbe30f52ec6cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e4a8e3951f0d3110b972a7ecc9374514e8ccb4d48affadbcac7c1ef1cee3d7dd\",\"dweb:/ipfs/QmYuWrenPXH92iRjkf9ERpcJuetEEqS3m9ykJW8Kaasyi1\"]},\"src/mock/MockWorldIDIdentityManager.sol\":{\"keccak256\":\"0xf81887da2d3a0d24b423c7837cb1f56b22fbbcfff267c2ee8e83ec1d53b3fd29\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2fc5cfd68d31109af17f684c6203ae49b37d6335f00080b11021558d555c24c5\",\"dweb:/ipfs/QmZjPzQPo32gfKFyD1h6A8eT2UTwGFWtDWAFDxAyxg8vNR\"]}},\"version\":1}", + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.15+commit.e14f2714\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"initRoot\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"preRoot\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"enum MockWorldIDIdentityManager.TreeChange\",\"name\":\"kind\",\"type\":\"uint8\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"postRoot\",\"type\":\"uint256\"}],\"name\":\"TreeChanged\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256[8]\",\"name\":\"deletionProof\",\"type\":\"uint256[8]\"},{\"internalType\":\"bytes\",\"name\":\"packedDeletionIndices\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"preRoot\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"postRoot\",\"type\":\"uint256\"}],\"name\":\"deleteIdentities\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"postRoot\",\"type\":\"uint256\"}],\"name\":\"insertRoot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestRoot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[8]\",\"name\":\"insertionProof\",\"type\":\"uint256[8]\"},{\"internalType\":\"uint256\",\"name\":\"preRoot\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"startIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256[]\",\"name\":\"identityCommitments\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"postRoot\",\"type\":\"uint256\"}],\"name\":\"registerIdentities\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Worldcoin\",\"details\":\"deployed through make mock and make local-mock\",\"events\":{\"TreeChanged(uint256,uint8,uint256)\":{\"params\":{\"kind\":\"Either \\\"insertion\\\" or \\\"update\\\", the kind of alteration that was made to the tree.\",\"postRoot\":\"The value of the tree's root after the update.\",\"preRoot\":\"The value of the tree's root before the update.\"}}},\"kind\":\"dev\",\"methods\":{\"deleteIdentities(uint256[8],bytes,uint256,uint256)\":{\"params\":{\"postRoot\":\"The root obtained after deleting all of `identityCommitments` into the tree described by `preRoot`. Must be an element of the field `Kr`.\",\"preRoot\":\"The value for the root of the tree before the corresponding identity commitments have been deleted. Must be an element of the field `Kr`.\"}},\"registerIdentities(uint256[8],uint256,uint32,uint256[],uint256)\":{\"params\":{\"identityCommitments\":\"The identities that were inserted into the tree starting at `startIndex` and `preRoot` to give `postRoot`. All of the commitments must be elements of the field `Kr`.\",\"postRoot\":\"The root obtained after inserting all of `identityCommitments` into the tree described by `preRoot`. Must be an element of the field `Kr`. (alread in reduced form)\",\"startIndex\":\"The position in the tree at which the insertions were made.\"}}},\"title\":\"WorldID Identity Manager Mock\",\"version\":1},\"userdoc\":{\"events\":{\"TreeChanged(uint256,uint8,uint256)\":{\"notice\":\"Emitted when the current root of the tree is updated.\"}},\"kind\":\"user\",\"methods\":{\"latestRoot()\":{\"notice\":\"returns the latest root\"}},\"notice\":\"Mock of the WorldID Identity Manager contract (world-id-contracts) to test functionality on a local chain\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/mock/MockWorldIDIdentityManager.sol\":\"MockWorldIDIdentityManager\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"none\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[\":@eth-optimism/contracts-bedrock/=node_modules/@eth-optimism/contracts-bedrock/\",\":@eth-optimism/contracts/=node_modules/@eth-optimism/contracts/\",\":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/\",\":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/\",\":@prb/test/=lib/prb-test/src/\",\":@rari-capital/solmate/=lib/solmate/\",\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\",\":fx-portal/contracts/=lib/contracts/contracts/\",\":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":prb-test/=lib/prb-test/src/\",\":solmate/=lib/solmate/\",\":src/=src/\"]},\"sources\":{\"src/interfaces/IWorldIDIdentityManager.sol\":{\"keccak256\":\"0xf088e152bce5d5dbf7ec47aeaf3e942bbea4f55a1f0b6422688dbe30f52ec6cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e4a8e3951f0d3110b972a7ecc9374514e8ccb4d48affadbcac7c1ef1cee3d7dd\",\"dweb:/ipfs/QmYuWrenPXH92iRjkf9ERpcJuetEEqS3m9ykJW8Kaasyi1\"]},\"src/mock/MockWorldIDIdentityManager.sol\":{\"keccak256\":\"0xbb2236139dfce1091ba6110ee133ecedd92a1b84b46c2f953552ce40766d1a94\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://35d413ff18dbc7081e5379c530813275281eb5caaaa27916126abb4b4ea24b30\",\"dweb:/ipfs/QmaET2NCoTfgteJcdEXfZ4cPUgyGZvo1YXEfsjMRUGkM7T\"]}},\"version\":1}", "metadata": { "compiler": { "version": "0.8.15+commit.e14f2714" @@ -121,6 +184,33 @@ "name": "TreeChanged", "anonymous": false }, + { + "inputs": [ + { + "internalType": "uint256[8]", + "name": "deletionProof", + "type": "uint256[8]" + }, + { + "internalType": "bytes", + "name": "packedDeletionIndices", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "preRoot", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "postRoot", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "deleteIdentities" + }, { "inputs": [ { @@ -145,11 +235,57 @@ "type": "uint256" } ] + }, + { + "inputs": [ + { + "internalType": "uint256[8]", + "name": "insertionProof", + "type": "uint256[8]" + }, + { + "internalType": "uint256", + "name": "preRoot", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "startIndex", + "type": "uint32" + }, + { + "internalType": "uint256[]", + "name": "identityCommitments", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "postRoot", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "registerIdentities" } ], "devdoc": { "kind": "dev", - "methods": {}, + "methods": { + "deleteIdentities(uint256[8],bytes,uint256,uint256)": { + "params": { + "postRoot": "The root obtained after deleting all of `identityCommitments` into the tree described by `preRoot`. Must be an element of the field `Kr`.", + "preRoot": "The value for the root of the tree before the corresponding identity commitments have been deleted. Must be an element of the field `Kr`." + } + }, + "registerIdentities(uint256[8],uint256,uint32,uint256[],uint256)": { + "params": { + "identityCommitments": "The identities that were inserted into the tree starting at `startIndex` and `preRoot` to give `postRoot`. All of the commitments must be elements of the field `Kr`.", + "postRoot": "The root obtained after inserting all of `identityCommitments` into the tree described by `preRoot`. Must be an element of the field `Kr`. (alread in reduced form)", + "startIndex": "The position in the tree at which the insertions were made." + } + } + }, "version": 1 }, "userdoc": { @@ -201,10 +337,10 @@ "license": "MIT" }, "src/mock/MockWorldIDIdentityManager.sol": { - "keccak256": "0xf81887da2d3a0d24b423c7837cb1f56b22fbbcfff267c2ee8e83ec1d53b3fd29", + "keccak256": "0xbb2236139dfce1091ba6110ee133ecedd92a1b84b46c2f953552ce40766d1a94", "urls": [ - "bzz-raw://2fc5cfd68d31109af17f684c6203ae49b37d6335f00080b11021558d555c24c5", - "dweb:/ipfs/QmZjPzQPo32gfKFyD1h6A8eT2UTwGFWtDWAFDxAyxg8vNR" + "bzz-raw://35d413ff18dbc7081e5379c530813275281eb5caaaa27916126abb4b4ea24b30", + "dweb:/ipfs/QmaET2NCoTfgteJcdEXfZ4cPUgyGZvo1YXEfsjMRUGkM7T" ], "license": "MIT" } @@ -213,20 +349,20 @@ }, "ast": { "absolutePath": "src/mock/MockWorldIDIdentityManager.sol", - "id": 32464, + "id": 32513, "exportedSymbols": { "IWorldIDIdentityManager": [ 32276 ], "MockWorldIDIdentityManager": [ - 32463 + 32512 ] }, "nodeType": "SourceUnit", - "src": "32:1403:36", + "src": "32:4736:36", "nodes": [ { - "id": 32403, + "id": 32405, "nodeType": "PragmaDirective", "src": "32:24:36", "nodes": [], @@ -238,19 +374,19 @@ ] }, { - "id": 32405, + "id": 32407, "nodeType": "ImportDirective", "src": "58:83:36", "nodes": [], "absolutePath": "src/interfaces/IWorldIDIdentityManager.sol", "file": "src/interfaces/IWorldIDIdentityManager.sol", "nameLocation": "-1:-1:-1", - "scope": 32464, + "scope": 32513, "sourceUnit": 32277, "symbolAliases": [ { "foreign": { - "id": 32404, + "id": 32406, "name": "IWorldIDIdentityManager", "nodeType": "Identifier", "overloadedDeclarations": [], @@ -264,12 +400,12 @@ "unitAlias": "" }, { - "id": 32463, + "id": 32512, "nodeType": "ContractDefinition", - "src": "381:1053:36", + "src": "381:4386:36", "nodes": [ { - "id": 32410, + "id": 32412, "nodeType": "VariableDeclaration", "src": "450:28:36", "nodes": [], @@ -277,7 +413,7 @@ "mutability": "mutable", "name": "_latestRoot", "nameLocation": "467:11:36", - "scope": 32463, + "scope": 32512, "stateVariable": true, "storageLocation": "default", "typeDescriptions": { @@ -285,7 +421,7 @@ "typeString": "uint256" }, "typeName": { - "id": 32409, + "id": 32411, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "450:7:36", @@ -297,21 +433,21 @@ "visibility": "internal" }, { - "id": 32413, + "id": 32415, "nodeType": "EnumDefinition", "src": "569:59:36", "nodes": [], "canonicalName": "MockWorldIDIdentityManager.TreeChange", "members": [ { - "id": 32411, + "id": 32413, "name": "Insertion", "nameLocation": "595:9:36", "nodeType": "EnumValue", "src": "595:9:36" }, { - "id": 32412, + "id": 32414, "name": "Deletion", "nameLocation": "614:8:36", "nodeType": "EnumValue", @@ -322,13 +458,13 @@ "nameLocation": "574:10:36" }, { - "id": 32423, + "id": 32425, "nodeType": "EventDefinition", "src": "971:94:36", "nodes": [], "anonymous": false, "documentation": { - "id": 32414, + "id": 32416, "nodeType": "StructuredDocumentation", "src": "634:332:36", "text": "@notice Emitted when the current root of the tree is updated.\n @param preRoot The value of the tree's root before the update.\n @param kind Either \"insertion\" or \"update\", the kind of alteration that was made to the\n tree.\n @param postRoot The value of the tree's root after the update." @@ -337,18 +473,18 @@ "name": "TreeChanged", "nameLocation": "977:11:36", "parameters": { - "id": 32422, + "id": 32424, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 32416, + "id": 32418, "indexed": true, "mutability": "mutable", "name": "preRoot", "nameLocation": "1005:7:36", "nodeType": "VariableDeclaration", - "scope": 32423, + "scope": 32425, "src": "989:23:36", "stateVariable": false, "storageLocation": "default", @@ -357,7 +493,7 @@ "typeString": "uint256" }, "typeName": { - "id": 32415, + "id": 32417, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "989:7:36", @@ -370,34 +506,34 @@ }, { "constant": false, - "id": 32419, + "id": 32421, "indexed": true, "mutability": "mutable", "name": "kind", "nameLocation": "1033:4:36", "nodeType": "VariableDeclaration", - "scope": 32423, + "scope": 32425, "src": "1014:23:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_enum$_TreeChange_$32413", + "typeIdentifier": "t_enum$_TreeChange_$32415", "typeString": "enum MockWorldIDIdentityManager.TreeChange" }, "typeName": { - "id": 32418, + "id": 32420, "nodeType": "UserDefinedTypeName", "pathNode": { - "id": 32417, + "id": 32419, "name": "TreeChange", "nodeType": "IdentifierPath", - "referencedDeclaration": 32413, + "referencedDeclaration": 32415, "src": "1014:10:36" }, - "referencedDeclaration": 32413, + "referencedDeclaration": 32415, "src": "1014:10:36", "typeDescriptions": { - "typeIdentifier": "t_enum$_TreeChange_$32413", + "typeIdentifier": "t_enum$_TreeChange_$32415", "typeString": "enum MockWorldIDIdentityManager.TreeChange" } }, @@ -405,13 +541,13 @@ }, { "constant": false, - "id": 32421, + "id": 32423, "indexed": true, "mutability": "mutable", "name": "postRoot", "nameLocation": "1055:8:36", "nodeType": "VariableDeclaration", - "scope": 32423, + "scope": 32425, "src": "1039:24:36", "stateVariable": false, "storageLocation": "default", @@ -420,7 +556,7 @@ "typeString": "uint256" }, "typeName": { - "id": 32420, + "id": 32422, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1039:7:36", @@ -436,29 +572,29 @@ } }, { - "id": 32433, + "id": 32435, "nodeType": "FunctionDefinition", "src": "1071:69:36", "nodes": [], "body": { - "id": 32432, + "id": 32434, "nodeType": "Block", "src": "1101:39:36", "nodes": [], "statements": [ { "expression": { - "id": 32430, + "id": 32432, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { - "id": 32428, + "id": 32430, "name": "_latestRoot", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 32410, + "referencedDeclaration": 32412, "src": "1111:11:36", "typeDescriptions": { "typeIdentifier": "t_uint256", @@ -468,11 +604,11 @@ "nodeType": "Assignment", "operator": "=", "rightHandSide": { - "id": 32429, + "id": 32431, "name": "initRoot", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 32425, + "referencedDeclaration": 32427, "src": "1125:8:36", "typeDescriptions": { "typeIdentifier": "t_uint256", @@ -485,7 +621,7 @@ "typeString": "uint256" } }, - "id": 32431, + "id": 32433, "nodeType": "ExpressionStatement", "src": "1111:22:36" } @@ -497,17 +633,17 @@ "name": "", "nameLocation": "-1:-1:-1", "parameters": { - "id": 32426, + "id": 32428, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 32425, + "id": 32427, "mutability": "mutable", "name": "initRoot", "nameLocation": "1091:8:36", "nodeType": "VariableDeclaration", - "scope": 32433, + "scope": 32435, "src": "1083:16:36", "stateVariable": false, "storageLocation": "default", @@ -516,7 +652,7 @@ "typeString": "uint256" }, "typeName": { - "id": 32424, + "id": 32426, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1083:7:36", @@ -531,41 +667,629 @@ "src": "1082:18:36" }, "returnParameters": { - "id": 32427, + "id": 32429, "nodeType": "ParameterList", "parameters": [], "src": "1101:0:36" }, - "scope": 32463, + "scope": 32512, + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "id": 32460, + "nodeType": "FunctionDefinition", + "src": "2634:285:36", + "nodes": [], + "body": { + "id": 32459, + "nodeType": "Block", + "src": "2845:74:36", + "nodes": [], + "statements": [ + { + "eventCall": { + "arguments": [ + { + "id": 32453, + "name": "preRoot", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32442, + "src": "2872:7:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "expression": { + "id": 32454, + "name": "TreeChange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32415, + "src": "2881:10:36", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_TreeChange_$32415_$", + "typeString": "type(enum MockWorldIDIdentityManager.TreeChange)" + } + }, + "id": 32455, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Insertion", + "nodeType": "MemberAccess", + "referencedDeclaration": 32413, + "src": "2881:20:36", + "typeDescriptions": { + "typeIdentifier": "t_enum$_TreeChange_$32415", + "typeString": "enum MockWorldIDIdentityManager.TreeChange" + } + }, + { + "id": 32456, + "name": "postRoot", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32449, + "src": "2903:8:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_enum$_TreeChange_$32415", + "typeString": "enum MockWorldIDIdentityManager.TreeChange" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 32452, + "name": "TreeChanged", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32425, + "src": "2860:11:36", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_enum$_TreeChange_$32415_$_t_uint256_$returns$__$", + "typeString": "function (uint256,enum MockWorldIDIdentityManager.TreeChange,uint256)" + } + }, + "id": 32457, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "2860:52:36", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 32458, + "nodeType": "EmitStatement", + "src": "2855:57:36" + } + ] + }, + "documentation": { + "id": 32436, + "nodeType": "StructuredDocumentation", + "src": "2106:523:36", + "text": "@param startIndex The position in the tree at which the insertions were made.\n @param identityCommitments The identities that were inserted into the tree starting at\n `startIndex` and `preRoot` to give `postRoot`. All of the commitments must be\n elements of the field `Kr`.\n @param postRoot The root obtained after inserting all of `identityCommitments` into the tree\n described by `preRoot`. Must be an element of the field `Kr`. (alread in reduced form)" + }, + "functionSelector": "2217b211", + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "registerIdentities", + "nameLocation": "2643:18:36", + "parameters": { + "id": 32450, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 32440, + "mutability": "mutable", + "name": "insertionProof", + "nameLocation": "2691:14:36", + "nodeType": "VariableDeclaration", + "scope": 32460, + "src": "2671:34:36", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$8_calldata_ptr", + "typeString": "uint256[8]" + }, + "typeName": { + "baseType": { + "id": 32437, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2671:7:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 32439, + "length": { + "hexValue": "38", + "id": 32438, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2679:1:36", + "typeDescriptions": { + "typeIdentifier": "t_rational_8_by_1", + "typeString": "int_const 8" + }, + "value": "8" + }, + "nodeType": "ArrayTypeName", + "src": "2671:10:36", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$8_storage_ptr", + "typeString": "uint256[8]" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 32442, + "mutability": "mutable", + "name": "preRoot", + "nameLocation": "2723:7:36", + "nodeType": "VariableDeclaration", + "scope": 32460, + "src": "2715:15:36", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 32441, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2715:7:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 32444, + "mutability": "mutable", + "name": "startIndex", + "nameLocation": "2747:10:36", + "nodeType": "VariableDeclaration", + "scope": 32460, + "src": "2740:17:36", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + }, + "typeName": { + "id": 32443, + "name": "uint32", + "nodeType": "ElementaryTypeName", + "src": "2740:6:36", + "typeDescriptions": { + "typeIdentifier": "t_uint32", + "typeString": "uint32" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 32447, + "mutability": "mutable", + "name": "identityCommitments", + "nameLocation": "2786:19:36", + "nodeType": "VariableDeclaration", + "scope": 32460, + "src": "2767:38:36", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_calldata_ptr", + "typeString": "uint256[]" + }, + "typeName": { + "baseType": { + "id": 32445, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2767:7:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 32446, + "nodeType": "ArrayTypeName", + "src": "2767:9:36", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", + "typeString": "uint256[]" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 32449, + "mutability": "mutable", + "name": "postRoot", + "nameLocation": "2823:8:36", + "nodeType": "VariableDeclaration", + "scope": 32460, + "src": "2815:16:36", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 32448, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2815:7:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "2661:176:36" + }, + "returnParameters": { + "id": 32451, + "nodeType": "ParameterList", + "parameters": [], + "src": "2845:0:36" + }, + "scope": 32512, + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + }, + { + "id": 32482, + "nodeType": "FunctionDefinition", + "src": "4221:252:36", + "nodes": [], + "body": { + "id": 32481, + "nodeType": "Block", + "src": "4400:73:36", + "nodes": [], + "statements": [ + { + "eventCall": { + "arguments": [ + { + "id": 32475, + "name": "preRoot", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32469, + "src": "4427:7:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + { + "expression": { + "id": 32476, + "name": "TreeChange", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32415, + "src": "4436:10:36", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_enum$_TreeChange_$32415_$", + "typeString": "type(enum MockWorldIDIdentityManager.TreeChange)" + } + }, + "id": 32477, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "memberName": "Deletion", + "nodeType": "MemberAccess", + "referencedDeclaration": 32414, + "src": "4436:19:36", + "typeDescriptions": { + "typeIdentifier": "t_enum$_TreeChange_$32415", + "typeString": "enum MockWorldIDIdentityManager.TreeChange" + } + }, + { + "id": 32478, + "name": "postRoot", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32471, + "src": "4457:8:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + { + "typeIdentifier": "t_enum$_TreeChange_$32415", + "typeString": "enum MockWorldIDIdentityManager.TreeChange" + }, + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 32474, + "name": "TreeChanged", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 32425, + "src": "4415:11:36", + "typeDescriptions": { + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_enum$_TreeChange_$32415_$_t_uint256_$returns$__$", + "typeString": "function (uint256,enum MockWorldIDIdentityManager.TreeChange,uint256)" + } + }, + "id": 32479, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4415:51:36", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 32480, + "nodeType": "EmitStatement", + "src": "4410:56:36" + } + ] + }, + "documentation": { + "id": 32461, + "nodeType": "StructuredDocumentation", + "src": "3875:341:36", + "text": "@param preRoot The value for the root of the tree before the corresponding identity commitments have\n been deleted. Must be an element of the field `Kr`.\n @param postRoot The root obtained after deleting all of `identityCommitments` into the tree\n described by `preRoot`. Must be an element of the field `Kr`." + }, + "functionSelector": "ea10fbbe", + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "deleteIdentities", + "nameLocation": "4230:16:36", + "parameters": { + "id": 32472, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 32465, + "mutability": "mutable", + "name": "deletionProof", + "nameLocation": "4276:13:36", + "nodeType": "VariableDeclaration", + "scope": 32482, + "src": "4256:33:36", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$8_calldata_ptr", + "typeString": "uint256[8]" + }, + "typeName": { + "baseType": { + "id": 32462, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4256:7:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 32464, + "length": { + "hexValue": "38", + "id": 32463, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4264:1:36", + "typeDescriptions": { + "typeIdentifier": "t_rational_8_by_1", + "typeString": "int_const 8" + }, + "value": "8" + }, + "nodeType": "ArrayTypeName", + "src": "4256:10:36", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_uint256_$8_storage_ptr", + "typeString": "uint256[8]" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 32467, + "mutability": "mutable", + "name": "packedDeletionIndices", + "nameLocation": "4314:21:36", + "nodeType": "VariableDeclaration", + "scope": 32482, + "src": "4299:36:36", + "stateVariable": false, + "storageLocation": "calldata", + "typeDescriptions": { + "typeIdentifier": "t_bytes_calldata_ptr", + "typeString": "bytes" + }, + "typeName": { + "id": 32466, + "name": "bytes", + "nodeType": "ElementaryTypeName", + "src": "4299:5:36", + "typeDescriptions": { + "typeIdentifier": "t_bytes_storage_ptr", + "typeString": "bytes" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 32469, + "mutability": "mutable", + "name": "preRoot", + "nameLocation": "4353:7:36", + "nodeType": "VariableDeclaration", + "scope": 32482, + "src": "4345:15:36", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 32468, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4345:7:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "constant": false, + "id": 32471, + "mutability": "mutable", + "name": "postRoot", + "nameLocation": "4378:8:36", + "nodeType": "VariableDeclaration", + "scope": 32482, + "src": "4370:16:36", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 32470, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4370:7:36", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4246:146:36" + }, + "returnParameters": { + "id": 32473, + "nodeType": "ParameterList", + "parameters": [], + "src": "4400:0:36" + }, + "scope": 32512, "stateMutability": "nonpayable", "virtual": false, "visibility": "public" }, { - "id": 32454, + "id": 32503, "nodeType": "FunctionDefinition", - "src": "1146:191:36", + "src": "4479:191:36", "nodes": [], "body": { - "id": 32453, + "id": 32502, "nodeType": "Block", - "src": "1191:146:36", + "src": "4524:146:36", "nodes": [], "statements": [ { "assignments": [ - 32439 + 32488 ], "declarations": [ { "constant": false, - "id": 32439, + "id": 32488, "mutability": "mutable", "name": "preRoot", - "nameLocation": "1209:7:36", + "nameLocation": "4542:7:36", "nodeType": "VariableDeclaration", - "scope": 32453, - "src": "1201:15:36", + "scope": 32502, + "src": "4534:15:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -573,10 +1297,10 @@ "typeString": "uint256" }, "typeName": { - "id": 32438, + "id": 32487, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "1201:7:36", + "src": "4534:7:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -585,36 +1309,36 @@ "visibility": "internal" } ], - "id": 32441, + "id": 32490, "initialValue": { - "id": 32440, + "id": 32489, "name": "_latestRoot", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 32410, - "src": "1219:11:36", + "referencedDeclaration": 32412, + "src": "4552:11:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", - "src": "1201:29:36" + "src": "4534:29:36" }, { "expression": { - "id": 32444, + "id": 32493, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { - "id": 32442, + "id": 32491, "name": "_latestRoot", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 32410, - "src": "1240:11:36", + "referencedDeclaration": 32412, + "src": "4573:11:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -623,37 +1347,37 @@ "nodeType": "Assignment", "operator": "=", "rightHandSide": { - "id": 32443, + "id": 32492, "name": "postRoot", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 32435, - "src": "1254:8:36", + "referencedDeclaration": 32484, + "src": "4587:8:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "1240:22:36", + "src": "4573:22:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 32445, + "id": 32494, "nodeType": "ExpressionStatement", - "src": "1240:22:36" + "src": "4573:22:36" }, { "eventCall": { "arguments": [ { - "id": 32447, + "id": 32496, "name": "preRoot", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 32439, - "src": "1290:7:36", + "referencedDeclaration": 32488, + "src": "4623:7:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -661,38 +1385,38 @@ }, { "expression": { - "id": 32448, + "id": 32497, "name": "TreeChange", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 32413, - "src": "1299:10:36", + "referencedDeclaration": 32415, + "src": "4632:10:36", "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_TreeChange_$32413_$", + "typeIdentifier": "t_type$_t_enum$_TreeChange_$32415_$", "typeString": "type(enum MockWorldIDIdentityManager.TreeChange)" } }, - "id": 32449, + "id": 32498, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "Insertion", "nodeType": "MemberAccess", - "referencedDeclaration": 32411, - "src": "1299:20:36", + "referencedDeclaration": 32413, + "src": "4632:20:36", "typeDescriptions": { - "typeIdentifier": "t_enum$_TreeChange_$32413", + "typeIdentifier": "t_enum$_TreeChange_$32415", "typeString": "enum MockWorldIDIdentityManager.TreeChange" } }, { - "id": 32450, + "id": 32499, "name": "postRoot", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 32435, - "src": "1321:8:36", + "referencedDeclaration": 32484, + "src": "4654:8:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -706,7 +1430,7 @@ "typeString": "uint256" }, { - "typeIdentifier": "t_enum$_TreeChange_$32413", + "typeIdentifier": "t_enum$_TreeChange_$32415", "typeString": "enum MockWorldIDIdentityManager.TreeChange" }, { @@ -714,18 +1438,18 @@ "typeString": "uint256" } ], - "id": 32446, + "id": 32495, "name": "TreeChanged", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 32423, - "src": "1278:11:36", + "referencedDeclaration": 32425, + "src": "4611:11:36", "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_enum$_TreeChange_$32413_$_t_uint256_$returns$__$", + "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_enum$_TreeChange_$32415_$_t_uint256_$returns$__$", "typeString": "function (uint256,enum MockWorldIDIdentityManager.TreeChange,uint256)" } }, - "id": 32451, + "id": 32500, "isConstant": false, "isLValue": false, "isPure": false, @@ -733,16 +1457,16 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "1278:52:36", + "src": "4611:52:36", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 32452, + "id": 32501, "nodeType": "EmitStatement", - "src": "1273:57:36" + "src": "4606:57:36" } ] }, @@ -751,20 +1475,20 @@ "kind": "function", "modifiers": [], "name": "insertRoot", - "nameLocation": "1155:10:36", + "nameLocation": "4488:10:36", "parameters": { - "id": 32436, + "id": 32485, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 32435, + "id": 32484, "mutability": "mutable", "name": "postRoot", - "nameLocation": "1174:8:36", + "nameLocation": "4507:8:36", "nodeType": "VariableDeclaration", - "scope": 32454, - "src": "1166:16:36", + "scope": 32503, + "src": "4499:16:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -772,10 +1496,10 @@ "typeString": "uint256" }, "typeName": { - "id": 32434, + "id": 32483, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "1166:7:36", + "src": "4499:7:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -784,47 +1508,47 @@ "visibility": "internal" } ], - "src": "1165:18:36" + "src": "4498:18:36" }, "returnParameters": { - "id": 32437, + "id": 32486, "nodeType": "ParameterList", "parameters": [], - "src": "1191:0:36" + "src": "4524:0:36" }, - "scope": 32463, + "scope": 32512, "stateMutability": "nonpayable", "virtual": false, "visibility": "public" }, { - "id": 32462, + "id": 32511, "nodeType": "FunctionDefinition", - "src": "1343:89:36", + "src": "4676:89:36", "nodes": [], "body": { - "id": 32461, + "id": 32510, "nodeType": "Block", - "src": "1397:35:36", + "src": "4730:35:36", "nodes": [], "statements": [ { "expression": { - "id": 32459, + "id": 32508, "name": "_latestRoot", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 32410, - "src": "1414:11:36", + "referencedDeclaration": 32412, + "src": "4747:11:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "functionReturnParameters": 32458, - "id": 32460, + "functionReturnParameters": 32507, + "id": 32509, "nodeType": "Return", - "src": "1407:18:36" + "src": "4740:18:36" } ] }, @@ -836,26 +1560,26 @@ "kind": "function", "modifiers": [], "name": "latestRoot", - "nameLocation": "1352:10:36", + "nameLocation": "4685:10:36", "parameters": { - "id": 32455, + "id": 32504, "nodeType": "ParameterList", "parameters": [], - "src": "1362:2:36" + "src": "4695:2:36" }, "returnParameters": { - "id": 32458, + "id": 32507, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 32457, + "id": 32506, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", - "scope": 32462, - "src": "1388:7:36", + "scope": 32511, + "src": "4721:7:36", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -863,10 +1587,10 @@ "typeString": "uint256" }, "typeName": { - "id": 32456, + "id": 32505, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "1388:7:36", + "src": "4721:7:36", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -875,9 +1599,9 @@ "visibility": "internal" } ], - "src": "1387:9:36" + "src": "4720:9:36" }, - "scope": 32463, + "scope": 32512, "stateMutability": "view", "virtual": false, "visibility": "external" @@ -887,13 +1611,13 @@ "baseContracts": [ { "baseName": { - "id": 32407, + "id": 32409, "name": "IWorldIDIdentityManager", "nodeType": "IdentifierPath", "referencedDeclaration": 32276, "src": "420:23:36" }, - "id": 32408, + "id": 32410, "nodeType": "InheritanceSpecifier", "src": "420:23:36" } @@ -902,19 +1626,19 @@ "contractDependencies": [], "contractKind": "contract", "documentation": { - "id": 32406, + "id": 32408, "nodeType": "StructuredDocumentation", "src": "143:238:36", "text": "@title WorldID Identity Manager Mock\n @author Worldcoin\n @notice Mock of the WorldID Identity Manager contract (world-id-contracts) to test functionality on a local chain\n @dev deployed through make mock and make local-mock" }, "fullyImplemented": true, "linearizedBaseContracts": [ - 32463, + 32512, 32276 ], "name": "MockWorldIDIdentityManager", "nameLocation": "390:26:36", - "scope": 32464, + "scope": 32513, "usedErrors": [] } ], diff --git a/crates/tree_availability/Cargo.toml b/crates/tree_availability/Cargo.toml index 1f4ec089..3ff01d9f 100644 --- a/crates/tree_availability/Cargo.toml +++ b/crates/tree_availability/Cargo.toml @@ -32,3 +32,4 @@ futures = "0.3.28" [dev-dependencies] reqwest = { version = "0.11.22", features = ["json"] } +common = {path = "../common"} diff --git a/crates/tree_availability/tests/inclusion_proof.rs b/crates/tree_availability/tests/inclusion_proof.rs index d151cdea..fc1c1ed2 100644 --- a/crates/tree_availability/tests/inclusion_proof.rs +++ b/crates/tree_availability/tests/inclusion_proof.rs @@ -1,8 +1,8 @@ use std::str::FromStr; -use std::sync::Arc; -use ethers::providers::{Http, Provider}; -use ethers::types::H160; +use common::test_utilities::chain_mock::{spawn_mock_chain, MockChain}; +use ethers::abi::Uint; +use ethers::types::U256; use futures::stream::FuturesUnordered; use futures::StreamExt; use hyper::StatusCode; @@ -13,13 +13,84 @@ use tree_availability::TreeAvailabilityService; #[tokio::test] async fn test_inclusion_proof() -> eyre::Result<()> { - let rpc_endpoint = std::env::var("GOERLI_RPC_ENDPOINT")?; - let middleware = Arc::new(Provider::::try_from(rpc_endpoint)?); + #[allow(unused_variables)] + let MockChain { + anvil, + middleware, + mock_world_id, + .. + } = spawn_mock_chain().await?; + + //let rpc_endpoint = std::env::var("GOERLI_RPC_ENDPOINT")?; + //let middleware = Arc::new(Provider::::try_from(rpc_endpoint)?); + + //let world_tree_address = + // H160::from_str("0x78eC127A3716D447F4575E9c834d452E397EE9E1")?; + + /////////////////////////////////////////////////////////////////// + /// TEST DATA /// + /////////////////////////////////////////////////////////////////// + let insertion_start_index = 0; + + // Taken from https://github.com/worldcoin/world-id-contracts/blob/main/src/test/identity-manager/WorldIDIdentityManagerTest.sol + let insertion_pre_root = U256::from_str( + "0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323", + )?; + + let insertion_post_root = U256::from_str( + "0x193289951bec3e4a099d9f1b0fb22cf20fe9dc4ea75c253352f22848b08c888b", + )?; + + let identity_commitments = + vec![U256::from(1), U256::from(2), U256::from(3)]; + + // proof is ignored in MockWorldIDIdentityManager + let mock_insertion_proof: [U256; 8] = [ + U256::from_str("0x12bca28c242e87a12637280e957ee6eefa29446e11cd4e49f86df9fd320fbdba")?, + U256::from_str("0x1f399a7953de230a6da3a70e49c284b60ee5040cd71ee668994f70f49ff73489")?, + U256::from_str("0x9b28c42a4b34507ae0ae61f72342888b64a2f89c1c45e2e897a53ee2b946406")?, + U256::from_str("0x28a5825073e62d01c9f5c8172664349180df8a09d68026a29df91500964a0a72")?, + U256::from_str("0x24356f7d8e4565514fc8a575834b6b37bd7df399ae99424187f30591557e4c4a")?, + U256::from_str("0x177dc415a6d6e866c0125a0f73f41e7a5b291f18a90864e5fbe106c67df82f67")?, + U256::from_str("0x1fb872833d2373abaa26cca40f498b878cef8134cae18cc703e68f99b9938fa5")?, + U256::from_str("0x1487bc571a30416ad9124f5f8ef9e2efe5a0d720a710f6abf0095004f250b306")?, + ]; + + let deletion_pre_root = U256::from_str( + "0x18cb13df3e79b9f847a1494d0a2e6f3cc0041d9cae7e5ccb8cd1852ecdc4af58", + )?; + + let deletion_post_root = U256::from_str( + "0x82fcf94594d7363636338e2c29242cc77e3d04f36c8ad64d294d2ab4d251708", + )?; + + // proof is ignored in MockWorldIDIdentityManager + let mock_deletion_proof: [U256;8] = [ + U256::from_str("0x19233cf0c60aa740585125dd5936462b1795bc2c8da7b9d0b7e92392cf91e1fd")?, + U256::from_str("0x244096da06de365f3bd8e7f428c2de4214096c4cd0feeba579642435ab15e90a")?, + U256::from_str("0x107395cd3aa9bfe3bcaada7f171d43a1ffffd576325598e2b9c8fbe1cfd6d032")?, + U256::from_str("0xac23f21fb0376055adeee2a78491ca13afc288c63c6450d0ce6ded6fda14344")?, + U256::from_str("0x29022f4cf64701ff88807430b9e333d87c670a4bdfe7d495d76271044a2d3711")?, + U256::from_str("0x134e41bef89e02289885852b368395b1b679dd243e5cf9e2f36b04ba990ab6a2")?, + U256::from_str("0x280894db66e6a9f9bf8aa48ffa1de98b755adadcf5962fb308cd1802a1101a0c")?, + U256::from_str("0x1484814b74243a07930c6af61079f94eefd843efe95e2388d9d49956cfacf3ab")?, + ]; + + mock_world_id + .register_identities( + mock_insertion_proof, + insertion_pre_root, + insertion_start_index, + identity_commitments, + insertion_post_root, + ) + .send() + .await? + .await?; - let world_tree_address = - H160::from_str("0x78eC127A3716D447F4575E9c834d452E397EE9E1")?; + let world_tree_address = mock_world_id.address(); - let world_tree_creation_block = 9888280; + let world_tree_creation_block = 0; let tree_availability_service = TreeAvailabilityService::new( 30, From e071b00144945b684add9a26d5a3237c7b799653 Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Thu, 26 Oct 2023 12:18:38 -0400 Subject: [PATCH 02/26] added deserialization for InclusionProof --- crates/tree_availability/src/server.rs | 28 +++++++- .../src/world_tree/tree_updater.rs | 68 +++++++++++-------- .../tests/inclusion_proof.rs | 22 +++--- 3 files changed, 78 insertions(+), 40 deletions(-) diff --git a/crates/tree_availability/src/server.rs b/crates/tree_availability/src/server.rs index 89a45802..a6e34ef5 100644 --- a/crates/tree_availability/src/server.rs +++ b/crates/tree_availability/src/server.rs @@ -6,9 +6,11 @@ use axum::http::StatusCode; use axum::response::IntoResponse; use axum::Json; use ethers::providers::Middleware; -use semaphore::poseidon_tree::Proof; +use semaphore::poseidon_tree::{Branch, PoseidonHash, Proof}; use semaphore::Field; -use serde::{Deserialize, Serialize}; +use serde::de::Error; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_json::Value; use crate::error::TreeError; use crate::world_tree::{Hash, WorldTree}; @@ -32,10 +34,11 @@ impl InclusionProofRequest { } } -#[derive(Debug, Serialize)] +#[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct InclusionProof { pub root: Field, + #[serde(deserialize_with = "deserialize_proof")] pub proof: Proof, pub message: Option, } @@ -54,6 +57,25 @@ impl InclusionProof { } } +fn deserialize_proof<'de, D>(deserializer: D) -> Result +where + D: Deserializer<'de>, +{ + let value: Value = Deserialize::deserialize(deserializer)?; + if let Value::Array(array) = value { + let mut branches = vec![]; + for value in array { + let branch = serde_json::from_value::(value) + .map_err(serde::de::Error::custom)?; + branches.push(branch); + } + + Ok(semaphore::merkle_tree::Proof(branches)) + } else { + Err(D::Error::custom("Expected an array")) + } +} + pub async fn inclusion_proof( State(world_tree): State>>, Json(req): Json, diff --git a/crates/tree_availability/src/world_tree/tree_updater.rs b/crates/tree_availability/src/world_tree/tree_updater.rs index ef40a39b..31ebbf36 100644 --- a/crates/tree_availability/src/world_tree/tree_updater.rs +++ b/crates/tree_availability/src/world_tree/tree_updater.rs @@ -61,39 +61,51 @@ impl TreeUpdater { .await .map_err(TreeAvailabilityError::MiddlewareError)?; - let mut futures = FuturesOrdered::new(); - //TODO: update this to use a throttle that can be set by the user - for logs in logs.chunks(20) { - for log in logs { - futures.push_back(self.middleware.get_transaction( - log.transaction_hash.ok_or( - TreeAvailabilityError::TransactionHashNotFound, - )?, - )); + if !logs.is_empty() { + let mut futures = FuturesOrdered::new(); + //TODO: update this to use a throttle that can be set by the user + for logs in logs.chunks(20) { + for log in logs { + futures.push_back(self.middleware.get_transaction( + log.transaction_hash.ok_or( + TreeAvailabilityError::TransactionHashNotFound, + )?, + )); + } + + while let Some(transaction) = futures.next().await { + let transaction = transaction + .map_err(TreeAvailabilityError::MiddlewareError)? + .ok_or(TreeAvailabilityError::TransactionNotFound)?; + + self.sync_from_transaction(tree_data, transaction).await?; + } + + //TODO: use a better throttle + tokio::time::sleep(Duration::from_secs(1)).await; } - while let Some(transaction) = futures.next().await { - let transaction = transaction - .map_err(TreeAvailabilityError::MiddlewareError)? - .ok_or(TreeAvailabilityError::TransactionNotFound)?; + let block_number = logs + .last() + .expect("Could not get last log") + .block_number + .ok_or(TreeAvailabilityError::BlockNumberNotFound)? + .as_u64(); - self.sync_from_transaction(tree_data, transaction).await?; - } - - //TODO: use a better throttle - tokio::time::sleep(Duration::from_secs(1)).await; + self.latest_synced_block + .store(block_number, Ordering::Relaxed); + } else { + let block_number = self + .middleware + .get_block_number() + .await + .map_err(TreeAvailabilityError::MiddlewareError)? + .as_u64(); + + self.latest_synced_block + .store(block_number, Ordering::Relaxed); } - let block_number = logs - .last() - .expect("Could not get last log") - .block_number - .ok_or(TreeAvailabilityError::BlockNumberNotFound)? - .as_u64(); - - self.latest_synced_block - .store(block_number, Ordering::Relaxed); - Ok(()) } diff --git a/crates/tree_availability/tests/inclusion_proof.rs b/crates/tree_availability/tests/inclusion_proof.rs index fc1c1ed2..77720ee7 100644 --- a/crates/tree_availability/tests/inclusion_proof.rs +++ b/crates/tree_availability/tests/inclusion_proof.rs @@ -2,12 +2,13 @@ use std::str::FromStr; use common::test_utilities::chain_mock::{spawn_mock_chain, MockChain}; use ethers::abi::Uint; +use ethers::providers::Middleware; use ethers::types::U256; use futures::stream::FuturesUnordered; use futures::StreamExt; use hyper::StatusCode; use tree_availability::error::TreeAvailabilityError; -use tree_availability::server::InclusionProofRequest; +use tree_availability::server::{InclusionProof, InclusionProofRequest}; use tree_availability::world_tree::Hash; use tree_availability::TreeAvailabilityService; @@ -76,6 +77,10 @@ async fn test_inclusion_proof() -> eyre::Result<()> { U256::from_str("0x1484814b74243a07930c6af61079f94eefd843efe95e2388d9d49956cfacf3ab")?, ]; + let world_tree_address = mock_world_id.address(); + let world_tree_creation_block = + middleware.get_block_number().await?.as_u64(); + mock_world_id .register_identities( mock_insertion_proof, @@ -90,12 +95,10 @@ async fn test_inclusion_proof() -> eyre::Result<()> { let world_tree_address = mock_world_id.address(); - let world_tree_creation_block = 0; - let tree_availability_service = TreeAvailabilityService::new( - 30, - 10, - 10, + 5, + 1, + 0, world_tree_address, world_tree_creation_block, middleware, @@ -133,7 +136,7 @@ async fn test_inclusion_proof() -> eyre::Result<()> { let response = client .post("http://127.0.0.1:8080/inclusionProof") .json(&InclusionProofRequest { - identity_commitment: Hash::from(0x01), //TODO: update to use a commitment in the tree + identity_commitment: Hash::from(0x01), root: None, }) .send() @@ -141,8 +144,9 @@ async fn test_inclusion_proof() -> eyre::Result<()> { // Check response assert_eq!(response.status(), StatusCode::OK); - // let proof: Option = response.json().await?; - // assert!(proof.is_some()); + + let proof: Option = response.json().await?; + assert!(proof.is_some()); // Cleanup: Shutdown the server task server_handle.abort(); From c869dd294d0b4ac851862f3d83a4c724409af5ed Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Thu, 26 Oct 2023 19:49:36 -0400 Subject: [PATCH 03/26] updated tree history structure to only store derived tree after a sequence of updates --- .../tree_availability/src/world_tree/mod.rs | 5 +- .../src/world_tree/tree_data.rs | 433 +++++++----------- .../src/world_tree/tree_updater.rs | 2 + 3 files changed, 184 insertions(+), 256 deletions(-) diff --git a/crates/tree_availability/src/world_tree/mod.rs b/crates/tree_availability/src/world_tree/mod.rs index ead736f3..c19312ef 100644 --- a/crates/tree_availability/src/world_tree/mod.rs +++ b/crates/tree_availability/src/world_tree/mod.rs @@ -39,7 +39,10 @@ impl WorldTree { middleware: Arc, ) -> Self { Self { - tree_data: Arc::new(TreeData::new(tree, tree_history_size)), + tree_data: Arc::new(TreeData::new( + tree.derived(), + tree_history_size, + )), tree_updater: Arc::new(TreeUpdater::new( address, creation_block, diff --git a/crates/tree_availability/src/world_tree/tree_data.rs b/crates/tree_availability/src/world_tree/tree_data.rs index 5295f40d..a6f76e99 100644 --- a/crates/tree_availability/src/world_tree/tree_data.rs +++ b/crates/tree_availability/src/world_tree/tree_data.rs @@ -1,4 +1,5 @@ use std::collections::VecDeque; +use std::fmt::format; use std::ops::DerefMut; use semaphore::lazy_merkle_tree::{ @@ -11,14 +12,9 @@ use super::{Hash, PoseidonTree}; use crate::server::InclusionProof; pub struct TreeData { - pub tree: RwLock>, + pub tree: RwLock>, pub tree_history_size: usize, - // TODO: This is an inefficient representation - // we should keep a list of structs where each struct has an associated root - // that is equal to the root of the last update - // and contains a list of updates - // that way we can remove from the history entires associated with actual on-chain roots - pub tree_history: RwLock)>>, + pub tree_history: RwLock>>, //TODO: make a note that the latest is at the front } pub struct TreeUpdate { pub index: usize, @@ -26,10 +22,7 @@ pub struct TreeUpdate { } impl TreeData { - pub fn new( - tree: PoseidonTree, - tree_history_size: usize, - ) -> Self { + pub fn new(tree: PoseidonTree, tree_history_size: usize) -> Self { Self { tree_history_size, tree: RwLock::new(tree), @@ -42,106 +35,31 @@ impl TreeData { start_index: usize, identities: &[Hash], ) { - let mut history = self.tree_history.write().await; + self.cache_tree_history().await; - let Some(first_identity) = identities.get(0) else { - return; - }; - - let mut next = if history.is_empty() { - let tree = self.tree.read().await; - tree.update(start_index, first_identity) - } else { - let (_, last_history_entry) = history.back().unwrap(); - - last_history_entry.update(start_index, first_identity) - }; - - let first_update = TreeUpdate { - index: start_index, - value: *first_identity, - }; - history.push_back((first_update, next.clone())); - - for (i, identity) in identities.iter().enumerate().skip(1) { - let update = TreeUpdate { - index: start_index + i, - value: *identity, - }; - - next = next.update(start_index + i, identity); - history.push_back((update, next.clone())); + let mut tree = self.tree.write().await; + for (i, identity) in identities.iter().enumerate() { + *tree = tree.update(start_index + i, identity); } } pub async fn delete_many(&self, delete_indices: &[usize]) { - let mut history = self.tree_history.write().await; - - let Some(first_idx) = delete_indices.first() else { - return; - }; - - let mut next = if history.is_empty() { - let tree: tokio::sync::RwLockReadGuard< - '_, - LazyMerkleTree, - > = self.tree.read().await; - tree.update(*first_idx, &Hash::ZERO) - } else { - let (_, last_history_entry) = history.back().unwrap(); - - last_history_entry.update(*first_idx, &Hash::ZERO) - }; - - let first_update = TreeUpdate { - index: *first_idx, - value: Hash::ZERO, - }; - history.push_back((first_update, next.clone())); - - for idx in delete_indices.iter().skip(1) { - let update = TreeUpdate { - index: *idx, - value: Hash::ZERO, - }; + self.cache_tree_history().await; + let mut tree = self.tree.write().await; - next = next.update(*idx, &Hash::ZERO); - history.push_back((update, next.clone())); + for idx in delete_indices.iter() { + *tree = tree.update(*idx, &Hash::ZERO); } } - /// Garbage collects the tree history - /// - /// Leaves up to `self.tree_history_size` entries in `self.tree_history` - /// The deleted entries are applied to the canonical tree - /// - /// This method also recalculates the updates on top of the canonical tree - pub async fn gc(&self) { + pub async fn cache_tree_history(&self) { let mut tree_history = self.tree_history.write().await; - let mut tree = self.tree.write().await; - while tree_history.len() > self.tree_history_size { - let (update, _updated_tree) = tree_history.pop_front().unwrap(); - - take_mut::take(tree.deref_mut(), |tree| { - tree.update_with_mutation(update.index, &update.value) - }); + if tree_history.len() == self.tree_history_size { + tree_history.pop_back(); } - let mut history_drain = tree_history.drain(..); - let (first_update, _) = history_drain.next().unwrap(); - - let mut next = tree.update(first_update.index, &first_update.value); - - let mut new_history = VecDeque::new(); - new_history.push_back((first_update, next.clone())); - - for (update, _) in history_drain { - next = next.update(update.index, &update.value); - new_history.push_back((update, next.clone())); - } - - *tree_history = new_history; + tree_history.push_front(self.tree.read().await.clone()); } /// Fetches the inclusion proof of the provided identity at the given root hash @@ -157,6 +75,11 @@ impl TreeData { // If the root is not specified, use the latest root if root.is_none() { + dbg!(tree.root()); + for leaf in tree.leaves().into_iter() { + dbg!(leaf); + } + Some(InclusionProof::new( tree.root(), Self::proof(&tree, identity)?, @@ -174,8 +97,8 @@ impl TreeData { )); } else { let tree_history = self.tree_history.read().await; - // Otherwise, search the tree history for the root and use the corresponding tree - for (_, prev_tree) in tree_history.iter() { + // // Otherwise, search the tree history for the root and use the corresponding tree + for prev_tree in tree_history.iter() { if prev_tree.root() == root { return Some(InclusionProof::new( root, @@ -200,183 +123,183 @@ impl TreeData { } } -#[cfg(test)] -mod tests { - use super::*; - - const TREE_DEPTH: usize = 10; - const NUM_IDENTITIES: usize = 10; - - const TREE_HISTORY_SIZE: usize = 10; - - #[tokio::test] - async fn fetch_proof_for_latest_root() { - let poseidon_tree = PoseidonTree::::new_with_dense_prefix( - TREE_DEPTH, - TREE_DEPTH, - &Hash::ZERO, - ); - let mut ref_tree = PoseidonTree::::new_with_dense_prefix( - TREE_DEPTH, - TREE_DEPTH, - &Hash::ZERO, - ); +// #[cfg(test)] +// mod tests { +// use super::*; - let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); +// const TREE_DEPTH: usize = 10; +// const NUM_IDENTITIES: usize = 10; - let world_tree = TreeData::new(poseidon_tree, TREE_HISTORY_SIZE); +// const TREE_HISTORY_SIZE: usize = 10; - for (idx, identity) in identities.iter().enumerate() { - ref_tree = ref_tree.update_with_mutation(idx, identity); - } - - world_tree.insert_many_at(0, &identities).await; - - let root = ref_tree.root(); - - for i in 0..NUM_IDENTITIES { - let proof_from_world_tree = world_tree - .get_inclusion_proof(identities[i], Some(root)) - .await - .unwrap(); - - assert_eq!(ref_tree.proof(i), proof_from_world_tree.proof); - } - } - - #[tokio::test] - async fn fetch_proof_for_intermediate_root() { - let poseidon_tree = PoseidonTree::::new_with_dense_prefix( - TREE_DEPTH, - TREE_DEPTH, - &Hash::ZERO, - ); - - let mut ref_tree = PoseidonTree::::new_with_dense_prefix( - TREE_DEPTH, - TREE_DEPTH, - &Hash::ZERO, - ); - - let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); - - let world_tree = TreeData::new(poseidon_tree, TREE_HISTORY_SIZE); - - for (idx, identity) in identities.iter().enumerate().take(5) { - ref_tree = ref_tree.update_with_mutation(idx, identity); - } +// #[tokio::test] +// async fn fetch_proof_for_latest_root() { +// let poseidon_tree = PoseidonTree::::new_with_dense_prefix( +// TREE_DEPTH, +// TREE_DEPTH, +// &Hash::ZERO, +// ); +// let mut ref_tree = PoseidonTree::::new_with_dense_prefix( +// TREE_DEPTH, +// TREE_DEPTH, +// &Hash::ZERO, +// ); - let root = ref_tree.root(); +// let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); - // No more updates to the reference tree as we need to fetch - // the proof from an older version +// let world_tree = TreeData::new(poseidon_tree, TREE_HISTORY_SIZE); - world_tree.insert_many_at(0, &identities).await; +// for (idx, identity) in identities.iter().enumerate() { +// ref_tree = ref_tree.update_with_mutation(idx, identity); +// } - for i in 0..5 { - let proof_from_world_tree = world_tree - .get_inclusion_proof(identities[i], Some(root)) - .await - .unwrap(); +// world_tree.insert_many_at(0, &identities).await; - assert_eq!(ref_tree.proof(i), proof_from_world_tree.proof); - } - } +// let root = ref_tree.root(); - #[tokio::test] - async fn deletion_of_identities() { - let poseidon_tree = PoseidonTree::::new_with_dense_prefix( - TREE_DEPTH, - TREE_DEPTH, - &Hash::ZERO, - ); +// for i in 0..NUM_IDENTITIES { +// let proof_from_world_tree = world_tree +// .get_inclusion_proof(identities[i], Some(root)) +// .await +// .unwrap(); + +// assert_eq!(ref_tree.proof(i), proof_from_world_tree.proof); +// } +// } + +// #[tokio::test] +// async fn fetch_proof_for_intermediate_root() { +// let poseidon_tree = PoseidonTree::::new_with_dense_prefix( +// TREE_DEPTH, +// TREE_DEPTH, +// &Hash::ZERO, +// ); - let mut ref_tree = PoseidonTree::::new_with_dense_prefix( - TREE_DEPTH, - TREE_DEPTH, - &Hash::ZERO, - ); +// let mut ref_tree = PoseidonTree::::new_with_dense_prefix( +// TREE_DEPTH, +// TREE_DEPTH, +// &Hash::ZERO, +// ); - let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); +// let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); - let tree = TreeData::new(poseidon_tree, TREE_HISTORY_SIZE); +// let world_tree = TreeData::new(poseidon_tree, TREE_HISTORY_SIZE); - for (idx, identity) in identities.iter().enumerate() { - ref_tree = ref_tree.update_with_mutation(idx, identity); - } +// for (idx, identity) in identities.iter().enumerate().take(5) { +// ref_tree = ref_tree.update_with_mutation(idx, identity); +// } - tree.insert_many_at(0, &identities).await; +// let root = ref_tree.root(); - let deleted_identity_idxs = &[3, 7]; - let non_deleted_identity_idxs: Vec<_> = (0..NUM_IDENTITIES) - .filter(|idx| !deleted_identity_idxs.contains(idx)) - .collect(); +// // No more updates to the reference tree as we need to fetch +// // the proof from an older version - for idx in deleted_identity_idxs { - ref_tree = ref_tree.update_with_mutation(*idx, &Hash::ZERO); - } +// world_tree.insert_many_at(0, &identities).await; - tree.delete_many(deleted_identity_idxs).await; +// for i in 0..5 { +// let proof_from_world_tree = world_tree +// .get_inclusion_proof(identities[i], Some(root)) +// .await +// .unwrap(); + +// assert_eq!(ref_tree.proof(i), proof_from_world_tree.proof); +// } +// } + +// #[tokio::test] +// async fn deletion_of_identities() { +// let poseidon_tree = PoseidonTree::::new_with_dense_prefix( +// TREE_DEPTH, +// TREE_DEPTH, +// &Hash::ZERO, +// ); + +// let mut ref_tree = PoseidonTree::::new_with_dense_prefix( +// TREE_DEPTH, +// TREE_DEPTH, +// &Hash::ZERO, +// ); + +// let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); + +// let tree = TreeData::new(poseidon_tree, TREE_HISTORY_SIZE); + +// for (idx, identity) in identities.iter().enumerate() { +// ref_tree = ref_tree.update_with_mutation(idx, identity); +// } + +// tree.insert_many_at(0, &identities).await; + +// let deleted_identity_idxs = &[3, 7]; +// let non_deleted_identity_idxs: Vec<_> = (0..NUM_IDENTITIES) +// .filter(|idx| !deleted_identity_idxs.contains(idx)) +// .collect(); + +// for idx in deleted_identity_idxs { +// ref_tree = ref_tree.update_with_mutation(*idx, &Hash::ZERO); +// } + +// tree.delete_many(deleted_identity_idxs).await; - let root = ref_tree.root(); +// let root = ref_tree.root(); - for i in non_deleted_identity_idxs { - let proof_from_world_tree = tree - .get_inclusion_proof(identities[i], Some(root)) - .await - .unwrap(); +// for i in non_deleted_identity_idxs { +// let proof_from_world_tree = tree +// .get_inclusion_proof(identities[i], Some(root)) +// .await +// .unwrap(); - assert_eq!(ref_tree.proof(i), proof_from_world_tree.proof); - } - } +// assert_eq!(ref_tree.proof(i), proof_from_world_tree.proof); +// } +// } - #[tokio::test] - async fn fetching_proof_after_gc() { - let poseidon_tree = PoseidonTree::::new_with_dense_prefix( - TREE_DEPTH, - TREE_DEPTH, - &Hash::ZERO, - ); - let mut ref_tree = PoseidonTree::::new_with_dense_prefix( - TREE_DEPTH, - TREE_DEPTH, - &Hash::ZERO, - ); - - let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); - - // NOTE: History size is set to 2 - let tree = TreeData::new(poseidon_tree, 5); - - for (idx, identity) in identities.iter().enumerate() { - ref_tree = ref_tree.update_with_mutation(idx, identity); - } +// #[tokio::test] +// async fn fetching_proof_after_gc() { +// let poseidon_tree = PoseidonTree::::new_with_dense_prefix( +// TREE_DEPTH, +// TREE_DEPTH, +// &Hash::ZERO, +// ); +// let mut ref_tree = PoseidonTree::::new_with_dense_prefix( +// TREE_DEPTH, +// TREE_DEPTH, +// &Hash::ZERO, +// ); + +// let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); + +// // NOTE: History size is set to 2 +// let tree = TreeData::new(poseidon_tree, 5); + +// for (idx, identity) in identities.iter().enumerate() { +// ref_tree = ref_tree.update_with_mutation(idx, identity); +// } - tree.insert_many_at(0, &identities).await; +// tree.insert_many_at(0, &identities).await; - assert_eq!( - tree.tree_history.read().await.len(), - NUM_IDENTITIES, - "We should have {NUM_IDENTITIES} before GC" - ); +// assert_eq!( +// tree.tree_history.read().await.len(), +// NUM_IDENTITIES, +// "We should have {NUM_IDENTITIES} before GC" +// ); - tree.gc().await; +// tree.gc().await; - assert_eq!( - tree.tree_history.read().await.len(), - 5, - "We should have 5 entries in tree history after GC" - ); - - let root = ref_tree.root(); - - for i in 0..NUM_IDENTITIES { - let proof_from_world_tree = tree - .get_inclusion_proof(identities[i], Some(root)) - .await - .unwrap(); - - assert_eq!(ref_tree.proof(i), proof_from_world_tree.proof); - } - } -} +// assert_eq!( +// tree.tree_history.read().await.len(), +// 5, +// "We should have 5 entries in tree history after GC" +// ); + +// let root = ref_tree.root(); + +// for i in 0..NUM_IDENTITIES { +// let proof_from_world_tree = tree +// .get_inclusion_proof(identities[i], Some(root)) +// .await +// .unwrap(); + +// assert_eq!(ref_tree.proof(i), proof_from_world_tree.proof); +// } +// } +// } diff --git a/crates/tree_availability/src/world_tree/tree_updater.rs b/crates/tree_availability/src/world_tree/tree_updater.rs index 31ebbf36..0dc244ae 100644 --- a/crates/tree_availability/src/world_tree/tree_updater.rs +++ b/crates/tree_availability/src/world_tree/tree_updater.rs @@ -134,6 +134,8 @@ impl TreeUpdater { .map(|u256: U256| Hash::from_limbs(u256.0)) .collect(); + dbg!(&identities); + tree_data .insert_many_at(start_index as usize, &identities) .await; From 535bf27816220c3ea0bcb40daa01425725c67cc6 Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Thu, 26 Oct 2023 20:23:43 -0400 Subject: [PATCH 04/26] fix tests in tree_data --- .../tree_availability/src/world_tree/mod.rs | 5 +- .../src/world_tree/tree_data.rs | 288 ++++++++---------- 2 files changed, 132 insertions(+), 161 deletions(-) diff --git a/crates/tree_availability/src/world_tree/mod.rs b/crates/tree_availability/src/world_tree/mod.rs index c19312ef..ead736f3 100644 --- a/crates/tree_availability/src/world_tree/mod.rs +++ b/crates/tree_availability/src/world_tree/mod.rs @@ -39,10 +39,7 @@ impl WorldTree { middleware: Arc, ) -> Self { Self { - tree_data: Arc::new(TreeData::new( - tree.derived(), - tree_history_size, - )), + tree_data: Arc::new(TreeData::new(tree, tree_history_size)), tree_updater: Arc::new(TreeUpdater::new( address, creation_block, diff --git a/crates/tree_availability/src/world_tree/tree_data.rs b/crates/tree_availability/src/world_tree/tree_data.rs index a6f76e99..d22b4c62 100644 --- a/crates/tree_availability/src/world_tree/tree_data.rs +++ b/crates/tree_availability/src/world_tree/tree_data.rs @@ -22,10 +22,13 @@ pub struct TreeUpdate { } impl TreeData { - pub fn new(tree: PoseidonTree, tree_history_size: usize) -> Self { + pub fn new( + tree: PoseidonTree, + tree_history_size: usize, + ) -> Self { Self { tree_history_size, - tree: RwLock::new(tree), + tree: RwLock::new(tree.derived()), tree_history: RwLock::new(VecDeque::new()), } } @@ -123,183 +126,154 @@ impl TreeData { } } -// #[cfg(test)] -// mod tests { -// use super::*; +#[cfg(test)] +mod tests { + use super::*; -// const TREE_DEPTH: usize = 10; -// const NUM_IDENTITIES: usize = 10; + const TREE_DEPTH: usize = 10; + const NUM_IDENTITIES: usize = 10; -// const TREE_HISTORY_SIZE: usize = 10; + const TREE_HISTORY_SIZE: usize = 10; -// #[tokio::test] -// async fn fetch_proof_for_latest_root() { -// let poseidon_tree = PoseidonTree::::new_with_dense_prefix( -// TREE_DEPTH, -// TREE_DEPTH, -// &Hash::ZERO, -// ); -// let mut ref_tree = PoseidonTree::::new_with_dense_prefix( -// TREE_DEPTH, -// TREE_DEPTH, -// &Hash::ZERO, -// ); + #[tokio::test] + async fn test_get_inclusion_proof() { + let poseidon_tree = PoseidonTree::::new_with_dense_prefix( + TREE_DEPTH, + TREE_DEPTH, + &Hash::ZERO, + ); + let mut ref_tree = PoseidonTree::::new_with_dense_prefix( + TREE_DEPTH, + TREE_DEPTH, + &Hash::ZERO, + ); -// let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); + let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); -// let world_tree = TreeData::new(poseidon_tree, TREE_HISTORY_SIZE); + // NOTE: History size is set to 2 + let tree: TreeData = TreeData::new(poseidon_tree, 5); -// for (idx, identity) in identities.iter().enumerate() { -// ref_tree = ref_tree.update_with_mutation(idx, identity); -// } + tree.insert_many_at(0, &identities).await; -// world_tree.insert_many_at(0, &identities).await; + for (idx, identity) in identities.iter().enumerate() { + ref_tree = ref_tree.update_with_mutation(idx, identity); + } -// let root = ref_tree.root(); + assert_eq!( + tree.tree_history.read().await.len(), + 1, + "We should have 1 entry in tree history" + ); -// for i in 0..NUM_IDENTITIES { -// let proof_from_world_tree = world_tree -// .get_inclusion_proof(identities[i], Some(root)) -// .await -// .unwrap(); - -// assert_eq!(ref_tree.proof(i), proof_from_world_tree.proof); -// } -// } - -// #[tokio::test] -// async fn fetch_proof_for_intermediate_root() { -// let poseidon_tree = PoseidonTree::::new_with_dense_prefix( -// TREE_DEPTH, -// TREE_DEPTH, -// &Hash::ZERO, -// ); + let root = ref_tree.root(); -// let mut ref_tree = PoseidonTree::::new_with_dense_prefix( -// TREE_DEPTH, -// TREE_DEPTH, -// &Hash::ZERO, -// ); + for i in 0..NUM_IDENTITIES { + let proof_from_world_tree = tree + .get_inclusion_proof(identities[i], Some(root)) + .await + .unwrap(); -// let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); + assert_eq!(ref_tree.proof(i), proof_from_world_tree.proof); + } + } -// let world_tree = TreeData::new(poseidon_tree, TREE_HISTORY_SIZE); + #[tokio::test] + async fn test_get_inclusion_proof_for_intermediate_root() { + let poseidon_tree = PoseidonTree::::new_with_dense_prefix( + TREE_DEPTH, + TREE_DEPTH, + &Hash::ZERO, + ); -// for (idx, identity) in identities.iter().enumerate().take(5) { -// ref_tree = ref_tree.update_with_mutation(idx, identity); -// } + let mut ref_tree = PoseidonTree::::new_with_dense_prefix( + TREE_DEPTH, + TREE_DEPTH, + &Hash::ZERO, + ); -// let root = ref_tree.root(); + let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); -// // No more updates to the reference tree as we need to fetch -// // the proof from an older version + let world_tree = TreeData::new(poseidon_tree, TREE_HISTORY_SIZE); -// world_tree.insert_many_at(0, &identities).await; + for (idx, identity) in identities.iter().enumerate().take(5) { + ref_tree = ref_tree.update_with_mutation(idx, identity); + } -// for i in 0..5 { -// let proof_from_world_tree = world_tree -// .get_inclusion_proof(identities[i], Some(root)) -// .await -// .unwrap(); - -// assert_eq!(ref_tree.proof(i), proof_from_world_tree.proof); -// } -// } - -// #[tokio::test] -// async fn deletion_of_identities() { -// let poseidon_tree = PoseidonTree::::new_with_dense_prefix( -// TREE_DEPTH, -// TREE_DEPTH, -// &Hash::ZERO, -// ); - -// let mut ref_tree = PoseidonTree::::new_with_dense_prefix( -// TREE_DEPTH, -// TREE_DEPTH, -// &Hash::ZERO, -// ); - -// let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); - -// let tree = TreeData::new(poseidon_tree, TREE_HISTORY_SIZE); - -// for (idx, identity) in identities.iter().enumerate() { -// ref_tree = ref_tree.update_with_mutation(idx, identity); -// } - -// tree.insert_many_at(0, &identities).await; - -// let deleted_identity_idxs = &[3, 7]; -// let non_deleted_identity_idxs: Vec<_> = (0..NUM_IDENTITIES) -// .filter(|idx| !deleted_identity_idxs.contains(idx)) -// .collect(); - -// for idx in deleted_identity_idxs { -// ref_tree = ref_tree.update_with_mutation(*idx, &Hash::ZERO); -// } - -// tree.delete_many(deleted_identity_idxs).await; + let root = ref_tree.root(); -// let root = ref_tree.root(); + // No more updates to the reference tree as we need to fetch + // the proof from an older version -// for i in non_deleted_identity_idxs { -// let proof_from_world_tree = tree -// .get_inclusion_proof(identities[i], Some(root)) -// .await -// .unwrap(); + //TODO: do first update -// assert_eq!(ref_tree.proof(i), proof_from_world_tree.proof); -// } -// } + //TODO: then do second, otherwise, we dont actually have this root in root history, so you need to update to 5 and then the rest -// #[tokio::test] -// async fn fetching_proof_after_gc() { -// let poseidon_tree = PoseidonTree::::new_with_dense_prefix( -// TREE_DEPTH, -// TREE_DEPTH, -// &Hash::ZERO, -// ); -// let mut ref_tree = PoseidonTree::::new_with_dense_prefix( -// TREE_DEPTH, -// TREE_DEPTH, -// &Hash::ZERO, -// ); - -// let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); - -// // NOTE: History size is set to 2 -// let tree = TreeData::new(poseidon_tree, 5); - -// for (idx, identity) in identities.iter().enumerate() { -// ref_tree = ref_tree.update_with_mutation(idx, identity); -// } + world_tree.insert_many_at(0, &identities[0..5]).await; + world_tree.insert_many_at(5, &identities[5..]).await; -// tree.insert_many_at(0, &identities).await; + for i in 0..5 { + let proof_from_world_tree = world_tree + .get_inclusion_proof(identities[i], Some(root)) + .await + .unwrap(); + + assert_eq!(ref_tree.proof(i), proof_from_world_tree.proof); + } + } -// assert_eq!( -// tree.tree_history.read().await.len(), -// NUM_IDENTITIES, -// "We should have {NUM_IDENTITIES} before GC" -// ); + //TODO: test to test overflow + + #[tokio::test] + async fn test_inclusion_proof_after_deletions() { + let poseidon_tree = PoseidonTree::::new_with_dense_prefix( + TREE_DEPTH, + TREE_DEPTH, + &Hash::ZERO, + ); + + let mut ref_tree = PoseidonTree::::new_with_dense_prefix( + TREE_DEPTH, + TREE_DEPTH, + &Hash::ZERO, + ); + + let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); + + let tree = TreeData::new(poseidon_tree, TREE_HISTORY_SIZE); + + for (idx, identity) in identities.iter().enumerate() { + ref_tree = ref_tree.update_with_mutation(idx, identity); + } -// tree.gc().await; + tree.insert_many_at(0, &identities).await; -// assert_eq!( -// tree.tree_history.read().await.len(), -// 5, -// "We should have 5 entries in tree history after GC" -// ); - -// let root = ref_tree.root(); - -// for i in 0..NUM_IDENTITIES { -// let proof_from_world_tree = tree -// .get_inclusion_proof(identities[i], Some(root)) -// .await -// .unwrap(); - -// assert_eq!(ref_tree.proof(i), proof_from_world_tree.proof); -// } -// } -// } + let deleted_identity_idxs = &[3, 7]; + let non_deleted_identity_idxs: Vec<_> = (0..NUM_IDENTITIES) + .filter(|idx| !deleted_identity_idxs.contains(idx)) + .collect(); + + for idx in deleted_identity_idxs { + ref_tree = ref_tree.update_with_mutation(*idx, &Hash::ZERO); + } + + tree.delete_many(deleted_identity_idxs).await; + + let root = ref_tree.root(); + + for i in non_deleted_identity_idxs { + let proof_from_world_tree = tree + .get_inclusion_proof(identities[i], Some(root)) + .await + .unwrap(); + + assert_eq!(ref_tree.proof(i), proof_from_world_tree.proof); + } + + for i in deleted_identity_idxs { + let proof_from_world_tree = + tree.get_inclusion_proof(identities[*i], Some(root)).await; + + assert!(proof_from_world_tree.is_none()); + } + } +} From ba1cb7355226fe70a9f2797d9339e19dd9dc7a9c Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Thu, 26 Oct 2023 21:27:09 -0400 Subject: [PATCH 05/26] updated tree_data tests --- .../src/world_tree/tree_data.rs | 114 +++++++++--------- 1 file changed, 55 insertions(+), 59 deletions(-) diff --git a/crates/tree_availability/src/world_tree/tree_data.rs b/crates/tree_availability/src/world_tree/tree_data.rs index d22b4c62..78b87f32 100644 --- a/crates/tree_availability/src/world_tree/tree_data.rs +++ b/crates/tree_availability/src/world_tree/tree_data.rs @@ -132,35 +132,43 @@ mod tests { const TREE_DEPTH: usize = 10; const NUM_IDENTITIES: usize = 10; + const TREE_HISTORY_SIZE: usize = 5; - const TREE_HISTORY_SIZE: usize = 10; - - #[tokio::test] - async fn test_get_inclusion_proof() { + fn initialize_tree_data( + tree_depth: usize, + tree_history_size: usize, + num_identities: usize + ) -> (TreeData, PoseidonTree, Vec) { let poseidon_tree = PoseidonTree::::new_with_dense_prefix( - TREE_DEPTH, - TREE_DEPTH, + tree_depth, + tree_depth, &Hash::ZERO, ); - let mut ref_tree = PoseidonTree::::new_with_dense_prefix( - TREE_DEPTH, - TREE_DEPTH, + let ref_tree = PoseidonTree::::new_with_dense_prefix( + tree_depth, + tree_depth, &Hash::ZERO, ); - let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); + let identities: Vec<_> = (0..num_identities).map(Hash::from).collect(); - // NOTE: History size is set to 2 - let tree: TreeData = TreeData::new(poseidon_tree, 5); + let tree: TreeData = TreeData::new(poseidon_tree, tree_history_size); - tree.insert_many_at(0, &identities).await; + (tree, ref_tree, identities) + } + + #[tokio::test] + async fn test_get_inclusion_proof() { + let (tree_data, ref_tree, identities) = initialize_tree_data(TREE_DEPTH, TREE_HISTORY_SIZE, NUM_IDENTITIES) + + tree_data.insert_many_at(0, &identities).await; for (idx, identity) in identities.iter().enumerate() { ref_tree = ref_tree.update_with_mutation(idx, identity); } assert_eq!( - tree.tree_history.read().await.len(), + tree_data.tree_history.read().await.len(), 1, "We should have 1 entry in tree history" ); @@ -168,7 +176,7 @@ mod tests { let root = ref_tree.root(); for i in 0..NUM_IDENTITIES { - let proof_from_world_tree = tree + let proof_from_world_tree = tree_data .get_inclusion_proof(identities[i], Some(root)) .await .unwrap(); @@ -179,21 +187,8 @@ mod tests { #[tokio::test] async fn test_get_inclusion_proof_for_intermediate_root() { - let poseidon_tree = PoseidonTree::::new_with_dense_prefix( - TREE_DEPTH, - TREE_DEPTH, - &Hash::ZERO, - ); - - let mut ref_tree = PoseidonTree::::new_with_dense_prefix( - TREE_DEPTH, - TREE_DEPTH, - &Hash::ZERO, - ); + let (tree_data, ref_tree, identities) = initialize_tree_data(TREE_DEPTH, TREE_HISTORY_SIZE, NUM_IDENTITIES) - let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); - - let world_tree = TreeData::new(poseidon_tree, TREE_HISTORY_SIZE); for (idx, identity) in identities.iter().enumerate().take(5) { ref_tree = ref_tree.update_with_mutation(idx, identity); @@ -201,18 +196,15 @@ mod tests { let root = ref_tree.root(); - // No more updates to the reference tree as we need to fetch - // the proof from an older version - - //TODO: do first update + // Since the tree state is cached to tree history before a sequence of updates, we need to apply the first 5 updates to + // ensure that the intermediate root is in the tree history + tree_data.insert_many_at(0, &identities[0..5]).await; - //TODO: then do second, otherwise, we dont actually have this root in root history, so you need to update to 5 and then the rest - - world_tree.insert_many_at(0, &identities[0..5]).await; - world_tree.insert_many_at(5, &identities[5..]).await; + // Then you can apply the remaining updates + tree_data.insert_many_at(5, &identities[5..]).await; for i in 0..5 { - let proof_from_world_tree = world_tree + let proof_from_world_tree = tree_data .get_inclusion_proof(identities[i], Some(root)) .await .unwrap(); @@ -221,47 +213,50 @@ mod tests { } } - //TODO: test to test overflow - #[tokio::test] - async fn test_inclusion_proof_after_deletions() { - let poseidon_tree = PoseidonTree::::new_with_dense_prefix( - TREE_DEPTH, - TREE_DEPTH, - &Hash::ZERO, - ); - - let mut ref_tree = PoseidonTree::::new_with_dense_prefix( - TREE_DEPTH, - TREE_DEPTH, - &Hash::ZERO, - ); + async fn test_tree_history_capacity() { + let (tree_data, ref_tree, identities) = initialize_tree_data(TREE_DEPTH, TREE_HISTORY_SIZE, NUM_IDENTITIES) - let identities: Vec<_> = (0..NUM_IDENTITIES).map(Hash::from).collect(); + // Apply an update to the tree one identity at a time to apply all changes to the tree history cache + for (idx, identity) in identities.into_iter().enumerate() { + tree_data.insert_many_at(idx, &vec![identity]).await; + } - let tree = TreeData::new(poseidon_tree, TREE_HISTORY_SIZE); + // The tree history should not be larger than the tree history size + assert_eq!( + tree_data.tree_history.read().await.len(), + tree_data.tree_history_size, + ); + } + #[tokio::test] + async fn test_inclusion_proof_after_deletions() { + let (tree_data, ref_tree, identities) = initialize_tree_data(TREE_DEPTH, TREE_HISTORY_SIZE, NUM_IDENTITIES) + + // Apply all identity updates to the ref tree and test tree for (idx, identity) in identities.iter().enumerate() { ref_tree = ref_tree.update_with_mutation(idx, identity); } - tree.insert_many_at(0, &identities).await; + tree_data.insert_many_at(0, &identities).await; + // Initialize a vector of indices to delete let deleted_identity_idxs = &[3, 7]; let non_deleted_identity_idxs: Vec<_> = (0..NUM_IDENTITIES) .filter(|idx| !deleted_identity_idxs.contains(idx)) .collect(); + // Delete the identities at the specified indices for the ref tree and test tree for idx in deleted_identity_idxs { ref_tree = ref_tree.update_with_mutation(*idx, &Hash::ZERO); } - - tree.delete_many(deleted_identity_idxs).await; + tree_data.delete_many(deleted_identity_idxs).await; let root = ref_tree.root(); + // Ensure that an inclusion proof can be generated for all identities that were not deleted for i in non_deleted_identity_idxs { - let proof_from_world_tree = tree + let proof_from_world_tree = tree_data .get_inclusion_proof(identities[i], Some(root)) .await .unwrap(); @@ -269,9 +264,10 @@ mod tests { assert_eq!(ref_tree.proof(i), proof_from_world_tree.proof); } + // Ensure that an inclusion proof cannot be generated for deleted identities for i in deleted_identity_idxs { let proof_from_world_tree = - tree.get_inclusion_proof(identities[*i], Some(root)).await; + tree_data.get_inclusion_proof(identities[*i], Some(root)).await; assert!(proof_from_world_tree.is_none()); } From aae90159921d7370527152fc1a04f4a73e306ea1 Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Thu, 26 Oct 2023 21:28:16 -0400 Subject: [PATCH 06/26] fix: tree_data tests --- .../src/world_tree/tree_data.rs | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/crates/tree_availability/src/world_tree/tree_data.rs b/crates/tree_availability/src/world_tree/tree_data.rs index 78b87f32..6d11379f 100644 --- a/crates/tree_availability/src/world_tree/tree_data.rs +++ b/crates/tree_availability/src/world_tree/tree_data.rs @@ -137,7 +137,7 @@ mod tests { fn initialize_tree_data( tree_depth: usize, tree_history_size: usize, - num_identities: usize + num_identities: usize, ) -> (TreeData, PoseidonTree, Vec) { let poseidon_tree = PoseidonTree::::new_with_dense_prefix( tree_depth, @@ -159,8 +159,9 @@ mod tests { #[tokio::test] async fn test_get_inclusion_proof() { - let (tree_data, ref_tree, identities) = initialize_tree_data(TREE_DEPTH, TREE_HISTORY_SIZE, NUM_IDENTITIES) - + let (tree_data, mut ref_tree, identities) = + initialize_tree_data(TREE_DEPTH, TREE_HISTORY_SIZE, NUM_IDENTITIES); + tree_data.insert_many_at(0, &identities).await; for (idx, identity) in identities.iter().enumerate() { @@ -187,8 +188,8 @@ mod tests { #[tokio::test] async fn test_get_inclusion_proof_for_intermediate_root() { - let (tree_data, ref_tree, identities) = initialize_tree_data(TREE_DEPTH, TREE_HISTORY_SIZE, NUM_IDENTITIES) - + let (tree_data, mut ref_tree, identities) = + initialize_tree_data(TREE_DEPTH, TREE_HISTORY_SIZE, NUM_IDENTITIES); for (idx, identity) in identities.iter().enumerate().take(5) { ref_tree = ref_tree.update_with_mutation(idx, identity); @@ -215,7 +216,8 @@ mod tests { #[tokio::test] async fn test_tree_history_capacity() { - let (tree_data, ref_tree, identities) = initialize_tree_data(TREE_DEPTH, TREE_HISTORY_SIZE, NUM_IDENTITIES) + let (tree_data, _, identities) = + initialize_tree_data(TREE_DEPTH, TREE_HISTORY_SIZE, NUM_IDENTITIES); // Apply an update to the tree one identity at a time to apply all changes to the tree history cache for (idx, identity) in identities.into_iter().enumerate() { @@ -231,8 +233,9 @@ mod tests { #[tokio::test] async fn test_inclusion_proof_after_deletions() { - let (tree_data, ref_tree, identities) = initialize_tree_data(TREE_DEPTH, TREE_HISTORY_SIZE, NUM_IDENTITIES) - + let (tree_data, mut ref_tree, identities) = + initialize_tree_data(TREE_DEPTH, TREE_HISTORY_SIZE, NUM_IDENTITIES); + // Apply all identity updates to the ref tree and test tree for (idx, identity) in identities.iter().enumerate() { ref_tree = ref_tree.update_with_mutation(idx, identity); @@ -266,8 +269,9 @@ mod tests { // Ensure that an inclusion proof cannot be generated for deleted identities for i in deleted_identity_idxs { - let proof_from_world_tree = - tree_data.get_inclusion_proof(identities[*i], Some(root)).await; + let proof_from_world_tree = tree_data + .get_inclusion_proof(identities[*i], Some(root)) + .await; assert!(proof_from_world_tree.is_none()); } From bede5a898de1f82c84eaaebf63ff6671b933f12a Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Thu, 26 Oct 2023 23:38:22 -0400 Subject: [PATCH 07/26] patched tree syncing, updated tests to include proofs from historical roots --- bin/tree_availability_service.rs | 4 +- crates/tree_availability/src/error.rs | 5 +- crates/tree_availability/src/lib.rs | 2 - .../tree_availability/src/world_tree/abi.rs | 6 +- .../src/world_tree/tree_data.rs | 7 -- .../src/world_tree/tree_updater.rs | 46 ++++--- .../tests/inclusion_proof.rs | 118 ++++++++---------- 7 files changed, 90 insertions(+), 98 deletions(-) diff --git a/bin/tree_availability_service.rs b/bin/tree_availability_service.rs index f784edf6..c1ab4316 100644 --- a/bin/tree_availability_service.rs +++ b/bin/tree_availability_service.rs @@ -1,5 +1,3 @@ -use std::net::{IpAddr, SocketAddr}; -use std::str::FromStr; use std::sync::Arc; use clap::Parser; @@ -13,7 +11,7 @@ use tree_availability::TreeAvailabilityService; #[clap(name = "Tree Availability Service", about = "")] struct Opts { #[clap(long, help = "Depth of the World Tree")] - tree_depth: usize, //TODO: we might be able to fetch tree depth on chain somewhere + tree_depth: usize, #[clap( long, help = "Quantity of recent tree changes to cache. This allows inclusion proof requests to specify a historical root" diff --git a/crates/tree_availability/src/error.rs b/crates/tree_availability/src/error.rs index bb469d64..4a653f7b 100644 --- a/crates/tree_availability/src/error.rs +++ b/crates/tree_availability/src/error.rs @@ -9,7 +9,6 @@ pub enum TreeAvailabilityError where M: Middleware + 'static, { - // Internal errors #[error("Missing transaction on log")] MissingTransaction, #[error("Unrecognized transaction")] @@ -20,8 +19,8 @@ where BlockNumberNotFound, #[error("Transaction was not found from hash")] TransactionNotFound, - - // Third-party converted errors + #[error("Unrecognized function selector")] + UnrecognizedFunctionSelector, #[error("Middleware error")] MiddlewareError(::Error), #[error("Provider error")] diff --git a/crates/tree_availability/src/lib.rs b/crates/tree_availability/src/lib.rs index 2c2a31f8..e92619fa 100644 --- a/crates/tree_availability/src/lib.rs +++ b/crates/tree_availability/src/lib.rs @@ -54,7 +54,6 @@ impl TreeAvailabilityService { let router = axum::Router::new() .route("/inclusionProof", axum::routing::post(inclusion_proof)) .route("/synced", axum::routing::post(synced)) - // .route("/verifyProof", axum::routing::post(verify_proof)) .with_state(self.world_tree.clone()); let address = @@ -65,7 +64,6 @@ impl TreeAvailabilityService { .serve(router.into_make_service()) .await .map_err(TreeAvailabilityError::HyperError)?; - // .with_graceful_shutdown(await_shutdown()); Ok(()) }); diff --git a/crates/tree_availability/src/world_tree/abi.rs b/crates/tree_availability/src/world_tree/abi.rs index 33d306f6..e14f04ae 100644 --- a/crates/tree_availability/src/world_tree/abi.rs +++ b/crates/tree_availability/src/world_tree/abi.rs @@ -1,10 +1,14 @@ use ethers::middleware::contract::abigen; +use ethers::types::Selector; + +pub const REGISTER_IDENTITIES_SELECTOR: Selector = [34, 23, 178, 17]; +pub const DELETE_IDENTITIES_SELECTOR: Selector = [234, 16, 251, 190]; abigen!( IWorldIDIdentityManager, r#"[ event TreeChanged(uint256 indexed preRoot, uint8 indexed kind, uint256 indexed postRoot) function registerIdentities(uint256[8] calldata insertionProof, uint256 preRoot, uint32 startIndex, uint256[] calldata identityCommitments, uint256 postRoot) external - function deleteIdentities(uint256[8] calldata deletionProof, uint32 batchSize, bytes calldata packedDeletionIndices, uint256 preRoot, uint256 postRoot) external + function deleteIdentities(uint256[8] calldata deletionProof, bytes calldata packedDeletionIndices, uint256 preRoot, uint256 postRoot) external ]"#; ); diff --git a/crates/tree_availability/src/world_tree/tree_data.rs b/crates/tree_availability/src/world_tree/tree_data.rs index 6d11379f..e08daeaf 100644 --- a/crates/tree_availability/src/world_tree/tree_data.rs +++ b/crates/tree_availability/src/world_tree/tree_data.rs @@ -38,8 +38,6 @@ impl TreeData { start_index: usize, identities: &[Hash], ) { - self.cache_tree_history().await; - let mut tree = self.tree.write().await; for (i, identity) in identities.iter().enumerate() { *tree = tree.update(start_index + i, identity); @@ -78,11 +76,6 @@ impl TreeData { // If the root is not specified, use the latest root if root.is_none() { - dbg!(tree.root()); - for leaf in tree.leaves().into_iter() { - dbg!(leaf); - } - Some(InclusionProof::new( tree.root(), Self::proof(&tree, identity)?, diff --git a/crates/tree_availability/src/world_tree/tree_updater.rs b/crates/tree_availability/src/world_tree/tree_updater.rs index 0dc244ae..3b4f9c88 100644 --- a/crates/tree_availability/src/world_tree/tree_updater.rs +++ b/crates/tree_availability/src/world_tree/tree_updater.rs @@ -5,11 +5,13 @@ use std::time::Duration; use ethers::abi::AbiDecode; use ethers::contract::EthEvent; use ethers::providers::{Middleware, StreamExt}; -use ethers::types::{Log, Transaction, H160, U256}; +use ethers::types::{Bytes, Log, Selector, Transaction, H160, U256}; use futures::stream::FuturesOrdered; use super::abi::{ - DeleteIdentitiesCall, RegisterIdentitiesCall, TreeChangedFilter, + DeleteIdentitiesCall, IWorldIDIdentityManager, RegisterIdentitiesCall, + TreeChangedFilter, DELETE_IDENTITIES_SELECTOR, + REGISTER_IDENTITIES_SELECTOR, }; use super::block_scanner::BlockScanner; use super::tree_data::TreeData; @@ -63,6 +65,7 @@ impl TreeUpdater { if !logs.is_empty() { let mut futures = FuturesOrdered::new(); + //TODO: update this to use a throttle that can be set by the user for logs in logs.chunks(20) { for log in logs { @@ -78,7 +81,7 @@ impl TreeUpdater { .map_err(TreeAvailabilityError::MiddlewareError)? .ok_or(TreeAvailabilityError::TransactionNotFound)?; - self.sync_from_transaction(tree_data, transaction).await?; + self.sync_from_transaction(tree_data, &transaction).await?; } //TODO: use a better throttle @@ -112,21 +115,17 @@ impl TreeUpdater { pub async fn sync_from_transaction( &self, tree_data: &TreeData, - transaction: Transaction, + transaction: &Transaction, ) -> Result<(), TreeAvailabilityError> { - if let Ok(delete_identities_call) = - DeleteIdentitiesCall::decode(transaction.input.as_ref()) - { - let indices = unpack_indices( - delete_identities_call.packed_deletion_indices.as_ref(), - ); - let indices: Vec<_> = - indices.into_iter().map(|x| x as usize).collect(); + let calldata = &transaction.input; + + let function_selector = Selector::try_from(&calldata[0..4]) + .expect("Transaction data does not contain a function selector"); + + if function_selector == REGISTER_IDENTITIES_SELECTOR { + let register_identities_call = + RegisterIdentitiesCall::decode(calldata.as_ref())?; - tree_data.delete_many(&indices).await; - } else if let Ok(register_identities_call) = - RegisterIdentitiesCall::decode(transaction.input.as_ref()) - { let start_index = register_identities_call.start_index; let identities = register_identities_call.identity_commitments; let identities: Vec<_> = identities @@ -134,13 +133,22 @@ impl TreeUpdater { .map(|u256: U256| Hash::from_limbs(u256.0)) .collect(); - dbg!(&identities); - tree_data .insert_many_at(start_index as usize, &identities) .await; + } else if function_selector == DELETE_IDENTITIES_SELECTOR { + let delete_identities_call = + DeleteIdentitiesCall::decode(calldata.as_ref())?; + + let indices = unpack_indices( + delete_identities_call.packed_deletion_indices.as_ref(), + ); + let indices: Vec<_> = + indices.into_iter().map(|x| x as usize).collect(); + + tree_data.delete_many(&indices).await; } else { - return Err(TreeAvailabilityError::UnrecognizedTransaction); + return Err(TreeAvailabilityError::UnrecognizedFunctionSelector); } Ok(()) diff --git a/crates/tree_availability/tests/inclusion_proof.rs b/crates/tree_availability/tests/inclusion_proof.rs index 77720ee7..e5259bbe 100644 --- a/crates/tree_availability/tests/inclusion_proof.rs +++ b/crates/tree_availability/tests/inclusion_proof.rs @@ -1,7 +1,7 @@ use std::str::FromStr; use common::test_utilities::chain_mock::{spawn_mock_chain, MockChain}; -use ethers::abi::Uint; +use ethers::abi::{FunctionExt, Uint}; use ethers::providers::Middleware; use ethers::types::U256; use futures::stream::FuturesUnordered; @@ -9,12 +9,12 @@ use futures::StreamExt; use hyper::StatusCode; use tree_availability::error::TreeAvailabilityError; use tree_availability::server::{InclusionProof, InclusionProofRequest}; +use tree_availability::world_tree::tree_updater::pack_indices; use tree_availability::world_tree::Hash; use tree_availability::TreeAvailabilityService; - #[tokio::test] async fn test_inclusion_proof() -> eyre::Result<()> { - #[allow(unused_variables)] + // Initialize a new mock tree let MockChain { anvil, middleware, @@ -22,81 +22,42 @@ async fn test_inclusion_proof() -> eyre::Result<()> { .. } = spawn_mock_chain().await?; - //let rpc_endpoint = std::env::var("GOERLI_RPC_ENDPOINT")?; - //let middleware = Arc::new(Provider::::try_from(rpc_endpoint)?); - - //let world_tree_address = - // H160::from_str("0x78eC127A3716D447F4575E9c834d452E397EE9E1")?; - - /////////////////////////////////////////////////////////////////// - /// TEST DATA /// - /////////////////////////////////////////////////////////////////// - let insertion_start_index = 0; - - // Taken from https://github.com/worldcoin/world-id-contracts/blob/main/src/test/identity-manager/WorldIDIdentityManagerTest.sol - let insertion_pre_root = U256::from_str( - "0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323", - )?; - - let insertion_post_root = U256::from_str( - "0x193289951bec3e4a099d9f1b0fb22cf20fe9dc4ea75c253352f22848b08c888b", - )?; - + // Register identities let identity_commitments = vec![U256::from(1), U256::from(2), U256::from(3)]; - // proof is ignored in MockWorldIDIdentityManager - let mock_insertion_proof: [U256; 8] = [ - U256::from_str("0x12bca28c242e87a12637280e957ee6eefa29446e11cd4e49f86df9fd320fbdba")?, - U256::from_str("0x1f399a7953de230a6da3a70e49c284b60ee5040cd71ee668994f70f49ff73489")?, - U256::from_str("0x9b28c42a4b34507ae0ae61f72342888b64a2f89c1c45e2e897a53ee2b946406")?, - U256::from_str("0x28a5825073e62d01c9f5c8172664349180df8a09d68026a29df91500964a0a72")?, - U256::from_str("0x24356f7d8e4565514fc8a575834b6b37bd7df399ae99424187f30591557e4c4a")?, - U256::from_str("0x177dc415a6d6e866c0125a0f73f41e7a5b291f18a90864e5fbe106c67df82f67")?, - U256::from_str("0x1fb872833d2373abaa26cca40f498b878cef8134cae18cc703e68f99b9938fa5")?, - U256::from_str("0x1487bc571a30416ad9124f5f8ef9e2efe5a0d720a710f6abf0095004f250b306")?, - ]; - - let deletion_pre_root = U256::from_str( - "0x18cb13df3e79b9f847a1494d0a2e6f3cc0041d9cae7e5ccb8cd1852ecdc4af58", - )?; - - let deletion_post_root = U256::from_str( - "0x82fcf94594d7363636338e2c29242cc77e3d04f36c8ad64d294d2ab4d251708", - )?; - - // proof is ignored in MockWorldIDIdentityManager - let mock_deletion_proof: [U256;8] = [ - U256::from_str("0x19233cf0c60aa740585125dd5936462b1795bc2c8da7b9d0b7e92392cf91e1fd")?, - U256::from_str("0x244096da06de365f3bd8e7f428c2de4214096c4cd0feeba579642435ab15e90a")?, - U256::from_str("0x107395cd3aa9bfe3bcaada7f171d43a1ffffd576325598e2b9c8fbe1cfd6d032")?, - U256::from_str("0xac23f21fb0376055adeee2a78491ca13afc288c63c6450d0ce6ded6fda14344")?, - U256::from_str("0x29022f4cf64701ff88807430b9e333d87c670a4bdfe7d495d76271044a2d3711")?, - U256::from_str("0x134e41bef89e02289885852b368395b1b679dd243e5cf9e2f36b04ba990ab6a2")?, - U256::from_str("0x280894db66e6a9f9bf8aa48ffa1de98b755adadcf5962fb308cd1802a1101a0c")?, - U256::from_str("0x1484814b74243a07930c6af61079f94eefd843efe95e2388d9d49956cfacf3ab")?, - ]; - let world_tree_address = mock_world_id.address(); let world_tree_creation_block = middleware.get_block_number().await?.as_u64(); mock_world_id .register_identities( - mock_insertion_proof, - insertion_pre_root, - insertion_start_index, + [U256::zero(); 8], + U256::zero(), + 0, identity_commitments, - insertion_post_root, + U256::zero(), ) .send() .await? .await?; - let world_tree_address = mock_world_id.address(); + // Delete an identity + mock_world_id + .delete_identities( + [U256::zero(); 8], + pack_indices(&vec![1]).into(), + U256::zero(), + U256::zero(), + ) + .send() + .await? + .await?; + // Initialize the tree availability service + let world_tree_address = mock_world_id.address(); let tree_availability_service = TreeAvailabilityService::new( - 5, + 3, 1, 0, world_tree_address, @@ -142,13 +103,44 @@ async fn test_inclusion_proof() -> eyre::Result<()> { .send() .await?; - // Check response assert_eq!(response.status(), StatusCode::OK); let proof: Option = response.json().await?; assert!(proof.is_some()); - // Cleanup: Shutdown the server task + // Try to get an inclusion proof for an identity at a historical root + let client = reqwest::Client::new(); + let response = client + .post("http://127.0.0.1:8080/inclusionProof") + .json(&InclusionProofRequest { + identity_commitment: Hash::from(0x01), + root: Some(Hash::from_str("0x05c1e52b41a571293b30efacd2afdb7173b20cfaf1f646c4ac9f96eb75848270")?), + }) + .send() + .await?; + + assert_eq!(response.status(), StatusCode::OK); + + let proof: Option = response.json().await?; + assert!(proof.is_some()); + + // Try to get an inclusion proof for an identity that has been deleted + let client = reqwest::Client::new(); + let response = client + .post("http://127.0.0.1:8080/inclusionProof") + .json(&InclusionProofRequest { + identity_commitment: Hash::from(0x02), + root: None, + }) + .send() + .await?; + + assert_eq!(response.status(), StatusCode::OK); + + let proof: Option = response.json().await?; + assert!(proof.is_none()); + + // Cleanup the server resources server_handle.abort(); Ok(()) From bcc58633450233158507fd9931214064486ee7f5 Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Thu, 26 Oct 2023 23:44:12 -0400 Subject: [PATCH 08/26] updated test utilities --- crates/common/src/test_utilities/abi.rs | 3 --- crates/common/src/test_utilities/chain_mock.rs | 3 ++- crates/common/src/test_utilities/mod.rs | 3 --- crates/tree_availability/src/lib.rs | 3 --- 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/crates/common/src/test_utilities/abi.rs b/crates/common/src/test_utilities/abi.rs index 5edbad51..66e2c947 100644 --- a/crates/common/src/test_utilities/abi.rs +++ b/crates/common/src/test_utilities/abi.rs @@ -1,20 +1,17 @@ use ethers::prelude::abigen; -// Generates ABI interfaces for `MockWorldID` abigen!( MockWorldID, "src/test_utilities/abi/MockWorldIDIdentityManager.json", event_derives(serde::Deserialize, serde::Serialize) ); -// Generates ABI interfaces for `MockStateBridge` abigen!( MockStateBridge, "src/test_utilities/abi/MockStateBridge.json", event_derives(serde::Deserialize, serde::Serialize) ); -// Generates ABI interfaces for `MockStateBridge` abigen!( MockBridgedWorldID, "src/test_utilities/abi/MockBridgedWorldID.json", diff --git a/crates/common/src/test_utilities/chain_mock.rs b/crates/common/src/test_utilities/chain_mock.rs index 03444d47..3d413090 100644 --- a/crates/common/src/test_utilities/chain_mock.rs +++ b/crates/common/src/test_utilities/chain_mock.rs @@ -12,7 +12,8 @@ use ethers::types::{Uint8, H256, U256}; use ethers::utils::{Anvil, AnvilInstance}; use super::abi::{MockBridgedWorldID, MockStateBridge, MockWorldID}; -use super::TREE_DEPTH; + +pub const TREE_DEPTH: u8 = 30; pub type TestMiddleware = NonceManagerMiddleware< SignerMiddleware, Wallet>, diff --git a/crates/common/src/test_utilities/mod.rs b/crates/common/src/test_utilities/mod.rs index 28126a85..ab4b6f09 100644 --- a/crates/common/src/test_utilities/mod.rs +++ b/crates/common/src/test_utilities/mod.rs @@ -1,5 +1,2 @@ pub mod abi; pub mod chain_mock; - -// can be refactored into a different module -pub const TREE_DEPTH: u8 = 30; diff --git a/crates/tree_availability/src/lib.rs b/crates/tree_availability/src/lib.rs index e92619fa..7bcc49d6 100644 --- a/crates/tree_availability/src/lib.rs +++ b/crates/tree_availability/src/lib.rs @@ -76,6 +76,3 @@ impl TreeAvailabilityService { handles } } - -#[cfg(test)] -mod tests {} From 98efd4b80635fba9139c9dc5b5012f953bd24419 Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 00:19:26 -0400 Subject: [PATCH 09/26] added ci --- .github/ISSUE_TEMPLATE/BUG-FORM.yml | 17 ++++ .github/ISSUE_TEMPLATE/FEATURE-FORM.yml | 21 ++++ .github/PULL_REQUEST_TEMPLATE.md | 34 +++++++ .github/dependabot.yml | 14 +++ .github/workflows/ci.yml | 129 ++++++++++++++++++++++++ 5 files changed, 215 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/BUG-FORM.yml create mode 100644 .github/ISSUE_TEMPLATE/FEATURE-FORM.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/ISSUE_TEMPLATE/BUG-FORM.yml b/.github/ISSUE_TEMPLATE/BUG-FORM.yml new file mode 100644 index 00000000..ccdf125a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/BUG-FORM.yml @@ -0,0 +1,17 @@ +name: Bug report +description: File a bug report +labels: ["bug"] +title: "[Bug] " +body: + - type: markdown + attributes: + value: | + Please ensure that the bug has not already been filed in the issue tracker. + + Thanks for taking the time to report this bug! + - type: textarea + attributes: + label: Describe the bug + description: Please include code snippets as well if relevant. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/FEATURE-FORM.yml b/.github/ISSUE_TEMPLATE/FEATURE-FORM.yml new file mode 100644 index 00000000..c50508b4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/FEATURE-FORM.yml @@ -0,0 +1,21 @@ +name: Feature request +description: Suggest a feature +labels: ["enhancement"] +title: "[Feature] " +body: + - type: markdown + attributes: + value: | + Please ensure that the feature has not already been requested in the issue tracker. + - type: textarea + attributes: + label: Describe the feature you would like + description: + Please also describe your goals for the feature. What problems it solves, how it would + be used, etc. + validations: + required: true + - type: textarea + attributes: + label: Additional context + description: Add any other context to the feature (screenshots, resources, etc.) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..27830988 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,34 @@ + + + + +## Motivation + + + +## Solution + + + +## PR Checklist + +- [ ] Added Tests +- [ ] Added Documentation +- [ ] Breaking changes diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..f0bfcd5d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..4071c7a9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,129 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + types: [opened,synchronize,reopened] + branches: + - main + +env: + RUST_VERSION: "1.74" + NIGHTLY_VERSION: nightly-2023-08-29 + CARGO_TERM_COLOR: always + # Skip incremental build and debug info generation in CI + CARGO_INCREMENTAL: 0 + CARGO_PROFILE_DEV_DEBUG: 0 + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Install rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ env.NIGHTLY_VERSION }} + override: true + components: rustfmt, clippy + - name: Install protobuf-compiler + run: sudo apt-get install -y protobuf-compiler + - name: Cache + uses: actions/cache@v3 + continue-on-error: false + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ env.RUST_VERSION }}-${{ env.NIGHTLY_VERSION }}-cargo-lint-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ env.RUST_VERSION }}-${{ env.NIGHTLY_VERSION }}-cargo-lint- + - name: Install cargo-sort + uses: actions-rs/install@v0.1 + with: + crate: cargo-sort + version: latest + - name: Check formatting + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + - name: Check Cargo.toml formatting + run: cargo sort --check --check-format + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --locked --features "mimalloc" --all-targets + - name: Check docs + uses: actions-rs/cargo@v1 + with: + command: doc + args: --locked --features "mimalloc" --no-deps --document-private-items + + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Install rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ env.NIGHTLY_VERSION }} + override: true + - name: Install protobuf-compiler + run: sudo apt-get install -y protobuf-compiler + - name: Cache + uses: actions/cache@v3 + continue-on-error: false + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ env.RUST_VERSION }}-${{ env.NIGHTLY_VERSION }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ env.RUST_VERSION }}-${{ env.NIGHTLY_VERSION }}-cargo-test- + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + - name: Install latest nextest release + uses: taiki-e/install-action@nextest + - name: Build tests + uses: actions-rs/cargo@v1 + with: + command: nextest + args: run --workspace --features "mimalloc" --no-run + - name: Run tests + uses: actions-rs/cargo@v1 + with: + command: nextest + args: run --workspace --features "mimalloc" + + cargo-vet: + name: Vet Dependencies + runs-on: ubuntu-latest + env: + CARGO_VET_VERSION: 0.8.0 + steps: + - uses: actions/checkout@master + - name: Install Rust + run: rustup update stable && rustup default stable + - uses: actions/cache@v3 + with: + path: ${{ runner.tool_cache }}/cargo-vet + key: cargo-vet-bin-${{ env.CARGO_VET_VERSION }} + - name: Add the tool cache directory to the search path + run: echo "${{ runner.tool_cache }}/cargo-vet/bin" >> $GITHUB_PATH + - name: Ensure that the tool cache is populated with the cargo-vet binary + run: cargo install --root ${{ runner.tool_cache }}/cargo-vet --version ${{ env.CARGO_VET_VERSION }} cargo-vet + - name: Invoke cargo-vet + run: cargo vet --locked \ No newline at end of file From 2601f09481875b56dbe7484ccf8d688926be0b7d Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 00:21:43 -0400 Subject: [PATCH 10/26] cargo clippy --- crates/tree_availability/src/server.rs | 2 +- crates/tree_availability/src/world_tree/tree_data.rs | 8 ++++---- crates/tree_availability/src/world_tree/tree_updater.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/tree_availability/src/server.rs b/crates/tree_availability/src/server.rs index a6e34ef5..3fdfca48 100644 --- a/crates/tree_availability/src/server.rs +++ b/crates/tree_availability/src/server.rs @@ -6,7 +6,7 @@ use axum::http::StatusCode; use axum::response::IntoResponse; use axum::Json; use ethers::providers::Middleware; -use semaphore::poseidon_tree::{Branch, PoseidonHash, Proof}; +use semaphore::poseidon_tree::{Branch, Proof}; use semaphore::Field; use serde::de::Error; use serde::{Deserialize, Deserializer, Serialize}; diff --git a/crates/tree_availability/src/world_tree/tree_data.rs b/crates/tree_availability/src/world_tree/tree_data.rs index e08daeaf..8569c84e 100644 --- a/crates/tree_availability/src/world_tree/tree_data.rs +++ b/crates/tree_availability/src/world_tree/tree_data.rs @@ -1,11 +1,11 @@ use std::collections::VecDeque; -use std::fmt::format; -use std::ops::DerefMut; + + use semaphore::lazy_merkle_tree::{ - Canonical, Derived, LazyMerkleTree, VersionMarker, + Canonical, Derived, VersionMarker, }; -use semaphore::poseidon_tree::{PoseidonHash, Proof}; +use semaphore::poseidon_tree::{Proof}; use tokio::sync::RwLock; use super::{Hash, PoseidonTree}; diff --git a/crates/tree_availability/src/world_tree/tree_updater.rs b/crates/tree_availability/src/world_tree/tree_updater.rs index 3b4f9c88..0736fd18 100644 --- a/crates/tree_availability/src/world_tree/tree_updater.rs +++ b/crates/tree_availability/src/world_tree/tree_updater.rs @@ -5,11 +5,11 @@ use std::time::Duration; use ethers::abi::AbiDecode; use ethers::contract::EthEvent; use ethers::providers::{Middleware, StreamExt}; -use ethers::types::{Bytes, Log, Selector, Transaction, H160, U256}; +use ethers::types::{Selector, Transaction, H160, U256}; use futures::stream::FuturesOrdered; use super::abi::{ - DeleteIdentitiesCall, IWorldIDIdentityManager, RegisterIdentitiesCall, + DeleteIdentitiesCall, RegisterIdentitiesCall, TreeChangedFilter, DELETE_IDENTITIES_SELECTOR, REGISTER_IDENTITIES_SELECTOR, }; From cd7c2deb76b8ba8dda8ce11b8bfb48b6adc0bcb4 Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 00:31:01 -0400 Subject: [PATCH 11/26] updated ci --- .github/workflows/ci.yml | 4 +- Cargo.lock | 65 ++++++++++++++++++++++++++++- crates/tree_availability/Cargo.toml | 1 + 3 files changed, 66 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4071c7a9..20d0fd15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,12 +59,12 @@ jobs: - uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - args: --locked --features "mimalloc" --all-targets + args: --locked --all-targets - name: Check docs uses: actions-rs/cargo@v1 with: command: doc - args: --locked --features "mimalloc" --no-deps --document-private-items + args: --locked --no-deps --document-private-items test: name: Test diff --git a/Cargo.lock b/Cargo.lock index 07b5c1e8..39a54b72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -49,6 +49,18 @@ dependencies = [ "version_check", ] +[[package]] +name = "ahash" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.1" @@ -2254,7 +2266,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash", + "ahash 0.7.6", ] [[package]] @@ -2263,7 +2275,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.6", ] [[package]] @@ -2829,6 +2841,28 @@ dependencies = [ "autocfg", ] +[[package]] +name = "metrics" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fde3af1a009ed76a778cb84fdef9e7dbbdf5775ae3e4cc1f434a6a307f6f76c5" +dependencies = [ + "ahash 0.8.6", + "metrics-macros", + "portable-atomic", +] + +[[package]] +name = "metrics-macros" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddece26afd34c31585c74a4db0630c376df271c285d682d1e55012197830b6df" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + [[package]] name = "mime" version = "0.3.17" @@ -3417,6 +3451,12 @@ dependencies = [ "plotters-backend", ] +[[package]] +name = "portable-atomic" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b559898e0b4931ed2d3b959ab0c2da4d99cc644c4b0b1a35b4d344027f474023" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -4945,6 +4985,7 @@ dependencies = [ "eyre", "futures", "hyper", + "metrics", "reqwest", "semaphore", "serde", @@ -5768,6 +5809,26 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "zerocopy" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81ba595b9f2772fbee2312de30eeb80ec773b4cb2f1e8098db024afadda6c06f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772666c41fb6dceaf520b564b962d738a8e1a83b41bd48945f50837aed78bb1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + [[package]] name = "zeroize" version = "1.6.0" diff --git a/crates/tree_availability/Cargo.toml b/crates/tree_availability/Cargo.toml index 3ff01d9f..d70301ae 100644 --- a/crates/tree_availability/Cargo.toml +++ b/crates/tree_availability/Cargo.toml @@ -28,6 +28,7 @@ axum = "0.6.20" clap = "4.4.6" hyper = { version = "^0.14.27", features = ["server", "tcp", "http1", "http2"] } futures = "0.3.28" +metrics = "0.21.1" [dev-dependencies] From 627b84d01b2efffaf705f271c860c100e828fd3e Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 00:32:52 -0400 Subject: [PATCH 12/26] updated ci --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20d0fd15..d26b57b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,12 +101,12 @@ jobs: uses: actions-rs/cargo@v1 with: command: nextest - args: run --workspace --features "mimalloc" --no-run + args: run --workspace --no-run - name: Run tests uses: actions-rs/cargo@v1 with: command: nextest - args: run --workspace --features "mimalloc" + args: run --workspace cargo-vet: name: Vet Dependencies From d7c9209e723daa2486974f83a9c6bd679ecdc056 Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 00:48:19 -0400 Subject: [PATCH 13/26] patched tree data tests --- .../src/world_tree/tree_data.rs | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/crates/tree_availability/src/world_tree/tree_data.rs b/crates/tree_availability/src/world_tree/tree_data.rs index 8569c84e..39ed1392 100644 --- a/crates/tree_availability/src/world_tree/tree_data.rs +++ b/crates/tree_availability/src/world_tree/tree_data.rs @@ -1,11 +1,7 @@ use std::collections::VecDeque; - - -use semaphore::lazy_merkle_tree::{ - Canonical, Derived, VersionMarker, -}; -use semaphore::poseidon_tree::{Proof}; +use semaphore::lazy_merkle_tree::{Canonical, Derived, VersionMarker}; +use semaphore::poseidon_tree::Proof; use tokio::sync::RwLock; use super::{Hash, PoseidonTree}; @@ -38,6 +34,8 @@ impl TreeData { start_index: usize, identities: &[Hash], ) { + self.cache_tree_history().await; + let mut tree = self.tree.write().await; for (i, identity) in identities.iter().enumerate() { *tree = tree.update(start_index + i, identity); @@ -46,6 +44,7 @@ impl TreeData { pub async fn delete_many(&self, delete_indices: &[usize]) { self.cache_tree_history().await; + let mut tree = self.tree.write().await; for idx in delete_indices.iter() { @@ -54,13 +53,15 @@ impl TreeData { } pub async fn cache_tree_history(&self) { - let mut tree_history = self.tree_history.write().await; + if self.tree_history_size > 0 { + let mut tree_history = self.tree_history.write().await; - if tree_history.len() == self.tree_history_size { - tree_history.pop_back(); - } + if tree_history.len() == self.tree_history_size { + tree_history.pop_back(); + } - tree_history.push_front(self.tree.read().await.clone()); + tree_history.push_front(self.tree.read().await.clone()); + } } /// Fetches the inclusion proof of the provided identity at the given root hash From 7b0db939100c481f36c66f2b086cc9f82fbc7eeb Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 00:49:39 -0400 Subject: [PATCH 14/26] removed unused imports --- crates/tree_availability/tests/inclusion_proof.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/crates/tree_availability/tests/inclusion_proof.rs b/crates/tree_availability/tests/inclusion_proof.rs index e5259bbe..cf955c48 100644 --- a/crates/tree_availability/tests/inclusion_proof.rs +++ b/crates/tree_availability/tests/inclusion_proof.rs @@ -1,7 +1,6 @@ use std::str::FromStr; use common::test_utilities::chain_mock::{spawn_mock_chain, MockChain}; -use ethers::abi::{FunctionExt, Uint}; use ethers::providers::Middleware; use ethers::types::U256; use futures::stream::FuturesUnordered; @@ -16,7 +15,7 @@ use tree_availability::TreeAvailabilityService; async fn test_inclusion_proof() -> eyre::Result<()> { // Initialize a new mock tree let MockChain { - anvil, + anvil: _anvil, middleware, mock_world_id, .. @@ -26,7 +25,6 @@ async fn test_inclusion_proof() -> eyre::Result<()> { let identity_commitments = vec![U256::from(1), U256::from(2), U256::from(3)]; - let world_tree_address = mock_world_id.address(); let world_tree_creation_block = middleware.get_block_number().await?.as_u64(); From 540d97f963a7f29dbaee64c264250d9417380a1f Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 00:54:27 -0400 Subject: [PATCH 15/26] cargo fmt --- crates/state_bridge/src/bridge.rs | 13 +++++---- crates/state_bridge/tests/bridge_service.rs | 7 ++--- crates/tree_availability/Cargo.toml | 28 +++++++++---------- .../src/world_tree/tree_updater.rs | 5 ++-- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/crates/state_bridge/src/bridge.rs b/crates/state_bridge/src/bridge.rs index 64992ae7..6d57c3b3 100644 --- a/crates/state_bridge/src/bridge.rs +++ b/crates/state_bridge/src/bridge.rs @@ -1,14 +1,15 @@ use std::sync::Arc; +use ethers::middleware::contract::abigen; +use ethers::providers::Middleware; +use ethers::types::H160; use ruint::Uint; +use tokio::select; +use tokio::task::JoinHandle; use tokio::time::{Duration, Instant}; -use ethers::{ - middleware::contract::abigen, providers::Middleware, types::H160, -}; -use tokio::{select, task::JoinHandle}; - -use crate::{error::StateBridgeError, root::Hash}; +use crate::error::StateBridgeError; +use crate::root::Hash; abigen!( IStateBridge, diff --git a/crates/state_bridge/tests/bridge_service.rs b/crates/state_bridge/tests/bridge_service.rs index b54742fa..f883c283 100644 --- a/crates/state_bridge/tests/bridge_service.rs +++ b/crates/state_bridge/tests/bridge_service.rs @@ -17,14 +17,13 @@ pub use ethers::utils::{Anvil, AnvilInstance}; pub use ethers_solc::artifacts::Bytecode; pub use serde::{Deserialize, Serialize}; pub use serde_json::json; -use state_bridge::error::StateBridgeError; -pub use tokio::task::JoinHandle; -pub use tracing::{error, info, instrument}; - use state_bridge::bridge::{IBridgedWorldID, IStateBridge, StateBridge}; +use state_bridge::error::StateBridgeError; use state_bridge::root::IWorldIDIdentityManager; use state_bridge::StateBridgeService; pub use tokio::spawn; +pub use tokio::task::JoinHandle; +pub use tracing::{error, info, instrument}; #[derive(Deserialize, Serialize, Debug)] struct CompiledContract { diff --git a/crates/tree_availability/Cargo.toml b/crates/tree_availability/Cargo.toml index d70301ae..d98e06f0 100644 --- a/crates/tree_availability/Cargo.toml +++ b/crates/tree_availability/Cargo.toml @@ -4,18 +4,9 @@ version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] -serde = { version = "1.0.189", features = ["derive"] } - -serde_json = "1.0.107" -semaphore = { git = "https://github.com/worldcoin/semaphore-rs", branch = "main", features = [ - "depth_20", -] } -thiserror = "1.0.49" -tracing = "0.1.37" -tokio = { version = "1.32.0", features = ["sync", "macros"] } -take_mut = "0.2.2" +axum = "0.6.20" +clap = "4.4.6" ethers = { version = "2.0.10", features = [ "abigen", "ws", @@ -24,13 +15,20 @@ ethers = { version = "2.0.10", features = [ "openssl", ] } eyre = "0.6.8" -axum = "0.6.20" -clap = "4.4.6" -hyper = { version = "^0.14.27", features = ["server", "tcp", "http1", "http2"] } futures = "0.3.28" +hyper = { version = "^0.14.27", features = ["server", "tcp", "http1", "http2"] } metrics = "0.21.1" +semaphore = { git = "https://github.com/worldcoin/semaphore-rs", branch = "main", features = [ + "depth_20", +] } +serde = { version = "1.0.189", features = ["derive"] } +serde_json = "1.0.107" +take_mut = "0.2.2" +thiserror = "1.0.49" +tokio = { version = "1.32.0", features = ["sync", "macros"] } +tracing = "0.1.37" [dev-dependencies] +common = { path = "../common" } reqwest = { version = "0.11.22", features = ["json"] } -common = {path = "../common"} diff --git a/crates/tree_availability/src/world_tree/tree_updater.rs b/crates/tree_availability/src/world_tree/tree_updater.rs index 0736fd18..586d22e4 100644 --- a/crates/tree_availability/src/world_tree/tree_updater.rs +++ b/crates/tree_availability/src/world_tree/tree_updater.rs @@ -9,9 +9,8 @@ use ethers::types::{Selector, Transaction, H160, U256}; use futures::stream::FuturesOrdered; use super::abi::{ - DeleteIdentitiesCall, RegisterIdentitiesCall, - TreeChangedFilter, DELETE_IDENTITIES_SELECTOR, - REGISTER_IDENTITIES_SELECTOR, + DeleteIdentitiesCall, RegisterIdentitiesCall, TreeChangedFilter, + DELETE_IDENTITIES_SELECTOR, REGISTER_IDENTITIES_SELECTOR, }; use super::block_scanner::BlockScanner; use super::tree_data::TreeData; From 7f944a1c3a4949590c492b0c466e766eece8a5bf Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 01:04:16 -0400 Subject: [PATCH 16/26] cargo clippy --- crates/tree_availability/src/world_tree/tree_data.rs | 9 +++++---- crates/tree_availability/tests/inclusion_proof.rs | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/tree_availability/src/world_tree/tree_data.rs b/crates/tree_availability/src/world_tree/tree_data.rs index 39ed1392..7b7db5f8 100644 --- a/crates/tree_availability/src/world_tree/tree_data.rs +++ b/crates/tree_availability/src/world_tree/tree_data.rs @@ -170,9 +170,10 @@ mod tests { let root = ref_tree.root(); - for i in 0..NUM_IDENTITIES { + for (i, identity) in identities.iter().enumerate().take(NUM_IDENTITIES) + { let proof_from_world_tree = tree_data - .get_inclusion_proof(identities[i], Some(root)) + .get_inclusion_proof(*identity, Some(root)) .await .unwrap(); @@ -198,7 +199,7 @@ mod tests { // Then you can apply the remaining updates tree_data.insert_many_at(5, &identities[5..]).await; - for i in 0..5 { + for (i, identity) in identities.iter().enumerate().take(5) { let proof_from_world_tree = tree_data .get_inclusion_proof(identities[i], Some(root)) .await @@ -215,7 +216,7 @@ mod tests { // Apply an update to the tree one identity at a time to apply all changes to the tree history cache for (idx, identity) in identities.into_iter().enumerate() { - tree_data.insert_many_at(idx, &vec![identity]).await; + tree_data.insert_many_at(idx, &[identity]).await; } // The tree history should not be larger than the tree history size diff --git a/crates/tree_availability/tests/inclusion_proof.rs b/crates/tree_availability/tests/inclusion_proof.rs index cf955c48..dec96f6e 100644 --- a/crates/tree_availability/tests/inclusion_proof.rs +++ b/crates/tree_availability/tests/inclusion_proof.rs @@ -44,7 +44,7 @@ async fn test_inclusion_proof() -> eyre::Result<()> { mock_world_id .delete_identities( [U256::zero(); 8], - pack_indices(&vec![1]).into(), + pack_indices(&[1]).into(), U256::zero(), U256::zero(), ) From 788e56385581831e875b58d894514d20b9330807 Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 01:15:43 -0400 Subject: [PATCH 17/26] added tree history size to inclusion proof test --- crates/tree_availability/src/world_tree/tree_data.rs | 6 +++--- crates/tree_availability/tests/inclusion_proof.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/tree_availability/src/world_tree/tree_data.rs b/crates/tree_availability/src/world_tree/tree_data.rs index 7b7db5f8..f4542510 100644 --- a/crates/tree_availability/src/world_tree/tree_data.rs +++ b/crates/tree_availability/src/world_tree/tree_data.rs @@ -53,7 +53,7 @@ impl TreeData { } pub async fn cache_tree_history(&self) { - if self.tree_history_size > 0 { + if self.tree_history_size != 0 { let mut tree_history = self.tree_history.write().await; if tree_history.len() == self.tree_history_size { @@ -199,7 +199,7 @@ mod tests { // Then you can apply the remaining updates tree_data.insert_many_at(5, &identities[5..]).await; - for (i, identity) in identities.iter().enumerate().take(5) { + for (i, _identity) in identities.iter().enumerate().take(5) { let proof_from_world_tree = tree_data .get_inclusion_proof(identities[i], Some(root)) .await @@ -227,7 +227,7 @@ mod tests { } #[tokio::test] - async fn test_inclusion_proof_after_deletions() { + async fn test_get_inclusion_proof_after_deletions() { let (tree_data, mut ref_tree, identities) = initialize_tree_data(TREE_DEPTH, TREE_HISTORY_SIZE, NUM_IDENTITIES); diff --git a/crates/tree_availability/tests/inclusion_proof.rs b/crates/tree_availability/tests/inclusion_proof.rs index dec96f6e..50b57f34 100644 --- a/crates/tree_availability/tests/inclusion_proof.rs +++ b/crates/tree_availability/tests/inclusion_proof.rs @@ -26,7 +26,7 @@ async fn test_inclusion_proof() -> eyre::Result<()> { vec![U256::from(1), U256::from(2), U256::from(3)]; let world_tree_creation_block = - middleware.get_block_number().await?.as_u64(); + middleware.get_block_number().await?.as_u64() - 1; mock_world_id .register_identities( @@ -57,7 +57,7 @@ async fn test_inclusion_proof() -> eyre::Result<()> { let tree_availability_service = TreeAvailabilityService::new( 3, 1, - 0, + 5, world_tree_address, world_tree_creation_block, middleware, From 87b017c84c2db4e98b3a2657fed6aa89311bf6ec Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 01:16:39 -0400 Subject: [PATCH 18/26] cargo sort --- Cargo.toml | 12 +++++------- crates/sequencer/Cargo.toml | 1 - crates/state_bridge/Cargo.toml | 27 +++++++++++++-------------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7aaf1026..311c1eb6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,27 +2,25 @@ name = "identity-sequencer" version = "0.1.0" edition = "2021" - # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [workspace] members = [ + "crates/common" +, "crates/sequencer", - "crates/tree_availability", "crates/state_bridge", - "crates/common" -] + "crates/tree_availability"] [dependencies] -clap = {version = "4.4.6", features = ["derive"]} +clap = { version = "4.4.6", features = ["derive"] } ethers = "2.0.10" eyre = "0.6.8" futures = "0.3.28" reqwest = "0.11.22" -tokio = { version = "1.33.0", features = ["full"]} +tokio = { version = "1.33.0", features = ["full"] } tree_availability = { path = "crates/tree_availability" } - [[bin]] name = "tree-availability-service" path = "bin/tree_availability_service.rs" diff --git a/crates/sequencer/Cargo.toml b/crates/sequencer/Cargo.toml index 480be02b..f51150fa 100644 --- a/crates/sequencer/Cargo.toml +++ b/crates/sequencer/Cargo.toml @@ -2,7 +2,6 @@ name = "sequencer" version = "0.1.0" edition = "2021" - # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/crates/state_bridge/Cargo.toml b/crates/state_bridge/Cargo.toml index bac609a9..4785f3e1 100644 --- a/crates/state_bridge/Cargo.toml +++ b/crates/state_bridge/Cargo.toml @@ -2,21 +2,11 @@ name = "state_bridge" version = "0.1.0" edition = "2021" - # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -serde = "1.0.188" -serde_json = "1.0.107" -semaphore = { git = "https://github.com/worldcoin/semaphore-rs", branch = "main", features = [ - "depth_20", -] } -thiserror = "1.0.49" -tracing = "0.1.37" +anyhow = "1.0.75" chrono = { version = "0.4.31", features = ["serde"] } # TODO: maybe remove this -tokio = {version = "1.32.0", features = ["sync","test-util","macros"]} -take_mut = "0.2.2" -ethers-solc = { git = "https://github.com/gakonst/ethers-rs" } ethers = { version = "2.0.10", features = [ "abigen", "ws", @@ -24,10 +14,19 @@ ethers = { version = "2.0.10", features = [ "rustls", "openssl", ] } -ruint = "1.10.1" +ethers-solc = { git = "https://github.com/gakonst/ethers-rs" } eyre = "0.6.8" -anyhow = "1.0.75" hex = "0.4.3" +ruint = "1.10.1" +semaphore = { git = "https://github.com/worldcoin/semaphore-rs", branch = "main", features = [ + "depth_20", +] } +serde = "1.0.188" +serde_json = "1.0.107" +take_mut = "0.2.2" +thiserror = "1.0.49" +tokio = { version = "1.32.0", features = ["sync","test-util","macros"] } +tracing = "0.1.37" [dev-dependencies] -common = {path = "../common"} \ No newline at end of file +common = { path = "../common" } From 62a6470ad86e85416705d6b36d91b1d85833bb12 Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 01:24:57 -0400 Subject: [PATCH 19/26] cargo vet init --- supply-chain/audits.toml | 4 + supply-chain/config.toml | 2230 +++++++++++++++++++++++++++++++++++++ supply-chain/imports.lock | 2 + 3 files changed, 2236 insertions(+) create mode 100644 supply-chain/audits.toml create mode 100644 supply-chain/config.toml create mode 100644 supply-chain/imports.lock diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml new file mode 100644 index 00000000..2772ccb2 --- /dev/null +++ b/supply-chain/audits.toml @@ -0,0 +1,4 @@ + +# cargo-vet audits file + +[audits] diff --git a/supply-chain/config.toml b/supply-chain/config.toml new file mode 100644 index 00000000..6ea8fb8b --- /dev/null +++ b/supply-chain/config.toml @@ -0,0 +1,2230 @@ + +# cargo-vet config file + +[cargo-vet] +version = "0.8" + +[policy.ark-groth16] +audit-as-crates-io = true + +[policy."ethers-core:2.0.10"] + +[policy."ethers-core:2.0.10@git:70e5f022b1bd94c26dbc85d57b5342e5e23ba8c2"] +audit-as-crates-io = true + +[policy."ethers-solc:2.0.10"] + +[policy."ethers-solc:2.0.10@git:70e5f022b1bd94c26dbc85d57b5342e5e23ba8c2"] +audit-as-crates-io = true + +[[exemptions.Inflector]] +version = "0.11.4" +criteria = "safe-to-deploy" + +[[exemptions.addr2line]] +version = "0.21.0" +criteria = "safe-to-deploy" + +[[exemptions.adler]] +version = "1.0.2" +criteria = "safe-to-deploy" + +[[exemptions.aes]] +version = "0.8.3" +criteria = "safe-to-deploy" + +[[exemptions.ahash]] +version = "0.7.6" +criteria = "safe-to-deploy" + +[[exemptions.ahash]] +version = "0.8.6" +criteria = "safe-to-deploy" + +[[exemptions.aho-corasick]] +version = "1.1.1" +criteria = "safe-to-deploy" + +[[exemptions.alloy-rlp]] +version = "0.3.3" +criteria = "safe-to-deploy" + +[[exemptions.android-tzdata]] +version = "0.1.1" +criteria = "safe-to-deploy" + +[[exemptions.android_system_properties]] +version = "0.1.5" +criteria = "safe-to-deploy" + +[[exemptions.anstream]] +version = "0.6.4" +criteria = "safe-to-deploy" + +[[exemptions.anstyle]] +version = "1.0.4" +criteria = "safe-to-deploy" + +[[exemptions.anstyle-parse]] +version = "0.2.2" +criteria = "safe-to-deploy" + +[[exemptions.anstyle-query]] +version = "1.0.0" +criteria = "safe-to-deploy" + +[[exemptions.anstyle-wincon]] +version = "3.0.1" +criteria = "safe-to-deploy" + +[[exemptions.anyhow]] +version = "1.0.75" +criteria = "safe-to-deploy" + +[[exemptions.ark-bn254]] +version = "0.3.0" +criteria = "safe-to-deploy" + +[[exemptions.ark-crypto-primitives]] +version = "0.3.0" +criteria = "safe-to-deploy" + +[[exemptions.ark-ec]] +version = "0.3.0" +criteria = "safe-to-deploy" + +[[exemptions.ark-ff]] +version = "0.3.0" +criteria = "safe-to-deploy" + +[[exemptions.ark-ff]] +version = "0.4.2" +criteria = "safe-to-deploy" + +[[exemptions.ark-ff-asm]] +version = "0.3.0" +criteria = "safe-to-deploy" + +[[exemptions.ark-ff-asm]] +version = "0.4.2" +criteria = "safe-to-deploy" + +[[exemptions.ark-ff-macros]] +version = "0.3.0" +criteria = "safe-to-deploy" + +[[exemptions.ark-ff-macros]] +version = "0.4.2" +criteria = "safe-to-deploy" + +[[exemptions.ark-groth16]] +version = "0.3.0@git:765817f77a6e14964c6f264d565b18676b11bd59" +criteria = "safe-to-deploy" + +[[exemptions.ark-poly]] +version = "0.3.0" +criteria = "safe-to-deploy" + +[[exemptions.ark-relations]] +version = "0.3.0" +criteria = "safe-to-deploy" + +[[exemptions.ark-serialize]] +version = "0.3.0" +criteria = "safe-to-deploy" + +[[exemptions.ark-serialize]] +version = "0.4.2" +criteria = "safe-to-deploy" + +[[exemptions.ark-serialize-derive]] +version = "0.3.0" +criteria = "safe-to-deploy" + +[[exemptions.ark-snark]] +version = "0.3.0" +criteria = "safe-to-deploy" + +[[exemptions.ark-std]] +version = "0.3.0" +criteria = "safe-to-deploy" + +[[exemptions.ark-std]] +version = "0.4.0" +criteria = "safe-to-deploy" + +[[exemptions.arrayvec]] +version = "0.7.4" +criteria = "safe-to-deploy" + +[[exemptions.ascii-canvas]] +version = "3.0.0" +criteria = "safe-to-deploy" + +[[exemptions.async-trait]] +version = "0.1.73" +criteria = "safe-to-deploy" + +[[exemptions.async_io_stream]] +version = "0.3.3" +criteria = "safe-to-deploy" + +[[exemptions.atty]] +version = "0.2.14" +criteria = "safe-to-deploy" + +[[exemptions.auto_impl]] +version = "1.1.0" +criteria = "safe-to-deploy" + +[[exemptions.autocfg]] +version = "1.1.0" +criteria = "safe-to-deploy" + +[[exemptions.axum]] +version = "0.6.20" +criteria = "safe-to-deploy" + +[[exemptions.axum-core]] +version = "0.3.4" +criteria = "safe-to-deploy" + +[[exemptions.backtrace]] +version = "0.3.69" +criteria = "safe-to-deploy" + +[[exemptions.base16ct]] +version = "0.2.0" +criteria = "safe-to-deploy" + +[[exemptions.base64]] +version = "0.13.1" +criteria = "safe-to-deploy" + +[[exemptions.base64]] +version = "0.21.4" +criteria = "safe-to-deploy" + +[[exemptions.base64ct]] +version = "1.6.0" +criteria = "safe-to-deploy" + +[[exemptions.bech32]] +version = "0.9.1" +criteria = "safe-to-deploy" + +[[exemptions.bincode]] +version = "1.3.3" +criteria = "safe-to-deploy" + +[[exemptions.bit-set]] +version = "0.5.3" +criteria = "safe-to-deploy" + +[[exemptions.bit-vec]] +version = "0.6.3" +criteria = "safe-to-deploy" + +[[exemptions.bitflags]] +version = "1.3.2" +criteria = "safe-to-deploy" + +[[exemptions.bitflags]] +version = "2.4.0" +criteria = "safe-to-deploy" + +[[exemptions.bitvec]] +version = "1.0.1" +criteria = "safe-to-deploy" + +[[exemptions.blake2]] +version = "0.9.2" +criteria = "safe-to-deploy" + +[[exemptions.block-buffer]] +version = "0.10.4" +criteria = "safe-to-deploy" + +[[exemptions.bs58]] +version = "0.5.0" +criteria = "safe-to-deploy" + +[[exemptions.bumpalo]] +version = "3.14.0" +criteria = "safe-to-deploy" + +[[exemptions.byte-slice-cast]] +version = "1.2.2" +criteria = "safe-to-deploy" + +[[exemptions.bytecheck]] +version = "0.6.11" +criteria = "safe-to-deploy" + +[[exemptions.bytecheck_derive]] +version = "0.6.11" +criteria = "safe-to-deploy" + +[[exemptions.byteorder]] +version = "1.4.3" +criteria = "safe-to-deploy" + +[[exemptions.bytes]] +version = "1.5.0" +criteria = "safe-to-deploy" + +[[exemptions.bzip2]] +version = "0.4.4" +criteria = "safe-to-deploy" + +[[exemptions.bzip2-sys]] +version = "0.1.11+1.0.8" +criteria = "safe-to-deploy" + +[[exemptions.camino]] +version = "1.1.6" +criteria = "safe-to-deploy" + +[[exemptions.cargo-platform]] +version = "0.1.3" +criteria = "safe-to-deploy" + +[[exemptions.cargo_metadata]] +version = "0.17.0" +criteria = "safe-to-deploy" + +[[exemptions.cast]] +version = "0.3.0" +criteria = "safe-to-deploy" + +[[exemptions.cc]] +version = "1.0.83" +criteria = "safe-to-deploy" + +[[exemptions.cfg-if]] +version = "1.0.0" +criteria = "safe-to-deploy" + +[[exemptions.chrono]] +version = "0.4.31" +criteria = "safe-to-deploy" + +[[exemptions.cipher]] +version = "0.4.4" +criteria = "safe-to-deploy" + +[[exemptions.clap]] +version = "2.34.0" +criteria = "safe-to-deploy" + +[[exemptions.clap]] +version = "4.4.6" +criteria = "safe-to-deploy" + +[[exemptions.clap_builder]] +version = "4.4.6" +criteria = "safe-to-deploy" + +[[exemptions.clap_derive]] +version = "4.4.2" +criteria = "safe-to-deploy" + +[[exemptions.clap_lex]] +version = "0.5.1" +criteria = "safe-to-deploy" + +[[exemptions.coins-bip32]] +version = "0.8.7" +criteria = "safe-to-deploy" + +[[exemptions.coins-bip39]] +version = "0.8.7" +criteria = "safe-to-deploy" + +[[exemptions.coins-core]] +version = "0.8.7" +criteria = "safe-to-deploy" + +[[exemptions.color-eyre]] +version = "0.5.11" +criteria = "safe-to-deploy" + +[[exemptions.color-eyre]] +version = "0.6.2" +criteria = "safe-to-deploy" + +[[exemptions.color-spantrace]] +version = "0.1.6" +criteria = "safe-to-deploy" + +[[exemptions.color-spantrace]] +version = "0.2.0" +criteria = "safe-to-deploy" + +[[exemptions.colorchoice]] +version = "1.0.0" +criteria = "safe-to-deploy" + +[[exemptions.combine]] +version = "4.6.6" +criteria = "safe-to-deploy" + +[[exemptions.const-hex]] +version = "1.9.0" +criteria = "safe-to-deploy" + +[[exemptions.const-oid]] +version = "0.9.5" +criteria = "safe-to-deploy" + +[[exemptions.constant_time_eq]] +version = "0.1.5" +criteria = "safe-to-deploy" + +[[exemptions.core-foundation]] +version = "0.9.3" +criteria = "safe-to-deploy" + +[[exemptions.core-foundation-sys]] +version = "0.8.4" +criteria = "safe-to-deploy" + +[[exemptions.corosensei]] +version = "0.1.4" +criteria = "safe-to-deploy" + +[[exemptions.cpufeatures]] +version = "0.2.9" +criteria = "safe-to-deploy" + +[[exemptions.cranelift-bforest]] +version = "0.82.3" +criteria = "safe-to-deploy" + +[[exemptions.cranelift-codegen]] +version = "0.82.3" +criteria = "safe-to-deploy" + +[[exemptions.cranelift-codegen-meta]] +version = "0.82.3" +criteria = "safe-to-deploy" + +[[exemptions.cranelift-codegen-shared]] +version = "0.82.3" +criteria = "safe-to-deploy" + +[[exemptions.cranelift-entity]] +version = "0.82.3" +criteria = "safe-to-deploy" + +[[exemptions.cranelift-frontend]] +version = "0.82.3" +criteria = "safe-to-deploy" + +[[exemptions.crc32fast]] +version = "1.3.2" +criteria = "safe-to-deploy" + +[[exemptions.criterion]] +version = "0.3.6" +criteria = "safe-to-deploy" + +[[exemptions.criterion-plot]] +version = "0.4.5" +criteria = "safe-to-deploy" + +[[exemptions.crossbeam-deque]] +version = "0.8.3" +criteria = "safe-to-deploy" + +[[exemptions.crossbeam-epoch]] +version = "0.9.15" +criteria = "safe-to-deploy" + +[[exemptions.crossbeam-utils]] +version = "0.8.16" +criteria = "safe-to-deploy" + +[[exemptions.crunchy]] +version = "0.2.2" +criteria = "safe-to-deploy" + +[[exemptions.crypto-bigint]] +version = "0.5.3" +criteria = "safe-to-deploy" + +[[exemptions.crypto-common]] +version = "0.1.6" +criteria = "safe-to-deploy" + +[[exemptions.crypto-mac]] +version = "0.8.0" +criteria = "safe-to-deploy" + +[[exemptions.csv]] +version = "1.2.2" +criteria = "safe-to-deploy" + +[[exemptions.csv-core]] +version = "0.1.10" +criteria = "safe-to-deploy" + +[[exemptions.ctr]] +version = "0.9.2" +criteria = "safe-to-deploy" + +[[exemptions.darling]] +version = "0.20.3" +criteria = "safe-to-deploy" + +[[exemptions.darling_core]] +version = "0.20.3" +criteria = "safe-to-deploy" + +[[exemptions.darling_macro]] +version = "0.20.3" +criteria = "safe-to-deploy" + +[[exemptions.data-encoding]] +version = "2.4.0" +criteria = "safe-to-deploy" + +[[exemptions.der]] +version = "0.7.8" +criteria = "safe-to-deploy" + +[[exemptions.deranged]] +version = "0.3.8" +criteria = "safe-to-deploy" + +[[exemptions.derivative]] +version = "2.2.0" +criteria = "safe-to-deploy" + +[[exemptions.derive_more]] +version = "0.99.17" +criteria = "safe-to-deploy" + +[[exemptions.diff]] +version = "0.1.13" +criteria = "safe-to-deploy" + +[[exemptions.digest]] +version = "0.9.0" +criteria = "safe-to-deploy" + +[[exemptions.digest]] +version = "0.10.7" +criteria = "safe-to-deploy" + +[[exemptions.dirs]] +version = "5.0.1" +criteria = "safe-to-deploy" + +[[exemptions.dirs-next]] +version = "2.0.0" +criteria = "safe-to-deploy" + +[[exemptions.dirs-sys]] +version = "0.4.1" +criteria = "safe-to-deploy" + +[[exemptions.dirs-sys-next]] +version = "0.1.2" +criteria = "safe-to-deploy" + +[[exemptions.dunce]] +version = "1.0.4" +criteria = "safe-to-deploy" + +[[exemptions.ecdsa]] +version = "0.16.8" +criteria = "safe-to-deploy" + +[[exemptions.either]] +version = "1.9.0" +criteria = "safe-to-deploy" + +[[exemptions.elliptic-curve]] +version = "0.13.5" +criteria = "safe-to-deploy" + +[[exemptions.ena]] +version = "0.14.2" +criteria = "safe-to-deploy" + +[[exemptions.encoding_rs]] +version = "0.8.33" +criteria = "safe-to-deploy" + +[[exemptions.enr]] +version = "0.9.1" +criteria = "safe-to-deploy" + +[[exemptions.enum-as-inner]] +version = "0.5.1" +criteria = "safe-to-deploy" + +[[exemptions.enum-iterator]] +version = "0.7.0" +criteria = "safe-to-deploy" + +[[exemptions.enum-iterator-derive]] +version = "0.7.0" +criteria = "safe-to-deploy" + +[[exemptions.enumset]] +version = "1.1.2" +criteria = "safe-to-deploy" + +[[exemptions.enumset_derive]] +version = "0.8.1" +criteria = "safe-to-deploy" + +[[exemptions.equivalent]] +version = "1.0.1" +criteria = "safe-to-deploy" + +[[exemptions.errno]] +version = "0.3.4" +criteria = "safe-to-deploy" + +[[exemptions.errno-dragonfly]] +version = "0.1.2" +criteria = "safe-to-deploy" + +[[exemptions.eth-keystore]] +version = "0.5.0" +criteria = "safe-to-deploy" + +[[exemptions.ethabi]] +version = "18.0.0" +criteria = "safe-to-deploy" + +[[exemptions.ethbloom]] +version = "0.13.0" +criteria = "safe-to-deploy" + +[[exemptions.ethereum-types]] +version = "0.14.1" +criteria = "safe-to-deploy" + +[[exemptions.ethers]] +version = "2.0.10" +criteria = "safe-to-deploy" + +[[exemptions.ethers-addressbook]] +version = "2.0.10" +criteria = "safe-to-deploy" + +[[exemptions.ethers-contract]] +version = "2.0.10" +criteria = "safe-to-deploy" + +[[exemptions.ethers-contract-abigen]] +version = "2.0.10" +criteria = "safe-to-deploy" + +[[exemptions.ethers-contract-derive]] +version = "2.0.10" +criteria = "safe-to-deploy" + +[[exemptions.ethers-core]] +version = "2.0.10" +criteria = "safe-to-deploy" + +[[exemptions.ethers-core]] +version = "2.0.10@git:70e5f022b1bd94c26dbc85d57b5342e5e23ba8c2" +criteria = "safe-to-deploy" + +[[exemptions.ethers-etherscan]] +version = "2.0.10" +criteria = "safe-to-deploy" + +[[exemptions.ethers-middleware]] +version = "2.0.10" +criteria = "safe-to-deploy" + +[[exemptions.ethers-providers]] +version = "2.0.10" +criteria = "safe-to-deploy" + +[[exemptions.ethers-signers]] +version = "2.0.10" +criteria = "safe-to-deploy" + +[[exemptions.ethers-solc]] +version = "2.0.10" +criteria = "safe-to-deploy" + +[[exemptions.ethers-solc]] +version = "2.0.10@git:70e5f022b1bd94c26dbc85d57b5342e5e23ba8c2" +criteria = "safe-to-deploy" + +[[exemptions.eyre]] +version = "0.6.8" +criteria = "safe-to-deploy" + +[[exemptions.fallible-iterator]] +version = "0.2.0" +criteria = "safe-to-deploy" + +[[exemptions.fastrand]] +version = "2.0.1" +criteria = "safe-to-deploy" + +[[exemptions.fastrlp]] +version = "0.3.1" +criteria = "safe-to-deploy" + +[[exemptions.ff]] +version = "0.13.0" +criteria = "safe-to-deploy" + +[[exemptions.fixed-hash]] +version = "0.8.0" +criteria = "safe-to-deploy" + +[[exemptions.fixedbitset]] +version = "0.4.2" +criteria = "safe-to-deploy" + +[[exemptions.flate2]] +version = "1.0.27" +criteria = "safe-to-deploy" + +[[exemptions.fnv]] +version = "1.0.7" +criteria = "safe-to-deploy" + +[[exemptions.foreign-types]] +version = "0.3.2" +criteria = "safe-to-deploy" + +[[exemptions.foreign-types-shared]] +version = "0.1.1" +criteria = "safe-to-deploy" + +[[exemptions.form_urlencoded]] +version = "1.2.0" +criteria = "safe-to-deploy" + +[[exemptions.fs2]] +version = "0.4.3" +criteria = "safe-to-deploy" + +[[exemptions.funty]] +version = "2.0.0" +criteria = "safe-to-deploy" + +[[exemptions.futures]] +version = "0.3.28" +criteria = "safe-to-deploy" + +[[exemptions.futures-channel]] +version = "0.3.28" +criteria = "safe-to-deploy" + +[[exemptions.futures-core]] +version = "0.3.28" +criteria = "safe-to-deploy" + +[[exemptions.futures-executor]] +version = "0.3.28" +criteria = "safe-to-deploy" + +[[exemptions.futures-io]] +version = "0.3.28" +criteria = "safe-to-deploy" + +[[exemptions.futures-locks]] +version = "0.7.1" +criteria = "safe-to-deploy" + +[[exemptions.futures-macro]] +version = "0.3.28" +criteria = "safe-to-deploy" + +[[exemptions.futures-sink]] +version = "0.3.28" +criteria = "safe-to-deploy" + +[[exemptions.futures-task]] +version = "0.3.28" +criteria = "safe-to-deploy" + +[[exemptions.futures-timer]] +version = "3.0.2" +criteria = "safe-to-deploy" + +[[exemptions.futures-util]] +version = "0.3.28" +criteria = "safe-to-deploy" + +[[exemptions.fxhash]] +version = "0.2.1" +criteria = "safe-to-deploy" + +[[exemptions.generic-array]] +version = "0.14.7" +criteria = "safe-to-deploy" + +[[exemptions.getrandom]] +version = "0.2.10" +criteria = "safe-to-deploy" + +[[exemptions.gimli]] +version = "0.26.2" +criteria = "safe-to-deploy" + +[[exemptions.gimli]] +version = "0.28.0" +criteria = "safe-to-deploy" + +[[exemptions.glob]] +version = "0.3.1" +criteria = "safe-to-deploy" + +[[exemptions.gloo-timers]] +version = "0.2.6" +criteria = "safe-to-deploy" + +[[exemptions.group]] +version = "0.13.0" +criteria = "safe-to-deploy" + +[[exemptions.h2]] +version = "0.3.21" +criteria = "safe-to-deploy" + +[[exemptions.half]] +version = "1.8.2" +criteria = "safe-to-deploy" + +[[exemptions.hashbrown]] +version = "0.11.2" +criteria = "safe-to-deploy" + +[[exemptions.hashbrown]] +version = "0.12.3" +criteria = "safe-to-deploy" + +[[exemptions.hashbrown]] +version = "0.14.1" +criteria = "safe-to-deploy" + +[[exemptions.hashers]] +version = "1.0.1" +criteria = "safe-to-deploy" + +[[exemptions.heck]] +version = "0.4.1" +criteria = "safe-to-deploy" + +[[exemptions.hermit-abi]] +version = "0.1.19" +criteria = "safe-to-deploy" + +[[exemptions.hermit-abi]] +version = "0.3.3" +criteria = "safe-to-deploy" + +[[exemptions.hex]] +version = "0.4.3" +criteria = "safe-to-deploy" + +[[exemptions.hex-literal]] +version = "0.3.4" +criteria = "safe-to-deploy" + +[[exemptions.hmac]] +version = "0.12.1" +criteria = "safe-to-deploy" + +[[exemptions.home]] +version = "0.5.5" +criteria = "safe-to-deploy" + +[[exemptions.http]] +version = "0.2.9" +criteria = "safe-to-deploy" + +[[exemptions.http-body]] +version = "0.4.5" +criteria = "safe-to-deploy" + +[[exemptions.httparse]] +version = "1.8.0" +criteria = "safe-to-deploy" + +[[exemptions.httpdate]] +version = "1.0.3" +criteria = "safe-to-deploy" + +[[exemptions.hyper]] +version = "0.14.27" +criteria = "safe-to-deploy" + +[[exemptions.hyper-rustls]] +version = "0.24.1" +criteria = "safe-to-deploy" + +[[exemptions.hyper-tls]] +version = "0.5.0" +criteria = "safe-to-deploy" + +[[exemptions.iana-time-zone]] +version = "0.1.57" +criteria = "safe-to-deploy" + +[[exemptions.iana-time-zone-haiku]] +version = "0.1.2" +criteria = "safe-to-deploy" + +[[exemptions.ident_case]] +version = "1.0.1" +criteria = "safe-to-deploy" + +[[exemptions.idna]] +version = "0.4.0" +criteria = "safe-to-deploy" + +[[exemptions.impl-codec]] +version = "0.6.0" +criteria = "safe-to-deploy" + +[[exemptions.impl-rlp]] +version = "0.3.0" +criteria = "safe-to-deploy" + +[[exemptions.impl-serde]] +version = "0.4.0" +criteria = "safe-to-deploy" + +[[exemptions.impl-trait-for-tuples]] +version = "0.2.2" +criteria = "safe-to-deploy" + +[[exemptions.indenter]] +version = "0.3.3" +criteria = "safe-to-deploy" + +[[exemptions.indexmap]] +version = "1.9.3" +criteria = "safe-to-deploy" + +[[exemptions.indexmap]] +version = "2.0.2" +criteria = "safe-to-deploy" + +[[exemptions.inout]] +version = "0.1.3" +criteria = "safe-to-deploy" + +[[exemptions.instant]] +version = "0.1.12" +criteria = "safe-to-deploy" + +[[exemptions.ipnet]] +version = "2.8.0" +criteria = "safe-to-deploy" + +[[exemptions.is-terminal]] +version = "0.4.9" +criteria = "safe-to-deploy" + +[[exemptions.itertools]] +version = "0.10.5" +criteria = "safe-to-deploy" + +[[exemptions.itertools]] +version = "0.11.0" +criteria = "safe-to-deploy" + +[[exemptions.itoa]] +version = "1.0.9" +criteria = "safe-to-deploy" + +[[exemptions.jobserver]] +version = "0.1.26" +criteria = "safe-to-deploy" + +[[exemptions.js-sys]] +version = "0.3.64" +criteria = "safe-to-deploy" + +[[exemptions.jsonwebtoken]] +version = "8.3.0" +criteria = "safe-to-deploy" + +[[exemptions.k256]] +version = "0.13.1" +criteria = "safe-to-deploy" + +[[exemptions.keccak]] +version = "0.1.4" +criteria = "safe-to-deploy" + +[[exemptions.lalrpop]] +version = "0.20.0" +criteria = "safe-to-deploy" + +[[exemptions.lalrpop-util]] +version = "0.20.0" +criteria = "safe-to-deploy" + +[[exemptions.lazy_static]] +version = "1.4.0" +criteria = "safe-to-deploy" + +[[exemptions.leb128]] +version = "0.2.5" +criteria = "safe-to-deploy" + +[[exemptions.libc]] +version = "0.2.148" +criteria = "safe-to-deploy" + +[[exemptions.libloading]] +version = "0.7.4" +criteria = "safe-to-deploy" + +[[exemptions.libm]] +version = "0.2.7" +criteria = "safe-to-deploy" + +[[exemptions.linux-raw-sys]] +version = "0.4.8" +criteria = "safe-to-deploy" + +[[exemptions.lock_api]] +version = "0.4.10" +criteria = "safe-to-deploy" + +[[exemptions.log]] +version = "0.4.20" +criteria = "safe-to-deploy" + +[[exemptions.loupe]] +version = "0.1.3" +criteria = "safe-to-deploy" + +[[exemptions.loupe-derive]] +version = "0.1.3" +criteria = "safe-to-deploy" + +[[exemptions.mach]] +version = "0.3.2" +criteria = "safe-to-deploy" + +[[exemptions.mach2]] +version = "0.4.1" +criteria = "safe-to-deploy" + +[[exemptions.matchit]] +version = "0.7.3" +criteria = "safe-to-deploy" + +[[exemptions.md-5]] +version = "0.10.6" +criteria = "safe-to-deploy" + +[[exemptions.memchr]] +version = "2.6.4" +criteria = "safe-to-deploy" + +[[exemptions.memmap2]] +version = "0.5.10" +criteria = "safe-to-deploy" + +[[exemptions.memoffset]] +version = "0.6.5" +criteria = "safe-to-deploy" + +[[exemptions.memoffset]] +version = "0.7.1" +criteria = "safe-to-deploy" + +[[exemptions.memoffset]] +version = "0.9.0" +criteria = "safe-to-deploy" + +[[exemptions.metrics]] +version = "0.21.1" +criteria = "safe-to-deploy" + +[[exemptions.metrics-macros]] +version = "0.7.0" +criteria = "safe-to-deploy" + +[[exemptions.mime]] +version = "0.3.17" +criteria = "safe-to-deploy" + +[[exemptions.miniz_oxide]] +version = "0.7.1" +criteria = "safe-to-deploy" + +[[exemptions.mio]] +version = "0.8.8" +criteria = "safe-to-deploy" + +[[exemptions.mmap-rs]] +version = "0.5.0" +criteria = "safe-to-deploy" + +[[exemptions.more-asserts]] +version = "0.2.2" +criteria = "safe-to-deploy" + +[[exemptions.native-tls]] +version = "0.2.11" +criteria = "safe-to-deploy" + +[[exemptions.new_debug_unreachable]] +version = "1.0.4" +criteria = "safe-to-deploy" + +[[exemptions.nix]] +version = "0.26.4" +criteria = "safe-to-deploy" + +[[exemptions.num]] +version = "0.4.1" +criteria = "safe-to-deploy" + +[[exemptions.num-bigint]] +version = "0.4.4" +criteria = "safe-to-deploy" + +[[exemptions.num-complex]] +version = "0.4.4" +criteria = "safe-to-deploy" + +[[exemptions.num-integer]] +version = "0.1.45" +criteria = "safe-to-deploy" + +[[exemptions.num-iter]] +version = "0.1.43" +criteria = "safe-to-deploy" + +[[exemptions.num-rational]] +version = "0.4.1" +criteria = "safe-to-deploy" + +[[exemptions.num-traits]] +version = "0.2.16" +criteria = "safe-to-deploy" + +[[exemptions.num_cpus]] +version = "1.16.0" +criteria = "safe-to-deploy" + +[[exemptions.num_enum]] +version = "0.7.0" +criteria = "safe-to-deploy" + +[[exemptions.num_enum_derive]] +version = "0.7.0" +criteria = "safe-to-deploy" + +[[exemptions.object]] +version = "0.28.4" +criteria = "safe-to-deploy" + +[[exemptions.object]] +version = "0.32.1" +criteria = "safe-to-deploy" + +[[exemptions.once_cell]] +version = "1.18.0" +criteria = "safe-to-deploy" + +[[exemptions.oorandom]] +version = "11.1.3" +criteria = "safe-to-deploy" + +[[exemptions.opaque-debug]] +version = "0.3.0" +criteria = "safe-to-deploy" + +[[exemptions.open-fastrlp]] +version = "0.1.4" +criteria = "safe-to-deploy" + +[[exemptions.open-fastrlp-derive]] +version = "0.1.1" +criteria = "safe-to-deploy" + +[[exemptions.openssl]] +version = "0.10.57" +criteria = "safe-to-deploy" + +[[exemptions.openssl-macros]] +version = "0.1.1" +criteria = "safe-to-deploy" + +[[exemptions.openssl-probe]] +version = "0.1.5" +criteria = "safe-to-deploy" + +[[exemptions.openssl-sys]] +version = "0.9.93" +criteria = "safe-to-deploy" + +[[exemptions.option-ext]] +version = "0.2.0" +criteria = "safe-to-deploy" + +[[exemptions.owo-colors]] +version = "1.3.0" +criteria = "safe-to-deploy" + +[[exemptions.owo-colors]] +version = "3.5.0" +criteria = "safe-to-deploy" + +[[exemptions.parity-scale-codec]] +version = "3.6.5" +criteria = "safe-to-deploy" + +[[exemptions.parity-scale-codec-derive]] +version = "3.6.5" +criteria = "safe-to-deploy" + +[[exemptions.parking_lot]] +version = "0.12.1" +criteria = "safe-to-deploy" + +[[exemptions.parking_lot_core]] +version = "0.9.8" +criteria = "safe-to-deploy" + +[[exemptions.password-hash]] +version = "0.4.2" +criteria = "safe-to-deploy" + +[[exemptions.paste]] +version = "1.0.14" +criteria = "safe-to-deploy" + +[[exemptions.path-slash]] +version = "0.2.1" +criteria = "safe-to-deploy" + +[[exemptions.pbkdf2]] +version = "0.11.0" +criteria = "safe-to-deploy" + +[[exemptions.pbkdf2]] +version = "0.12.2" +criteria = "safe-to-deploy" + +[[exemptions.pem]] +version = "1.1.1" +criteria = "safe-to-deploy" + +[[exemptions.percent-encoding]] +version = "2.3.0" +criteria = "safe-to-deploy" + +[[exemptions.pest]] +version = "2.7.4" +criteria = "safe-to-deploy" + +[[exemptions.petgraph]] +version = "0.6.4" +criteria = "safe-to-deploy" + +[[exemptions.pharos]] +version = "0.5.3" +criteria = "safe-to-deploy" + +[[exemptions.phf]] +version = "0.11.2" +criteria = "safe-to-deploy" + +[[exemptions.phf_generator]] +version = "0.11.2" +criteria = "safe-to-deploy" + +[[exemptions.phf_macros]] +version = "0.11.2" +criteria = "safe-to-deploy" + +[[exemptions.phf_shared]] +version = "0.10.0" +criteria = "safe-to-deploy" + +[[exemptions.phf_shared]] +version = "0.11.2" +criteria = "safe-to-deploy" + +[[exemptions.pin-project]] +version = "1.1.3" +criteria = "safe-to-deploy" + +[[exemptions.pin-project-internal]] +version = "1.1.3" +criteria = "safe-to-deploy" + +[[exemptions.pin-project-lite]] +version = "0.2.13" +criteria = "safe-to-deploy" + +[[exemptions.pin-utils]] +version = "0.1.0" +criteria = "safe-to-deploy" + +[[exemptions.pkcs8]] +version = "0.10.2" +criteria = "safe-to-deploy" + +[[exemptions.pkg-config]] +version = "0.3.27" +criteria = "safe-to-deploy" + +[[exemptions.plotters]] +version = "0.3.5" +criteria = "safe-to-deploy" + +[[exemptions.plotters-backend]] +version = "0.3.5" +criteria = "safe-to-deploy" + +[[exemptions.plotters-svg]] +version = "0.3.5" +criteria = "safe-to-deploy" + +[[exemptions.portable-atomic]] +version = "1.5.0" +criteria = "safe-to-deploy" + +[[exemptions.ppv-lite86]] +version = "0.2.17" +criteria = "safe-to-deploy" + +[[exemptions.precomputed-hash]] +version = "0.1.1" +criteria = "safe-to-deploy" + +[[exemptions.prettyplease]] +version = "0.2.15" +criteria = "safe-to-deploy" + +[[exemptions.primitive-types]] +version = "0.12.1" +criteria = "safe-to-deploy" + +[[exemptions.proc-macro-crate]] +version = "1.3.1" +criteria = "safe-to-deploy" + +[[exemptions.proc-macro-error]] +version = "1.0.4" +criteria = "safe-to-deploy" + +[[exemptions.proc-macro-error-attr]] +version = "1.0.4" +criteria = "safe-to-deploy" + +[[exemptions.proc-macro2]] +version = "1.0.67" +criteria = "safe-to-deploy" + +[[exemptions.proptest]] +version = "1.3.1" +criteria = "safe-to-deploy" + +[[exemptions.ptr_meta]] +version = "0.1.4" +criteria = "safe-to-deploy" + +[[exemptions.ptr_meta_derive]] +version = "0.1.4" +criteria = "safe-to-deploy" + +[[exemptions.quote]] +version = "1.0.33" +criteria = "safe-to-deploy" + +[[exemptions.radium]] +version = "0.7.0" +criteria = "safe-to-deploy" + +[[exemptions.rand]] +version = "0.8.5" +criteria = "safe-to-deploy" + +[[exemptions.rand_chacha]] +version = "0.3.1" +criteria = "safe-to-deploy" + +[[exemptions.rand_core]] +version = "0.6.4" +criteria = "safe-to-deploy" + +[[exemptions.rand_xorshift]] +version = "0.3.0" +criteria = "safe-to-deploy" + +[[exemptions.rayon]] +version = "1.8.0" +criteria = "safe-to-deploy" + +[[exemptions.rayon-core]] +version = "1.12.0" +criteria = "safe-to-deploy" + +[[exemptions.redox_syscall]] +version = "0.2.16" +criteria = "safe-to-deploy" + +[[exemptions.redox_syscall]] +version = "0.3.5" +criteria = "safe-to-deploy" + +[[exemptions.redox_users]] +version = "0.4.3" +criteria = "safe-to-deploy" + +[[exemptions.regalloc]] +version = "0.0.34" +criteria = "safe-to-deploy" + +[[exemptions.regex]] +version = "1.9.6" +criteria = "safe-to-deploy" + +[[exemptions.regex-automata]] +version = "0.3.9" +criteria = "safe-to-deploy" + +[[exemptions.regex-syntax]] +version = "0.7.5" +criteria = "safe-to-deploy" + +[[exemptions.region]] +version = "3.0.0" +criteria = "safe-to-deploy" + +[[exemptions.rend]] +version = "0.4.1" +criteria = "safe-to-deploy" + +[[exemptions.reqwest]] +version = "0.11.22" +criteria = "safe-to-deploy" + +[[exemptions.rfc6979]] +version = "0.4.0" +criteria = "safe-to-deploy" + +[[exemptions.ring]] +version = "0.16.20" +criteria = "safe-to-deploy" + +[[exemptions.ripemd]] +version = "0.1.3" +criteria = "safe-to-deploy" + +[[exemptions.rkyv]] +version = "0.7.42" +criteria = "safe-to-deploy" + +[[exemptions.rkyv_derive]] +version = "0.7.42" +criteria = "safe-to-deploy" + +[[exemptions.rlp]] +version = "0.5.2" +criteria = "safe-to-deploy" + +[[exemptions.rlp-derive]] +version = "0.1.0" +criteria = "safe-to-deploy" + +[[exemptions.ruint]] +version = "1.10.1" +criteria = "safe-to-deploy" + +[[exemptions.ruint-macro]] +version = "1.1.0" +criteria = "safe-to-deploy" + +[[exemptions.rustc-demangle]] +version = "0.1.23" +criteria = "safe-to-deploy" + +[[exemptions.rustc-hash]] +version = "1.1.0" +criteria = "safe-to-deploy" + +[[exemptions.rustc-hex]] +version = "2.1.0" +criteria = "safe-to-deploy" + +[[exemptions.rustc_version]] +version = "0.3.3" +criteria = "safe-to-deploy" + +[[exemptions.rustc_version]] +version = "0.4.0" +criteria = "safe-to-deploy" + +[[exemptions.rustix]] +version = "0.38.15" +criteria = "safe-to-deploy" + +[[exemptions.rustls]] +version = "0.21.7" +criteria = "safe-to-deploy" + +[[exemptions.rustls-pemfile]] +version = "1.0.3" +criteria = "safe-to-deploy" + +[[exemptions.rustls-webpki]] +version = "0.101.6" +criteria = "safe-to-deploy" + +[[exemptions.rustversion]] +version = "1.0.14" +criteria = "safe-to-deploy" + +[[exemptions.ryu]] +version = "1.0.15" +criteria = "safe-to-deploy" + +[[exemptions.salsa20]] +version = "0.10.2" +criteria = "safe-to-deploy" + +[[exemptions.same-file]] +version = "1.0.6" +criteria = "safe-to-deploy" + +[[exemptions.scale-info]] +version = "2.9.0" +criteria = "safe-to-deploy" + +[[exemptions.scale-info-derive]] +version = "2.9.0" +criteria = "safe-to-deploy" + +[[exemptions.schannel]] +version = "0.1.22" +criteria = "safe-to-deploy" + +[[exemptions.scopeguard]] +version = "1.2.0" +criteria = "safe-to-deploy" + +[[exemptions.scrypt]] +version = "0.10.0" +criteria = "safe-to-deploy" + +[[exemptions.sct]] +version = "0.7.0" +criteria = "safe-to-deploy" + +[[exemptions.seahash]] +version = "4.1.0" +criteria = "safe-to-deploy" + +[[exemptions.sec1]] +version = "0.7.3" +criteria = "safe-to-deploy" + +[[exemptions.security-framework]] +version = "2.9.2" +criteria = "safe-to-deploy" + +[[exemptions.security-framework-sys]] +version = "2.9.1" +criteria = "safe-to-deploy" + +[[exemptions.semver]] +version = "0.11.0" +criteria = "safe-to-deploy" + +[[exemptions.semver]] +version = "1.0.19" +criteria = "safe-to-deploy" + +[[exemptions.semver-parser]] +version = "0.10.2" +criteria = "safe-to-deploy" + +[[exemptions.send_wrapper]] +version = "0.4.0" +criteria = "safe-to-deploy" + +[[exemptions.send_wrapper]] +version = "0.6.0" +criteria = "safe-to-deploy" + +[[exemptions.serde]] +version = "1.0.189" +criteria = "safe-to-deploy" + +[[exemptions.serde_bytes]] +version = "0.11.12" +criteria = "safe-to-deploy" + +[[exemptions.serde_cbor]] +version = "0.11.2" +criteria = "safe-to-deploy" + +[[exemptions.serde_derive]] +version = "1.0.189" +criteria = "safe-to-deploy" + +[[exemptions.serde_json]] +version = "1.0.107" +criteria = "safe-to-deploy" + +[[exemptions.serde_path_to_error]] +version = "0.1.14" +criteria = "safe-to-deploy" + +[[exemptions.serde_spanned]] +version = "0.6.3" +criteria = "safe-to-deploy" + +[[exemptions.serde_urlencoded]] +version = "0.7.1" +criteria = "safe-to-deploy" + +[[exemptions.sha1]] +version = "0.10.6" +criteria = "safe-to-deploy" + +[[exemptions.sha2]] +version = "0.10.8" +criteria = "safe-to-deploy" + +[[exemptions.sha3]] +version = "0.10.8" +criteria = "safe-to-deploy" + +[[exemptions.sharded-slab]] +version = "0.1.6" +criteria = "safe-to-deploy" + +[[exemptions.signal-hook-registry]] +version = "1.4.1" +criteria = "safe-to-deploy" + +[[exemptions.signature]] +version = "2.1.0" +criteria = "safe-to-deploy" + +[[exemptions.simdutf8]] +version = "0.1.4" +criteria = "safe-to-deploy" + +[[exemptions.simple_asn1]] +version = "0.6.2" +criteria = "safe-to-deploy" + +[[exemptions.siphasher]] +version = "0.3.11" +criteria = "safe-to-deploy" + +[[exemptions.slab]] +version = "0.4.9" +criteria = "safe-to-deploy" + +[[exemptions.smallvec]] +version = "1.11.1" +criteria = "safe-to-deploy" + +[[exemptions.smol_str]] +version = "0.2.0" +criteria = "safe-to-deploy" + +[[exemptions.socket2]] +version = "0.4.9" +criteria = "safe-to-deploy" + +[[exemptions.socket2]] +version = "0.5.4" +criteria = "safe-to-deploy" + +[[exemptions.solang-parser]] +version = "0.3.2" +criteria = "safe-to-deploy" + +[[exemptions.spin]] +version = "0.5.2" +criteria = "safe-to-deploy" + +[[exemptions.spki]] +version = "0.7.2" +criteria = "safe-to-deploy" + +[[exemptions.stable_deref_trait]] +version = "1.2.0" +criteria = "safe-to-deploy" + +[[exemptions.static_assertions]] +version = "1.1.0" +criteria = "safe-to-deploy" + +[[exemptions.string_cache]] +version = "0.8.7" +criteria = "safe-to-deploy" + +[[exemptions.strsim]] +version = "0.10.0" +criteria = "safe-to-deploy" + +[[exemptions.strum]] +version = "0.25.0" +criteria = "safe-to-deploy" + +[[exemptions.strum_macros]] +version = "0.25.2" +criteria = "safe-to-deploy" + +[[exemptions.subtle]] +version = "2.5.0" +criteria = "safe-to-deploy" + +[[exemptions.svm-rs]] +version = "0.3.0" +criteria = "safe-to-deploy" + +[[exemptions.syn]] +version = "1.0.109" +criteria = "safe-to-deploy" + +[[exemptions.syn]] +version = "2.0.37" +criteria = "safe-to-deploy" + +[[exemptions.sync_wrapper]] +version = "0.1.2" +criteria = "safe-to-deploy" + +[[exemptions.sysctl]] +version = "0.5.4" +criteria = "safe-to-deploy" + +[[exemptions.system-configuration]] +version = "0.5.1" +criteria = "safe-to-deploy" + +[[exemptions.system-configuration-sys]] +version = "0.5.0" +criteria = "safe-to-deploy" + +[[exemptions.take_mut]] +version = "0.2.2" +criteria = "safe-to-deploy" + +[[exemptions.tap]] +version = "1.0.1" +criteria = "safe-to-deploy" + +[[exemptions.target-lexicon]] +version = "0.12.11" +criteria = "safe-to-deploy" + +[[exemptions.tempfile]] +version = "3.8.0" +criteria = "safe-to-deploy" + +[[exemptions.term]] +version = "0.7.0" +criteria = "safe-to-deploy" + +[[exemptions.textwrap]] +version = "0.11.0" +criteria = "safe-to-deploy" + +[[exemptions.thiserror]] +version = "1.0.49" +criteria = "safe-to-deploy" + +[[exemptions.thiserror-impl]] +version = "1.0.49" +criteria = "safe-to-deploy" + +[[exemptions.thread_local]] +version = "1.1.7" +criteria = "safe-to-deploy" + +[[exemptions.time]] +version = "0.3.29" +criteria = "safe-to-deploy" + +[[exemptions.time-core]] +version = "0.1.2" +criteria = "safe-to-deploy" + +[[exemptions.time-macros]] +version = "0.2.15" +criteria = "safe-to-deploy" + +[[exemptions.tiny-keccak]] +version = "2.0.2" +criteria = "safe-to-deploy" + +[[exemptions.tinytemplate]] +version = "1.2.1" +criteria = "safe-to-deploy" + +[[exemptions.tinyvec]] +version = "1.6.0" +criteria = "safe-to-deploy" + +[[exemptions.tinyvec_macros]] +version = "0.1.1" +criteria = "safe-to-deploy" + +[[exemptions.tokio]] +version = "1.33.0" +criteria = "safe-to-deploy" + +[[exemptions.tokio-macros]] +version = "2.1.0" +criteria = "safe-to-deploy" + +[[exemptions.tokio-native-tls]] +version = "0.3.1" +criteria = "safe-to-deploy" + +[[exemptions.tokio-rustls]] +version = "0.24.1" +criteria = "safe-to-deploy" + +[[exemptions.tokio-tungstenite]] +version = "0.20.1" +criteria = "safe-to-deploy" + +[[exemptions.tokio-util]] +version = "0.7.9" +criteria = "safe-to-deploy" + +[[exemptions.toml]] +version = "0.7.8" +criteria = "safe-to-deploy" + +[[exemptions.toml_datetime]] +version = "0.6.3" +criteria = "safe-to-deploy" + +[[exemptions.toml_edit]] +version = "0.19.15" +criteria = "safe-to-deploy" + +[[exemptions.tower]] +version = "0.4.13" +criteria = "safe-to-deploy" + +[[exemptions.tower-layer]] +version = "0.3.2" +criteria = "safe-to-deploy" + +[[exemptions.tower-service]] +version = "0.3.2" +criteria = "safe-to-deploy" + +[[exemptions.tracing]] +version = "0.1.39" +criteria = "safe-to-deploy" + +[[exemptions.tracing-attributes]] +version = "0.1.27" +criteria = "safe-to-deploy" + +[[exemptions.tracing-core]] +version = "0.1.32" +criteria = "safe-to-deploy" + +[[exemptions.tracing-error]] +version = "0.1.2" +criteria = "safe-to-deploy" + +[[exemptions.tracing-error]] +version = "0.2.0" +criteria = "safe-to-deploy" + +[[exemptions.tracing-futures]] +version = "0.2.5" +criteria = "safe-to-deploy" + +[[exemptions.tracing-subscriber]] +version = "0.2.25" +criteria = "safe-to-deploy" + +[[exemptions.tracing-subscriber]] +version = "0.3.17" +criteria = "safe-to-deploy" + +[[exemptions.try-lock]] +version = "0.2.4" +criteria = "safe-to-deploy" + +[[exemptions.tungstenite]] +version = "0.20.1" +criteria = "safe-to-deploy" + +[[exemptions.typenum]] +version = "1.17.0" +criteria = "safe-to-deploy" + +[[exemptions.ucd-trie]] +version = "0.1.6" +criteria = "safe-to-deploy" + +[[exemptions.uint]] +version = "0.9.5" +criteria = "safe-to-deploy" + +[[exemptions.unarray]] +version = "0.1.4" +criteria = "safe-to-deploy" + +[[exemptions.unicode-bidi]] +version = "0.3.13" +criteria = "safe-to-deploy" + +[[exemptions.unicode-ident]] +version = "1.0.12" +criteria = "safe-to-deploy" + +[[exemptions.unicode-normalization]] +version = "0.1.22" +criteria = "safe-to-deploy" + +[[exemptions.unicode-width]] +version = "0.1.11" +criteria = "safe-to-deploy" + +[[exemptions.unicode-xid]] +version = "0.2.4" +criteria = "safe-to-deploy" + +[[exemptions.untrusted]] +version = "0.7.1" +criteria = "safe-to-deploy" + +[[exemptions.url]] +version = "2.4.1" +criteria = "safe-to-deploy" + +[[exemptions.utf-8]] +version = "0.7.6" +criteria = "safe-to-deploy" + +[[exemptions.utf8parse]] +version = "0.2.1" +criteria = "safe-to-deploy" + +[[exemptions.uuid]] +version = "0.8.2" +criteria = "safe-to-deploy" + +[[exemptions.uuid]] +version = "1.4.1" +criteria = "safe-to-deploy" + +[[exemptions.valuable]] +version = "0.1.0" +criteria = "safe-to-deploy" + +[[exemptions.vcpkg]] +version = "0.2.15" +criteria = "safe-to-deploy" + +[[exemptions.version_check]] +version = "0.9.4" +criteria = "safe-to-deploy" + +[[exemptions.walkdir]] +version = "2.4.0" +criteria = "safe-to-deploy" + +[[exemptions.want]] +version = "0.3.1" +criteria = "safe-to-deploy" + +[[exemptions.wasi]] +version = "0.11.0+wasi-snapshot-preview1" +criteria = "safe-to-deploy" + +[[exemptions.wasm-bindgen]] +version = "0.2.87" +criteria = "safe-to-deploy" + +[[exemptions.wasm-bindgen-backend]] +version = "0.2.87" +criteria = "safe-to-deploy" + +[[exemptions.wasm-bindgen-futures]] +version = "0.4.37" +criteria = "safe-to-deploy" + +[[exemptions.wasm-bindgen-macro]] +version = "0.2.87" +criteria = "safe-to-deploy" + +[[exemptions.wasm-bindgen-macro-support]] +version = "0.2.87" +criteria = "safe-to-deploy" + +[[exemptions.wasm-bindgen-shared]] +version = "0.2.87" +criteria = "safe-to-deploy" + +[[exemptions.wasm-encoder]] +version = "0.33.2" +criteria = "safe-to-deploy" + +[[exemptions.wasmer]] +version = "2.3.0" +criteria = "safe-to-deploy" + +[[exemptions.wasmer-artifact]] +version = "2.3.0" +criteria = "safe-to-deploy" + +[[exemptions.wasmer-compiler]] +version = "2.3.0" +criteria = "safe-to-deploy" + +[[exemptions.wasmer-compiler-cranelift]] +version = "2.3.0" +criteria = "safe-to-deploy" + +[[exemptions.wasmer-derive]] +version = "2.3.0" +criteria = "safe-to-deploy" + +[[exemptions.wasmer-engine]] +version = "2.3.0" +criteria = "safe-to-deploy" + +[[exemptions.wasmer-engine-dylib]] +version = "2.3.0" +criteria = "safe-to-deploy" + +[[exemptions.wasmer-engine-universal]] +version = "2.3.0" +criteria = "safe-to-deploy" + +[[exemptions.wasmer-engine-universal-artifact]] +version = "2.3.0" +criteria = "safe-to-deploy" + +[[exemptions.wasmer-object]] +version = "2.3.0" +criteria = "safe-to-deploy" + +[[exemptions.wasmer-types]] +version = "2.3.0" +criteria = "safe-to-deploy" + +[[exemptions.wasmer-vm]] +version = "2.3.0" +criteria = "safe-to-deploy" + +[[exemptions.wasmparser]] +version = "0.83.0" +criteria = "safe-to-deploy" + +[[exemptions.wast]] +version = "65.0.2" +criteria = "safe-to-deploy" + +[[exemptions.wat]] +version = "1.0.74" +criteria = "safe-to-deploy" + +[[exemptions.web-sys]] +version = "0.3.64" +criteria = "safe-to-deploy" + +[[exemptions.webpki-roots]] +version = "0.25.2" +criteria = "safe-to-deploy" + +[[exemptions.which]] +version = "4.4.2" +criteria = "safe-to-deploy" + +[[exemptions.widestring]] +version = "1.0.2" +criteria = "safe-to-deploy" + +[[exemptions.winapi]] +version = "0.3.9" +criteria = "safe-to-deploy" + +[[exemptions.winapi-i686-pc-windows-gnu]] +version = "0.4.0" +criteria = "safe-to-deploy" + +[[exemptions.winapi-util]] +version = "0.1.6" +criteria = "safe-to-deploy" + +[[exemptions.winapi-x86_64-pc-windows-gnu]] +version = "0.4.0" +criteria = "safe-to-deploy" + +[[exemptions.windows]] +version = "0.44.0" +criteria = "safe-to-deploy" + +[[exemptions.windows]] +version = "0.48.0" +criteria = "safe-to-deploy" + +[[exemptions.windows-sys]] +version = "0.33.0" +criteria = "safe-to-deploy" + +[[exemptions.windows-sys]] +version = "0.48.0" +criteria = "safe-to-deploy" + +[[exemptions.windows-targets]] +version = "0.42.2" +criteria = "safe-to-deploy" + +[[exemptions.windows-targets]] +version = "0.48.5" +criteria = "safe-to-deploy" + +[[exemptions.windows_aarch64_gnullvm]] +version = "0.42.2" +criteria = "safe-to-deploy" + +[[exemptions.windows_aarch64_gnullvm]] +version = "0.48.5" +criteria = "safe-to-deploy" + +[[exemptions.windows_aarch64_msvc]] +version = "0.33.0" +criteria = "safe-to-deploy" + +[[exemptions.windows_aarch64_msvc]] +version = "0.42.2" +criteria = "safe-to-deploy" + +[[exemptions.windows_aarch64_msvc]] +version = "0.48.5" +criteria = "safe-to-deploy" + +[[exemptions.windows_i686_gnu]] +version = "0.33.0" +criteria = "safe-to-deploy" + +[[exemptions.windows_i686_gnu]] +version = "0.42.2" +criteria = "safe-to-deploy" + +[[exemptions.windows_i686_gnu]] +version = "0.48.5" +criteria = "safe-to-deploy" + +[[exemptions.windows_i686_msvc]] +version = "0.33.0" +criteria = "safe-to-deploy" + +[[exemptions.windows_i686_msvc]] +version = "0.42.2" +criteria = "safe-to-deploy" + +[[exemptions.windows_i686_msvc]] +version = "0.48.5" +criteria = "safe-to-deploy" + +[[exemptions.windows_x86_64_gnu]] +version = "0.33.0" +criteria = "safe-to-deploy" + +[[exemptions.windows_x86_64_gnu]] +version = "0.42.2" +criteria = "safe-to-deploy" + +[[exemptions.windows_x86_64_gnu]] +version = "0.48.5" +criteria = "safe-to-deploy" + +[[exemptions.windows_x86_64_gnullvm]] +version = "0.42.2" +criteria = "safe-to-deploy" + +[[exemptions.windows_x86_64_gnullvm]] +version = "0.48.5" +criteria = "safe-to-deploy" + +[[exemptions.windows_x86_64_msvc]] +version = "0.33.0" +criteria = "safe-to-deploy" + +[[exemptions.windows_x86_64_msvc]] +version = "0.42.2" +criteria = "safe-to-deploy" + +[[exemptions.windows_x86_64_msvc]] +version = "0.48.5" +criteria = "safe-to-deploy" + +[[exemptions.winnow]] +version = "0.5.15" +criteria = "safe-to-deploy" + +[[exemptions.winreg]] +version = "0.50.0" +criteria = "safe-to-deploy" + +[[exemptions.ws_stream_wasm]] +version = "0.7.4" +criteria = "safe-to-deploy" + +[[exemptions.wyz]] +version = "0.5.1" +criteria = "safe-to-deploy" + +[[exemptions.yansi]] +version = "0.5.1" +criteria = "safe-to-deploy" + +[[exemptions.zerocopy]] +version = "0.7.15" +criteria = "safe-to-deploy" + +[[exemptions.zerocopy-derive]] +version = "0.7.15" +criteria = "safe-to-deploy" + +[[exemptions.zeroize]] +version = "1.6.0" +criteria = "safe-to-deploy" + +[[exemptions.zeroize_derive]] +version = "1.4.2" +criteria = "safe-to-deploy" + +[[exemptions.zip]] +version = "0.6.6" +criteria = "safe-to-deploy" + +[[exemptions.zstd]] +version = "0.11.2+zstd.1.5.2" +criteria = "safe-to-deploy" + +[[exemptions.zstd-safe]] +version = "5.0.2+zstd.1.5.2" +criteria = "safe-to-deploy" + +[[exemptions.zstd-sys]] +version = "2.0.8+zstd.1.5.5" +criteria = "safe-to-deploy" diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock new file mode 100644 index 00000000..0c397a40 --- /dev/null +++ b/supply-chain/imports.lock @@ -0,0 +1,2 @@ + +# cargo-vet imports lock From 73f1246f318dca6a05a5d133bb10fa4490b90fe2 Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 09:33:12 -0400 Subject: [PATCH 20/26] updated logic if logs is empty in sync to head --- Cargo.lock | 34 +-------- crates/state_bridge/Cargo.toml | 9 +-- crates/state_bridge/tests/bridge_service.rs | 7 -- .../src/world_tree/tree_updater.rs | 70 +++++++++---------- 4 files changed, 37 insertions(+), 83 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 39a54b72..3878071d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1639,7 +1639,7 @@ dependencies = [ "ethers-middleware", "ethers-providers", "ethers-signers", - "ethers-solc 2.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "ethers-solc", ] [[package]] @@ -1901,37 +1901,6 @@ dependencies = [ "yansi", ] -[[package]] -name = "ethers-solc" -version = "2.0.10" -source = "git+https://github.com/gakonst/ethers-rs#1d4a11231dc3c2b3c231b42e4864100c1f09ca64" -dependencies = [ - "cfg-if", - "const-hex", - "dirs", - "dunce", - "ethers-core 2.0.10 (git+https://github.com/gakonst/ethers-rs)", - "glob", - "home", - "md-5", - "num_cpus", - "once_cell", - "path-slash", - "rayon", - "regex", - "semver 1.0.19", - "serde", - "serde_json", - "solang-parser", - "svm-rs", - "thiserror", - "tiny-keccak", - "tokio", - "tracing", - "walkdir", - "yansi", -] - [[package]] name = "eyre" version = "0.6.8" @@ -4454,7 +4423,6 @@ dependencies = [ "chrono", "common", "ethers", - "ethers-solc 2.0.10 (git+https://github.com/gakonst/ethers-rs)", "eyre", "hex", "ruint", diff --git a/crates/state_bridge/Cargo.toml b/crates/state_bridge/Cargo.toml index 4785f3e1..90281d44 100644 --- a/crates/state_bridge/Cargo.toml +++ b/crates/state_bridge/Cargo.toml @@ -7,14 +7,7 @@ edition = "2021" [dependencies] anyhow = "1.0.75" chrono = { version = "0.4.31", features = ["serde"] } # TODO: maybe remove this -ethers = { version = "2.0.10", features = [ - "abigen", - "ws", - "ipc", - "rustls", - "openssl", -] } -ethers-solc = { git = "https://github.com/gakonst/ethers-rs" } +ethers = { version = "2.0.10", features = ["abigen", "ws", "ipc", "rustls", "openssl"] } eyre = "0.6.8" hex = "0.4.3" ruint = "1.10.1" diff --git a/crates/state_bridge/tests/bridge_service.rs b/crates/state_bridge/tests/bridge_service.rs index f883c283..28988d93 100644 --- a/crates/state_bridge/tests/bridge_service.rs +++ b/crates/state_bridge/tests/bridge_service.rs @@ -14,7 +14,6 @@ pub use ethers::prelude::{ pub use ethers::providers::{Middleware, StreamExt}; pub use ethers::types::{Bytes, H256, U256}; pub use ethers::utils::{Anvil, AnvilInstance}; -pub use ethers_solc::artifacts::Bytecode; pub use serde::{Deserialize, Serialize}; pub use serde_json::json; use state_bridge::bridge::{IBridgedWorldID, IStateBridge, StateBridge}; @@ -25,12 +24,6 @@ pub use tokio::spawn; pub use tokio::task::JoinHandle; pub use tracing::{error, info, instrument}; -#[derive(Deserialize, Serialize, Debug)] -struct CompiledContract { - abi: Abi, - bytecode: Bytecode, -} - // test that spawns a mock anvil chain, deploys world id contracts, instantiates a `StateBridgeService` // and propagates a root in order to see if the `StateBridgeService` works as intended. #[tokio::test] diff --git a/crates/tree_availability/src/world_tree/tree_updater.rs b/crates/tree_availability/src/world_tree/tree_updater.rs index 586d22e4..ac9fd00b 100644 --- a/crates/tree_availability/src/world_tree/tree_updater.rs +++ b/crates/tree_availability/src/world_tree/tree_updater.rs @@ -62,41 +62,7 @@ impl TreeUpdater { .await .map_err(TreeAvailabilityError::MiddlewareError)?; - if !logs.is_empty() { - let mut futures = FuturesOrdered::new(); - - //TODO: update this to use a throttle that can be set by the user - for logs in logs.chunks(20) { - for log in logs { - futures.push_back(self.middleware.get_transaction( - log.transaction_hash.ok_or( - TreeAvailabilityError::TransactionHashNotFound, - )?, - )); - } - - while let Some(transaction) = futures.next().await { - let transaction = transaction - .map_err(TreeAvailabilityError::MiddlewareError)? - .ok_or(TreeAvailabilityError::TransactionNotFound)?; - - self.sync_from_transaction(tree_data, &transaction).await?; - } - - //TODO: use a better throttle - tokio::time::sleep(Duration::from_secs(1)).await; - } - - let block_number = logs - .last() - .expect("Could not get last log") - .block_number - .ok_or(TreeAvailabilityError::BlockNumberNotFound)? - .as_u64(); - - self.latest_synced_block - .store(block_number, Ordering::Relaxed); - } else { + if logs.is_empty() { let block_number = self .middleware .get_block_number() @@ -108,6 +74,40 @@ impl TreeUpdater { .store(block_number, Ordering::Relaxed); } + let mut futures = FuturesOrdered::new(); + + //TODO: update this to use a throttle that can be set by the user + for logs in logs.chunks(20) { + for log in logs { + futures.push_back(self.middleware.get_transaction( + log.transaction_hash.ok_or( + TreeAvailabilityError::TransactionHashNotFound, + )?, + )); + } + + while let Some(transaction) = futures.next().await { + let transaction = transaction + .map_err(TreeAvailabilityError::MiddlewareError)? + .ok_or(TreeAvailabilityError::TransactionNotFound)?; + + self.sync_from_transaction(tree_data, &transaction).await?; + } + + //TODO: use a better throttle + tokio::time::sleep(Duration::from_secs(1)).await; + } + + let block_number = logs + .last() + .expect("Could not get last log") + .block_number + .ok_or(TreeAvailabilityError::BlockNumberNotFound)? + .as_u64(); + + self.latest_synced_block + .store(block_number, Ordering::Relaxed); + Ok(()) } From 67f78ba04b71b448606355d7ae1d0809f072c931 Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 09:35:49 -0400 Subject: [PATCH 21/26] removed redundant last synced block --- .../src/world_tree/tree_updater.rs | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/crates/tree_availability/src/world_tree/tree_updater.rs b/crates/tree_availability/src/world_tree/tree_updater.rs index ac9fd00b..0450250f 100644 --- a/crates/tree_availability/src/world_tree/tree_updater.rs +++ b/crates/tree_availability/src/world_tree/tree_updater.rs @@ -63,15 +63,7 @@ impl TreeUpdater { .map_err(TreeAvailabilityError::MiddlewareError)?; if logs.is_empty() { - let block_number = self - .middleware - .get_block_number() - .await - .map_err(TreeAvailabilityError::MiddlewareError)? - .as_u64(); - - self.latest_synced_block - .store(block_number, Ordering::Relaxed); + return Ok(()); } let mut futures = FuturesOrdered::new(); @@ -98,16 +90,6 @@ impl TreeUpdater { tokio::time::sleep(Duration::from_secs(1)).await; } - let block_number = logs - .last() - .expect("Could not get last log") - .block_number - .ok_or(TreeAvailabilityError::BlockNumberNotFound)? - .as_u64(); - - self.latest_synced_block - .store(block_number, Ordering::Relaxed); - Ok(()) } From a5b4f55b7157db5d6125f5731e6156f5d3a20bd8 Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 09:37:32 -0400 Subject: [PATCH 22/26] updated to use selector from abigen --- crates/tree_availability/src/world_tree/abi.rs | 3 --- crates/tree_availability/src/world_tree/tree_updater.rs | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/tree_availability/src/world_tree/abi.rs b/crates/tree_availability/src/world_tree/abi.rs index e14f04ae..b2e18104 100644 --- a/crates/tree_availability/src/world_tree/abi.rs +++ b/crates/tree_availability/src/world_tree/abi.rs @@ -1,9 +1,6 @@ use ethers::middleware::contract::abigen; use ethers::types::Selector; -pub const REGISTER_IDENTITIES_SELECTOR: Selector = [34, 23, 178, 17]; -pub const DELETE_IDENTITIES_SELECTOR: Selector = [234, 16, 251, 190]; - abigen!( IWorldIDIdentityManager, r#"[ diff --git a/crates/tree_availability/src/world_tree/tree_updater.rs b/crates/tree_availability/src/world_tree/tree_updater.rs index 0450250f..8a61b1fc 100644 --- a/crates/tree_availability/src/world_tree/tree_updater.rs +++ b/crates/tree_availability/src/world_tree/tree_updater.rs @@ -3,6 +3,7 @@ use std::sync::Arc; use std::time::Duration; use ethers::abi::AbiDecode; +use ethers::contract::EthCall; use ethers::contract::EthEvent; use ethers::providers::{Middleware, StreamExt}; use ethers::types::{Selector, Transaction, H160, U256}; @@ -10,7 +11,6 @@ use futures::stream::FuturesOrdered; use super::abi::{ DeleteIdentitiesCall, RegisterIdentitiesCall, TreeChangedFilter, - DELETE_IDENTITIES_SELECTOR, REGISTER_IDENTITIES_SELECTOR, }; use super::block_scanner::BlockScanner; use super::tree_data::TreeData; @@ -103,7 +103,7 @@ impl TreeUpdater { let function_selector = Selector::try_from(&calldata[0..4]) .expect("Transaction data does not contain a function selector"); - if function_selector == REGISTER_IDENTITIES_SELECTOR { + if function_selector == RegisterIdentitiesCall::selector() { let register_identities_call = RegisterIdentitiesCall::decode(calldata.as_ref())?; @@ -117,7 +117,7 @@ impl TreeUpdater { tree_data .insert_many_at(start_index as usize, &identities) .await; - } else if function_selector == DELETE_IDENTITIES_SELECTOR { + } else if function_selector == DeleteIdentitiesCall::selector() { let delete_identities_call = DeleteIdentitiesCall::decode(calldata.as_ref())?; From cd854ebaf2ce2619db7e4fad3611bd86f0784a7c Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 09:42:23 -0400 Subject: [PATCH 23/26] fmt --- crates/tree_availability/src/world_tree/tree_updater.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/tree_availability/src/world_tree/tree_updater.rs b/crates/tree_availability/src/world_tree/tree_updater.rs index 8a61b1fc..9d57544f 100644 --- a/crates/tree_availability/src/world_tree/tree_updater.rs +++ b/crates/tree_availability/src/world_tree/tree_updater.rs @@ -3,8 +3,7 @@ use std::sync::Arc; use std::time::Duration; use ethers::abi::AbiDecode; -use ethers::contract::EthCall; -use ethers::contract::EthEvent; +use ethers::contract::{EthCall, EthEvent}; use ethers::providers::{Middleware, StreamExt}; use ethers::types::{Selector, Transaction, H160, U256}; use futures::stream::FuturesOrdered; From 6252acc64c349d90f41ae069c71e8633ac7d5c0e Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 09:49:26 -0400 Subject: [PATCH 24/26] updated audits.toml --- supply-chain/audits.toml | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index 2772ccb2..979d9f22 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -2,3 +2,57 @@ # cargo-vet audits file [audits] + +[[trusted.windows-sys]] +criteria = "safe-to-deploy" +user-id = 64539 # Kenny Kerr (kennykerr) +start = "2021-11-15" +end = "2024-07-18" + +[[trusted.windows-targets]] +criteria = "safe-to-deploy" +user-id = 64539 # Kenny Kerr (kennykerr) +start = "2022-09-09" +end = "2024-07-18" + +[[trusted.windows_aarch64_gnullvm]] +criteria = "safe-to-deploy" +user-id = 64539 # Kenny Kerr (kennykerr) +start = "2022-09-01" +end = "2024-07-18" + +[[trusted.windows_aarch64_msvc]] +criteria = "safe-to-deploy" +user-id = 64539 # Kenny Kerr (kennykerr) +start = "2021-11-05" +end = "2024-07-18" + +[[trusted.windows_i686_gnu]] +criteria = "safe-to-deploy" +user-id = 64539 # Kenny Kerr (kennykerr) +start = "2021-10-28" +end = "2024-07-18" + +[[trusted.windows_i686_msvc]] +criteria = "safe-to-deploy" +user-id = 64539 # Kenny Kerr (kennykerr) +start = "2021-10-27" +end = "2024-07-18" + +[[trusted.windows_x86_64_gnu]] +criteria = "safe-to-deploy" +user-id = 64539 # Kenny Kerr (kennykerr) +start = "2021-10-28" +end = "2024-07-18" + +[[trusted.windows_x86_64_gnullvm]] +criteria = "safe-to-deploy" +user-id = 64539 # Kenny Kerr (kennykerr) +start = "2022-09-01" +end = "2024-07-18" + +[[trusted.windows_x86_64_msvc]] +criteria = "safe-to-deploy" +user-id = 64539 # Kenny Kerr (kennykerr) +start = "2021-10-27" +end = "2024-07-18" From a4e8303437bc4aa242704a015c82c951d7f7738c Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 09:53:50 -0400 Subject: [PATCH 25/26] updated cargo vet --- supply-chain/config.toml | 99 ----------------------- supply-chain/imports.lock | 161 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 161 insertions(+), 99 deletions(-) diff --git a/supply-chain/config.toml b/supply-chain/config.toml index 6ea8fb8b..5a9d059a 100644 --- a/supply-chain/config.toml +++ b/supply-chain/config.toml @@ -14,9 +14,6 @@ audit-as-crates-io = true [policy."ethers-solc:2.0.10"] -[policy."ethers-solc:2.0.10@git:70e5f022b1bd94c26dbc85d57b5342e5e23ba8c2"] -audit-as-crates-io = true - [[exemptions.Inflector]] version = "0.11.4" criteria = "safe-to-deploy" @@ -657,10 +654,6 @@ criteria = "safe-to-deploy" version = "2.0.10" criteria = "safe-to-deploy" -[[exemptions.ethers-solc]] -version = "2.0.10@git:70e5f022b1bd94c26dbc85d57b5342e5e23ba8c2" -criteria = "safe-to-deploy" - [[exemptions.eyre]] version = "0.6.8" criteria = "safe-to-deploy" @@ -2085,98 +2078,6 @@ criteria = "safe-to-deploy" version = "0.48.0" criteria = "safe-to-deploy" -[[exemptions.windows-sys]] -version = "0.33.0" -criteria = "safe-to-deploy" - -[[exemptions.windows-sys]] -version = "0.48.0" -criteria = "safe-to-deploy" - -[[exemptions.windows-targets]] -version = "0.42.2" -criteria = "safe-to-deploy" - -[[exemptions.windows-targets]] -version = "0.48.5" -criteria = "safe-to-deploy" - -[[exemptions.windows_aarch64_gnullvm]] -version = "0.42.2" -criteria = "safe-to-deploy" - -[[exemptions.windows_aarch64_gnullvm]] -version = "0.48.5" -criteria = "safe-to-deploy" - -[[exemptions.windows_aarch64_msvc]] -version = "0.33.0" -criteria = "safe-to-deploy" - -[[exemptions.windows_aarch64_msvc]] -version = "0.42.2" -criteria = "safe-to-deploy" - -[[exemptions.windows_aarch64_msvc]] -version = "0.48.5" -criteria = "safe-to-deploy" - -[[exemptions.windows_i686_gnu]] -version = "0.33.0" -criteria = "safe-to-deploy" - -[[exemptions.windows_i686_gnu]] -version = "0.42.2" -criteria = "safe-to-deploy" - -[[exemptions.windows_i686_gnu]] -version = "0.48.5" -criteria = "safe-to-deploy" - -[[exemptions.windows_i686_msvc]] -version = "0.33.0" -criteria = "safe-to-deploy" - -[[exemptions.windows_i686_msvc]] -version = "0.42.2" -criteria = "safe-to-deploy" - -[[exemptions.windows_i686_msvc]] -version = "0.48.5" -criteria = "safe-to-deploy" - -[[exemptions.windows_x86_64_gnu]] -version = "0.33.0" -criteria = "safe-to-deploy" - -[[exemptions.windows_x86_64_gnu]] -version = "0.42.2" -criteria = "safe-to-deploy" - -[[exemptions.windows_x86_64_gnu]] -version = "0.48.5" -criteria = "safe-to-deploy" - -[[exemptions.windows_x86_64_gnullvm]] -version = "0.42.2" -criteria = "safe-to-deploy" - -[[exemptions.windows_x86_64_gnullvm]] -version = "0.48.5" -criteria = "safe-to-deploy" - -[[exemptions.windows_x86_64_msvc]] -version = "0.33.0" -criteria = "safe-to-deploy" - -[[exemptions.windows_x86_64_msvc]] -version = "0.42.2" -criteria = "safe-to-deploy" - -[[exemptions.windows_x86_64_msvc]] -version = "0.48.5" -criteria = "safe-to-deploy" - [[exemptions.winnow]] version = "0.5.15" criteria = "safe-to-deploy" diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock index 0c397a40..5fa1c5aa 100644 --- a/supply-chain/imports.lock +++ b/supply-chain/imports.lock @@ -1,2 +1,163 @@ # cargo-vet imports lock + +[[publisher.windows-sys]] +version = "0.33.0" +when = "2022-02-24" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows-sys]] +version = "0.48.0" +when = "2023-03-31" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows-targets]] +version = "0.42.2" +when = "2023-03-13" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows-targets]] +version = "0.48.5" +when = "2023-08-18" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_aarch64_gnullvm]] +version = "0.42.2" +when = "2023-03-13" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_aarch64_gnullvm]] +version = "0.48.5" +when = "2023-08-18" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_aarch64_msvc]] +version = "0.33.0" +when = "2022-02-24" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_aarch64_msvc]] +version = "0.42.2" +when = "2023-03-13" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_aarch64_msvc]] +version = "0.48.5" +when = "2023-08-18" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_i686_gnu]] +version = "0.33.0" +when = "2022-02-24" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_i686_gnu]] +version = "0.42.2" +when = "2023-03-13" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_i686_gnu]] +version = "0.48.5" +when = "2023-08-18" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_i686_msvc]] +version = "0.33.0" +when = "2022-02-24" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_i686_msvc]] +version = "0.42.2" +when = "2023-03-13" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_i686_msvc]] +version = "0.48.5" +when = "2023-08-18" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_x86_64_gnu]] +version = "0.33.0" +when = "2022-02-24" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_x86_64_gnu]] +version = "0.42.2" +when = "2023-03-13" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_x86_64_gnu]] +version = "0.48.5" +when = "2023-08-18" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_x86_64_gnullvm]] +version = "0.42.2" +when = "2023-03-13" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_x86_64_gnullvm]] +version = "0.48.5" +when = "2023-08-18" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_x86_64_msvc]] +version = "0.33.0" +when = "2022-02-24" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_x86_64_msvc]] +version = "0.42.2" +when = "2023-03-13" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" + +[[publisher.windows_x86_64_msvc]] +version = "0.48.5" +when = "2023-08-18" +user-id = 64539 +user-login = "kennykerr" +user-name = "Kenny Kerr" From 5645cf339d5868c7174f95250a0926a9eae01387 Mon Sep 17 00:00:00 2001 From: 0xKitsune <0xKitsune@protonmail.com> Date: Fri, 27 Oct 2023 10:27:01 -0400 Subject: [PATCH 26/26] updated todos --- crates/tree_availability/src/server.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/tree_availability/src/server.rs b/crates/tree_availability/src/server.rs index 3fdfca48..4a48a6a3 100644 --- a/crates/tree_availability/src/server.rs +++ b/crates/tree_availability/src/server.rs @@ -38,6 +38,7 @@ impl InclusionProofRequest { #[serde(rename_all = "camelCase")] pub struct InclusionProof { pub root: Field, + //TODO: Implement `Deserialize` for Proof within semaphore-rs instead of using `deserialize_with` #[serde(deserialize_with = "deserialize_proof")] pub proof: Proof, pub message: Option,