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

Increase test coverage for RPC endpoints #1078

Open
jharveyb opened this issue Aug 12, 2024 · 0 comments
Open

Increase test coverage for RPC endpoints #1078

jharveyb opened this issue Aug 12, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@jharveyb
Copy link
Contributor

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 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.

@jharveyb jharveyb added the enhancement New feature or request label Aug 12, 2024
@jharveyb jharveyb changed the title Increased test coverage for RPC endpoints Increase test coverage for RPC endpoints Aug 12, 2024
@dstadulis dstadulis moved this from 🆕 New to 💇‍♂️Needs Shaping in Taproot-Assets Project Board Aug 13, 2024
@dstadulis dstadulis moved this from 💇‍♂️Needs Shaping to 🔖 Ready in Taproot-Assets Project Board Aug 13, 2024
@dstadulis dstadulis moved this from 🔖 Ready to 🏗 In progress in Taproot-Assets Project Board Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🏗 In progress
Development

No branches or pull requests

1 participant