Internal/External: External
Summary
The consensus layer is responsible for validating block headers (at least, some elements of it). This happens through the envelopeChecks:
|
envelopeChecks cfg lv hdr = do |
|
unless (m <= maxpv) $ throwError (ObsoleteNode m maxpv) |
|
unless (bhviewHSize bhv <= fromIntegral @Word16 @Int maxHeaderSize) $ |
|
throwError $ |
|
HeaderSizeTooLarge (bhviewHSize bhv) maxHeaderSize |
|
unless (bhviewBSize bhv <= maxBodySize) $ |
|
throwError $ |
|
BlockSizeTooLarge (bhviewBSize bhv) maxBodySize |
|
where |
|
pp = praosParams cfg |
|
(MaxMajorProtVer maxpv) = praosMaxMajorPV pp |
|
(ProtVer m _) = lvProtocolVersion lv |
|
maxHeaderSize = lvMaxHeaderSize lv |
|
maxBodySize = lvMaxBodySize lv |
|
bhv = mkHeaderView hdr |
One of the check refers to the protocol major version:
unless (m <= maxpv) $ throwError (ObsoleteNode m maxpv)
However:
maxpv is a configuration parameter provided at runtime
m comes from the ledger view and reflects the current protocol version major
Notice that the protocol version from the header is totally ignored.
Steps to reproduce
See this block on Preview which declares a protocol major version 12 when the network just transitioned into 11.
Expected behavior
I am unclear whether this is desired or a genuine oversight? It seems to me that this check only ensures that the consensus and ledger libraries agree on what is the maximum protocol version; but then, why perform this check on every header?
If this is the intended behavior, then so be it. If not, let me know 😶
System info (please complete the following information):
- OS Name: irrelevant
- OS Version: irrelevant
- Consensus version:
==3.0.1.0
Screenshots and attachments
Additional context
Add any other context about the problem here.
Internal/External: External
Summary
The consensus layer is responsible for validating block headers (at least, some elements of it). This happens through the
envelopeChecks:ouroboros-consensus/ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Protocol/Praos.hs
Lines 111 to 125 in 2ca6c74
One of the check refers to the protocol major version:
However:
maxpvis a configuration parameter provided at runtimemcomes from the ledger view and reflects the current protocol version majorNotice that the protocol version from the header is totally ignored.
Steps to reproduce
See this block on Preview which declares a protocol major version
12when the network just transitioned into11.Expected behavior
I am unclear whether this is desired or a genuine oversight? It seems to me that this check only ensures that the consensus and ledger libraries agree on what is the maximum protocol version; but then, why perform this check on every header?
If this is the intended behavior, then so be it. If not, let me know 😶
System info (please complete the following information):
==3.0.1.0Screenshots and attachments
Additional context
Add any other context about the problem here.