diff --git a/docs/docs/aztec/aztec/concepts/smart_contracts/functions/context.md b/docs/docs/aztec/aztec/concepts/smart_contracts/functions/context.md index a2d44f40d800..35bc4d347bbd 100644 --- a/docs/docs/aztec/aztec/concepts/smart_contracts/functions/context.md +++ b/docs/docs/aztec/aztec/concepts/smart_contracts/functions/context.md @@ -130,13 +130,7 @@ New L2 to L1 messages contains messages that are delivered to the [l1 outbox](/p ## Public Context -The Public Context includes all of the information passed from the `Public VM` into the execution environment. It is very similar to the [Private Context](#the-private-context), however it has some minor differences (detailed below). - -### Public Context Inputs - -In the current version of the system, the public context is almost a clone of the private execution context. - -#include_code public-context-inputs /noir-projects/aztec-nr/aztec/src/context/inputs/public_context_inputs.nr rust +The Public Context includes all of the information passed from the `Public VM` into the execution environment. It's interface is very similar to the [Private Context](#the-private-context), however it has some minor differences (detailed below). ### Public Global Variables diff --git a/noir-projects/aztec-nr/aztec/src/context/inputs/public_context_inputs.nr b/noir-projects/aztec-nr/aztec/src/context/inputs/public_context_inputs.nr index c15ead73744d..862147bd33b8 100644 --- a/noir-projects/aztec-nr/aztec/src/context/inputs/public_context_inputs.nr +++ b/noir-projects/aztec-nr/aztec/src/context/inputs/public_context_inputs.nr @@ -1,5 +1,6 @@ use dep::protocol_types::traits::Empty; +// These inputs will likely go away once the AVM processes 1 public kernel per enqueued call. struct PublicContextInputs { selector: Field, args_hash: Field, diff --git a/noir-projects/aztec-nr/aztec/src/context/public_context.nr b/noir-projects/aztec-nr/aztec/src/context/public_context.nr index 9ac5ff10d532..8ab1a46e8c4e 100644 --- a/noir-projects/aztec-nr/aztec/src/context/public_context.nr +++ b/noir-projects/aztec-nr/aztec/src/context/public_context.nr @@ -200,67 +200,67 @@ fn gas_for_call(user_gas: GasOpts) -> [Field; 2] { // Unconstrained opcode wrappers (do not use directly). // TODO(https://github.com/AztecProtocol/aztec-packages/issues/6420): reconsider. -fn address() -> AztecAddress { +unconstrained fn address() -> AztecAddress { address_opcode() } -fn storage_address() -> AztecAddress { +unconstrained fn storage_address() -> AztecAddress { storage_address_opcode() } -fn sender() -> AztecAddress { +unconstrained fn sender() -> AztecAddress { sender_opcode() } -fn portal() -> EthAddress { +unconstrained fn portal() -> EthAddress { portal_opcode() } -fn fee_per_l2_gas() -> Field { +unconstrained fn fee_per_l2_gas() -> Field { fee_per_l2_gas_opcode() } -fn fee_per_da_gas() -> Field { +unconstrained fn fee_per_da_gas() -> Field { fee_per_da_gas_opcode() } -fn transaction_fee() -> Field { +unconstrained fn transaction_fee() -> Field { transaction_fee_opcode() } -fn chain_id() -> Field { +unconstrained fn chain_id() -> Field { chain_id_opcode() } -fn version() -> Field { +unconstrained fn version() -> Field { version_opcode() } -fn block_number() -> Field { +unconstrained fn block_number() -> Field { block_number_opcode() } -fn timestamp() -> u64 { +unconstrained fn timestamp() -> u64 { timestamp_opcode() } -fn l2_gas_left() -> Field { +unconstrained fn l2_gas_left() -> Field { l2_gas_left_opcode() } -fn da_gas_left() -> Field { +unconstrained fn da_gas_left() -> Field { da_gas_left_opcode() } -fn note_hash_exists(note_hash: Field, leaf_index: Field) -> u8 { +unconstrained fn note_hash_exists(note_hash: Field, leaf_index: Field) -> u8 { note_hash_exists_opcode(note_hash, leaf_index) } -fn emit_note_hash(note_hash: Field) { +unconstrained fn emit_note_hash(note_hash: Field) { emit_note_hash_opcode(note_hash) } -fn nullifier_exists(nullifier: Field, address: Field) -> u8 { +unconstrained fn nullifier_exists(nullifier: Field, address: Field) -> u8 { nullifier_exists_opcode(nullifier, address) } -fn emit_nullifier(nullifier: Field) { +unconstrained fn emit_nullifier(nullifier: Field) { emit_nullifier_opcode(nullifier) } -fn emit_unencrypted_log(event_selector: Field, message: T) { +unconstrained fn emit_unencrypted_log(event_selector: Field, message: T) { emit_unencrypted_log_opcode(event_selector, message) } -fn l1_to_l2_msg_exists(msg_hash: Field, msg_leaf_index: Field) -> u8 { +unconstrained fn l1_to_l2_msg_exists(msg_hash: Field, msg_leaf_index: Field) -> u8 { l1_to_l2_msg_exists_opcode(msg_hash, msg_leaf_index) } -fn send_l2_to_l1_msg(recipient: EthAddress, content: Field) { +unconstrained fn send_l2_to_l1_msg(recipient: EthAddress, content: Field) { send_l2_to_l1_msg_opcode(recipient, content) } -fn call( +unconstrained fn call( gas: [Field; 2], address: AztecAddress, args: [Field], @@ -268,7 +268,7 @@ fn call( ) -> ([Field; RET_SIZE], u8) { call_opcode(gas, address, args, function_selector) } -fn call_static( +unconstrained fn call_static( gas: [Field; 2], address: AztecAddress, args: [Field],