updated to match adr 005

This commit is contained in:
Ethan Buchman
2017-09-16 00:16:49 -04:00
parent d343560108
commit 3a03fe5a15
5 changed files with 84 additions and 23 deletions

View File

@ -13,10 +13,12 @@ such as a period over which evidence is valid, or the frequency of checkpoints.
### ConsensusParams
No consensus critical parameters should ever be found in the `config.toml`.
A new `ConsensusParams` is optionally included in the `genesis.json` file,
and loaded into the `State`. Any items not included are set to their default value.
A value of 0 is undefined (see ABCI, below). A value of -1 is used to indicate the parameter does not apply.
No consensus critical parameters should ever be found in the `config.toml`.
The parameters are used to determine the validity of a block (and tx) via the union of all relevant parameters.
```
type ConsensusParams struct {
@ -26,14 +28,14 @@ type ConsensusParams struct {
}
type BlockSizeParams struct {
BlockSizeBytes int
BlockSizeTxs int
BlockSizeGas int
MaxBytes int
MaxTxs int
MaxGas int
}
type TxSizeParams struct {
TxSizeBytes int
TxSizeGas int
MaxBytes int
MaxGas int
}
type BlockGossipParams struct {
@ -43,12 +45,16 @@ type BlockGossipParams struct {
The `ConsensusParams` can evolve over time by adding new structs that cover different aspects of the consensus rules.
The `BlockPartSizeBytes` and the `BlockSizeParams.MaxBytes` are enforced to be greater than 0.
The former because we need a part size, the latter so that we always have at least some sanity check over the size of blocks.
### ABCI
#### InitChain
InitChain currently takes the initial validator set. It should be extended to also take the ConsensusParams.
In fact, it might as well just consume the whole Genesis.
InitChain currently takes the initial validator set. It should be extended to also take parts of the ConsensusParams.
There is some case to be made for it to take the entire Genesis, except there may be things in the genesis,
like the BlockPartSize, that the app shouldn't really know about.
#### EndBlock
@ -75,3 +81,5 @@ Proposed.
- Different rules at different heights in the blockchain complicates fast sync
### Neutral
- The TxSizeParams, which checks validity, may be in conflict with the config's `max_block_size_tx`, which determines proposal sizes