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

Remove use of exitcode.SysErrInvalidParameters #3184

Closed
wants to merge 1 commit into from
Closed

Conversation

anorth
Copy link
Member

@anorth anorth commented Aug 20, 2020

SysErrInvalidParameters is deprecated, there's no case where it should be used.

FYI @raulk

@anorth anorth requested a review from arajasek August 20, 2020 05:29
@@ -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)
Copy link
Member Author

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)
Copy link
Member Author

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.

@arajasek
Copy link
Contributor

arajasek commented Sep 7, 2020

Pulled into #3603

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/consensus Impact: Consensus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants