cardano-ledger-byron icon indicating copy to clipboard operation
cardano-ledger-byron copied to clipboard

Incorrect comment on the `headerProtocolVersion` field

Open nfrisby opened this issue 4 years ago • 3 comments

https://github.com/input-output-hk/cardano-ledger/blob/172b49ff1b6456851f10ae18f920fbfa733be0b0/cardano-ledger/src/Cardano/Chain/Block/Header.hs#L145-L146

That comment is incorrect. The field is only used to endorse parameter update proposals, not to document how the current block was forged.

(I'm not sure if the corresponding headerSoftwareVersion comment is also incorrect; I'm looking into that now.)

nfrisby avatar Mar 02 '20 17:03 nfrisby

This is kind of a matter of perspective. I have always thought that one endorses a proposal by forging a block with the correct protocol version. E.g. "endorsement" is simply a measure of how many nodes are using that version. So from that perspective the comment is correct. However, we could perhaps elaborate this.

nc6 avatar Mar 04 '20 08:03 nc6

with the correct protocol version

using that version

@nc6 By "with/use", do you mean that the nodes have started to use the new proposed protocol parameter values even though the ledger rules have not yet adopted those values? I think this is impossible in general. Consider an update proposal that increases ppMaxBlockSize. If a node has adopted the new value prematurely, it might create a block that the ledger rules' currently-adopted protocol parameter values judge to be invalid.

nfrisby avatar Mar 04 '20 14:03 nfrisby

Ah, I see. Yes, when you think of protocol parameters, I agree this is incorrect

nc6 avatar Mar 16 '20 08:03 nc6