-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: prep for switching AVM to checkpointed native trees - TS test …
…cleanup and refactors (#12023) This PR is mostly setup for switching the AVM to use checkpointed native trees. Originally I had that in the same branch, but there were enough of these prerequisite changes to pull them out. ## Orchestrator testing prover-client's `TestContext` no longer mocks AVM simulation. Context: while trying to transition the AVM to use native checkpointed trees, I ran into issues with the orchestrator public functions tests because the public processor will no longer update the trees for public functions. So, I think we should stop mocking the AVM simulation for these tests and let the AVM do its tree updates. We can then do two types of tests: 1. A quick test that doesn't actually deploy/run any real contract functions and instead tests the orchestrator with a mocked/garbage TX that has 1 _revertible_ enqueued call. The AVM will fail to retrieve it's bytecode, but the TX can still be included. `orchestrator_public_functions.test.ts` now does this. 2. A real test that creates TXs that actually do a bunch of real token operations via non-revertible and revertible enqueued calls. `orchestrator_multi_public_functions.test.ts` now does this. ## AVM & PublicProcessor testing - `PublicTxSimulationTester` lets you `createTx` separately from `simulateTx` (useful for testing `PublicProcessor`) - Add `PublicTxSimulator` test for avm bulk test - Add a `PublicProcessor` test of the token contract (construct, mint, many transfers) - Consolidate some duplicate helper functions in `simulator/src/avm` and `simulator/src/public` - Simplify process of registering/deploying contracts via avm `*Tester` classes, and optional contract address nullifier insertion - Contract Updates test now use the tester's `register*()` function instead of manually constructing contract classes and instances - Remove unused function from avm test contract ## Misc - Making contract classes for tests is now deterministic (no more random public keys) - Use new/proper sha256 in benchmarking test contract
- Loading branch information
Showing
36 changed files
with
565 additions
and
470 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
26 changes: 7 additions & 19 deletions
26
yarn-project/bb-prover/src/avm_proving_tests/avm_check_circuit1.test.ts
This file contains 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
This file contains 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
31 changes: 7 additions & 24 deletions
31
yarn-project/bb-prover/src/avm_proving_tests/avm_check_circuit3.test.ts
This file contains 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
This file contains 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
This file contains 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
This file contains 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
3 changes: 2 additions & 1 deletion
3
yarn-project/bb-prover/src/avm_proving_tests/avm_proven_token.test.ts
This file contains 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
Oops, something went wrong.