mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-09 22:47:24 +00:00
Pass all parameters from JSON-RPC requests to their corresponding handlers using struct types instead of positional parameters. This allows us to control encoding of arguments using only the standard library, and to eliminate the remaining special-purpose JSON encoding hooks in the server. To support existing use, the server still allows arguments to be encoded in JSON as either an array or an object. Related changes: - Rework the RPCFunc constructor to reduce reflection during RPC call service. - Add request parameter wrappers for each RPC service method. - Update the RPC Environment methods to use these types. - Update the interfaces and shims derived from Environment to the new signatures. - Update and extend test cases.
fuzz
Fuzzing for various packages in Tendermint using go-fuzz library.
Inputs:
- mempool
CheckTx(using kvstore in-process ABCI app) - p2p
SecretConnection#ReadandSecretConnection#Write - rpc jsonrpc server
Running
The fuzz tests are in native Go fuzzing format. Use the go
tool to run them:
go test -fuzz Mempool ./tests
go test -fuzz P2PSecretConnection ./tests
go test -fuzz RPCJSONRPCServer ./tests
See the Go Fuzzing introduction for more information.