diff --git a/noir-projects/aztec-nr/aztec/src/context/avm_context.nr b/noir-projects/aztec-nr/aztec/src/context/avm_context.nr index f318253d9ce..3a8dd4bb9bf 100644 --- a/noir-projects/aztec-nr/aztec/src/context/avm_context.nr +++ b/noir-projects/aztec-nr/aztec/src/context/avm_context.nr @@ -122,14 +122,6 @@ impl PublicContextInterface for AvmContext { nullifier_exists(unsiloed_nullifier, address.to_field()) == 1 } - fn push_nullifier_read_request(&mut self, nullifier: Field) { - assert(false, "'push_nullifier_read_request' not implemented!"); - } - - fn push_nullifier_non_existent_read_request(&mut self, nullifier: Field) { - assert(false, "'push_nullifier_non_existent_read_request' not implemented!"); - } - fn accumulate_encrypted_logs(&mut self, log: [Field; N]) { assert(false, "'accumulate_encrypted_logs' not implemented!"); } @@ -222,10 +214,6 @@ impl ContextInterface for AvmContext { fn selector(self) -> FunctionSelector { FunctionSelector::from_field(self.inputs.selector) } - fn get_header(self) -> Header { - assert(false, "'get_header' not implemented!"); - Header::empty() - } fn get_args_hash(self) -> Field { self.inputs.args_hash } diff --git a/noir-projects/aztec-nr/aztec/src/context/interface.nr b/noir-projects/aztec-nr/aztec/src/context/interface.nr index 7af943c3a4a..ef64964368c 100644 --- a/noir-projects/aztec-nr/aztec/src/context/interface.nr +++ b/noir-projects/aztec-nr/aztec/src/context/interface.nr @@ -13,7 +13,6 @@ trait ContextInterface { fn version(self) -> Field; fn selector(self) -> FunctionSelector; fn get_args_hash(self) -> Field; - fn get_header(self) -> Header; } // TEMPORARY: This trait is to promote sharing of the current public context @@ -27,8 +26,6 @@ trait PublicContextInterface { fn fee_per_da_gas(self) -> Field; fn fee_per_l1_gas(self) -> Field; fn fee_per_l2_gas(self) -> Field; - fn push_nullifier_read_request(&mut self, nullifier: Field); - fn push_nullifier_non_existent_read_request(&mut self, nullifier: Field); fn message_portal(&mut self, recipient: EthAddress, content: Field); fn consume_l1_to_l2_message(&mut self, content: Field, secret: Field, sender: EthAddress); fn accumulate_encrypted_logs(&mut self, log: [Field; N]); diff --git a/noir-projects/aztec-nr/aztec/src/context/private_context.nr b/noir-projects/aztec-nr/aztec/src/context/private_context.nr index 48e4824521f..4009c79b680 100644 --- a/noir-projects/aztec-nr/aztec/src/context/private_context.nr +++ b/noir-projects/aztec-nr/aztec/src/context/private_context.nr @@ -99,12 +99,6 @@ impl ContextInterface for PrivateContext { self.args_hash } - // Returns the header of a block whose state is used during private execution (not the block the transaction is - // included in). - fn get_header(self) -> Header { - self.historical_header - } - fn push_new_note_hash(&mut self, note_hash: Field) { let side_effect = SideEffect { value: note_hash, counter: self.side_effect_counter }; self.new_note_hashes.push(side_effect); @@ -148,6 +142,12 @@ impl PrivateContext { } } + // Returns the header of a block whose state is used during private execution (not the block the transaction is + // included in). + fn get_header(self) -> Header { + self.historical_header + } + // Returns the header of an arbitrary block whose block number is less than or equal to the block number // of historical header. pub fn get_header_at(self, block_number: u32) -> Header { 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 af98dc9d169..9bcde4fe514 100644 --- a/noir-projects/aztec-nr/aztec/src/context/public_context.nr +++ b/noir-projects/aztec-nr/aztec/src/context/public_context.nr @@ -130,6 +130,20 @@ impl PublicContext { self.return_hash = returns_hasher.hash(); } + // Keep private or ask the AVM team if you want to change it. + fn push_nullifier_read_request(&mut self, nullifier: Field) { + let request = ReadRequest { value: nullifier, counter: self.side_effect_counter }; + self.nullifier_read_requests.push(request); + self.side_effect_counter = self.side_effect_counter + 1; + } + + // Keep private or ask the AVM team if you want to change it. + fn push_nullifier_non_existent_read_request(&mut self, nullifier: Field) { + let request = ReadRequest { value: nullifier, counter: self.side_effect_counter }; + self.nullifier_non_existent_read_requests.push(request); + self.side_effect_counter = self.side_effect_counter + 1; + } + pub fn finish(self) -> PublicCircuitPublicInputs { // TODO(https://github.com/AztecProtocol/aztec-packages/issues/1165) let unencrypted_logs_hash = 0; @@ -189,10 +203,6 @@ impl ContextInterface for PublicContext { self.args_hash } - fn get_header(self) -> Header { - self.historical_header - } - fn push_new_note_hash(&mut self, note_hash: Field) { let side_effect = SideEffect { value: note_hash, counter: self.side_effect_counter }; self.new_note_hashes.push(side_effect); @@ -245,18 +255,6 @@ impl PublicContextInterface for PublicContext { nullifier_exists_oracle(siloed_nullifier) == 1 } - fn push_nullifier_read_request(&mut self, nullifier: Field) { - let request = ReadRequest { value: nullifier, counter: self.side_effect_counter }; - self.nullifier_read_requests.push(request); - self.side_effect_counter = self.side_effect_counter + 1; - } - - fn push_nullifier_non_existent_read_request(&mut self, nullifier: Field) { - let request = ReadRequest { value: nullifier, counter: self.side_effect_counter }; - self.nullifier_non_existent_read_requests.push(request); - self.side_effect_counter = self.side_effect_counter + 1; - } - fn message_portal(&mut self, recipient: EthAddress, content: Field) { let message = L2ToL1Message { recipient, content }; self.new_l2_to_l1_msgs.push(message); diff --git a/noir-projects/aztec-nr/aztec/src/oracle/create_commitment.nr b/noir-projects/aztec-nr/aztec/src/oracle/create_commitment.nr deleted file mode 100644 index 62c848c1d71..00000000000 --- a/noir-projects/aztec-nr/aztec/src/oracle/create_commitment.nr +++ /dev/null @@ -1,6 +0,0 @@ -#[oracle(createCommitment)] -fn create_commitment_oracle(_commitment: Field) -> Field {} - -unconstrained pub fn create_commitment(commitment: Field) { - assert(create_commitment_oracle(commitment) == 0); -}