You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we have itests that exercise the RPC endpoints, but not tests that check their safety; specifically that parsing gRPC Request types is panic-free and enforces the invariants that we require, like the size of certain fields or that only certain combinations of fields are valid.
One way to improve that is to introduce property-based tests for the initial logic in our RPC endpoints that handles request unmarshalling and sanity checking.
IMO the highest-priority endpoints are those related to universerpc, specifically those involved in sync operations as they would be exposed to public use by universe server operators. Others like MintAsset would also be good to cover since they involve may fields and invariants wrt. field combinations.
This may require minor refactoring of these endpoints to separate unmarshalling logic from the core logic of the endpoint itself. Also, due to import cycles for some logic like the universerpc unmarshalling functions, I think these tests would have to be put in the top-level scope / at the same point as rpcserver itself. That may require some changes to have these tests run as part of the existing make unit target.
The text was updated successfully, but these errors were encountered:
Currently, we have itests that exercise the RPC endpoints, but not tests that check their safety; specifically that parsing gRPC
Request
types is panic-free and enforces the invariants that we require, like the size of certain fields or that only certain combinations of fields are valid.One way to improve that is to introduce property-based tests for the initial logic in our RPC endpoints that handles request unmarshalling and sanity checking.
A useful tool for this is https://github.com/flyingmutant/rapid , which seems better-maintained and more capable than alternatives like https://pkg.go.dev/testing/quick .
rapid
tests can also be used as fuzz tests.IMO the highest-priority endpoints are those related to
universerpc
, specifically those involved in sync operations as they would be exposed to public use by universe server operators. Others likeMintAsset
would also be good to cover since they involve may fields and invariants wrt. field combinations.This may require minor refactoring of these endpoints to separate unmarshalling logic from the core logic of the endpoint itself. Also, due to import cycles for some logic like the
universerpc
unmarshalling functions, I think these tests would have to be put in the top-level scope / at the same point asrpcserver
itself. That may require some changes to have these tests run as part of the existingmake unit
target.The text was updated successfully, but these errors were encountered: