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

Rapid proto message generator #14704

Closed
aaronc opened this issue Jan 19, 2023 · 1 comment · Fixed by #14849
Closed

Rapid proto message generator #14704

aaronc opened this issue Jan 19, 2023 · 1 comment · Fixed by #14849
Assignees

Comments

@aaronc
Copy link
Member

aaronc commented Jan 19, 2023

Summary

Create a configurable generator that works with https://pkg.go.dev/pgregory.net/rapid to generate random protobuf messages for testing.

Problem Definition

Property-based testing and fuzz testing allow us to automatically generate test input to cover a wider variety of cases than hard-coded input. Rapid allows us to create generators which can be used in both property-based and fuzz testing. Protobuf messages are a common source of input in the SDK and have a well-defined format. It would help testing in many places to have a good high-quality reusable generator.

Specific use cases right now are:

Proposal

Create a configurable generator using rapid in codec/v2 that uses the protoreflect API to generate random protobuf input. This can serve as a starting point: https://github.com/cosmos/cosmos-proto/blob/main/internal/fuzz/message.go.

It should be possible to:

  • configure the file and type registries
  • limit the set of messages which are generated
  • use accepts_interface/implements_interface annotations to sensibly populate Anys
  • use generics to specify the root message to be generated (ex. ProtoGenerator[MsgSend])
@aaronc aaronc changed the title Random proto message generator Rapid proto message generator Jan 19, 2023
@aaronc
Copy link
Member Author

aaronc commented Jan 19, 2023

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

Successfully merging a pull request may close this issue.

2 participants