diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5258e8e..08b7ae17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: "CI" +name: "EVM" env: HARDHAT_VAR_MNEMONIC: "test test test test test test test test test test test junk" diff --git a/.github/workflows/publish-evm.yml b/.github/workflows/publish-evm.yml new file mode 100644 index 00000000..9bd86220 --- /dev/null +++ b/.github/workflows/publish-evm.yml @@ -0,0 +1,23 @@ +name: EVM Version release + +on: + release: + types: [created] + +env: + HARDHAT_VAR_MNEMONIC: "test test test test test test test test test test test junk" + HARDHAT_VAR_INFURA_API_KEY: "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" + +jobs: + publish-npm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 20 + - run: yarn + - run: yarn evm:release + env: + NPM_AUTH_TOKEN: ${{secrets.PUBLISH_NPM_TOKEN}} + YARN_REGISTRY: https://registry.npmjs.org/ diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml new file mode 100644 index 00000000..b53b3fb3 --- /dev/null +++ b/.github/workflows/rust-ci.yml @@ -0,0 +1,26 @@ +name: Rust + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + +jobs: + ci: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install latest stable Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Run tests + run: | + cd ./packages/ciphernode/ + cargo test diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 9a51b727..1f6b36b6 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,6 @@ { - "recommendations": ["esbenp.prettier-vscode", "NomicFoundation.hardhat-solidity"] + "recommendations": [ + "esbenp.prettier-vscode", + "NomicFoundation.hardhat-solidity" + ] } diff --git a/LICENSE.md b/LICENSE.md index f288702d..a5eae152 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,190 +1,190 @@ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. +Copyright (C) 2007 Free Software Foundation, Inc. +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. Preamble - The GNU General Public License is a free, copyleft license for +The GNU General Public License is a free, copyleft license for software and other kinds of works. - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the +software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to +any other work released this way by its authors. You can apply it to your programs, too. - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have +To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. - For example, if you distribute copies of such a program, whether +For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they know their rights. - Developers that use the GNU GPL protect your rights with two steps: +Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and +For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. - Some devices are designed to deny users access to install or run +Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we +use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we +products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. - Finally, every program is threatened constantly by software patents. +Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that +make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. - The precise terms and conditions for copying, distribution and +The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS - 0. Definitions. +0. Definitions. - "This License" refers to version 3 of the GNU General Public License. +"This License" refers to version 3 of the GNU General Public License. - "Copyright" also means copyright-like laws that apply to other kinds of +"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and +"The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. - To "modify" a work means to copy from or adapt all or part of the work +To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the +exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. - A "covered work" means either the unmodified Program or a work based +A "covered work" means either the unmodified Program or a work based on the Program. - To "propagate" a work means to do anything with it that, without +To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, +computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through +To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. - An interactive user interface displays "Appropriate Legal Notices" +An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If +work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. - 1. Source Code. +1. Source Code. - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source +The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source form of a work. - A "Standard Interface" means an interface that either is an official +A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. - The "System Libraries" of an executable work include anything, other +The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A +implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. - The "Corresponding Source" for a work in object code form means all +The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's +control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source +which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. - The Corresponding Source need not include anything that users +The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. - The Corresponding Source for a work in source code form is that +The Corresponding Source for a work in source code form is that same work. - 2. Basic Permissions. +2. Basic Permissions. - All rights granted under this License are granted for the term of +All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your +content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. - You may make, run and propagate covered works that you do not +You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose +in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works +not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 +Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. +3. Protecting Users' Legal Rights From Anti-Circumvention Law. - No covered work shall be deemed part of an effective technological +No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. - When you convey a covered work, you waive any legal power to forbid +When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or @@ -192,9 +192,9 @@ modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. - 4. Conveying Verbatim Copies. +4. Conveying Verbatim Copies. - You may convey verbatim copies of the Program's source code as you +You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any @@ -202,12 +202,12 @@ non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. - You may charge any price or no price for each copy that you convey, +You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. - 5. Conveying Modified Source Versions. +5. Conveying Modified Source Versions. - You may convey a work based on the Program, or the modifications to +You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: @@ -232,19 +232,19 @@ terms of section 4, provided that you also meet all of these conditions: interfaces that do not display Appropriate Legal Notices, your work need not make them do so. - A compilation of a covered work with other separate and independent +A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work +beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. - 6. Conveying Non-Source Forms. +6. Conveying Non-Source Forms. - You may convey a covered work in object code form under the terms +You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: @@ -290,75 +290,75 @@ in one of these ways: Source of the work are being offered to the general public at no charge under subsection 6d. - A separable portion of the object code, whose source code is excluded +A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. - A "User Product" is either (1) a "consumer product", which means any +A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product +actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. - "Installation Information" for a User Product means any methods, +"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must +a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. - If you convey an object code work under this section in, or with, or +If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply +by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). - The requirement to provide Installation Information does not include a +The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a +the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. - Corresponding Source conveyed, and Installation Information provided, +Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. - 7. Additional Terms. +7. Additional Terms. - "Additional permissions" are terms that supplement the terms of this +"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions +that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. - When you convey a copy of a covered work, you may at your option +When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. - Notwithstanding any other provision of this License, for material you +Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: @@ -385,74 +385,74 @@ that material) supplement the terms of this License with terms: any liability that these contractual assumptions directly impose on those licensors and authors. - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you +All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains +restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. - If you add terms to a covered work in accord with this section, you +If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. - Additional terms, permissive or non-permissive, may be stated in the +Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. - 8. Termination. +8. Termination. - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). - However, if you cease all violation of this License, then your +However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. - Moreover, your license from a particular copyright holder is +Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. - Termination of your rights under this section does not terminate the +Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently +this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. - 9. Acceptance Not Required for Having Copies. +9. Acceptance Not Required for Having Copies. - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work +You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, +to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. - 10. Automatic Licensing of Downstream Recipients. +10. Automatic Licensing of Downstream Recipients. - Each time you convey a covered work, the recipient automatically +Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible +propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. - An "entity transaction" is a transaction transferring control of an +An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered +organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could @@ -460,43 +460,43 @@ give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. - 11. Patents. +11. Patents. - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The +A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". - A contributor's "essential patent claims" are all patent claims +A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For +consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. - Each contributor grants you a non-exclusive, worldwide, royalty-free +Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. - In the following three paragraphs, a "patent license" is any express +In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a +sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. - If you convey a covered work, knowingly relying on a patent license, +If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, @@ -504,13 +504,13 @@ then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have +license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. - If, pursuant to or in connection with a single transaction or +If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify @@ -518,10 +518,10 @@ or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. - A patent license is "discriminatory" if it does not include within +A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered +specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying @@ -533,73 +533,73 @@ for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. - Nothing in this License shall be construed as excluding or limiting +Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. - 12. No Surrender of Others' Freedom. +12. No Surrender of Others' Freedom. - If conditions are imposed on you (whether by court order, agreement or +If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a +excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you +not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. - 13. Use with the GNU Affero General Public License. +13. Use with the GNU Affero General Public License. - Notwithstanding any other provision of this License, you have +Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this +combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. - 14. Revised Versions of this License. +14. Revised Versions of this License. - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will +The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - Each version is given a distinguishing version number. If the +Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the +Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. - If the Program specifies that a proxy can decide which future +If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. - 15. Disclaimer of Warranty. +15. Disclaimer of Warranty. - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - 16. Limitation of Liability. +16. Limitation of Liability. - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE @@ -609,9 +609,9 @@ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - 17. Interpretation of Sections 15 and 16. +17. Interpretation of Sections 15 and 16. - If the disclaimer of warranty and limitation of liability provided +If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the @@ -622,11 +622,11 @@ copy of the Program in return for a fee. How to Apply These Terms to Your New Programs - If you develop a new program, and you want it to be of the greatest +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. - To do so, attach the following notices to the program. It is safest +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. @@ -649,7 +649,7 @@ the "copyright" line and a pointer to where the full notice is found. Also add information on how to contact you by electronic and paper mail. - If the program does terminal interaction, make it output a short +If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) @@ -658,17 +658,17 @@ notice like this when it starts in an interactive mode: under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands +parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". - You should also get your employer (if you work as a programmer) or school, +You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you +The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read . diff --git a/package.json b/package.json index 85fe8606..69448f37 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,8 @@ "evm:typechain": "cd packages/evm && yarn typechain", "evm:test": "cd packages/evm && yarn test", "evm:coverage": "cd packages/evm && yarn coverage", - "preinstall": "yarn evm:install" - } + "preinstall": "yarn evm:install", + "evm:release": "cd packages/evm && yarn release" + }, + "dependencies": {} } diff --git a/packages/ciphernode/Cargo.lock b/packages/ciphernode/Cargo.lock index 39e6be0c..ded3b907 100644 --- a/packages/ciphernode/Cargo.lock +++ b/packages/ciphernode/Cargo.lock @@ -3,1774 +3,6410 @@ version = 3 [[package]] -name = "ahash" -version = "0.8.11" +name = "actix" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "de7fa236829ba0841304542f7614c42b80fca007455315c45c785ccfa873a85b" dependencies = [ - "cfg-if", + "actix-macros", + "actix-rt", + "actix_derive", + "bitflags 2.6.0", + "bytes", + "crossbeam-channel", + "futures-core", + "futures-sink", + "futures-task", + "futures-util", + "log", "once_cell", - "version_check", - "zerocopy", + "parking_lot", + "pin-project-lite", + "smallvec", + "tokio", + "tokio-util", ] [[package]] -name = "aho-corasick" -version = "1.1.3" +name = "actix-macros" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ - "memchr", + "quote", + "syn 2.0.72", ] [[package]] -name = "allocator-api2" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" - -[[package]] -name = "anyhow" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" - -[[package]] -name = "arrayref" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" - -[[package]] -name = "async-channel" -version = "1.9.0" +name = "actix-rt" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +checksum = "24eda4e2a6e042aa4e55ac438a2ae052d3b5da0ecf83d7411e1a368946925208" dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", + "actix-macros", "futures-core", + "tokio", ] [[package]] -name = "async-channel" -version = "2.3.1" +name = "actix_derive" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +checksum = "7c7db3d5a9718568e4cf4a537cfd7070e6e6ff7481510d0237fb529ac850f6d3" dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", + "proc-macro2", + "quote", + "syn 2.0.72", ] [[package]] -name = "async-executor" -version = "1.13.0" +name = "addr2line" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ - "async-task", - "concurrent-queue", - "fastrand 2.1.0", - "futures-lite 2.3.0", - "slab", + "gimli", ] [[package]] -name = "async-global-executor" -version = "2.4.1" +name = "adler" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" -dependencies = [ - "async-channel 2.3.1", - "async-executor", - "async-io 2.3.3", - "async-lock 3.4.0", - "blocking", - "futures-lite 2.3.0", - "once_cell", -] +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] -name = "async-io" -version = "1.13.0" +name = "aead" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2", - "waker-fn", + "crypto-common", + "generic-array", ] [[package]] -name = "async-io" -version = "2.3.3" +name = "aes" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ - "async-lock 3.4.0", "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite 2.3.0", - "parking", - "polling 3.7.2", - "rustix 0.38.34", - "slab", - "tracing", - "windows-sys 0.52.0", + "cipher", + "cpufeatures", ] [[package]] -name = "async-lock" -version = "2.8.0" +name = "aes-gcm" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ - "event-listener 2.5.3", + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", ] [[package]] -name = "async-lock" -version = "3.4.0" +name = "ahash" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "event-listener 5.3.1", - "event-listener-strategy", - "pin-project-lite", + "cfg-if", + "once_cell", + "version_check", + "zerocopy", ] [[package]] -name = "async-std" -version = "1.12.0" +name = "aho-corasick" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ - "async-channel 1.9.0", - "async-global-executor", - "async-io 1.13.0", - "async-lock 2.8.0", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite 1.13.0", - "gloo-timers", - "kv-log-macro", - "log", "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", ] [[package]] -name = "async-task" -version = "4.7.1" +name = "allocator-api2" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] -name = "atomic-waker" -version = "1.1.2" +name = "alloy" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +checksum = "3f4a4aaae80afd4be443a6aecd92a6b255dcdd000f97996928efb33d8a71e100" +dependencies = [ + "alloy-consensus 0.2.1", + "alloy-contract 0.2.1", + "alloy-core 0.7.7", + "alloy-eips 0.2.1", + "alloy-genesis 0.2.1", + "alloy-network 0.2.1", + "alloy-provider 0.2.1", + "alloy-pubsub 0.2.1", + "alloy-rpc-client 0.2.1", + "alloy-rpc-types 0.2.1", + "alloy-serde 0.2.1", + "alloy-signer 0.2.1", + "alloy-signer-local 0.2.1", + "alloy-transport 0.2.1", + "alloy-transport-http 0.2.1", + "alloy-transport-ipc 0.2.1", + "alloy-transport-ws 0.2.1", +] + +[[package]] +name = "alloy" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c37d89f69cb43901949ba29307ada8b9e3b170f94057ad4c04d6fd169d24d65f" +dependencies = [ + "alloy-consensus 0.3.3", + "alloy-contract 0.3.3", + "alloy-core 0.8.3", + "alloy-eips 0.3.3", + "alloy-genesis 0.3.3", + "alloy-network 0.3.3", + "alloy-provider 0.3.3", + "alloy-pubsub 0.3.5", + "alloy-rpc-client 0.3.3", + "alloy-rpc-types 0.3.5", + "alloy-serde 0.3.3", + "alloy-signer 0.3.3", + "alloy-signer-local 0.3.5", + "alloy-transport 0.3.3", + "alloy-transport-http 0.3.3", + "alloy-transport-ipc 0.3.5", + "alloy-transport-ws 0.3.5", +] [[package]] -name = "autocfg" -version = "1.3.0" +name = "alloy-chains" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "bb07629a5d0645d29f68d2fb6f4d0cf15c89ec0965be915f303967180929743f" +dependencies = [ + "num_enum", + "strum", +] [[package]] -name = "base-x" -version = "0.2.11" +name = "alloy-consensus" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" +checksum = "04c309895995eaa4bfcc345f5515a39c7df9447798645cc8bf462b6c5bf1dc96" +dependencies = [ + "alloy-eips 0.2.1", + "alloy-primitives 0.7.7", + "alloy-rlp", + "alloy-serde 0.2.1", + "c-kzg", + "serde", +] [[package]] -name = "base64ct" -version = "1.6.0" +name = "alloy-consensus" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +checksum = "1468e3128e07c7afe4ff13c17e8170c330d12c322f8924b8bf6986a27e0aad3d" +dependencies = [ + "alloy-eips 0.3.3", + "alloy-primitives 0.8.3", + "alloy-rlp", + "alloy-serde 0.3.3", + "c-kzg", + "serde", +] [[package]] -name = "bitflags" -version = "1.3.2" +name = "alloy-contract" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "3f4e0ef72b0876ae3068b2ed7dfae9ae1779ce13cfaec2ee1f08f5bd0348dc57" +dependencies = [ + "alloy-dyn-abi 0.7.7", + "alloy-json-abi 0.7.7", + "alloy-network 0.2.1", + "alloy-network-primitives 0.2.1", + "alloy-primitives 0.7.7", + "alloy-provider 0.2.1", + "alloy-pubsub 0.2.1", + "alloy-rpc-types-eth 0.2.1", + "alloy-sol-types 0.7.7", + "alloy-transport 0.2.1", + "futures", + "futures-util", + "thiserror", +] [[package]] -name = "bitflags" -version = "2.6.0" +name = "alloy-contract" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "335d62de1a887f1b780441f8a3037f39c9fb26839cc9acd891c9b80396145cd5" +dependencies = [ + "alloy-dyn-abi 0.8.3", + "alloy-json-abi 0.8.3", + "alloy-network 0.3.3", + "alloy-network-primitives 0.3.3", + "alloy-primitives 0.8.3", + "alloy-provider 0.3.3", + "alloy-pubsub 0.3.5", + "alloy-rpc-types-eth 0.3.3", + "alloy-sol-types 0.8.3", + "alloy-transport 0.3.3", + "futures", + "futures-util", + "thiserror", +] [[package]] -name = "block-buffer" -version = "0.10.4" +name = "alloy-core" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +checksum = "529fc6310dc1126c8de51c376cbc59c79c7f662bd742be7dc67055d5421a81b4" dependencies = [ - "generic-array", + "alloy-dyn-abi 0.7.7", + "alloy-json-abi 0.7.7", + "alloy-primitives 0.7.7", + "alloy-sol-types 0.7.7", ] [[package]] -name = "blocking" -version = "1.6.1" +name = "alloy-core" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +checksum = "88b095eb0533144b4497e84a9cc3e44a5c2e3754a3983c0376a55a2f9183a53e" dependencies = [ - "async-channel 2.3.1", - "async-task", - "futures-io", - "futures-lite 2.3.0", - "piper", + "alloy-dyn-abi 0.8.3", + "alloy-json-abi 0.8.3", + "alloy-primitives 0.8.3", + "alloy-sol-types 0.8.3", ] [[package]] -name = "bs58" -version = "0.5.1" +name = "alloy-dyn-abi" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +checksum = "413902aa18a97569e60f679c23f46a18db1656d87ab4d4e49d0e1e52042f66df" dependencies = [ - "tinyvec", + "alloy-json-abi 0.7.7", + "alloy-primitives 0.7.7", + "alloy-sol-type-parser 0.7.7", + "alloy-sol-types 0.7.7", + "const-hex", + "itoa", + "serde", + "serde_json", + "winnow", ] [[package]] -name = "bumpalo" -version = "3.16.0" +name = "alloy-dyn-abi" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "4004925bff5ba0a11739ae84dbb6601a981ea692f3bd45b626935ee90a6b8471" +dependencies = [ + "alloy-json-abi 0.8.3", + "alloy-primitives 0.8.3", + "alloy-sol-type-parser 0.8.3", + "alloy-sol-types 0.8.3", + "const-hex", + "itoa", + "serde", + "serde_json", + "winnow", +] [[package]] -name = "byteorder" -version = "1.5.0" +name = "alloy-eip2930" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +checksum = "0069cf0642457f87a01a014f6dc29d5d893cd4fd8fddf0c3cdfad1bb3ebafc41" +dependencies = [ + "alloy-primitives 0.8.3", + "alloy-rlp", + "serde", +] [[package]] -name = "bytes" -version = "1.7.1" +name = "alloy-eip7702" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "37d319bb544ca6caeab58c39cea8921c55d924d4f68f2c60f24f914673f9a74a" +dependencies = [ + "alloy-primitives 0.8.3", + "alloy-rlp", + "k256", + "serde", +] [[package]] -name = "cfg-if" -version = "1.0.0" +name = "alloy-eips" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "d9431c99a3b3fe606ede4b3d4043bdfbcb780c45b8d8d226c3804e2b75cfbe68" +dependencies = [ + "alloy-primitives 0.7.7", + "alloy-rlp", + "alloy-serde 0.2.1", + "c-kzg", + "derive_more 0.99.18", + "k256", + "once_cell", + "serde", + "sha2", +] [[package]] -name = "concurrent-queue" -version = "2.5.0" +name = "alloy-eips" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +checksum = "0c35df7b972b06f1b2f4e8b7a53328522fa788054a9d3e556faf2411c5a51d5a" dependencies = [ - "crossbeam-utils", + "alloy-eip2930", + "alloy-eip7702", + "alloy-primitives 0.8.3", + "alloy-rlp", + "alloy-serde 0.3.3", + "c-kzg", + "derive_more 1.0.0", + "once_cell", + "serde", + "sha2", ] [[package]] -name = "const-oid" -version = "0.9.6" +name = "alloy-genesis" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +checksum = "79614dfe86144328da11098edcc7bc1a3f25ad8d3134a9eb9e857e06f0d9840d" +dependencies = [ + "alloy-primitives 0.7.7", + "alloy-serde 0.2.1", + "serde", +] [[package]] -name = "core" -version = "0.1.0" +name = "alloy-genesis" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7210f9206c0fa2a83c824cf8cb6c962126bc9fdc4f41ade1932f14150ef5f6" dependencies = [ - "async-std", - "fhe", - "fhe-traits", - "fhe-util", - "libp2p", + "alloy-primitives 0.8.3", + "alloy-serde 0.3.3", + "serde", ] [[package]] -name = "core2" -version = "0.4.0" +name = "alloy-json-abi" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +checksum = "bc05b04ac331a9f07e3a4036ef7926e49a8bf84a99a1ccfc7e2ab55a5fcbb372" dependencies = [ - "memchr", + "alloy-primitives 0.7.7", + "alloy-sol-type-parser 0.7.7", + "serde", + "serde_json", ] [[package]] -name = "cpufeatures" -version = "0.2.12" +name = "alloy-json-abi" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "9996daf962fd0a90d3c93b388033228865953b92de7bb1959b891d78750a4091" dependencies = [ - "libc", + "alloy-primitives 0.8.3", + "alloy-sol-type-parser 0.8.3", + "serde", + "serde_json", ] [[package]] -name = "crossbeam-utils" -version = "0.8.20" +name = "alloy-json-rpc" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "57e2865c4c3bb4cdad3f0d9ec1ab5c0c657ba69a375651bd35e32fb6c180ccc2" +dependencies = [ + "alloy-primitives 0.7.7", + "alloy-sol-types 0.7.7", + "serde", + "serde_json", + "thiserror", + "tracing", +] [[package]] -name = "crypto-common" -version = "0.1.6" +name = "alloy-json-rpc" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "8866562186d237f1dfeaf989ef941a24764f764bf5c33311e37ead3519c6a429" dependencies = [ - "generic-array", - "typenum", + "alloy-primitives 0.8.3", + "alloy-sol-types 0.8.3", + "serde", + "serde_json", + "thiserror", + "tracing", ] [[package]] -name = "curve25519-dalek" -version = "4.1.3" +name = "alloy-network" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" -dependencies = [ - "cfg-if", - "cpufeatures", - "curve25519-dalek-derive", - "digest", - "fiat-crypto", - "rustc_version", - "subtle", - "zeroize", +checksum = "6e701fc87ef9a3139154b0b4ccb935b565d27ffd9de020fe541bf2dec5ae4ede" +dependencies = [ + "alloy-consensus 0.2.1", + "alloy-eips 0.2.1", + "alloy-json-rpc 0.2.1", + "alloy-network-primitives 0.2.1", + "alloy-primitives 0.7.7", + "alloy-rpc-types-eth 0.2.1", + "alloy-serde 0.2.1", + "alloy-signer 0.2.1", + "alloy-sol-types 0.7.7", + "async-trait", + "auto_impl", + "futures-utils-wasm", + "thiserror", ] [[package]] -name = "curve25519-dalek-derive" -version = "0.1.1" +name = "alloy-network" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", +checksum = "abe714e233f9eaf410de95a9af6bcd05d3a7f8c8de7a0817221e95a6b642a080" +dependencies = [ + "alloy-consensus 0.3.3", + "alloy-eips 0.3.3", + "alloy-json-rpc 0.3.3", + "alloy-network-primitives 0.3.3", + "alloy-primitives 0.8.3", + "alloy-rpc-types-eth 0.3.3", + "alloy-serde 0.3.3", + "alloy-signer 0.3.3", + "alloy-sol-types 0.8.3", + "async-trait", + "auto_impl", + "futures-utils-wasm", + "thiserror", ] [[package]] -name = "data-encoding" -version = "2.6.0" +name = "alloy-network-primitives" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "ec9d5a0f9170b10988b6774498a022845e13eda94318440d17709d50687f67f9" +dependencies = [ + "alloy-primitives 0.7.7", + "alloy-serde 0.2.1", + "serde", +] [[package]] -name = "data-encoding-macro" -version = "0.1.15" +name = "alloy-network-primitives" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1559b6cba622276d6d63706db152618eeb15b89b3e4041446b05876e352e639" +checksum = "8c5a38117974c5776a45e140226745a0b664f79736aa900995d8e4121558e064" dependencies = [ - "data-encoding", - "data-encoding-macro-internal", + "alloy-eips 0.3.3", + "alloy-primitives 0.8.3", + "alloy-serde 0.3.3", + "serde", ] [[package]] -name = "data-encoding-macro-internal" -version = "0.1.13" +name = "alloy-primitives" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332d754c0af53bc87c108fed664d121ecf59207ec4196041f04d6ab9002ad33f" +checksum = "600d34d8de81e23b6d909c094e23b3d357e01ca36b78a8c5424c501eedbe86f0" dependencies = [ - "data-encoding", - "syn 1.0.109", + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 0.99.18", + "hex-literal", + "itoa", + "k256", + "keccak-asm", + "proptest", + "rand", + "ruint", + "serde", + "tiny-keccak", ] [[package]] -name = "der" -version = "0.7.9" +name = "alloy-primitives" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" dependencies = [ - "const-oid", - "zeroize", + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 0.99.18", + "hex-literal", + "itoa", + "k256", + "keccak-asm", + "proptest", + "rand", + "ruint", + "serde", + "tiny-keccak", ] [[package]] -name = "digest" -version = "0.10.7" +name = "alloy-primitives" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +checksum = "411aff151f2a73124ee473708e82ed51b2535f68928b6a1caa8bc1246ae6f7cd" dependencies = [ - "block-buffer", - "crypto-common", - "subtle", + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more 1.0.0", + "hex-literal", + "itoa", + "k256", + "keccak-asm", + "proptest", + "rand", + "ruint", + "serde", + "tiny-keccak", ] [[package]] -name = "doc-comment" +name = "alloy-provider" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9c0ab10b93de601a6396fc7ff2ea10d3b28c46f079338fa562107ebf9857c8" +dependencies = [ + "alloy-chains", + "alloy-consensus 0.2.1", + "alloy-eips 0.2.1", + "alloy-json-rpc 0.2.1", + "alloy-network 0.2.1", + "alloy-network-primitives 0.2.1", + "alloy-primitives 0.7.7", + "alloy-pubsub 0.2.1", + "alloy-rpc-client 0.2.1", + "alloy-rpc-types-eth 0.2.1", + "alloy-transport 0.2.1", + "alloy-transport-http 0.2.1", + "alloy-transport-ipc 0.2.1", + "alloy-transport-ws 0.2.1", + "async-stream", + "async-trait", + "auto_impl", + "dashmap 5.5.3", + "futures", + "futures-utils-wasm", + "lru", + "pin-project", + "reqwest", + "serde", + "serde_json", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "alloy-provider" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" +checksum = "c65633d6ef83c3626913c004eaf166a6dd50406f724772ea8567135efd6dc5d3" +dependencies = [ + "alloy-chains", + "alloy-consensus 0.3.3", + "alloy-eips 0.3.3", + "alloy-json-rpc 0.3.3", + "alloy-network 0.3.3", + "alloy-network-primitives 0.3.3", + "alloy-primitives 0.8.3", + "alloy-pubsub 0.3.5", + "alloy-rpc-client 0.3.3", + "alloy-rpc-types-eth 0.3.3", + "alloy-transport 0.3.3", + "alloy-transport-http 0.3.3", + "alloy-transport-ipc 0.3.5", + "alloy-transport-ws 0.3.5", + "async-stream", + "async-trait", + "auto_impl", + "dashmap 6.1.0", + "futures", + "futures-utils-wasm", + "lru", + "pin-project", + "reqwest", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "url", +] [[package]] -name = "ed25519" -version = "2.2.3" +name = "alloy-pubsub" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +checksum = "3f5da2c55cbaf229bad3c5f8b00b5ab66c74ef093e5f3a753d874cfecf7d2281" dependencies = [ - "pkcs8", - "signature", + "alloy-json-rpc 0.2.1", + "alloy-primitives 0.7.7", + "alloy-transport 0.2.1", + "bimap", + "futures", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tower 0.4.13", + "tracing", ] [[package]] -name = "ed25519-dalek" -version = "2.1.1" +name = "alloy-pubsub" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +checksum = "34b9f5e85120aab30b8da23354592f7bd2b208d33d3204ffa1d44ac2e3dd5691" dependencies = [ - "curve25519-dalek", - "ed25519", - "rand_core", + "alloy-json-rpc 0.3.3", + "alloy-primitives 0.8.3", + "alloy-transport 0.3.3", + "bimap", + "futures", "serde", - "sha2", - "subtle", - "zeroize", + "serde_json", + "tokio", + "tokio-stream", + "tower 0.5.1", + "tracing", ] [[package]] -name = "either" -version = "1.13.0" +name = "alloy-rlp" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" +dependencies = [ + "alloy-rlp-derive", + "arrayvec", + "bytes", +] [[package]] -name = "enclave" -version = "0.1.0" +name = "alloy-rlp-derive" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" dependencies = [ - "async-std", - "eth", - "fhe", - "fhe-traits", - "fhe-util", + "proc-macro2", + "quote", + "syn 2.0.72", ] [[package]] -name = "enclave_node" -version = "0.1.0" +name = "alloy-rpc-client" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b38e3ffdb285df5d9f60cb988d336d9b8e3505acb78750c3bc60336a7af41d3" dependencies = [ - "async-std", - "eth", - "fhe", - "fhe-traits", - "fhe-util", + "alloy-json-rpc 0.2.1", + "alloy-primitives 0.7.7", + "alloy-pubsub 0.2.1", + "alloy-transport 0.2.1", + "alloy-transport-http 0.2.1", + "alloy-transport-ipc 0.2.1", + "alloy-transport-ws 0.2.1", + "futures", + "pin-project", + "reqwest", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tower 0.4.13", + "tracing", + "url", ] [[package]] -name = "equivalent" -version = "1.0.1" +name = "alloy-rpc-client" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "d5fc328bb5d440599ba1b5aa44c0b9ab0625fbc3a403bb5ee94ed4a01ba23e07" +dependencies = [ + "alloy-json-rpc 0.3.3", + "alloy-primitives 0.8.3", + "alloy-pubsub 0.3.5", + "alloy-transport 0.3.3", + "alloy-transport-http 0.3.3", + "alloy-transport-ipc 0.3.5", + "alloy-transport-ws 0.3.5", + "futures", + "pin-project", + "reqwest", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tower 0.5.1", + "tracing", + "url", +] [[package]] -name = "errno" -version = "0.3.9" +name = "alloy-rpc-types" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "e6c31a3750b8f5a350d17354e46a52b0f2f19ec5f2006d816935af599dedc521" dependencies = [ - "libc", - "windows-sys 0.52.0", + "alloy-rpc-types-engine 0.2.1", + "alloy-rpc-types-eth 0.2.1", + "alloy-serde 0.2.1", + "serde", ] [[package]] -name = "eth" -version = "0.1.0" +name = "alloy-rpc-types" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22045187a5ebf5b2af3f8b6831b66735b6556c5750ec5790aeeb45935260c1c2" dependencies = [ - "async-std", - "fhe", - "fhe-traits", - "fhe-util", + "alloy-rpc-types-engine 0.3.5", + "alloy-rpc-types-eth 0.3.3", + "alloy-serde 0.3.3", + "serde", ] [[package]] -name = "ethnum" -version = "1.5.0" +name = "alloy-rpc-types-engine" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b90ca2580b73ab6a1f724b76ca11ab632df820fd6040c336200d2c1df7b3c82c" +checksum = "ff63f51b2fb2f547df5218527fd0653afb1947bf7fead5b3ce58c75d170b30f7" +dependencies = [ + "alloy-consensus 0.2.1", + "alloy-eips 0.2.1", + "alloy-primitives 0.7.7", + "alloy-rlp", + "alloy-rpc-types-eth 0.2.1", + "alloy-serde 0.2.1", + "jsonwebtoken", + "rand", + "serde", + "thiserror", +] [[package]] -name = "event-listener" -version = "2.5.3" +name = "alloy-rpc-types-engine" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +checksum = "1c031a91e94a39f928244bc837c953817be5b8cc61759e1a9123b3abd17560dd" +dependencies = [ + "alloy-consensus 0.3.3", + "alloy-eips 0.3.3", + "alloy-primitives 0.8.3", + "alloy-rlp", + "derive_more 1.0.0", +] [[package]] -name = "event-listener" -version = "5.3.1" +name = "alloy-rpc-types-eth" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +checksum = "81e18424d962d7700a882fe423714bd5b9dde74c7a7589d4255ea64068773aef" dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", + "alloy-consensus 0.2.1", + "alloy-eips 0.2.1", + "alloy-network-primitives 0.2.1", + "alloy-primitives 0.7.7", + "alloy-rlp", + "alloy-serde 0.2.1", + "alloy-sol-types 0.7.7", + "itertools 0.13.0", + "serde", + "serde_json", + "thiserror", ] [[package]] -name = "event-listener-strategy" -version = "0.5.2" +name = "alloy-rpc-types-eth" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +checksum = "9a59b1d7c86e0a653e7f3d29954f6de5a2878d8cfd1f010ff93be5c2c48cd3b1" dependencies = [ - "event-listener 5.3.1", - "pin-project-lite", + "alloy-consensus 0.3.3", + "alloy-eips 0.3.3", + "alloy-network-primitives 0.3.3", + "alloy-primitives 0.8.3", + "alloy-rlp", + "alloy-serde 0.3.3", + "alloy-sol-types 0.8.3", + "itertools 0.13.0", + "serde", + "serde_json", + "thiserror", ] [[package]] -name = "fastrand" -version = "1.9.0" +name = "alloy-serde" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +checksum = "e33feda6a53e6079895aed1d08dcb98a1377b000d80d16370fbbdb8155d547ef" dependencies = [ - "instant", + "alloy-primitives 0.7.7", + "serde", + "serde_json", ] [[package]] -name = "fastrand" -version = "2.1.0" +name = "alloy-serde" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "51db8a6428a2159e01b7a43ec7aac801edd0c4db1d4de06f310c288940f16fd3" +dependencies = [ + "alloy-primitives 0.8.3", + "serde", + "serde_json", +] [[package]] -name = "fhe" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#9624766dcfbb40ecfb01147f59c2f6292c447707" +name = "alloy-signer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "740a25b92e849ed7b0fa013951fe2f64be9af1ad5abe805037b44fb7770c5c47" dependencies = [ - "doc-comment", - "fhe-math", - "fhe-traits", - "fhe-util", - "itertools", - "ndarray", - "num-bigint", - "num-traits", - "prost", - "prost-build", - "rand", - "rand_chacha", - "serde", + "alloy-primitives 0.7.7", + "async-trait", + "auto_impl", + "elliptic-curve", + "k256", "thiserror", - "zeroize", - "zeroize_derive", ] [[package]] -name = "fhe-math" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#9624766dcfbb40ecfb01147f59c2f6292c447707" +name = "alloy-signer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bebc1760c13592b7ba3fcd964abba546b8d6a9f10d15e8d92a8263731be33f36" dependencies = [ - "ethnum", - "fhe-traits", - "fhe-util", - "itertools", - "ndarray", - "num-bigint", - "num-bigint-dig", - "num-traits", - "prost", - "prost-build", - "rand", - "rand_chacha", - "sha2", + "alloy-primitives 0.8.3", + "async-trait", + "auto_impl", + "elliptic-curve", + "k256", "thiserror", - "zeroize", ] [[package]] -name = "fhe-traits" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#9624766dcfbb40ecfb01147f59c2f6292c447707" +name = "alloy-signer-local" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b0707d4f63e4356a110b30ef3add8732ab6d181dd7be4607bf79b8777105cee" dependencies = [ + "alloy-consensus 0.2.1", + "alloy-network 0.2.1", + "alloy-primitives 0.7.7", + "alloy-signer 0.2.1", + "async-trait", + "k256", "rand", + "thiserror", ] [[package]] -name = "fhe-util" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#9624766dcfbb40ecfb01147f59c2f6292c447707" +name = "alloy-signer-local" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99e250010dce0e3caf6a6033e809718e5921391d937d1cbbcffe52653b37cc63" dependencies = [ - "itertools", - "num-bigint-dig", - "num-traits", + "alloy-consensus 0.3.3", + "alloy-network 0.3.3", + "alloy-primitives 0.8.3", + "alloy-signer 0.3.3", + "async-trait", + "k256", "rand", + "thiserror", ] [[package]] -name = "fiat-crypto" -version = "0.2.9" +name = "alloy-sol-macro" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" +checksum = "e86ec0a47740b20bc5613b8712d0d321d031c4efc58e9645af96085d5cccfc27" +dependencies = [ + "const-hex", + "dunce", + "heck 0.4.1", + "indexmap", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.72", + "syn-solidity 0.6.4", + "tiny-keccak", +] [[package]] -name = "fixedbitset" -version = "0.4.2" +name = "alloy-sol-macro" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +checksum = "2b40397ddcdcc266f59f959770f601ce1280e699a91fc1862f29cef91707cd09" +dependencies = [ + "alloy-sol-macro-expander 0.7.7", + "alloy-sol-macro-input 0.7.7", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.72", +] [[package]] -name = "fnv" -version = "1.0.7" +name = "alloy-sol-macro" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +checksum = "0458ccb02a564228fcd76efb8eb5a520521a8347becde37b402afec9a1b83859" +dependencies = [ + "alloy-sol-macro-expander 0.8.3", + "alloy-sol-macro-input 0.8.3", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.72", +] [[package]] -name = "form_urlencoded" -version = "1.2.1" +name = "alloy-sol-macro-expander" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "867a5469d61480fea08c7333ffeca52d5b621f5ca2e44f271b117ec1fc9a0525" dependencies = [ - "percent-encoding", + "alloy-json-abi 0.7.7", + "alloy-sol-macro-input 0.7.7", + "const-hex", + "heck 0.5.0", + "indexmap", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.72", + "syn-solidity 0.7.7", + "tiny-keccak", ] [[package]] -name = "futures" -version = "0.3.30" +name = "alloy-sol-macro-expander" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "2bc65475025fc1e84bf86fc840f04f63fcccdcf3cf12053c99918e4054dfbc69" dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", + "alloy-json-abi 0.8.3", + "alloy-sol-macro-input 0.8.3", + "const-hex", + "heck 0.5.0", + "indexmap", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.72", + "syn-solidity 0.8.3", + "tiny-keccak", ] [[package]] -name = "futures-channel" -version = "0.3.30" +name = "alloy-sol-macro-input" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2e482dc33a32b6fadbc0f599adea520bd3aaa585c141a80b404d0a3e3fa72528" dependencies = [ - "futures-core", - "futures-sink", + "alloy-json-abi 0.7.7", + "const-hex", + "dunce", + "heck 0.5.0", + "proc-macro2", + "quote", + "serde_json", + "syn 2.0.72", + "syn-solidity 0.7.7", ] [[package]] -name = "futures-core" -version = "0.3.30" +name = "alloy-sol-macro-input" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "6ed10f0715a0b69fde3236ff3b9ae5f6f7c97db5a387747100070d3016b9266b" +dependencies = [ + "alloy-json-abi 0.8.3", + "const-hex", + "dunce", + "heck 0.5.0", + "proc-macro2", + "quote", + "serde_json", + "syn 2.0.72", + "syn-solidity 0.8.3", +] [[package]] -name = "futures-executor" -version = "0.3.30" +name = "alloy-sol-type-parser" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "cbcba3ca07cf7975f15d871b721fb18031eec8bce51103907f6dcce00b255d98" dependencies = [ - "futures-core", - "futures-task", - "futures-util", - "num_cpus", + "serde", + "winnow", ] [[package]] -name = "futures-io" -version = "0.3.30" +name = "alloy-sol-type-parser" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "3edae8ea1de519ccba896b6834dec874230f72fe695ff3c9c118e90ec7cff783" +dependencies = [ + "serde", + "winnow", +] [[package]] -name = "futures-lite" -version = "1.13.0" +name = "alloy-sol-types" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +checksum = "ad09ec5853fa700d12d778ad224dcdec636af424d29fad84fb9a2f16a5b0ef09" dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", + "alloy-primitives 0.6.4", + "alloy-sol-macro 0.6.4", + "const-hex", + "serde", ] [[package]] -name = "futures-lite" -version = "2.3.0" +name = "alloy-sol-types" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +checksum = "a91ca40fa20793ae9c3841b83e74569d1cc9af29a2f5237314fd3452d51e38c7" dependencies = [ - "fastrand 2.1.0", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", + "alloy-json-abi 0.7.7", + "alloy-primitives 0.7.7", + "alloy-sol-macro 0.7.7", + "const-hex", + "serde", ] [[package]] -name = "futures-macro" -version = "0.3.30" +name = "alloy-sol-types" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "1eb88e4da0a1b697ed6a9f811fdba223cf4d5c21410804fd1707836af73a462b" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", + "alloy-json-abi 0.8.3", + "alloy-primitives 0.8.3", + "alloy-sol-macro 0.8.3", + "const-hex", + "serde", ] [[package]] -name = "futures-sink" -version = "0.3.30" +name = "alloy-transport" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "3d0590afbdacf2f8cca49d025a2466f3b6584a016a8b28f532f29f8da1007bae" +dependencies = [ + "alloy-json-rpc 0.2.1", + "base64 0.22.1", + "futures-util", + "futures-utils-wasm", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower 0.4.13", + "tracing", + "url", +] [[package]] -name = "futures-task" -version = "0.3.30" +name = "alloy-transport" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "fd5dc4e902f1860d54952446d246ac05386311ad61030a2b906ae865416d36e0" +dependencies = [ + "alloy-json-rpc 0.3.3", + "base64 0.22.1", + "futures-util", + "futures-utils-wasm", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower 0.5.1", + "tracing", + "url", +] [[package]] -name = "futures-timer" -version = "3.0.3" +name = "alloy-transport-http" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" +checksum = "2437d145d80ea1aecde8574d2058cceb8b3c9cba05f6aea8e67907c660d46698" +dependencies = [ + "alloy-json-rpc 0.2.1", + "alloy-transport 0.2.1", + "reqwest", + "serde_json", + "tower 0.4.13", + "tracing", + "url", +] [[package]] -name = "futures-util" -version = "0.3.30" +name = "alloy-transport-http" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "1742b94bb814f1ca6b322a6f9dd38a0252ff45a3119e40e888fb7029afa500ce" dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", + "alloy-json-rpc 0.3.3", + "alloy-transport 0.3.3", + "reqwest", + "serde_json", + "tower 0.5.1", + "tracing", + "url", ] [[package]] -name = "generic-array" -version = "0.14.7" +name = "alloy-transport-ipc" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +checksum = "804494366e20468776db4e18f9eb5db7db0fe14f1271eb6dbf155d867233405c" dependencies = [ - "typenum", - "version_check", + "alloy-json-rpc 0.2.1", + "alloy-pubsub 0.2.1", + "alloy-transport 0.2.1", + "bytes", + "futures", + "interprocess", + "pin-project", + "serde_json", + "tokio", + "tokio-util", + "tracing", ] [[package]] -name = "getrandom" -version = "0.2.15" +name = "alloy-transport-ipc" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "9aa02db8751f9c0c37caf8c38ad3eb7aa1cfb09cfea3451a13aacaf06846c7a5" dependencies = [ - "cfg-if", - "libc", - "wasi", + "alloy-json-rpc 0.3.3", + "alloy-pubsub 0.3.5", + "alloy-transport 0.3.3", + "bytes", + "futures", + "interprocess", + "pin-project", + "serde_json", + "tokio", + "tokio-util", + "tracing", ] [[package]] -name = "gloo-timers" -version = "0.2.6" +name = "alloy-transport-ws" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +checksum = "af855163e7df008799941aa6dd324a43ef2bf264b08ba4b22d44aad6ced65300" dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", + "alloy-pubsub 0.2.1", + "alloy-transport 0.2.1", + "futures", + "http 1.1.0", + "rustls", + "serde_json", + "tokio", + "tokio-tungstenite", + "tracing", + "ws_stream_wasm", ] [[package]] -name = "hashbrown" -version = "0.14.5" +name = "alloy-transport-ws" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "b0a5c4a0929479bcb85a2df628c01173618a71c807b2f499939a236dbde5d008" dependencies = [ - "ahash", - "allocator-api2", + "alloy-pubsub 0.3.5", + "alloy-transport 0.3.3", + "futures", + "http 1.1.0", + "rustls", + "serde_json", + "tokio", + "tokio-tungstenite", + "tracing", + "ws_stream_wasm", ] [[package]] -name = "heck" -version = "0.5.0" +name = "anstream" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] [[package]] -name = "hermit-abi" -version = "0.3.9" +name = "anstyle" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] -name = "hermit-abi" -version = "0.4.0" +name = "anstyle-parse" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +dependencies = [ + "utf8parse", +] [[package]] -name = "hkdf" -version = "0.12.4" +name = "anstyle-query" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ - "hmac", + "windows-sys 0.52.0", ] [[package]] -name = "hmac" -version = "0.12.1" +name = "anstyle-wincon" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ - "digest", + "anstyle", + "windows-sys 0.52.0", ] [[package]] -name = "idna" -version = "0.5.0" +name = "anyhow" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.0", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "arrayref" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "asn1-rs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048" +dependencies = [ + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "async-attributes" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand 2.1.0", + "futures-lite 2.3.0", + "slab", +] + +[[package]] +name = "async-fs" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "blocking", + "futures-lite 1.13.0", +] + +[[package]] +name = "async-global-executor" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" +dependencies = [ + "async-channel 2.3.1", + "async-executor", + "async-io 2.3.3", + "async-lock 3.4.0", + "blocking", + "futures-lite 2.3.0", + "once_cell", +] + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite 1.13.0", + "log", + "parking", + "polling 2.8.0", + "rustix 0.37.27", + "slab", + "socket2 0.4.10", + "waker-fn", +] + +[[package]] +name = "async-io" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +dependencies = [ + "async-lock 3.4.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.3.0", + "parking", + "polling 3.7.2", + "rustix 0.38.34", + "slab", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener 5.3.1", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-net" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0434b1ed18ce1cf5769b8ac540e33f01fa9471058b5e89da9e06f3c882a8c12f" +dependencies = [ + "async-io 1.13.0", + "blocking", + "futures-lite 1.13.0", +] + +[[package]] +name = "async-process" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" +dependencies = [ + "async-io 1.13.0", + "async-lock 2.8.0", + "async-signal", + "blocking", + "cfg-if", + "event-listener 3.1.0", + "futures-lite 1.13.0", + "rustix 0.38.34", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-signal" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" +dependencies = [ + "async-io 2.3.3", + "async-lock 3.4.0", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 0.38.34", + "signal-hook-registry", + "slab", + "windows-sys 0.59.0", +] + +[[package]] +name = "async-std" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +dependencies = [ + "async-attributes", + "async-channel 1.9.0", + "async-global-executor", + "async-io 1.13.0", + "async-lock 2.8.0", + "async-process", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite 1.13.0", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + +[[package]] +name = "async-std-resolver" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc3b454643291f9a4a3bbdb35fa62efa4ba7be5ea13fe243e3be4352182ff4b8" +dependencies = [ + "async-std", + "async-trait", + "futures-io", + "futures-util", + "hickory-resolver", + "pin-utils", + "socket2 0.5.7", +] + +[[package]] +name = "async-stream" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "async_io_stream" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" +dependencies = [ + "futures", + "pharos", + "rustc_version 0.4.0", +] + +[[package]] +name = "asynchronous-codec" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" +dependencies = [ + "bytes", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite", +] + +[[package]] +name = "asynchronous-codec" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a860072022177f903e59730004fb5dc13db9275b79bb2aef7ba8ce831956c233" +dependencies = [ + "bytes", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "attohttpc" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d9a9bf8b79a749ee0b911b91b671cc2b6c670bdbc7e3dfd537576ddc94bb2a2" +dependencies = [ + "http 0.2.12", + "log", + "url", +] + +[[package]] +name = "auto_impl" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "backtrace" +version = "0.3.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base-x" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "base91" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4eb5fbae7b5ee422f239444a3dca9bdf5ecb3abf3af1bf87c8097db3f7bc025" + +[[package]] +name = "bfv" +version = "0.1.0" +dependencies = [ + "async-std", + "fhe", + "fhe-traits", + "fhe-util", + "rand", +] + +[[package]] +name = "bimap" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blocking" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +dependencies = [ + "async-channel 2.3.1", + "async-task", + "futures-io", + "futures-lite 2.3.0", + "piper", +] + +[[package]] +name = "blst" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4378725facc195f1a538864863f6de233b500a8862747e7f165078a419d5e874" +dependencies = [ + "cc", + "glob", + "threadpool", + "zeroize", +] + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +dependencies = [ + "serde", +] + +[[package]] +name = "c-kzg" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0307f72feab3300336fb803a57134159f6e20139af1357f36c54cb90d8e8928" +dependencies = [ + "blst", + "cc", + "glob", + "hex", + "libc", + "once_cell", + "serde", +] + +[[package]] +name = "cc" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9e8aabfac534be767c909e0690571677d49f41bd8465ae876fe043d52ba5292" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chacha20" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "chacha20poly1305" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" +dependencies = [ + "aead", + "chacha20", + "cipher", + "poly1305", + "zeroize", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", + "zeroize", +] + +[[package]] +name = "clap" +version = "4.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "clap_lex" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" + +[[package]] +name = "colorchoice" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-hex" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" +dependencies = [ + "cfg-if", + "cpufeatures", + "hex", + "proptest", + "serde", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "rand_core", + "typenum", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "rustc_version 0.4.0", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "data-encoding" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" + +[[package]] +name = "data-encoding-macro" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1559b6cba622276d6d63706db152618eeb15b89b3e4041446b05876e352e639" +dependencies = [ + "data-encoding", + "data-encoding-macro-internal", +] + +[[package]] +name = "data-encoding-macro-internal" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "332d754c0af53bc87c108fed664d121ecf59207ec4196041f04d6ab9002ad33f" +dependencies = [ + "data-encoding", + "syn 1.0.109", +] + +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "der-parser" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" +dependencies = [ + "asn1-rs", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version 0.4.0", + "syn 2.0.72", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "doctest-file" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" + +[[package]] +name = "dtoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand_core", + "serde", + "sha2", + "subtle", + "zeroize", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "enclave" +version = "0.1.0" +dependencies = [ + "async-std", + "fhe", + "fhe-traits", + "fhe-util", +] + +[[package]] +name = "enclave-core" +version = "0.1.0" +dependencies = [ + "actix", + "actix-rt", + "alloy 0.3.3", + "alloy-primitives 0.6.4", + "alloy-sol-types 0.6.4", + "anyhow", + "async-std", + "base64 0.22.1", + "base91", + "bincode", + "bs58", + "fhe", + "fhe-traits", + "fhe-util", + "futures-util", + "libp2p", + "p2p", + "rand", + "rand_chacha", + "secp256k1", + "serde", + "sha2", + "sortition", + "tokio", +] + +[[package]] +name = "enclave_node" +version = "0.1.0" +dependencies = [ + "actix-rt", + "alloy 0.2.1", + "alloy-primitives 0.6.4", + "async-std", + "base64 0.22.1", + "base91", + "bfv", + "bincode", + "clap", + "enclave-core", + "fhe", + "fhe-traits", + "fhe-util", + "p2p", + "rand", + "rand_chacha", + "sortition", + "tokio", +] + +[[package]] +name = "enum-as-inner" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "ethnum" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b90ca2580b73ab6a1f724b76ca11ab632df820fd6040c336200d2c1df7b3c82c" + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener" +version = "5.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener 5.3.1", + "pin-project-lite", +] + +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fastrand" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" + +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fhe" +version = "0.1.0-beta.7" +source = "git+https://github.com/gnosisguild/fhe.rs#9624766dcfbb40ecfb01147f59c2f6292c447707" +dependencies = [ + "doc-comment", + "fhe-math", + "fhe-traits", + "fhe-util", + "itertools 0.12.1", + "ndarray", + "num-bigint", + "num-traits", + "prost", + "prost-build", + "rand", + "rand_chacha", + "serde", + "thiserror", + "zeroize", + "zeroize_derive", +] + +[[package]] +name = "fhe-math" +version = "0.1.0-beta.7" +source = "git+https://github.com/gnosisguild/fhe.rs#9624766dcfbb40ecfb01147f59c2f6292c447707" +dependencies = [ + "ethnum", + "fhe-traits", + "fhe-util", + "itertools 0.12.1", + "ndarray", + "num-bigint", + "num-bigint-dig", + "num-traits", + "prost", + "prost-build", + "rand", + "rand_chacha", + "sha2", + "thiserror", + "zeroize", +] + +[[package]] +name = "fhe-traits" +version = "0.1.0-beta.7" +source = "git+https://github.com/gnosisguild/fhe.rs#9624766dcfbb40ecfb01147f59c2f6292c447707" +dependencies = [ + "rand", +] + +[[package]] +name = "fhe-util" +version = "0.1.0-beta.7" +source = "git+https://github.com/gnosisguild/fhe.rs#9624766dcfbb40ecfb01147f59c2f6292c447707" +dependencies = [ + "itertools 0.12.1", + "num-bigint-dig", + "num-traits", + "rand", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-bounded" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91f328e7fb845fc832912fb6a34f40cf6d1888c92f974d1893a54e97b5ff542e" +dependencies = [ + "futures-timer", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-lite" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +dependencies = [ + "fastrand 2.1.0", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "futures-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" +dependencies = [ + "futures-io", + "rustls", + "rustls-pki-types", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-ticker" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9763058047f713632a52e916cc7f6a4b3fc6e9fc1ff8c5b1dc49e5a89041682e" +dependencies = [ + "futures", + "futures-timer", + "instant", +] + +[[package]] +name = "futures-timer" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "futures-utils-wasm" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "ghash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +dependencies = [ + "opaque-debug", + "polyval", +] + +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hex_fmt" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" + +[[package]] +name = "hickory-proto" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.4.0", + "ipnet", + "once_cell", + "rand", + "socket2 0.5.7", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "hickory-resolver" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot", + "rand", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2 0.5.7", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.4.1", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "hyper 1.4.1", + "pin-project-lite", + "socket2 0.5.7", + "tokio", + "tower 0.4.13", + "tower-service", + "tracing", +] + +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ "unicode-bidi", "unicode-normalization", ] [[package]] -name = "indexmap" -version = "2.3.0" +name = "if-addrs" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cabb0019d51a643781ff15c9c8a3e5dedc365c47211270f4e8f82812fedd8f0a" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "if-watch" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" +dependencies = [ + "async-io 2.3.3", + "core-foundation", + "fnv", + "futures", + "if-addrs", + "ipnet", + "log", + "rtnetlink", + "smol", + "system-configuration", + "tokio", + "windows", +] + +[[package]] +name = "igd-next" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "064d90fec10d541084e7b39ead8875a5a80d9114a2b18791565253bae25f49e4" +dependencies = [ + "async-trait", + "attohttpc", + "bytes", + "futures", + "http 0.2.12", + "hyper 0.14.30", + "log", + "rand", + "tokio", + "url", + "xmltree", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "interprocess" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2f4e4a06d42fab3e85ab1b419ad32b09eab58b901d40c57935ff92db3287a13" +dependencies = [ + "doctest-file", + "futures-core", + "libc", + "recvmsg", + "tokio", + "widestring", + "windows-sys 0.52.0", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ipconfig" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" +dependencies = [ + "socket2 0.5.7", + "widestring", + "windows-sys 0.48.0", + "winreg", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jsonwebtoken" +version = "9.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" +dependencies = [ + "base64 0.21.7", + "js-sys", + "pem", + "ring 0.17.8", + "serde", + "serde_json", + "simple_asn1", +] + +[[package]] +name = "k256" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2", + "signature", +] + +[[package]] +name = "keccak-asm" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "422fbc7ff2f2f5bdffeb07718e5a5324dca72b0c9293d50df4026652385e3314" +dependencies = [ + "digest 0.10.7", + "sha3-asm", +] + +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin 0.9.8", +] + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libp2p" +version = "0.53.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681fb3f183edfbedd7a57d32ebe5dcdc0b9f94061185acf3c30249349cc6fc99" +dependencies = [ + "bytes", + "either", + "futures", + "futures-timer", + "getrandom", + "instant", + "libp2p-allow-block-list", + "libp2p-connection-limits", + "libp2p-core 0.41.3", + "libp2p-dns", + "libp2p-gossipsub 0.46.1", + "libp2p-identify 0.44.2", + "libp2p-identity", + "libp2p-mdns", + "libp2p-metrics", + "libp2p-noise", + "libp2p-ping 0.44.1", + "libp2p-quic", + "libp2p-rendezvous", + "libp2p-swarm 0.44.2", + "libp2p-tcp", + "libp2p-upnp", + "libp2p-yamux", + "multiaddr", + "pin-project", + "rw-stream-sink", + "thiserror", +] + +[[package]] +name = "libp2p-allow-block-list" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "107b238b794cb83ab53b74ad5dcf7cca3200899b72fe662840cfb52f5b0a32e6" +dependencies = [ + "libp2p-core 0.41.3", + "libp2p-identity", + "libp2p-swarm 0.44.2", + "void", +] + +[[package]] +name = "libp2p-connection-limits" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7cd50a78ccfada14de94cbacd3ce4b0138157f376870f13d3a8422cd075b4fd" +dependencies = [ + "libp2p-core 0.41.3", + "libp2p-identity", + "libp2p-swarm 0.44.2", + "void", +] + +[[package]] +name = "libp2p-core" +version = "0.41.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5a8920cbd8540059a01950c1e5c96ea8d89eb50c51cd366fc18bdf540a6e48f" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "libp2p-identity", + "multiaddr", + "multihash", + "multistream-select", + "once_cell", + "parking_lot", + "pin-project", + "quick-protobuf", + "rand", + "rw-stream-sink", + "smallvec", + "thiserror", + "tracing", + "unsigned-varint 0.8.0", + "void", + "web-time", +] + +[[package]] +name = "libp2p-core" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a61f26c83ed111104cd820fe9bc3aaabbac5f1652a1d213ed6e900b7918a1298" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "libp2p-identity", + "multiaddr", + "multihash", + "multistream-select", + "once_cell", + "parking_lot", + "pin-project", + "quick-protobuf", + "rand", + "rw-stream-sink", + "smallvec", + "thiserror", + "tracing", + "unsigned-varint 0.8.0", + "void", + "web-time", +] + +[[package]] +name = "libp2p-dns" +version = "0.41.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d17cbcf7160ff35c3e8e560de4a068fe9d6cb777ea72840e48eb76ff9576c4b6" +dependencies = [ + "async-std-resolver", + "async-trait", + "futures", + "hickory-resolver", + "libp2p-core 0.41.3", + "libp2p-identity", + "parking_lot", + "smallvec", + "tracing", +] + +[[package]] +name = "libp2p-gossipsub" +version = "0.46.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d665144a616dadebdc5fff186b1233488cdcd8bfb1223218ff084b6d052c94f7" +dependencies = [ + "asynchronous-codec 0.7.0", + "base64 0.21.7", + "byteorder", + "bytes", + "either", + "fnv", + "futures", + "futures-ticker", + "getrandom", + "hex_fmt", + "instant", + "libp2p-core 0.41.3", + "libp2p-identity", + "libp2p-swarm 0.44.2", + "prometheus-client", + "quick-protobuf", + "quick-protobuf-codec 0.3.1", + "rand", + "regex", + "sha2", + "smallvec", + "tracing", + "void", +] + +[[package]] +name = "libp2p-gossipsub" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4e830fdf24ac8c444c12415903174d506e1e077fbe3875c404a78c5935a8543" +dependencies = [ + "asynchronous-codec 0.7.0", + "base64 0.22.1", + "byteorder", + "bytes", + "either", + "fnv", + "futures", + "futures-ticker", + "getrandom", + "hex_fmt", + "libp2p-core 0.42.0", + "libp2p-identity", + "libp2p-swarm 0.45.1", + "prometheus-client", + "quick-protobuf", + "quick-protobuf-codec 0.3.1", + "rand", + "regex", + "sha2", + "smallvec", + "tracing", + "void", + "web-time", +] + +[[package]] +name = "libp2p-identify" +version = "0.44.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5d635ebea5ca0c3c3e77d414ae9b67eccf2a822be06091b9c1a0d13029a1e2f" +dependencies = [ + "asynchronous-codec 0.7.0", + "either", + "futures", + "futures-bounded", + "futures-timer", + "libp2p-core 0.41.3", + "libp2p-identity", + "libp2p-swarm 0.44.2", + "lru", + "quick-protobuf", + "quick-protobuf-codec 0.3.1", + "smallvec", + "thiserror", + "tracing", + "void", +] + +[[package]] +name = "libp2p-identify" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1711b004a273be4f30202778856368683bd9a83c4c7dcc8f848847606831a4e3" +dependencies = [ + "asynchronous-codec 0.7.0", + "either", + "futures", + "futures-bounded", + "futures-timer", + "libp2p-core 0.42.0", + "libp2p-identity", + "libp2p-swarm 0.45.1", + "lru", + "quick-protobuf", + "quick-protobuf-codec 0.3.1", + "smallvec", + "thiserror", + "tracing", + "void", +] + +[[package]] +name = "libp2p-identity" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cca1eb2bc1fd29f099f3daaab7effd01e1a54b7c577d0ed082521034d912e8" +dependencies = [ + "bs58", + "ed25519-dalek", + "hkdf", + "multihash", + "quick-protobuf", + "rand", + "sha2", + "thiserror", + "tracing", + "zeroize", +] + +[[package]] +name = "libp2p-mdns" +version = "0.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49007d9a339b3e1d7eeebc4d67c05dbf23d300b7d091193ec2d3f26802d7faf2" +dependencies = [ + "async-io 2.3.3", + "async-std", + "data-encoding", + "futures", + "hickory-proto", + "if-watch", + "libp2p-core 0.41.3", + "libp2p-identity", + "libp2p-swarm 0.44.2", + "rand", + "smallvec", + "socket2 0.5.7", + "tokio", + "tracing", + "void", +] + +[[package]] +name = "libp2p-metrics" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a70afa7692c81ee03e89c40d1e8638d634f18baef6aeeea30fd245edfae4d3fd" +dependencies = [ + "futures", + "libp2p-core 0.42.0", + "libp2p-gossipsub 0.47.0", + "libp2p-identify 0.45.0", + "libp2p-identity", + "libp2p-ping 0.45.0", + "libp2p-swarm 0.45.1", + "pin-project", + "prometheus-client", + "web-time", +] + +[[package]] +name = "libp2p-noise" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecd0545ce077f6ea5434bcb76e8d0fe942693b4380aaad0d34a358c2bd05793" +dependencies = [ + "asynchronous-codec 0.7.0", + "bytes", + "curve25519-dalek", + "futures", + "libp2p-core 0.41.3", + "libp2p-identity", + "multiaddr", + "multihash", + "once_cell", + "quick-protobuf", + "rand", + "sha2", + "snow", + "static_assertions", + "thiserror", + "tracing", + "x25519-dalek", + "zeroize", +] + +[[package]] +name = "libp2p-ping" +version = "0.44.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1de5a6cf64fba7f7e8f2102711c9c6c043a8e56b86db8cd306492c517da3fb3" +dependencies = [ + "either", + "futures", + "futures-timer", + "instant", + "libp2p-core 0.41.3", + "libp2p-identity", + "libp2p-swarm 0.44.2", + "rand", + "tracing", + "void", +] + +[[package]] +name = "libp2p-ping" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "005a34420359223b974ee344457095f027e51346e992d1e0dcd35173f4cdd422" +dependencies = [ + "either", + "futures", + "futures-timer", + "libp2p-core 0.42.0", + "libp2p-identity", + "libp2p-swarm 0.45.1", + "rand", + "tracing", + "void", + "web-time", +] + +[[package]] +name = "libp2p-quic" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c67296ad4e092e23f92aea3d2bdb6f24eab79c0929ed816dfb460ea2f4567d2b" +dependencies = [ + "async-std", + "bytes", + "futures", + "futures-timer", + "if-watch", + "libp2p-core 0.41.3", + "libp2p-identity", + "libp2p-tls", + "parking_lot", + "quinn", + "rand", + "ring 0.17.8", + "rustls", + "socket2 0.5.7", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "libp2p-rendezvous" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168a444a16f569771bcb48aa081a32724079156e64a730dd900276391ccb6385" +dependencies = [ + "async-trait", + "asynchronous-codec 0.6.2", + "bimap", + "futures", + "futures-timer", + "instant", + "libp2p-core 0.41.3", + "libp2p-identity", + "libp2p-request-response", + "libp2p-swarm 0.44.2", + "quick-protobuf", + "quick-protobuf-codec 0.2.0", + "rand", + "thiserror", + "tracing", + "void", +] + +[[package]] +name = "libp2p-request-response" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c314fe28368da5e3a262553fb0ad575c1c8934c461e10de10265551478163836" +dependencies = [ + "async-trait", + "futures", + "futures-bounded", + "futures-timer", + "instant", + "libp2p-core 0.41.3", + "libp2p-identity", + "libp2p-swarm 0.44.2", + "rand", + "smallvec", + "tracing", + "void", +] + +[[package]] +name = "libp2p-swarm" +version = "0.44.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80cae6cb75f89dbca53862f9ebe0b9f463aa7b302762fcfaafb9e51dcc9b0f7e" +dependencies = [ + "async-std", + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-core 0.41.3", + "libp2p-identity", + "libp2p-swarm-derive", + "lru", + "multistream-select", + "once_cell", + "rand", + "smallvec", + "tokio", + "tracing", + "void", +] + +[[package]] +name = "libp2p-swarm" +version = "0.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7dd6741793d2c1fb2088f67f82cf07261f25272ebe3c0b0c311e0c6b50e851a" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "libp2p-core 0.42.0", + "libp2p-identity", + "lru", + "multistream-select", + "once_cell", + "rand", + "smallvec", + "tracing", + "void", + "web-time", +] + +[[package]] +name = "libp2p-swarm-derive" +version = "0.34.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5daceb9dd908417b6dfcfe8e94098bc4aac54500c282e78120b885dadc09b999" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "libp2p-tcp" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2460fc2748919adff99ecbc1aab296e4579e41f374fb164149bd2c9e529d4c" +dependencies = [ + "async-io 1.13.0", + "futures", + "futures-timer", + "if-watch", + "libc", + "libp2p-core 0.41.3", + "libp2p-identity", + "socket2 0.5.7", + "tokio", + "tracing", +] + +[[package]] +name = "libp2p-tls" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b7b831e55ce2aa6c354e6861a85fdd4dd0a2b97d5e276fabac0e4810a71776" +dependencies = [ + "futures", + "futures-rustls", + "libp2p-core 0.41.3", + "libp2p-identity", + "rcgen", + "ring 0.17.8", + "rustls", + "rustls-webpki 0.101.7", + "thiserror", + "x509-parser", + "yasna", +] + +[[package]] +name = "libp2p-upnp" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccf04b0e3ff3de52d07d5fd6c3b061d0e7f908ffc683c32d9638caedce86fc8" +dependencies = [ + "futures", + "futures-timer", + "igd-next", + "libp2p-core 0.41.3", + "libp2p-swarm 0.44.2", + "tokio", + "tracing", + "void", +] + +[[package]] +name = "libp2p-yamux" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd5265f6b80f94d48a3963541aad183cc598a645755d2f1805a373e41e0716b" +dependencies = [ + "either", + "futures", + "libp2p-core 0.41.3", + "thiserror", + "tracing", + "yamux 0.12.1", + "yamux 0.13.3", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +dependencies = [ + "value-bag", +] + +[[package]] +name = "lru" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "lru-cache" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matrixmultiply" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a" +dependencies = [ + "autocfg", + "rawpointer", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "wasi", + "windows-sys 0.52.0", +] + +[[package]] +name = "multiaddr" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b852bc02a2da5feed68cd14fa50d0774b92790a5bdbfa932a813926c8472070" +dependencies = [ + "arrayref", + "byteorder", + "data-encoding", + "libp2p-identity", + "multibase", + "multihash", + "percent-encoding", + "serde", + "static_assertions", + "unsigned-varint 0.7.2", + "url", +] + +[[package]] +name = "multibase" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" +dependencies = [ + "base-x", + "data-encoding", + "data-encoding-macro", +] + +[[package]] +name = "multihash" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" +dependencies = [ + "core2", + "unsigned-varint 0.7.2", +] + +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + +[[package]] +name = "multistream-select" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea0df8e5eec2298a62b326ee4f0d7fe1a6b90a09dfcf9df37b38f947a8c42f19" +dependencies = [ + "bytes", + "futures", + "log", + "pin-project", + "smallvec", + "unsigned-varint 0.7.2", +] + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "ndarray" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" +dependencies = [ + "matrixmultiply", + "num-complex", + "num-integer", + "num-traits", + "rawpointer", +] + +[[package]] +name = "netlink-packet-core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345b8ab5bd4e71a2986663e88c56856699d060e78e152e6e9d7966fcd5491297" +dependencies = [ + "anyhow", + "byteorder", + "libc", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-route" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "byteorder", + "libc", + "netlink-packet-core", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-utils" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34" +dependencies = [ + "anyhow", + "byteorder", + "paste", + "thiserror", +] + +[[package]] +name = "netlink-proto" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" +dependencies = [ + "bytes", + "futures", + "log", + "netlink-packet-core", + "netlink-sys", + "thiserror", + "tokio", +] + +[[package]] +name = "netlink-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" +dependencies = [ + "async-io 1.13.0", + "bytes", + "futures", + "libc", + "log", + "tokio", +] + +[[package]] +name = "nix" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", +] + +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "serde", + "smallvec", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi 0.3.9", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "object" +version = "0.36.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" +dependencies = [ + "memchr", +] + +[[package]] +name = "oid-registry" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c958dd45046245b9c3c2547369bb634eb461670b2e7e0de552905801a648d1d" +dependencies = [ + "asn1-rs", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "openssl" +version = "0.10.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "p2p" +version = "0.1.0" +dependencies = [ + "async-std", + "async-trait", + "bfv", + "fhe", + "fhe-traits", + "fhe-util", + "futures", + "libp2p", + "tokio", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "parity-scale-codec" +version = "3.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pem" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" +dependencies = [ + "base64 0.22.1", + "serde", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pest" +version = "2.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pharos" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" +dependencies = [ + "futures", + "rustc_version 0.4.0", +] + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "piper" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" +dependencies = [ + "atomic-waker", + "fastrand 2.1.0", + "futures-io", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + +[[package]] +name = "polling" +version = "3.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi 0.4.0", + "pin-project-lite", + "rustix 0.38.34", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "poly1305" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +dependencies = [ + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "polyval" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +dependencies = [ + "proc-macro2", + "syn 2.0.72", +] + +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "impl-codec", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prometheus-client" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "504ee9ff529add891127c4827eb481bd69dc0ebc72e9a682e187db4caa60c3ca" +dependencies = [ + "dtoa", + "itoa", + "parking_lot", + "prometheus-client-derive-encode", +] + +[[package]] +name = "prometheus-client-derive-encode" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "proptest" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags 2.6.0", + "lazy_static", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax 0.8.4", + "rusty-fork", + "tempfile", + "unarray", +] + +[[package]] +name = "prost" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +dependencies = [ + "bytes", + "heck 0.5.0", + "itertools 0.12.1", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn 2.0.72", + "tempfile", +] + +[[package]] +name = "prost-derive" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +dependencies = [ + "anyhow", + "itertools 0.12.1", + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "prost-types" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +dependencies = [ + "prost", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quick-protobuf" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" +dependencies = [ + "byteorder", +] + +[[package]] +name = "quick-protobuf-codec" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ededb1cd78531627244d51dd0c7139fbe736c7d57af0092a76f0ffb2f56e98" +dependencies = [ + "asynchronous-codec 0.6.2", + "bytes", + "quick-protobuf", + "thiserror", + "unsigned-varint 0.7.2", +] + +[[package]] +name = "quick-protobuf-codec" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15a0580ab32b169745d7a39db2ba969226ca16738931be152a3209b409de2474" +dependencies = [ + "asynchronous-codec 0.7.0", + "bytes", + "quick-protobuf", + "thiserror", + "unsigned-varint 0.8.0", +] + +[[package]] +name = "quinn" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" +dependencies = [ + "async-io 2.3.3", + "async-std", + "bytes", + "futures-io", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2 0.5.7", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd" +dependencies = [ + "bytes", + "rand", + "ring 0.17.8", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2 0.5.7", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "rcgen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52c4f3084aa3bc7dfbba4eff4fab2a54db4324965d8872ab933565e6fbd83bc6" +dependencies = [ + "pem", + "ring 0.16.20", + "time", + "yasna", +] + +[[package]] +name = "recvmsg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" + +[[package]] +name = "redox_syscall" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +dependencies = [ + "bitflags 2.6.0", +] + +[[package]] +name = "regex" +version = "1.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" + +[[package]] +name = "reqwest" +version = "0.12.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-core", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-tls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 1.0.1", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-registry", +] + +[[package]] +name = "resolv-conf" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" +checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" dependencies = [ - "equivalent", - "hashbrown", + "hostname", + "quick-error", ] [[package]] -name = "instant" -version = "0.1.13" +name = "rfc6979" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "cfg-if", + "hmac", + "subtle", ] [[package]] -name = "io-lifetimes" -version = "1.0.11" +name = "ring" +version = "0.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" dependencies = [ - "hermit-abi 0.3.9", + "cc", "libc", - "windows-sys 0.48.0", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", ] [[package]] -name = "itertools" -version = "0.12.1" +name = "ring" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ - "either", + "cc", + "cfg-if", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.52.0", ] [[package]] -name = "js-sys" -version = "0.3.69" +name = "rlp" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" dependencies = [ - "wasm-bindgen", + "bytes", + "rustc-hex", ] [[package]] -name = "kv-log-macro" -version = "1.0.7" +name = "rtnetlink" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" dependencies = [ + "async-global-executor", + "futures", "log", + "netlink-packet-route", + "netlink-proto", + "nix", + "thiserror", + "tokio", ] [[package]] -name = "lazy_static" -version = "1.5.0" +name = "ruint" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" dependencies = [ - "spin", + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "bytes", + "fastrlp", + "num-bigint", + "num-traits", + "parity-scale-codec", + "primitive-types", + "proptest", + "rand", + "rlp", + "ruint-macro", + "serde", + "valuable", + "zeroize", ] [[package]] -name = "libc" -version = "0.2.155" +name = "ruint-macro" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] -name = "libm" -version = "0.2.8" +name = "rustc-demangle" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "libp2p" -version = "0.53.2" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681fb3f183edfbedd7a57d32ebe5dcdc0b9f94061185acf3c30249349cc6fc99" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" dependencies = [ - "bytes", - "either", - "futures", - "futures-timer", - "getrandom", - "instant", - "libp2p-allow-block-list", - "libp2p-connection-limits", - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "multiaddr", - "pin-project", - "rw-stream-sink", - "thiserror", + "semver 0.11.0", ] [[package]] -name = "libp2p-allow-block-list" -version = "0.3.0" +name = "rustc_version" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "107b238b794cb83ab53b74ad5dcf7cca3200899b72fe662840cfb52f5b0a32e6" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "void", + "semver 1.0.23", ] [[package]] -name = "libp2p-connection-limits" -version = "0.3.1" +name = "rusticata-macros" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7cd50a78ccfada14de94cbacd3ce4b0138157f376870f13d3a8422cd075b4fd" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" dependencies = [ - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "void", + "nom", ] [[package]] -name = "libp2p-core" -version = "0.41.3" +name = "rustix" +version = "0.37.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5a8920cbd8540059a01950c1e5c96ea8d89eb50c51cd366fc18bdf540a6e48f" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" dependencies = [ - "either", - "fnv", - "futures", - "futures-timer", - "libp2p-identity", - "multiaddr", - "multihash", - "multistream-select", - "once_cell", - "parking_lot", - "pin-project", - "quick-protobuf", - "rand", - "rw-stream-sink", - "smallvec", - "thiserror", - "tracing", - "unsigned-varint 0.8.0", - "void", - "web-time", + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", ] [[package]] -name = "libp2p-identity" -version = "0.2.9" +name = "rustix" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cca1eb2bc1fd29f099f3daaab7effd01e1a54b7c577d0ed082521034d912e8" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bs58", - "ed25519-dalek", - "hkdf", - "multihash", - "quick-protobuf", - "rand", - "sha2", - "thiserror", - "tracing", - "zeroize", + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys 0.4.14", + "windows-sys 0.52.0", ] [[package]] -name = "libp2p-swarm" -version = "0.44.2" +name = "rustls" +version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80cae6cb75f89dbca53862f9ebe0b9f463aa7b302762fcfaafb9e51dcc9b0f7e" +checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" dependencies = [ - "either", - "fnv", - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-identity", - "lru", - "multistream-select", "once_cell", - "rand", - "smallvec", - "tracing", - "void", + "ring 0.17.8", + "rustls-pki-types", + "rustls-webpki 0.102.6", + "subtle", + "zeroize", ] [[package]] -name = "linux-raw-sys" -version = "0.3.8" +name = "rustls-pemfile" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] [[package]] -name = "linux-raw-sys" -version = "0.4.14" +name = "rustls-pki-types" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] -name = "lock_api" -version = "0.4.12" +name = "rustls-webpki" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "autocfg", - "scopeguard", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] -name = "log" -version = "0.4.22" +name = "rustls-webpki" +version = "0.102.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" dependencies = [ - "value-bag", + "ring 0.17.8", + "rustls-pki-types", + "untrusted 0.9.0", ] [[package]] -name = "lru" -version = "0.12.4" +name = "rustversion" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" dependencies = [ - "hashbrown", + "fnv", + "quick-error", + "tempfile", + "wait-timeout", ] [[package]] -name = "matrixmultiply" -version = "0.3.9" +name = "rw-stream-sink" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a" +checksum = "d8c9026ff5d2f23da5e45bbc283f156383001bfb09c4e44256d02c1a685fe9a1" dependencies = [ - "autocfg", - "rawpointer", + "futures", + "pin-project", + "static_assertions", ] [[package]] -name = "memchr" -version = "2.7.4" +name = "ryu" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] -name = "multiaddr" -version = "0.18.1" +name = "schannel" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b852bc02a2da5feed68cd14fa50d0774b92790a5bdbfa932a813926c8472070" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "arrayref", - "byteorder", - "data-encoding", - "libp2p-identity", - "multibase", - "multihash", - "percent-encoding", - "serde", - "static_assertions", - "unsigned-varint 0.7.2", - "url", + "windows-sys 0.52.0", ] [[package]] -name = "multibase" -version = "0.9.1" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" -dependencies = [ - "base-x", - "data-encoding", - "data-encoding-macro", -] +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "multihash" -version = "0.19.1" +name = "sec1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "core2", - "unsigned-varint 0.7.2", + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", ] [[package]] -name = "multimap" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" - -[[package]] -name = "multistream-select" -version = "0.13.0" +name = "secp256k1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0df8e5eec2298a62b326ee4f0d7fe1a6b90a09dfcf9df37b38f947a8c42f19" +checksum = "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3" dependencies = [ - "bytes", - "futures", - "log", - "pin-project", - "smallvec", - "unsigned-varint 0.7.2", + "secp256k1-sys", ] [[package]] -name = "ndarray" -version = "0.15.6" +name = "secp256k1-sys" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" +checksum = "1433bd67156263443f14d603720b082dd3121779323fce20cba2aa07b874bc1b" dependencies = [ - "matrixmultiply", - "num-complex", - "num-integer", - "num-traits", - "rawpointer", + "cc", ] [[package]] -name = "num-bigint" -version = "0.4.6" +name = "security-framework" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "num-integer", - "num-traits", + "bitflags 2.6.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", ] [[package]] -name = "num-bigint-dig" -version = "0.8.4" +name = "security-framework-sys" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand", - "serde", - "smallvec", + "core-foundation-sys", + "libc", ] [[package]] -name = "num-complex" -version = "0.4.6" +name = "semver" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" dependencies = [ - "num-traits", + "semver-parser", ] [[package]] -name = "num-integer" -version = "0.1.46" +name = "semver" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" dependencies = [ - "num-traits", + "pest", ] [[package]] -name = "num-iter" -version = "0.1.45" +name = "send_wrapper" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" + +[[package]] +name = "serde" +version = "1.0.208" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" dependencies = [ - "autocfg", - "num-integer", - "num-traits", + "serde_derive", ] [[package]] -name = "num-traits" -version = "0.2.19" +name = "serde_derive" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ - "autocfg", + "proc-macro2", + "quote", + "syn 2.0.72", ] [[package]] -name = "num_cpus" -version = "1.16.0" +name = "serde_json" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ - "hermit-abi 0.3.9", - "libc", + "itoa", + "memchr", + "ryu", + "serde", ] [[package]] -name = "once_cell" -version = "1.19.0" +name = "serde_urlencoded" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] [[package]] -name = "parking" -version = "2.2.0" +name = "sha1" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] [[package]] -name = "parking_lot" -version = "0.12.3" +name = "sha2" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "lock_api", - "parking_lot_core", + "cfg-if", + "cpufeatures", + "digest 0.10.7", ] [[package]] -name = "parking_lot_core" -version = "0.9.10" +name = "sha3-asm" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "57d79b758b7cb2085612b11a235055e485605a5103faccdd633f35bd7aee69dd" dependencies = [ + "cc", "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.6", ] [[package]] -name = "percent-encoding" -version = "2.3.1" +name = "sharded-slab" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] [[package]] -name = "petgraph" -version = "0.6.5" +name = "signal-hook-registry" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ - "fixedbitset", - "indexmap", + "libc", ] [[package]] -name = "pin-project" -version = "1.1.5" +name = "signature" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "pin-project-internal", + "digest 0.10.7", + "rand_core", ] [[package]] -name = "pin-project-internal" -version = "1.1.5" +name = "simple_asn1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", + "num-bigint", + "num-traits", + "thiserror", + "time", ] [[package]] -name = "pin-project-lite" -version = "0.2.14" +name = "slab" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] [[package]] -name = "pin-utils" -version = "0.1.0" +name = "smallvec" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] -name = "piper" -version = "0.2.3" +name = "smol" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" +checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1" dependencies = [ - "atomic-waker", - "fastrand 2.1.0", - "futures-io", + "async-channel 1.9.0", + "async-executor", + "async-fs", + "async-io 1.13.0", + "async-lock 2.8.0", + "async-net", + "async-process", + "blocking", + "futures-lite 1.13.0", ] [[package]] -name = "pkcs8" -version = "0.10.2" +name = "snow" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" dependencies = [ - "der", - "spki", + "aes-gcm", + "blake2", + "chacha20poly1305", + "curve25519-dalek", + "rand_core", + "ring 0.17.8", + "rustc_version 0.4.0", + "sha2", + "subtle", ] [[package]] -name = "polling" -version = "2.8.0" +name = "socket2" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", + "winapi", ] [[package]] -name = "polling" -version = "3.7.2" +name = "socket2" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi 0.4.0", - "pin-project-lite", - "rustix 0.38.34", - "tracing", + "libc", "windows-sys 0.52.0", ] [[package]] -name = "ppv-lite86" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +name = "sortition" +version = "0.1.0" dependencies = [ - "zerocopy", + "alloy 0.2.1", + "alloy-primitives 0.6.4", + "alloy-sol-types 0.6.4", + "eyre", + "futures-util", + "num", + "rand", ] [[package]] -name = "prettyplease" -version = "0.2.20" +name = "spin" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" -dependencies = [ - "proc-macro2", - "syn 2.0.72", -] +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] -name = "proc-macro2" -version = "1.0.86" +name = "spin" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] -name = "prost" -version = "0.12.6" +name = "spki" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ - "bytes", - "prost-derive", + "base64ct", + "der", ] [[package]] -name = "prost-build" -version = "0.12.6" +name = "static_assertions" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" -dependencies = [ - "bytes", - "heck", - "itertools", - "log", - "multimap", - "once_cell", - "petgraph", - "prettyplease", - "prost", - "prost-types", - "regex", - "syn 2.0.72", - "tempfile", +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", ] [[package]] -name = "prost-derive" -version = "0.12.6" +name = "strum_macros" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "anyhow", - "itertools", + "heck 0.5.0", "proc-macro2", "quote", + "rustversion", "syn 2.0.72", ] [[package]] -name = "prost-types" -version = "0.12.6" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" -dependencies = [ - "prost", -] +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] -name = "quick-protobuf" -version = "0.8.1" +name = "syn" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "byteorder", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] -name = "quote" -version = "1.0.36" +name = "syn" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", + "quote", + "unicode-ident", ] [[package]] -name = "rand" -version = "0.8.5" +name = "syn-solidity" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "cb3d0961cd53c23ea94eeec56ba940f636f6394788976e9f16ca5ee0aca7464a" dependencies = [ - "libc", - "rand_chacha", - "rand_core", + "paste", + "proc-macro2", + "quote", + "syn 2.0.72", ] [[package]] -name = "rand_chacha" -version = "0.3.1" +name = "syn-solidity" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "c837dc8852cb7074e46b444afb81783140dab12c58867b49fb3898fbafedf7ea" dependencies = [ - "ppv-lite86", - "rand_core", + "paste", + "proc-macro2", + "quote", + "syn 2.0.72", ] [[package]] -name = "rand_core" -version = "0.6.4" +name = "syn-solidity" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +checksum = "4b95156f8b577cb59dc0b1df15c6f29a10afc5f8a7ac9786b0b5c68c19149278" dependencies = [ - "getrandom", + "paste", + "proc-macro2", + "quote", + "syn 2.0.72", ] [[package]] -name = "rawpointer" -version = "0.2.1" +name = "sync_wrapper" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] -name = "redox_syscall" -version = "0.5.3" +name = "sync_wrapper" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" dependencies = [ - "bitflags 2.6.0", + "futures-core", ] [[package]] -name = "regex" -version = "1.10.6" +name = "synstructure" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", + "proc-macro2", + "quote", + "syn 2.0.72", ] [[package]] -name = "regex-automata" -version = "0.4.7" +name = "system-configuration" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", ] [[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc_version" -version = "0.4.0" +name = "system-configuration-sys" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ - "semver", + "core-foundation-sys", + "libc", ] [[package]] -name = "rustix" -version = "0.37.27" +name = "tap" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] -name = "rustix" -version = "0.38.34" +name = "tempfile" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53" dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys 0.4.14", + "cfg-if", + "fastrand 2.1.0", + "once_cell", + "rustix 0.38.34", "windows-sys 0.52.0", ] [[package]] -name = "rw-stream-sink" -version = "0.4.0" +name = "thiserror" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8c9026ff5d2f23da5e45bbc283f156383001bfb09c4e44256d02c1a685fe9a1" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ - "futures", - "pin-project", - "static_assertions", + "thiserror-impl", ] [[package]] -name = "scopeguard" -version = "1.2.0" +name = "thiserror-impl" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] [[package]] -name = "semver" -version = "1.0.23" +name = "thread_local" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] [[package]] -name = "serde" -version = "1.0.204" +name = "threadpool" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" dependencies = [ - "serde_derive", + "num_cpus", ] [[package]] -name = "serde_derive" -version = "1.0.204" +name = "time" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", ] [[package]] -name = "sha2" -version = "0.10.8" +name = "time-core" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ - "cfg-if", - "cpufeatures", - "digest", + "num-conv", + "time-core", ] [[package]] -name = "signature" -version = "2.2.0" +name = "tiny-keccak" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" dependencies = [ - "rand_core", + "crunchy", ] [[package]] -name = "slab" -version = "0.4.9" +name = "tinyvec" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ - "autocfg", + "tinyvec_macros", ] [[package]] -name = "smallvec" -version = "1.13.2" +name = "tinyvec_macros" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] -name = "socket2" -version = "0.4.10" +name = "tokio" +version = "1.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" dependencies = [ + "backtrace", + "bytes", "libc", - "winapi", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2 0.5.7", + "tokio-macros", + "windows-sys 0.52.0", ] [[package]] -name = "spin" -version = "0.9.8" +name = "tokio-macros" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] [[package]] -name = "spki" -version = "0.7.3" +name = "tokio-native-tls" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ - "base64ct", - "der", + "native-tls", + "tokio", ] [[package]] -name = "static_assertions" -version = "1.1.0" +name = "tokio-rustls" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls", + "rustls-pki-types", + "tokio", +] [[package]] -name = "subtle" -version = "2.6.1" +name = "tokio-stream" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] [[package]] -name = "syn" -version = "1.0.109" +name = "tokio-tungstenite" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "futures-util", + "log", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tungstenite", + "webpki-roots", ] [[package]] -name = "syn" -version = "2.0.72" +name = "tokio-util" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", ] [[package]] -name = "tempfile" -version = "3.11.0" +name = "toml_datetime" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" + +[[package]] +name = "toml_edit" +version = "0.22.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "cfg-if", - "fastrand 2.1.0", - "once_cell", - "rustix 0.38.34", - "windows-sys 0.52.0", + "indexmap", + "toml_datetime", + "winnow", ] [[package]] -name = "thiserror" -version = "1.0.63" +name = "tower" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ - "thiserror-impl", + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", ] [[package]] -name = "thiserror-impl" -version = "1.0.63" +name = "tower" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 0.1.2", + "tower-layer", + "tower-service", ] [[package]] -name = "tinyvec" -version = "1.8.0" +name = "tower-layer" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" -dependencies = [ - "tinyvec_macros", -] +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] -name = "tinyvec_macros" -version = "0.1.1" +name = "tower-service" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -1778,6 +6414,7 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1801,6 +6438,62 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "tungstenite" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 1.1.0", + "httparse", + "log", + "rand", + "rustls", + "rustls-pki-types", + "sha1", + "thiserror", + "utf-8", ] [[package]] @@ -1809,6 +6502,30 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -1830,11 +6547,31 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-xid" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" + +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + [[package]] name = "unsigned-varint" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" +dependencies = [ + "asynchronous-codec 0.6.2", + "bytes", +] [[package]] name = "unsigned-varint" @@ -1842,6 +6579,18 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.5.2" @@ -1849,16 +6598,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", - "idna", + "idna 0.5.0", "percent-encoding", ] +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "value-bag" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version_check" version = "0.9.5" @@ -1871,12 +6644,30 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + [[package]] name = "waker-fn" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1969,6 +6760,21 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "widestring" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" + [[package]] name = "winapi" version = "0.3.9" @@ -1991,6 +6797,55 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +dependencies = [ + "windows-core", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -2009,6 +6864,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -2130,6 +6994,137 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "ws_stream_wasm" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7999f5f4217fe3818726b66257a4475f71e74ffd190776ad053fa159e50737f5" +dependencies = [ + "async_io_stream", + "futures", + "js-sys", + "log", + "pharos", + "rustc_version 0.4.0", + "send_wrapper", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "x25519-dalek" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" +dependencies = [ + "curve25519-dalek", + "rand_core", + "serde", + "zeroize", +] + +[[package]] +name = "x509-parser" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" +dependencies = [ + "asn1-rs", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "xml-rs" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "539a77ee7c0de333dcc6da69b177380a0b81e0dacfa4f7344c465a36871ee601" + +[[package]] +name = "xmltree" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d8a75eaf6557bb84a65ace8609883db44a29951042ada9b393151532e41fcb" +dependencies = [ + "xml-rs", +] + +[[package]] +name = "yamux" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed0164ae619f2dc144909a9f082187ebb5893693d8c0196e8085283ccd4b776" +dependencies = [ + "futures", + "log", + "nohash-hasher", + "parking_lot", + "pin-project", + "rand", + "static_assertions", +] + +[[package]] +name = "yamux" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31b5e376a8b012bee9c423acdbb835fc34d45001cfa3106236a624e4b738028" +dependencies = [ + "futures", + "log", + "nohash-hasher", + "parking_lot", + "pin-project", + "rand", + "static_assertions", + "web-time", +] + +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +dependencies = [ + "time", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -2156,6 +7151,9 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] [[package]] name = "zeroize_derive" diff --git a/packages/ciphernode/Cargo.toml b/packages/ciphernode/Cargo.toml index e84fdc9c..5a82643f 100644 --- a/packages/ciphernode/Cargo.toml +++ b/packages/ciphernode/Cargo.toml @@ -1,2 +1,2 @@ [workspace] -members = ["core", "eth", "enclave", "enclave_node"] +members = ["core", "enclave", "enclave_node", "p2p", "bfv"] diff --git a/packages/ciphernode/bfv/Cargo.toml b/packages/ciphernode/bfv/Cargo.toml index 2f53f5d2..2426bd01 100644 --- a/packages/ciphernode/bfv/Cargo.toml +++ b/packages/ciphernode/bfv/Cargo.toml @@ -12,3 +12,4 @@ async-std = "1.12.0" fhe = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" } fhe-traits = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" } fhe-util = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" } +rand = "0.8.5" diff --git a/packages/ciphernode/bfv/src/lib.rs b/packages/ciphernode/bfv/src/lib.rs new file mode 100644 index 00000000..d8e55781 --- /dev/null +++ b/packages/ciphernode/bfv/src/lib.rs @@ -0,0 +1,73 @@ +#![crate_name = "bfv"] +#![crate_type = "lib"] +#![warn(missing_docs, unused_imports)] + +mod util; + +use std::{sync::Arc}; +use fhe::{ + bfv::{BfvParameters, BfvParametersBuilder, Ciphertext, Encoding, Plaintext, SecretKey}, + mbfv::{AggregateIter, CommonRandomPoly, DecryptionShare, PublicKeyShare}, +}; +use fhe_traits::{FheDecoder, Serialize as FheSerialize, Deserialize, DeserializeParametrized}; +use rand::{Rng, rngs::OsRng, thread_rng}; +use util::timeit::{timeit}; + +pub struct EnclaveBFV { + pub pk_share: PublicKeyShare, + sk_share: SecretKey, + pub params: Arc, + pub crp: CommonRandomPoly, +} + +impl EnclaveBFV { + pub fn new(degree: usize, plaintext_modulus: u64, moduli: Vec) -> Self { + // let degree = 4096; + // let plaintext_modulus: u64 = 4096; + // let moduli = vec![0xffffee001, 0xffffc4001, 0x1ffffe0001]; + + // Generate the BFV parameters structure. + let params = timeit!( + "Parameters generation", + BfvParametersBuilder::new() + .set_degree(degree) + .set_plaintext_modulus(plaintext_modulus) + .set_moduli(&moduli) + .build_arc().unwrap() + ); + + let crp = CommonRandomPoly::new(¶ms, &mut thread_rng()).unwrap(); + //TODO: save encrypted sk_share to disk? + let sk_share = SecretKey::random(¶ms, &mut OsRng); + let pk_share = PublicKeyShare::new(&sk_share, crp.clone(), &mut thread_rng()).unwrap(); + + Self { pk_share, sk_share, params, crp } + } + + pub fn serialize_pk(&mut self) -> Vec { + self.pk_share.to_bytes() + } + + pub fn deserialize_pk(&mut self, bytes: Vec, par_bytes: Vec, crp_bytes: Vec) -> PublicKeyShare { + let params = Arc::new(BfvParameters::try_deserialize(&par_bytes).unwrap()); + let crp = CommonRandomPoly::deserialize(&crp_bytes, ¶ms).unwrap(); + PublicKeyShare::deserialize(&bytes, ¶ms, crp.clone()).unwrap() + } + + pub fn serialize_crp(&mut self) -> Vec { + self.crp.to_bytes() + } + + pub fn deserialize_crp(&mut self, bytes: Vec, par_bytes: Vec) -> CommonRandomPoly { + let params = Arc::new(BfvParameters::try_deserialize(&par_bytes).unwrap()); + CommonRandomPoly::deserialize(&bytes, ¶ms).unwrap() + } + + pub fn serialize_params(&mut self) -> Vec { + self.params.to_bytes() + } + + pub fn deserialize_params(&mut self, par_bytes: Vec) -> Arc { + Arc::new(BfvParameters::try_deserialize(&par_bytes).unwrap()) + } +} \ No newline at end of file diff --git a/packages/ciphernode/bfv/src/main.rs b/packages/ciphernode/bfv/src/main.rs deleted file mode 100644 index a0d9916c..00000000 --- a/packages/ciphernode/bfv/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("Hello, cipher world!"); -} diff --git a/packages/ciphernode/bfv/src/util.rs b/packages/ciphernode/bfv/src/util.rs new file mode 100644 index 00000000..8e3d167f --- /dev/null +++ b/packages/ciphernode/bfv/src/util.rs @@ -0,0 +1,129 @@ +//! Utility functions + +use fhe::bfv; +use fhe_traits::FheEncoder; +use fhe_util::transcode_from_bytes; +use std::{cmp::min, fmt, sync::Arc, time::Duration}; + +/// Macros to time code and display a human-readable duration. +pub mod timeit { + #[allow(unused_macros)] + macro_rules! timeit_n { + ($name:expr, $loops:expr, $code:expr) => {{ + use util::DisplayDuration; + let start = std::time::Instant::now(); + let r = $code; + for _ in 1..$loops { + let _ = $code; + } + println!( + "⏱ {}: {}", + $name, + DisplayDuration(start.elapsed() / $loops) + ); + r + }}; + } + + #[allow(unused_macros)] + macro_rules! timeit { + ($name:expr, $code:expr) => {{ + use util::DisplayDuration; + let start = std::time::Instant::now(); + let r = $code; + println!("⏱ {}: {}", $name, DisplayDuration(start.elapsed())); + r + }}; + } + + #[allow(unused_imports)] + pub(crate) use timeit; + #[allow(unused_imports)] + pub(crate) use timeit_n; +} + +/// Utility struct for displaying human-readable duration of the form "10.5 ms", +/// "350 μs", or "27 ns". +pub struct DisplayDuration(pub Duration); + +impl fmt::Display for DisplayDuration { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let duration_ns = self.0.as_nanos(); + if duration_ns < 1_000_u128 { + write!(f, "{duration_ns} ns") + } else if duration_ns < 1_000_000_u128 { + write!(f, "{} μs", (duration_ns + 500) / 1_000) + } else { + let duration_ms_times_10 = (duration_ns + 50_000) / (100_000); + write!(f, "{} ms", (duration_ms_times_10 as f64) / 10.0) + } + } +} + +// Utility functions for Private Information Retrieval. + +/// Generate a database of elements of the form [i || 0...0] where i is the 4B +/// little endian encoding of the index. When the element size is less than 4B, +/// the encoding is truncated. +#[allow(dead_code)] +pub fn generate_database(database_size: usize, elements_size: usize) -> Vec> { + assert!(database_size > 0 && elements_size > 0); + let mut database = vec![vec![0u8; elements_size]; database_size]; + for (i, element) in database.iter_mut().enumerate() { + element[..min(4, elements_size)] + .copy_from_slice(&(i as u32).to_le_bytes()[..min(4, elements_size)]); + } + database +} + +#[allow(dead_code)] +pub fn number_elements_per_plaintext( + degree: usize, + plaintext_nbits: usize, + elements_size: usize, +) -> usize { + (plaintext_nbits * degree) / (elements_size * 8) +} + +#[allow(dead_code)] +pub fn encode_database( + database: &Vec>, + par: Arc, + level: usize, +) -> (Vec, (usize, usize)) { + assert!(!database.is_empty()); + + let elements_size = database[0].len(); + let plaintext_nbits = par.plaintext().ilog2() as usize; + let number_elements_per_plaintext = + number_elements_per_plaintext(par.degree(), plaintext_nbits, elements_size); + let number_rows = + (database.len() + number_elements_per_plaintext - 1) / number_elements_per_plaintext; + println!("number_rows = {number_rows}"); + println!("number_elements_per_plaintext = {number_elements_per_plaintext}"); + let dimension_1 = (number_rows as f64).sqrt().ceil() as usize; + let dimension_2 = (number_rows + dimension_1 - 1) / dimension_1; + println!("dimensions = {dimension_1} {dimension_2}"); + println!("dimension = {}", dimension_1 * dimension_2); + let mut preprocessed_database = + vec![ + bfv::Plaintext::zero(bfv::Encoding::poly_at_level(level), &par).unwrap(); + dimension_1 * dimension_2 + ]; + (0..number_rows).for_each(|i| { + let mut serialized_plaintext = vec![0u8; number_elements_per_plaintext * elements_size]; + for j in 0..number_elements_per_plaintext { + if let Some(pt) = database.get(j + i * number_elements_per_plaintext) { + serialized_plaintext[j * elements_size..(j + 1) * elements_size].copy_from_slice(pt) + } + } + let pt_values = transcode_from_bytes(&serialized_plaintext, plaintext_nbits); + preprocessed_database[i] = + bfv::Plaintext::try_encode(&pt_values, bfv::Encoding::poly_at_level(level), &par) + .unwrap(); + }); + (preprocessed_database, (dimension_1, dimension_2)) +} + +#[allow(dead_code)] +fn main() {} \ No newline at end of file diff --git a/packages/ciphernode/core/Cargo.lock b/packages/ciphernode/core/Cargo.lock deleted file mode 100644 index 23e86c30..00000000 --- a/packages/ciphernode/core/Cargo.lock +++ /dev/null @@ -1,2137 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "allocator-api2" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" - -[[package]] -name = "anyhow" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" - -[[package]] -name = "arrayref" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" - -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-executor" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand 2.1.0", - "futures-lite 2.3.0", - "slab", -] - -[[package]] -name = "async-global-executor" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" -dependencies = [ - "async-channel 2.3.1", - "async-executor", - "async-io 2.3.3", - "async-lock 3.4.0", - "blocking", - "futures-lite 2.3.0", - "once_cell", -] - -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.27", - "slab", - "socket2", - "waker-fn", -] - -[[package]] -name = "async-io" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" -dependencies = [ - "async-lock 3.4.0", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite 2.3.0", - "parking", - "polling 3.7.2", - "rustix 0.38.34", - "slab", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", -] - -[[package]] -name = "async-lock" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" -dependencies = [ - "event-listener 5.3.1", - "event-listener-strategy", - "pin-project-lite", -] - -[[package]] -name = "async-std" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" -dependencies = [ - "async-channel 1.9.0", - "async-global-executor", - "async-io 1.13.0", - "async-lock 2.8.0", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite 1.13.0", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - -[[package]] -name = "async-task" -version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "base-x" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" - -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "blocking" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" -dependencies = [ - "async-channel 2.3.1", - "async-task", - "futures-io", - "futures-lite 2.3.0", - "piper", -] - -[[package]] -name = "bs58" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "core2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" -dependencies = [ - "memchr", -] - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "curve25519-dalek" -version = "4.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" -dependencies = [ - "cfg-if", - "cpufeatures", - "curve25519-dalek-derive", - "digest", - "fiat-crypto", - "rustc_version", - "subtle", - "zeroize", -] - -[[package]] -name = "curve25519-dalek-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "data-encoding" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" - -[[package]] -name = "data-encoding-macro" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1559b6cba622276d6d63706db152618eeb15b89b3e4041446b05876e352e639" -dependencies = [ - "data-encoding", - "data-encoding-macro-internal", -] - -[[package]] -name = "data-encoding-macro-internal" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332d754c0af53bc87c108fed664d121ecf59207ec4196041f04d6ab9002ad33f" -dependencies = [ - "data-encoding", - "syn 1.0.109", -] - -[[package]] -name = "der" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" -dependencies = [ - "const-oid", - "zeroize", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", - "subtle", -] - -[[package]] -name = "doc-comment" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" - -[[package]] -name = "ed25519" -version = "2.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" -dependencies = [ - "pkcs8", - "signature", -] - -[[package]] -name = "ed25519-dalek" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" -dependencies = [ - "curve25519-dalek", - "ed25519", - "rand_core", - "serde", - "sha2", - "subtle", - "zeroize", -] - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "enclave-core" -version = "0.1.0" -dependencies = [ - "async-std", - "fhe", - "fhe-traits", - "fhe-util", - "libp2p", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "ethnum" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b90ca2580b73ab6a1f724b76ca11ab632df820fd6040c336200d2c1df7b3c82c" - -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "5.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" -dependencies = [ - "event-listener 5.3.1", - "pin-project-lite", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fastrand" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" - -[[package]] -name = "fhe" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#9624766dcfbb40ecfb01147f59c2f6292c447707" -dependencies = [ - "doc-comment", - "fhe-math", - "fhe-traits", - "fhe-util", - "itertools", - "ndarray", - "num-bigint", - "num-traits", - "prost", - "prost-build", - "rand", - "rand_chacha", - "serde", - "thiserror", - "zeroize", - "zeroize_derive", -] - -[[package]] -name = "fhe-math" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#9624766dcfbb40ecfb01147f59c2f6292c447707" -dependencies = [ - "ethnum", - "fhe-traits", - "fhe-util", - "itertools", - "ndarray", - "num-bigint", - "num-bigint-dig", - "num-traits", - "prost", - "prost-build", - "rand", - "rand_chacha", - "sha2", - "thiserror", - "zeroize", -] - -[[package]] -name = "fhe-traits" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#9624766dcfbb40ecfb01147f59c2f6292c447707" -dependencies = [ - "rand", -] - -[[package]] -name = "fhe-util" -version = "0.1.0-beta.7" -source = "git+https://github.com/gnosisguild/fhe.rs#9624766dcfbb40ecfb01147f59c2f6292c447707" -dependencies = [ - "itertools", - "num-bigint-dig", - "num-traits", - "rand", -] - -[[package]] -name = "fiat-crypto" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", - "num_cpus", -] - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - -[[package]] -name = "futures-lite" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" -dependencies = [ - "fastrand 2.1.0", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - -[[package]] -name = "hkdf" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" -dependencies = [ - "hmac", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indexmap" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" -dependencies = [ - "equivalent", - "hashbrown", -] - -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -dependencies = [ - "spin", -] - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "libm" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - -[[package]] -name = "libp2p" -version = "0.53.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681fb3f183edfbedd7a57d32ebe5dcdc0b9f94061185acf3c30249349cc6fc99" -dependencies = [ - "bytes", - "either", - "futures", - "futures-timer", - "getrandom", - "instant", - "libp2p-allow-block-list", - "libp2p-connection-limits", - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "multiaddr", - "pin-project", - "rw-stream-sink", - "thiserror", -] - -[[package]] -name = "libp2p-allow-block-list" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "107b238b794cb83ab53b74ad5dcf7cca3200899b72fe662840cfb52f5b0a32e6" -dependencies = [ - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "void", -] - -[[package]] -name = "libp2p-connection-limits" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7cd50a78ccfada14de94cbacd3ce4b0138157f376870f13d3a8422cd075b4fd" -dependencies = [ - "libp2p-core", - "libp2p-identity", - "libp2p-swarm", - "void", -] - -[[package]] -name = "libp2p-core" -version = "0.41.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5a8920cbd8540059a01950c1e5c96ea8d89eb50c51cd366fc18bdf540a6e48f" -dependencies = [ - "either", - "fnv", - "futures", - "futures-timer", - "libp2p-identity", - "multiaddr", - "multihash", - "multistream-select", - "once_cell", - "parking_lot", - "pin-project", - "quick-protobuf", - "rand", - "rw-stream-sink", - "smallvec", - "thiserror", - "tracing", - "unsigned-varint 0.8.0", - "void", - "web-time", -] - -[[package]] -name = "libp2p-identity" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cca1eb2bc1fd29f099f3daaab7effd01e1a54b7c577d0ed082521034d912e8" -dependencies = [ - "bs58", - "ed25519-dalek", - "hkdf", - "multihash", - "quick-protobuf", - "rand", - "sha2", - "thiserror", - "tracing", - "zeroize", -] - -[[package]] -name = "libp2p-swarm" -version = "0.44.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80cae6cb75f89dbca53862f9ebe0b9f463aa7b302762fcfaafb9e51dcc9b0f7e" -dependencies = [ - "either", - "fnv", - "futures", - "futures-timer", - "instant", - "libp2p-core", - "libp2p-identity", - "lru", - "multistream-select", - "once_cell", - "rand", - "smallvec", - "tracing", - "void", -] - -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -dependencies = [ - "value-bag", -] - -[[package]] -name = "lru" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" -dependencies = [ - "hashbrown", -] - -[[package]] -name = "matrixmultiply" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a" -dependencies = [ - "autocfg", - "rawpointer", -] - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "multiaddr" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b852bc02a2da5feed68cd14fa50d0774b92790a5bdbfa932a813926c8472070" -dependencies = [ - "arrayref", - "byteorder", - "data-encoding", - "libp2p-identity", - "multibase", - "multihash", - "percent-encoding", - "serde", - "static_assertions", - "unsigned-varint 0.7.2", - "url", -] - -[[package]] -name = "multibase" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" -dependencies = [ - "base-x", - "data-encoding", - "data-encoding-macro", -] - -[[package]] -name = "multihash" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" -dependencies = [ - "core2", - "unsigned-varint 0.7.2", -] - -[[package]] -name = "multimap" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" - -[[package]] -name = "multistream-select" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0df8e5eec2298a62b326ee4f0d7fe1a6b90a09dfcf9df37b38f947a8c42f19" -dependencies = [ - "bytes", - "futures", - "log", - "pin-project", - "smallvec", - "unsigned-varint 0.7.2", -] - -[[package]] -name = "ndarray" -version = "0.15.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb12d4e967ec485a5f71c6311fe28158e9d6f4bc4a447b474184d0f91a8fa32" -dependencies = [ - "matrixmultiply", - "num-complex", - "num-integer", - "num-traits", - "rawpointer", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-bigint-dig" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" -dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand", - "serde", - "smallvec", -] - -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi 0.3.9", - "libc", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "parking" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" - -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "petgraph" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" -dependencies = [ - "fixedbitset", - "indexmap", -] - -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "piper" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" -dependencies = [ - "atomic-waker", - "fastrand 2.1.0", - "futures-io", -] - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] - -[[package]] -name = "polling" -version = "3.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" -dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi 0.4.0", - "pin-project-lite", - "rustix 0.38.34", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "prettyplease" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" -dependencies = [ - "proc-macro2", - "syn 2.0.72", -] - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "prost" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-build" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" -dependencies = [ - "bytes", - "heck", - "itertools", - "log", - "multimap", - "once_cell", - "petgraph", - "prettyplease", - "prost", - "prost-types", - "regex", - "syn 2.0.72", - "tempfile", -] - -[[package]] -name = "prost-derive" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "prost-types" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" -dependencies = [ - "prost", -] - -[[package]] -name = "quick-protobuf" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" -dependencies = [ - "byteorder", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - -[[package]] -name = "redox_syscall" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "regex" -version = "1.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.37.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", -] - -[[package]] -name = "rw-stream-sink" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8c9026ff5d2f23da5e45bbc283f156383001bfb09c4e44256d02c1a685fe9a1" -dependencies = [ - "futures", - "pin-project", - "static_assertions", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.204" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.204" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "rand_core", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53" -dependencies = [ - "cfg-if", - "fastrand 2.1.0", - "once_cell", - "rustix 0.38.34", - "windows-sys 0.52.0", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "tinyvec" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unsigned-varint" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" - -[[package]] -name = "unsigned-varint" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" - -[[package]] -name = "url" -version = "2.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "value-bag" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "waker-fn" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.72", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "web-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "web-time" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "byteorder", - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] diff --git a/packages/ciphernode/core/Cargo.toml b/packages/ciphernode/core/Cargo.toml index 44c46514..8a8836f4 100644 --- a/packages/ciphernode/core/Cargo.toml +++ b/packages/ciphernode/core/Cargo.toml @@ -1,5 +1,6 @@ [package] -name = "core" +# we have to name this other than core for disambiguation +name = "enclave-core" version = "0.1.0" edition = "2021" description = ": coordinates the encryption and decryption of enclave computations" @@ -8,9 +9,27 @@ repository = "https://github.com/gnosisguild/enclave/packages/ciphernode" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +p2p = { path = "../p2p" } +sortition = { path = "../sortition" } async-std = "1.12.0" libp2p = "0.53.2" fhe = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" } fhe-traits = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" } fhe-util = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" } - +actix = "0.13.5" +actix-rt = "2.10.0" +anyhow = "1.0.86" +rand = "0.8.5" +rand_chacha = "0.3.1" +secp256k1 = "0.29.0" +tokio = { version = "1.39.3", features = ["full"] } +sha2 = "0.10.8" +bs58 = "0.5.1" +serde = { version = "1.0.208", features = ["derive"] } +bincode = "1.3.3" +futures-util = "0.3" +alloy = { version = "0.3.3", features = ["full"] } +alloy-primitives = { version = "0.6", default-features = false, features = ["rlp", "serde", "std"] } +alloy-sol-types = { version = "0.6" } +base64 = "0.22.1" +base91 = "0.1.0" diff --git a/packages/ciphernode/core/src/ciphernode.rs b/packages/ciphernode/core/src/ciphernode.rs new file mode 100644 index 00000000..8bf0e9c5 --- /dev/null +++ b/packages/ciphernode/core/src/ciphernode.rs @@ -0,0 +1,169 @@ +use crate::{ + data::{Data, Insert}, + eventbus::EventBus, + events::{EnclaveEvent, KeyshareCreated}, + fhe::{Fhe, GenerateKeyshare}, + ActorFactory, CiphernodeSelected, CiphertextOutputPublished, DecryptCiphertext, + DecryptionshareCreated, Get, +}; +use actix::prelude::*; +use alloy_primitives::Address; +use anyhow::Result; + +pub struct Ciphernode { + fhe: Addr, + data: Addr, + bus: Addr, + address: Address, +} + +impl Actor for Ciphernode { + type Context = Context; +} + +impl Ciphernode { + pub fn new(bus: Addr, fhe: Addr, data: Addr, address: Address) -> Self { + Self { + bus, + fhe, + data, + address, + } + } +} + +impl Handler for Ciphernode { + type Result = (); + + fn handle(&mut self, event: EnclaveEvent, ctx: &mut Context) -> Self::Result { + match event { + EnclaveEvent::CiphernodeSelected { data, .. } => ctx.address().do_send(data), + EnclaveEvent::CiphertextOutputPublished { data, .. } => ctx.address().do_send(data), + _ => (), + } + } +} + +impl Handler for Ciphernode { + type Result = ResponseFuture<()>; + + fn handle(&mut self, event: CiphernodeSelected, _: &mut Context) -> Self::Result { + let fhe = self.fhe.clone(); + let data = self.data.clone(); + let bus = self.bus.clone(); + let address = self.address; + Box::pin(async move { + on_ciphernode_selected(fhe, data, bus, event, address) + .await + .unwrap() + }) + } +} + +impl Handler for Ciphernode { + type Result = ResponseFuture<()>; + + fn handle(&mut self, event: CiphertextOutputPublished, _: &mut Context) -> Self::Result { + println!("Ciphernode::CiphertextOutputPublished"); + let fhe = self.fhe.clone(); + let data = self.data.clone(); + let bus = self.bus.clone(); + let address = self.address; + Box::pin(async move { + on_decryption_requested(fhe, data, bus, event, address) + .await + .unwrap() + }) + } +} + +async fn on_ciphernode_selected( + fhe: Addr, + data: Addr, + bus: Addr, + event: CiphernodeSelected, + address: Address, +) -> Result<()> { + let CiphernodeSelected { e3_id, .. } = event; + + println!("\n\nGENERATING KEY!\n\n"); + + // generate keyshare + let (sk, pubkey) = fhe.send(GenerateKeyshare {}).await??; + + // TODO: decrypt from FHE actor + // save encrypted key against e3_id/sk + // reencrypt secretkey locally with env var - this is so we don't have to serialize a secret + // best practice would be as you boot up a node you enter in a configured password from + // which we derive a kdf which gets used to generate this key + data.do_send(Insert(format!("{}/sk", e3_id).into(), sk)); + + // save public key against e3_id/pk + data.do_send(Insert(format!("{}/pk", e3_id).into(), pubkey.clone())); + + // broadcast the KeyshareCreated message + let event = EnclaveEvent::from(KeyshareCreated { + pubkey, + e3_id, + node: address, + }); + bus.do_send(event); + + Ok(()) +} + +async fn on_decryption_requested( + fhe: Addr, + data: Addr, + bus: Addr, + event: CiphertextOutputPublished, + address: Address, +) -> Result<()> { + let CiphertextOutputPublished { + e3_id, + ciphertext_output, + } = event; + + // get secret key by id from data + let Some(unsafe_secret) = data.send(Get(format!("{}/sk", e3_id).into())).await? else { + return Err(anyhow::anyhow!("Secret key not stored for {}", e3_id)); + }; + + println!("\n\nDECRYPTING!\n\n"); + + let decryption_share = fhe + .send(DecryptCiphertext { + ciphertext: ciphertext_output, + unsafe_secret, + }) + .await??; + + let event = EnclaveEvent::from(DecryptionshareCreated { + e3_id, + decryption_share, + node: address, + }); + + bus.do_send(event); + + Ok(()) +} + +pub struct CiphernodeFactory; +impl CiphernodeFactory { + pub fn create(bus: Addr, data: Addr, address: Address) -> ActorFactory { + Box::new(move |ctx, evt| { + // Save Ciphernode on CiphernodeSelected + let EnclaveEvent::CiphernodeSelected { .. } = evt else { + return; + }; + + let Some(ref fhe) = ctx.fhe else { + return; + }; + + ctx.ciphernode = + Some(Ciphernode::new(bus.clone(), fhe.clone(), data.clone(), address).start()) + }) + } +} diff --git a/packages/ciphernode/core/src/ciphernode_selector.rs b/packages/ciphernode/core/src/ciphernode_selector.rs new file mode 100644 index 00000000..5502d947 --- /dev/null +++ b/packages/ciphernode/core/src/ciphernode_selector.rs @@ -0,0 +1,74 @@ +use actix::prelude::*; +use alloy_primitives::Address; + +use crate::{ + CiphernodeSelected, EnclaveEvent, EventBus, GetHasNode, Sortition, Subscribe, +}; + +pub struct CiphernodeSelector { + bus: Addr, + sortition: Addr, + address: Address, +} + +impl Actor for CiphernodeSelector { + type Context = Context; +} + +impl CiphernodeSelector { + pub fn new(bus: Addr, sortition: Addr, address: Address) -> Self { + Self { + bus, + sortition, + address, + } + } + + pub fn attach(bus: Addr, sortition: Addr, address: Address) -> Addr { + let addr = CiphernodeSelector::new(bus.clone(), sortition, address).start(); + + bus.do_send(Subscribe::new( + "CommitteeRequested", + addr.clone().recipient(), + )); + + addr + } +} + +impl Handler for CiphernodeSelector { + type Result = ResponseFuture<()>; + + fn handle(&mut self, event: EnclaveEvent, _ctx: &mut Self::Context) -> Self::Result { + let address = self.address; + let sortition = self.sortition.clone(); + let bus = self.bus.clone(); + + Box::pin(async move { + let EnclaveEvent::CommitteeRequested { data, .. } = event else { + return; + }; + + let seed = data.sortition_seed; + let size = data.nodecount; + + if let Ok(is_selected) = sortition + .send(GetHasNode { + seed, + address, + size, + }) + .await + { + if !is_selected { + return; + } + + bus.do_send(EnclaveEvent::from(CiphernodeSelected { + e3_id: data.e3_id, + nodecount: data.nodecount, + })); + } + }) + } +} diff --git a/packages/ciphernode/core/src/committee_meta.rs b/packages/ciphernode/core/src/committee_meta.rs new file mode 100644 index 00000000..78be9141 --- /dev/null +++ b/packages/ciphernode/core/src/committee_meta.rs @@ -0,0 +1,26 @@ +use crate::{ActorFactory, CommitteeRequested, EnclaveEvent}; + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct CommitteeMeta { + pub nodecount: usize, + pub seed: u64, +} + +pub struct CommitteeMetaFactory; + +impl CommitteeMetaFactory { + pub fn create() -> ActorFactory { + Box::new(move |ctx, evt| { + let EnclaveEvent::CommitteeRequested { data, .. }: crate::EnclaveEvent = evt else { + return; + }; + let CommitteeRequested { + nodecount, + sortition_seed: seed, + .. + } = data; + + ctx.meta = Some(CommitteeMeta { nodecount, seed }); + }) + } +} diff --git a/packages/ciphernode/core/src/data.rs b/packages/ciphernode/core/src/data.rs new file mode 100644 index 00000000..7da55390 --- /dev/null +++ b/packages/ciphernode/core/src/data.rs @@ -0,0 +1,83 @@ +use std::collections::BTreeMap; + +use actix::{Actor, Context, Handler, Message}; + +// TODO: replace with sled version + +#[derive(Message, Clone, Debug, PartialEq, Eq, Hash)] +#[rtype(result = "()")] +pub struct Insert(pub Vec, pub Vec); +impl Insert { + fn key(&self) -> Vec { + self.0.clone() + } + + fn value(&self) -> Vec { + self.1.clone() + } +} + +#[derive(Message, Clone, Debug, PartialEq, Eq, Hash)] +#[rtype(result = "Option>")] +pub struct Get(pub Vec); +impl Get { + fn key(&self) -> Vec { + self.0.clone() + } +} + +#[derive(Message, Clone, Debug, PartialEq, Eq, Hash)] +#[rtype(result = "Vec")] +pub struct GetLog; + +#[derive(Clone, Debug, PartialEq, Eq, Hash)] +pub enum DataOp { + Insert(Insert), +} + +pub struct Data { + db: BTreeMap, Vec>, + log: Vec, + capture: bool, +} + +impl Actor for Data { + type Context = Context; +} + +impl Data { + pub fn new(capture: bool) -> Self { + Self { + db: BTreeMap::new(), + capture, + log: vec![], + } + } +} + +impl Handler for Data { + type Result = (); + fn handle(&mut self, event: Insert, _: &mut Self::Context) { + // insert data into sled + self.db.insert(event.key(), event.value()); + + if self.capture { + self.log.push(DataOp::Insert(event)); + } + } +} + +impl Handler for Data { + type Result = Option>; + fn handle(&mut self, event: Get, _: &mut Self::Context) -> Option> { + let key = event.key(); + self.db.get(&key).map(|r| r.clone()) + } +} + +impl Handler for Data { + type Result = Vec; + fn handle(&mut self, _: GetLog, _: &mut Self::Context) -> Vec { + self.log.clone() + } +} diff --git a/packages/ciphernode/core/src/e3_request.rs b/packages/ciphernode/core/src/e3_request.rs new file mode 100644 index 00000000..32de3914 --- /dev/null +++ b/packages/ciphernode/core/src/e3_request.rs @@ -0,0 +1,145 @@ +use std::collections::HashMap; + +use actix::{Actor, Addr, Context, Handler, Recipient}; + +use crate::{ + Ciphernode, CommitteeMeta, E3id, EnclaveEvent, EventBus, Fhe, PlaintextAggregator, + PublicKeyAggregator, Subscribe, +}; + +#[derive(Default)] +// TODO: Set this up with a Typestate pattern +pub struct E3RequestContext { + pub ciphernode: Option>, + pub fhe: Option>, + pub plaintext: Option>, + pub publickey: Option>, + pub meta: Option, +} + +struct EventBuffer { + buffer: HashMap>, +} + +impl Default for EventBuffer { + fn default() -> Self { + Self { + buffer: HashMap::new(), + } + } +} + +impl EventBuffer { + pub fn add(&mut self, key: &str, event: EnclaveEvent) { + self.buffer.entry(key.to_string()).or_default().push(event) + } + + pub fn take(&mut self, key: &str) -> Vec { + self.buffer + .get_mut(key) + .map(std::mem::take) + .unwrap_or_default() + } +} + +impl E3RequestContext { + fn recipients(&self) -> Vec<(String, Option>)> { + vec![ + ( + "ciphernode".to_owned(), + self.ciphernode.clone().map(|addr| addr.into()), + ), + ( + "plaintext".to_owned(), + self.plaintext.clone().map(|addr| addr.into()), + ), + ( + "publickey".to_owned(), + self.publickey.clone().map(|addr| addr.into()), + ), + ] + } + + fn forward_message(&self, msg: &EnclaveEvent, buffer: &mut EventBuffer) { + self.recipients().into_iter().for_each(|(key, recipient)| { + if let Some(act) = recipient { + act.do_send(msg.clone()); + for m in buffer.take(&key) { + act.do_send(m); + } + } else { + buffer.add(&key, msg.clone()); + } + }); + } +} + +struct E3RequestBuffers { + ciphernode: Vec, + publickey: Vec, + plaintext: Vec, +} + +pub type ActorFactory = Box; + +// TODO: setup typestate pattern so that we have to place factories within correct order of +// dependencies +pub struct E3RequestManager { + contexts: HashMap, + factories: Vec, + buffer: EventBuffer, +} + +impl E3RequestManager { + pub fn builder(bus: Addr) -> E3RequestManagerBuilder { + E3RequestManagerBuilder { + bus, + factories: vec![], + } + } +} + +pub struct E3RequestManagerBuilder { + pub bus: Addr, + pub factories: Vec, +} +impl E3RequestManagerBuilder { + pub fn add_hook(mut self, listener: ActorFactory) -> Self { + self.factories.push(listener); + self + } + + pub fn build(self) -> Addr { + let e3r = E3RequestManager { + contexts: HashMap::new(), + factories: self.factories, + buffer: EventBuffer::default(), + }; + + let addr = e3r.start(); + self.bus + .do_send(Subscribe::new("*", addr.clone().recipient())); + addr + } +} + +impl Actor for E3RequestManager { + type Context = Context; +} + +impl Handler for E3RequestManager { + type Result = (); + fn handle(&mut self, msg: EnclaveEvent, _: &mut Self::Context) -> Self::Result { + let Some(e3_id) = msg.get_e3_id() else { + return; + }; + + let context = self.contexts.entry(e3_id).or_default(); + + for factory in &mut self.factories { + factory(context, msg.clone()); + } + + context.forward_message(&msg, &mut self.buffer); + } +} diff --git a/packages/ciphernode/core/src/enclave_contract.rs b/packages/ciphernode/core/src/enclave_contract.rs new file mode 100644 index 00000000..ef607190 --- /dev/null +++ b/packages/ciphernode/core/src/enclave_contract.rs @@ -0,0 +1,13 @@ +use actix::{Actor, Context}; + +/// Manage an internal web3 instance and express protocol specific behaviour through the events it +/// accepts and emits to the EventBus +/// Monitor contract events using `contract.events().create_filter()` and rebroadcast to eventbus by +/// creating `EnclaveEvent` events +/// Delegate signing to a separate actor responsible for managing Eth keys +/// Accept eventbus events and forward as appropriate contract calls as required +pub struct EnclaveContract; + +impl Actor for EnclaveContract { + type Context = Context; +} diff --git a/packages/ciphernode/core/src/eventbus.rs b/packages/ciphernode/core/src/eventbus.rs new file mode 100644 index 00000000..6171fa07 --- /dev/null +++ b/packages/ciphernode/core/src/eventbus.rs @@ -0,0 +1,114 @@ +use crate::events::{EnclaveEvent, EventId}; +use actix::prelude::*; +use std::collections::{HashMap, HashSet}; + +#[derive(Message, Debug)] +#[rtype(result = "()")] +pub struct Subscribe { + pub event_type: String, + pub listener: Recipient, +} + +impl Subscribe { + pub fn new(event_type: impl Into, listener: Recipient) -> Self { + Self { + event_type: event_type.into(), + listener, + } + } +} + +#[derive(Message)] +#[rtype(result = "Vec")] +pub struct GetHistory; + +#[derive(Message)] +#[rtype(result = "()")] +pub struct ResetHistory; + +/// Central EventBus for each node. Actors publish events to this bus by sending it EnclaveEvents. +/// All events sent to this bus are assumed to be published over the network via pubsub. +/// Other actors such as the P2p and Evm actor connect to outside services and control which events +/// actually get published as well as ensure that local events are not rebroadcast locally after +/// being published. +pub struct EventBus { + capture: bool, + history: Vec, + ids: HashSet, + listeners: HashMap>>, +} + +impl Actor for EventBus { + type Context = Context; +} + +impl EventBus { + pub fn new(capture: bool) -> Self { + EventBus { + capture, + listeners: HashMap::new(), + ids: HashSet::new(), + history: vec![], + } + } + + fn add_to_history(&mut self, event: EnclaveEvent) { + self.history.push(event.clone()); + self.ids.insert(event.into()); + } +} + +impl Handler for EventBus { + type Result = (); + + fn handle(&mut self, event: Subscribe, _: &mut Context) { + self.listeners + .entry(event.event_type) + .or_default() + .push(event.listener); + } +} + +impl Handler for EventBus { + type Result = Vec; + + fn handle(&mut self, _: GetHistory, _: &mut Context) -> Vec { + self.history.clone() + } +} +impl Handler for EventBus { + type Result = (); + + fn handle(&mut self, _: ResetHistory, _: &mut Context) { + self.history.clear() + } +} + +impl Handler for EventBus { + type Result = (); + + fn handle(&mut self, event: EnclaveEvent, _: &mut Context) { + // Deduplicate by id + if self.ids.contains(&event.get_id()) { + // We have seen this before + return; + } + + // TODO: How can we ensure the event we see is coming in in the correct order? + if let Some(listeners) = self.listeners.get("*") { + for listener in listeners { + listener.do_send(event.clone()) + } + } + + if let Some(listeners) = self.listeners.get(&event.event_type()) { + for listener in listeners { + listener.do_send(event.clone()) + } + } + + if self.capture { + self.add_to_history(event); + } + } +} diff --git a/packages/ciphernode/core/src/events.rs b/packages/ciphernode/core/src/events.rs new file mode 100644 index 00000000..43a42fff --- /dev/null +++ b/packages/ciphernode/core/src/events.rs @@ -0,0 +1,393 @@ +use actix::Message; +use alloy_primitives::Address; +use serde::{Deserialize, Serialize}; +use sha2::{Digest, Sha256}; +use std::{ + fmt, + hash::{DefaultHasher, Hash, Hasher}, +}; + +#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub struct EthAddr(pub Vec); + +impl From
for EthAddr { + fn from(value: Address) -> Self { + Self(value.to_vec()) + } +} + +#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub struct E3id(pub String); +impl fmt::Display for E3id { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(&self.0) + } +} + +impl E3id { + pub fn new(id: impl Into) -> Self { + Self(id.into()) + } +} + +impl From for E3id { + fn from(value: u32) -> Self { + E3id::new(value.to_string()) + } +} + +#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub struct EventId(pub [u8; 32]); + +impl EventId { + fn from(value: T) -> Self { + let mut hasher = Sha256::new(); + let mut std_hasher = DefaultHasher::new(); + value.hash(&mut std_hasher); + hasher.update(std_hasher.finish().to_le_bytes()); + let result = hasher.finalize(); + EventId(result.into()) + } +} + +impl fmt::Display for EventId { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let base58_string = bs58::encode(&self.0).into_string(); + write!(f, "eid_{}", base58_string) + } +} + +#[derive(Message, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[rtype(result = "()")] +pub enum EnclaveEvent { + KeyshareCreated { + id: EventId, + data: KeyshareCreated, + }, + CommitteeRequested { + id: EventId, + data: CommitteeRequested, + }, + PublicKeyAggregated { + id: EventId, + data: PublicKeyAggregated, + }, + CiphertextOutputPublished { + id: EventId, + data: CiphertextOutputPublished, + }, + DecryptionshareCreated { + id: EventId, + data: DecryptionshareCreated, + }, + PlaintextAggregated { + id: EventId, + data: PlaintextAggregated, + }, + CiphernodeSelected { + id: EventId, + data: CiphernodeSelected, + }, + CiphernodeAdded { + id: EventId, + data: CiphernodeAdded, + }, + CiphernodeRemoved { + id: EventId, + data: CiphernodeRemoved, + }, + // CommitteeSelected, + // OutputDecrypted, + // CiphernodeRegistered, + // CiphernodeDeregistered, +} + +impl EnclaveEvent { + pub fn to_bytes(&self) -> Result, bincode::Error> { + bincode::serialize(self) + } + + pub fn from_bytes(bytes: &[u8]) -> Result { + bincode::deserialize(bytes) + } + + pub fn get_id(&self) -> EventId { + self.clone().into() + } + + pub fn is_local_only(&self) -> bool { + // Add a list of local events + match self { + EnclaveEvent::CiphernodeSelected { .. } => true, + _ => false, + } + } +} + +impl From for EventId { + fn from(value: EnclaveEvent) -> Self { + match value { + EnclaveEvent::KeyshareCreated { id, .. } => id, + EnclaveEvent::CommitteeRequested { id, .. } => id, + EnclaveEvent::PublicKeyAggregated { id, .. } => id, + EnclaveEvent::CiphertextOutputPublished { id, .. } => id, + EnclaveEvent::DecryptionshareCreated { id, .. } => id, + EnclaveEvent::PlaintextAggregated { id, .. } => id, + EnclaveEvent::CiphernodeSelected { id, .. } => id, + EnclaveEvent::CiphernodeAdded { id, .. } => id, + EnclaveEvent::CiphernodeRemoved { id, .. } => id, + } + } +} + +impl EnclaveEvent { + pub fn get_e3_id(&self) -> Option { + match self.clone() { + EnclaveEvent::KeyshareCreated { data, .. } => Some(data.e3_id), + EnclaveEvent::CommitteeRequested { data, .. } => Some(data.e3_id), + EnclaveEvent::PublicKeyAggregated { data, .. } => Some(data.e3_id), + EnclaveEvent::CiphertextOutputPublished { data, .. } => Some(data.e3_id), + EnclaveEvent::DecryptionshareCreated { data, .. } => Some(data.e3_id), + EnclaveEvent::PlaintextAggregated { data, .. } => Some(data.e3_id), + EnclaveEvent::CiphernodeSelected { data, .. } => Some(data.e3_id), + _ => None, + } + } +} + +impl From for EnclaveEvent { + fn from(data: KeyshareCreated) -> Self { + EnclaveEvent::KeyshareCreated { + id: EventId::from(data.clone()), + data: data.clone(), + } + } +} + +impl From for EnclaveEvent { + fn from(data: CommitteeRequested) -> Self { + EnclaveEvent::CommitteeRequested { + id: EventId::from(data.clone()), + data: data.clone(), + } + } +} + +impl From for EnclaveEvent { + fn from(data: PublicKeyAggregated) -> Self { + EnclaveEvent::PublicKeyAggregated { + id: EventId::from(data.clone()), + data: data.clone(), + } + } +} + +impl From for EnclaveEvent { + fn from(data: CiphertextOutputPublished) -> Self { + EnclaveEvent::CiphertextOutputPublished { + id: EventId::from(data.clone()), + data: data.clone(), + } + } +} + +impl From for EnclaveEvent { + fn from(data: DecryptionshareCreated) -> Self { + EnclaveEvent::DecryptionshareCreated { + id: EventId::from(data.clone()), + data: data.clone(), + } + } +} + +impl From for EnclaveEvent { + fn from(data: PlaintextAggregated) -> Self { + EnclaveEvent::PlaintextAggregated { + id: EventId::from(data.clone()), + data: data.clone(), + } + } +} + +impl From for EnclaveEvent { + fn from(data: CiphernodeSelected) -> Self { + EnclaveEvent::CiphernodeSelected { + id: EventId::from(data.clone()), + data: data.clone(), + } + } +} + +impl From for EnclaveEvent { + fn from(data: CiphernodeAdded) -> Self { + EnclaveEvent::CiphernodeAdded { + id: EventId::from(data.clone()), + data: data.clone(), + } + } +} + +impl From for EnclaveEvent { + fn from(data: CiphernodeRemoved) -> Self { + EnclaveEvent::CiphernodeRemoved { + id: EventId::from(data.clone()), + data: data.clone(), + } + } +} +impl fmt::Display for EnclaveEvent { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(&format!("{}({})", self.event_type(), self.get_id())) + } +} + +#[derive(Message, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[rtype(result = "anyhow::Result<()>")] +pub struct KeyshareCreated { + pub pubkey: Vec, + pub e3_id: E3id, + pub node: Address, +} + +#[derive(Message, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[rtype(result = "anyhow::Result<()>")] +pub struct DecryptionshareCreated { + pub decryption_share: Vec, + pub e3_id: E3id, + pub node: Address, +} + +#[derive(Message, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[rtype(result = "()")] +pub struct PublicKeyAggregated { + pub pubkey: Vec, + pub e3_id: E3id, +} + +#[derive(Message, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[rtype(result = "()")] +pub struct CommitteeRequested { + pub e3_id: E3id, + pub nodecount: usize, + pub sortition_seed: u64, // Should actually be much larger eg [u8;32] + + // fhe params + pub moduli: Vec, + pub degree: usize, + pub plaintext_modulus: u64, + pub crp: Vec, + // threshold: usize, // TODO: + // computation_type: ??, // TODO: + // execution_model_type: ??, // TODO: + // input_deadline: ??, // TODO: + // availability_duration: ??, // TODO: +} + +#[derive(Message, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[rtype(result = "()")] +pub struct CiphernodeSelected { + pub e3_id: E3id, + pub nodecount: usize, +} + +#[derive(Message, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[rtype(result = "()")] +pub struct CiphertextOutputPublished { + pub e3_id: E3id, + pub ciphertext_output: Vec, +} + +#[derive(Message, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[rtype(result = "()")] +pub struct PlaintextAggregated { + pub e3_id: E3id, + pub decrypted_output: Vec, +} + +#[derive(Message, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[rtype(result = "()")] +pub struct CiphernodeAdded { + pub address: Address, + pub index: usize, + pub num_nodes: usize, +} + +#[derive(Message, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[rtype(result = "()")] +pub struct CiphernodeRemoved { + pub address: Address, + pub index: usize, + pub num_nodes: usize, +} + +fn extract_enclave_event_name(s: &str) -> &str { + let bytes = s.as_bytes(); + for (i, &item) in bytes.iter().enumerate() { + if item == b' ' || item == b'(' { + return &s[..i]; + } + } + s +} + +impl EnclaveEvent { + pub fn event_type(&self) -> String { + let s = format!("{:?}", self); + extract_enclave_event_name(&s).to_string() + } +} + +#[cfg(test)] +mod tests { + use super::EnclaveEvent; + use crate::{ + events::extract_enclave_event_name, serializers::PublicKeyShareSerializer, E3id, + KeyshareCreated, + }; + use alloy_primitives::address; + use fhe::{ + bfv::{BfvParametersBuilder, SecretKey}, + mbfv::{CommonRandomPoly, PublicKeyShare}, + }; + use rand::SeedableRng; + use rand_chacha::ChaCha20Rng; + use std::error::Error; + + #[test] + fn test_extract_enum_name() { + assert_eq!( + extract_enclave_event_name("KeyshareCreated(KeyshareCreated { pubkey: [] })"), + "KeyshareCreated" + ); + assert_eq!( + extract_enclave_event_name("CommitteeSelected(SomeStruct { t: 8 })"), + "CommitteeSelected" + ); + } + + #[test] + fn test_deserialization() -> Result<(), Box> { + let moduli = &vec![0x3FFFFFFF000001]; + let degree = 2048usize; + let plaintext_modulus = 1032193u64; + let mut rng = ChaCha20Rng::from_entropy(); + let params = BfvParametersBuilder::new() + .set_degree(degree) + .set_plaintext_modulus(plaintext_modulus) + .set_moduli(&moduli) + .build_arc()?; + let crp = CommonRandomPoly::new(¶ms, &mut rng)?; + let sk_share = { SecretKey::random(¶ms, &mut rng) }; + let pk_share = { PublicKeyShare::new(&sk_share, crp.clone(), &mut rng)? }; + let pubkey = PublicKeyShareSerializer::to_bytes(pk_share, params.clone(), crp.clone())?; + let kse = EnclaveEvent::from(KeyshareCreated { + e3_id: E3id::from(1001), + pubkey, + node: address!("d8dA6BF26964aF9D7eEd9e03E53415D37aA96045"), + }); + let kse_bytes = kse.to_bytes()?; + let _ = EnclaveEvent::from_bytes(&kse_bytes.clone()); + // deserialization occurred without panic! + Ok(()) + } +} diff --git a/packages/ciphernode/core/src/evm.rs b/packages/ciphernode/core/src/evm.rs new file mode 100644 index 00000000..2984ac41 --- /dev/null +++ b/packages/ciphernode/core/src/evm.rs @@ -0,0 +1,90 @@ +use actix::{Actor, Addr, Context}; +use alloy::{primitives::Address, sol, sol_types::SolEvent}; +use rand::{thread_rng, RngCore}; + +use crate::{ + evm_listener::{AddEventHandler, EvmEventListener, StartListening}, + evm_manager::{AddListener, EvmContractManager}, + E3id, EnclaveEvent, EventBus, SharedRng, +}; + +sol! { + #[derive(Debug)] + event CommitteeRequested( + uint256 indexed e3Id, + address filter, + uint32[2] threshold + ); + + #[derive(Debug)] + event CiphernodeAdded( + address indexed node, + uint256 index, + uint256 numNodes, + uint256 size + ); + + #[derive(Debug)] + event CiphernodeRemoved( + address indexed node, + uint256 index, + uint256 numNodes, + uint256 size + ); + + #[derive(Debug)] + event CiphertextOutputPublished( + uint256 indexed e3Id, + bytes ciphertextOutput + ); +} + +struct Evm { + evm_manager: Addr, + evm_listener: Addr, +} + +impl Evm { + pub async fn attach( + bus: Addr, + rpc_url: &str, + contract_address: Address, + ) -> Addr { + let evm_manager = EvmContractManager::attach(bus.clone(), rpc_url).await; + let evm_listener = evm_manager + .send(AddListener { contract_address }) + .await + .unwrap(); + + evm_listener + .send(AddEventHandler::::new()) + .await + .unwrap(); + + evm_listener + .send(AddEventHandler::::new()) + .await + .unwrap(); + + evm_listener + .send(AddEventHandler::::new()) + .await + .unwrap(); + + evm_listener + .send(AddEventHandler::::new()) + .await + .unwrap(); + evm_listener.do_send(StartListening); + + Evm { + evm_listener, + evm_manager, + } + .start() + } +} + +impl Actor for Evm { + type Context = Context; +} diff --git a/packages/ciphernode/core/src/evm_listener.rs b/packages/ciphernode/core/src/evm_listener.rs new file mode 100644 index 00000000..042c6a1c --- /dev/null +++ b/packages/ciphernode/core/src/evm_listener.rs @@ -0,0 +1,151 @@ +use actix::{Actor, Addr, AsyncContext, Context, Handler, Message, WrapFuture}; +use alloy::{ + primitives::B256, + providers::{Provider, RootProvider}, + rpc::types::{Filter, Log}, + sol_types::SolEvent, + transports::BoxTransport, +}; +use anyhow::Result; +use futures_util::stream::StreamExt; +use std::collections::HashMap; +use std::fmt::Debug; +use std::sync::Arc; +use std::marker::PhantomData; + +use crate::{EnclaveEvent, EventBus}; + +pub trait ContractEvent: Send + Sync + 'static { + fn process(&self, bus: Addr) -> Result<()>; +} + +impl ContractEvent for T +where + T: SolEvent + Debug + Send + Sync + 'static, +{ + fn process(&self, bus: Addr) -> Result<()> { + println!("Processing event: {:?}", self); + // bus.do_send(EnclaveEvent::from(self)); + Ok(()) + } +} + +pub struct EvmEventListener { + provider: Arc>, + filter: Filter, + handlers: HashMap Result> + Send + Sync>>, + bus: Addr, +} + +impl EvmEventListener { + pub fn new( + provider: Arc>, + filter: Filter, + bus: Addr, + ) -> Self { + Self { + provider, + filter, + handlers: HashMap::new(), + bus, + } + } + + pub fn add_event_handler(&mut self) + where + E: SolEvent + ContractEvent + 'static, + { + let signature = E::SIGNATURE_HASH; + let handler = Arc::new(move |log: Log| -> Result> { + let event = log.log_decode::()?.inner.data; + Ok(Box::new(event)) + }); + + self.handlers.insert(signature, handler); + } + + pub async fn listen(&self) -> Result<()> { + let mut stream = self + .provider + .subscribe_logs(&self.filter) + .await? + .into_stream(); + while let Some(log) = stream.next().await { + if let Some(topic0) = log.topic0() { + if let Some(decoder) = self.handlers.get(topic0) { + if let Ok(event) = decoder(log.clone()) { + event.process(self.bus.clone())?; + } + } + } + } + + Ok(()) + } +} + +impl Actor for EvmEventListener { + type Context = Context; +} + +#[derive(Message)] +#[rtype(result = "()")] +pub struct AddEventHandler +where + E: SolEvent + ContractEvent + 'static, +{ + pub _marker: PhantomData, +} + +impl AddEventHandler +where + E: SolEvent + ContractEvent + 'static, +{ + pub fn new() -> Self { + Self { + _marker: PhantomData, + } + } +} + +impl Handler> for EvmEventListener +where + E: SolEvent + ContractEvent + 'static, +{ + type Result = (); + + fn handle(&mut self, _: AddEventHandler, _: &mut Self::Context) -> Self::Result { + self.add_event_handler::(); + } +} + +#[derive(Message)] +#[rtype(result = "()")] +pub struct StartListening; + +impl Handler for EvmEventListener { + type Result = (); + fn handle(&mut self, _: StartListening, ctx: &mut Self::Context) -> Self::Result { + let (provider, filter, handlers, bus) = ( + self.provider.clone(), + self.filter.clone(), + self.handlers.clone(), + self.bus.clone(), + ); + + ctx.spawn( + async move { + let listener = EvmEventListener { + provider, + filter, + handlers, + bus, + }; + if let Err(err) = listener.listen().await { + eprintln!("Error listening for events: {:?}", err); + } + } + .into_actor(self), + ); + } +} diff --git a/packages/ciphernode/core/src/evm_manager.rs b/packages/ciphernode/core/src/evm_manager.rs new file mode 100644 index 00000000..e00d659a --- /dev/null +++ b/packages/ciphernode/core/src/evm_manager.rs @@ -0,0 +1,76 @@ +use crate::{ + evm_listener::{EvmEventListener, StartListening}, + EventBus, +}; +use actix::{Actor, Addr, Context, Handler, Message}; +use alloy::{ + primitives::Address, + providers::{ProviderBuilder, RootProvider}, + rpc::types::{BlockNumberOrTag, Filter}, + transports::BoxTransport, +}; +use anyhow::Result; +use std::sync::Arc; + +pub struct EvmContractManager { + bus: Addr, + provider: Arc>, + listeners: Vec>, +} + +impl EvmContractManager { + async fn new(bus: Addr, rpc_url: &str) -> Result { + let provider = ProviderBuilder::new().on_builtin(rpc_url).await?; + Ok(Self { + bus, + provider: Arc::new(provider), + listeners: vec![], + }) + } + + pub async fn attach(bus: Addr, rpc_url: &str) -> Addr { + EvmContractManager::new(bus.clone(), rpc_url) + .await + .unwrap() + .start() + } + + fn add_listener(&self, contract_address: Address) -> Addr { + let filter = Filter::new() + .address(contract_address) + .from_block(BlockNumberOrTag::Latest); + let listener = EvmEventListener::new(self.provider.clone(), filter, self.bus.clone()); + listener.start() + } +} + +impl Actor for EvmContractManager { + type Context = Context; +} + +#[derive(Message)] +#[rtype(result = "Addr")] +pub struct AddListener { + pub contract_address: Address, +} + +impl Handler for EvmContractManager { + type Result = Addr; + + fn handle(&mut self, msg: AddListener, _ctx: &mut Self::Context) -> Self::Result { + let listener = self.add_listener(msg.contract_address); + self.listeners.push(listener.clone()); + listener + } +} + +impl Handler for EvmContractManager { + type Result = (); + + fn handle(&mut self, _: StartListening, _ctx: &mut Self::Context) -> Self::Result { + for listener in &self.listeners { + listener.do_send(StartListening); + } + } +} + diff --git a/packages/ciphernode/core/src/fhe.rs b/packages/ciphernode/core/src/fhe.rs new file mode 100644 index 00000000..f3394c18 --- /dev/null +++ b/packages/ciphernode/core/src/fhe.rs @@ -0,0 +1,211 @@ +use crate::{ + ordered_set::OrderedSet, + serializers::{ + CiphertextSerializer, DecryptionShareSerializer, PublicKeySerializer, + PublicKeyShareSerializer, SecretKeySerializer, + }, + ActorFactory, CommitteeRequested, EnclaveEvent, +}; +use actix::{Actor, Context, Handler, Message}; +use anyhow::*; +use fhe::{ + bfv::{BfvParameters, BfvParametersBuilder, Encoding, Plaintext, PublicKey, SecretKey}, + mbfv::{AggregateIter, CommonRandomPoly, DecryptionShare, PublicKeyShare}, +}; +use fhe_traits::{FheDecoder, Serialize}; +use rand::SeedableRng; +use rand_chacha::{ChaCha20Rng, ChaCha8Rng}; +use std::{ + hash::Hash, + sync::{Arc, Mutex}, +}; + +#[derive(Message, Clone, Debug, PartialEq, Eq, Hash)] +#[rtype(result = "Result<(Vec, Vec)>")] +pub struct GenerateKeyshare { + // responder_pk: Vec, // TODO: use this to encrypt the secret data +} + +#[derive(Message, Clone, Debug, PartialEq, Eq)] +#[rtype(result = "Result<(Vec)>")] +pub struct GetAggregatePublicKey { + pub keyshares: OrderedSet>, +} + +#[derive(Message, Clone, Debug, PartialEq, Eq)] +#[rtype(result = "Result<(Vec)>")] +pub struct GetAggregatePlaintext { + pub decryptions: OrderedSet>, +} + +#[derive(Message, Clone, Debug, PartialEq, Eq)] +#[rtype(result = "Result<(Vec)>")] +pub struct DecryptCiphertext { + pub unsafe_secret: Vec, + pub ciphertext: Vec, +} + +pub type SharedRng = Arc>; + +/// Fhe library adaptor. All FHE computations should happen through this actor. +pub struct Fhe { + params: Arc, + crp: CommonRandomPoly, + rng: SharedRng, +} + +impl Actor for Fhe { + type Context = Context; +} + +impl Fhe { + pub fn new(params: Arc, crp: CommonRandomPoly, rng: SharedRng) -> Self { + Self { params, crp, rng } + } + + // Deprecated + pub fn try_default() -> Result { + // TODO: The production bootstrapping of this will involve receiving a crp bytes and param + // input form the event + let moduli = &vec![0x3FFFFFFF000001]; + let degree = 2048usize; + let plaintext_modulus = 1032193u64; + let rng = Arc::new(Mutex::new(ChaCha20Rng::from_entropy())); + let crp = CommonRandomPoly::new( + &BfvParametersBuilder::new() + .set_degree(degree) + .set_plaintext_modulus(plaintext_modulus) + .set_moduli(&moduli) + .build_arc()?, + &mut *rng.lock().unwrap(), + )? + .to_bytes(); + + Ok(Fhe::from_raw_params( + moduli, + degree, + plaintext_modulus, + &crp, + rng, + )?) + } + + pub fn from_raw_params( + moduli: &[u64], + degree: usize, + plaintext_modulus: u64, + crp: &[u8], + rng: Arc>, + ) -> Result { + let params = BfvParametersBuilder::new() + .set_degree(degree) + .set_plaintext_modulus(plaintext_modulus) + .set_moduli(moduli) + .build_arc()?; + + Ok(Fhe::new( + params.clone(), + CommonRandomPoly::deserialize(crp, ¶ms)?, + rng, + )) + } +} + +impl Handler for Fhe { + type Result = Result<(Vec, Vec)>; + fn handle(&mut self, _event: GenerateKeyshare, _: &mut Self::Context) -> Self::Result { + let sk_share = { SecretKey::random(&self.params, &mut *self.rng.lock().unwrap()) }; + let pk_share = + { PublicKeyShare::new(&sk_share, self.crp.clone(), &mut *self.rng.lock().unwrap())? }; + Ok(( + SecretKeySerializer::to_bytes(sk_share, self.params.clone())?, + PublicKeyShareSerializer::to_bytes(pk_share, self.params.clone(), self.crp.clone())?, + )) + } +} + +impl Handler for Fhe { + type Result = Result>; + fn handle(&mut self, msg: DecryptCiphertext, _: &mut Self::Context) -> Self::Result { + let DecryptCiphertext { + unsafe_secret, // TODO: fix security issues with sending secrets between actors + ciphertext, + } = msg; + + let secret_key = SecretKeySerializer::from_bytes(&unsafe_secret)?; + let ct = Arc::new(CiphertextSerializer::from_bytes(&ciphertext)?); + let inner = DecryptionShare::new(&secret_key, &ct, &mut *self.rng.lock().unwrap()).unwrap(); + + Ok(DecryptionShareSerializer::to_bytes( + inner, + self.params.clone(), + ct.clone(), + )?) + } +} + +impl Handler for Fhe { + type Result = Result>; + + fn handle(&mut self, msg: GetAggregatePublicKey, _: &mut Self::Context) -> Self::Result { + let public_key: PublicKey = msg + .keyshares + .iter() + .map(|k| PublicKeyShareSerializer::from_bytes(k)) + .collect::>>()? + .into_iter() + .aggregate()?; + + Ok(public_key.to_bytes()) + } +} + +impl Handler for Fhe { + type Result = Result>; + fn handle(&mut self, msg: GetAggregatePlaintext, _: &mut Self::Context) -> Self::Result { + let plaintext: Plaintext = msg + .decryptions + .iter() + .map(|k| DecryptionShareSerializer::from_bytes(k)) + .collect::>>()? + .into_iter() + .aggregate()?; + + // XXX: how do we know what the expected output of the plaintext is in order to decrypt + // here for serialization? + // This would be dependent on the computation that is running. + // For now assuming testcase of Vec and currently represents a "HARDCODED" program + // output format of Vec + // This could be determined based on the "program" config events + + let decoded = Vec::::try_decode(&plaintext, Encoding::poly())?; + let decoded = &decoded[0..2]; // TODO: this will be computation dependent + Ok(bincode::serialize(&decoded)?) + } +} + +pub struct FheFactory; + +impl FheFactory { + pub fn create(rng: Arc>) -> ActorFactory { + Box::new(move |ctx, evt| { + // Saving the fhe on Committee Requested + let EnclaveEvent::CommitteeRequested { data, .. } = evt else { + return; + }; + let CommitteeRequested { + degree, + moduli, + plaintext_modulus, + crp, + .. + } = data; + + ctx.fhe = Some( + Fhe::from_raw_params(&moduli, degree, plaintext_modulus, &crp, rng.clone()) + .unwrap() + .start(), + ); + }) + } +} diff --git a/packages/ciphernode/core/src/lib.rs b/packages/ciphernode/core/src/lib.rs index eecfcfeb..3131e409 100644 --- a/packages/ciphernode/core/src/lib.rs +++ b/packages/ciphernode/core/src/lib.rs @@ -1,13 +1,431 @@ -#![crate_name = "core"] +#![crate_name = "enclave_core"] #![crate_type = "lib"] -#![warn(missing_docs, unused_imports)] +// #![warn(missing_docs, unused_imports)] -pub struct Core { - pub name: String, -} +mod ciphernode; +mod ciphernode_selector; +mod committee_meta; +mod data; +mod e3_request; +mod enclave_contract; +mod eventbus; +pub mod events; +mod evm; +mod evm_listener; +mod evm_manager; +mod fhe; +mod logger; +mod main_aggregator; +mod main_ciphernode; +mod ordered_set; +mod p2p; +mod plaintext_aggregator; +mod publickey_aggregator; +mod serializers; +mod sortition; +mod utils; + +// TODO: this is too permissive +pub use actix::prelude::*; +pub use ciphernode::*; +pub use ciphernode_selector::*; +pub use committee_meta::*; +pub use data::*; +pub use e3_request::*; +pub use eventbus::*; +pub use events::*; +pub use fhe::*; +pub use logger::*; +pub use main_aggregator::*; +pub use main_ciphernode::*; +pub use p2p::*; +pub use plaintext_aggregator::*; +pub use publickey_aggregator::*; +pub use serializers::*; +pub use sortition::*; +pub use utils::*; + +// TODO: move these out to a test folder +#[cfg(test)] +mod tests { + use crate::{ + ciphernode_selector::CiphernodeSelector, + data::Data, + eventbus::{EventBus, GetHistory}, + events::{CommitteeRequested, E3id, EnclaveEvent, KeyshareCreated, PublicKeyAggregated}, + p2p::P2p, + serializers::{CiphertextSerializer, DecryptionShareSerializer, PublicKeyShareSerializer}, + utils::{setup_crp_params, ParamsWithCrp}, + CiphernodeAdded, CiphernodeFactory, CiphernodeSelected, CiphertextOutputPublished, + CommitteeMetaFactory, DecryptionshareCreated, E3RequestManager, FheFactory, + PlaintextAggregated, PlaintextAggregatorFactory, PublicKeyAggregatorFactory, ResetHistory, + SharedRng, Sortition, + }; + use actix::prelude::*; + use alloy_primitives::Address; + use anyhow::*; + use fhe::{ + bfv::{BfvParameters, Encoding, Plaintext, PublicKey, SecretKey}, + mbfv::{AggregateIter, CommonRandomPoly, DecryptionShare, PublicKeyShare}, + }; + use fhe_traits::{FheEncoder, FheEncrypter, Serialize}; + use rand::Rng; + use rand::SeedableRng; + use rand_chacha::ChaCha20Rng; + use std::{sync::Arc, time::Duration}; + use tokio::sync::Mutex; + use tokio::{sync::mpsc::channel, time::sleep}; + + // Simulating a local node + async fn setup_local_ciphernode( + bus: Addr, + rng: SharedRng, + logging: bool, + addr: Address, + ) { + // create data actor for saving data + let data = Data::new(logging).start(); // TODO: Use a sled backed Data Actor + + // create ciphernode actor for managing ciphernode flow + let sortition = Sortition::attach(bus.clone()); + CiphernodeSelector::attach(bus.clone(), sortition.clone(), addr); + + E3RequestManager::builder(bus.clone()) + .add_hook(CommitteeMetaFactory::create()) + .add_hook(FheFactory::create(rng.clone())) + .add_hook(PublicKeyAggregatorFactory::create( + bus.clone(), + sortition.clone(), + )) + .add_hook(PlaintextAggregatorFactory::create( + bus.clone(), + sortition.clone(), + )) + .add_hook(CiphernodeFactory::create( + bus.clone(), + data.clone(), + addr, + )) + .build(); + } + + fn generate_pk_share( + params: Arc, + crp: CommonRandomPoly, + rng: SharedRng, + ) -> Result<(Vec, SecretKey)> { + let sk = SecretKey::random(¶ms, &mut *rng.lock().unwrap()); + let pk = PublicKeyShareSerializer::to_bytes( + PublicKeyShare::new(&sk, crp.clone(), &mut *rng.lock().unwrap())?, + params.clone(), + crp, + )?; + Ok((pk, sk)) + } + + #[actix::test] + async fn test_public_key_aggregation_and_decryption() -> Result<()> { + // Setup EventBus + let bus = EventBus::new(true).start(); + + let rng = Arc::new(std::sync::Mutex::new(ChaCha20Rng::seed_from_u64(42))); + + let eth_addrs: Vec
= (0..3) + .map(|_| Address::from_slice(&rand::thread_rng().gen::<[u8; 20]>())) + .collect(); + + setup_local_ciphernode(bus.clone(), rng.clone(), true, eth_addrs[0]).await; + setup_local_ciphernode(bus.clone(), rng.clone(), true, eth_addrs[1]).await; + setup_local_ciphernode(bus.clone(), rng.clone(), true, eth_addrs[2]).await; + + let e3_id = E3id::new("1234"); + + let ParamsWithCrp { + moduli, + degree, + plaintext_modulus, + crp_bytes, + params, + } = setup_crp_params( + &[0x3FFFFFFF000001], + 2048, + 1032193, + Arc::new(std::sync::Mutex::new(ChaCha20Rng::seed_from_u64(42))), + ); + + let regevt_1 = EnclaveEvent::from(CiphernodeAdded { + address: eth_addrs[0], + index: 0, + num_nodes: 1, + }); + + bus.send(regevt_1.clone()).await?; + + let regevt_2 = EnclaveEvent::from(CiphernodeAdded { + address: eth_addrs[1], + index: 1, + num_nodes: 2, + }); + + bus.send(regevt_2.clone()).await?; + + let regevt_3 = EnclaveEvent::from(CiphernodeAdded { + address: eth_addrs[2], + index: 2, + num_nodes: 3, + }); + + bus.send(regevt_3.clone()).await?; + + let event = EnclaveEvent::from(CommitteeRequested { + e3_id: e3_id.clone(), + nodecount: 3, + sortition_seed: 123, + moduli: moduli.clone(), + degree, + plaintext_modulus, + crp: crp_bytes.clone(), + }); + + // Send the computation requested event + bus.send(event.clone()).await?; + + // Test that we cannot send the same event twice + bus.send(event).await?; + + let history = bus.send(GetHistory).await?; + + let rng_test = Arc::new(std::sync::Mutex::new(ChaCha20Rng::seed_from_u64(42))); + + let crpoly = CommonRandomPoly::deserialize(&crp_bytes.clone(), ¶ms)?; + + // Passing rng through function chain to ensure it matches usage in system above + let (p1, sk1) = generate_pk_share(params.clone(), crpoly.clone(), rng_test.clone())?; + let (p2, sk2) = generate_pk_share(params.clone(), crpoly.clone(), rng_test.clone())?; + let (p3, sk3) = generate_pk_share(params.clone(), crpoly.clone(), rng_test.clone())?; + + let pubkey: PublicKey = [p1.clone(), p2.clone(), p3.clone()] + .iter() + .map(|k| PublicKeyShareSerializer::from_bytes(k).unwrap()) + .aggregate()?; + + assert_eq!(history.len(), 9); + assert_eq!( + history, + vec![ + regevt_1, + regevt_2, + regevt_3, + EnclaveEvent::from(CommitteeRequested { + e3_id: e3_id.clone(), + nodecount: 3, + sortition_seed: 123, + moduli, + degree, + plaintext_modulus, + crp: crp_bytes, + }), + EnclaveEvent::from(CiphernodeSelected { + e3_id: e3_id.clone(), + nodecount: 3, + }), + EnclaveEvent::from(KeyshareCreated { + pubkey: p1.clone(), + e3_id: e3_id.clone(), + node: eth_addrs[0] + }), + EnclaveEvent::from(KeyshareCreated { + pubkey: p2.clone(), + e3_id: e3_id.clone(), + node: eth_addrs[1] + }), + EnclaveEvent::from(KeyshareCreated { + pubkey: p3.clone(), + e3_id: e3_id.clone(), + node: eth_addrs[2] + }), + EnclaveEvent::from(PublicKeyAggregated { + pubkey: pubkey.to_bytes(), + e3_id: e3_id.clone() + }) + ] + ); + + // Aggregate decryption + bus.send(ResetHistory).await?; -impl Core { - fn new(name: String) -> Self { - Self { name } + // TODO: + // Making these values large (especially the yes value) requires changing + // the params we use here - as we tune the FHE we need to take care + let yes = 1234u64; + let no = 873827u64; + + let raw_plaintext = vec![yes, no]; + let expected_raw_plaintext = bincode::serialize(&raw_plaintext)?; + let pt = Plaintext::try_encode(&raw_plaintext, Encoding::poly(), ¶ms)?; + + let ciphertext = pubkey.try_encrypt(&pt, &mut ChaCha20Rng::seed_from_u64(42))?; + + let event = EnclaveEvent::from(CiphertextOutputPublished { + ciphertext_output: CiphertextSerializer::to_bytes(ciphertext.clone(), params.clone())?, + e3_id: e3_id.clone(), + }); + + let arc_ct = Arc::new(ciphertext); + + let ds1 = DecryptionShareSerializer::to_bytes( + DecryptionShare::new(&sk1, &arc_ct, &mut *rng_test.lock().unwrap()).unwrap(), + params.clone(), + arc_ct.clone(), + )?; + let ds2 = DecryptionShareSerializer::to_bytes( + DecryptionShare::new(&sk2, &arc_ct, &mut *rng_test.lock().unwrap()).unwrap(), + params.clone(), + arc_ct.clone(), + )?; + let ds3 = DecryptionShareSerializer::to_bytes( + DecryptionShare::new(&sk3, &arc_ct, &mut *rng_test.lock().unwrap()).unwrap(), + params.clone(), + arc_ct.clone(), + )?; + + // let ds1 = sk1 + bus.send(event.clone()).await?; + + sleep(Duration::from_millis(1)).await; // need to push to next tick + let history = bus.send(GetHistory).await?; + + assert_eq!(history.len(), 5); + assert_eq!( + history, + vec![ + event.clone(), + EnclaveEvent::from(DecryptionshareCreated { + decryption_share: ds1.clone(), + e3_id: e3_id.clone(), + node: eth_addrs[0] + }), + EnclaveEvent::from(DecryptionshareCreated { + decryption_share: ds2.clone(), + e3_id: e3_id.clone(), + node: eth_addrs[1] + }), + EnclaveEvent::from(DecryptionshareCreated { + decryption_share: ds3.clone(), + e3_id: e3_id.clone(), + node: eth_addrs[2] + }), + EnclaveEvent::from(PlaintextAggregated { + e3_id: e3_id.clone(), + decrypted_output: expected_raw_plaintext.clone() + }) + ] + ); + + Ok(()) } -} \ No newline at end of file + + #[actix::test] + async fn test_p2p_actor_forwards_events_to_network() -> Result<()> { + // Setup elements in test + let (tx, mut output) = channel(100); // Transmit byte events to the network + let (input, rx) = channel(100); // Receive byte events from the network + let bus = EventBus::new(true).start(); + P2p::spawn_and_listen(bus.clone(), tx.clone(), rx); + + // Capture messages from output on msgs vec + let msgs: Arc>>> = Arc::new(Mutex::new(Vec::new())); + let msgs_loop = msgs.clone(); + + tokio::spawn(async move { + while let Some(msg) = output.recv().await { + msgs_loop.lock().await.push(msg.clone()); + let _ = input.send(msg).await; // loopback to simulate a rebroadcast message + // if this manages to broadcast an event to the + // event bus we will expect to see an extra event on + // the bus + } + }); + + let evt_1 = EnclaveEvent::from(CommitteeRequested { + e3_id: E3id::new("1234"), + nodecount: 3, + sortition_seed: 123, + moduli: vec![0x3FFFFFFF000001], + degree: 2048, + plaintext_modulus: 1032193, + crp: vec![1, 2, 3, 4], + }); + + let evt_2 = EnclaveEvent::from(CommitteeRequested { + e3_id: E3id::new("1235"), + nodecount: 3, + sortition_seed: 123, + moduli: vec![0x3FFFFFFF000001], + degree: 2048, + plaintext_modulus: 1032193, + crp: vec![1, 2, 3, 4], + }); + + let local_evt_3 = EnclaveEvent::from(CiphernodeSelected { + e3_id: E3id::new("1235"), + nodecount: 3, + }); + + bus.do_send(evt_1.clone()); + bus.do_send(evt_2.clone()); + bus.do_send(local_evt_3.clone()); // This is a local event which should not be broadcast to the network + + sleep(Duration::from_millis(1)).await; // need to push to next tick + + // check the history of the event bus + let history = bus.send(GetHistory).await?; + + assert_eq!( + *msgs.lock().await, + vec![evt_1.to_bytes()?, evt_2.to_bytes()?], // notice no local events + "P2p did not transmit correct events to the network" + ); + + assert_eq!( + history, + vec![evt_1, evt_2, local_evt_3], // all local events that have been broadcast but no + // events from the loopback + "P2p must not retransmit forwarded event to event bus" + ); + + Ok(()) + } + + #[actix::test] + async fn test_p2p_actor_forwards_events_to_bus() -> Result<()> { + // Setup elements in test + let (tx, _) = channel(100); // Transmit byte events to the network + let (input, rx) = channel(100); // Receive byte events from the network + let bus = EventBus::new(true).start(); + P2p::spawn_and_listen(bus.clone(), tx.clone(), rx); + + // Capture messages from output on msgs vec + let event = EnclaveEvent::from(CommitteeRequested { + e3_id: E3id::new("1235"), + nodecount: 3, + sortition_seed: 123, + moduli: vec![0x3FFFFFFF000001], + degree: 2048, + plaintext_modulus: 1032193, + crp: vec![1, 2, 3, 4], + }); + + // lets send an event from the network + let _ = input.send(event.to_bytes()?).await; + + sleep(Duration::from_millis(1)).await; // need to push to next tick + + // check the history of the event bus + let history = bus.send(GetHistory).await?; + + assert_eq!(history, vec![event]); + + Ok(()) + } +} diff --git a/packages/ciphernode/core/src/logger.rs b/packages/ciphernode/core/src/logger.rs new file mode 100644 index 00000000..8b3ef1cf --- /dev/null +++ b/packages/ciphernode/core/src/logger.rs @@ -0,0 +1,54 @@ +use crate::{EnclaveEvent, EventBus, Subscribe}; +use actix::{Actor, Addr, Context, Handler}; +use base64::prelude::*; +use std::fs; + +pub struct SimpleLogger { + name: String, +} + +impl SimpleLogger { + pub fn attach(name: &str, bus: Addr) -> Addr { + let addr = Self { + name: name.to_owned(), + } + .start(); + bus.do_send(Subscribe { + listener: addr.clone().recipient(), + event_type: "*".to_string(), + }); + println!("[{}]: READY", name); + addr + } +} + +impl Actor for SimpleLogger { + type Context = Context; +} + +impl Handler for SimpleLogger { + type Result = (); + fn handle(&mut self, msg: EnclaveEvent, _: &mut Self::Context) -> Self::Result { + match msg.clone() { + EnclaveEvent::PublicKeyAggregated { data, .. } => { + let pubkey_str = BASE64_STANDARD.encode(&data.pubkey); + println!( + "\n\nPUBKEY:\n{}...{}\n\nSaved to scripts/pubkey.b64\n\n", + &pubkey_str[..20], + &pubkey_str[pubkey_str.len() - 20..] + ); + fs::write("scripts/pubkey.b64", &pubkey_str).unwrap(); + println!("[{}]: {}", self.name, msg); + } + EnclaveEvent::PlaintextAggregated { data, .. } => { + let output: Vec = bincode::deserialize(&data.decrypted_output).unwrap(); + println!("\n\nDECRYPTED:\n{:?}\n\n", output); + println!("[{}]: {}", self.name, msg); + } + EnclaveEvent::CiphernodeAdded { data, .. } => { + println!("[{}]: CiphernodeAdded({})", self.name, data.address); + } + _ => println!("[{}]: {}", self.name, msg), + } + } +} diff --git a/packages/ciphernode/core/src/main_aggregator.rs b/packages/ciphernode/core/src/main_aggregator.rs new file mode 100644 index 00000000..faf4ecb8 --- /dev/null +++ b/packages/ciphernode/core/src/main_aggregator.rs @@ -0,0 +1,69 @@ +use std::sync::{Arc, Mutex}; + +use crate::{ + committee_meta::CommitteeMetaFactory, E3RequestManager, EventBus, FheFactory, P2p, + PlaintextAggregatorFactory, PublicKeyAggregatorFactory, SimpleLogger, Sortition, +}; +use actix::{Actor, Addr, Context}; +use rand::SeedableRng; +use rand_chacha::rand_core::OsRng; +use tokio::task::JoinHandle; + +/// Main Ciphernode Actor +/// Suprvises all children +// TODO: add supervision logic +pub struct MainAggregator { + e3_manager: Addr, + bus: Addr, + sortition: Addr, + p2p: Addr, +} + +impl MainAggregator { + pub fn new( + bus: Addr, + sortition: Addr, + p2p: Addr, + e3_manager: Addr, + ) -> Self { + Self { + e3_manager, + bus, + sortition, + p2p, + } + } + + pub async fn attach() -> (Addr, JoinHandle<()>) { + let rng = Arc::new(Mutex::new( + rand_chacha::ChaCha20Rng::from_rng(OsRng).expect("Failed to create RNG"), + )); + let bus = EventBus::new(true).start(); + let sortition = Sortition::attach(bus.clone()); + + let e3_manager = E3RequestManager::builder(bus.clone()) + .add_hook(CommitteeMetaFactory::create()) + .add_hook(FheFactory::create(rng.clone())) + .add_hook(PublicKeyAggregatorFactory::create( + bus.clone(), + sortition.clone(), + )) + .add_hook(PlaintextAggregatorFactory::create( + bus.clone(), + sortition.clone(), + )) + .build(); + + let (p2p_addr, join_handle) = + P2p::spawn_libp2p(bus.clone()).expect("Failed to setup libp2p"); + + SimpleLogger::attach("AGGREGATOR", bus.clone()); + + let main_addr = MainAggregator::new(bus, sortition, p2p_addr, e3_manager).start(); + (main_addr, join_handle) + } +} + +impl Actor for MainAggregator { + type Context = Context; +} diff --git a/packages/ciphernode/core/src/main_ciphernode.rs b/packages/ciphernode/core/src/main_ciphernode.rs new file mode 100644 index 00000000..94af2618 --- /dev/null +++ b/packages/ciphernode/core/src/main_ciphernode.rs @@ -0,0 +1,85 @@ +use std::sync::{Arc, Mutex}; + +use crate::{ + CiphernodeFactory, CiphernodeSelector, CommitteeMetaFactory, Data, E3RequestManager, EventBus, + FheFactory, P2p, PlaintextAggregatorFactory, PublicKeyAggregatorFactory, SimpleLogger, + Sortition, +}; +use actix::{Actor, Addr, Context}; +use alloy_primitives::Address; +use rand::SeedableRng; +use rand_chacha::rand_core::OsRng; +use tokio::task::JoinHandle; + +/// Main Ciphernode Actor +/// Suprvises all children +// TODO: add supervision logic +pub struct MainCiphernode { + addr: Address, + bus: Addr, + data: Addr, + sortition: Addr, + selector: Addr, + e3_manager: Addr, + p2p: Addr, +} + +impl MainCiphernode { + pub fn new( + addr: Address, + bus: Addr, + data: Addr, + sortition: Addr, + selector: Addr, + p2p: Addr, + e3_manager: Addr, + ) -> Self { + Self { + addr, + bus, + data, + sortition, + selector, + e3_manager, + p2p, + } + } + + pub async fn attach( + address: Address, + // rpc_url: String, + // contract_address: Address, + ) -> (Addr, JoinHandle<()>) { + let rng = Arc::new(Mutex::new( + rand_chacha::ChaCha20Rng::from_rng(OsRng).expect("Failed to create RNG"), + )); + let bus = EventBus::new(true).start(); + let data = Data::new(true).start(); // TODO: Use a sled backed Data Actor + let sortition = Sortition::attach(bus.clone()); + let selector = CiphernodeSelector::attach(bus.clone(), sortition.clone(), address); + + let e3_manager = E3RequestManager::builder(bus.clone()) + .add_hook(CommitteeMetaFactory::create()) + .add_hook(FheFactory::create(rng.clone())) + .add_hook(CiphernodeFactory::create( + bus.clone(), + data.clone(), + address, + )) + .build(); + + let (p2p_addr, join_handle) = + P2p::spawn_libp2p(bus.clone()).expect("Failed to setup libp2p"); + + SimpleLogger::attach("CIPHERNODE", bus.clone()); + let main_addr = MainCiphernode::new( + address, bus, data, sortition, selector, p2p_addr, e3_manager, + ) + .start(); + (main_addr, join_handle) + } +} + +impl Actor for MainCiphernode { + type Context = Context; +} diff --git a/packages/ciphernode/core/src/ordered_set.rs b/packages/ciphernode/core/src/ordered_set.rs new file mode 100644 index 00000000..c263e30a --- /dev/null +++ b/packages/ciphernode/core/src/ordered_set.rs @@ -0,0 +1,194 @@ +use std::collections::BTreeSet; +use std::hash::{Hash, Hasher}; +use std::fmt; + +#[derive(Clone)] +pub struct OrderedSet(BTreeSet); + +impl OrderedSet { + pub fn new() -> Self { + OrderedSet(BTreeSet::new()) + } + + pub fn insert(&mut self, value: T) -> bool { + self.0.insert(value) + } + + pub fn contains(&self, value: &T) -> bool { + self.0.contains(value) + } + + pub fn len(&self) -> usize { + self.0.len() + } + + pub fn is_empty(&self) -> bool { + self.0.is_empty() + } + + pub fn iter(&self) -> impl Iterator { + self.0.iter() + } +} + +impl Hash for OrderedSet { + fn hash(&self, state: &mut H) { + self.0.len().hash(state); + for item in &self.0 { + item.hash(state); + } + } +} + +impl PartialEq for OrderedSet { + fn eq(&self, other: &Self) -> bool { + self.0 == other.0 + } +} + +impl Eq for OrderedSet {} + +impl fmt::Debug for OrderedSet { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_set().entries(self.0.iter()).finish() + } +} + +impl IntoIterator for OrderedSet { + type Item = T; + type IntoIter = std::collections::btree_set::IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.0.into_iter() + } +} + +impl<'a, T: Ord> IntoIterator for &'a OrderedSet { + type Item = &'a T; + type IntoIter = std::collections::btree_set::Iter<'a, T>; + + fn into_iter(self) -> Self::IntoIter { + self.0.iter() + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::collections::hash_map::DefaultHasher; + use std::hash::{Hash, Hasher}; + + #[test] + fn test_new() { + let set: OrderedSet = OrderedSet::new(); + assert!(set.is_empty()); + assert_eq!(set.len(), 0); + } + + #[test] + fn test_insert() { + let mut set = OrderedSet::new(); + assert!(set.insert(1)); + assert!(set.insert(2)); + assert!(!set.insert(1)); // Duplicate insertion + assert_eq!(set.len(), 2); + } + + #[test] + fn test_contains() { + let mut set = OrderedSet::new(); + set.insert(1); + set.insert(2); + assert!(set.contains(&1)); + assert!(set.contains(&2)); + assert!(!set.contains(&3)); + } + + #[test] + fn test_len_and_is_empty() { + let mut set = OrderedSet::new(); + assert!(set.is_empty()); + assert_eq!(set.len(), 0); + set.insert(1); + assert!(!set.is_empty()); + assert_eq!(set.len(), 1); + } + + #[test] + fn test_iter() { + let mut set = OrderedSet::new(); + set.insert(3); + set.insert(1); + set.insert(2); + let mut iter = set.iter(); + assert_eq!(iter.next(), Some(&1)); + assert_eq!(iter.next(), Some(&2)); + assert_eq!(iter.next(), Some(&3)); + assert_eq!(iter.next(), None); + } + + #[test] + fn test_hash() { + let mut set1 = OrderedSet::new(); + set1.insert(1); + set1.insert(2); + + let mut set2 = OrderedSet::new(); + set2.insert(2); + set2.insert(1); + + let mut hasher1 = DefaultHasher::new(); + let mut hasher2 = DefaultHasher::new(); + + set1.hash(&mut hasher1); + set2.hash(&mut hasher2); + + assert_eq!(hasher1.finish(), hasher2.finish()); + } + + #[test] + fn test_eq() { + let mut set1 = OrderedSet::new(); + set1.insert(1); + set1.insert(2); + + let mut set2 = OrderedSet::new(); + set2.insert(2); + set2.insert(1); + + let mut set3 = OrderedSet::new(); + set3.insert(1); + set3.insert(3); + + assert_eq!(set1, set2); + assert_ne!(set1, set3); + } + + #[test] + fn test_debug() { + let mut set = OrderedSet::new(); + set.insert(1); + set.insert(2); + assert_eq!(format!("{:?}", set), "{1, 2}"); + } + + #[test] + fn test_into_iter() { + let mut set = OrderedSet::new(); + set.insert(3); + set.insert(1); + set.insert(2); + let vec: Vec = set.into_iter().collect(); + assert_eq!(vec, vec![1, 2, 3]); + } + + #[test] + fn test_iter_ref() { + let mut set = OrderedSet::new(); + set.insert(3); + set.insert(1); + set.insert(2); + let vec: Vec<&i32> = (&set).into_iter().collect(); + assert_eq!(vec, vec![&1, &2, &3]); + } +} diff --git a/packages/ciphernode/core/src/p2p.rs b/packages/ciphernode/core/src/p2p.rs new file mode 100644 index 00000000..7c8cb9a8 --- /dev/null +++ b/packages/ciphernode/core/src/p2p.rs @@ -0,0 +1,120 @@ +use std::{collections::HashSet, error::Error}; + +/// Actor for connecting to an libp2p client via it's mpsc channel interface +/// This Actor should be responsible for +use actix::prelude::*; +use p2p::EnclaveRouter; +use tokio::sync::mpsc::{Receiver, Sender}; + +use crate::{ + eventbus::{EventBus, Subscribe}, + events::{EnclaveEvent, EventId}, +}; + +pub struct P2p { + bus: Addr, + tx: Sender>, + sent_events: HashSet, +} + +impl Actor for P2p { + type Context = Context; +} + +#[derive(Message, Clone, Debug, PartialEq, Eq)] +#[rtype(result = "anyhow::Result<()>")] +struct LibP2pEvent(pub Vec); + +impl P2p { + pub fn new(bus: Addr, tx: Sender>) -> Self { + Self { + bus, + tx, + sent_events: HashSet::new(), + } + } + + /// Start a new P2p actor listening for libp2p messages on the given Receiver and forwarding + /// them to the actor + pub fn spawn_and_listen( + bus: Addr, + tx: Sender>, // Transmit byte events to the network + mut rx: Receiver>, // Receive byte events from the network + ) -> Addr { + // Create a new Actor + let p2p = P2p::new(bus.clone(), tx).start(); + + // Listen on all events + bus.do_send(Subscribe { + event_type: String::from("*"), + listener: p2p.clone().recipient(), + }); + + // Clone this to go in the spawned future + let p2p_addr = p2p.clone(); + tokio::spawn(async move { + while let Some(msg) = rx.recv().await { + p2p_addr.do_send(LibP2pEvent(msg)) + } + }); + + // Return the address + p2p + } + + pub fn spawn_libp2p( + bus: Addr, + ) -> Result<(Addr, tokio::task::JoinHandle<()>), Box> { + let (mut libp2p, tx, rx) = EnclaveRouter::new()?; + libp2p.connect_swarm("mdns".to_string())?; + libp2p.join_topic("enclave-keygen-01")?; + + let p2p_addr = Self::spawn_and_listen(bus, tx, rx); + let handle = tokio::spawn(async move { libp2p.start().await.unwrap() }); + Ok((p2p_addr, handle)) + } +} + +impl Handler for P2p { + type Result = anyhow::Result<()>; + fn handle(&mut self, msg: LibP2pEvent, _: &mut Self::Context) -> Self::Result { + let LibP2pEvent(bytes) = msg; + match EnclaveEvent::from_bytes(&bytes) { + Ok(event) => { + self.bus.do_send(event.clone()); + self.sent_events.insert(event.into()); + } + Err(err) => println!("Error: {}", err), + } + Ok(()) + } +} + +impl Handler for P2p { + type Result = ResponseFuture<()>; + fn handle(&mut self, event: EnclaveEvent, _: &mut Self::Context) -> Self::Result { + let sent_events = self.sent_events.clone(); + let tx = self.tx.clone(); + let evt = event.clone(); + Box::pin(async move { + let id: EventId = evt.clone().into(); + + // if we have seen this event before dont rebroadcast + if sent_events.contains(&id) { + return; + } + + // Ignore events that should be considered local + if evt.is_local_only() { + return; + } + + match evt.to_bytes() { + Ok(bytes) => { + let _ = tx.send(bytes).await; + } + Err(error) => println!("Error: {}", error), + } + }) + } +} diff --git a/packages/ciphernode/core/src/plaintext_aggregator.rs b/packages/ciphernode/core/src/plaintext_aggregator.rs new file mode 100644 index 00000000..618e2088 --- /dev/null +++ b/packages/ciphernode/core/src/plaintext_aggregator.rs @@ -0,0 +1,209 @@ +use crate::{ + ordered_set::OrderedSet, ActorFactory, DecryptionshareCreated, E3id, EnclaveEvent, EventBus, + Fhe, GetAggregatePlaintext, GetHasNode, PlaintextAggregated, Sortition, +}; +use actix::prelude::*; +use anyhow::{anyhow, Result}; + +#[derive(Debug, Clone)] +pub enum PlaintextAggregatorState { + Collecting { + nodecount: usize, + shares: OrderedSet>, + seed: u64, + }, + Computing { + shares: OrderedSet>, + }, + Complete { + decrypted: Vec, + shares: OrderedSet>, + }, +} + +#[derive(Message)] +#[rtype(result = "anyhow::Result<()>")] +struct ComputeAggregate { + pub shares: OrderedSet>, +} + +pub struct PlaintextAggregator { + fhe: Addr, + bus: Addr, + sortition: Addr, + e3_id: E3id, + state: PlaintextAggregatorState, +} + +impl PlaintextAggregator { + pub fn new( + fhe: Addr, + bus: Addr, + sortition: Addr, + e3_id: E3id, + nodecount: usize, + seed: u64, + ) -> Self { + PlaintextAggregator { + fhe, + bus, + sortition, + e3_id, + state: PlaintextAggregatorState::Collecting { + nodecount, + shares: OrderedSet::new(), + seed, + }, + } + } + + pub fn add_share(&mut self, share: Vec) -> Result { + let PlaintextAggregatorState::Collecting { + nodecount, shares, .. + } = &mut self.state + else { + return Err(anyhow::anyhow!("Can only add share in Collecting state")); + }; + + shares.insert(share); + if shares.len() == *nodecount { + return Ok(PlaintextAggregatorState::Computing { + shares: shares.clone(), + }); + } + + Ok(self.state.clone()) + } + + pub fn set_decryption(&mut self, decrypted: Vec) -> Result { + let PlaintextAggregatorState::Computing { shares } = &mut self.state else { + return Ok(self.state.clone()); + }; + + let shares = shares.to_owned(); + + Ok(PlaintextAggregatorState::Complete { decrypted, shares }) + } +} + +impl Actor for PlaintextAggregator { + type Context = Context; +} + +impl Handler for PlaintextAggregator { + type Result = (); + fn handle(&mut self, msg: EnclaveEvent, ctx: &mut Self::Context) -> Self::Result { + if let EnclaveEvent::DecryptionshareCreated { data, .. } = msg { + ctx.notify(data) + } + } +} + +impl Handler for PlaintextAggregator { + type Result = ResponseActFuture>; + + fn handle(&mut self, event: DecryptionshareCreated, _: &mut Self::Context) -> Self::Result { + let PlaintextAggregatorState::Collecting { + nodecount, seed, .. + } = self.state + else { + println!("Aggregator has been closed for collecting."); + return Box::pin(fut::ready(Ok(()))); + }; + + let size = nodecount; + let address = event.node; + let e3_id = event.e3_id.clone(); + let decryption_share = event.decryption_share.clone(); + + Box::pin( + self.sortition + .send(GetHasNode { + address, + size, + seed, + }) + .into_actor(self) + .map(move |res, act, ctx| { + let has_node = res?; + if !has_node { + println!("Node not found in committee"); // TODO: log properly + return Ok(()); + } + + if e3_id != act.e3_id { + println!("Wrong e3_id sent to aggregator. This should not happen."); + return Ok(()); + } + + // add the keyshare and + act.state = act.add_share(decryption_share)?; + + // Check the state and if it has changed to the computing + if let PlaintextAggregatorState::Computing { shares } = &act.state { + ctx.notify(ComputeAggregate { + shares: shares.clone(), + }) + } + + Ok(()) + }), + ) + } +} + +impl Handler for PlaintextAggregator { + type Result = ResponseActFuture>; + fn handle(&mut self, msg: ComputeAggregate, _: &mut Self::Context) -> Self::Result { + Box::pin( + self.fhe + .send(GetAggregatePlaintext { + decryptions: msg.shares.clone(), + }) + .into_actor(self) + .map(|res, act, _| { + let decrypted_output = res??; + // Update the local state + act.state = act.set_decryption(decrypted_output.clone())?; + + // Dispatch the PublicKeyAggregated event + let event = EnclaveEvent::from(PlaintextAggregated { + decrypted_output, + e3_id: act.e3_id.clone(), + }); + act.bus.do_send(event); + + Ok(()) + }), + ) + } +} + +pub struct PlaintextAggregatorFactory; +impl PlaintextAggregatorFactory { + pub fn create(bus: Addr, sortition: Addr) -> ActorFactory { + Box::new(move |ctx, evt| { + // Save plaintext aggregator + let EnclaveEvent::CiphertextOutputPublished { data, .. } = evt else { + return; + }; + let Some(ref fhe) = ctx.fhe else { + return; + }; + let Some(ref meta) = ctx.meta else { + return; + }; + ctx.plaintext = Some( + PlaintextAggregator::new( + fhe.clone(), + bus.clone(), + sortition.clone(), + data.e3_id, + meta.nodecount, + meta.seed, + ) + .start(), + ); + }) + } +} diff --git a/packages/ciphernode/core/src/publickey_aggregator.rs b/packages/ciphernode/core/src/publickey_aggregator.rs new file mode 100644 index 00000000..2b09ae85 --- /dev/null +++ b/packages/ciphernode/core/src/publickey_aggregator.rs @@ -0,0 +1,240 @@ +use crate::{ + eventbus::EventBus, + events::{E3id, EnclaveEvent, KeyshareCreated, PublicKeyAggregated}, + fhe::{Fhe, GetAggregatePublicKey}, + ordered_set::OrderedSet, + ActorFactory, GetHasNode, Sortition, +}; +use actix::prelude::*; +use anyhow::Result; + +#[derive(Debug, Clone)] +pub enum PublicKeyAggregatorState { + Collecting { + nodecount: usize, + keyshares: OrderedSet>, + seed: u64, + }, + Computing { + keyshares: OrderedSet>, + }, + Complete { + public_key: Vec, + keyshares: OrderedSet>, + }, +} + +#[derive(Message)] +#[rtype(result = "anyhow::Result<()>")] +struct ComputeAggregate { + pub keyshares: OrderedSet>, +} + +pub struct PublicKeyAggregator { + fhe: Addr, + bus: Addr, + sortition: Addr, + e3_id: E3id, + state: PublicKeyAggregatorState, +} + +/// Aggregate PublicKey for a committee of nodes. This actor listens for KeyshareCreated events +/// around a particular e3_id and aggregates the public key based on this and once done broadcasts +/// a EnclaveEvent::PublicKeyAggregated event on the event bus. Note events are hashed and +/// identical events will not be triggered twice. +/// It is expected to change this mechanism as we work through adversarial scenarios and write tests +/// for them. +impl PublicKeyAggregator { + pub fn new( + fhe: Addr, + bus: Addr, + sortition: Addr, + e3_id: E3id, + nodecount: usize, + seed: u64, + ) -> Self { + PublicKeyAggregator { + fhe, + bus, + e3_id, + sortition, + state: PublicKeyAggregatorState::Collecting { + nodecount, + keyshares: OrderedSet::new(), + seed, + }, + } + } + + pub fn add_keyshare(&mut self, keyshare: Vec) -> Result { + let PublicKeyAggregatorState::Collecting { + nodecount, + keyshares, + .. + } = &mut self.state + else { + return Err(anyhow::anyhow!("Can only add keyshare in Collecting state")); + }; + + keyshares.insert(keyshare); + if keyshares.len() == *nodecount { + return Ok(PublicKeyAggregatorState::Computing { + keyshares: keyshares.clone(), + }); + } + + Ok(self.state.clone()) + } + + pub fn set_pubkey(&mut self, pubkey: Vec) -> Result { + let PublicKeyAggregatorState::Computing { keyshares } = &mut self.state else { + return Ok(self.state.clone()); + }; + + let keyshares = keyshares.to_owned(); + + Ok(PublicKeyAggregatorState::Complete { + public_key: pubkey, + keyshares, + }) + } +} + +impl Actor for PublicKeyAggregator { + type Context = Context; +} + +impl Handler for PublicKeyAggregator { + type Result = (); + fn handle(&mut self, msg: EnclaveEvent, ctx: &mut Self::Context) -> Self::Result { + if let EnclaveEvent::KeyshareCreated { data, .. } = msg { + ctx.notify(data) + } + } +} + +impl Handler for PublicKeyAggregator { + type Result = ResponseActFuture>; + + fn handle(&mut self, event: KeyshareCreated, _: &mut Self::Context) -> Self::Result { + let PublicKeyAggregatorState::Collecting { + nodecount, seed, .. + } = self.state.clone() + else { + println!("Aggregator has been closed for collecting keyshares."); // TODO: log properly + + return Box::pin(fut::ready(Ok(()))); + }; + + let size = nodecount; + let address = event.node; + let e3_id = event.e3_id.clone(); + let pubkey = event.pubkey.clone(); + + Box::pin( + self.sortition + .send(GetHasNode { + address, + size, + seed, + }) + .into_actor(self) + .map(move |res, act, ctx| { + // NOTE: Returning Ok(()) on errors as we probably dont need a result type here since + // we will not be doing a send + let has_node = res?; + if !has_node { + println!("Node not found in committee"); // TODO: log properly + return Ok(()); + } + + if e3_id != act.e3_id { + println!("Wrong e3_id sent to aggregator. This should not happen."); + return Ok(()); + } + + // add the keyshare and + act.state = act.add_keyshare(pubkey)?; + + // Check the state and if it has changed to the computing + if let PublicKeyAggregatorState::Computing { keyshares } = &act.state { + ctx.notify(ComputeAggregate { + keyshares: keyshares.clone(), + }) + } + + Ok(()) + }), + ) + } +} + +impl Handler for PublicKeyAggregator { + type Result = ResponseActFuture>; + + fn handle(&mut self, msg: ComputeAggregate, _: &mut Self::Context) -> Self::Result { + // Futures are awkward in Actix from what I can tell we should try and structure events so + // that futures that don't require access to self like the following... + Box::pin( + // Run the async future. + self.fhe + .send(GetAggregatePublicKey { + keyshares: msg.keyshares.clone(), + }) + // allow access to the actor + .into_actor(self) + // map into some sync stuff + .map(|res, act, _| { + // We have to double unwrap here. Suggestions? + // 1st - Mailbox error. + // 2nd - GetAggregatePublicKey Response. + let pubkey = res??; + + // Update the local state + act.state = act.set_pubkey(pubkey.clone())?; + + // Dispatch the PublicKeyAggregated event + let event = EnclaveEvent::from(PublicKeyAggregated { + pubkey, + e3_id: act.e3_id.clone(), + }); + + act.bus.do_send(event); + + // Return + Ok(()) + }), + ) + } +} + +pub struct PublicKeyAggregatorFactory; +impl PublicKeyAggregatorFactory { + pub fn create(bus: Addr, sortition: Addr) -> ActorFactory { + Box::new(move |ctx, evt| { + // Saving the publickey aggregator with deps on CommitteeRequested + let EnclaveEvent::CommitteeRequested { data, .. } = evt else { + return; + }; + + let Some(ref fhe) = ctx.fhe else { + return; + }; + let Some(ref meta) = ctx.meta else { + return; + }; + + ctx.publickey = Some( + PublicKeyAggregator::new( + fhe.clone(), + bus.clone(), + sortition.clone(), + data.e3_id, + meta.nodecount, + meta.seed, + ) + .start(), + ); + }) + } +} diff --git a/packages/ciphernode/core/src/serializers/ciphertext.rs b/packages/ciphernode/core/src/serializers/ciphertext.rs new file mode 100644 index 00000000..271fef7b --- /dev/null +++ b/packages/ciphernode/core/src/serializers/ciphertext.rs @@ -0,0 +1,56 @@ +use anyhow::*; +use fhe::bfv::{BfvParameters, Ciphertext}; +use fhe_traits::{Deserialize, DeserializeParametrized, Serialize}; +use serde::Serializer; +use std::sync::Arc; + +pub struct CiphertextSerializer { + pub inner: Ciphertext, + pub params: Arc, +} + +impl CiphertextSerializer { + pub fn to_bytes(inner: Ciphertext, params: Arc) -> Result> { + let value = Self { inner, params }; + Ok(bincode::serialize(&value)?) + } + + pub fn from_bytes(bytes:&[u8]) -> Result{ + let wct: Self = bincode::deserialize(&bytes)?; + Ok(wct.inner) + } +} + +/// Deserialize from serde to PublicKeySerializer +impl<'de> serde::Deserialize<'de> for CiphertextSerializer { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + // Intermediate struct of bytes for deserialization + #[derive(serde::Deserialize)] + struct DeserializedBytes { + par: Vec, + bytes: Vec, + } + let DeserializedBytes { par, bytes } = DeserializedBytes::deserialize(deserializer)?; + let params = Arc::new(BfvParameters::try_deserialize(&par).unwrap()); + let inner = Ciphertext::from_bytes(&bytes, ¶ms).map_err(serde::de::Error::custom)?; + std::result::Result::Ok(Self { inner, params }) + } +} +impl serde::Serialize for CiphertextSerializer { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + use serde::ser::SerializeStruct; + let bytes = self.inner.to_bytes(); + let par_bytes = self.params.to_bytes(); + // Intermediate struct of bytes + let mut state = serializer.serialize_struct("Ciphertext", 2)?; + state.serialize_field("par_bytes", &par_bytes)?; + state.serialize_field("bytes", &bytes)?; + state.end() + } +} diff --git a/packages/ciphernode/core/src/serializers/decryption_share.rs b/packages/ciphernode/core/src/serializers/decryption_share.rs new file mode 100644 index 00000000..bc99d12e --- /dev/null +++ b/packages/ciphernode/core/src/serializers/decryption_share.rs @@ -0,0 +1,72 @@ +use anyhow::*; +use fhe::{ + bfv::{BfvParameters, Ciphertext}, + mbfv::DecryptionShare, +}; +use fhe_traits::{Deserialize, DeserializeParametrized, Serialize}; +use serde::Serializer; +use std::sync::Arc; + +pub struct DecryptionShareSerializer { + inner: DecryptionShare, + params: Arc, + ct: Arc, +} + +impl DecryptionShareSerializer { + pub fn to_bytes( + inner: DecryptionShare, + params: Arc, + ct: Arc, + ) -> Result> { + let value = Self { inner, params, ct }; + Ok(bincode::serialize(&value)?) + } + + pub fn from_bytes(bytes: &[u8]) -> Result { + let ds: DecryptionShareSerializer = bincode::deserialize(&bytes)?; + Ok(ds.inner) + } +} + +/// Deserialize from serde to PublicKeySerializer +impl<'de> serde::Deserialize<'de> for DecryptionShareSerializer { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + // Intermediate struct of bytes for deserialization + #[derive(serde::Deserialize)] + struct DecryptionShareBytes { + par: Vec, + bytes: Vec, + ct: Vec, + } + let DecryptionShareBytes { par, bytes, ct } = + DecryptionShareBytes::deserialize(deserializer)?; + let params = Arc::new(BfvParameters::try_deserialize(&par).unwrap()); // TODO: fix errors + let ct = Arc::new(Ciphertext::from_bytes(&ct, ¶ms).unwrap()); // TODO: fix errors + let inner = DecryptionShare::deserialize(&bytes, ¶ms, ct.clone()) + .map_err(serde::de::Error::custom)?; + // TODO: how do we create an invariant that the deserialized params match the global params? + std::result::Result::Ok(Self { inner, params, ct }) + } +} +/// Serialize to serde bytes representation +impl serde::Serialize for DecryptionShareSerializer { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + use serde::ser::SerializeStruct; + let bytes = self.inner.to_bytes(); + let par_bytes = self.params.to_bytes(); + let ct_bytes = self.ct.to_bytes(); + // Intermediate struct of bytes + let mut state = serializer.serialize_struct("DecryptionShareBytes", 2)?; + state.serialize_field("par", &par_bytes)?; + state.serialize_field("bytes", &bytes)?; + state.serialize_field("bytes", &ct_bytes)?; + state.end() + } +} diff --git a/packages/ciphernode/core/src/serializers/mod.rs b/packages/ciphernode/core/src/serializers/mod.rs new file mode 100644 index 00000000..e5c15eeb --- /dev/null +++ b/packages/ciphernode/core/src/serializers/mod.rs @@ -0,0 +1,11 @@ +mod ciphertext; +mod decryption_share; +mod public_key; +mod public_key_share; +mod secret_key; + +pub use ciphertext::*; +pub use decryption_share::*; +pub use public_key::*; +pub use public_key_share::*; +pub use secret_key::*; diff --git a/packages/ciphernode/core/src/serializers/public_key.rs b/packages/ciphernode/core/src/serializers/public_key.rs new file mode 100644 index 00000000..a485334b --- /dev/null +++ b/packages/ciphernode/core/src/serializers/public_key.rs @@ -0,0 +1,77 @@ +use anyhow::*; +use fhe::bfv::{BfvParameters, PublicKey}; +use fhe_traits::{Deserialize, DeserializeParametrized, Serialize}; +use serde::Serializer; +use std::sync::Arc; + +pub struct PublicKeySerializer { + inner: PublicKey, + params: Arc, +} + +impl PublicKeySerializer { + pub fn to_bytes(inner: PublicKey, params: Arc) -> Result> { + let value = Self { inner, params }; + Ok(bincode::serialize(&value)?) + } + + pub fn from_bytes(bytes: Vec) -> Result { + let wpk: PublicKeySerializer = bincode::deserialize(&bytes)?; + Ok(wpk.inner) + } +} + +/// Deserialize from serde to PublicKeySerializer +impl<'de> serde::Deserialize<'de> for PublicKeySerializer { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + // Intermediate struct of bytes for deserialization + #[derive(serde::Deserialize)] + struct PublicKeyBytes { + par: Vec, + bytes: Vec, + } + let PublicKeyBytes { par, bytes } = PublicKeyBytes::deserialize(deserializer)?; + let params = Arc::new(BfvParameters::try_deserialize(&par).unwrap()); // TODO: fix errors + let inner = PublicKey::from_bytes(&bytes, ¶ms).map_err(serde::de::Error::custom)?; + // TODO: how do we create an invariant that the deserialized params match the global params? + std::result::Result::Ok(Self { inner, params }) + } +} + +/// Serialize to serde bytes representation +impl serde::Serialize for PublicKeySerializer { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + use serde::ser::SerializeStruct; + let bytes = self.inner.to_bytes(); + let par_bytes = self.params.to_bytes(); + // Intermediate struct of bytes + let mut state = serializer.serialize_struct("PublicKey", 2)?; + state.serialize_field("par_bytes", &par_bytes)?; + state.serialize_field("bytes", &bytes)?; + state.end() + } +} + +// impl Hash for PublicKeySerializer { +// fn hash(&self, state: &mut H) { +// self.inner.to_bytes().hash(state) +// } +// } +// +// impl Ord for PublicKeySerializer { +// fn cmp(&self, other: &Self) -> Ordering { +// self.inner.to_bytes().cmp(&other.inner.to_bytes()) +// } +// } +// +// impl PartialOrd for PublicKeySerializer { +// fn partial_cmp(&self, other: &Self) -> Option { +// Some(self.cmp(other)) +// } +// } diff --git a/packages/ciphernode/core/src/serializers/public_key_share.rs b/packages/ciphernode/core/src/serializers/public_key_share.rs new file mode 100644 index 00000000..cf7a6c6d --- /dev/null +++ b/packages/ciphernode/core/src/serializers/public_key_share.rs @@ -0,0 +1,81 @@ +use anyhow::*; +use fhe::{ + bfv::BfvParameters, + mbfv::{CommonRandomPoly, PublicKeyShare}, +}; +use fhe_traits::{Deserialize, Serialize}; +use serde::Serializer; +use std::sync::Arc; + +pub struct PublicKeyShareSerializer { + inner: PublicKeyShare, + // We need to hold copies of the params and crp in order to effectively serialize and + // deserialize the wrapped type + params: Arc, + crp: CommonRandomPoly, +} + +impl PublicKeyShareSerializer { + /// Public function to serialize specifically from the wrapped type including types that are + /// private from outside the crate + pub fn to_bytes( + inner: PublicKeyShare, + params: Arc, + crp: CommonRandomPoly, + ) -> Result> { + let value = Self { inner, params, crp }; + Ok(bincode::serialize(&value)?) + } + + pub fn from_bytes(bytes: &[u8]) -> Result { + let wpk: Self = bincode::deserialize(&bytes)?; + Ok(wpk.inner) + } +} + +/// Deserialize from serde to PublicKeyShareSerializer +impl<'de> serde::Deserialize<'de> for PublicKeyShareSerializer { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + // Intermediate struct of bytes for deserialization + #[derive(serde::Deserialize)] + struct PublicKeyShareBytes { + par_bytes: Vec, + crp_bytes: Vec, + bytes: Vec, + } + let PublicKeyShareBytes { + par_bytes, + crp_bytes, + bytes, + } = PublicKeyShareBytes::deserialize(deserializer)?; + let params = Arc::new(BfvParameters::try_deserialize(&par_bytes).unwrap()); + let crp = + CommonRandomPoly::deserialize(&crp_bytes, ¶ms).map_err(serde::de::Error::custom)?; + let inner = PublicKeyShare::deserialize(&bytes, ¶ms, crp.clone()) + .map_err(serde::de::Error::custom)?; + // TODO: how do we create an invariant that the deserialized params match the global params? + std::result::Result::Ok(Self { inner, params, crp }) + } +} + +/// Serialize to serde bytes representation +impl serde::Serialize for PublicKeyShareSerializer { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + use serde::ser::SerializeStruct; + let bytes = self.inner.to_bytes(); + let par_bytes = self.params.to_bytes(); + let crp_bytes = self.crp.to_bytes(); + // Intermediate struct of bytes + let mut state = serializer.serialize_struct("PublicKeyShare", 3)?; + state.serialize_field("par_bytes", &par_bytes)?; + state.serialize_field("crp_bytes", &crp_bytes)?; + state.serialize_field("bytes", &bytes)?; + state.end() + } +} diff --git a/packages/ciphernode/core/src/serializers/secret_key.rs b/packages/ciphernode/core/src/serializers/secret_key.rs new file mode 100644 index 00000000..95abca76 --- /dev/null +++ b/packages/ciphernode/core/src/serializers/secret_key.rs @@ -0,0 +1,44 @@ +use anyhow::*; +use fhe::bfv::{BfvParameters, SecretKey}; +use fhe_traits::{Deserialize, Serialize}; +use std::sync::Arc; + +pub struct SecretKeySerializer { + pub inner: SecretKey, + pub params: Arc, +} + +impl SecretKeySerializer { + pub fn to_bytes(inner: SecretKey, params: Arc) -> Result> { + let value = Self { inner, params }; + Ok(value.unsafe_serialize()?) + } + + pub fn from_bytes(bytes: &[u8]) -> Result { + Ok(Self::deserialize(bytes)?.inner) + } +} + +#[derive(serde::Serialize, serde::Deserialize)] +struct SecretKeyData { + coeffs: Box<[i64]>, + par: Vec, +} + +impl SecretKeySerializer { + pub fn unsafe_serialize(&self) -> Result> { + Ok(bincode::serialize(&SecretKeyData { + coeffs: self.inner.coeffs.clone(), + par: self.params.clone().to_bytes(), + })?) + } + + pub fn deserialize(bytes: &[u8]) -> Result { + let SecretKeyData { coeffs, par } = bincode::deserialize(&bytes)?; + let params = Arc::new(BfvParameters::try_deserialize(&par).unwrap()); + Ok(Self { + inner: SecretKey::new(coeffs.to_vec(), ¶ms), + params, + }) + } +} diff --git a/packages/ciphernode/core/src/sortition.rs b/packages/ciphernode/core/src/sortition.rs new file mode 100644 index 00000000..f808be3d --- /dev/null +++ b/packages/ciphernode/core/src/sortition.rs @@ -0,0 +1,120 @@ +use std::collections::HashSet; + +use actix::prelude::*; +use alloy_primitives::Address; +use sortition::DistanceSortition; + +use crate::{CiphernodeAdded, CiphernodeRemoved, EnclaveEvent, EthAddr, EventBus, Subscribe}; + +#[derive(Message, Clone, Debug, PartialEq, Eq)] +#[rtype(result = "bool")] +pub struct GetHasNode { + pub seed: u64, + pub address: Address, + pub size: usize, +} + +pub trait SortitionList { + fn contains(&self, seed: u64, size: usize, address: T) -> bool; + fn add(&mut self, address: T); + fn remove(&mut self, address: T); +} + +pub struct SortitionModule { + nodes: HashSet
, +} + +impl SortitionModule { + pub fn new() -> Self { + Self { + nodes: HashSet::new(), + } + } +} + +impl Default for SortitionModule { + fn default() -> Self { + Self::new() + } +} + +impl SortitionList
for SortitionModule { + fn contains(&self, seed: u64, size: usize, address: Address) -> bool { + DistanceSortition::new( + seed, + self.nodes.clone().into_iter().collect(), + size, + ) + .get_committee() + .iter() + .any(|(_, addr)| *addr == address) + } + + fn add(&mut self, address: Address) { + self.nodes.insert(address); + } + + fn remove(&mut self, address: Address) { + self.nodes.remove(&address); + } +} + +pub struct Sortition { + list: SortitionModule, +} + +impl Sortition { + pub fn new() -> Self { + Self { + list: SortitionModule::new(), + } + } + + pub fn attach(bus: Addr) -> Addr { + let addr = Sortition::new().start(); + bus.do_send(Subscribe::new("CiphernodeAdded", addr.clone().into())); + addr + } +} + +impl Default for Sortition { + fn default() -> Self { + Self::new() + } +} + +impl Actor for Sortition { + type Context = Context; +} + +impl Handler for Sortition { + type Result = (); + fn handle(&mut self, msg: EnclaveEvent, ctx: &mut Self::Context) -> Self::Result { + match msg { + EnclaveEvent::CiphernodeAdded { data, .. } => ctx.notify(data.clone()), + EnclaveEvent::CiphernodeRemoved { data, .. } => ctx.notify(data.clone()), + _ => (), + } + } +} + +impl Handler for Sortition { + type Result = (); + fn handle(&mut self, msg: CiphernodeAdded, _ctx: &mut Self::Context) -> Self::Result { + self.list.add(msg.address); + } +} + +impl Handler for Sortition { + type Result = (); + fn handle(&mut self, msg: CiphernodeRemoved, _ctx: &mut Self::Context) -> Self::Result { + self.list.remove(msg.address); + } +} + +impl Handler for Sortition { + type Result = bool; + fn handle(&mut self, msg: GetHasNode, _ctx: &mut Self::Context) -> Self::Result { + self.list.contains(msg.seed, msg.size, msg.address) + } +} diff --git a/packages/ciphernode/core/src/utils.rs b/packages/ciphernode/core/src/utils.rs new file mode 100644 index 00000000..1a51e8db --- /dev/null +++ b/packages/ciphernode/core/src/utils.rs @@ -0,0 +1,45 @@ +use crate::SharedRng; +use fhe::{ + bfv::{BfvParameters, BfvParametersBuilder}, + mbfv::CommonRandomPoly, +}; +use fhe_traits::Serialize; +use std::sync::Arc; + +pub struct ParamsWithCrp { + pub moduli: Vec, + pub degree: usize, + pub plaintext_modulus: u64, + pub crp_bytes: Vec, + pub params: Arc, +} + +pub fn setup_crp_params( + moduli: &[u64], + degree: usize, + plaintext_modulus: u64, + rng: SharedRng, +) -> ParamsWithCrp { + let params = setup_bfv_params(moduli, degree, plaintext_modulus); + let crp = set_up_crp(params.clone(), rng); + ParamsWithCrp { + moduli: moduli.to_vec(), + degree, + plaintext_modulus, + crp_bytes: crp.to_bytes(), + params, + } +} + +pub fn setup_bfv_params(moduli: &[u64], degree: usize, plaintext_modulus: u64) -> Arc { + BfvParametersBuilder::new() + .set_degree(degree) + .set_plaintext_modulus(plaintext_modulus) + .set_moduli(moduli) + .build_arc() + .unwrap() +} + +pub fn set_up_crp(params: Arc, rng: SharedRng) -> CommonRandomPoly { + CommonRandomPoly::new(¶ms, &mut *rng.lock().unwrap()).unwrap() +} diff --git a/packages/ciphernode/enclave/Cargo.toml b/packages/ciphernode/enclave/Cargo.toml index 3e2824bd..dba66d24 100644 --- a/packages/ciphernode/enclave/Cargo.toml +++ b/packages/ciphernode/enclave/Cargo.toml @@ -8,7 +8,6 @@ repository = "https://github.com/gnosisguild/enclave/packages/ciphernode" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -eth = { path = "../eth" } async-std = "1.12.0" fhe = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" } fhe-traits = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" } diff --git a/packages/ciphernode/enclave_node/Cargo.toml b/packages/ciphernode/enclave_node/Cargo.toml index 861bc2e7..7841aa31 100644 --- a/packages/ciphernode/enclave_node/Cargo.toml +++ b/packages/ciphernode/enclave_node/Cargo.toml @@ -8,8 +8,22 @@ repository = "https://github.com/gnosisguild/enclave/packages/ciphernode" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -eth = { path = "../eth" } +p2p = { path = "../p2p" } +bfv = { path = "../bfv" } +sortition = { path = "../sortition" } +enclave-core = { path = "../core" } async-std = "1.12.0" fhe = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" } fhe-traits = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" } fhe-util = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" } +tokio = { version = "1.38", features = ["full"] } +actix-rt = "2.10.0" +alloy-primitives = { version = "0.6", default-features = false, features = ["rlp", "serde", "std"] } + +alloy = { version = "0.2.1", features = ["full"] } +clap = { version = "4.5.17", features = ["derive"] } +rand_chacha = "0.3.1" +rand = "0.8.5" +bincode = "1.3.3" +base91 = "0.1.0" +base64 = "0.22.1" diff --git a/packages/ciphernode/enclave_node/scripts/.gitignore b/packages/ciphernode/enclave_node/scripts/.gitignore new file mode 100644 index 00000000..3ba8733c --- /dev/null +++ b/packages/ciphernode/enclave_node/scripts/.gitignore @@ -0,0 +1 @@ +*.b64 diff --git a/packages/ciphernode/enclave_node/scripts/ag.sh b/packages/ciphernode/enclave_node/scripts/ag.sh new file mode 100755 index 00000000..d6e22791 --- /dev/null +++ b/packages/ciphernode/enclave_node/scripts/ag.sh @@ -0,0 +1,3 @@ +#!/bin/sh +echo "loading..." +RUSTFLAGS="-A warnings" cargo run --quiet --bin aggregator diff --git a/packages/ciphernode/enclave_node/scripts/cmd.sh b/packages/ciphernode/enclave_node/scripts/cmd.sh new file mode 100755 index 00000000..86e2106c --- /dev/null +++ b/packages/ciphernode/enclave_node/scripts/cmd.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "loading..." +RUSTFLAGS="-A warnings" cargo run --quiet --bin cmd diff --git a/packages/ciphernode/enclave_node/scripts/encrypt.sh b/packages/ciphernode/enclave_node/scripts/encrypt.sh new file mode 100755 index 00000000..45d3d6f8 --- /dev/null +++ b/packages/ciphernode/enclave_node/scripts/encrypt.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "loading..." +RUSTFLAGS="-A warnings" cargo run --quiet --bin encrypt diff --git a/packages/ciphernode/enclave_node/scripts/node1.sh b/packages/ciphernode/enclave_node/scripts/node1.sh new file mode 100755 index 00000000..97474c90 --- /dev/null +++ b/packages/ciphernode/enclave_node/scripts/node1.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "loading..." +RUSTFLAGS="-A warnings" cargo run --quiet --bin node -- --address 0xCc6c693FDB68f0DB58172639CDEa33FF488cf0a5 diff --git a/packages/ciphernode/enclave_node/scripts/node2.sh b/packages/ciphernode/enclave_node/scripts/node2.sh new file mode 100755 index 00000000..7568191c --- /dev/null +++ b/packages/ciphernode/enclave_node/scripts/node2.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "loading..." +RUSTFLAGS="-A warnings" cargo run --quiet --bin node -- --address 0x75437e59cAC691C0624e089554834619dc49B944 diff --git a/packages/ciphernode/enclave_node/scripts/node3.sh b/packages/ciphernode/enclave_node/scripts/node3.sh new file mode 100755 index 00000000..af6ca05c --- /dev/null +++ b/packages/ciphernode/enclave_node/scripts/node3.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "loading..." +RUSTFLAGS="-A warnings" cargo run --quiet --bin node -- --address 0xe3092f4A2B59234a557aa2dE5D97314D4E969764 diff --git a/packages/ciphernode/enclave_node/scripts/node4.sh b/packages/ciphernode/enclave_node/scripts/node4.sh new file mode 100755 index 00000000..0569550e --- /dev/null +++ b/packages/ciphernode/enclave_node/scripts/node4.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "loading..." +RUSTFLAGS="-A warnings" cargo run --quiet --bin node -- --address 0x25c693E1188b9E4455E07DC4f6a49142eFbF2C61 diff --git a/packages/ciphernode/enclave_node/src/bin/aggregator.rs b/packages/ciphernode/enclave_node/src/bin/aggregator.rs new file mode 100644 index 00000000..8ae7e2a5 --- /dev/null +++ b/packages/ciphernode/enclave_node/src/bin/aggregator.rs @@ -0,0 +1,16 @@ +use clap::Parser; +use enclave_core::MainAggregator; + +#[derive(Parser, Debug)] +#[command(author, version, about, long_about = None)] +struct Args { + #[arg(short, long)] + address: String, +} + +#[actix_rt::main] +async fn main() -> Result<(), Box> { + let (_, handle) = MainAggregator::attach().await; + let _ = tokio::join!(handle); + Ok(()) +} diff --git a/packages/ciphernode/enclave_node/src/bin/cmd.rs b/packages/ciphernode/enclave_node/src/bin/cmd.rs new file mode 100644 index 00000000..aca81e00 --- /dev/null +++ b/packages/ciphernode/enclave_node/src/bin/cmd.rs @@ -0,0 +1,116 @@ +use std::sync::Arc; + +use alloy_primitives::{address, Address}; +use base64::{engine::general_purpose, Engine as _}; +use enclave_core::{ + setup_crp_params, Actor, CommitteeRequested, E3id, EnclaveEvent, EventBus, P2p, ParamsWithCrp, + SimpleLogger, +}; +use enclave_core::{CiphernodeAdded, CiphertextOutputPublished}; +use fhe::bfv::{Encoding, Plaintext, PublicKey}; +use fhe_traits::{DeserializeParametrized, FheEncoder}; +use rand::{thread_rng, RngCore, SeedableRng}; +use rand_chacha::rand_core::OsRng; +use std::fs; +use tokio::{ + self, + io::{self, AsyncBufReadExt, BufReader}, +}; + +const ADDRS: [Address; 4] = [ + address!("Cc6c693FDB68f0DB58172639CDEa33FF488cf0a5"), + address!("75437e59cAC691C0624e089554834619dc49B944"), + address!("e3092f4A2B59234a557aa2dE5D97314D4E969764"), + address!("25c693E1188b9E4455E07DC4f6a49142eFbF2C61"), +]; + +#[actix_rt::main] +async fn main() -> Result<(), Box> { + let rng = Arc::new(std::sync::Mutex::new( + rand_chacha::ChaCha20Rng::from_rng(OsRng).expect("Failed to create RNG"), + )); + + let bus = EventBus::new(true).start(); + + SimpleLogger::attach("CMD", bus.clone()); + let (_, t1) = P2p::spawn_libp2p(bus.clone())?; + let mut stdin = BufReader::new(io::stdin()).lines(); + let ParamsWithCrp { + moduli, + degree, + plaintext_modulus, + crp_bytes, + .. + } = setup_crp_params(&[0x3FFFFFFF000001], 2048, 1032193, rng.clone()); + let t2 = tokio::spawn(async move { + let mut id: u32 = 1000; + while let Ok(Some(line)) = stdin.next_line().await { + let parts: Vec<&str> = line.split_whitespace().collect(); + match parts.as_slice() { + ["reg", "1"] => { + println!("Registering Ciphernode {}", ADDRS[0]); + bus.do_send(EnclaveEvent::from(CiphernodeAdded { + address: ADDRS[0], + index: 0, + num_nodes: 1, + })); + } + ["reg", "2"] => { + println!("Registering Ciphernode {}", ADDRS[1]); + bus.do_send(EnclaveEvent::from(CiphernodeAdded { + address: ADDRS[1], + index: 1, + num_nodes: 2, + })) + } + ["reg", "3"] => { + println!("Registering Ciphernode {}", ADDRS[2]); + bus.do_send(EnclaveEvent::from(CiphernodeAdded { + address: ADDRS[2], + index: 2, + num_nodes: 3, + })) + } + ["reg", "4"] => { + println!("Registering Ciphernode {}", ADDRS[3]); + bus.do_send(EnclaveEvent::from(CiphernodeAdded { + address: ADDRS[3], + index: 3, + num_nodes: 4, + })) + } + + ["com"] => { + id += 1; + println!("Requesting comittee: {}", id); + bus.do_send(EnclaveEvent::from(CommitteeRequested { + e3_id: E3id::from(id), + nodecount: 3, + sortition_seed: thread_rng().next_u64(), + moduli: moduli.clone(), + plaintext_modulus, + degree, + crp: crp_bytes.clone(), + })); + } + ["load"] => { + println!("Loading from ./scripts/encrypted.b64..."); + let encoded_string = fs::read_to_string("scripts/encrypted.b64").unwrap(); + + let decoded_bytes: Vec = general_purpose::STANDARD + .decode(encoded_string.trim()) + .unwrap(); + + bus.do_send(EnclaveEvent::from(CiphertextOutputPublished { + e3_id: E3id::from(id), + ciphertext_output: decoded_bytes, + })) + } + _ => println!("Unknown command"), + } + } + }); + + let _ = tokio::join!(t1, t2); + Ok(()) +} diff --git a/packages/ciphernode/enclave_node/src/bin/encrypt.rs b/packages/ciphernode/enclave_node/src/bin/encrypt.rs new file mode 100644 index 00000000..8777991a --- /dev/null +++ b/packages/ciphernode/enclave_node/src/bin/encrypt.rs @@ -0,0 +1,34 @@ +use base64::{engine::general_purpose, Engine as _}; +use enclave_core::{setup_bfv_params, setup_crp_params, CiphertextSerializer, ParamsWithCrp}; +use fhe::bfv::{Encoding, Plaintext, PublicKey}; +use fhe_traits::{DeserializeParametrized, FheEncoder, FheEncrypter, Serialize}; +use rand::SeedableRng; +use rand_chacha::{rand_core::OsRng, ChaCha20Rng}; +use std::{fs, sync::Arc}; + +fn main() -> Result<(), Box> { + // Read the base64 encoded string from a file + println!("Loading public key from ./scripts/pubkey.b64"); + let encoded_string = fs::read_to_string("scripts/pubkey.b64")?; + + // Decode the base64 string + let decoded_bytes: Vec = general_purpose::STANDARD.decode(encoded_string.trim())?; + let params = setup_bfv_params(&[0x3FFFFFFF000001], 2048, 1032193); + let pubkey = PublicKey::from_bytes(&decoded_bytes, ¶ms)?; + + let yes = 1234u64; + let no = 873827u64; + + let raw_plaintext = vec![yes, no]; + println!("Encrypting plaintext: {:?}", raw_plaintext); + + let pt = Plaintext::try_encode(&raw_plaintext, Encoding::poly(), ¶ms)?; + + let ciphertext = pubkey.try_encrypt(&pt, &mut ChaCha20Rng::seed_from_u64(42))?; + let ciphertext_bytes = CiphertextSerializer::to_bytes(ciphertext.clone(), params.clone())?; + + let encrypted = general_purpose::STANDARD.encode(ciphertext_bytes); + fs::write("scripts/encrypted.b64", &encrypted).unwrap(); + println!("Created ./scripts/encrypted.b64"); + Ok(()) +} diff --git a/packages/ciphernode/enclave_node/src/bin/node.rs b/packages/ciphernode/enclave_node/src/bin/node.rs new file mode 100644 index 00000000..67908f96 --- /dev/null +++ b/packages/ciphernode/enclave_node/src/bin/node.rs @@ -0,0 +1,25 @@ +use alloy_primitives::Address; +use clap::Parser; +use enclave_core::MainCiphernode; + +#[derive(Parser, Debug)] +#[command(author, version, about, long_about = None)] +struct Args { + #[arg(short, long)] + address: String, + // #[arg(short, long)] + // rpc: String, + // #[arg(short, long)] + // contract_address: String, +} + +#[actix_rt::main] +async fn main() -> Result<(), Box> { + let args = Args::parse(); + let address = Address::parse_checksummed(&args.address, None).expect("Invalid address"); + println!("LAUNCHING CIPHERNODE: ({})", address); + // let contract_address = Address::parse_checksummed(&args.contract_address, None).expect("Invalid address"); + let (_, handle) = MainCiphernode::attach(address /*args.rpc, contract_address*/).await; + let _ = tokio::join!(handle); + Ok(()) +} diff --git a/packages/ciphernode/enclave_node/src/main.rs b/packages/ciphernode/enclave_node/src/main.rs index 0074dc3c..9e5aee83 100644 --- a/packages/ciphernode/enclave_node/src/main.rs +++ b/packages/ciphernode/enclave_node/src/main.rs @@ -1,12 +1,65 @@ -use eth::EtherClient; +use std::error::Error; -fn main() { - // boot up p2p network +use p2p::EnclaveRouter; +use bfv::EnclaveBFV; +use sortition::DistanceSortition; +use tokio::{ + self, + io::{self, AsyncBufReadExt, BufReader}, +}; - // boot up ether client +use alloy_primitives::{address}; - // start main loop +const OWO: &str = r#" + ___ ___ ___ ___ ___ + /\__\ /\ \ /\__\ /\ \ ___ /\__\ + /:/ _/_ \:\ \ /:/ / /::\ \ /\ \ /:/ _/_ + /:/ /\__\ \:\ \ /:/ / /:/\:\ \ \:\ \ /:/ /\__\ + /:/ /:/ _/_ _____\:\ \ /:/ / ___ ___ ___ /:/ /::\ \ \:\ \ /:/ /:/ _/_ + /:/_/:/ /\__\ /::::::::\__\ /:/__/ /\__\ /\ \ /\__\ /:/_/:/\:\__\ ___ \:\__\ /:/_/:/ /\__\ + \:\/:/ /:/ / \:\~~\~~\/__/ \:\ \ /:/ / \:\ \ /:/ / \:\/:/ \/__/ /\ \ |:| | \:\/:/ /:/ / + \::/_/:/ / \:\ \ \:\ /:/ / \:\ /:/ / \::/__/ \:\ \|:| | \::/_/:/ / + \:\/:/ / \:\ \ \:\/:/ / \:\/:/ / \:\ \ \:\__|:|__| \:\/:/ / + \::/ / \:\__\ \::/ / \::/ / \:\__\ \::::/__/ \::/ / + \/__/ \/__/ \/__/ \/__/ \/__/ ~~~~ \/__/ + +"#; - let ether = eth::EtherClient::new("test".to_string()); +#[tokio::main] +async fn main() -> Result<(), Box> { + // boot up p2p network + + // boot up ether client + + // start main loop + + //let ether = eth::EtherClient::new("test".to_string()); + println!("\n\n\n\n\n{}", OWO); + println!("\n\n\n\n"); println!("Hello, cipher world!"); -} \ No newline at end of file + + let mut committee = DistanceSortition::new(12, vec![address!("d8da6bf26964af9d7eed9e03e53415d37aa96045")], 10); + committee.get_committee(); + + let mut new_bfv = EnclaveBFV::new(4096, 4096, vec![0xffffee001, 0xffffc4001, 0x1ffffe0001]); + let pk_bytes = new_bfv.serialize_pk(); + let param_bytes = new_bfv.serialize_params(); + let crp_bytes = new_bfv.serialize_crp(); + let deserialized_pk = new_bfv.deserialize_pk(pk_bytes, param_bytes, crp_bytes); + + let (mut p2p, tx, mut rx) = EnclaveRouter::new()?; + p2p.connect_swarm("mdns".to_string())?; + p2p.join_topic("enclave-keygen-01")?; + let mut stdin = BufReader::new(io::stdin()).lines(); + tokio::spawn(async move { p2p.start().await }); + tokio::spawn(async move { + while let Some(msg) = rx.recv().await { + println!("msg: {}", String::from_utf8(msg).unwrap()); + } + }); + loop { + if let Ok(Some(line)) = stdin.next_line().await { + tx.send(line.as_bytes().to_vec().clone()).await.unwrap(); + } + } +} diff --git a/packages/ciphernode/eth/src/lib.rs b/packages/ciphernode/eth/src/lib.rs deleted file mode 100644 index d59ebed4..00000000 --- a/packages/ciphernode/eth/src/lib.rs +++ /dev/null @@ -1,14 +0,0 @@ -#![crate_name = "eth"] -#![crate_type = "lib"] -#![warn(missing_docs, unused_imports)] - - -pub struct EtherClient { - pub address: String, -} - -impl EtherClient { - pub fn new(address: String) -> Self { - Self { address } - } -} \ No newline at end of file diff --git a/packages/ciphernode/p2p/Cargo.toml b/packages/ciphernode/p2p/Cargo.toml index 4340494c..487b5a53 100644 --- a/packages/ciphernode/p2p/Cargo.toml +++ b/packages/ciphernode/p2p/Cargo.toml @@ -8,15 +8,16 @@ repository = "https://github.com/gnosisguild/enclave/packages/ciphernode" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -async-std = "1.12.0" +bfv = { path = "../bfv" } fhe = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" } fhe-traits = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" } fhe-util = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" } async-std = { version = "1.12", features = ["attributes"] } async-trait = "0.1" -futures = { workspace = true } -libp2p = { version = "0.53.2", features = [ "async-std", "identify", "macros", "noise", "ping", "rendezvous", "tcp", "tokio", "yamux"] } -tokio = { workspace = true, features = ["rt-multi-thread", "macros", "time"] } -tracing = { workspace = true } -tracing-subscriber = { workspace = true, features = ["env-filter"] } +futures = "0.3.30" +libp2p = { version = "0.53.2", features = [ "async-std", "identify", "macros", "noise", "ping", "rendezvous", "tcp", "tokio", "yamux", "mdns", "gossipsub", "quic"] } +tokio = { version = "1.38", features = ["full"] } +tracing = "0.1.37" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } + diff --git a/packages/ciphernode/p2p/src/lib.rs b/packages/ciphernode/p2p/src/lib.rs new file mode 100644 index 00000000..9cf789cf --- /dev/null +++ b/packages/ciphernode/p2p/src/lib.rs @@ -0,0 +1,180 @@ +#![crate_name = "p2p"] +#![crate_type = "lib"] +#![warn(missing_docs, unused_imports)] + +use futures::stream::StreamExt; +use libp2p::{ + gossipsub, identity, mdns, noise, swarm::NetworkBehaviour, swarm::SwarmEvent, tcp, yamux, +}; +use std::collections::hash_map::DefaultHasher; +use std::error::Error; +use std::hash::{Hash, Hasher}; +use std::time::Duration; +use tokio::sync::mpsc::{channel, Receiver, Sender}; +use tokio::{io, select}; +use tracing_subscriber::EnvFilter; + +#[derive(NetworkBehaviour)] +pub struct MyBehaviour { + gossipsub: gossipsub::Behaviour, + mdns: mdns::tokio::Behaviour, +} + + +pub struct EnclaveRouter { + pub identity: Option, + pub gossipsub_config: gossipsub::Config, + pub swarm: Option>, + pub topic: Option, + evt_tx: Sender>, + cmd_rx: Receiver> +} + +impl EnclaveRouter { + pub fn new() -> Result<(Self, Sender>, Receiver>), Box> { + let (evt_tx, evt_rx) = channel(100); // TODO : tune this param + let (cmd_tx, cmd_rx) = channel(100); // TODO : tune this param + let message_id_fn = |message: &gossipsub::Message| { + let mut s = DefaultHasher::new(); + message.data.hash(&mut s); + gossipsub::MessageId::from(s.finish().to_string()) + }; + + // TODO: Allow for config inputs to new() + let gossipsub_config = gossipsub::ConfigBuilder::default() + .heartbeat_interval(Duration::from_secs(10)) + .validation_mode(gossipsub::ValidationMode::Strict) + .message_id_fn(message_id_fn) + .build() + .map_err(|msg| io::Error::new(io::ErrorKind::Other, msg))?; + + Ok(( + Self { + identity: None, + gossipsub_config, + swarm: None, + topic: None, + evt_tx, + cmd_rx + }, + cmd_tx, + evt_rx, + )) + } + + pub fn with_identiy(&mut self, keypair: identity::Keypair) { + self.identity = Some(keypair); + } + + pub fn connect_swarm(&mut self, discovery_type: String) -> Result<&Self, Box> { + match discovery_type.as_str() { + "mdns" => { + let _ = tracing_subscriber::fmt() + .with_env_filter(EnvFilter::from_default_env()) + .try_init(); + + // TODO: Use key if assigned already + let mut swarm = libp2p::SwarmBuilder::with_new_identity() + .with_tokio() + .with_tcp( + tcp::Config::default(), + noise::Config::new, + yamux::Config::default, + )? + .with_quic() + .with_behaviour(|key| { + let gossipsub = gossipsub::Behaviour::new( + gossipsub::MessageAuthenticity::Signed(key.clone()), + self.gossipsub_config.clone(), + )?; + + let mdns = mdns::tokio::Behaviour::new( + mdns::Config::default(), + key.public().to_peer_id(), + )?; + Ok(MyBehaviour { gossipsub, mdns }) + })? + .with_swarm_config(|c| c.with_idle_connection_timeout(Duration::from_secs(60))) + .build(); + self.swarm = Some(swarm); + } + _ => println!("Defaulting to MDNS discovery"), + } + Ok(self) + } + + pub fn join_topic(&mut self, topic_name: &str) -> Result<&Self, Box> { + let topic = gossipsub::IdentTopic::new(topic_name); + self.topic = Some(topic.clone()); + self.swarm + .as_mut() + .unwrap() + .behaviour_mut() + .gossipsub + .subscribe(&topic)?; + Ok(self) + } + + pub async fn start(&mut self) -> Result<(), Box> { + self.swarm + .as_mut() + .unwrap() + .listen_on("/ip4/0.0.0.0/udp/0/quic-v1".parse()?)?; + self.swarm + .as_mut() + .unwrap() + .listen_on("/ip4/0.0.0.0/tcp/0".parse()?)?; + loop { + select! { + Some(line) = self.cmd_rx.recv() => { + if let Err(e) = self.swarm.as_mut().unwrap() + .behaviour_mut().gossipsub + .publish(self.topic.as_mut().unwrap().clone(), line) { + println!("Publish error: {e:?}"); + } + } + event = self.swarm.as_mut().unwrap().select_next_some() => match event { + SwarmEvent::Behaviour(MyBehaviourEvent::Mdns(mdns::Event::Discovered(list))) => { + for (peer_id, _multiaddr) in list { + // println!("mDNS discovered a new peer: {peer_id}"); + self.swarm.as_mut().unwrap().behaviour_mut().gossipsub.add_explicit_peer(&peer_id); + } + }, + SwarmEvent::Behaviour(MyBehaviourEvent::Mdns(mdns::Event::Expired(list))) => { + for (peer_id, _multiaddr) in list { + // println!("mDNS discover peer has expired: {peer_id}"); + self.swarm.as_mut().unwrap().behaviour_mut().gossipsub.remove_explicit_peer(&peer_id); + } + }, + SwarmEvent::Behaviour(MyBehaviourEvent::Gossipsub(gossipsub::Event::Message { + propagation_source: peer_id, + message_id: id, + message, + })) => { + // println!( + // "Got message with id: {id} from peer: {peer_id}", + // ); + // println!("{:?}", message); + self.evt_tx.send(message.data).await?; + }, + SwarmEvent::NewListenAddr { address, .. } => { + // println!("Local node is listening on {address}"); + } + _ => {} + } + } + } + } +} + +// #[tokio::main] +// async fn main() -> Result<(), Box> { + +// let mut p2p = EnclaveRouter::new()?; +// p2p.connect_swarm("mdns".to_string())?; +// p2p.join_topic("enclave-keygen-01")?; +// p2p.start().await?; + +// println!("Hello, cipher world!"); +// Ok(()) +// } diff --git a/packages/ciphernode/p2p/src/main.rs b/packages/ciphernode/p2p/src/main.rs deleted file mode 100644 index a0d9916c..00000000 --- a/packages/ciphernode/p2p/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("Hello, cipher world!"); -} diff --git a/packages/ciphernode/eth/Cargo.toml b/packages/ciphernode/sortition/Cargo.toml similarity index 53% rename from packages/ciphernode/eth/Cargo.toml rename to packages/ciphernode/sortition/Cargo.toml index 8e25c2d8..54704919 100644 --- a/packages/ciphernode/eth/Cargo.toml +++ b/packages/ciphernode/sortition/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "eth" +name = "sortition" version = "0.1.0" edition = "2021" description = ": coordinates the encryption and decryption of enclave computations" @@ -9,7 +9,12 @@ path = "src/lib.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -async-std = "1.12.0" -fhe = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" } -fhe-traits = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" } -fhe-util = { git = "https://github.com/gnosisguild/fhe.rs", version = "0.1.0-beta.7" } +num = "0.4.3" +rand = "0.8.5" + +# Ethereum +futures-util = "0.3" +eyre = "0.6" +alloy = { version = "0.2.1", features = ["full"] } +alloy-primitives = { version = "0.6", default-features = false, features = ["rlp", "serde", "std"] } +alloy-sol-types = { version = "0.6" } diff --git a/packages/ciphernode/sortition/src/distance.rs b/packages/ciphernode/sortition/src/distance.rs new file mode 100644 index 00000000..79b6bb86 --- /dev/null +++ b/packages/ciphernode/sortition/src/distance.rs @@ -0,0 +1,32 @@ +use alloy_primitives::{address, Address, keccak256}; +use num::{BigInt, Num}; + +pub struct DistanceSortition { + pub random_seed: u64, + pub registered_nodes: Vec
, + pub size: usize, +} + +impl DistanceSortition { + pub fn new(random_seed: u64, registered_nodes: Vec
, size: usize) -> Self { + Self { random_seed, registered_nodes, size } + } + + pub fn get_committee(&mut self) -> Vec<(BigInt, Address)> { + let mut scores = self.registered_nodes.iter() + .map(|address| + { + let concat = address.to_string() + &self.random_seed.to_string(); + let hash = keccak256(concat).to_string(); + let without_prefix = hash.trim_start_matches("0x"); + let z = BigInt::from_str_radix(without_prefix, 16).unwrap(); + let score = z - BigInt::from(self.random_seed); + (score, *address) + }) + .collect::>(); + + scores.sort_by(|a, b| a.0.cmp(&b.0)); + let result = scores[0..self.size].to_vec(); + result + } +} \ No newline at end of file diff --git a/packages/ciphernode/sortition/src/index.rs b/packages/ciphernode/sortition/src/index.rs new file mode 100644 index 00000000..da7162cc --- /dev/null +++ b/packages/ciphernode/sortition/src/index.rs @@ -0,0 +1,36 @@ +use rand::{rngs::StdRng, Rng, SeedableRng}; + +pub struct IndexSortition { + pub random_seed: u64, + pub num_nodes: usize, + pub size: usize, +} + +impl IndexSortition { + pub fn new(random_seed: u64, num_nodes: usize, size: usize) -> Self { + Self { random_seed, num_nodes, size } + } + + fn get_committee(&mut self) -> Vec { + // Initialize a vector with indices of nodes as elements + let mut leaf_indices: Vec = (0..self.num_nodes).collect(); + // Initialize an empty vector to store the committee + let mut committee: Vec = Vec::new(); + + // Initialize the random number generator with the given `seed` + let mut rng = StdRng::seed_from_u64(self.random_seed); + + // Partial shuffle for only the `committee_size` number of nodes + for _ in 0..self.size { + // Choose a random leaf index from the `leaf_indices` + let j = rng.gen_range(0..leaf_indices.len()); + // Push the chosen leaf index to the `committee` + committee.push(leaf_indices[j]); + // Remove the chosen leaf index from the `leaf_indices` + leaf_indices.remove(j); + } + + // Return the leaf indices of the selected committee + committee + } +} \ No newline at end of file diff --git a/packages/ciphernode/sortition/src/lib.rs b/packages/ciphernode/sortition/src/lib.rs new file mode 100644 index 00000000..6a99e9df --- /dev/null +++ b/packages/ciphernode/sortition/src/lib.rs @@ -0,0 +1,9 @@ +#![crate_name = "sortition"] +#![crate_type = "lib"] +// #![warn(missing_docs, unused_imports)] + +mod distance; +mod index; + +pub use distance::*; +pub use index::*; \ No newline at end of file diff --git a/packages/evm/.gitignore b/packages/evm/.gitignore index e812c153..2b590893 100644 --- a/packages/evm/.gitignore +++ b/packages/evm/.gitignore @@ -9,6 +9,7 @@ coverage dist node_modules types +deployments/localhost # files *.env diff --git a/packages/evm/contracts/Enclave.sol b/packages/evm/contracts/Enclave.sol index f67943bf..3e597e55 100644 --- a/packages/evm/contracts/Enclave.sol +++ b/packages/evm/contracts/Enclave.sol @@ -34,12 +34,16 @@ contract Enclave is IEnclave, OwnableUpgradeable { // Mapping of E3s. mapping(uint256 e3Id => E3 e3) public e3s; - // Mapping of input merkle trees + // Mapping of input merkle trees. mapping(uint256 e3Id => LeanIMTData imt) public inputs; // Mapping counting the number of inputs for each E3. mapping(uint256 e3Id => uint256 inputCount) public inputCounts; + // Mapping of enabled encryption schemes. + mapping(bytes32 encryptionSchemeId => bool enabled) + public encryptionSchemes; + //////////////////////////////////////////////////////////// // // // Errors // @@ -55,6 +59,7 @@ contract Enclave is IEnclave, OwnableUpgradeable { error E3DoesNotExist(uint256 e3Id); error ModuleAlreadyEnabled(address module); error ModuleNotEnabled(address module); + error InvalidEncryptionScheme(bytes32 encryptionSchemeId); error InputDeadlinePassed(uint256 e3Id, uint256 expiration); error InputDeadlineNotPassed(uint256 e3Id, uint256 expiration); error InvalidComputationRequest( @@ -141,6 +146,7 @@ contract Enclave is IEnclave, OwnableUpgradeable { uint256 seed = uint256(keccak256(abi.encode(block.prevrandao, e3Id))); ( + bytes32 encryptionSchemeId, IInputValidator inputValidator, IDecryptionVerifier decryptionVerifier ) = e3Program.validate( @@ -149,6 +155,10 @@ contract Enclave is IEnclave, OwnableUpgradeable { e3ProgramParams, computeProviderParams ); + require( + encryptionSchemes[encryptionSchemeId], + InvalidEncryptionScheme(encryptionSchemeId) + ); require( address(inputValidator) != address(0) && address(decryptionVerifier) != address(0), @@ -161,6 +171,7 @@ contract Enclave is IEnclave, OwnableUpgradeable { startWindow: startWindow, duration: duration, expiration: 0, + encryptionSchemeId: encryptionSchemeId, e3Program: e3Program, e3ProgramParams: e3ProgramParams, inputValidator: inputValidator, @@ -176,7 +187,7 @@ contract Enclave is IEnclave, OwnableUpgradeable { CommitteeSelectionFailed() ); - emit E3Requested(e3Id, e3s[e3Id], filter, e3Program); + emit E3Requested(e3Id, e3, filter, e3Program); } function activate(uint256 e3Id) external returns (bool success) { @@ -228,7 +239,8 @@ contract Enclave is IEnclave, OwnableUpgradeable { function publishCiphertextOutput( uint256 e3Id, - bytes memory data + bytes memory ciphertextOutput, + bytes memory proof ) external returns (bool success) { E3 memory e3 = getE3(e3Id); // Note: if we make 0 a no expiration, this has to be refactored @@ -240,38 +252,43 @@ contract Enclave is IEnclave, OwnableUpgradeable { // TODO: should the output verifier be able to change its mind? //i.e. should we be able to call this multiple times? require( - e3.ciphertextOutput.length == 0, + e3.ciphertextOutput == bytes32(0), CiphertextOutputAlreadyPublished(e3Id) ); - bytes memory output; - (output, success) = e3.e3Program.verify(e3Id, data); - require(success, InvalidOutput(output)); - e3s[e3Id].ciphertextOutput = output; + bytes32 ciphertextOutputHash = keccak256(ciphertextOutput); + (success) = e3.e3Program.verify(e3Id, ciphertextOutputHash, proof); + require(success, InvalidOutput(ciphertextOutput)); + e3s[e3Id].ciphertextOutput = ciphertextOutputHash; - emit CiphertextOutputPublished(e3Id, output); + emit CiphertextOutputPublished(e3Id, ciphertextOutput); } function publishPlaintextOutput( uint256 e3Id, - bytes memory data + bytes memory plaintextOutput, + bytes memory proof ) external returns (bool success) { E3 memory e3 = getE3(e3Id); // Note: if we make 0 a no expiration, this has to be refactored require(e3.expiration > 0, E3NotActivated(e3Id)); require( - e3.ciphertextOutput.length > 0, + e3.ciphertextOutput != bytes32(0), CiphertextOutputNotPublished(e3Id) ); require( - e3.plaintextOutput.length == 0, + e3.plaintextOutput == bytes32(0), PlaintextOutputAlreadyPublished(e3Id) ); - bytes memory output; - (output, success) = e3.decryptionVerifier.verify(e3Id, data); - require(success, InvalidOutput(output)); - e3s[e3Id].plaintextOutput = output; + bytes32 plaintextOutputHash = keccak256(plaintextOutput); + (success) = e3.decryptionVerifier.verify( + e3Id, + plaintextOutputHash, + proof + ); + require(success, InvalidOutput(plaintextOutput)); + e3s[e3Id].plaintextOutput = plaintextOutputHash; - emit PlaintextOutputPublished(e3Id, output); + emit PlaintextOutputPublished(e3Id, plaintextOutput); } //////////////////////////////////////////////////////////// @@ -322,6 +339,30 @@ contract Enclave is IEnclave, OwnableUpgradeable { emit E3ProgramDisabled(e3Program); } + function enableEncryptionScheme( + bytes32 encryptionSchemeId + ) public onlyOwner returns (bool success) { + require( + !encryptionSchemes[encryptionSchemeId], + InvalidEncryptionScheme(encryptionSchemeId) + ); + encryptionSchemes[encryptionSchemeId] = true; + success = true; + emit EncryptionSchemeEnabled(encryptionSchemeId); + } + + function disableEncryptionScheme( + bytes32 encryptionSchemeId + ) public onlyOwner returns (bool success) { + require( + encryptionSchemes[encryptionSchemeId], + InvalidEncryptionScheme(encryptionSchemeId) + ); + encryptionSchemes[encryptionSchemeId] = false; + success = false; + emit EncryptionSchemeDisabled(encryptionSchemeId); + } + //////////////////////////////////////////////////////////// // // // Get Functions // @@ -340,4 +381,10 @@ contract Enclave is IEnclave, OwnableUpgradeable { ); return InternalLeanIMT._root(inputs[e3Id]); } + + function isEncryptionSchemeEnabled( + bytes32 encryptionSchemeId + ) public view returns (bool) { + return encryptionSchemes[encryptionSchemeId]; + } } diff --git a/packages/evm/contracts/interfaces/IDecryptionVerifier.sol b/packages/evm/contracts/interfaces/IDecryptionVerifier.sol index 0b9ad1f5..d5221a37 100644 --- a/packages/evm/contracts/interfaces/IDecryptionVerifier.sol +++ b/packages/evm/contracts/interfaces/IDecryptionVerifier.sol @@ -2,12 +2,15 @@ pragma solidity >=0.8.27; interface IDecryptionVerifier { - /// @notice This function should be called by the Enclave contract to verify the decryption of output of a computation. + /// @notice This function should be called by the Enclave contract to verify the + /// decryption of output of a computation. /// @param e3Id ID of the E3. - /// @param data ABI encoded output data to be verified. - /// @return output Plaintext output of the given computation. + /// @param plaintextOutputHash The keccak256 hash of the plaintext output to be verified. + /// @param proof ABI encoded proof of the given output hash. + /// @return success Whether or not the plaintextOutputHash was successfully verified. function verify( uint256 e3Id, - bytes memory data - ) external view returns (bytes memory output, bool success); + bytes32 plaintextOutputHash, + bytes memory proof + ) external view returns (bool success); } diff --git a/packages/evm/contracts/interfaces/IE3.sol b/packages/evm/contracts/interfaces/IE3.sol index 2a4e6e5e..8a3222aa 100644 --- a/packages/evm/contracts/interfaces/IE3.sol +++ b/packages/evm/contracts/interfaces/IE3.sol @@ -2,7 +2,6 @@ pragma solidity >=0.8.27; import { IInputValidator } from "./IInputValidator.sol"; -import { IComputeProvider } from "./IComputeProvider.sol"; import { IE3Program } from "./IE3Program.sol"; import { IDecryptionVerifier } from "./IDecryptionVerifier.sol"; @@ -25,11 +24,12 @@ struct E3 { uint256[2] startWindow; uint256 duration; uint256 expiration; + bytes32 encryptionSchemeId; IE3Program e3Program; bytes e3ProgramParams; IInputValidator inputValidator; IDecryptionVerifier decryptionVerifier; bytes committeePublicKey; - bytes ciphertextOutput; - bytes plaintextOutput; + bytes32 ciphertextOutput; + bytes32 plaintextOutput; } diff --git a/packages/evm/contracts/interfaces/IE3Program.sol b/packages/evm/contracts/interfaces/IE3Program.sol index 601dc4f4..2116adc6 100644 --- a/packages/evm/contracts/interfaces/IE3Program.sol +++ b/packages/evm/contracts/interfaces/IE3Program.sol @@ -10,6 +10,7 @@ interface IE3Program { /// @param seed Seed for the computation. /// @param e3ProgramParams ABI encoded computation parameters. /// @param computeProviderParams ABI encoded compute provider parameters. + /// @return encryptionSchemeId ID of the encryption scheme to be used for the computation. /// @return inputValidator The input validator to be used for the computation. /// @return decryptionVerifier The decryption verifier to be used for the computation. function validate( @@ -20,17 +21,19 @@ interface IE3Program { ) external returns ( + bytes32 encryptionSchemeId, IInputValidator inputValidator, IDecryptionVerifier decryptionVerifier ); /// @notice This function should be called by the Enclave contract to verify the decrypted output of an E3. /// @param e3Id ID of the E3. - /// @param outputData ABI encoded output data to be verified. - /// @return output The output data to be published. + /// @param ciphertextOutputHash The keccak256 hash of output data to be verified. + /// @param proof ABI encoded data to verify the ciphertextOutputHash. /// @return success Whether the output data is valid. function verify( uint256 e3Id, - bytes memory outputData - ) external returns (bytes memory output, bool success); + bytes32 ciphertextOutputHash, + bytes memory proof + ) external returns (bool success); } diff --git a/packages/evm/contracts/interfaces/IEnclave.sol b/packages/evm/contracts/interfaces/IEnclave.sol index 246bc3d9..896bde79 100644 --- a/packages/evm/contracts/interfaces/IEnclave.sol +++ b/packages/evm/contracts/interfaces/IEnclave.sol @@ -66,6 +66,14 @@ interface IEnclave { /// @param ciphernodeRegistry The address of the CiphernodeRegistry contract. event CiphernodeRegistrySet(address ciphernodeRegistry); + /// @notice The event MUST be emitted any time an encryption scheme is enabled. + /// @param encryptionSchemeId The ID of the encryption scheme that was enabled. + event EncryptionSchemeEnabled(bytes32 encryptionSchemeId); + + /// @notice This event MUST be emitted any time an encryption scheme is disabled. + /// @param encryptionSchemeId The ID of the encryption scheme that was disabled. + event EncryptionSchemeDisabled(bytes32 encryptionSchemeId); + /// @notice This event MUST be emitted any time a E3 Program is enabled. /// @param e3Program The address of the E3 Program. event E3ProgramEnabled(IE3Program e3Program); @@ -122,22 +130,25 @@ interface IEnclave { /// @notice This function should be called to publish output data for an Encrypted Execution Environment (E3). /// @dev This function MUST emit the CiphertextOutputPublished event. /// @param e3Id ID of the E3. - /// @param data ABI encoded output data to verify. + /// @param ciphertextOutput ABI encoded output data to verify. + /// @param proof ABI encoded data to verify the ciphertextOutput. /// @return success True if the output was successfully published. function publishCiphertextOutput( uint256 e3Id, - bytes memory data + bytes memory ciphertextOutput, + bytes memory proof ) external returns (bool success); /// @notice This function publishes the plaintext output of an Encrypted Execution Environment (E3). /// @dev This function MUST revert if the output has not been published. /// @dev This function MUST emit the PlaintextOutputPublished event. /// @param e3Id ID of the E3. - /// @param data ABI encoded output data to decrypt. - /// @return success True if the output was successfully decrypted. + /// @param plaintextOutput ABI encoded plaintext output. + /// @param proof ABI encoded data to verify the plaintextOutput. function publishPlaintextOutput( uint256 e3Id, - bytes memory data + bytes memory plaintextOutput, + bytes memory proof ) external returns (bool success); //////////////////////////////////////////////////////////// diff --git a/packages/evm/contracts/registry/CiphernodeRegistryOwnable.sol b/packages/evm/contracts/registry/CiphernodeRegistryOwnable.sol index 96c4c54b..1c645307 100644 --- a/packages/evm/contracts/registry/CiphernodeRegistryOwnable.sol +++ b/packages/evm/contracts/registry/CiphernodeRegistryOwnable.sol @@ -8,8 +8,7 @@ import { } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import { InternalLeanIMT, - LeanIMTData, - PoseidonT3 + LeanIMTData } from "@zk-kit/lean-imt.sol/InternalLeanIMT.sol"; contract CiphernodeRegistryOwnable is ICiphernodeRegistry, OwnableUpgradeable { @@ -25,7 +24,7 @@ contract CiphernodeRegistryOwnable is ICiphernodeRegistry, OwnableUpgradeable { uint256 public numCiphernodes; LeanIMTData public ciphernodes; - mapping(uint256 e3Id => IRegistryFilter filter) public requests; + mapping(uint256 e3Id => IRegistryFilter filter) public filters; mapping(uint256 e3Id => uint256 root) public roots; mapping(uint256 e3Id => bytes publicKey) public publicKeys; @@ -37,7 +36,7 @@ contract CiphernodeRegistryOwnable is ICiphernodeRegistry, OwnableUpgradeable { error CommitteeAlreadyRequested(); error CommitteeAlreadyPublished(); - error CommitteeDoesNotExist(); + error OnlyFilter(); error CommitteeNotPublished(); error CiphernodeNotEnabled(address node); error OnlyEnclave(); @@ -66,7 +65,7 @@ contract CiphernodeRegistryOwnable is ICiphernodeRegistry, OwnableUpgradeable { function initialize(address _owner, address _enclave) public initializer { __Ownable_init(msg.sender); setEnclave(_enclave); - transferOwnership(_owner); + if (_owner != owner()) transferOwnership(_owner); } //////////////////////////////////////////////////////////// @@ -81,10 +80,10 @@ contract CiphernodeRegistryOwnable is ICiphernodeRegistry, OwnableUpgradeable { uint32[2] calldata threshold ) external onlyEnclave returns (bool success) { require( - requests[e3Id] == IRegistryFilter(address(0)), + filters[e3Id] == IRegistryFilter(address(0)), CommitteeAlreadyRequested() ); - requests[e3Id] = IRegistryFilter(filter); + filters[e3Id] = IRegistryFilter(filter); roots[e3Id] = root(); IRegistryFilter(filter).requestCommittee(e3Id, threshold); @@ -98,25 +97,14 @@ contract CiphernodeRegistryOwnable is ICiphernodeRegistry, OwnableUpgradeable { bytes calldata publicKey ) external { // only to be published by the filter - require(address(requests[e3Id]) == msg.sender, CommitteeDoesNotExist()); + require(address(filters[e3Id]) == msg.sender, OnlyFilter()); publicKeys[e3Id] = publicKey; emit CommitteePublished(e3Id, publicKey); } - //////////////////////////////////////////////////////////// - // // - // Set Functions // - // // - //////////////////////////////////////////////////////////// - - function setEnclave(address _enclave) public onlyOwner { - enclave = _enclave; - emit EnclaveSet(_enclave); - } - function addCiphernode(address node) external onlyOwner { - uint256 ciphernode = uint256(bytes32(bytes20(node))); + uint160 ciphernode = uint160(node); ciphernodes._insert(ciphernode); numCiphernodes++; emit CiphernodeAdded( @@ -131,21 +119,22 @@ contract CiphernodeRegistryOwnable is ICiphernodeRegistry, OwnableUpgradeable { address node, uint256[] calldata siblingNodes ) external onlyOwner { - uint256 ciphernode = uint256(bytes32(bytes20(node))); - ciphernodes._remove(ciphernode, siblingNodes); + uint160 ciphernode = uint160(node); uint256 index = ciphernodes._indexOf(ciphernode); + ciphernodes._remove(ciphernode, siblingNodes); numCiphernodes--; - emit CiphernodeAdded( - node, - ciphernodes._indexOf(ciphernode), - numCiphernodes, - ciphernodes.size - ); emit CiphernodeRemoved(node, index, numCiphernodes, ciphernodes.size); } - function isCiphernodeEligible(address node) external view returns (bool) { - return isEnabled(node); + //////////////////////////////////////////////////////////// + // // + // Set Functions // + // // + //////////////////////////////////////////////////////////// + + function setEnclave(address _enclave) public onlyOwner { + enclave = _enclave; + emit EnclaveSet(_enclave); } //////////////////////////////////////////////////////////// @@ -161,8 +150,12 @@ contract CiphernodeRegistryOwnable is ICiphernodeRegistry, OwnableUpgradeable { require(publicKey.length > 0, CommitteeNotPublished()); } + function isCiphernodeEligible(address node) external view returns (bool) { + return isEnabled(node); + } + function isEnabled(address node) public view returns (bool) { - return ciphernodes._has(uint256(bytes32(bytes20(node)))); + return ciphernodes._has(uint160(node)); } function root() public view returns (uint256) { @@ -172,4 +165,12 @@ contract CiphernodeRegistryOwnable is ICiphernodeRegistry, OwnableUpgradeable { function rootAt(uint256 e3Id) public view returns (uint256) { return roots[e3Id]; } + + function getFilter(uint256 e3Id) public view returns (IRegistryFilter) { + return filters[e3Id]; + } + + function treeSize() public view returns (uint256) { + return ciphernodes.size; + } } diff --git a/packages/evm/contracts/registry/NaiveRegistryFilter.sol b/packages/evm/contracts/registry/NaiveRegistryFilter.sol index 7d122e9e..a8694196 100644 --- a/packages/evm/contracts/registry/NaiveRegistryFilter.sol +++ b/packages/evm/contracts/registry/NaiveRegistryFilter.sol @@ -60,7 +60,7 @@ contract NaiveRegistryFilter is IRegistryFilter, OwnableUpgradeable { function initialize(address _owner, address _registry) public initializer { __Ownable_init(msg.sender); setRegistry(_registry); - transferOwnership(_owner); + if (_owner != owner()) transferOwnership(_owner); } //////////////////////////////////////////////////////////// @@ -73,9 +73,8 @@ contract NaiveRegistryFilter is IRegistryFilter, OwnableUpgradeable { uint256 e3Id, uint32[2] calldata threshold ) external onlyRegistry returns (bool success) { - Committee storage committee = committees[e3Id]; - require(committee.threshold.length == 0, CommitteeAlreadyExists()); - committee.threshold = threshold; + require(committees[e3Id].threshold[1] == 0, CommitteeAlreadyExists()); + committees[e3Id].threshold = threshold; success = true; } @@ -107,4 +106,16 @@ contract NaiveRegistryFilter is IRegistryFilter, OwnableUpgradeable { function setRegistry(address _registry) public onlyOwner { registry = _registry; } + + //////////////////////////////////////////////////////////// + // // + // Get Functions // + // // + //////////////////////////////////////////////////////////// + + function getCommittee( + uint256 e3Id + ) external view returns (Committee memory) { + return committees[e3Id]; + } } diff --git a/packages/evm/contracts/test/MockCiphernodeRegistry.sol b/packages/evm/contracts/test/MockCiphernodeRegistry.sol index 4704e50a..29625e39 100644 --- a/packages/evm/contracts/test/MockCiphernodeRegistry.sol +++ b/packages/evm/contracts/test/MockCiphernodeRegistry.sol @@ -21,7 +21,7 @@ contract MockCiphernodeRegistry is ICiphernodeRegistry { uint256, bytes calldata, bytes calldata - ) external {} + ) external {} // solhint-disable-line no-empty-blocks function committeePublicKey( uint256 e3Id @@ -56,7 +56,7 @@ contract MockCiphernodeRegistryEmptyKey is ICiphernodeRegistry { uint256, bytes calldata, bytes calldata - ) external {} + ) external {} // solhint-disable-line no-empty-blocks function committeePublicKey(uint256) external pure returns (bytes memory) { return hex""; diff --git a/packages/evm/contracts/test/MockDecryptionVerifier.sol b/packages/evm/contracts/test/MockDecryptionVerifier.sol index d2977901..7bbf68d3 100644 --- a/packages/evm/contracts/test/MockDecryptionVerifier.sol +++ b/packages/evm/contracts/test/MockDecryptionVerifier.sol @@ -6,10 +6,11 @@ import { IDecryptionVerifier } from "../interfaces/IDecryptionVerifier.sol"; contract MockDecryptionVerifier is IDecryptionVerifier { function verify( uint256, + bytes32, bytes memory data - ) external pure returns (bytes memory output, bool success) { - output = data; + ) external pure returns (bool success) { + data; - if (output.length > 0) success = true; + if (data.length > 0) success = true; } } diff --git a/packages/evm/contracts/test/MockE3Program.sol b/packages/evm/contracts/test/MockE3Program.sol index d8ff026c..079ae9b0 100644 --- a/packages/evm/contracts/test/MockE3Program.sol +++ b/packages/evm/contracts/test/MockE3Program.sol @@ -19,6 +19,7 @@ contract MockE3Program is IE3Program { external pure returns ( + bytes32 encryptionSchemeId, IInputValidator inputValidator, IDecryptionVerifier decryptionVerifier ) @@ -32,13 +33,15 @@ contract MockE3Program is IE3Program { inputValidator := mload(add(e3ProgramParams, 32)) decryptionVerifier := mload(add(computeProviderParams, 32)) } + encryptionSchemeId = 0x0000000000000000000000000000000000000000000000000000000000000001; } function verify( uint256, + bytes32, bytes memory data - ) external pure returns (bytes memory output, bool success) { - output = data; - if (output.length > 0) success = true; + ) external pure returns (bool success) { + data; + if (data.length > 0) success = true; } } diff --git a/packages/evm/contracts/test/MockRegistryFilter.sol b/packages/evm/contracts/test/MockRegistryFilter.sol index 4899f574..f0abc7a3 100644 --- a/packages/evm/contracts/test/MockRegistryFilter.sol +++ b/packages/evm/contracts/test/MockRegistryFilter.sol @@ -67,7 +67,7 @@ contract MockNaiveRegistryFilter is IRegistryFilter, OwnableUpgradeable { function initialize(address _owner, address _registry) public initializer { __Ownable_init(msg.sender); setRegistry(_registry); - transferOwnership(_owner); + if (_owner != owner()) transferOwnership(_owner); } //////////////////////////////////////////////////////////// diff --git a/packages/evm/deploy/deploy.ts b/packages/evm/deploy/enclave.ts similarity index 52% rename from packages/evm/deploy/deploy.ts rename to packages/evm/deploy/enclave.ts index 35b99935..207be341 100644 --- a/packages/evm/deploy/deploy.ts +++ b/packages/evm/deploy/enclave.ts @@ -1,5 +1,6 @@ import { DeployFunction } from "hardhat-deploy/types"; import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { PoseidonT3, proxy } from "poseidon-solidity"; const THIRTY_DAYS_IN_SECONDS = 60 * 60 * 24 * 30; const addressOne = "0x0000000000000000000000000000000000000001"; @@ -8,26 +9,58 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deployer } = await hre.getNamedAccounts(); const { deploy } = hre.deployments; + // First check if the proxy exists + if ((await hre.ethers.provider.getCode(proxy.address)) === "0x") { + // probably on the hardhat network + // fund the keyless account + const [sender] = await hre.ethers.getSigners(); + await sender.sendTransaction({ + to: proxy.from, + value: proxy.gas, + }); + + // then send the presigned transaction deploying the proxy + await hre.ethers.provider.broadcastTransaction(proxy.tx); + console.log(`Proxy deployed to: ${proxy.address}`); + } + + // Then deploy the hasher, if needed + if ((await hre.ethers.provider.getCode(PoseidonT3.address)) === "0x") { + const [sender] = await hre.ethers.getSigners(); + await sender.sendTransaction({ + to: proxy.address, + data: PoseidonT3.data, + }); + + console.log(`PoseidonT3 deployed to: ${PoseidonT3.address}`); + } + // Deploy Enclave contract const enclave = await deploy("Enclave", { from: deployer, args: [deployer, addressOne, THIRTY_DAYS_IN_SECONDS], log: true, + libraries: { + PoseidonT3: PoseidonT3.address, + }, }); console.log(`Enclave contract: `, enclave.address); - // Deploy CyphernodeRegistryOwnable contract + // Deploy CiphernodeRegistryOwnable contract - const cypherNodeRegistry = await deploy("CyphernodeRegistryOwnable", { + const cypherNodeRegistry = await deploy("CiphernodeRegistryOwnable", { from: deployer, args: [deployer, enclave.address], log: true, + libraries: { + PoseidonT3: PoseidonT3.address, + }, }); console.log( - `CyphernodeRegistryOwnable contract: `, + `CiphernodeRegistryOwnable contract: `, cypherNodeRegistry.address, ); @@ -47,19 +80,18 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { enclave.address, ); - const registryAddress = await enclaveContract.cyphernodeRegistry(); + const registryAddress = await enclaveContract.ciphernodeRegistry(); if (registryAddress === cypherNodeRegistry.address) { console.log(`Enclave contract already has registry`); return; } - const result = await enclaveContract.setCyphernodeRegistry( + const result = await enclaveContract.setCiphernodeRegistry( cypherNodeRegistry.address, ); await result.wait(); console.log(`Enclave contract updated with registry`); }; export default func; -func.id = "deploy_enclave"; // id required to prevent reexecution -func.tags = ["Enclave"]; +func.tags = ["enclave"]; diff --git a/packages/evm/deploy/mocks.ts b/packages/evm/deploy/mocks.ts new file mode 100644 index 00000000..623ebaf7 --- /dev/null +++ b/packages/evm/deploy/mocks.ts @@ -0,0 +1,33 @@ +import { DeployFunction } from "hardhat-deploy/types"; +import { HardhatRuntimeEnvironment } from "hardhat/types"; + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const { deployer } = await hre.getNamedAccounts(); + const { deploy } = hre.deployments; + + await deploy("MockE3Program", { + from: deployer, + args: [], + log: true, + }); + + await deploy("MockComputeProvider", { + from: deployer, + args: [], + log: true, + }); + + await deploy("MockDecryptionVerifier", { + from: deployer, + args: [], + log: true, + }); + + await deploy("MockInputValidator", { + from: deployer, + args: [], + log: true, + }); +}; +export default func; +func.tags = ["mocks"]; diff --git a/packages/evm/deployments/sepolia/CyphernodeRegistryOwnable.json b/packages/evm/deployments/sepolia/CyphernodeRegistryOwnable.json index 1dce7765..47ad8adb 100644 --- a/packages/evm/deployments/sepolia/CyphernodeRegistryOwnable.json +++ b/packages/evm/deployments/sepolia/CyphernodeRegistryOwnable.json @@ -723,4 +723,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/evm/deployments/sepolia/Enclave.json b/packages/evm/deployments/sepolia/Enclave.json index 0cd92d01..389e0b3f 100644 --- a/packages/evm/deployments/sepolia/Enclave.json +++ b/packages/evm/deployments/sepolia/Enclave.json @@ -1754,4 +1754,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/evm/deployments/sepolia/NaiveRegistryFilter.json b/packages/evm/deployments/sepolia/NaiveRegistryFilter.json index bc51ef5b..61400ff2 100644 --- a/packages/evm/deployments/sepolia/NaiveRegistryFilter.json +++ b/packages/evm/deployments/sepolia/NaiveRegistryFilter.json @@ -455,4 +455,4 @@ } } } -} \ No newline at end of file +} diff --git a/packages/evm/deployments/sepolia/solcInputs/d0e6e4f19028714f394c36db62dff2be.json b/packages/evm/deployments/sepolia/solcInputs/d0e6e4f19028714f394c36db62dff2be.json index 5c8e6151..eaf4c996 100644 --- a/packages/evm/deployments/sepolia/solcInputs/d0e6e4f19028714f394c36db62dff2be.json +++ b/packages/evm/deployments/sepolia/solcInputs/d0e6e4f19028714f394c36db62dff2be.json @@ -86,10 +86,8 @@ "storageLayout", "evm.gasEstimates" ], - "": [ - "ast" - ] + "": ["ast"] } } } -} \ No newline at end of file +} diff --git a/packages/evm/hardhat.config.ts b/packages/evm/hardhat.config.ts index 590a4deb..60c4cf88 100644 --- a/packages/evm/hardhat.config.ts +++ b/packages/evm/hardhat.config.ts @@ -7,18 +7,22 @@ import type { NetworkUserConfig } from "hardhat/types"; import "./tasks/accounts"; import "./tasks/ciphernode"; +import "./tasks/enclave"; dotenv.config(); const { INFURA_KEY, MNEMONIC, ETHERSCAN_API_KEY } = process.env; + if (!INFURA_KEY || !MNEMONIC || !ETHERSCAN_API_KEY) { console.error( "Please set the INFURA_KEY, MNEMONIC, and ETHERSCAN_API_KEY environment variables", ); - process.exit(1); } -const mnemonic: string = MNEMONIC; -const infuraApiKey: string = INFURA_KEY; + +// Setting defaults so that tests will run +const mnemonic = + MNEMONIC || "test test test test test test test test test test test junk"; +const infuraApiKey = INFURA_KEY || "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"; const chainIds = { "arbitrum-mainnet": 42161, @@ -66,18 +70,17 @@ const config: HardhatUserConfig = { arbitrumOne: vars.get("ARBISCAN_API_KEY", ""), avalanche: vars.get("SNOWTRACE_API_KEY", ""), bsc: vars.get("BSCSCAN_API_KEY", ""), - mainnet: ETHERSCAN_API_KEY, + mainnet: ETHERSCAN_API_KEY || "", optimisticEthereum: vars.get("OPTIMISM_API_KEY", ""), polygon: vars.get("POLYGONSCAN_API_KEY", ""), polygonMumbai: vars.get("POLYGONSCAN_API_KEY", ""), - sepolia: ETHERSCAN_API_KEY, + sepolia: ETHERSCAN_API_KEY || "", }, }, gasReporter: { currency: "USD", enabled: process.env.REPORT_GAS ? true : false, excludeContracts: [], - src: "./contracts", }, networks: { hardhat: { @@ -87,13 +90,6 @@ const config: HardhatUserConfig = { chainId: chainIds.hardhat, allowUnlimitedContractSize: true, }, - ganache: { - accounts: { - mnemonic, - }, - chainId: chainIds.ganache, - url: "http://localhost:8545", - }, arbitrum: getChainConfig("arbitrum-mainnet"), avalanche: getChainConfig("avalanche"), bsc: getChainConfig("bsc"), @@ -127,6 +123,7 @@ const config: HardhatUserConfig = { }, overrides: { "node_modules/poseidon-solidity/PoseidonT3.sol": { + version: "0.7.0", settings: { optimizer: { enabled: true, diff --git a/packages/evm/package.json b/packages/evm/package.json index 6dae0e66..cc897ff5 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,7 +1,7 @@ { - "name": "@gnosisguild/enclave", + "name": "@gnosis-guild/enclave", "description": "Enclave is an open-source protocol for Encrypted Execution Environments (E3).", - "version": "0.0.0", + "version": "0.0.1", "license": "LGPL-3.0-only", "author": { "name": "gnosisguild", @@ -72,7 +72,8 @@ "clean": "rimraf ./artifacts ./cache ./coverage ./types ./coverage.json && yarn typechain", "compile": "cross-env TS_NODE_TRANSPILE_ONLY=true hardhat compile", "coverage": "hardhat coverage --solcoverjs ./.solcover.js --temp artifacts --testfiles \"test/**/*.ts\" && yarn typechain", - "deploy": "hardhat deploy", + "deploy": "hardhat deploy --tags enclave", + "deploy:mocks": "hardhat deploy --tags enclave,mocks", "ciphernode:add": "hardhat ciphernode:add", "ciphernode:remove": "hardhat ciphernode:remove", "lint": "yarn lint:sol && yarn lint:ts && yarn prettier:check", @@ -84,7 +85,9 @@ "task:deployLock": "hardhat task:deployLock", "task:withdraw": "hardhat task:withdraw", "test": "hardhat test", - "typechain": "cross-env TS_NODE_TRANSPILE_ONLY=true hardhat typechain" + "typechain": "cross-env TS_NODE_TRANSPILE_ONLY=true hardhat typechain", + "prerelease": "yarn clean && yarn compile && yarn typechain", + "release": "yarn publish --non-interactive" }, "dependencies": {} } diff --git a/packages/evm/tasks/ciphernode.ts b/packages/evm/tasks/ciphernode.ts index af706bfa..a66bb264 100644 --- a/packages/evm/tasks/ciphernode.ts +++ b/packages/evm/tasks/ciphernode.ts @@ -4,35 +4,17 @@ import type { TaskArguments } from "hardhat/types"; task("ciphernode:add", "Register a ciphernode to the registry") .addParam("ciphernodeAddress", "address of ciphernode to register") .setAction(async function (taskArguments: TaskArguments, hre) { - const registry = await hre.deployments.get("CyphernodeRegistryOwnable"); + const registry = await hre.deployments.get("CiphernodeRegistryOwnable"); const registryContract = await hre.ethers.getContractAt( - "CyphernodeRegistryOwnable", + "CiphernodeRegistryOwnable", registry.address, ); - const tx = await registryContract.addCyphernode( + const tx = await registryContract.addCiphernode( taskArguments.ciphernodeAddress, ); await tx.wait(); console.log(`Ciphernode ${taskArguments.ciphernodeAddress} registered`); }); - -task("ciphernode:remove", "Remove a ciphernode from the registry") - .addParam("ciphernodeAddress", "address of ciphernode to remove") - .setAction(async function (taskArguments: TaskArguments, hre) { - const registry = await hre.deployments.get("CyphernodeRegistryOwnable"); - - const registryContract = await hre.ethers.getContractAt( - "CyphernodeRegistryOwnable", - registry.address, - ); - - const tx = await registryContract.removeCyphernode( - taskArguments.ciphernodeAddress, - ); - await tx.wait(); - - console.log(`Ciphernode ${taskArguments.ciphernodeAddress} removed`); - }); diff --git a/packages/evm/tasks/enclave.ts b/packages/evm/tasks/enclave.ts new file mode 100644 index 00000000..7e925614 --- /dev/null +++ b/packages/evm/tasks/enclave.ts @@ -0,0 +1,269 @@ +import { task, types } from "hardhat/config"; +import type { TaskArguments } from "hardhat/types"; + +task( + "committee:new", + "Request a new ciphernode committee, will use E3 mock contracts by default", +) + .addOptionalParam( + "filter", + "address of filter contract to use", + undefined, + types.string, + ) + .addOptionalParam( + "thresholdQuorum", + "threshold quorum for committee", + 2, + types.int, + ) + .addOptionalParam( + "thresholdTotal", + "threshold total for committee", + 2, + types.int, + ) + .addOptionalParam( + "windowStart", + "timestamp start of window for the E3 (default: now)", + Math.floor(Date.now() / 1000), + types.int, + ) + .addOptionalParam( + "windowEnd", + "timestamp end of window for the E3 (default: now + 1 day)", + Math.floor(Date.now() / 1000) + 86400, + types.int, + ) + .addOptionalParam( + "duration", + "duration in seconds of the E3 (default: 1 day)", + 86400, + types.int, + ) + .addOptionalParam( + "e3Address", + "address of the E3 program", + undefined, + types.string, + ) + .addOptionalParam( + "e3Params", + "parameters for the E3 program", + undefined, + types.string, + ) + .addOptionalParam( + "computeParams", + "parameters for the compute provider", + undefined, + types.string, + ) + .setAction(async function (taskArguments: TaskArguments, hre) { + const enclave = await hre.deployments.get("Enclave"); + + const enclaveContract = await hre.ethers.getContractAt( + "Enclave", + enclave.address, + ); + + let e3Address = taskArguments.e3Address; + if (!e3Address) { + const mockE3Program = await hre.deployments.get("MockE3Program"); + if (!mockE3Program) { + throw new Error("MockE3Program not deployed"); + } + e3Address = mockE3Program.address; + } + + let filterAddress = taskArguments.filter; + if (!filterAddress) { + const naiveRegistryFilter = await hre.deployments.get( + "NaiveRegistryFilter", + ); + if (!naiveRegistryFilter) { + throw new Error("NaiveRegistryFilter not deployed"); + } + filterAddress = naiveRegistryFilter.address; + } + + let e3Params = taskArguments.e3Params; + if (!e3Params) { + const MockInputValidator = + await hre.deployments.get("MockInputValidator"); + if (!MockInputValidator) { + throw new Error("MockInputValidator not deployed"); + } + e3Params = hre.ethers.zeroPadValue(MockInputValidator.address, 32); + } + + let computeParams = taskArguments.computeParams; + if (!computeParams) { + const MockDecryptionVerifier = await hre.deployments.get( + "MockDecryptionVerifier", + ); + if (!MockDecryptionVerifier) { + throw new Error("MockDecryptionVerifier not deployed"); + } + computeParams = hre.ethers.zeroPadValue( + MockDecryptionVerifier.address, + 32, + ); + } + + try { + const enableE3Tx = await enclaveContract.enableE3Program(e3Address); + await enableE3Tx.wait(); + } catch (e) { + console.log("E3 program enabling failed, probably already enabled: ", e); + } + + const tx = await enclaveContract.request( + filterAddress, + [taskArguments.thresholdQuorum, taskArguments.thresholdTotal], + [taskArguments.windowStart, taskArguments.windowEnd], + taskArguments.duration, + e3Address, + e3Params, + computeParams, + // 1 ETH + { value: "1000000000000000000" }, + ); + + console.log("Reequesting committee... ", tx.hash); + await tx.wait(); + + console.log(`Committee requested`); + }); + +task("committee:publish", "Publish the publickey of the committee") + .addOptionalParam( + "filter", + "address of filter contract to use (defaults to NaiveRegistryFilter)", + ) + .addParam("e3Id", "Id of the E3 program", undefined, types.int) + .addParam( + "nodes", + "list of node address in the committee, comma separated", + undefined, + types.string, + ) + .addParam("publicKey", "public key of the committee", undefined, types.string) + .setAction(async function (taskArguments: TaskArguments, hre) { + let filterAddress = taskArguments.filter; + if (!taskArguments.filter) { + filterAddress = (await hre.deployments.get("NaiveRegistryFilter")) + .address; + + if (!filterAddress) { + throw new Error("NaiveRegistryFilter not deployed"); + } + } + + const filterContract = await hre.ethers.getContractAt( + "NaiveRegistryFilter", + filterAddress, + ); + + const nodes = taskArguments.nodes.split(","); + + if (!Array.isArray(nodes)) { + throw new Error( + "Could not parse nodes: Nodes must be input as comma separated list", + ); + } + + const tx = await filterContract.publishCommittee( + taskArguments.e3Id, + nodes, + taskArguments.publicKey, + ); + + console.log("Publishing committee... ", tx.hash); + await tx.wait(); + console.log(`Committee public key published`); + }); + +task("e3:activate", "Activate an E3 program") + .addParam("e3Id", "Id of the E3 program") + .setAction(async function (taskArguments: TaskArguments, hre) { + const enclave = await hre.deployments.get("Enclave"); + + const enclaveContract = await hre.ethers.getContractAt( + "Enclave", + enclave.address, + ); + + const tx = await enclaveContract.activate(taskArguments.e3Id); + + console.log("Activating E3 program... ", tx.hash); + await tx.wait(); + + console.log(`E3 program activated`); + }); + +task("e3:publishInput", "Publish input for an E3 program") + .addParam("e3Id", "Id of the E3 program") + .addParam("data", "data to publish") + .setAction(async function (taskArguments: TaskArguments, hre) { + const enclave = await hre.deployments.get("Enclave"); + + const enclaveContract = await hre.ethers.getContractAt( + "Enclave", + enclave.address, + ); + + const tx = await enclaveContract.publishInput( + taskArguments.e3Id, + taskArguments.data, + ); + + console.log("Publishing input... ", tx.hash); + await tx.wait(); + + console.log(`Input published`); + }); + +task("e3:publishCiphertext", "Publish ciphertext output for an E3 program") + .addParam("e3Id", "Id of the E3 program") + .addParam("data", "data to publish") + .setAction(async function (taskArguments: TaskArguments, hre) { + const enclave = await hre.deployments.get("Enclave"); + + const enclaveContract = await hre.ethers.getContractAt( + "Enclave", + enclave.address, + ); + + const tx = await enclaveContract.publishCiphertextOutput( + taskArguments.e3Id, + taskArguments.data, + ); + + console.log("Publishing ciphertext... ", tx.hash); + await tx.wait(); + + console.log(`Ciphertext published`); + }); + +task("e3:publishPlaintext", "Publish plaintext output for an E3 program") + .addParam("e3Id", "Id of the E3 program") + .addParam("data", "data to publish") + .setAction(async function (taskArguments: TaskArguments, hre) { + const enclave = await hre.deployments.get("Enclave"); + + const enclaveContract = await hre.ethers.getContractAt( + "Enclave", + enclave.address, + ); + + const tx = await enclaveContract.publishPlaintextOutput( + taskArguments.e3Id, + taskArguments.data, + ); + + console.log("Publishing ciphertext... ", tx.hash); + await tx.wait(); + + console.log(`Ciphertext published`); + }); diff --git a/packages/evm/test/CiphernodeRegistry/CiphernodeRegistryOwnable.spec.ts b/packages/evm/test/CiphernodeRegistry/CiphernodeRegistryOwnable.spec.ts new file mode 100644 index 00000000..bf828e20 --- /dev/null +++ b/packages/evm/test/CiphernodeRegistry/CiphernodeRegistryOwnable.spec.ts @@ -0,0 +1,389 @@ +import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; +import { LeanIMT } from "@zk-kit/lean-imt"; +import { expect } from "chai"; +import { ethers } from "hardhat"; +import { poseidon2 } from "poseidon-lite"; + +import { deployCiphernodeRegistryOwnableFixture } from "../fixtures/CiphernodeRegistryOwnable.fixture"; +import { naiveRegistryFilterFixture } from "../fixtures/NaiveRegistryFilter.fixture"; +import { PoseidonT3Fixture } from "../fixtures/PoseidonT3.fixture"; + +const AddressOne = "0x0000000000000000000000000000000000000001"; +const AddressTwo = "0x0000000000000000000000000000000000000002"; +const AddressThree = "0x0000000000000000000000000000000000000003"; + +// Hash function used to compute the tree nodes. +const hash = (a: bigint, b: bigint) => poseidon2([a, b]); + +describe("CiphernodeRegistryOwnable", function () { + async function setup() { + const [owner, notTheOwner] = await ethers.getSigners(); + + const poseidon = await PoseidonT3Fixture(); + const registry = await deployCiphernodeRegistryOwnableFixture( + owner.address, + owner.address, + await poseidon.getAddress(), + ); + const filter = await naiveRegistryFilterFixture( + owner.address, + await registry.getAddress(), + ); + + const tree = new LeanIMT(hash); + await registry.addCiphernode(AddressOne); + tree.insert(BigInt(AddressOne)); + await registry.addCiphernode(AddressTwo); + tree.insert(BigInt(AddressTwo)); + + return { + owner, + notTheOwner, + registry, + filter, + tree, + request: { + e3Id: 1, + filter: await filter.getAddress(), + threshold: [2, 2] as [number, number], + }, + }; + } + + describe("constructor / initialize()", function () { + it("correctly sets `_owner` and `enclave` ", async function () { + const poseidonFactory = await ethers.getContractFactory("PoseidonT3"); + const poseidonDeployment = await poseidonFactory.deploy(); + const [deployer] = await ethers.getSigners(); + const ciphernodeRegistryFactory = await ethers.getContractFactory( + "CiphernodeRegistryOwnable", + { + libraries: { + PoseidonT3: await poseidonDeployment.getAddress(), + }, + }, + ); + const ciphernodeRegistry = await ciphernodeRegistryFactory.deploy( + deployer.address, + AddressTwo, + ); + expect(await ciphernodeRegistry.owner()).to.equal(deployer.address); + expect(await ciphernodeRegistry.enclave()).to.equal(AddressTwo); + }); + }); + + describe("requestCommittee()", function () { + it("reverts if committee has already been requested for given e3Id", async function () { + const { registry, request } = await loadFixture(setup); + await registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ); + await expect( + registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ), + ).to.be.revertedWithCustomError(registry, "CommitteeAlreadyRequested"); + }); + it("stores the registry filter for the given e3Id", async function () { + const { registry, request } = await loadFixture(setup); + await registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ); + expect(await registry.getFilter(request.e3Id)).to.equal(request.filter); + }); + it("stores the root of the ciphernode registry at the time of the request", async function () { + const { registry, request } = await loadFixture(setup); + await registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ); + expect(await registry.rootAt(request.e3Id)).to.equal( + await registry.root(), + ); + }); + it("requests a committee from the given filter", async function () { + const { registry, request } = await loadFixture(setup); + await registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ); + expect(await registry.getFilter(request.e3Id)).to.equal(request.filter); + }); + it("emits a CommitteeRequested event", async function () { + const { registry, request } = await loadFixture(setup); + await expect( + registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ), + ) + .to.emit(registry, "CommitteeRequested") + .withArgs(request.e3Id, request.filter, request.threshold); + }); + it("reverts if filter.requestCommittee() fails", async function () { + const { owner, registry, filter, request } = await loadFixture(setup); + + await filter.setRegistry(owner.address); + await filter.requestCommittee(request.e3Id, request.threshold); + await filter.setRegistry(await registry.getAddress()); + + await expect( + registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ), + ).to.be.revertedWithCustomError(filter, "CommitteeAlreadyExists"); + }); + it("returns true if the request is successful", async function () { + const { registry, request } = await loadFixture(setup); + expect( + await registry.requestCommittee.staticCall( + request.e3Id, + request.filter, + request.threshold, + ), + ).to.be.true; + }); + }); + + describe("publishCommittee()", function () { + it("reverts if the caller is not the filter for the given e3Id", async function () { + const { registry, request } = await loadFixture(setup); + await registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ); + await expect( + registry.publishCommittee(request.e3Id, "0xc0de", "0xda7a"), + ).to.be.revertedWithCustomError(registry, "OnlyFilter"); + }); + it("stores the public key of the committee", async function () { + const { filter, registry, request } = await loadFixture(setup); + await registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ); + await filter.publishCommittee( + request.e3Id, + [AddressOne, AddressTwo], + "0xda7a", + ); + expect(await registry.committeePublicKey(request.e3Id)).to.equal( + "0xda7a", + ); + }); + it("emits a CommitteePublished event", async function () { + const { filter, registry, request } = await loadFixture(setup); + await registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ); + await expect( + await filter.publishCommittee( + request.e3Id, + [AddressOne, AddressTwo], + "0xda7a", + ), + ) + .to.emit(registry, "CommitteePublished") + .withArgs(request.e3Id, "0xda7a"); + }); + }); + + describe("addCiphernode()", function () { + it("reverts if the caller is not the owner", async function () { + const { registry, notTheOwner } = await loadFixture(setup); + await expect(registry.connect(notTheOwner).addCiphernode(AddressThree)) + .to.be.revertedWithCustomError(registry, "OwnableUnauthorizedAccount") + .withArgs(notTheOwner.address); + }); + it("adds the ciphernode to the registry", async function () { + const { registry } = await loadFixture(setup); + expect(await registry.addCiphernode(AddressThree)); + expect(await registry.isCiphernodeEligible(AddressThree)).to.be.true; + }); + it("increments numCiphernodes", async function () { + const { registry } = await loadFixture(setup); + const numCiphernodes = await registry.numCiphernodes(); + expect(await registry.addCiphernode(AddressThree)); + expect(await registry.numCiphernodes()).to.equal( + numCiphernodes + BigInt(1), + ); + }); + it("emits a CiphernodeAdded event", async function () { + const { registry } = await loadFixture(setup); + const treeSize = await registry.treeSize(); + const numCiphernodes = await registry.numCiphernodes(); + await expect(await registry.addCiphernode(AddressThree)) + .to.emit(registry, "CiphernodeAdded") + .withArgs( + AddressThree, + treeSize, + numCiphernodes + BigInt(1), + treeSize + BigInt(1), + ); + }); + }); + + describe("removeCiphernode()", function () { + it("reverts if the caller is not the owner", async function () { + const { registry, notTheOwner } = await loadFixture(setup); + await expect( + registry.connect(notTheOwner).removeCiphernode(AddressOne, []), + ) + .to.be.revertedWithCustomError(registry, "OwnableUnauthorizedAccount") + .withArgs(notTheOwner.address); + }); + it("removes the ciphernode from the registry", async function () { + const { registry, tree } = await loadFixture(setup); + const index = tree.indexOf(BigInt(AddressOne)); + const proof = tree.generateProof(index); + expect(await registry.isEnabled(AddressOne)).to.be.true; + expect(await registry.removeCiphernode(AddressOne, proof.siblings)); + expect(await registry.isEnabled(AddressOne)).to.be.false; + }); + it("decrements numCiphernodes", async function () { + const { registry, tree } = await loadFixture(setup); + const numCiphernodes = await registry.numCiphernodes(); + const index = tree.indexOf(BigInt(AddressOne)); + const proof = tree.generateProof(index); + expect(await registry.removeCiphernode(AddressOne, proof.siblings)); + expect(await registry.numCiphernodes()).to.equal( + numCiphernodes - BigInt(1), + ); + }); + it("emits a CiphernodeRemoved event", async function () { + const { registry, tree } = await loadFixture(setup); + const numCiphernodes = await registry.numCiphernodes(); + const size = await registry.treeSize(); + const index = tree.indexOf(BigInt(AddressOne)); + const proof = tree.generateProof(index); + await expect(registry.removeCiphernode(AddressOne, proof.siblings)) + .to.emit(registry, "CiphernodeRemoved") + .withArgs(AddressOne, index, numCiphernodes - BigInt(1), size); + }); + }); + + describe("setEnclave()", function () { + it("reverts if the caller is not the owner", async function () { + const { registry, notTheOwner } = await loadFixture(setup); + await expect( + registry.connect(notTheOwner).setEnclave(AddressThree), + ).to.be.revertedWithCustomError(registry, "OwnableUnauthorizedAccount"); + }); + it("sets the enclave address", async function () { + const { registry } = await loadFixture(setup); + expect(await registry.setEnclave(AddressThree)); + expect(await registry.enclave()).to.equal(AddressThree); + }); + it("emits an EnclaveSet event", async function () { + const { registry } = await loadFixture(setup); + await expect(await registry.setEnclave(AddressThree)) + .to.emit(registry, "EnclaveSet") + .withArgs(AddressThree); + }); + }); + + describe("committeePublicKey()", function () { + it("returns the public key of the committee for the given e3Id", async function () { + const { filter, registry, request } = await loadFixture(setup); + await registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ); + await filter.publishCommittee( + request.e3Id, + [AddressOne, AddressTwo], + "0xda7a", + ); + expect(await registry.committeePublicKey(request.e3Id)).to.equal( + "0xda7a", + ); + }); + it("reverts if the committee has not been published", async function () { + const { registry, request } = await loadFixture(setup); + await registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ); + await expect( + registry.committeePublicKey(request.e3Id), + ).to.be.revertedWithCustomError(registry, "CommitteeNotPublished"); + }); + }); + + describe("isCiphernodeEligible()", function () { + it("returns true if the ciphernode is in the registry", async function () { + const { registry } = await loadFixture(setup); + expect(await registry.isCiphernodeEligible(AddressOne)).to.be.true; + }); + it("returns false if the ciphernode is not in the registry", async function () { + const { registry } = await loadFixture(setup); + expect(await registry.isCiphernodeEligible(AddressThree)).to.be.false; + }); + }); + + describe("isEnabled()", function () { + it("returns true if the ciphernode is currently enabled", async function () { + const { registry } = await loadFixture(setup); + expect(await registry.isEnabled(AddressOne)).to.be.true; + }); + it("returns false if the ciphernode is not currently enabled", async function () { + const { registry } = await loadFixture(setup); + expect(await registry.isEnabled(AddressThree)).to.be.false; + }); + }); + + describe("root()", function () { + it("returns the root of the ciphernode registry merkle tree", async function () { + const { registry, tree } = await loadFixture(setup); + expect(await registry.root()).to.equal(tree.root); + }); + }); + + describe("rootAt()", function () { + it("returns the root of the ciphernode registry merkle tree at the given e3Id", async function () { + const { registry, tree, request } = await loadFixture(setup); + await registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ); + expect(await registry.rootAt(request.e3Id)).to.equal(tree.root); + }); + }); + + describe("getFilter()", function () { + it("returns the registry filter for the given e3Id", async function () { + const { registry, request } = await loadFixture(setup); + await registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ); + expect(await registry.getFilter(request.e3Id)).to.equal(request.filter); + }); + }); + + describe("treeSize()", function () { + it("returns the size of the ciphernode registry merkle tree", async function () { + const { registry, tree } = await loadFixture(setup); + expect(await registry.treeSize()).to.equal(tree.size); + }); + }); +}); diff --git a/packages/evm/test/CiphernodeRegistry/NaiveRegistryFilter.spec.ts b/packages/evm/test/CiphernodeRegistry/NaiveRegistryFilter.spec.ts new file mode 100644 index 00000000..f2faa038 --- /dev/null +++ b/packages/evm/test/CiphernodeRegistry/NaiveRegistryFilter.spec.ts @@ -0,0 +1,241 @@ +import { loadFixture } from "@nomicfoundation/hardhat-network-helpers"; +import { LeanIMT } from "@zk-kit/lean-imt"; +import { expect } from "chai"; +import { ethers } from "hardhat"; +import { poseidon2 } from "poseidon-lite"; + +import { deployCiphernodeRegistryOwnableFixture } from "../fixtures/CiphernodeRegistryOwnable.fixture"; +import { naiveRegistryFilterFixture } from "../fixtures/NaiveRegistryFilter.fixture"; +import { PoseidonT3Fixture } from "../fixtures/PoseidonT3.fixture"; + +const AddressOne = "0x0000000000000000000000000000000000000001"; +const AddressTwo = "0x0000000000000000000000000000000000000002"; +const AddressThree = "0x0000000000000000000000000000000000000003"; + +// Hash function used to compute the tree nodes. +const hash = (a: bigint, b: bigint) => poseidon2([a, b]); + +describe("NaiveRegistryFilter", function () { + async function setup() { + const [owner, notTheOwner] = await ethers.getSigners(); + + const poseidon = await PoseidonT3Fixture(); + const registry = await deployCiphernodeRegistryOwnableFixture( + owner.address, + owner.address, + await poseidon.getAddress(), + ); + const filter = await naiveRegistryFilterFixture( + owner.address, + await registry.getAddress(), + ); + + const tree = new LeanIMT(hash); + await registry.addCiphernode(AddressOne); + tree.insert(BigInt(AddressOne)); + await registry.addCiphernode(AddressTwo); + tree.insert(BigInt(AddressTwo)); + + return { + owner, + notTheOwner, + registry, + filter, + tree, + request: { + e3Id: 1, + filter: await filter.getAddress(), + threshold: [2, 2] as [number, number], + }, + }; + } + + describe("constructor / initialize()", function () { + it("should set the owner", async function () { + const { owner, filter } = await loadFixture(setup); + expect(await filter.owner()).to.equal(owner.address); + }); + it("should set the registry", async function () { + const { registry, filter } = await loadFixture(setup); + expect(await filter.registry()).to.equal(await registry.getAddress()); + }); + }); + + describe("requestCommittee()", function () { + it("should revert if the caller is not the registry", async function () { + const { notTheOwner, filter, request } = await loadFixture(setup); + await expect( + filter + .connect(notTheOwner) + .requestCommittee(request.e3Id, request.threshold), + ).to.be.revertedWithCustomError(filter, "OnlyRegistry"); + }); + it("should revert if a committee has already been requested for the given e3Id", async function () { + const { filter, request, owner } = await loadFixture(setup); + await filter.setRegistry(owner.address); + await filter.requestCommittee(request.e3Id, request.threshold); + await expect( + filter.requestCommittee(request.e3Id, request.threshold), + ).to.be.revertedWithCustomError(filter, "CommitteeAlreadyExists"); + }); + it("should set the threshold for the requested committee", async function () { + const { filter, owner, request } = await loadFixture(setup); + await filter.setRegistry(owner.address); + await filter.requestCommittee(request.e3Id, request.threshold); + const committee = await filter.getCommittee(request.e3Id); + expect(committee.threshold).to.deep.equal(request.threshold); + }); + it("should return true when a committee is requested", async function () { + const { filter, owner, request } = await loadFixture(setup); + await filter.setRegistry(owner.address); + const result = await filter.requestCommittee.staticCall( + request.e3Id, + request.threshold, + ); + expect(result).to.equal(true); + }); + }); + + describe("publishCommittee()", function () { + it("should revert if the caller is not owner", async function () { + const { filter, notTheOwner, request } = await loadFixture(setup); + await expect( + filter + .connect(notTheOwner) + .publishCommittee( + request.e3Id, + [AddressOne, AddressTwo], + AddressThree, + ), + ).to.be.revertedWithCustomError(filter, "OwnableUnauthorizedAccount"); + }); + it("should revert if committee already published", async function () { + const { filter, registry, request } = await loadFixture(setup); + expect( + await registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ), + ); + await filter.publishCommittee( + request.e3Id, + [AddressOne, AddressTwo], + AddressThree, + ); + await expect( + filter.publishCommittee( + request.e3Id, + [AddressOne, AddressTwo], + AddressThree, + ), + ).to.be.revertedWithCustomError(filter, "CommitteeAlreadyPublished"); + }); + it("should store the node addresses of the committee", async function () { + const { filter, registry, request } = await loadFixture(setup); + expect( + await registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ), + ); + await filter.publishCommittee( + request.e3Id, + [AddressOne, AddressTwo], + AddressThree, + ); + const committee = await filter.getCommittee(request.e3Id); + expect(committee.nodes).to.deep.equal([AddressOne, AddressTwo]); + }); + it("should store the public key of the committee", async function () { + const { filter, registry, request } = await loadFixture(setup); + expect( + await registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ), + ); + await filter.publishCommittee( + request.e3Id, + [AddressOne, AddressTwo], + AddressThree, + ); + const committee = await filter.getCommittee(request.e3Id); + expect(committee.publicKey).to.equal(AddressThree); + }); + it("should publish the correct node addresses of the committee for the given e3Id", async function () { + const { filter, registry, request } = await loadFixture(setup); + expect( + await registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ), + ); + await filter.publishCommittee( + request.e3Id, + [AddressOne, AddressTwo], + AddressThree, + ); + const committee = await filter.getCommittee(request.e3Id); + expect(committee.nodes).to.deep.equal([AddressOne, AddressTwo]); + }); + it("should publish the public key of the committee for the given e3Id", async function () { + const { filter, registry, request } = await loadFixture(setup); + expect( + await registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ), + ); + await filter.publishCommittee( + request.e3Id, + [AddressOne, AddressTwo], + AddressThree, + ); + const committee = await filter.getCommittee(request.e3Id); + expect(committee.publicKey).to.equal(AddressThree); + }); + }); + + describe("setRegistry()", function () { + it("should revert if the caller is not the owner", async function () { + const { filter, notTheOwner } = await loadFixture(setup); + await expect(filter.connect(notTheOwner).setRegistry(notTheOwner.address)) + .to.be.revertedWithCustomError(filter, "OwnableUnauthorizedAccount") + .withArgs(notTheOwner.address); + }); + it("should set the registry", async function () { + const { filter, owner } = await loadFixture(setup); + await filter.setRegistry(owner.address); + expect(await filter.registry()).to.equal(owner.address); + }); + }); + + describe("getCommittee()", function () { + it("should return the committee for the given e3Id", async function () { + const { filter, registry, request } = await loadFixture(setup); + expect( + await registry.requestCommittee( + request.e3Id, + request.filter, + request.threshold, + ), + ); + expect( + await filter.publishCommittee( + request.e3Id, + [AddressOne, AddressTwo], + AddressThree, + ), + ); + const committee = await filter.getCommittee(request.e3Id); + expect(committee.threshold).to.deep.equal(request.threshold); + expect(committee.nodes).to.deep.equal([AddressOne, AddressTwo]); + expect(committee.publicKey).to.equal(AddressThree); + }); + }); +}); diff --git a/packages/evm/test/Enclave.spec.ts b/packages/evm/test/Enclave.spec.ts index 773a1cc3..47244ec0 100644 --- a/packages/evm/test/Enclave.spec.ts +++ b/packages/evm/test/Enclave.spec.ts @@ -15,14 +15,23 @@ import { deployComputeProviderFixture } from "./fixtures/MockComputeProvider.fix import { deployDecryptionVerifierFixture } from "./fixtures/MockDecryptionVerifier.fixture"; import { deployE3ProgramFixture } from "./fixtures/MockE3Program.fixture"; import { deployInputValidatorFixture } from "./fixtures/MockInputValidator.fixture"; +import { PoseidonT3Fixture } from "./fixtures/PoseidonT3.fixture"; const abiCoder = ethers.AbiCoder.defaultAbiCoder(); const AddressTwo = "0x0000000000000000000000000000000000000002"; const AddressSix = "0x0000000000000000000000000000000000000006"; +const encryptionSchemeId = + "0x0000000000000000000000000000000000000000000000000000000000000001"; +const newEncryptionSchemeId = + "0x0000000000000000000000000000000000000000000000000000000000000002"; const FilterFail = AddressTwo; const FilterOkay = AddressSix; +const data = "0xda7a"; +const dataHash = ethers.keccak256(data); +const proof = "0x1337"; + // Hash function used to compute the tree nodes. const hash = (a: bigint, b: bigint) => poseidon2([a, b]); @@ -30,23 +39,27 @@ describe("Enclave", function () { async function setup() { const [owner, notTheOwner] = await ethers.getSigners(); + const poseidon = await PoseidonT3Fixture(); const registry = await deployCiphernodeRegistryFixture(); const e3Program = await deployE3ProgramFixture(); const decryptionVerifier = await deployDecryptionVerifierFixture(); const computeProvider = await deployComputeProviderFixture(); const inputValidator = await deployInputValidatorFixture(); - const enclave = await deployEnclaveFixture({ - owner, - registry: await registry.getAddress(), - }); + const enclave = await deployEnclaveFixture( + owner.address, + await registry.getAddress(), + await poseidon.getAddress(), + ); + await enclave.enableEncryptionScheme(encryptionSchemeId); await enclave.enableE3Program(await e3Program.getAddress()); return { owner, notTheOwner, enclave, + poseidon, mocks: { e3Program, decryptionVerifier, @@ -77,31 +90,20 @@ describe("Enclave", function () { describe("constructor / initialize()", function () { it("correctly sets owner", async function () { - const [, , , someSigner] = await ethers.getSigners(); - const enclave = await deployEnclaveFixture({ - owner: someSigner, - registry: AddressTwo, - }); - expect(await enclave.ciphernodeRegistry()).to.equal(AddressTwo); + const { owner, enclave } = await loadFixture(setup); + expect(await enclave.owner()).to.equal(owner.address); }); it("correctly sets ciphernodeRegistry address", async function () { - const [aSigner] = await ethers.getSigners(); - const enclave = await deployEnclaveFixture({ - owner: aSigner, - registry: AddressTwo, - }); - expect(await enclave.ciphernodeRegistry()).to.equal(AddressTwo); + const { mocks, enclave } = await loadFixture(setup); + expect(await enclave.ciphernodeRegistry()).to.equal( + await mocks.registry.getAddress(), + ); }); it("correctly sets max duration", async function () { - const [aSigner] = await ethers.getSigners(); - const enclave = await deployEnclaveFixture({ - owner: aSigner, - registry: AddressTwo, - maxDuration: 9876, - }); - expect(await enclave.maxDuration()).to.equal(9876); + const { enclave } = await loadFixture(setup); + expect(await enclave.maxDuration()).to.equal(60 * 60 * 24 * 30); }); }); @@ -210,8 +212,89 @@ describe("Enclave", function () { abiCoder.decode(["address"], request.computeProviderParams)[0], ); expect(e3.committeePublicKey).to.equal("0x"); - expect(e3.ciphertextOutput).to.equal("0x"); - expect(e3.plaintextOutput).to.equal("0x"); + expect(e3.ciphertextOutput).to.equal(ethers.ZeroHash); + expect(e3.plaintextOutput).to.equal(ethers.ZeroHash); + }); + }); + + describe("isEncryptionSchemeEnabled()", function () { + it("returns true if encryption scheme is enabled", async function () { + const { enclave } = await loadFixture(setup); + expect(await enclave.isEncryptionSchemeEnabled(encryptionSchemeId)).to.be + .true; + }); + it("returns false if encryption scheme is not enabled", async function () { + const { enclave } = await loadFixture(setup); + expect(await enclave.isEncryptionSchemeEnabled(newEncryptionSchemeId)).to + .be.false; + }); + }); + + describe("enableEncryptionScheme()", function () { + it("reverts if caller is not owner", async function () { + const { enclave, notTheOwner } = await loadFixture(setup); + + await expect( + enclave.connect(notTheOwner).enableEncryptionScheme(encryptionSchemeId), + ) + .to.be.revertedWithCustomError(enclave, "OwnableUnauthorizedAccount") + .withArgs(notTheOwner); + }); + it("reverts if encryption scheme is already enabled", async function () { + const { enclave } = await loadFixture(setup); + + await expect(enclave.enableEncryptionScheme(encryptionSchemeId)) + .to.be.revertedWithCustomError(enclave, "InvalidEncryptionScheme") + .withArgs(encryptionSchemeId); + }); + it("enabled encryption scheme", async function () { + const { enclave } = await loadFixture(setup); + + expect(await enclave.enableEncryptionScheme(newEncryptionSchemeId)); + expect(await enclave.isEncryptionSchemeEnabled(newEncryptionSchemeId)).to + .be.true; + }); + it("emits EncryptionSchemeEnabled", async function () { + const { enclave } = await loadFixture(setup); + + await expect(await enclave.enableEncryptionScheme(newEncryptionSchemeId)) + .to.emit(enclave, "EncryptionSchemeEnabled") + .withArgs(newEncryptionSchemeId); + }); + }); + + describe("disableEncryptionScheme()", function () { + it("reverts if caller is not owner", async function () { + const { enclave, notTheOwner } = await loadFixture(setup); + + await expect( + enclave + .connect(notTheOwner) + .disableEncryptionScheme(encryptionSchemeId), + ) + .to.be.revertedWithCustomError(enclave, "OwnableUnauthorizedAccount") + .withArgs(notTheOwner); + }); + it("reverts if encryption scheme is not already enabled", async function () { + const { enclave } = await loadFixture(setup); + + await expect(enclave.disableEncryptionScheme(newEncryptionSchemeId)) + .to.be.revertedWithCustomError(enclave, "InvalidEncryptionScheme") + .withArgs(newEncryptionSchemeId); + }); + it("disables encryption scheme", async function () { + const { enclave } = await loadFixture(setup); + + expect(await enclave.disableEncryptionScheme(encryptionSchemeId)); + expect(await enclave.isEncryptionSchemeEnabled(encryptionSchemeId)).to.be + .false; + }); + it("emits EncryptionSchemeDisabled", async function () { + const { enclave } = await loadFixture(setup); + + await expect(await enclave.disableEncryptionScheme(encryptionSchemeId)) + .to.emit(enclave, "EncryptionSchemeDisabled") + .withArgs(encryptionSchemeId); }); }); @@ -397,7 +480,25 @@ describe("Enclave", function () { .to.be.revertedWithCustomError(enclave, "E3ProgramNotAllowed") .withArgs(ethers.ZeroAddress); }); - it("reverts if input E3 Program does not return input validator address", async function () { + it("reverts if given encryption scheme is not enabled", async function () { + const { enclave, request } = await loadFixture(setup); + await enclave.disableEncryptionScheme(encryptionSchemeId); + await expect( + enclave.request( + request.filter, + request.threshold, + request.startTime, + request.duration, + request.e3Program, + ZeroHash, + request.computeProviderParams, + { value: 10 }, + ), + ) + .to.be.revertedWithCustomError(enclave, "InvalidEncryptionScheme") + .withArgs(encryptionSchemeId); + }); + it("reverts if given E3 Program does not return input validator address", async function () { const { enclave, request } = await loadFixture(setup); await expect( @@ -413,7 +514,7 @@ describe("Enclave", function () { ), ).to.be.revertedWithCustomError(enclave, "InvalidComputationRequest"); }); - it("reverts if input compute provider does not return output verifier address", async function () { + it("reverts if given compute provider does not return output verifier address", async function () { const { enclave, request } = await loadFixture(setup); await expect( enclave.request( @@ -467,8 +568,8 @@ describe("Enclave", function () { abiCoder.decode(["address"], request.computeProviderParams)[0], ); expect(e3.committeePublicKey).to.equal("0x"); - expect(e3.ciphertextOutput).to.equal("0x"); - expect(e3.plaintextOutput).to.equal("0x"); + expect(e3.ciphertextOutput).to.equal(ethers.ZeroHash); + expect(e3.plaintextOutput).to.equal(ethers.ZeroHash); }); it("emits E3Requested event", async function () { const { enclave, request } = await loadFixture(setup); @@ -808,6 +909,7 @@ describe("Enclave", function () { true, ); }); + it("adds inputHash to merkle tree", async function () { const { enclave, request } = await loadFixture(setup); const inputData = abiCoder.encode(["bytes"], ["0xaabbccddeeff"]); @@ -870,7 +972,7 @@ describe("Enclave", function () { it("reverts if E3 does not exist", async function () { const { enclave } = await loadFixture(setup); - await expect(enclave.publishCiphertextOutput(0, "0x")) + await expect(enclave.publishCiphertextOutput(0, "0x", "0x")) .to.be.revertedWithCustomError(enclave, "E3DoesNotExist") .withArgs(0); }); @@ -888,7 +990,7 @@ describe("Enclave", function () { request.computeProviderParams, { value: 10 }, ); - await expect(enclave.publishCiphertextOutput(e3Id, "0x")) + await expect(enclave.publishCiphertextOutput(e3Id, "0x", "0x")) .to.be.revertedWithCustomError(enclave, "E3NotActivated") .withArgs(e3Id); }); @@ -911,7 +1013,7 @@ describe("Enclave", function () { await enclave.activate(e3Id); - await expect(enclave.publishCiphertextOutput(e3Id, "0x")) + await expect(enclave.publishCiphertextOutput(e3Id, "0x", "0x")) .to.be.revertedWithCustomError(enclave, "InputDeadlineNotPassed") .withArgs(e3Id, expectedExpiration); }); @@ -931,8 +1033,8 @@ describe("Enclave", function () { ); await enclave.activate(e3Id); await mine(2, { interval: request.duration }); - expect(await enclave.publishCiphertextOutput(e3Id, "0x1337")); - await expect(enclave.publishCiphertextOutput(e3Id, "0x1337")) + expect(await enclave.publishCiphertextOutput(e3Id, data, proof)); + await expect(enclave.publishCiphertextOutput(e3Id, data, proof)) .to.be.revertedWithCustomError( enclave, "CiphertextOutputAlreadyPublished", @@ -956,7 +1058,7 @@ describe("Enclave", function () { await enclave.activate(e3Id); await mine(2, { interval: request.duration }); await expect( - enclave.publishCiphertextOutput(e3Id, "0x"), + enclave.publishCiphertextOutput(e3Id, "0x", "0x"), ).to.be.revertedWithCustomError(enclave, "InvalidOutput"); }); it("sets ciphertextOutput correctly", async function () { @@ -975,9 +1077,9 @@ describe("Enclave", function () { ); await enclave.activate(e3Id); await mine(2, { interval: request.duration }); - expect(await enclave.publishCiphertextOutput(e3Id, "0x1337")); + expect(await enclave.publishCiphertextOutput(e3Id, data, proof)); const e3 = await enclave.getE3(e3Id); - expect(e3.ciphertextOutput).to.equal("0x1337"); + expect(e3.ciphertextOutput).to.equal(dataHash); }); it("returns true if output is published successfully", async function () { const { enclave, request } = await loadFixture(setup); @@ -996,7 +1098,7 @@ describe("Enclave", function () { await enclave.activate(e3Id); await mine(2, { interval: request.duration }); expect( - await enclave.publishCiphertextOutput.staticCall(e3Id, "0x1337"), + await enclave.publishCiphertextOutput.staticCall(e3Id, data, proof), ).to.equal(true); }); it("emits CiphertextOutputPublished event", async function () { @@ -1015,9 +1117,9 @@ describe("Enclave", function () { ); await enclave.activate(e3Id); await mine(2, { interval: request.duration }); - await expect(enclave.publishCiphertextOutput(e3Id, "0x1337")) + await expect(enclave.publishCiphertextOutput(e3Id, data, proof)) .to.emit(enclave, "CiphertextOutputPublished") - .withArgs(e3Id, "0x1337"); + .withArgs(e3Id, data); }); }); @@ -1026,7 +1128,7 @@ describe("Enclave", function () { const { enclave } = await loadFixture(setup); const e3Id = 0; - await expect(enclave.publishPlaintextOutput(e3Id, "0x")) + await expect(enclave.publishPlaintextOutput(e3Id, data, "0x")) .to.be.revertedWithCustomError(enclave, "E3DoesNotExist") .withArgs(e3Id); }); @@ -1044,7 +1146,7 @@ describe("Enclave", function () { request.computeProviderParams, { value: 10 }, ); - await expect(enclave.publishPlaintextOutput(e3Id, "0x")) + await expect(enclave.publishPlaintextOutput(e3Id, data, "0x")) .to.be.revertedWithCustomError(enclave, "E3NotActivated") .withArgs(e3Id); }); @@ -1063,7 +1165,7 @@ describe("Enclave", function () { { value: 10 }, ); await enclave.activate(e3Id); - await expect(enclave.publishPlaintextOutput(e3Id, "0x")) + await expect(enclave.publishPlaintextOutput(e3Id, data, "0x")) .to.be.revertedWithCustomError(enclave, "CiphertextOutputNotPublished") .withArgs(e3Id); }); @@ -1083,9 +1185,9 @@ describe("Enclave", function () { ); await enclave.activate(e3Id); await mine(2, { interval: request.duration }); - await enclave.publishCiphertextOutput(e3Id, "0x1337"); - await enclave.publishPlaintextOutput(e3Id, "0x1337"); - await expect(enclave.publishPlaintextOutput(e3Id, "0x1337")) + await enclave.publishCiphertextOutput(e3Id, data, proof); + await enclave.publishPlaintextOutput(e3Id, data, proof); + await expect(enclave.publishPlaintextOutput(e3Id, data, proof)) .to.be.revertedWithCustomError( enclave, "PlaintextOutputAlreadyPublished", @@ -1108,10 +1210,10 @@ describe("Enclave", function () { ); await enclave.activate(e3Id); await mine(2, { interval: request.duration }); - await enclave.publishCiphertextOutput(e3Id, "0x1337"); - await expect(enclave.publishPlaintextOutput(e3Id, "0x")) + await enclave.publishCiphertextOutput(e3Id, data, proof); + await expect(enclave.publishPlaintextOutput(e3Id, data, "0x")) .to.be.revertedWithCustomError(enclave, "InvalidOutput") - .withArgs("0x"); + .withArgs(data); }); it("sets plaintextOutput correctly", async function () { const { enclave, request } = await loadFixture(setup); @@ -1129,11 +1231,11 @@ describe("Enclave", function () { ); await enclave.activate(e3Id); await mine(2, { interval: request.duration }); - await enclave.publishCiphertextOutput(e3Id, "0x1337"); - expect(await enclave.publishPlaintextOutput(e3Id, "0x1337")); + await enclave.publishCiphertextOutput(e3Id, data, proof); + expect(await enclave.publishPlaintextOutput(e3Id, data, proof)); const e3 = await enclave.getE3(e3Id); - expect(e3.plaintextOutput).to.equal("0x1337"); + expect(e3.plaintextOutput).to.equal(dataHash); }); it("returns true if output is published successfully", async function () { const { enclave, request } = await loadFixture(setup); @@ -1151,9 +1253,9 @@ describe("Enclave", function () { ); await enclave.activate(e3Id); await mine(2, { interval: request.duration }); - await enclave.publishCiphertextOutput(e3Id, "0x1337"); + await enclave.publishCiphertextOutput(e3Id, data, proof); expect( - await enclave.publishPlaintextOutput.staticCall(e3Id, "0x1337"), + await enclave.publishPlaintextOutput.staticCall(e3Id, data, proof), ).to.equal(true); }); it("emits PlaintextOutputPublished event", async function () { @@ -1172,10 +1274,10 @@ describe("Enclave", function () { ); await enclave.activate(e3Id); await mine(2, { interval: request.duration }); - await enclave.publishCiphertextOutput(e3Id, "0x1337"); - await expect(enclave.publishPlaintextOutput(e3Id, "0x1337")) + await enclave.publishCiphertextOutput(e3Id, data, proof); + await expect(await enclave.publishPlaintextOutput(e3Id, data, proof)) .to.emit(enclave, "PlaintextOutputPublished") - .withArgs(e3Id, "0x1337"); + .withArgs(e3Id, data); }); }); }); diff --git a/packages/evm/test/fixtures/CiphernodeRegistryOwnable.fixture.ts b/packages/evm/test/fixtures/CiphernodeRegistryOwnable.fixture.ts new file mode 100644 index 00000000..3189186e --- /dev/null +++ b/packages/evm/test/fixtures/CiphernodeRegistryOwnable.fixture.ts @@ -0,0 +1,24 @@ +import { ethers } from "hardhat"; + +import { CiphernodeRegistryOwnable__factory } from "../../types"; + +export async function deployCiphernodeRegistryOwnableFixture( + owner: string, + enclave: string, + poseidonT3: string, + name?: string, +) { + const [signer] = await ethers.getSigners(); + const deployment = await ( + await ethers.getContractFactory(name || "CiphernodeRegistryOwnable", { + libraries: { + PoseidonT3: poseidonT3, + }, + }) + ).deploy(owner, enclave); + + return CiphernodeRegistryOwnable__factory.connect( + await deployment.getAddress(), + signer, + ); +} diff --git a/packages/evm/test/fixtures/Enclave.fixture.ts b/packages/evm/test/fixtures/Enclave.fixture.ts index aee379e0..b5d9087c 100644 --- a/packages/evm/test/fixtures/Enclave.fixture.ts +++ b/packages/evm/test/fixtures/Enclave.fixture.ts @@ -1,27 +1,21 @@ -import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { ethers } from "hardhat"; import { Enclave__factory } from "../../types/factories/contracts/Enclave__factory"; -export async function deployEnclaveFixture({ - owner, - registry, - maxDuration = 60 * 60 * 24 * 30, -}: { - owner: SignerWithAddress; - registry: string; - maxDuration?: number; -}) { - const poseidonFactory = await ethers.getContractFactory("PoseidonT3"); - const poseidonDeployment = await poseidonFactory.deploy(); - +export async function deployEnclaveFixture( + owner: string, + registry: string, + poseidonT3: string, + maxDuration?: number, +) { + const [signer] = await ethers.getSigners(); const deployment = await ( await ethers.getContractFactory("Enclave", { libraries: { - PoseidonT3: await poseidonDeployment.getAddress(), + PoseidonT3: poseidonT3, }, }) - ).deploy(owner, registry, maxDuration); + ).deploy(owner, registry, maxDuration || 60 * 60 * 24 * 30); - return Enclave__factory.connect(await deployment.getAddress(), owner); + return Enclave__factory.connect(await deployment.getAddress(), signer); } diff --git a/packages/evm/test/fixtures/NaiveRegistryFilter.fixture.ts b/packages/evm/test/fixtures/NaiveRegistryFilter.fixture.ts new file mode 100644 index 00000000..64bc8c1c --- /dev/null +++ b/packages/evm/test/fixtures/NaiveRegistryFilter.fixture.ts @@ -0,0 +1,19 @@ +import { ethers } from "hardhat"; + +import { NaiveRegistryFilter__factory } from "../../types"; + +export async function naiveRegistryFilterFixture( + owner: string, + registry: string, + name?: string, +) { + const [signer] = await ethers.getSigners(); + const deployment = await ( + await ethers.getContractFactory(name || "NaiveRegistryFilter") + ).deploy(owner, registry); + + return NaiveRegistryFilter__factory.connect( + await deployment.getAddress(), + signer, + ); +} diff --git a/packages/evm/test/fixtures/PoseidonT3.fixture.ts b/packages/evm/test/fixtures/PoseidonT3.fixture.ts new file mode 100644 index 00000000..471339c9 --- /dev/null +++ b/packages/evm/test/fixtures/PoseidonT3.fixture.ts @@ -0,0 +1,15 @@ +import { ethers } from "hardhat"; + +import { PoseidonT3__factory } from "../../types"; + +export async function PoseidonT3Fixture(name?: string) { + const [signer] = await ethers.getSigners(); + const deployment = await ( + await ethers.getContractFactory(name || "PoseidonT3") + ).deploy(); + + return PoseidonT3__factory.connect( + await deployment.getAddress(), + signer.provider, + ); +} diff --git a/packages/evm/yarn.lock b/packages/evm/yarn.lock index f681baac..709ecbf8 100644 --- a/packages/evm/yarn.lock +++ b/packages/evm/yarn.lock @@ -4318,10 +4318,10 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" -solc@0.8.27: - version "0.8.27" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.27.tgz#cb8e7246cceadad8df65ceccffe640e106106bb4" - integrity sha512-BNxMol2tUAbkH7HKlXBcBqrGi2aqgv+uMHz26mJyTtlVgWmBA4ktiw0qVKHfkjf2oaHbwtbtaSeE2dhn/gTAKw== +solc@0.8.26: + version "0.8.26" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.26.tgz#afc78078953f6ab3e727c338a2fefcd80dd5b01a" + integrity sha512-yiPQNVf5rBFHwN6SIf3TUUvVAFKcQqmSUFeq+fb6pNRCo0ZCgpYOZDi3BVoezCPIAcKrVYd/qXlBLUP9wVrZ9g== dependencies: command-exists "^1.2.8" commander "^8.1.0" @@ -4442,7 +4442,16 @@ string-format@^2.0.0: resolved "https://registry.yarnpkg.com/string-format/-/string-format-2.0.0.tgz#f2df2e7097440d3b65de31b6d40d54c96eaffb9b" integrity sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA== -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -4467,7 +4476,14 @@ string_decoder@^1.1.1: dependencies: safe-buffer "~5.2.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -4861,7 +4877,16 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==