cardano-ledger-byron
cardano-ledger-byron copied to clipboard
Synchronize data type, functions, and spec for (updatable) protocol parameters
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 withinppSoftforkRule
- 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 theProtocolParameter
andSoftForkPolicy
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.