From 56516f3813ccf175b381ac943a746aee361a51ba Mon Sep 17 00:00:00 2001 From: Bobbin Threadbare Date: Mon, 29 Jul 2024 16:56:53 -0700 Subject: [PATCH 1/3] chore: add labeled and unlabeled triggers to changlog check task --- .github/workflows/changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 5fde0d8d0..c890c4c26 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -5,7 +5,7 @@ name: changelog on: pull_request: - types: [opened, reopened, synchronize] + types: [opened, reopened, synchronize, labeled, unlabeled] jobs: changelog: From a942c54bab7bfa1c08d89cb58fe5dd4c6afe05b0 Mon Sep 17 00:00:00 2001 From: omahs <73983677+omahs@users.noreply.github.com> Date: Tue, 30 Jul 2024 01:58:20 +0200 Subject: [PATCH 2/3] docs: fix typos (#805) --- docs/architecture/state.md | 4 ++-- docs/architecture/transactions/contexts.md | 4 ++-- docs/architecture/transactions/execution.md | 4 ++-- docs/architecture/transactions/kernel.md | 4 ++-- miden-tx/src/tests/kernel_tests/test_account.rs | 8 ++++---- objects/README.md | 2 +- objects/src/transaction/prepared_tx.rs | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/architecture/state.md b/docs/architecture/state.md index bbb55217b..eb6fec7fa 100644 --- a/docs/architecture/state.md +++ b/docs/architecture/state.md @@ -85,9 +85,9 @@ Nullifiers are stored in a sparse Merkle tree, which maps [note nullifiers](note ![Architecture core concepts](../img/architecture/state/nullifier-db.png){ width="80%" } -To prove that a note has not been consumed previously, the operator needs to provide a Merkle path to its node, and then show that the value in that node is `0`. In our case nullifiers are $32$ bytes each, and thus, the height of the Sparse Merkle Tree need to be $256$. +To prove that a note has not been consumed previously, the operator needs to provide a Merkle path to its node, and then show that the value in that node is `0`. In our case nullifiers are $32$ bytes each, and thus, the height of the Sparse Merkle Tree needs to be $256$. -To add new nullifiers to the database, operators needs to maintain the entire nullifier set. Otherwise, they would not be able to compute the new root of the tree. +To add new nullifiers to the database, operators need to maintain the entire nullifier set. Otherwise, they would not be able to compute the new root of the tree. !!! note Nullifiers as constructed in Miden break linkability of privately stored notes and the information about the note's consumption. To know the [note's nullifier](notes.md#note-nullifier-to-ensure-private-consumption) one must know the note's data. diff --git a/docs/architecture/transactions/contexts.md b/docs/architecture/transactions/contexts.md index aaf834c9d..2deca6b55 100644 --- a/docs/architecture/transactions/contexts.md +++ b/docs/architecture/transactions/contexts.md @@ -64,7 +64,7 @@ export.receive_asset end ``` -The [account API](https://github.com/0xPolygonMiden/miden-base/blob/main/miden-lib/asm/miden/account.masm#L162) exposes procedures to manage accounts. This particular procedure that was called by the wallet invokes a `syscall` to return back to the root context **(3)**, where the account vault is stored in memory (see prologue). `syscall` can incoke all procedures defined in the [Kernel API](https://github.com/0xPolygonMiden/miden-base/blob/main/miden-lib/asm/kernels/transaction/api.masm). +The [account API](https://github.com/0xPolygonMiden/miden-base/blob/main/miden-lib/asm/miden/account.masm#L162) exposes procedures to manage accounts. This particular procedure that was called by the wallet invokes a `syscall` to return back to the root context **(3)**, where the account vault is stored in memory (see prologue). `syscall` can invoke all procedures defined in the [Kernel API](https://github.com/0xPolygonMiden/miden-base/blob/main/miden-lib/asm/kernels/transaction/api.masm). ```arduino #! Add the specified asset to the vault. @@ -76,4 +76,4 @@ end Now, the asset can be safely added to the vault within the kernel context, and the note can be successfully processed. -
\ No newline at end of file +
diff --git a/docs/architecture/transactions/execution.md b/docs/architecture/transactions/execution.md index 0b22c732e..b3c11c277 100644 --- a/docs/architecture/transactions/execution.md +++ b/docs/architecture/transactions/execution.md @@ -4,7 +4,7 @@ comments: true The Miden transaction executor is the component that executes transactions. -Transaction execution consists of the following steps and results in a `ExecutedTransaction` object: +Transaction execution consists of the following steps and results in an `ExecutedTransaction` object: 1. Fetch the data required to execute a transaction from the data store. 2. Compile the transaction into an executable [MASM](https://0xpolygonmiden.github.io/miden-vm/user_docs/assembly/main.html) program using the transaction compiler. @@ -49,4 +49,4 @@ A successfully executed transaction results in a new account state which is a ve The transaction prover proves the inputted `ExecutedTransaction` and returns a `ProvenTransaction` object. The Miden node verifies the `ProvenTransaction` object using the transaction verifier and, if valid, updates the [state](../state.md) databases. -
\ No newline at end of file +
diff --git a/docs/architecture/transactions/kernel.md b/docs/architecture/transactions/kernel.md index cc6dcda35..f1ebbd602 100644 --- a/docs/architecture/transactions/kernel.md +++ b/docs/architecture/transactions/kernel.md @@ -28,7 +28,7 @@ The transaction kernel program receives two types of inputs, public inputs via t The operand stack holds the global inputs which serve as a commitment to the data being provided via the advice provider. -The advice provider holds data of the last known block, account and input note data. The details are layed out in the next paragraph. +The advice provider holds data of the last known block, account and input note data. The details are laid out in the next paragraph. ## Prologue @@ -156,4 +156,4 @@ There is an exception for special accounts, called faucets, which can mint or bu The transaction kernel program outputs the transaction script root, a commitment of all newly created outputs notes, and the account hash in its new state. -
\ No newline at end of file +
diff --git a/miden-tx/src/tests/kernel_tests/test_account.rs b/miden-tx/src/tests/kernel_tests/test_account.rs index dc3a47eee..bf384a98d 100644 --- a/miden-tx/src/tests/kernel_tests/test_account.rs +++ b/miden-tx/src/tests/kernel_tests/test_account.rs @@ -41,7 +41,7 @@ pub fn test_set_code_is_not_immediate() { assert_eq!( read_root_mem_value(&process, ACCT_CODE_ROOT_PTR), tx_context.account().code().root().as_elements(), - "the code root must not change immediatelly", + "the code root must not change immediately", ); assert_eq!( @@ -373,17 +373,17 @@ fn test_get_map_item() { assert_eq!( Word::default(), process.get_stack_word(1), - "The the rest of the stack must be cleared", + "The rest of the stack must be cleared", ); assert_eq!( Word::default(), process.get_stack_word(2), - "The the rest of the stack must be cleared", + "The rest of the stack must be cleared", ); assert_eq!( Word::default(), process.get_stack_word(3), - "The the rest of the stack must be cleared", + "The rest of the stack must be cleared", ); } } diff --git a/objects/README.md b/objects/README.md index 3959e5096..e1ac52e0c 100644 --- a/objects/README.md +++ b/objects/README.md @@ -22,7 +22,7 @@ Structures used to define fungible and non-fungible assets. Accounts own assets ### Block -Structures used to define a block. These objects contains authentication structures, merkle trees, used to represent the state of the rollup at a given point in time. +Structures used to define a block. These objects contain authentication structures, merkle trees, used to represent the state of the rollup at a given point in time. ### Notes diff --git a/objects/src/transaction/prepared_tx.rs b/objects/src/transaction/prepared_tx.rs index 80d20b9ac..b6e63e798 100644 --- a/objects/src/transaction/prepared_tx.rs +++ b/objects/src/transaction/prepared_tx.rs @@ -8,7 +8,7 @@ use super::{ /// A struct that contains all of the data required to execute a transaction. /// /// This includes: -/// - A an executable program which defines the transaction. +/// - An executable program which defines the transaction. /// - An optional transaction script. /// - A set of inputs against which the transaction program should be executed. #[derive(Debug)] From 194267b058bbec024251b36e95c23aba6a329e8a Mon Sep 17 00:00:00 2001 From: igamigo Date: Tue, 30 Jul 2024 16:39:37 -0300 Subject: [PATCH 3/3] test: Remove test subdir in favor of inline mod (#809) --- miden-lib/src/lib.rs | 27 ++++++++++++++++++++++++--- miden-lib/src/tests/mod.rs | 22 ---------------------- 2 files changed, 24 insertions(+), 25 deletions(-) delete mode 100644 miden-lib/src/tests/mod.rs diff --git a/miden-lib/src/lib.rs b/miden-lib/src/lib.rs index 0ef06ecb3..8095832cc 100644 --- a/miden-lib/src/lib.rs +++ b/miden-lib/src/lib.rs @@ -18,9 +18,6 @@ pub mod accounts; pub mod notes; pub mod transaction; -#[cfg(all(test, feature = "std"))] -mod tests; - // RE-EXPORTS // ================================================================================================ @@ -60,3 +57,27 @@ impl Library for MidenLib { self.contents.dependencies() } } + +// TESTS +// ================================================================================================ + +// NOTE: Most kernel-related tests can be found under /miden-tx/kernel_tests +#[cfg(all(test, feature = "std"))] +mod tests { + use miden_objects::assembly::Library; + + #[test] + fn test_compile() { + let path = "miden::kernels::tx::memory::get_input_note_ptr"; + let miden = super::MidenLib::default(); + let exists = miden.modules().any(|module| { + module + .ast + .procs() + .iter() + .any(|proc| module.path.append(&proc.name).unwrap().as_str() == path) + }); + + assert!(exists); + } +} diff --git a/miden-lib/src/tests/mod.rs b/miden-lib/src/tests/mod.rs deleted file mode 100644 index e74c43e73..000000000 --- a/miden-lib/src/tests/mod.rs +++ /dev/null @@ -1,22 +0,0 @@ -/// NOTE: Most kernel-related tests can be found under /miden-tx/kernel_tests -// CONSTANTS -// ================================================================================================ -use miden_objects::assembly::Library; - -// TESTS -// ================================================================================================ - -#[test] -fn test_compile() { - let path = "miden::kernels::tx::memory::get_input_note_ptr"; - let miden = super::MidenLib::default(); - let exists = miden.modules().any(|module| { - module - .ast - .procs() - .iter() - .any(|proc| module.path.append(&proc.name).unwrap().as_str() == path) - }); - - assert!(exists); -}