diff --git a/CHANGELOG.md b/CHANGELOG.md index ac43c616a..c1081f3cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,8 @@ - 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)). +- Fixed the network monitor counter account to use the storage slot name ([#1492](https://github.com/0xMiden/miden-node/pull/1492)). ## v0.12.6 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..48539adb6 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") });