You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.5 KiB

  1. syntax = "proto3";
  2. package tendermint.proto.types;
  3. option go_package = "github.com/tendermint/tendermint/proto/types";
  4. import "third_party/proto/gogoproto/gogo.proto";
  5. import "google/protobuf/duration.proto";
  6. option (gogoproto.equal_all) = true;
  7. option (gogoproto.marshaler_all) = true;
  8. option (gogoproto.unmarshaler_all) = true;
  9. option (gogoproto.sizer_all) = true;
  10. option (gogoproto.goproto_registration) = true;
  11. // ConsensusParams contains consensus critical parameters that determine the
  12. // validity of blocks.
  13. message ConsensusParams {
  14. BlockParams block = 1 [(gogoproto.nullable) = false];
  15. EvidenceParams evidence = 2 [(gogoproto.nullable) = false];
  16. ValidatorParams validator = 3 [(gogoproto.nullable) = false];
  17. }
  18. // BlockParams contains limits on the block size.
  19. message BlockParams {
  20. // Note: must be greater than 0
  21. int64 max_bytes = 1;
  22. // Note: must be greater or equal to -1
  23. int64 max_gas = 2;
  24. // Minimum time increment between consecutive blocks (in milliseconds)
  25. // Not exposed to the application.
  26. int64 time_iota_ms = 3;
  27. }
  28. // EvidenceParams determine how we handle evidence of malfeasance.
  29. message EvidenceParams {
  30. // Max age of evidence, in blocks.
  31. //
  32. // The basic formula for calculating this is: MaxAgeDuration / {average block
  33. // time}.
  34. int64 max_age_num_blocks = 1;
  35. // Max age of evidence, in time.
  36. //
  37. // It should correspond with an app's "unbonding period" or other similar
  38. // mechanism for handling [Nothing-At-Stake
  39. // attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed).
  40. google.protobuf.Duration max_age_duration = 2
  41. [(gogoproto.nullable) = false, (gogoproto.stdduration) = true];
  42. // This sets the maximum number of evidence that can be committed in a single block.
  43. // and should fall comfortably under the max block bytes when we consider the size of
  44. // each evidence (See MaxEvidenceBytes). The maximum number is MaxEvidencePerBlock.
  45. // Default is 50
  46. uint32 max_num = 3;
  47. }
  48. // ValidatorParams restrict the public key types validators can use.
  49. // NOTE: uses ABCI pubkey naming, not Amino names.
  50. message ValidatorParams {
  51. option (gogoproto.populate) = true;
  52. option (gogoproto.equal) = true;
  53. repeated string pub_key_types = 1;
  54. }
  55. // HashedParams is a subset of ConsensusParams.
  56. // It is amino encoded and hashed into
  57. // the Header.ConsensusHash.
  58. message HashedParams {
  59. int64 block_max_bytes = 1;
  60. int64 block_max_gas = 2;
  61. }