Skip to content
This repository was archived by the owner on Apr 19, 2023. It is now read-only.

Latest commit

 

History

History
22 lines (18 loc) · 1.06 KB

README.md

File metadata and controls

22 lines (18 loc) · 1.06 KB

Merkle proof optimisation

To run the tests, install foundry and run forge test from the root of this repository.

To get an estimate of the gas consumption of each test, see the output from forge test. Each passing test produces a line ending in (gas: _). Alternatively, run forge snapshot and view the results.

Changing the leaves used

  • Update the leaves & leafIndex in the test data generator, optionally changing the leafEncoding if necessary.
  • Ensure pnpm is installed and run the test data generator from its directory with cd test/data/ && pnpm start && cd -.
  • Use the output of the test data generator to update the following variables in the tests:
    • At the top level of the contract:
      • leafIndex
      • leaves
    • Within each test case:
      • expectedRoot
      • proof
      • hashSides (for the test that uses this)
  • Run forge test or forge snapshot as before.