Skip to content

Chore: update miden-protocol#2095

Open
juan518munoz wants to merge 2 commits into
nextfrom
jmunoz-update-miden-deps
Open

Chore: update miden-protocol#2095
juan518munoz wants to merge 2 commits into
nextfrom
jmunoz-update-miden-deps

Conversation

@juan518munoz
Copy link
Copy Markdown
Collaborator

No description provided.

@juan518munoz juan518munoz force-pushed the jmunoz-update-miden-deps branch 3 times, most recently from 13a8bfe to 4ce77a3 Compare May 20, 2026 16:20
@juan518munoz juan518munoz force-pushed the jmunoz-update-miden-deps branch from 4ce77a3 to fbd4960 Compare May 20, 2026 17:56
@juan518munoz juan518munoz marked this pull request as ready for review May 20, 2026 19:09
Copy link
Copy Markdown
Collaborator

@igamigo igamigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good, leaving some comments

Comment on lines 65 to 70
let counter_account = AccountBuilder::new(init_seed)
.account_type(AccountType::RegularAccountUpdatableCode)
.storage_mode(AccountStorageMode::Network)
.storage_mode(AccountStorageMode::Public)
.with_component(account_code)
.with_auth_component(incr_nonce_auth)
.build()?;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure but I think we will need to add the NetworkNoteAllowList component here. But I think we can fix the network monitor separately if necessary cc @SantiagoPittella

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes to both, we will need that and I can tackle it in another PR.

Comment on lines +21 to +31
// Only treat full-state creations as network if the storage carries the
// standardized `NetworkAccountNoteAllowlist` slot.
let account = Account::try_from(update)
.expect("Account should be derivable by full state AccountDelta");
if account.is_public()
&& NetworkAccountNoteAllowlist::try_from(account.storage()).is_ok()
{
Some(NetworkAccountEffect::Created(account))
} else {
None
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's the NetworkAccount wrapper we can use here

Comment on lines +33 to +37
AccountUpdateDetails::Delta(update) => {
// Partial updates carry no storage we can inspect here. Forward them as updates and
// let the coordinator's actor registry filter to known network accounts.
Some(NetworkAccountEffect::Updated(update.clone()))
},
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like, from an account delta, we can no longer know whether it belongs to a network account. Is this right @PhilippGackstatter? Then this will likely need some refactoring on the NTX builder side because I think we expect to have the account in the builder if we receive a delta. But I think some of this was being refactored anyway (cc @Mirko-von-Leipzig @SantiagoPittella)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, the block subscription approach will use partial accounts

Comment on lines +234 to +236
&& let Ok(account) = Account::try_from(delta)
&& account.is_public()
&& NetworkAccountNoteAllowlist::try_from(account.storage()).is_ok()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly here we should be able to use tjhe NetworkAccount wrapper

Comment on lines +501 to +510
let response = self
.store
.clone()
.are_network_accounts(tonic::Request::new(proto::account::AccountIdList {
account_ids: vec![tx.account_id().into()],
}))
.await
.map_err(|err| {
Status::internal(format!("network-account classification failed: {err}"))
})?;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to cache new account IDs that belong to network accounts in memory as a future enhancement here

.map_err(DatabaseError::from)
}

/// Returns the subset of `account_ids` whose latest committed state is a network account.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for now we can assume that network accounts will either be network accounts forever or not (because right now changing account code and adding/removing components is not supported).

Comment on lines +1405 to +1406
if account.is_public()
&& NetworkAccountNoteAllowlist::try_from(account.storage()).is_ok()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too we should be able to use hte NetworkAccount wrapper

StorageMode::Network => AccountStorageMode::Network,
// Network accounts must be public in the new protocol model; the network-ness is
// determined by the standardized `NetworkAccountNoteAllowlist` slot in storage.
StorageMode::Network | StorageMode::Public => AccountStorageMode::Public,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably remove the Network storage mode?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants