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

Use new ExitCode type and values. #200

Closed
wants to merge 10 commits into from
Closed

Conversation

dignifiedquire
Copy link
Contributor

Replaces #191

Copy link
Member

@anorth anorth left a comment

Choose a reason for hiding this comment

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

[shakes fist] stealing my praise lines!

actors/runtime/src/runtime/fvm.rs Show resolved Hide resolved
// We do this after handling the error, because the actor may have encountered an error before
// it even could validate the caller.
if !rt.caller_validated {
fvm::vm::abort(ExitCode::SysErrIllegalActor as u32, Some("failed to validate caller"))
fvm::vm::abort(ExitCode::USR_UNSPECIFIED.value(), Some("failed to validate caller"))
Copy link
Member

Choose a reason for hiding this comment

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

This should be the "user assertion failed" one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

actors/runtime/src/test_utils.rs Outdated Show resolved Hide resolved
actors/runtime/src/runtime/fvm.rs Outdated Show resolved Hide resolved
actors/runtime/src/runtime/fvm.rs Show resolved Hide resolved
actors/runtime/src/runtime/fvm.rs Outdated Show resolved Hide resolved
actors/runtime/src/runtime/fvm.rs Outdated Show resolved Hide resolved
@Stebalien
Copy link
Member

So, I think the core issue we (I?) have is that we're using ActorError for two purposes:

  1. To propagate error information from the runtime.
  2. To decide which exit code we should exit with.

But I believe dig's proposal in #197 will solve this. Basically:

  1. Syscalls can return a real "error" indicating what went wrong.
  2. We can implement conversions to ActorErrors (or aborts, or exit codes, or whatever) where we can make a reasonable mapping between "if an actor sees error X from the runtime and wants to abort, it should abort with exit code Y".

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

LGTM for merge modulo the incorrect comments.

@Stebalien
Copy link
Member

Updated to released dependencies.

The real fix is discussed in #144, but this version is strictly "more
correct" than the previous code.
Many of these are temporary (waiting on #144), but this is as correct as
we can get it for now.
@dignifiedquire
Copy link
Contributor Author

lgtm (can’t approve my own pr)

@Stebalien
Copy link
Member

I've stolen the blame lines back for @anorth now that we're ready to merge.

@Stebalien Stebalien closed this Apr 11, 2022
@Stebalien
Copy link
Member

Will be merged in #191.

@Stebalien Stebalien deleted the dig/syserror branch April 11, 2022 14:00
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.

3 participants