-
Notifications
You must be signed in to change notification settings - Fork 260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: TXE #6985
+2,949
−570
Merged
feat!: TXE #6985
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
39e88bf
Adapt public immutable
nventuro de4dfef
Add comments to private imnmutable
nventuro 584250d
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar 8c5bdf1
TXE
Thunkar 3fbc3ee
improvements
Thunkar 58c4c82
fixed tsconfig
Thunkar 84af5e8
public data tree witness
Thunkar aab9959
return null
Thunkar c94d32e
more oracle calls
Thunkar 5d857ae
more oracles, timetravel
Thunkar 717a16a
fix
Thunkar 58e7bfa
Sketch nr tests for txe testing
nventuro d543edf
fix
Thunkar 92b9a48
Begin test refactor
nventuro c6fdef6
fix
Thunkar b29b3a4
fixes
Thunkar 6628ab0
fix
Thunkar 460a1d1
private context inputs
Thunkar 069a09a
return struct
Thunkar 7edc719
fix
Thunkar f2820a7
configurable private inputs
Thunkar cbe1564
???
nventuro 2250b98
???
nventuro 45434f9
fixes
Thunkar c180bdb
git add .
nventuro a34bf85
fixes and moar
Thunkar fdbeaf8
note handling
Thunkar 12453ea
Samples
nventuro fdd5cf1
Add address fixes
nventuro ff3fa71
almost there
Thunkar ea506ab
working proto
Thunkar 562e92e
initial txe version
Thunkar e037804
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar 21f3178
removed file
Thunkar c543a2c
Add TXE
nventuro 0d1221a
Merge branch 'gj_nv/txe' of github.com:AztecProtocol/aztec-packages i…
Thunkar 6083ade
fixes
Thunkar b80f6c7
fixes
Thunkar ca42523
account abstraction
Thunkar 38fb77e
reverted parallel changes since we have session ids now
Thunkar dc373da
Merge branch 'master' into gj_nv/txe
Thunkar 85b7dec
updated tsconfig
Thunkar 84292d0
Merge branch 'master' into gj_nv/txe
Thunkar 907e26d
external calls
Thunkar 5a92553
private calls
Thunkar 8b278a1
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar cf027a2
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar 5e9486e
public initializers
Thunkar bbeaa00
34 token transfer
Thunkar 963990a
cleanup
Thunkar a68fec7
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar 44d63aa
sessionId compatibility
Thunkar 9f1dbe6
corrected docs
Thunkar 93f32d0
cleanup
Thunkar 19123bd
formatting
Thunkar 35fe257
better comment
Thunkar e41a19c
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar 1ccfe4f
Merge branch 'master' into gj_nv/txe
Thunkar eb48006
Merge branch 'master' into gj_nv/txe
Thunkar cca4e8c
test ci
Thunkar 83c16e5
Merge branch 'gj_nv/txe' of github.com:AztecProtocol/aztec-packages i…
Thunkar f564d92
working CI
Thunkar 083b1f8
better dockerfile
Thunkar 2155e79
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar c583065
Merge branch 'master' into gj_nv/txe
Thunkar ab5e0e9
nargo fmt
Thunkar 44669d9
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar 39b5f76
comments from PR
Thunkar 9e0ac91
kill txe even if nargo test fails
Thunkar fa744a5
Merge branch 'master' into gj_nv/txe
Thunkar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Samples
- Loading branch information
commit 12453eae864f6bc3def7d2f06c2ef83227f56a31
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
2 changes: 1 addition & 1 deletion
2
noir-projects/aztec-nr/aztec/src/state_vars/private_mutable/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
3 changes: 1 addition & 2 deletions
3
noir-projects/aztec-nr/aztec/src/state_vars/public_immutable/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
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 |
---|---|---|
@@ -1,18 +1,9 @@ | ||
use dep::std::{merkle::compute_merkle_root, test::OracleMock}; | ||
|
||
use crate::{ | ||
context::{PublicContext, PrivateContext}, | ||
state_vars::shared_mutable::{ | ||
shared_mutable::SharedMutable, scheduled_value_change::ScheduledValueChange, | ||
scheduled_delay_change::ScheduledDelayChange | ||
}, | ||
test::helpers::context_builder::TestEnvironment, oracle::get_public_data_witness::PublicDataWitness | ||
context::{PublicContext, PrivateContext}, state_vars::shared_mutable::shared_mutable::SharedMutable, | ||
test::helpers::test_environment::TestEnvironment | ||
}; | ||
|
||
use dep::protocol_types::{ | ||
constants::{GENERATOR_INDEX__PUBLIC_LEAF_INDEX, PUBLIC_DATA_TREE_HEIGHT}, hash::pedersen_hash, | ||
address::AztecAddress, public_data_tree_leaf_preimage::PublicDataTreeLeafPreimage | ||
}; | ||
use dep::protocol_types::address::AztecAddress; | ||
|
||
global new_value = 57; | ||
|
||
|
@@ -21,7 +12,7 @@ global post_delay = 15; | |
|
||
global storage_slot = 57; | ||
|
||
global TEST_INITIAL_DELAY: u32 = 3; | ||
global TEST_INITIAL_DELAY: u32 = 30; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pretty wild to see so long delays without it totally nuking testing time 😎 |
||
|
||
fn setup() -> TestEnvironment { | ||
TestEnvironment::new() | ||
|
@@ -92,6 +83,71 @@ fn test_get_current_value_in_public_after_scheduled_change() { | |
assert_eq(state_var.get_current_value_in_public(), new_value); | ||
} | ||
|
||
#[test] | ||
fn test_get_current_value_in_private_before_change() { | ||
let mut env = setup(); | ||
|
||
let public_state_var = in_public(env); | ||
public_state_var.schedule_value_change(new_value); | ||
|
||
let (_, block_of_change) = public_state_var.get_scheduled_value_in_public(); | ||
|
||
let schedule_block_number = env.block_number; | ||
|
||
let private_state_var = in_private(&mut env, schedule_block_number); | ||
assert_eq(private_state_var.get_current_value_in_private(), 0); | ||
assert_eq(private_state_var.context.max_block_number.unwrap(), block_of_change - 1); | ||
} | ||
|
||
#[test] | ||
fn test_get_current_value_in_private_immediately_before_change() { | ||
let mut env = setup(); | ||
|
||
let public_state_var = in_public(env); | ||
public_state_var.schedule_value_change(new_value); | ||
|
||
let (_, block_of_change) = public_state_var.get_scheduled_value_in_public(); | ||
|
||
let private_state_var = in_private(&mut env, block_of_change - 1); | ||
|
||
assert_eq(private_state_var.get_current_value_in_private(), 0); | ||
assert_eq(private_state_var.context.max_block_number.unwrap(), block_of_change - 1); | ||
} | ||
|
||
#[test] | ||
fn test_get_current_value_in_private_at_change() { | ||
let mut env = setup(); | ||
|
||
let public_state_var = in_public(env); | ||
public_state_var.schedule_value_change(new_value); | ||
|
||
let (_, block_of_change) = public_state_var.get_scheduled_value_in_public(); | ||
|
||
let historical_block_number = block_of_change; | ||
let private_state_var = in_private(&mut env, historical_block_number); | ||
assert_eq(private_state_var.get_current_value_in_private(), new_value); | ||
assert_eq( | ||
private_state_var.context.max_block_number.unwrap(), historical_block_number + TEST_INITIAL_DELAY | ||
); | ||
} | ||
|
||
#[test] | ||
fn test_get_current_value_in_private_after_change() { | ||
let mut env = setup(); | ||
|
||
let public_state_var = in_public(env); | ||
public_state_var.schedule_value_change(new_value); | ||
|
||
let (_, block_of_change) = public_state_var.get_scheduled_value_in_public(); | ||
|
||
let historical_block_number = block_of_change + 10; | ||
let private_state_var = in_private(&mut env, historical_block_number); | ||
assert_eq(private_state_var.get_current_value_in_private(), new_value); | ||
assert_eq( | ||
private_state_var.context.max_block_number.unwrap(), historical_block_number + TEST_INITIAL_DELAY | ||
); | ||
} | ||
|
||
// #[test] | ||
// fn test_get_current_delay_in_public() { | ||
// let (state_var, block_number) = setup(); | ||
|
@@ -304,56 +360,4 @@ fn test_get_current_value_in_public_after_scheduled_change() { | |
// new_delay, | ||
// block_number + post_delay - new_delay | ||
// ); | ||
// } | ||
|
||
#[test] | ||
fn test_get_current_value_in_private_before_change() { | ||
let mut env = setup(); | ||
|
||
let public_state_var = in_public(env); | ||
public_state_var.schedule_value_change(new_value); | ||
|
||
let schedule_block_number = env.block_number; | ||
|
||
let private_state_var = in_private(&mut env, schedule_block_number); | ||
assert_eq(private_state_var.get_current_value_in_private(), 0); | ||
} | ||
|
||
#[test] | ||
fn test_get_current_value_in_private_immediately_before_change() { | ||
let mut env = setup(); | ||
|
||
let state_var = in_public(env); | ||
state_var.schedule_value_change(new_value); | ||
|
||
let (_, block_horizon) = state_var.get_scheduled_value_in_public(); | ||
|
||
let private_state_var = in_private(&mut env, block_horizon - 1); | ||
assert_eq(private_state_var.get_current_value_in_private(), 0); | ||
} | ||
|
||
#[test] | ||
fn test_get_current_value_in_private_at_change() { | ||
let mut env = setup(); | ||
|
||
let state_var = in_public(env); | ||
state_var.schedule_value_change(new_value); | ||
|
||
let (_, block_horizon) = state_var.get_scheduled_value_in_public(); | ||
|
||
let private_state_var = in_private(&mut env, block_horizon); | ||
assert_eq(private_state_var.get_current_value_in_private(), new_value); | ||
} | ||
|
||
#[test] | ||
fn test_get_current_value_in_private_after_change() { | ||
let mut env = setup(); | ||
|
||
let state_var = in_public(env); | ||
state_var.schedule_value_change(new_value); | ||
|
||
let (_, block_horizon) = state_var.get_scheduled_value_in_public(); | ||
|
||
let private_state_var = in_private(&mut env, block_horizon + 10); | ||
assert_eq(private_state_var.get_current_value_in_private(), new_value); | ||
} | ||
// } |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
mod context_builder; | ||
mod test_environment; | ||
mod cheatcodes; |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this just to have "some" value? Seems to be used just in the
in_public
but guess it is nicer to have it clearly named here 👍There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previous