Skip to content

Commit

Permalink
refactor: update dynamic calls and executions
Browse files Browse the repository at this point in the history
  • Loading branch information
Fumuran committed Oct 30, 2024
1 parent b575e8a commit 335bffa
Show file tree
Hide file tree
Showing 13 changed files with 205 additions and 414 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,28 @@ lto = true

[workspace.dependencies]
#assembly = { package = "miden-assembly", version = "0.10", default-features = false }
assembly = { package = "miden-assembly", git = "https://github.com/0xPolygonMiden/miden-vm.git", branch = "next", default-features = false }
assembly = { package = "miden-assembly", git = "https://github.com/0xPolygonMiden/miden-vm.git", branch = "plafer-1091-dyn-op-rework", default-features = false }

miden-crypto = { version = "0.11", default-features = false }
#miden-crypto = { git = "https://github.com/0xPolygonMiden/miden-vm.git", branch = "next", default-features = false }

miden-lib = { path = "miden-lib", version = "0.6", default-features = false }
miden-objects = { path = "objects", version = "0.6", default-features = false }

#miden-prover = { version = "0.10", default-features = false }
miden-prover = { git = "https://github.com/0xPolygonMiden/miden-vm.git", branch = "next", default-features = false }
miden-prover = { git = "https://github.com/0xPolygonMiden/miden-vm.git", branch = "plafer-1091-dyn-op-rework", default-features = false }

#miden-stdlib = { version = "0.10", default-features = false }
miden-stdlib = { git = "https://github.com/0xPolygonMiden/miden-vm.git", branch = "next", default-features = false }
miden-stdlib = { git = "https://github.com/0xPolygonMiden/miden-vm.git", branch = "plafer-1091-dyn-op-rework", default-features = false }

miden-tx = { path = "miden-tx", version = "0.6", default-features = false }

#miden-verifier = { version = "0.10", default-features = false }
miden-verifier = { git = "https://github.com/0xPolygonMiden/miden-vm.git", branch = "next", default-features = false }
miden-verifier = { git = "https://github.com/0xPolygonMiden/miden-vm.git", branch = "plafer-1091-dyn-op-rework", default-features = false }

rand = { version = "0.8", default-features = false }

#vm-core = { package = "miden-core", version = "0.10", default-features = false }
vm-core = { package = "miden-core", git = "https://github.com/0xPolygonMiden/miden-vm.git", branch = "next", default-features = false }
vm-core = { package = "miden-core", git = "https://github.com/0xPolygonMiden/miden-vm.git", branch = "plafer-1091-dyn-op-rework", default-features = false }

#vm-processor = { package = "miden-processor", version = "0.10", default-features = false }
vm-processor = { package = "miden-processor", git = "https://github.com/0xPolygonMiden/miden-vm.git", branch = "next", default-features = false }
vm-processor = { package = "miden-processor", git = "https://github.com/0xPolygonMiden/miden-vm.git", branch = "plafer-1091-dyn-op-rework", default-features = false }
6 changes: 5 additions & 1 deletion docs/architecture/transactions/kernel.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ If a transaction script is provided, its root is stored at a pre-defined memory

## Note processing

Input notes are consumed in a loop.
Input notes are consumed in a loop.

For every note, the [MAST root](https://0xpolygonmiden.github.io/miden-vm/design/programs.html) of the note script is loaded onto the stack. Then, by calling a [`dyncall`](https://0xpolygonmiden.github.io/miden-vm/user_docs/assembly/code_organization.html?highlight=dyncall#dynamic-procedure-invocation) the note script is executed in a new context which prevents unwanted memory access.

Expand All @@ -102,6 +102,10 @@ For every note, the [MAST root](https://0xpolygonmiden.github.io/miden-vm/design
exec.note::prepare_note
# => [NOTE_SCRIPT_HASH]
# store the NOTE_SCRIPT_HASH to the memory to be able to call it dynamically
loc_storew.0 dropw locaddr.0
# => [note_script_hash_addr]
# invoke the note script using the dyncall instruction
dyncall
# => [OUTPUT_3, OUTPUT_2, OUTPUT_1, OUTPUT_0]
Expand Down
Loading

0 comments on commit 335bffa

Please sign in to comment.