-
Notifications
You must be signed in to change notification settings - Fork 234
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 2: Electric boogaloo #7154
Merged
Merged
Changes from 80 commits
Commits
Show all changes
95 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 d214093
wip
Thunkar 0a1c2e1
fixed account contract deployments
Thunkar 2d934d3
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar e711f21
compatibility with new deployment
Thunkar 553a904
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar 9a09e2b
working private authwits
Thunkar e3c5f71
avoid unnecesary account contract creation
Thunkar 891d331
public execution
Thunkar c6b4675
authwits, expect failures, token suite
Thunkar fcf7823
more tests
Thunkar 5dc4c9a
test constrained
Thunkar 1206b87
Revert "test constrained"
Thunkar 05cdb9c
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar aa8e006
moar tests
Thunkar 53b2192
test tweaks
Thunkar f180efd
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar 2c2424d
use only public avm exports
Thunkar 937f561
added comments for context
Thunkar 04d215a
tweaked sideEffectCounters
Thunkar e76229a
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar 899c65a
fixed problem with initializers, more flexibility on nullifiers and n…
Thunkar bd944d2
typo
Thunkar 9b80629
removed contract import restriction
Thunkar 44366a5
Merge branch 'master' of github.com:AztecProtocol/aztec-packages into…
Thunkar 0227efe
nargo fmt
Thunkar 625a492
increased timeouts
Thunkar 151e312
yarn formatting
Thunkar 19e323f
formatting
Thunkar d5f28b4
comments from PR
Thunkar 9c55d33
more comments
Thunkar 8095410
removed unnecessary tree accesses
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
use dep::aztec::{ | ||
protocol_types::address::AztecAddress, | ||
context::{public_context::PublicContext, call_interfaces::CallInterface}, test::helpers::cheatcodes, | ||
hash::hash_args | ||
}; | ||
|
||
use crate::auth::{compute_inner_authwit_hash, compute_outer_authwit_hash, set_authorized}; | ||
|
||
pub fn add_private_authwit_from_call_interface<C, M, T, P, Env>( | ||
on_behalf_of: AztecAddress, | ||
caller: AztecAddress, | ||
call_interface: C | ||
) where C: CallInterface<M, T, P, Env> { | ||
let target = call_interface.get_contract_address(); | ||
let inputs = cheatcodes::get_private_context_inputs(cheatcodes::get_block_number()); | ||
let chain_id = inputs.tx_context.chain_id; | ||
let version = inputs.tx_context.version; | ||
let args_hash = hash_args(call_interface.get_args()); | ||
let selector = call_interface.get_selector(); | ||
let inner_hash = compute_inner_authwit_hash([caller.to_field(), selector.to_field(), args_hash]); | ||
let message_hash = compute_outer_authwit_hash(target, chain_id, version, inner_hash); | ||
cheatcodes::add_authwit(on_behalf_of, message_hash); | ||
} | ||
|
||
pub fn add_public_authwit_from_call_interface<C, M, T, P, Env>( | ||
on_behalf_of: AztecAddress, | ||
caller: AztecAddress, | ||
call_interface: C | ||
) where C: CallInterface<M, T, P, Env> { | ||
let current_contract = cheatcodes::get_contract_address(); | ||
cheatcodes::set_contract_address(on_behalf_of); | ||
let target = call_interface.get_contract_address(); | ||
let inputs = cheatcodes::get_private_context_inputs(cheatcodes::get_block_number()); | ||
let chain_id = inputs.tx_context.chain_id; | ||
let version = inputs.tx_context.version; | ||
let args_hash = hash_args(call_interface.get_args()); | ||
let selector = call_interface.get_selector(); | ||
let inner_hash = compute_inner_authwit_hash([caller.to_field(), selector.to_field(), args_hash]); | ||
let message_hash = compute_outer_authwit_hash(target, chain_id, version, inner_hash); | ||
let mut inputs = cheatcodes::get_public_context_inputs(); | ||
let mut context = PublicContext::new(inputs); | ||
set_authorized(&mut context, message_hash, true); | ||
cheatcodes::set_contract_address(current_contract); | ||
} |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ mod account; | |
mod auth_witness; | ||
mod auth; | ||
mod entrypoint; | ||
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
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.
Oops, something went wrong.
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.
I find some of the cheatcode structure slightly odd, e.g., having it a bit all over the place instead of having a folder just with cheatcodes. Ideally think it would be nice to have it outside of the others, to not pollute 🤷. But it is something I think we could deal with in a separate PR.
Might also just be that I am not thinking about something and we need it this way 👍.
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.
Most of it is in
aztec-nr
, but for authwits it was necessary to do it this way due to circular dependencies:aztec-nr
->auth
->aztec-nr
.We could have a separate crate, but I though it wouldn't be so bad if our packages exported their tests interfaces themselves.