Skip to content

Commit

Permalink
better documentation of a header
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Jan 30, 2024
1 parent aafa2c8 commit e7bc0c5
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class ClientExecutionContext extends ViewDataOracle {
private readonly argsHash: Fr,
private readonly txContext: TxContext,
private readonly callContext: CallContext,
/** Header of a block whose state is used during private execution. */
/** Header of a block whose state is used during private execution (not the block the transaction is included in). */
protected readonly historicalHeader: Header,
/** List of transient auth witnesses to be used during this simulation */
protected readonly authWitnesses: AuthWitness[],
Expand Down
8 changes: 7 additions & 1 deletion yarn-project/aztec-nr/aztec/src/context.nr
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ struct PrivateContext {
new_l2_to_l1_msgs : BoundedVec<Field, MAX_NEW_L2_TO_L1_MSGS_PER_CALL>,
// docs:end:private-context

// Header of a block whose state is used during private execution (not the block the transaction is included in).
historical_header: Header,

// TODO(https://github.com/AztecProtocol/aztec-packages/issues/1165)
Expand Down Expand Up @@ -148,11 +149,14 @@ impl PrivateContext {
self.inputs.call_context.function_selector
}

// Returns the header of a block whose state is used during private execution
// Returns the header of a block whose state is used during private execution (not the block the transaction is
// included in).
pub 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 {
get_header_at(block_number, self)
}
Expand Down Expand Up @@ -494,6 +498,8 @@ struct PublicContext {
unencrypted_logs_hash: BoundedVec<Field, NUM_FIELDS_PER_SHA256>,
unencrypted_logs_preimages_length: Field,

// Header of a block whose state is used during public execution. Set by sequencer to be a header of a block
// previous to the one in which the tx is included.
historical_header: Header,
prover_address: AztecAddress,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class PrivateCircuitPublicInputs {
*/
public unencryptedLogPreimagesLength: Fr,
/**
* L2 block header.
* Header of a block whose state is used during private execution (not the block the transaction is included in).
*/
public historicalHeader: Header,
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ export class PublicCircuitPublicInputs {
*/
public unencryptedLogPreimagesLength: Fr,
/**
* L2 block header of the block preceding the block in which this tx is included.
* Header of a block whose state is used during public execution. Set by sequencer to be a header of a block
* previous to the one in which the tx is included.
*/
public historicalHeader: Header,
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct PrivateCircuitPublicInputs {
encrypted_log_preimages_length: Field,
unencrypted_log_preimages_length: Field,

// Header of the block the transaction is executing against (not the block the transaction is included in).
// Header of a block whose state is used during private execution (not the block the transaction is included in).
historical_header: Header,

contract_deployment_data: ContractDeploymentData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ struct PublicCircuitPublicInputs{
// variable-length data.
unencrypted_log_preimages_length: Field,

// Header of a block whose state is used during public execution. Set by sequencer to be a header of a block
// previous to the one in which the tx is included.
historical_header: Header,

prover_address: AztecAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class PublicProcessorFactory {

/**
* Creates a new instance of a PublicProcessor.
* @param historicalHeader - The header of the previous block.
* @param historicalHeader - The header of a block previous to the one in which the tx is included.
* @param globalVariables - The global variables for the block being processed.
* @param newContracts - Provides access to contract bytecode for public executions.
* @returns A new instance of a PublicProcessor.
Expand Down

0 comments on commit e7bc0c5

Please sign in to comment.