-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
C:abciComponent: Application Blockchain InterfaceComponent: Application Blockchain InterfaceC:consensusComponent: ConsensusComponent: Consensus
Description
The docs read:
Each field that is not empty will be applied in full. For instance, if updating the BlockSize.MaxBytes, applications must also set the other BlockSize fields (like BlockSize.MaxGas), even if they are unchanged, as they will otherwise cause the value to be updated to 0.
But in the code, we do this:
Lines 224 to 251 in 7457133
| func (pb2tm) ConsensusParams(csp *abci.ConsensusParams) ConsensusParams { | |
| params := ConsensusParams{ | |
| Block: BlockParams{}, | |
| Evidence: EvidenceParams{}, | |
| Validator: ValidatorParams{}, | |
| } | |
| // we must defensively consider any structs may be nil | |
| if csp.Block != nil { | |
| params.Block = BlockParams{ | |
| MaxBytes: csp.Block.MaxBytes, | |
| MaxGas: csp.Block.MaxGas, | |
| } | |
| } | |
| if csp.Evidence != nil { | |
| params.Evidence = EvidenceParams{ | |
| MaxAge: csp.Evidence.MaxAge, | |
| } | |
| } | |
| if csp.Validator != nil { | |
| params.Validator = ValidatorParams{ | |
| PubKeyTypes: csp.Validator.PubKeyTypes, | |
| } | |
| } | |
| return params |
Which means all the non-specified fields will be over written.
Also, we're still referring to BlockSize, which should be Block as of v0.31.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C:abciComponent: Application Blockchain InterfaceComponent: Application Blockchain InterfaceC:consensusComponent: ConsensusComponent: Consensus