From b1010ae71dd22ce5fa358dc4d83d70682dbd1494 Mon Sep 17 00:00:00 2001 From: benesjan Date: Mon, 29 Jan 2024 08:40:10 +0000 Subject: [PATCH] fixed docs --- docs/docs/developers/contracts/syntax/context.mdx | 12 +++++++++--- .../src/crates/types/src/header.nr | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/docs/developers/contracts/syntax/context.mdx b/docs/docs/developers/contracts/syntax/context.mdx index 9a2691b7bd20..9b14aaa45018 100644 --- a/docs/docs/developers/contracts/syntax/context.mdx +++ b/docs/docs/developers/contracts/syntax/context.mdx @@ -71,11 +71,17 @@ The call context contains information about the current call being made: - is_static_call: This will be set if and only if the current call is a static call. In a static call, state changing altering operations are not allowed. - is_contract_deployment: This will be set if and only if the current call is the contract's constructor. -### Block Header +### Header -Another structure that is contained within the context is the Block Header object. This object is a special one as it contains all of the roots of Aztec's data trees. +Another structure that is contained within the context is the Header object. +In the private context this is a header of a block which used to generate proofs against. +In the public context this is a header of the block in which the transaction is to be included. -#include_code block-header /yarn-project/noir-protocol-circuits/src/crates/types/src/abis/header.nr rust +#include_code header /yarn-project/noir-protocol-circuits/src/crates/types/src/header.nr rust + +:::info +The header can be of latest block only in the public context because only public transactions are being executed by the sequencer and therefore only public transactions can have this information. +::: ### Contract Deployment Data diff --git a/yarn-project/noir-protocol-circuits/src/crates/types/src/header.nr b/yarn-project/noir-protocol-circuits/src/crates/types/src/header.nr index 9d32cad94f86..17c079e60750 100644 --- a/yarn-project/noir-protocol-circuits/src/crates/types/src/header.nr +++ b/yarn-project/noir-protocol-circuits/src/crates/types/src/header.nr @@ -26,12 +26,14 @@ use crate::{ }, }; +// docs:start:header struct Header { last_archive: AppendOnlyTreeSnapshot, body_hash: [Field; NUM_FIELDS_PER_SHA256], state: StateReference, global_variables: GlobalVariables, } +// docs:end:header impl Header {