Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Incorrect errorcode? #1536

Open
laudiacay opened this issue Dec 1, 2021 · 2 comments
Open

Incorrect errorcode? #1536

laudiacay opened this issue Dec 1, 2021 · 2 comments

Comments

@laudiacay
Copy link
Contributor

aggSectorsCount, err := params.SectorNumbers.Count()
builtin.RequireNoErr(rt, err, exitcode.ErrIllegalState, "failed to count aggregated sectors")

this should probably be an errIllegalArgument, no? the params failed validation?

@ZenGround0
Copy link
Contributor

It's a bit of an edge case but I don't think so. ErrIllegalArgument for values actor logic forbids. ErrIllegalState for failures that should be impossible. In this case the bitfield was serialized correctly but makes Count fail which I wouldn't expect to be possible. If you look into it and Count errors are expected for certain valid serializations I'll support changing to ErrIllegalArgument.

@Stebalien
Copy link
Member

Well, the serialization may not actually be valid. We check lazily when we actually operate on the bitfield to avoid validating bitfields in the state every time we rehydrate them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@Stebalien @ZenGround0 @laudiacay and others