From 2e817f290856495ea57d8841450b7eef196eaa79 Mon Sep 17 00:00:00 2001 From: benesjan Date: Mon, 29 Jan 2024 15:48:35 +0000 Subject: [PATCH] header -> historical_header in contexts --- .../acir-simulator/src/acvm/serialize.ts | 2 +- yarn-project/aztec-nr/aztec/src/abi.nr | 4 ++-- yarn-project/aztec-nr/aztec/src/context.nr | 20 +++++++++---------- .../aztec-nr/aztec/src/oracle/get_header.nr | 5 +++-- yarn-project/circuits.js/src/abis/abis.ts | 4 ++-- .../structs/private_circuit_public_inputs.ts | 6 +++--- .../structs/public_circuit_public_inputs.ts | 6 +++--- .../circuits.js/src/tests/factories.ts | 2 +- .../crates/private-kernel-lib/src/common.nr | 2 +- .../src/private_kernel_init.nr | 2 +- .../src/private_kernel_inner.nr | 2 +- .../src/abis/private_circuit_public_inputs.nr | 7 ++++--- .../src/abis/public_circuit_public_inputs.nr | 6 +++--- .../src/crates/types/src/tests/fixtures.nr | 2 +- .../src/tests/previous_kernel_data_builder.nr | 2 +- .../private_circuit_public_inputs_builder.nr | 6 +++--- .../public_circuit_public_inputs_builder.nr | 6 +++--- .../src/type_conversion.ts | 4 ++-- .../src/sequencer/public_processor.ts | 2 +- 19 files changed, 46 insertions(+), 44 deletions(-) diff --git a/yarn-project/acir-simulator/src/acvm/serialize.ts b/yarn-project/acir-simulator/src/acvm/serialize.ts index ae052166043..f0ae6d1e284 100644 --- a/yarn-project/acir-simulator/src/acvm/serialize.ts +++ b/yarn-project/acir-simulator/src/acvm/serialize.ts @@ -149,7 +149,7 @@ export function toACVMPublicInputs(publicInputs: PrivateCircuitPublicInputs): AC toACVMField(publicInputs.encryptedLogPreimagesLength), toACVMField(publicInputs.unencryptedLogPreimagesLength), - ...toACVMHeader(publicInputs.header), + ...toACVMHeader(publicInputs.historicalHeader), ...toACVMContractDeploymentData(publicInputs.contractDeploymentData), diff --git a/yarn-project/aztec-nr/aztec/src/abi.nr b/yarn-project/aztec-nr/aztec/src/abi.nr index d1ea6ba7aea..74ba77db97e 100644 --- a/yarn-project/aztec-nr/aztec/src/abi.nr +++ b/yarn-project/aztec-nr/aztec/src/abi.nr @@ -41,7 +41,7 @@ impl PublicGlobalVariables { // docs:start:private-context-inputs struct PrivateContextInputs { call_context : CallContext, - header: Header, + historical_header: Header, contract_deployment_data: ContractDeploymentData, private_global_variables: PrivateGlobalVariables, } @@ -51,7 +51,7 @@ struct PrivateContextInputs { // docs:start:public-context-inputs struct PublicContextInputs { call_context: CallContext, - header: Header, + historical_header: Header, public_global_variables: PublicGlobalVariables, } diff --git a/yarn-project/aztec-nr/aztec/src/context.nr b/yarn-project/aztec-nr/aztec/src/context.nr index 850a848868e..9b3790a02a0 100644 --- a/yarn-project/aztec-nr/aztec/src/context.nr +++ b/yarn-project/aztec-nr/aztec/src/context.nr @@ -86,7 +86,7 @@ struct PrivateContext { new_l2_to_l1_msgs : BoundedVec, // docs:end:private-context - header: Header, + historical_header: Header, // TODO(https://github.com/AztecProtocol/aztec-packages/issues/1165) // encrypted_logs_preimages: Vec, @@ -110,7 +110,7 @@ impl PrivateContext { new_commitments: BoundedVec::new(SideEffect::empty()), new_nullifiers: BoundedVec::new(SideEffectLinkedToNoteHash::empty()), - header: inputs.header, + historical_header: inputs.historical_header, private_call_stack_hashes: BoundedVec::new(0), public_call_stack_hashes: BoundedVec::new(0), @@ -175,7 +175,7 @@ impl PrivateContext { unencrypted_logs_hash: unencrypted_logs_hash, encrypted_log_preimages_length: encrypted_log_preimages_length, unencrypted_log_preimages_length: unencrypted_log_preimages_length, - header: self.header, + historical_header: self.historical_header, contract_deployment_data: self.inputs.contract_deployment_data, chain_id: self.inputs.private_global_variables.chain_id, version: self.inputs.private_global_variables.version, @@ -248,7 +248,7 @@ impl PrivateContext { ) // docs:end:context_consume_l1_to_l2_message { - let nullifier = process_l1_to_l2_message(self.header.state.l1_to_l2_message_tree.root, self.this_address(), self.this_portal_address(), self.chain_id(), self.version(), msg_key, content, secret); + let nullifier = process_l1_to_l2_message(self.historical_header.state.l1_to_l2_message_tree.root, self.this_address(), self.this_portal_address(), self.chain_id(), self.version(), msg_key, content, secret); // Push nullifier (and the "commitment" corresponding to this can be "empty") self.push_new_nullifier(nullifier, 0) @@ -333,7 +333,7 @@ impl PrivateContext { unencrypted_logs_hash: reader.read_array([0; NUM_FIELDS_PER_SHA256]), encrypted_log_preimages_length: reader.read(), unencrypted_log_preimages_length: reader.read(), - header: Header{ + historical_header: Header{ // Must match order in `private_circuit_public_inputs.nr` last_archive: reader.read_struct(AppendOnlyTreeSnapshot::deserialize), body_hash: reader.read_array([0; NUM_FIELDS_PER_SHA256]), @@ -446,7 +446,7 @@ impl PrivateContext { new_l2_to_l1_msgs:[0; MAX_NEW_L2_TO_L1_MSGS_PER_CALL], unencrypted_logs_hash:[0; NUM_FIELDS_PER_SHA256], unencrypted_log_preimages_length: 0, - header: Header::empty(), + historical_header: Header::empty(), prover_address: AztecAddress::zero(), }, is_execution_request: true, @@ -495,7 +495,7 @@ struct PublicContext { unencrypted_logs_hash: BoundedVec, unencrypted_logs_preimages_length: Field, - header: Header, + historical_header: Header, prover_address: AztecAddress, } @@ -523,7 +523,7 @@ impl PublicContext { unencrypted_logs_hash: BoundedVec::new(0), unencrypted_logs_preimages_length: 0, - header: inputs.header, + historical_header: inputs.historical_header, prover_address: AztecAddress::zero(), // TODO(https://github.com/AztecProtocol/aztec-packages/issues/1165) @@ -583,7 +583,7 @@ impl PublicContext { new_l2_to_l1_msgs: self.new_l2_to_l1_msgs.storage, unencrypted_logs_hash: unencrypted_logs_hash, unencrypted_log_preimages_length: unencrypted_log_preimages_length, - header: self.inputs.header, + historical_header: self.inputs.historical_header, prover_address: self.prover_address, }; pub_circuit_pub_inputs @@ -616,7 +616,7 @@ impl PublicContext { // Note this returns self to get around an issue where mutable structs do not maintain mutations unless reassigned pub fn consume_l1_to_l2_message(&mut self, msg_key: Field, content: Field, secret: Field) { let this = (*self).this_address(); - let nullifier = process_l1_to_l2_message(self.header.state.l1_to_l2_message_tree.root, this, self.this_portal_address(), self.chain_id(), self.version(), msg_key, content, secret); + let nullifier = process_l1_to_l2_message(self.historical_header.state.l1_to_l2_message_tree.root, this, self.this_portal_address(), self.chain_id(), self.version(), msg_key, content, secret); // Push nullifier (and the "commitment" corresponding to this can be "empty") self.push_new_nullifier(nullifier, 0) diff --git a/yarn-project/aztec-nr/aztec/src/oracle/get_header.nr b/yarn-project/aztec-nr/aztec/src/oracle/get_header.nr index a65dc070207..b8f48cd6453 100644 --- a/yarn-project/aztec-nr/aztec/src/oracle/get_header.nr +++ b/yarn-project/aztec-nr/aztec/src/oracle/get_header.nr @@ -20,7 +20,7 @@ unconstrained pub fn get_header_internal(block_number: u32) -> Header { pub fn get_header(block_number: u32, context: PrivateContext) -> Header { // 1) Get block number corresponding to the last_archive root in the header // Note: We subtract 1 because the last_archive root is the root of the archive after applying the previous block - let last_archive_block_number = (context.header.global_variables.block_number - 1) as u32; + let last_archive_block_number = (context.historical_header.global_variables.block_number - 1) as u32; // 2) Check that the last archive block number is more than or equal to the block number we want to prove against // We could not perform the proof otherwise because the last archive root from the header would not "contain" @@ -40,7 +40,8 @@ pub fn get_header(block_number: u32, context: PrivateContext) -> Header { // 6) Check that the block is in the archive (i.e. the witness is valid) assert( - context.header.last_archive.root == compute_merkle_root(block_hash, witness.index, witness.path), "Proving membership of a block in archive failed" + context.historical_header.last_archive.root + == compute_merkle_root(block_hash, witness.index, witness.path), "Proving membership of a block in archive failed" ); // 7) Return the block header diff --git a/yarn-project/circuits.js/src/abis/abis.ts b/yarn-project/circuits.js/src/abis/abis.ts index dbae080226a..bcf7d01e3db 100644 --- a/yarn-project/circuits.js/src/abis/abis.ts +++ b/yarn-project/circuits.js/src/abis/abis.ts @@ -535,7 +535,7 @@ function computePrivateInputsHash(input: PrivateCircuitPublicInputs) { ...input.unencryptedLogsHash.map(fr => fr.toBuffer()), input.encryptedLogPreimagesLength.toBuffer(), input.unencryptedLogPreimagesLength.toBuffer(), - ...(input.header.toFieldArray().map(fr => fr.toBuffer()) as Buffer[]), + ...(input.historicalHeader.toFieldArray().map(fr => fr.toBuffer()) as Buffer[]), computeContractDeploymentDataHash(input.contractDeploymentData).toBuffer(), input.chainId.toBuffer(), input.version.toBuffer(), @@ -601,7 +601,7 @@ export function computePublicInputsHash(input: PublicCircuitPublicInputs) { ...input.newL2ToL1Msgs.map(fr => fr.toBuffer()), ...input.unencryptedLogsHash.map(fr => fr.toBuffer()), input.unencryptedLogPreimagesLength.toBuffer(), - ...input.header.toFieldArray().map(fr => fr.toBuffer()), + ...input.historicalHeader.toFieldArray().map(fr => fr.toBuffer()), input.proverAddress.toBuffer(), ]; if (toHash.length != PUBLIC_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH) { diff --git a/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts b/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts index adff61c5326..e16a2e4a68e 100644 --- a/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts @@ -96,7 +96,7 @@ export class PrivateCircuitPublicInputs { /** * L2 block header. */ - public header: Header, + public historicalHeader: Header, /** * Deployment data of contracts being deployed in this kernel iteration. */ @@ -199,7 +199,7 @@ export class PrivateCircuitPublicInputs { isZeroArray(this.unencryptedLogsHash) && this.encryptedLogPreimagesLength.isZero() && this.unencryptedLogPreimagesLength.isZero() && - this.header.isEmpty() && + this.historicalHeader.isEmpty() && this.contractDeploymentData.isEmpty() && this.chainId.isZero() && this.version.isZero() @@ -228,7 +228,7 @@ export class PrivateCircuitPublicInputs { fields.unencryptedLogsHash, fields.encryptedLogPreimagesLength, fields.unencryptedLogPreimagesLength, - fields.header, + fields.historicalHeader, fields.contractDeploymentData, fields.chainId, fields.version, diff --git a/yarn-project/circuits.js/src/structs/public_circuit_public_inputs.ts b/yarn-project/circuits.js/src/structs/public_circuit_public_inputs.ts index 40039aa54c8..a7c434b12b9 100644 --- a/yarn-project/circuits.js/src/structs/public_circuit_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/public_circuit_public_inputs.ts @@ -200,7 +200,7 @@ export class PublicCircuitPublicInputs { /** * L2 block header of the block preceding the block in which this tx is included. */ - public header: Header, + public historicalHeader: Header, /** * Address of the prover. */ @@ -255,7 +255,7 @@ export class PublicCircuitPublicInputs { isFrArrayEmpty(this.newL2ToL1Msgs) && isFrArrayEmpty(this.unencryptedLogsHash) && this.unencryptedLogPreimagesLength.isZero() && - this.header.isEmpty() && + this.historicalHeader.isEmpty() && this.proverAddress.isZero() ); } @@ -278,7 +278,7 @@ export class PublicCircuitPublicInputs { fields.newL2ToL1Msgs, fields.unencryptedLogsHash, fields.unencryptedLogPreimagesLength, - fields.header, + fields.historicalHeader, fields.proverAddress, ] as const; } diff --git a/yarn-project/circuits.js/src/tests/factories.ts b/yarn-project/circuits.js/src/tests/factories.ts index f56175e9d09..3770d632b8d 100644 --- a/yarn-project/circuits.js/src/tests/factories.ts +++ b/yarn-project/circuits.js/src/tests/factories.ts @@ -726,7 +726,7 @@ export function makePrivateCircuitPublicInputs(seed = 0): PrivateCircuitPublicIn unencryptedLogsHash: makeTuple(NUM_FIELDS_PER_SHA256, fr, seed + 0xa00), encryptedLogPreimagesLength: fr(seed + 0xb00), unencryptedLogPreimagesLength: fr(seed + 0xc00), - header: makeHeader(seed + 0xd00, undefined), + historicalHeader: makeHeader(seed + 0xd00, undefined), contractDeploymentData: makeContractDeploymentData(seed + 0xe00), chainId: fr(seed + 0x1400), version: fr(seed + 0x1500), diff --git a/yarn-project/noir-protocol-circuits/src/crates/private-kernel-lib/src/common.nr b/yarn-project/noir-protocol-circuits/src/crates/private-kernel-lib/src/common.nr index fcb11f0db45..3be4b547363 100644 --- a/yarn-project/noir-protocol-circuits/src/crates/private-kernel-lib/src/common.nr +++ b/yarn-project/noir-protocol-circuits/src/crates/private-kernel-lib/src/common.nr @@ -376,7 +376,7 @@ pub fn contract_logic( private_call.contract_leaf_membership_witness.sibling_path ); - let purported_contract_tree_root = private_call.call_stack_item.public_inputs.header.state.partial.contract_tree.root; + let purported_contract_tree_root = private_call.call_stack_item.public_inputs.historical_header.state.partial.contract_tree.root; assert_eq( computed_contract_tree_root, purported_contract_tree_root, "computed_contract_tree_root does not match purported_contract_tree_root" ); diff --git a/yarn-project/noir-protocol-circuits/src/crates/private-kernel-lib/src/private_kernel_init.nr b/yarn-project/noir-protocol-circuits/src/crates/private-kernel-lib/src/private_kernel_init.nr index d9fb781591c..44749f9f5ec 100644 --- a/yarn-project/noir-protocol-circuits/src/crates/private-kernel-lib/src/private_kernel_init.nr +++ b/yarn-project/noir-protocol-circuits/src/crates/private-kernel-lib/src/private_kernel_init.nr @@ -21,7 +21,7 @@ struct PrivateKernelInputsInit { impl PrivateKernelInputsInit { fn initialize_end_values(self, public_inputs: &mut KernelCircuitPublicInputsBuilder) { public_inputs.constants = CombinedConstantData { - header: self.private_call.call_stack_item.public_inputs.header, + header: self.private_call.call_stack_item.public_inputs.historical_header, tx_context: self.tx_request.tx_context, }; } diff --git a/yarn-project/noir-protocol-circuits/src/crates/private-kernel-lib/src/private_kernel_inner.nr b/yarn-project/noir-protocol-circuits/src/crates/private-kernel-lib/src/private_kernel_inner.nr index ba3314ba0d2..bbc1961542d 100644 --- a/yarn-project/noir-protocol-circuits/src/crates/private-kernel-lib/src/private_kernel_inner.nr +++ b/yarn-project/noir-protocol-circuits/src/crates/private-kernel-lib/src/private_kernel_inner.nr @@ -22,7 +22,7 @@ impl PrivateKernelInputsInner { } fn validate_contract_tree_root(self) { - let purported_contract_tree_root = self.private_call.call_stack_item.public_inputs.header.state.partial.contract_tree.root; + let purported_contract_tree_root = self.private_call.call_stack_item.public_inputs.historical_header.state.partial.contract_tree.root; let previous_kernel_contract_tree_root = self.previous_kernel.public_inputs.constants.header.state.partial.contract_tree.root; assert(purported_contract_tree_root == previous_kernel_contract_tree_root, "purported_contract_tree_root does not match previous_kernel_contract_tree_root"); diff --git a/yarn-project/noir-protocol-circuits/src/crates/types/src/abis/private_circuit_public_inputs.nr b/yarn-project/noir-protocol-circuits/src/crates/types/src/abis/private_circuit_public_inputs.nr index 7ebae29b69d..6439a66da6e 100644 --- a/yarn-project/noir-protocol-circuits/src/crates/types/src/abis/private_circuit_public_inputs.nr +++ b/yarn-project/noir-protocol-circuits/src/crates/types/src/abis/private_circuit_public_inputs.nr @@ -51,7 +51,8 @@ struct PrivateCircuitPublicInputs { encrypted_log_preimages_length: Field, unencrypted_log_preimages_length: Field, - header: Header, + // Header of the block the transaction is executing against (not the block the transaction is included in). + historical_header: Header, contract_deployment_data: ContractDeploymentData, @@ -85,7 +86,7 @@ impl Hash for PrivateCircuitPublicInputs { fields.push_array(self.unencrypted_logs_hash); fields.push(self.encrypted_log_preimages_length); fields.push(self.unencrypted_log_preimages_length); - fields.push_array(self.header.serialize()); + fields.push_array(self.historical_header.serialize()); fields.push(self.contract_deployment_data.hash()); fields.push(self.chain_id); fields.push(self.version); @@ -120,7 +121,7 @@ impl PrivateCircuitPublicInputs { fields.push_array(self.unencrypted_logs_hash); fields.push(self.encrypted_log_preimages_length); fields.push(self.unencrypted_log_preimages_length); - fields.push_array(self.header.serialize()); + fields.push_array(self.historical_header.serialize()); fields.push_array(self.contract_deployment_data.serialize()); fields.push(self.chain_id); fields.push(self.version); diff --git a/yarn-project/noir-protocol-circuits/src/crates/types/src/abis/public_circuit_public_inputs.nr b/yarn-project/noir-protocol-circuits/src/crates/types/src/abis/public_circuit_public_inputs.nr index abb3a8bbeec..fafcec432ae 100644 --- a/yarn-project/noir-protocol-circuits/src/crates/types/src/abis/public_circuit_public_inputs.nr +++ b/yarn-project/noir-protocol-circuits/src/crates/types/src/abis/public_circuit_public_inputs.nr @@ -46,7 +46,7 @@ struct PublicCircuitPublicInputs{ // variable-length data. unencrypted_log_preimages_length: Field, - header: Header, + historical_header: Header, prover_address: AztecAddress, } @@ -75,7 +75,7 @@ impl PublicCircuitPublicInputs{ inputs.push_array(self.new_l2_to_l1_msgs); inputs.push_array(self.unencrypted_logs_hash); inputs.push(self.unencrypted_log_preimages_length); - inputs.push_array(self.header.serialize()); + inputs.push_array(self.historical_header.serialize()); inputs.push(self.prover_address.to_field()); assert_eq(inputs.len(), PUBLIC_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH, "Incorrect number of input fields when hashing PublicCircuitPublicInputs"); @@ -105,7 +105,7 @@ impl PublicCircuitPublicInputs{ fields.push_array(self.new_l2_to_l1_msgs); fields.push_array(self.unencrypted_logs_hash); fields.push(self.unencrypted_log_preimages_length); - fields.push_array(self.header.serialize()); + fields.push_array(self.historical_header.serialize()); fields.push(self.prover_address.to_field()); fields.storage } diff --git a/yarn-project/noir-protocol-circuits/src/crates/types/src/tests/fixtures.nr b/yarn-project/noir-protocol-circuits/src/crates/types/src/tests/fixtures.nr index b4a621e421c..cbefab05efe 100644 --- a/yarn-project/noir-protocol-circuits/src/crates/types/src/tests/fixtures.nr +++ b/yarn-project/noir-protocol-circuits/src/crates/types/src/tests/fixtures.nr @@ -27,7 +27,7 @@ fn empty_append_only_tree() -> AppendOnlyTreeSnapshot { AppendOnlyTreeSnapshot::empty() } -global BLOCK_HEADER = Header { +global HEADER = Header { last_archive: empty_append_only_tree(), body_hash: [0; NUM_FIELDS_PER_SHA256], state: StateReference { diff --git a/yarn-project/noir-protocol-circuits/src/crates/types/src/tests/previous_kernel_data_builder.nr b/yarn-project/noir-protocol-circuits/src/crates/types/src/tests/previous_kernel_data_builder.nr index ec65aa24041..ec329d912ed 100644 --- a/yarn-project/noir-protocol-circuits/src/crates/types/src/tests/previous_kernel_data_builder.nr +++ b/yarn-project/noir-protocol-circuits/src/crates/types/src/tests/previous_kernel_data_builder.nr @@ -57,7 +57,7 @@ impl PreviousKernelDataBuilder { contract_address: fixtures::contracts::parent_contract.address, portal_contract_address: fixtures::contracts::parent_contract.portal_contract_address, end, - header: fixtures::BLOCK_HEADER, + header: fixtures::HEADER, tx_context, is_private: true, proof: Proof {}, diff --git a/yarn-project/noir-protocol-circuits/src/crates/types/src/tests/private_circuit_public_inputs_builder.nr b/yarn-project/noir-protocol-circuits/src/crates/types/src/tests/private_circuit_public_inputs_builder.nr index 5be3ac62fd2..5617dcd970b 100644 --- a/yarn-project/noir-protocol-circuits/src/crates/types/src/tests/private_circuit_public_inputs_builder.nr +++ b/yarn-project/noir-protocol-circuits/src/crates/types/src/tests/private_circuit_public_inputs_builder.nr @@ -49,7 +49,7 @@ struct PrivateCircuitPublicInputsBuilder { encrypted_log_preimages_length: Field, unencrypted_log_preimages_length: Field, - header: Header, + historical_header: Header, contract_deployment_data: ContractDeploymentData, @@ -101,7 +101,7 @@ impl PrivateCircuitPublicInputsBuilder { public_inputs.call_context = call_context; public_inputs.args_hash = args_hash; public_inputs.contract_deployment_data = contract_deployment_data; - public_inputs.header = fixtures::BLOCK_HEADER; + public_inputs.historical_header = fixtures::HEADER; public_inputs.chain_id = 0; public_inputs.version = 1; @@ -131,7 +131,7 @@ impl PrivateCircuitPublicInputsBuilder { encrypted_log_preimages_length: self.encrypted_log_preimages_length, unencrypted_log_preimages_length: self.unencrypted_log_preimages_length, - header: self.header, + historical_header: self.historical_header, contract_deployment_data: self.contract_deployment_data, diff --git a/yarn-project/noir-protocol-circuits/src/crates/types/src/tests/public_circuit_public_inputs_builder.nr b/yarn-project/noir-protocol-circuits/src/crates/types/src/tests/public_circuit_public_inputs_builder.nr index 9326a4f165c..e266a8e34ee 100644 --- a/yarn-project/noir-protocol-circuits/src/crates/types/src/tests/public_circuit_public_inputs_builder.nr +++ b/yarn-project/noir-protocol-circuits/src/crates/types/src/tests/public_circuit_public_inputs_builder.nr @@ -36,7 +36,7 @@ struct PublicCircuitPublicInputsBuilder { new_l2_to_l1_msgs: BoundedVec, unencrypted_logs_hash: [Field; NUM_FIELDS_PER_SHA256], unencrypted_log_preimages_length: Field, - header: Header, + historical_header: Header, prover_address: AztecAddress, } @@ -44,7 +44,7 @@ impl PublicCircuitPublicInputsBuilder { pub fn new() -> Self { let mut public_inputs: PublicCircuitPublicInputsBuilder = dep::std::unsafe::zeroed(); public_inputs.call_context.msg_sender = fixtures::MSG_SENDER; - public_inputs.header = fixtures::BLOCK_HEADER; + public_inputs.historical_header = fixtures::HEADER; public_inputs } @@ -61,7 +61,7 @@ impl PublicCircuitPublicInputsBuilder { new_l2_to_l1_msgs: self.new_l2_to_l1_msgs.storage, unencrypted_logs_hash: self.unencrypted_logs_hash, unencrypted_log_preimages_length: self.unencrypted_log_preimages_length, - header: self.header, + historical_header: self.historical_header, prover_address: self.prover_address, } } diff --git a/yarn-project/noir-protocol-circuits/src/type_conversion.ts b/yarn-project/noir-protocol-circuits/src/type_conversion.ts index 64ae1cbd600..4a493ff4d75 100644 --- a/yarn-project/noir-protocol-circuits/src/type_conversion.ts +++ b/yarn-project/noir-protocol-circuits/src/type_conversion.ts @@ -619,7 +619,7 @@ export function mapPrivateCircuitPublicInputsToNoir( unencrypted_logs_hash: mapTuple(privateCircuitPublicInputs.unencryptedLogsHash, mapFieldToNoir), encrypted_log_preimages_length: mapFieldToNoir(privateCircuitPublicInputs.encryptedLogPreimagesLength), unencrypted_log_preimages_length: mapFieldToNoir(privateCircuitPublicInputs.unencryptedLogPreimagesLength), - header: mapHeaderToNoir(privateCircuitPublicInputs.header), + historical_header: mapHeaderToNoir(privateCircuitPublicInputs.historicalHeader), contract_deployment_data: mapContractDeploymentDataToNoir(privateCircuitPublicInputs.contractDeploymentData), chain_id: mapFieldToNoir(privateCircuitPublicInputs.chainId), version: mapFieldToNoir(privateCircuitPublicInputs.version), @@ -1211,7 +1211,7 @@ export function mapPublicCircuitPublicInputsToNoir( new_l2_to_l1_msgs: mapTuple(publicInputs.newL2ToL1Msgs, mapFieldToNoir), unencrypted_logs_hash: mapTuple(publicInputs.unencryptedLogsHash, mapFieldToNoir), unencrypted_log_preimages_length: mapFieldToNoir(publicInputs.unencryptedLogPreimagesLength), - header: mapHeaderToNoir(publicInputs.header), + historical_header: mapHeaderToNoir(publicInputs.historicalHeader), prover_address: mapAztecAddressToNoir(publicInputs.proverAddress), }; diff --git a/yarn-project/sequencer-client/src/sequencer/public_processor.ts b/yarn-project/sequencer-client/src/sequencer/public_processor.ts index f2fa29a8899..3fcd01cf4dc 100644 --- a/yarn-project/sequencer-client/src/sequencer/public_processor.ts +++ b/yarn-project/sequencer-client/src/sequencer/public_processor.ts @@ -309,7 +309,7 @@ export class PublicProcessor { publicCallStackHashes, unencryptedLogsHash, unencryptedLogPreimagesLength, - header: this.header, + historicalHeader: this.header, }); }