Skip to content
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

draft: txe native world state #10478

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions noir-projects/aztec-nr/authwit/src/cheatcodes.nr
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ where
C: CallInterface<M>,
{
let target = call_interface.get_contract_address();
let inputs = cheatcodes::get_private_context_inputs(get_block_number());
let inputs = cheatcodes::get_private_context_inputs(get_block_number() - 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Careful!

We used to do this because this.blockNumber in TXE means "the block I'm currently building" and we set the private context to "-1" so that we could do historical proofs.

Will this change break that flow?

let chain_id = inputs.tx_context.chain_id;
let version = inputs.tx_context.version;
let args_hash = hash_args(call_interface.get_args());
Expand All @@ -39,7 +39,7 @@ where
let current_contract = get_contract_address();
cheatcodes::set_contract_address(on_behalf_of);
let target = call_interface.get_contract_address();
let inputs = cheatcodes::get_private_context_inputs(get_block_number());
let inputs = cheatcodes::get_private_context_inputs(get_block_number() - 1);
let chain_id = inputs.tx_context.chain_id;
let version = inputs.tx_context.version;
let args_hash = hash_args(call_interface.get_args());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ unconstrained fn test_check_block_number() {
let router_contract_address = router_contract.to_address();
let router = Router::at(router_contract_address);

env.advance_block_by(9);
env.advance_block_by(8);

// First we sanity-check that current block number is as expected
let current_block_number = env.block_number();
Expand All @@ -28,7 +28,7 @@ unconstrained fn test_fail_check_block_number() {
let router_contract_address = router_contract.to_address();
let router = Router::at(router_contract_address);

env.advance_block_by(9);
env.advance_block_by(8);

// First we sanity-check that current block number is as expected
let current_block_number = env.block_number();
Expand Down
Loading
Loading