Skip to content

Replace network note detection with NetworkAccountTarget #1522

@PhilippGackstatter

Description

@PhilippGackstatter

When upgrading miden-node to latest miden-base, there are some relevant changes.

  • Note::is_network_note, NoteTag::is_single_target and NoteTag::NetworkAccount were removed, so there is no more conversion path from NoteTag to NetworkAccountPrefix. Instead, notes should be detected as network notes whenever their attachment is miden_standards::note::NetworkAccountTarget, which can be decoded with try_from.
    • It seems it would make sense to redefine NetworkAccountPrefix(u32) as NetworkAccountId(AccountId) and then convert NetworkAccountTarget::target_id into NetworkAccountId.
    • Similarly, SingleTargetNetworkNote would conceptually be a Note whose attachment is NetworkAccountTarget.
  • NoteMetadata::aux was removed and can be replaced with NoteAttachment, but most likely aux was just set to zero anyway in most places.
  • NoteMetadata::execution_hint was moved to NetworkAccountTarget.

I don't see any usages of note tag or metadata in the network monitor that aren't covered by the above, but ping me for questions.

cc @SantiagoPittella

One thing I noticed while looking at usages in node was that we should change impl TryFrom<NoteAttachment> for NetworkAccountTarget to &NoteAttachment. Changed in 0xMiden/protocol#2289.

Metadata

Metadata

Labels

network transactionsRelates to the network transactions feature

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions