-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: emulating blocks and correct (non-partial) note discovery in txe (
#10356) This is the initial approach to adding correct private note emission and discovery in the TXe, with a tentative solution for finalized partial notes (notes emitted in public). This enables historical proofs as well because now we correctly use note nonces. This is a draft PR and is looking for more feedback on 1. The general methodology 2. Partial notes implementation (incl TxEffect crafting) Things to highlight: 1. TxHashes are hardcoded to blockNumber 3. Partial notes approach is more tenuous, we are assuming all unencrypted logs / notes are the last note hashes, the full fix for partials will be solved in a follow up PR if this is unsatisfactory. 4. The first nullifier is 6969 + block number. Setting this to blockNumber only causes issues because apparently a nullifier with value 1 is already set before doing anything. See comment in code for the issue.
- Loading branch information
Showing
9 changed files
with
1,044 additions
and
27 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
17 changes: 17 additions & 0 deletions
17
noir-projects/noir-contracts/contracts/counter_contract/src/test.nr
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use crate::Counter; | ||
use dep::aztec::{prelude::AztecAddress, test::helpers::test_environment::TestEnvironment}; | ||
|
||
pub unconstrained fn setup( | ||
initial_value: Field, | ||
) -> (&mut TestEnvironment, AztecAddress, AztecAddress, AztecAddress) { | ||
// Setup env, generate keys | ||
let mut env = TestEnvironment::new(); | ||
let owner = env.create_account(); | ||
let sender = env.create_account(); | ||
env.impersonate(owner); | ||
// Deploy contract and initialize | ||
let initializer = Counter::interface().initialize(initial_value as u64, owner); | ||
let counter_contract = env.deploy_self("Counter").with_private_initializer(initializer); | ||
let contract_address = counter_contract.to_address(); | ||
(&mut env, contract_address, owner, sender) | ||
} |
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
Oops, something went wrong.