From f1edc47bf9365b1b8f98cd43746c105ee508d7d5 Mon Sep 17 00:00:00 2001 From: SantiagoPittella Date: Wed, 7 Jan 2026 15:15:28 -0300 Subject: [PATCH 1/4] fix: send tx_inputs, use existing asset witness --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac43c616a..8bf054dde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ - Fixed missing asset setup for full account initialization ([#1461](https://github.com/0xMiden/miden-node/pull/1461)). - Fixed validator to use pre-stored asset witnesses from the transaction inputs instead of trying to open the partial vault ([#1490](https://github.com/0xMiden/miden-node/pull/1490)). - Fixed `GetNetworkAccountIds` pagination to return the chain tip ([#1489](https://github.com/0xMiden/miden-node/pull/1489)). +- Fixed validator to use pre-stored asset witnesses from the transaction inputs instead of trying to open the partial vault ([#1490](https://github.com/0xMiden/miden-node/pull/1490)). ## v0.12.6 From 04553861a82319a28c1400018ade89c541a223d3 Mon Sep 17 00:00:00 2001 From: SantiagoPittella Date: Thu, 8 Jan 2026 17:27:29 -0300 Subject: [PATCH 2/4] fix: use slot names --- bin/network-monitor/src/assets/counter_program.masm | 10 +++++----- bin/network-monitor/src/counter.rs | 13 +++++++++---- bin/network-monitor/src/deploy/counter.rs | 4 ++-- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/bin/network-monitor/src/assets/counter_program.masm b/bin/network-monitor/src/assets/counter_program.masm index 175e7e969..9cd6536f4 100644 --- a/bin/network-monitor/src/assets/counter_program.masm +++ b/bin/network-monitor/src/assets/counter_program.masm @@ -1,7 +1,7 @@ # Counter program for network monitoring with note authentication # Storage layout: -# - Slot 0: counter value (u64) -# - Slot 1: authorized wallet account id as [prefix, suffix, 0, 0] +# - OWNER_SLOT: authorized wallet account id as [prefix, suffix, 0, 0] +# - COUNTER_SLOT: counter value (u64) use miden::core::sys use miden::protocol::active_account @@ -11,14 +11,14 @@ use miden::protocol::account_id use miden::protocol::tx -# The slot in this component's storage layout where the counter is stored. const COUNTER_SLOT = word("miden::monitor::counter_contract::counter") +const OWNER_SLOT = word("miden::monitor::counter_contract::owner") # Increment function with note authentication # => [] pub proc increment - # Ensure the note sender matches the authorized wallet stored in slot 1. - push.1 exec.active_account::get_item + # Ensure the note sender matches the authorized wallet. + push.OWNER_SLOT[0..2] exec.active_account::get_item # => [owner_prefix, owner_suffix, 0, 0] exec.active_note::get_sender diff --git a/bin/network-monitor/src/counter.rs b/bin/network-monitor/src/counter.rs index fdcbe58f2..d9c3ae9d9 100644 --- a/bin/network-monitor/src/counter.rs +++ b/bin/network-monitor/src/counter.rs @@ -43,6 +43,7 @@ use tracing::{error, info, instrument, warn}; use crate::COMPONENT; use crate::config::MonitorConfig; +use crate::deploy::counter::COUNTER_SLOT_NAME; use crate::deploy::{MonitorDataStore, create_genesis_aware_rpc_client, get_counter_library}; use crate::status::{ CounterTrackingDetails, @@ -83,7 +84,7 @@ async fn get_genesis_block_header(rpc_client: &mut RpcClient) -> Result = LazyLock::new(|| { +pub static OWNER_SLOT_NAME: LazyLock = LazyLock::new(|| { StorageSlotName::new("miden::monitor::counter_contract::owner") .expect("storage slot name should be valid") }); -static COUNTER_SLOT_NAME: LazyLock = LazyLock::new(|| { +pub static COUNTER_SLOT_NAME: LazyLock = LazyLock::new(|| { StorageSlotName::new("miden::monitor::counter_contract::counter") .expect("storage slot name should be valid") }); From f4c9707b03d379acc119732d3a2ef3813475b861 Mon Sep 17 00:00:00 2001 From: Santiago Pittella <87827390+SantiagoPittella@users.noreply.github.com> Date: Fri, 9 Jan 2026 12:39:02 -0300 Subject: [PATCH 3/4] review: use context Co-authored-by: Mirko <48352201+Mirko-von-Leipzig@users.noreply.github.com> --- bin/network-monitor/src/counter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/network-monitor/src/counter.rs b/bin/network-monitor/src/counter.rs index d9c3ae9d9..48539adb6 100644 --- a/bin/network-monitor/src/counter.rs +++ b/bin/network-monitor/src/counter.rs @@ -100,7 +100,7 @@ async fn fetch_counter_value( let word = account .storage() .get_item(&COUNTER_SLOT_NAME) - .map_err(|e| anyhow::anyhow!("failed to get counter storage slot: {e}"))?; + .context("failed to get counter storage slot")?; let value = word.as_elements().first().expect("a word is always 4 elements").as_int(); From af90ff3fe1f4d8b4ab8901fe82ce73a16bf16768 Mon Sep 17 00:00:00 2001 From: SantiagoPittella Date: Fri, 9 Jan 2026 12:40:35 -0300 Subject: [PATCH 4/4] docs: add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bf054dde..c1081f3cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ - Fixed validator to use pre-stored asset witnesses from the transaction inputs instead of trying to open the partial vault ([#1490](https://github.com/0xMiden/miden-node/pull/1490)). - Fixed `GetNetworkAccountIds` pagination to return the chain tip ([#1489](https://github.com/0xMiden/miden-node/pull/1489)). - Fixed validator to use pre-stored asset witnesses from the transaction inputs instead of trying to open the partial vault ([#1490](https://github.com/0xMiden/miden-node/pull/1490)). +- Fixed the network monitor counter account to use the storage slot name ([#1492](https://github.com/0xMiden/miden-node/pull/1492)). ## v0.12.6