-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Remove use of exitcode.SysErrInvalidParameters #3184
Conversation
@@ -342,7 +342,7 @@ func (rt *Runtime) Send(to address.Address, method abi.MethodNum, m vmr.CBORMars | |||
if m != nil { | |||
buf := new(bytes.Buffer) | |||
if err := m.MarshalCBOR(buf); err != nil { | |||
rt.Abortf(exitcode.SysErrInvalidParameters, "failed to marshal input parameters: %s", err) | |||
rt.Abortf(exitcode.ErrSerialization, "failed to marshal input parameters: %s", err) |
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 was a somewhat legitimate use, but I've changed this to be consistent with our policy elsewhere that parameter/result and state de/serialization is logically part of actor code, and so uses the actor ErrSerialization
.
if addr.Protocol() == address.BLS || addr.Protocol() == address.SECP256K1 { | ||
return addr, nil | ||
} | ||
|
||
act, err := state.GetActor(addr) | ||
if err != nil { | ||
return address.Undef, aerrors.Newf(exitcode.SysErrInvalidParameters, "failed to find actor: %s", addr) | ||
return address.Undef, xerrors.Errorf("failed to find actor: %s", addr) |
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.
These uses didn't make much sense to me. This method is reached only indirectly from actor code; most callers are from outside. Where this is reached, e,g. as part of signature verification, the non-nil error should be propagated to the actor code itself, which will decide to abort. I think this exit code was always ignored.
Pulled into #3603 |
SysErrInvalidParameters
is deprecated, there's no case where it should be used.FYI @raulk