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.

129 lines
5.4 KiB

proto: update proto generation to use buf (#7975) * Hard-code go_package option for .proto files Signed-off-by: Thane Thomson <connect@thanethomson.com> * Automatically relocate generated ABCI types after proto-gen Signed-off-by: Thane Thomson <connect@thanethomson.com> * Skip building gogoproto (i.e. only build our types) Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove unnecessary proto generation scripts Signed-off-by: Thane Thomson <connect@thanethomson.com> * Upgrade buf config from v1beta1 to v1 Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add simple proto generation script Signed-off-by: Thane Thomson <connect@thanethomson.com> * Replace buf-based protobuf generation with simple protoc-based approach Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove custom buf-based Docker image generation config and Dockerfile Signed-off-by: Thane Thomson <connect@thanethomson.com> * Adopt Cosmos SDK's approach to Protobuf linting and breakage checking in CI Signed-off-by: Thane Thomson <connect@thanethomson.com> * Suppress command echo when running proto checks Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix proto-check workflow YAML indentation Signed-off-by: Thane Thomson <connect@thanethomson.com> * Restore proto-format target Signed-off-by: Thane Thomson <connect@thanethomson.com> * Replace custom BASH script with make equivalent Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove proto linting/breaking changes CI checks after discussion today Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove dangling reference to CI workflow that no longer exists Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update contributing guidelines relating to protos Signed-off-by: Thane Thomson <connect@thanethomson.com> * Use buf instead for generating protos Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove unused buf config for gogoprotobuf Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add reminder for if we migrate fully to buf Signed-off-by: Thane Thomson <connect@thanethomson.com> * Restore protopackage script for #8065 Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix permissions on protopackage script Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update contributing guidelines to show building of protos using buf Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix breaking changes check and add disclaimer Signed-off-by: Thane Thomson <connect@thanethomson.com> * Expand on contributing guidelines for clarity Signed-off-by: Thane Thomson <connect@thanethomson.com> * Re-remove old proto workflows Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add buf-based proto linting workflow in CI Signed-off-by: Thane Thomson <connect@thanethomson.com> * Superficially reorder proto targets Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix proto lints Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix GA workflow YAML indentation Signed-off-by: Thane Thomson <connect@thanethomson.com> * Temporarily use forked version of mlc Use forked version of markdown-link-check until https://github.com/gaurav-nelson/github-action-markdown-link-check/pull/126 lands. Signed-off-by: Thane Thomson <connect@thanethomson.com> * Temporarily disable markdown link checker Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove gogo protos - superseded by version from buf registry Signed-off-by: Thane Thomson <connect@thanethomson.com>
2 years ago
  1. syntax = "proto3";
  2. package tendermint.types;
  3. option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";
  4. import "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;
  11. EvidenceParams evidence = 2;
  12. ValidatorParams validator = 3;
  13. VersionParams version = 4;
  14. SynchronyParams synchrony = 5;
  15. TimeoutParams timeout = 6;
  16. }
  17. // BlockParams contains limits on the block size.
  18. message BlockParams {
  19. // Max block size, in bytes.
  20. // Note: must be greater than 0
  21. int64 max_bytes = 1;
  22. // Max gas per block.
  23. // Note: must be greater or equal to -1
  24. int64 max_gas = 2;
  25. }
  26. // EvidenceParams determine how we handle evidence of malfeasance.
  27. message EvidenceParams {
  28. // Max age of evidence, in blocks.
  29. //
  30. // The basic formula for calculating this is: MaxAgeDuration / {average block
  31. // time}.
  32. int64 max_age_num_blocks = 1;
  33. // Max age of evidence, in time.
  34. //
  35. // It should correspond with an app's "unbonding period" or other similar
  36. // mechanism for handling [Nothing-At-Stake
  37. // attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed).
  38. google.protobuf.Duration max_age_duration = 2
  39. [(gogoproto.nullable) = false, (gogoproto.stdduration) = true];
  40. // This sets the maximum size of total evidence in bytes that can be committed
  41. // in a single block. and should fall comfortably under the max block bytes.
  42. // Default is 1048576 or 1MB
  43. int64 max_bytes = 3;
  44. }
  45. // ValidatorParams restrict the public key types validators can use.
  46. // NOTE: uses ABCI pubkey naming, not Amino names.
  47. message ValidatorParams {
  48. repeated string pub_key_types = 1;
  49. }
  50. // VersionParams contains the ABCI application version.
  51. message VersionParams {
  52. uint64 app_version = 1;
  53. }
  54. // HashedParams is a subset of ConsensusParams.
  55. //
  56. // It is hashed into the Header.ConsensusHash.
  57. message HashedParams {
  58. int64 block_max_bytes = 1;
  59. int64 block_max_gas = 2;
  60. }
  61. // SynchronyParams configure the bounds under which a proposed block's timestamp is considered valid.
  62. // These parameters are part of the proposer-based timestamps algorithm. For more information,
  63. // see the specification of proposer-based timestamps:
  64. // https://github.com/tendermint/tendermint/tree/master/spec/consensus/proposer-based-timestamp
  65. message SynchronyParams {
  66. // message_delay bounds how long a proposal message may take to reach all validators on a newtork
  67. // and still be considered valid.
  68. google.protobuf.Duration message_delay = 1 [(gogoproto.stdduration) = true];
  69. // precision bounds how skewed a proposer's clock may be from any validator
  70. // on the network while still producing valid proposals.
  71. google.protobuf.Duration precision = 2 [(gogoproto.stdduration) = true];
  72. }
  73. // TimeoutParams configure the timeouts for the steps of the Tendermint consensus algorithm.
  74. message TimeoutParams {
  75. // These fields configure the timeouts for the propose step of the Tendermint
  76. // consensus algorithm: propose is the initial timeout and propose_delta
  77. // determines how much the timeout grows in subsequent rounds.
  78. // For the first round, this propose timeout is used and for every subsequent
  79. // round, the timeout grows by propose_delta.
  80. //
  81. // For example:
  82. // With propose = 10ms, propose_delta = 5ms, the first round's propose phase
  83. // timeout would be 10ms, the second round's would be 15ms, the third 20ms and so on.
  84. //
  85. // If a node waiting for a proposal message does not receive one matching its
  86. // current height and round before this timeout, the node will issue a
  87. // nil prevote for the round and advance to the next step.
  88. google.protobuf.Duration propose = 1 [(gogoproto.stdduration) = true];
  89. google.protobuf.Duration propose_delta = 2 [(gogoproto.stdduration) = true];
  90. // vote along with vote_delta configure the timeout for both of the prevote and
  91. // precommit steps of the Tendermint consensus algorithm.
  92. //
  93. // These parameters influence the vote step timeouts in the the same way that
  94. // the propose and propose_delta parameters do to the proposal step.
  95. //
  96. // The vote timeout does not begin until a quorum of votes has been received. Once
  97. // a quorum of votes has been seen and this timeout elapses, Tendermint will
  98. // procced to the next step of the consensus algorithm. If Tendermint receives
  99. // all of the remaining votes before the end of the timeout, it will proceed
  100. // to the next step immediately.
  101. google.protobuf.Duration vote = 3 [(gogoproto.stdduration) = true];
  102. google.protobuf.Duration vote_delta = 4 [(gogoproto.stdduration) = true];
  103. // commit configures how long Tendermint will wait after receiving a quorum of
  104. // precommits before beginning consensus for the next height. This can be
  105. // used to allow slow precommits to arrive for inclusion in the next height before progressing.
  106. google.protobuf.Duration commit = 5 [(gogoproto.stdduration) = true];
  107. // bypass_commit_timeout configures the node to proceed immediately to
  108. // the next height once the node has received all precommits for a block, forgoing
  109. // the remaining commit timeout.
  110. // Setting bypass_commit_timeout false (the default) causes Tendermint to wait
  111. // for the full commit timeout.
  112. bool bypass_commit_timeout = 6;
  113. }