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.

452 lines
14 KiB

7 years ago
types: add default values for the synchrony parameters (#7788) ## Summary This pull request adds a default set of values to the new Synchrony parameters. These values were chosen by after observation of three live networks: Emoney, Osmosis, and the Cosmos Hub. For the default Precision value, `505ms` was selected. The reasoning for this is summarized in https://github.com/tendermint/tendermint/issues/7724 For each observed chain, an experimental Message Delay was collected over a 24 hour period and an average over this period was calculated using this data. Values over 10s were considered outliers and treated separately for the average since the majority of observations were far below 10s. The message delay was calculated both for the quorum and the 'full' prevote. Description of the technique for collecting the experimental values can found in #7202. This value is calculated only using timestamps given by processes on the network, so large variation in values is almost certainly due to clock skew among the validator set. `12s` is proposed for the default MessageDelay value. This value would easily accomodates all non-outlier values, allowing even E-money's 4.25s value to be valid. This would also allow some validators with skewed clocks to still participate without allowing for huge variation in the timestamps produced by the network. Additionally, for the currently listed use-cases of PBTS, such as unbonding period, and light client trust period, the current bounds for these are in weeks. Adding a few seconds of tolerance by default is therefore unlikely to have serious side-effects. ## Data ### Cosmos Hub Observation Period: 2022-02-03 20:22-2022-02-04 20:22 Avg Full Prevote Message Delay: 1.27s Outliers: 11s,13s,50s,106s,144s Total Outlier Heights: 86 Avg Quorum Prevote Message Delay: .77s Outliers: 10s,14s,107s,144s Total Outlier Heights: 617 Total heights: 11528 ### Osmosis Observation Period: 2022-01-29 20:26-2022-01-28 20:26 Avg Quorum Prevote Message Delay: .46s Outliers: 21s,50s Total Outlier Heights: 26 NOTE: During the observation period, a 'full' prevote was not observed. Total heights: 13983 ### E-Money Observation Period: 2022-02-07 04:29-2022-02-08 04:29 Avg Full Prevote Message Delay: 4.25s Outliers: 12s,15s,39s Total Outlier Heights: 128 Avg Quorum Prevote Message Delay: .20s Outliers: 28s Total Outlier Heights: 15 Total heights: 3791
3 years ago
types: add default values for the synchrony parameters (#7788) ## Summary This pull request adds a default set of values to the new Synchrony parameters. These values were chosen by after observation of three live networks: Emoney, Osmosis, and the Cosmos Hub. For the default Precision value, `505ms` was selected. The reasoning for this is summarized in https://github.com/tendermint/tendermint/issues/7724 For each observed chain, an experimental Message Delay was collected over a 24 hour period and an average over this period was calculated using this data. Values over 10s were considered outliers and treated separately for the average since the majority of observations were far below 10s. The message delay was calculated both for the quorum and the 'full' prevote. Description of the technique for collecting the experimental values can found in #7202. This value is calculated only using timestamps given by processes on the network, so large variation in values is almost certainly due to clock skew among the validator set. `12s` is proposed for the default MessageDelay value. This value would easily accomodates all non-outlier values, allowing even E-money's 4.25s value to be valid. This would also allow some validators with skewed clocks to still participate without allowing for huge variation in the timestamps produced by the network. Additionally, for the currently listed use-cases of PBTS, such as unbonding period, and light client trust period, the current bounds for these are in weeks. Adding a few seconds of tolerance by default is therefore unlikely to have serious side-effects. ## Data ### Cosmos Hub Observation Period: 2022-02-03 20:22-2022-02-04 20:22 Avg Full Prevote Message Delay: 1.27s Outliers: 11s,13s,50s,106s,144s Total Outlier Heights: 86 Avg Quorum Prevote Message Delay: .77s Outliers: 10s,14s,107s,144s Total Outlier Heights: 617 Total heights: 11528 ### Osmosis Observation Period: 2022-01-29 20:26-2022-01-28 20:26 Avg Quorum Prevote Message Delay: .46s Outliers: 21s,50s Total Outlier Heights: 26 NOTE: During the observation period, a 'full' prevote was not observed. Total heights: 13983 ### E-Money Observation Period: 2022-02-07 04:29-2022-02-08 04:29 Avg Full Prevote Message Delay: 4.25s Outliers: 12s,15s,39s Total Outlier Heights: 128 Avg Quorum Prevote Message Delay: .20s Outliers: 28s Total Outlier Heights: 15 Total heights: 3791
3 years ago
types: add default values for the synchrony parameters (#7788) ## Summary This pull request adds a default set of values to the new Synchrony parameters. These values were chosen by after observation of three live networks: Emoney, Osmosis, and the Cosmos Hub. For the default Precision value, `505ms` was selected. The reasoning for this is summarized in https://github.com/tendermint/tendermint/issues/7724 For each observed chain, an experimental Message Delay was collected over a 24 hour period and an average over this period was calculated using this data. Values over 10s were considered outliers and treated separately for the average since the majority of observations were far below 10s. The message delay was calculated both for the quorum and the 'full' prevote. Description of the technique for collecting the experimental values can found in #7202. This value is calculated only using timestamps given by processes on the network, so large variation in values is almost certainly due to clock skew among the validator set. `12s` is proposed for the default MessageDelay value. This value would easily accomodates all non-outlier values, allowing even E-money's 4.25s value to be valid. This would also allow some validators with skewed clocks to still participate without allowing for huge variation in the timestamps produced by the network. Additionally, for the currently listed use-cases of PBTS, such as unbonding period, and light client trust period, the current bounds for these are in weeks. Adding a few seconds of tolerance by default is therefore unlikely to have serious side-effects. ## Data ### Cosmos Hub Observation Period: 2022-02-03 20:22-2022-02-04 20:22 Avg Full Prevote Message Delay: 1.27s Outliers: 11s,13s,50s,106s,144s Total Outlier Heights: 86 Avg Quorum Prevote Message Delay: .77s Outliers: 10s,14s,107s,144s Total Outlier Heights: 617 Total heights: 11528 ### Osmosis Observation Period: 2022-01-29 20:26-2022-01-28 20:26 Avg Quorum Prevote Message Delay: .46s Outliers: 21s,50s Total Outlier Heights: 26 NOTE: During the observation period, a 'full' prevote was not observed. Total heights: 13983 ### E-Money Observation Period: 2022-02-07 04:29-2022-02-08 04:29 Avg Full Prevote Message Delay: 4.25s Outliers: 12s,15s,39s Total Outlier Heights: 128 Avg Quorum Prevote Message Delay: .20s Outliers: 28s Total Outlier Heights: 15 Total heights: 3791
3 years ago
  1. package types
  2. import (
  3. "errors"
  4. "fmt"
  5. "time"
  6. "github.com/tendermint/tendermint/crypto/ed25519"
  7. "github.com/tendermint/tendermint/crypto/secp256k1"
  8. "github.com/tendermint/tendermint/crypto/sr25519"
  9. "github.com/tendermint/tendermint/crypto/tmhash"
  10. tmstrings "github.com/tendermint/tendermint/libs/strings"
  11. tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
  12. )
  13. const (
  14. // MaxBlockSizeBytes is the maximum permitted size of the blocks.
  15. MaxBlockSizeBytes = 104857600 // 100MB
  16. // BlockPartSizeBytes is the size of one block part.
  17. BlockPartSizeBytes uint32 = 65536 // 64kB
  18. // MaxBlockPartsCount is the maximum number of block parts.
  19. MaxBlockPartsCount = (MaxBlockSizeBytes / BlockPartSizeBytes) + 1
  20. ABCIPubKeyTypeEd25519 = ed25519.KeyType
  21. ABCIPubKeyTypeSecp256k1 = secp256k1.KeyType
  22. ABCIPubKeyTypeSr25519 = sr25519.KeyType
  23. )
  24. var ABCIPubKeyTypesToNames = map[string]string{
  25. ABCIPubKeyTypeEd25519: ed25519.PubKeyName,
  26. ABCIPubKeyTypeSecp256k1: secp256k1.PubKeyName,
  27. ABCIPubKeyTypeSr25519: sr25519.PubKeyName,
  28. }
  29. // ConsensusParams contains consensus critical parameters that determine the
  30. // validity of blocks.
  31. type ConsensusParams struct {
  32. Block BlockParams `json:"block"`
  33. Evidence EvidenceParams `json:"evidence"`
  34. Validator ValidatorParams `json:"validator"`
  35. Version VersionParams `json:"version"`
  36. Synchrony SynchronyParams `json:"synchrony"`
  37. Timeout TimeoutParams `json:"timeout"`
  38. }
  39. // HashedParams is a subset of ConsensusParams.
  40. // It is amino encoded and hashed into
  41. // the Header.ConsensusHash.
  42. type HashedParams struct {
  43. BlockMaxBytes int64
  44. BlockMaxGas int64
  45. }
  46. // BlockParams define limits on the block size and gas plus minimum time
  47. // between blocks.
  48. type BlockParams struct {
  49. MaxBytes int64 `json:"max_bytes,string"`
  50. MaxGas int64 `json:"max_gas,string"`
  51. }
  52. // EvidenceParams determine how we handle evidence of malfeasance.
  53. type EvidenceParams struct {
  54. MaxAgeNumBlocks int64 `json:"max_age_num_blocks,string"` // only accept new evidence more recent than this
  55. MaxAgeDuration time.Duration `json:"max_age_duration,string"`
  56. MaxBytes int64 `json:"max_bytes,string"`
  57. }
  58. // ValidatorParams restrict the public key types validators can use.
  59. // NOTE: uses ABCI pubkey naming, not Amino names.
  60. type ValidatorParams struct {
  61. PubKeyTypes []string `json:"pub_key_types"`
  62. }
  63. type VersionParams struct {
  64. AppVersion uint64 `json:"app_version,string"`
  65. }
  66. // SynchronyParams influence the validity of block timestamps.
  67. // For more information on the relationship of the synchrony parameters to
  68. // block validity, see the Proposer-Based Timestamps specification:
  69. // https://github.com/tendermint/tendermint/blob/master/spec/consensus/proposer-based-timestamp/README.md
  70. type SynchronyParams struct {
  71. Precision time.Duration `json:"precision,string"`
  72. MessageDelay time.Duration `json:"message_delay,string"`
  73. }
  74. // TimeoutParams configure the timings of the steps of the Tendermint consensus algorithm.
  75. type TimeoutParams struct {
  76. Propose time.Duration `json:"propose,string"`
  77. ProposeDelta time.Duration `json:"propose_delta,string"`
  78. Vote time.Duration `json:"vote,string"`
  79. VoteDelta time.Duration `json:"vote_delta,string"`
  80. Commit time.Duration `json:"commit,string"`
  81. BypassCommitTimeout bool `json:"bypass_commit_timeout"`
  82. }
  83. // DefaultConsensusParams returns a default ConsensusParams.
  84. func DefaultConsensusParams() *ConsensusParams {
  85. return &ConsensusParams{
  86. Block: DefaultBlockParams(),
  87. Evidence: DefaultEvidenceParams(),
  88. Validator: DefaultValidatorParams(),
  89. Version: DefaultVersionParams(),
  90. Synchrony: DefaultSynchronyParams(),
  91. Timeout: DefaultTimeoutParams(),
  92. }
  93. }
  94. // DefaultBlockParams returns a default BlockParams.
  95. func DefaultBlockParams() BlockParams {
  96. return BlockParams{
  97. MaxBytes: 22020096, // 21MB
  98. MaxGas: -1,
  99. }
  100. }
  101. // DefaultEvidenceParams returns a default EvidenceParams.
  102. func DefaultEvidenceParams() EvidenceParams {
  103. return EvidenceParams{
  104. MaxAgeNumBlocks: 100000, // 27.8 hrs at 1block/s
  105. MaxAgeDuration: 48 * time.Hour,
  106. MaxBytes: 1048576, // 1MB
  107. }
  108. }
  109. // DefaultValidatorParams returns a default ValidatorParams, which allows
  110. // only ed25519 pubkeys.
  111. func DefaultValidatorParams() ValidatorParams {
  112. return ValidatorParams{
  113. PubKeyTypes: []string{ABCIPubKeyTypeEd25519},
  114. }
  115. }
  116. func DefaultVersionParams() VersionParams {
  117. return VersionParams{
  118. AppVersion: 0,
  119. }
  120. }
  121. func DefaultSynchronyParams() SynchronyParams {
  122. return SynchronyParams{
  123. // 505ms was selected as the default to enable chains that have validators in
  124. // mixed leap-second handling environments.
  125. // For more information, see: https://github.com/tendermint/tendermint/issues/7724
  126. Precision: 505 * time.Millisecond,
  127. MessageDelay: 12 * time.Second,
  128. }
  129. }
  130. func DefaultTimeoutParams() TimeoutParams {
  131. return TimeoutParams{
  132. Propose: 3000 * time.Millisecond,
  133. ProposeDelta: 500 * time.Millisecond,
  134. Vote: 1000 * time.Millisecond,
  135. VoteDelta: 500 * time.Millisecond,
  136. Commit: 1000 * time.Millisecond,
  137. BypassCommitTimeout: false,
  138. }
  139. }
  140. // ProposeTimeout returns the amount of time to wait for a proposal.
  141. func (t TimeoutParams) ProposeTimeout(round int32) time.Duration {
  142. return time.Duration(
  143. t.Propose.Nanoseconds()+t.ProposeDelta.Nanoseconds()*int64(round),
  144. ) * time.Nanosecond
  145. }
  146. // VoteTimeout returns the amount of time to wait for remaining votes after receiving any +2/3 votes.
  147. func (t TimeoutParams) VoteTimeout(round int32) time.Duration {
  148. return time.Duration(
  149. t.Vote.Nanoseconds()+t.VoteDelta.Nanoseconds()*int64(round),
  150. ) * time.Nanosecond
  151. }
  152. // CommitTime accepts ti, the time at which the consensus engine received +2/3
  153. // precommits for a block and returns the point in time at which the consensus
  154. // engine should begin consensus on the next block.
  155. func (t TimeoutParams) CommitTime(ti time.Time) time.Time {
  156. return ti.Add(t.Commit)
  157. }
  158. func (val *ValidatorParams) IsValidPubkeyType(pubkeyType string) bool {
  159. for i := 0; i < len(val.PubKeyTypes); i++ {
  160. if val.PubKeyTypes[i] == pubkeyType {
  161. return true
  162. }
  163. }
  164. return false
  165. }
  166. func (params *ConsensusParams) Complete() {
  167. if params.Synchrony == (SynchronyParams{}) {
  168. params.Synchrony = DefaultSynchronyParams()
  169. }
  170. if params.Timeout == (TimeoutParams{}) {
  171. params.Timeout = DefaultTimeoutParams()
  172. }
  173. }
  174. // Validate validates the ConsensusParams to ensure all values are within their
  175. // allowed limits, and returns an error if they are not.
  176. func (params ConsensusParams) ValidateConsensusParams() error {
  177. if params.Block.MaxBytes <= 0 {
  178. return fmt.Errorf("block.MaxBytes must be greater than 0. Got %d",
  179. params.Block.MaxBytes)
  180. }
  181. if params.Block.MaxBytes > MaxBlockSizeBytes {
  182. return fmt.Errorf("block.MaxBytes is too big. %d > %d",
  183. params.Block.MaxBytes, MaxBlockSizeBytes)
  184. }
  185. if params.Block.MaxGas < -1 {
  186. return fmt.Errorf("block.MaxGas must be greater or equal to -1. Got %d",
  187. params.Block.MaxGas)
  188. }
  189. if params.Evidence.MaxAgeNumBlocks <= 0 {
  190. return fmt.Errorf("evidence.MaxAgeNumBlocks must be greater than 0. Got %d",
  191. params.Evidence.MaxAgeNumBlocks)
  192. }
  193. if params.Evidence.MaxAgeDuration <= 0 {
  194. return fmt.Errorf("evidence.MaxAgeDuration must be greater than 0 if provided, Got %v",
  195. params.Evidence.MaxAgeDuration)
  196. }
  197. if params.Evidence.MaxBytes > params.Block.MaxBytes {
  198. return fmt.Errorf("evidence.MaxBytesEvidence is greater than upper bound, %d > %d",
  199. params.Evidence.MaxBytes, params.Block.MaxBytes)
  200. }
  201. if params.Evidence.MaxBytes < 0 {
  202. return fmt.Errorf("evidence.MaxBytes must be non negative. Got: %d",
  203. params.Evidence.MaxBytes)
  204. }
  205. if params.Synchrony.MessageDelay <= 0 {
  206. return fmt.Errorf("synchrony.MessageDelay must be greater than 0. Got: %d",
  207. params.Synchrony.MessageDelay)
  208. }
  209. if params.Synchrony.Precision <= 0 {
  210. return fmt.Errorf("synchrony.Precision must be greater than 0. Got: %d",
  211. params.Synchrony.Precision)
  212. }
  213. if params.Timeout.Propose <= 0 {
  214. return fmt.Errorf("timeout.ProposeDelta must be greater than 0. Got: %d", params.Timeout.Propose)
  215. }
  216. if params.Timeout.ProposeDelta <= 0 {
  217. return fmt.Errorf("timeout.ProposeDelta must be greater than 0. Got: %d", params.Timeout.ProposeDelta)
  218. }
  219. if params.Timeout.Vote <= 0 {
  220. return fmt.Errorf("timeout.Vote must be greater than 0. Got: %d", params.Timeout.Vote)
  221. }
  222. if params.Timeout.VoteDelta <= 0 {
  223. return fmt.Errorf("timeout.VoteDelta must be greater than 0. Got: %d", params.Timeout.VoteDelta)
  224. }
  225. if params.Timeout.Commit <= 0 {
  226. return fmt.Errorf("timeout.Commit must be greater than 0. Got: %d", params.Timeout.Commit)
  227. }
  228. if len(params.Validator.PubKeyTypes) == 0 {
  229. return errors.New("len(Validator.PubKeyTypes) must be greater than 0")
  230. }
  231. // Check if keyType is a known ABCIPubKeyType
  232. for i := 0; i < len(params.Validator.PubKeyTypes); i++ {
  233. keyType := params.Validator.PubKeyTypes[i]
  234. if _, ok := ABCIPubKeyTypesToNames[keyType]; !ok {
  235. return fmt.Errorf("params.Validator.PubKeyTypes[%d], %s, is an unknown pubkey type",
  236. i, keyType)
  237. }
  238. }
  239. return nil
  240. }
  241. // Hash returns a hash of a subset of the parameters to store in the block header.
  242. // Only the Block.MaxBytes and Block.MaxGas are included in the hash.
  243. // This allows the ConsensusParams to evolve more without breaking the block
  244. // protocol. No need for a Merkle tree here, just a small struct to hash.
  245. func (params ConsensusParams) HashConsensusParams() []byte {
  246. hasher := tmhash.New()
  247. hp := tmproto.HashedParams{
  248. BlockMaxBytes: params.Block.MaxBytes,
  249. BlockMaxGas: params.Block.MaxGas,
  250. }
  251. bz, err := hp.Marshal()
  252. if err != nil {
  253. panic(err)
  254. }
  255. _, err = hasher.Write(bz)
  256. if err != nil {
  257. panic(err)
  258. }
  259. return hasher.Sum(nil)
  260. }
  261. func (params *ConsensusParams) Equals(params2 *ConsensusParams) bool {
  262. return params.Block == params2.Block &&
  263. params.Evidence == params2.Evidence &&
  264. params.Version == params2.Version &&
  265. params.Synchrony == params2.Synchrony &&
  266. params.Timeout == params2.Timeout &&
  267. tmstrings.StringSliceEqual(params.Validator.PubKeyTypes, params2.Validator.PubKeyTypes)
  268. }
  269. // Update returns a copy of the params with updates from the non-zero fields of p2.
  270. // NOTE: note: must not modify the original
  271. func (params ConsensusParams) UpdateConsensusParams(params2 *tmproto.ConsensusParams) ConsensusParams {
  272. res := params // explicit copy
  273. if params2 == nil {
  274. return res
  275. }
  276. // we must defensively consider any structs may be nil
  277. if params2.Block != nil {
  278. res.Block.MaxBytes = params2.Block.MaxBytes
  279. res.Block.MaxGas = params2.Block.MaxGas
  280. }
  281. if params2.Evidence != nil {
  282. res.Evidence.MaxAgeNumBlocks = params2.Evidence.MaxAgeNumBlocks
  283. res.Evidence.MaxAgeDuration = params2.Evidence.MaxAgeDuration
  284. res.Evidence.MaxBytes = params2.Evidence.MaxBytes
  285. }
  286. if params2.Validator != nil {
  287. // Copy params2.Validator.PubkeyTypes, and set result's value to the copy.
  288. // This avoids having to initialize the slice to 0 values, and then write to it again.
  289. res.Validator.PubKeyTypes = append([]string{}, params2.Validator.PubKeyTypes...)
  290. }
  291. if params2.Version != nil {
  292. res.Version.AppVersion = params2.Version.AppVersion
  293. }
  294. if params2.Synchrony != nil {
  295. if params2.Synchrony.MessageDelay != nil {
  296. res.Synchrony.MessageDelay = *params2.Synchrony.GetMessageDelay()
  297. }
  298. if params2.Synchrony.Precision != nil {
  299. res.Synchrony.Precision = *params2.Synchrony.GetPrecision()
  300. }
  301. }
  302. if params2.Timeout != nil {
  303. if params2.Timeout.Propose != nil {
  304. res.Timeout.Propose = *params2.Timeout.GetPropose()
  305. }
  306. if params2.Timeout.ProposeDelta != nil {
  307. res.Timeout.ProposeDelta = *params2.Timeout.GetProposeDelta()
  308. }
  309. if params2.Timeout.Vote != nil {
  310. res.Timeout.Vote = *params2.Timeout.GetVote()
  311. }
  312. if params2.Timeout.VoteDelta != nil {
  313. res.Timeout.VoteDelta = *params2.Timeout.GetVoteDelta()
  314. }
  315. if params2.Timeout.Commit != nil {
  316. res.Timeout.Commit = *params2.Timeout.GetCommit()
  317. }
  318. res.Timeout.BypassCommitTimeout = params2.Timeout.GetBypassCommitTimeout()
  319. }
  320. return res
  321. }
  322. func (params *ConsensusParams) ToProto() tmproto.ConsensusParams {
  323. return tmproto.ConsensusParams{
  324. Block: &tmproto.BlockParams{
  325. MaxBytes: params.Block.MaxBytes,
  326. MaxGas: params.Block.MaxGas,
  327. },
  328. Evidence: &tmproto.EvidenceParams{
  329. MaxAgeNumBlocks: params.Evidence.MaxAgeNumBlocks,
  330. MaxAgeDuration: params.Evidence.MaxAgeDuration,
  331. MaxBytes: params.Evidence.MaxBytes,
  332. },
  333. Validator: &tmproto.ValidatorParams{
  334. PubKeyTypes: params.Validator.PubKeyTypes,
  335. },
  336. Version: &tmproto.VersionParams{
  337. AppVersion: params.Version.AppVersion,
  338. },
  339. Synchrony: &tmproto.SynchronyParams{
  340. MessageDelay: &params.Synchrony.MessageDelay,
  341. Precision: &params.Synchrony.Precision,
  342. },
  343. Timeout: &tmproto.TimeoutParams{
  344. Propose: &params.Timeout.Propose,
  345. ProposeDelta: &params.Timeout.ProposeDelta,
  346. Vote: &params.Timeout.Vote,
  347. VoteDelta: &params.Timeout.VoteDelta,
  348. Commit: &params.Timeout.Commit,
  349. BypassCommitTimeout: params.Timeout.BypassCommitTimeout,
  350. },
  351. }
  352. }
  353. func ConsensusParamsFromProto(pbParams tmproto.ConsensusParams) ConsensusParams {
  354. c := ConsensusParams{
  355. Block: BlockParams{
  356. MaxBytes: pbParams.Block.MaxBytes,
  357. MaxGas: pbParams.Block.MaxGas,
  358. },
  359. Evidence: EvidenceParams{
  360. MaxAgeNumBlocks: pbParams.Evidence.MaxAgeNumBlocks,
  361. MaxAgeDuration: pbParams.Evidence.MaxAgeDuration,
  362. MaxBytes: pbParams.Evidence.MaxBytes,
  363. },
  364. Validator: ValidatorParams{
  365. PubKeyTypes: pbParams.Validator.PubKeyTypes,
  366. },
  367. Version: VersionParams{
  368. AppVersion: pbParams.Version.AppVersion,
  369. },
  370. }
  371. if pbParams.Synchrony != nil {
  372. if pbParams.Synchrony.MessageDelay != nil {
  373. c.Synchrony.MessageDelay = *pbParams.Synchrony.GetMessageDelay()
  374. }
  375. if pbParams.Synchrony.Precision != nil {
  376. c.Synchrony.Precision = *pbParams.Synchrony.GetPrecision()
  377. }
  378. }
  379. if pbParams.Timeout != nil {
  380. if pbParams.Timeout.Propose != nil {
  381. c.Timeout.Propose = *pbParams.Timeout.GetPropose()
  382. }
  383. if pbParams.Timeout.ProposeDelta != nil {
  384. c.Timeout.ProposeDelta = *pbParams.Timeout.GetProposeDelta()
  385. }
  386. if pbParams.Timeout.Vote != nil {
  387. c.Timeout.Vote = *pbParams.Timeout.GetVote()
  388. }
  389. if pbParams.Timeout.VoteDelta != nil {
  390. c.Timeout.VoteDelta = *pbParams.Timeout.GetVoteDelta()
  391. }
  392. if pbParams.Timeout.Commit != nil {
  393. c.Timeout.Commit = *pbParams.Timeout.GetCommit()
  394. }
  395. c.Timeout.BypassCommitTimeout = pbParams.Timeout.BypassCommitTimeout
  396. }
  397. return c
  398. }