docs: document ConsensusParams (#5165)

Closes #2836
This commit is contained in:
Anton Kaliaev
2020-07-29 15:24:01 +04:00
committed by GitHub
parent 4ab7b7d7ca
commit b5f030892d
3 changed files with 34 additions and 7 deletions

View File

@@ -99,11 +99,15 @@ func (m *ConsensusParams) GetVersion() VersionParams {
// BlockParams contains limits on the block size.
type BlockParams struct {
// Max block size, in bytes.
// Note: must be greater than 0
MaxBytes int64 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"`
// Max gas per block.
// Note: must be greater or equal to -1
MaxGas int64 `protobuf:"varint,2,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"`
// Minimum time increment between consecutive blocks (in milliseconds)
// Minimum time increment between consecutive blocks (in milliseconds) If the
// block header timestamp is ahead of the system clock, decrease this value.
//
// Not exposed to the application.
TimeIotaMs int64 `protobuf:"varint,3,opt,name=time_iota_ms,json=timeIotaMs,proto3" json:"time_iota_ms,omitempty"`
}
@@ -339,8 +343,8 @@ func (m *VersionParams) GetAppVersion() uint64 {
}
// HashedParams is a subset of ConsensusParams.
// It is amino encoded and hashed into
// the Header.ConsensusHash.
//
// It is hashed into the Header.ConsensusHash.
type HashedParams struct {
BlockMaxBytes int64 `protobuf:"varint,1,opt,name=block_max_bytes,json=blockMaxBytes,proto3" json:"block_max_bytes,omitempty"`
BlockMaxGas int64 `protobuf:"varint,2,opt,name=block_max_gas,json=blockMaxGas,proto3" json:"block_max_gas,omitempty"`

View File

@@ -19,11 +19,15 @@ message ConsensusParams {
// BlockParams contains limits on the block size.
message BlockParams {
// Max block size, in bytes.
// Note: must be greater than 0
int64 max_bytes = 1;
// Max gas per block.
// Note: must be greater or equal to -1
int64 max_gas = 2;
// Minimum time increment between consecutive blocks (in milliseconds)
// Minimum time increment between consecutive blocks (in milliseconds) If the
// block header timestamp is ahead of the system clock, decrease this value.
//
// Not exposed to the application.
int64 time_iota_ms = 3;
}
@@ -74,8 +78,8 @@ message VersionParams {
}
// HashedParams is a subset of ConsensusParams.
// It is amino encoded and hashed into
// the Header.ConsensusHash.
//
// It is hashed into the Header.ConsensusHash.
message HashedParams {
int64 block_max_bytes = 1;
int64 block_max_gas = 2;