Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Synchronize data type, functions, and spec for (updatable) protocol parameters #730

Open
nfrisby opened this issue Mar 2, 2020 · 0 comments
Labels
spec-alignment Tasks related to bringing the implementation to agree with the formal specification. technical-debt

Comments

@nfrisby
Copy link
Contributor

nfrisby commented Mar 2, 2020

General mismatches

These three objects are somewhat out-of-sync.

  • The ProtocolParameters data type definition
  • The high-level code that uses ProtocolParameters (excluding low-level code such as pretty-printing, serialization, etc)
  • The analogous spec that describes (eg Fig 21 of the Byron ledger spec)

The data type definition includes fields that the code never uses, and the spec mentions some extras and also doesn't consistently mention others that it should.

Concrete mismatches

Here is the data type definition.

https://github.com/input-output-hk/cardano-ledger/blob/6ceedf17b813ac9d381cc0d679d16c849365a496/cardano-ledger/src/Cardano/Chain/Update/ProtocolParameters.hs#L33-L61

The code seems to only use the following parts.

  • the sizes: ppMaxBlockSize, ppMaxHeaderSize, ppMaxTxSize, ppMaxProposalSize
  • the TTL: ppUpdateProposalTTL
  • the srMinThd field within ppSoftforkRule
  • the ppTxFeePolicy

The spec lists only the following protocol parameters in Fig 21.

  • block, tx, and header maximum sizes --- note that the code also uses the max proposal size
  • scriptVersion --- the code does not use this beyond parameter update validations limiting how it changes
  • upAdtThd --- srMinThd is reused/abused to derive this value, as discussed in both the code and the spec, but not in the ProtocolParameter and SoftForkPolicy data type definitions' field declarations' comments.
  • the proposal TTL
  • the figure does not list the tx fee policy

The pdf text and rules mention maxProposalSize, but Fig 21 does not.

The pdf text mentions txFeePolicy, but Fig 21 and the rules do not.


#494 is related. I don't know if the cardano-ledger-specs repo has any related Issues.

@nfrisby nfrisby added technical-debt spec-alignment Tasks related to bringing the implementation to agree with the formal specification. byron Required for a Byron mainnet: replace the old core nodes with cardano-node. and removed byron Required for a Byron mainnet: replace the old core nodes with cardano-node. labels Mar 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
spec-alignment Tasks related to bringing the implementation to agree with the formal specification. technical-debt
Projects
None yet
Development

No branches or pull requests

1 participant