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.

73 lines
2.5 KiB

  1. syntax = "proto3";
  2. package tendermint.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. // ConsensusParams contains consensus critical parameters that determine the
  8. // validity of blocks.
  9. message ConsensusParams {
  10. BlockParams block = 1 [(gogoproto.nullable) = false];
  11. EvidenceParams evidence = 2 [(gogoproto.nullable) = false];
  12. ValidatorParams validator = 3 [(gogoproto.nullable) = false];
  13. }
  14. // BlockParams contains limits on the block size.
  15. message BlockParams {
  16. // Note: must be greater than 0
  17. int64 max_bytes = 1;
  18. // Note: must be greater or equal to -1
  19. int64 max_gas = 2;
  20. // Minimum time increment between consecutive blocks (in milliseconds)
  21. // Not exposed to the application.
  22. int64 time_iota_ms = 3;
  23. }
  24. // EvidenceParams determine how we handle evidence of malfeasance.
  25. message EvidenceParams {
  26. // Max age of evidence, in blocks.
  27. //
  28. // The basic formula for calculating this is: MaxAgeDuration / {average block
  29. // time}.
  30. int64 max_age_num_blocks = 1;
  31. // Max age of evidence, in time.
  32. //
  33. // It should correspond with an app's "unbonding period" or other similar
  34. // mechanism for handling [Nothing-At-Stake
  35. // attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed).
  36. google.protobuf.Duration max_age_duration = 2
  37. [(gogoproto.nullable) = false, (gogoproto.stdduration) = true];
  38. // This sets the maximum number of evidence that can be committed in a single block.
  39. // and should fall comfortably under the max block bytes when we consider the size of
  40. // each evidence (See MaxEvidenceBytes). The maximum number is MaxEvidencePerBlock.
  41. // Default is 50
  42. uint32 max_num = 3;
  43. // Proof trial period dictates the time given for nodes accused of amnesia evidence, incorrectly
  44. // voting twice in two different rounds to respond with their respective proofs.
  45. // Default is half the max age in blocks: 50,000
  46. int64 proof_trial_period = 4;
  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. }