Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework miden-lib error categories #1196

Open
wants to merge 11 commits into
base: next
Choose a base branch
from

Conversation

PhilippGackstatter
Copy link
Contributor

Rework miden-lib error categories.

Essentially there are two high-level categories now, which we can anticipate to extend in the future with batch and block kernel:

  • Transaction Kernel errors are in range 0x20000..0x24000.
  • Note Script errors are in range 0x2c000..0x30000.

Eventually we can add:

  • Batch kernel errors in range 0x24000..0x28000.
  • Block kernel errors in range 0x28000..0x2c000.

The transaction kernel's sub categories are:

  • KERNEL is in range 0x20000..0x20040
  • PROLOGUE is in range 0x20040..0x20080
  • EPILOGUE is in range 0x20080..0x200c0
  • TX is in range 0x200c0..0x20100
  • NOTE is in range 0x20100..0x20140
  • ACCOUNT is in range 0x20140..0x20180
  • FOREIGN_ACCOUNT is in range 0x20180..0x201c0
  • FAUCET is in range 0x201c0..0x20200
  • FUNGIBLE_ASSET is in range 0x20200..0x20240
  • NON_FUNGIBLE_ASSET is in range 0x20240..0x20280
  • VAULT is in range 0x20280..0x202c0

Each category has a size of 64 codes, which looks like its enough for now. This also means we can easily fit all four high-level categories into 0x2xxxx.

It's easiest to review the changes by looking at the resulting files in crates/miden-lib/src/errors/.

closes #914

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.

2 participants