-
Notifications
You must be signed in to change notification settings - Fork 705
chore: document and rename InterpreterError
to VmInternalError
#6500
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
chore: document and rename InterpreterError
to VmInternalError
#6500
Conversation
/// did not match the expected type signature. | ||
FailureConstructingListWithType, | ||
/// An STX transfer failed due to insufficient balance. | ||
InsufficientBalance, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this truly an unexpected error? Does it imply that the calling code should sanitize inputs first, and that this error should never actually be raised?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be used as “the last stand.”.
Looking at STXBalanceSnapshot::transfer_to(...)
(invoked in Environment::stx_transfer_consolidated(..)
), it attempts to check the amount immediately before performing the transfer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly -- it's the final check to prevent balance underflows. Balance underflows are checked at several places up the stack, so if this error is needed then Bad Things have already happened in the VM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT!
A conflict need to be addressed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Sorry about the conflicts. :/
…r-to-vm-internal-error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI Format step is failing
/// A generic, unexpected internal error, indicating a logic failure within | ||
/// the VM. | ||
/// The `String` provides a message describing the specific failure. | ||
InvariantViolation(String), // TODO: merge with VmInternalError::Expect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an issue for this TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point! I just opened it #6530
LGTM; please address my one comment and I'll approve 👍 |
…r-to-vm-internal-error
Replaced by #6497 |
Codecov Report❌ Patch coverage is ❌ Your project status has failed because the head coverage (78.81%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## aac-client-breaking #6500 +/- ##
=======================================================
- Coverage 79.88% 78.81% -1.07%
=======================================================
Files 565 565
Lines 346594 346578 -16
=======================================================
- Hits 276882 273162 -3720
- Misses 69712 73416 +3704
... and 87 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
Rename:
InterpreterError
toVmInternalError
InterpreterError::InterpreterError
toVmInternalError::InvariantViolation
WARNING: This is a breaking change for consumers, like the sbtc crate.
Applicable issues