Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add block_num as a public input to the transaction kernel #1126

Merged
merged 10 commits into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [BREAKING] Renamed `AccountData` to `AccountFile` (#1116).
- Implement transaction batch prover in Rust (#1112).
- [BREAKING] Refactored config file for `miden-proving-service` to be based on environment variables (#1120).
- Added block number as a public input to the transaction kernel. Updated prologue logic to validate the global input block number is consistent with the commitment block number (#1126).

## 0.7.2 (2025-01-28) - `miden-objects` crate only

Expand Down
28 changes: 14 additions & 14 deletions crates/miden-lib/asm/kernels/transaction/lib/memory.masm
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,25 @@ const.TX_EXPIRATION_BLOCK_NUM_PTR=28
# GLOBAL INPUTS
# -------------------------------------------------------------------------------------------------

# The memory address at which the global inputs section begins
# The memory address at which the global inputs section begins.
const.GLOBAL_INPUTS_SECTION_OFFSET=400

# The memory address at which the latest known block hash is stored
# The memory address at which the latest known block hash is stored.
const.BLK_HASH_PTR=400

# The memory address at which the account ID felts are stored.
const.ACCT_ID_PTR=404

# The memory address at which the initial account hash is stored
# The memory address at which the initial account hash is stored.
const.INIT_ACCT_HASH_PTR=408

# The memory address at which the input notes commitment is stored
# The memory address at which the input notes commitment is stored.
const.INPUT_NOTES_COMMITMENT_PTR=412

# The memory address at which the initial nonce is stored
# The memory address at which the initial nonce is stored.
const.INIT_NONCE_PTR=416

# The memory address at which the transaction script mast root is stored
# The memory address at which the transaction script mast root is stored.
const.TX_SCRIPT_ROOT_PTR=420

# GLOBAL BLOCK DATA
Expand Down Expand Up @@ -123,14 +123,14 @@ const.KERNEL_PROCEDURES_PTR=1604
# -------------------------------------------------------------------------------------------------

# The largest memory address which can be used to load the foreign account data.
# It is computed as `2048 * 64 * 4` -- this is the memory address where the data block of the 64th
# It is computed as `2048 * 64 * 4` -- this is the memory address where the data block of the 64th
# account starts.
const.MAX_FOREIGN_ACCOUNT_PTR=524288

# The memory address at which the native account data is stored.
const.NATIVE_ACCOUNT_DATA_PTR=8192

# The length of the memory interval that the account data occupies.
# The length of the memory interval that the account data occupies.
const.ACCOUNT_DATA_LENGTH=8192

# The offsets at which the account data is stored relative to the start of the account data segment.
Expand Down Expand Up @@ -241,7 +241,7 @@ end
#! Outputs: [input_vault_root_ptr]
#!
#! Where:
#! - input_vault_root_ptr is a pointer to the memory address at which the input vault root is
#! - input_vault_root_ptr is a pointer to the memory address at which the input vault root is
#! stored.
export.get_input_vault_root_ptr
push.INPUT_VAULT_ROOT_PTR
Expand Down Expand Up @@ -649,7 +649,7 @@ export.get_native_account_data_ptr
push.NATIVE_ACCOUNT_DATA_PTR
end

#! Returns the length of the memory interval that the account data occupies.
#! Returns the length of the memory interval that the account data occupies.
#!
#! Inputs: []
#! Outputs: [acct_data_length]
Expand All @@ -666,7 +666,7 @@ end
#! Outputs: [max_foreign_acct_ptr]
#!
#! Where:
#! - max_foreign_acct_ptr is the largest memory address which can be used to load the foreign
#! - max_foreign_acct_ptr is the largest memory address which can be used to load the foreign
#! account data.
export.get_max_foreign_account_ptr
push.MAX_FOREIGN_ACCOUNT_PTR
Expand Down Expand Up @@ -1063,7 +1063,7 @@ export.set_input_note_id
mem_storew
end

#! Computes a pointer to the memory address at which the nullifier associated a note with `idx` is
#! Computes a pointer to the memory address at which the nullifier associated a note with `idx` is
#! stored.
#!
#! Inputs: [idx]
Expand Down Expand Up @@ -1221,7 +1221,7 @@ export.set_input_note_num_assets
mem_store
end

#! Returns a pointer to the start of the assets segment for the input note located at the specified
#! Returns a pointer to the start of the assets segment for the input note located at the specified
#! memory address.
#!
#! Inputs: [note_ptr]
Expand Down Expand Up @@ -1449,7 +1449,7 @@ end
#! Outputs: [kernel_procedures_ptr]
#!
#! Where:
#! - kernel_procedures_ptr is the memory address where the hashes of the kernel procedures are
#! - kernel_procedures_ptr is the memory address where the hashes of the kernel procedures are
#! stored.
export.get_kernel_procedures_ptr
push.KERNEL_PROCEDURES_PTR
Expand Down
Loading
Loading