Skip to content

feat: implement TransactionEventId::event_name and host name resolution#2628

Open
PhilippGackstatter wants to merge 3 commits intonextfrom
pgackst-tx-event-name
Open

feat: implement TransactionEventId::event_name and host name resolution#2628
PhilippGackstatter wants to merge 3 commits intonextfrom
pgackst-tx-event-name

Conversation

@PhilippGackstatter
Copy link
Contributor

@PhilippGackstatter PhilippGackstatter commented Mar 18, 2026

Implements TransactionEventId::event_name and host name resolution.

  • Extract not only the event ID but also the event name in build.rs.
  • Implements TransactionEventId::event_name to map event ID to name.
  • Implements Host::resolve_event for all hosts to improve error messages.

For example, an error in an event handler currently gives:

Error:   × error during processing of event with ID: 11218463077671809423
  ╰─▶ slot ptr 10632 is uninitialized
      ╭─[~/miden-protocol/target/debug/build/miden-protocol-8f28cfe76b3927bf/out/asm/kernels/transaction/lib/account.masm:1634:5]
 1633 │ 
 1634 │     emit.ACCOUNT_STORAGE_BEFORE_GET_MAP_ITEM_EVENT
      ·     ──────────────────────────────────────────────
 1635 │     # => [slot_ptr, KEY]
      ╰────

We now get the same error message, but with:

Error:   × error during processing of event 'miden::protocol::account::storage_before_get_map_item' (ID: 11218463077671809423)

So the event name is contained in the error (though we already knew that from the constant name too).

There may be other benefits of implementing Host::resolve_event but, I'm not sure.

closes #2043

Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you!

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.

Use EventName for TransactionEvent

2 participants