-
Notifications
You must be signed in to change notification settings - Fork 17
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
Responsive panic about invalid user input during contract execution #329
Comments
For a contract it's OK to panic.
You're assuming that contracts can return Documenting assumptions on inputs is OK, it's useful anyway. |
I meant responsive exceptions (in Go code - |
Previously `setEACL` method could throw `invalid offset` fault exception about invalid eACL argument. This message is too generic, may occur in different places of execution code and doesn't help caller to realize the reason. To improve user experience, it's worth to check method arguments before slice instructions. Pre-check `eACL` slice length in `SetEACL` method implementation and throw responsive panic message. Ref nspcc-dev#329. Signed-off-by: Leonard Lyubich <[email protected]>
`SetEACL` method imposes requirements on the eACL parameter of a generic byte array type. These requirements should be described in the documentation as user manual. Ref nspcc-dev#329. Signed-off-by: Leonard Lyubich <[email protected]>
Context
Calling https://pkg.go.dev/github.com/nspcc-dev/neofs-contract/container#SetEACL threw following exception:
This behavior occurs similar to
index out of range
panic in the general Go view. While in general panic has the right to exist (developer's mistakes), code MUST NOT panic about user input.Solution
Explore all methods which are sensitive to user input and
The text was updated successfully, but these errors were encountered: