SmtLib updates#443
Open
daveroga wants to merge 18 commits into
Open
Conversation
Coverage Report for CI Build 27819600194Coverage decreased (-0.2%) to 85.224%Details
Uncovered Changes
Coverage Regressions12 previously-covered lines in 2 files lost coverage.
Coverage Stats
💛 - Coveralls |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Sparse Merkle Tree (SMT) implementation to support configurable hashing and adds new SMT leaf mutation capabilities, along with broad test/script adjustments to the Hardhat 3 runtime setup.
Changes:
- Added
updateLeafandremoveLeafsupport toSmtLib, plus new/expanded SMT tests (Poseidon + new Keccak test suite). - Introduced configurable hashing via
IHasherwithPoseidonHasherandKeccak256Hasherimplementations, and wired hasher injection throughState/ identity initialization paths and Ignition modules. - Updated tests and operational scripts to use
hre.network.create()instead ofnetwork.connect().
Reviewed changes
Copilot reviewed 101 out of 101 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/verifier/verifier.test.ts | Switches Hardhat runtime initialization to hre.network.create() in verifier tests. |
| test/verifier/validatorWhitelist.test.ts | Switches Hardhat runtime initialization to hre.network.create() in whitelist tests. |
| test/verifier/universal-verifier.test.ts | Switches Hardhat runtime initialization to hre.network.create() in universal verifier tests. |
| test/verifier/requestOwnership.test.ts | Switches Hardhat runtime initialization to hre.network.create() in request-ownership tests. |
| test/verifier/requestDisableable.test.ts | Switches Hardhat runtime initialization to hre.network.create() in request-disableable tests. |
| test/verifier/embedded-verifier.test.ts | Switches Hardhat runtime initialization to hre.network.create() in embedded verifier tests. |
| test/validators/v3/index.ts | Switches Hardhat runtime initialization to hre.network.create() in v3 validator tests. |
| test/validators/v3-stable/index.ts | Switches Hardhat runtime initialization to hre.network.create() in v3-stable validator tests. |
| test/validators/sig/index.ts | Switches Hardhat runtime initialization to hre.network.create() in signature validator tests. |
| test/validators/mtp/index.ts | Switches Hardhat runtime initialization to hre.network.create() in MTP validator tests. |
| test/validators/linked-multi-query/linked-multi-query10.test.ts | Switches Hardhat runtime initialization to hre.network.create() in linked multi-query tests. |
| test/validators/linked-multi-query/linked-multi-query-stable.test.ts | Switches Hardhat runtime initialization to hre.network.create() in linked multi-query stable tests. |
| test/validators/eth-identity/index.ts | Switches Hardhat runtime initialization to hre.network.create() in eth-identity validator tests. |
| test/validators/authv3/index.ts | Switches Hardhat runtime initialization to hre.network.create() in authv3 validator tests. |
| test/validators/authv3-8-32/index.ts | Switches Hardhat runtime initialization to hre.network.create() in authv3-8-32 validator tests. |
| test/validators/authv2/index.ts | Switches Hardhat runtime initialization to hre.network.create() in authv2 validator tests. |
| test/utils/packData.ts | Switches Hardhat runtime initialization to hre.network.create() for packing utilities used in tests. |
| test/utils/id-calculation-utils.ts | Switches Hardhat runtime initialization to hre.network.create() for ID calculation helpers. |
| test/stateLib/stateLib.test.ts | Switches Hardhat runtime initialization to hre.network.create() in StateLib tests. |
| test/state/state.test.ts | Switches Hardhat runtime initialization to hre.network.create() in State contract tests. |
| test/smtLib/smtLib.poseidon.test.ts | Updates Poseidon SMT tests; adds update/remove leaf test cases and minor timing tweaks. |
| test/smtLib/smtLib.keccak.test.ts | Adds a full SMT test suite for Keccak-based hashing. |
| test/reverseHash/reverseHash.test.ts | Switches Hardhat runtime initialization to hre.network.create() in reverse-hash tests. |
| test/primitiveUtils/primitiveUtils.test.ts | Switches Hardhat runtime initialization to hre.network.create() in primitive utils tests. |
| test/poseidon/poseidon.test.ts | Switches Hardhat runtime initialization to hre.network.create() in poseidon tests. |
| test/payment/vc-payment.test.ts | Switches Hardhat runtime initialization to hre.network.create() in VC payment tests. |
| test/payment/mc-payment.test.ts | Switches Hardhat runtime initialization to hre.network.create() in MC payment tests. |
| test/onchain-identity/onchain-identity.test.ts | Switches Hardhat runtime initialization to hre.network.create() in onchain identity tests. |
| test/onchain-identity/claim-builder.test.ts | Switches Hardhat runtime initialization to hre.network.create() in claim-builder tests. |
| test/integration-tests/integration-verifier.test.ts | Switches Hardhat runtime initialization to hre.network.create() in integration verifier tests. |
| test/IdentityTreeStore/IdentityTreeStore.test.ts | Switches Hardhat runtime initialization to hre.network.create() in IdentityTreeStore tests. |
| test/get-own-unified-addresses.test.ts | Switches Hardhat runtime initialization to hre.network.create() in unified-address helper test. |
| test/genesisUtils/genesisUtils.test.ts | Switches Hardhat runtime initialization to hre.network.create() in genesis utils tests. |
| test/disable-proxy.test.ts | Switches Hardhat runtime initialization to hre.network.create() in disable-proxy tests. |
| test/cross-chain/cross-chain-proof-validator.test.ts | Switches Hardhat runtime initialization to hre.network.create() in cross-chain proof validator tests. |
| test/check-unified-addresses.test.ts | Switches Hardhat runtime initialization to hre.network.create() in unified-address check test. |
| scripts/upgrade/verifiers/universal-verifier-upgrade.ts | Switches Hardhat runtime initialization to hre.network.create() in verifier upgrade script. |
| scripts/upgrade/verifiers/helpers/testVerifier.ts | Switches Hardhat runtime initialization to hre.network.create() in verifier helper script. |
| scripts/upgrade/verifiers/embedded-verifier-upgrade.ts | Switches Hardhat runtime initialization to hre.network.create() in embedded verifier upgrade script. |
| scripts/upgrade/validators/validators-upgrade.ts | Switches Hardhat runtime initialization to hre.network.create() in validators upgrade script. |
| scripts/upgrade/state/state-upgrade.ts | Switches Hardhat runtime initialization to hre.network.create() in state upgrade script. |
| scripts/upgrade/payments/vcPayment-upgrade.ts | Switches Hardhat runtime initialization to hre.network.create() in VC payment upgrade script. |
| scripts/upgrade/payments/mcPayment-upgrade.ts | Switches Hardhat runtime initialization to hre.network.create() in MC payment upgrade script. |
| scripts/upgrade/identitytreestore/identitytreestore-upgrade.ts | Switches Hardhat runtime initialization to hre.network.create() in ITS upgrade script. |
| scripts/upgrade/helpers/utils.ts | Switches Hardhat runtime initialization to hre.network.create() in upgrade helper utilities. |
| scripts/maintenance/setSupportedIdTypes.ts | Switches Hardhat runtime initialization to hre.network.create() in maintenance script. |
| scripts/maintenance/setProofRequest.ts | Switches Hardhat runtime initialization to hre.network.create() in maintenance script. |
| scripts/maintenance/setPaymentValue.ts | Switches Hardhat runtime initialization to hre.network.create() and updates TypeChain import path. |
| scripts/maintenance/setOracleSigningAddress.ts | Switches Hardhat runtime initialization to hre.network.create() in maintenance script. |
| scripts/maintenance/multi-chain/checkValidatorsUniversalVerifier.ts | Switches Hardhat runtime initialization to hre.network.create() and minor formatting. |
| scripts/maintenance/multi-chain/checkUnifiedContracts.ts | Switches Hardhat runtime initialization to hre.network.create() in multi-chain maintenance. |
| scripts/maintenance/multi-chain/checkOracleSigningAddress.ts | Switches Hardhat runtime initialization to hre.network.create() in multi-chain maintenance. |
| scripts/maintenance/multi-chain/checkIdTypes.ts | Switches Hardhat runtime initialization to hre.network.create() in multi-chain maintenance. |
| scripts/maintenance/getContractsAt.ts | Switches Hardhat runtime initialization to hre.network.create() in maintenance script. |
| scripts/maintenance/disableProxyContract.ts | Switches Hardhat runtime initialization to hre.network.create() in maintenance script. |
| scripts/maintenance/disableLegacySigningAddressOfCrossChainValidator.ts | Switches Hardhat runtime initialization to hre.network.create() in maintenance script. |
| scripts/maintenance/computeCreate2Address.ts | Switches Hardhat runtime initialization to hre.network.create() in maintenance script. |
| scripts/maintenance/checkUniversalVerifierSingleNetwork.ts | Switches Hardhat runtime initialization to hre.network.create() in maintenance script. |
| scripts/maintenance/checkUniversalVerifierCustomNetwork.ts | Switches Hardhat runtime initialization to hre.network.create() in maintenance script. |
| scripts/maintenance/addValidatorsToUniversalVerifier.ts | Switches Hardhat runtime initialization to hre.network.create() in maintenance script. |
| scripts/deploy/linkValidatorsToUniversalVerifier.ts | Switches Hardhat runtime initialization to hre.network.create() and refactors tx call formatting. |
| scripts/deploy/deployVCPayment.ts | Switches Hardhat runtime initialization to hre.network.create() in deploy script. |
| scripts/deploy/deployValidators.ts | Switches Hardhat runtime initialization to hre.network.create() in deploy script. |
| scripts/deploy/deployUniversalVerifier.ts | Switches Hardhat runtime initialization to hre.network.create() in deploy script. |
| scripts/deploy/deployState.ts | Switches Hardhat runtime initialization to hre.network.create() in deploy script. |
| scripts/deploy/deployment-step-2/deployValidators.ts | Switches Hardhat runtime initialization to hre.network.create() in step-2 deploy script. |
| scripts/deploy/deployment-step-2/deployUniversalVerifier.ts | Switches Hardhat runtime initialization to hre.network.create() in step-2 deploy script. |
| scripts/deploy/deployment-step-2/deploySystem.ts | Switches Hardhat runtime initialization to hre.network.create() in step-2 deploy script. |
| scripts/deploy/deployment-step-1/deployValidators.ts | Switches Hardhat runtime initialization to hre.network.create() in step-1 deploy script. |
| scripts/deploy/deployment-step-1/deployUniversalVerifier.ts | Switches Hardhat runtime initialization to hre.network.create() in step-1 deploy script. |
| scripts/deploy/deployment-step-1/deploySystem.ts | Adds PoseidonHasher deployment wiring and switches Hardhat runtime initialization to hre.network.create(). |
| scripts/deploy/deployMCPayment.ts | Switches Hardhat runtime initialization to hre.network.create() in deploy script. |
| scripts/deploy/deployLibraries.ts | Switches Hardhat runtime initialization to hre.network.create() in deploy script. |
| scripts/deploy/deployIdentityTreeStore.ts | Switches Hardhat runtime initialization to hre.network.create() in deploy script. |
| scripts/deploy/deployIdentityExample.ts | Switches Hardhat runtime initialization to hre.network.create() in deploy script. |
| scripts/deploy/deployEverythingBasicStrategy.ts | Switches Hardhat runtime initialization to hre.network.create() and adjusts deployed contract list. |
| scripts/deploy/deployCrossChainProofValidator.ts | Switches Hardhat runtime initialization to hre.network.create() in deploy script. |
| scripts/deploy/deployCreateX.ts | Switches Hardhat runtime initialization to hre.network.create() in deploy script. |
| scripts/deploy/deployCreate2AddressAnchor.ts | Switches Hardhat runtime initialization to hre.network.create() in deploy script. |
| ignition/modules/state.ts | Wires PoseidonHasher into State module initialization wiring. |
| ignition/modules/libraries.ts | Adds PoseidonHasher module and adjusts SMT library module deployment strategy. |
| ignition/modules/deployment/deploySystemFinalImplementations.ts | Switches Hardhat runtime initialization to hre.network.create() for final implementations deploy flow. |
| ignition/modules/deployEverythingBasicStrategy/universalVerifier.ts | Propagates PoseidonHasher dependency from State module into universal verifier module outputs. |
| ignition/modules/deployEverythingBasicStrategy/testHelpers.ts | Updates SMT/BinarySearch test helper wrappers to accept an injected hasher; adds Keccak wrapper module. |
| ignition/modules/deployEverythingBasicStrategy/state.ts | Injects PoseidonHasher into State implementation initialization and module outputs. |
| ignition/modules/deployEverythingBasicStrategy/libraries.ts | Adds PoseidonHasher and Keccak hasher deployment modules; decouples SmtLib deployment. |
| ignition/modules/deployEverythingBasicStrategy/identityExample.ts | Updates IdentityExample initialization to pass hasher to IdentityBase. |
| ignition/modules/deployEverythingBasicStrategy/deployEverythingBasicStrategy.ts | Propagates PoseidonHasher through system deployment outputs; removes many-responses-per-user wrapper wiring. |
| ignition/modules/contractsAt.ts | Adds PoseidonHasherAtModule for attaching to deployed PoseidonHasher. |
| helpers/helperUtils.ts | Switches Hardhat runtime initialization to hre.network.create() for helper utilities. |
| helpers/constants.ts | Switches Hardhat runtime initialization to hre.network.create(), bumps State version, adds PoseidonHasher contract info. |
| contracts/test-helpers/SmtLibTestWrapper.sol | Updates wrapper to inject a hasher and expose update/remove wrappers. |
| contracts/test-helpers/IdentityExample.sol | Updates initializer to accept hasher and pass through to IdentityBase. |
| contracts/test-helpers/BinarySearchTestWrapper.sol | Updates wrapper to inject a hasher for SMT initialization. |
| contracts/state/State.sol | Adds hasher dependency into State initialization and initializes GIST SMT with injected hasher. |
| contracts/lib/SmtLib.sol | Adds configurable hasher storage, updateLeaf/removeLeaf, and collision-safe node insertion behavior. |
| contracts/lib/IdentityLib.sol | Injects hasher into identity SMT tree initialization. |
| contracts/lib/IdentityBase.sol | Extends initialization to accept hasher and pass into IdentityLib initialization. |
| contracts/lib/hash/PoseidonHasher.sol | Adds Poseidon-based IHasher implementation. |
| contracts/lib/hash/KeccakHasher.sol | Adds Keccak-based IHasher implementation. |
| contracts/interfaces/IHasher.sol | Introduces IHasher interface for pluggable SMT hashing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a16fa32 to
338ff6d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
updateLeaf,removeLeafwith corresponding tests