-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify the protVer
arguments
#324
Comments
Minor comments:
Yeah, I think this is a case where we actually loose generality by only considering Allegra: Ignoring experimental eras for now (this just changes what the "last era" is),
Also see #294 (comment) So in fact, we can safely use the
That specific approach won't work directly:
The general approach can of course still work, we just have to pass in more stuff ("worst-case", just the max major protocol version directly).
Intuitively, that sounds like a good plan; main question is: do we ever want forging nodes to put different versions in their header for different eras? Maybe a statistical use case similar to https://github.com/input-output-hk/cardano-node/blob/70dde196367e86c977fbe72167f4eb303b3ffa88/cardano-node/src/Cardano/Node/Protocol/Cardano.hs#L210-L213 could arise? |
The changing semantics of the field---especially in a way dependent on the
Yeah, I figured there isn't quite enough information/it wasn't accessible right now. But this still seems right to me as a high-level design target.
In general, sounds useful. And indeed you linked to a former example use (which correctly comments itself as a "HACK" :/). But it also sounds not strictly necessary. So at the very least, I think it should be provided in a separate "overrides" argument, eg (perhaps limited to the minor version?). More directly: I think we should remove it now and add something like that back when it's next actually needed. |
PR #294 is definitely related. For context: I hadn't looked over that PR before drafting this Issue. |
PR IntersectMBO/ouroboros-network#3891 also seems related Also, I transferred Issue #325 from Wise final words from Jared in his comment:
|
The Edit: Just for context: that commit is from March 2020, which is before the Byron-Shelley hardfork. |
Esgen and I just discussed this all during a call. There are several overlapping concerns, sadly. Testing overridesFor testing, we let config override the version-based triggers in the HFC. Experimental flagsThere are two "experimental" flags in the node: The node ultimately passes
The node uses
It is not obvious to me how these two flags interact in general. In particular, suppose we have an experimental era, such as Conway right now. Is it necessarily the case that When we instead don't have an experimental era, The Obsolete Node ChecksThe It seems possible that we could ban intra-era hard forks in the future. Or maybe even implement them as duplicates in the HFC type-level list (but that would be inconvenient in terms of performance, and Issue #328, eg). Either would let us remove the Type-level ledger era major version intervalsThe ledger statically assigns intervals of the major version to each era. For example:
Alonzo is different because it contains a so-called "intra-era hard fork" (ie a hard fork that does not change the ledger era, and so does not involve the HFC).
If it weren't for the testing overrides and the experimental flags, I think all of the node's use of protocol versions would be determined by those |
My mental model, although I know very little about the |
I think the only risk of not considering this would be surprise delays in releases (which are bad, but not as bad as bugs eg). |
I think so too. Right now graph TD;
1'-->0;
1-->0;
2-->1;
2-->1';
where Our picking algorithm would need to pick the smallest sub-partial order which is closed under supremum. This way if one enables only consensus experimental features one would end with versions smaller or equal to Handshake would do the same as now: pick the largest version which belongs to both own supported versions and the presented one. |
While giving us flexibility, using different protocol versions for all eras increased the level of complexity and led to several errors in the past. This PR removes this flexibility by using a single protocol version, which determines the maximum protocol version Consensus supports. See #324 for more background. Closes #324. Closes #276. TODOs: - [x] Format the code. - [x] Fix ThreadNet test failure. - [x] Improve documentation. - [x] Address all the `FIXME`s.
Without loss of generality, focus on Allegra. Start from the binding of
protVerAllegra
inprotocolInfoCardano
. EG at https://github.com/input-output-hk/ouroboros-consensus/blob/0079ee65f6c49d1c05a8d30ffa492b20c46b12b8/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Node.hs#L658There,
protVerAllegra
:mkShelleyBlockConfig
maxMajorProtVer
Also,
maxMajorProtVer
:tpraosParams
and used to constructpraosParams
, to eventually be an upper bound in theProtocolHeaderSupportsEnvelope
envelopeChecks
method (to throw the "obsolete node" errors).mkPartialLedgerConfigShelley
which eventually uses it to constructorSL.Globals
(D) I just opened The maxMajorPV field of Globals is unused cardano-ledger#3682, which would eliminate this use.
(A) ultimately enables the node to write this version to a header field that is never scrutinized by the entire Cardano node code base. It is only used for SPOs to indicate in their blocks that they have upgraded their software in preparation for an imminent transition to the next ledger era.
(C) This use is motivated in a short paragraph in the the ledger spec, here: https://github.com/input-output-hk/cardano-ledger/blob/63d98c3f8e9eb2878cec3ab71c54fc40c798ac01/eras/shelley/formal-spec/protocol-parameters.tex#L162-L165 It is worth noting that the value scrutinized here doesn't come from the header, it instead comes from the ledger state (view). And most crucially: it is not the header from (A).
(B) The influence of
allegraProtVer
onmaxMajorProtVer
is via the latter's definition:https://github.com/input-output-hk/ouroboros-consensus/blob/0079ee65f6c49d1c05a8d30ffa492b20c46b12b8/ouroboros-consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/Node.hs#L754-L775
Note that this use is exactly contrary to the warning comments where
allegraProtVer
is actually set, such as:https://github.com/input-output-hk/cardano-node/blob/70dde196367e86c977fbe72167f4eb303b3ffa88/cardano-node/src/Cardano/Node/Protocol/Cardano.hs#L185-L194
It is currently my suspicion that all of these per-era
*ProtVer
arguments should be removed (thereby eliminating (B)), and replaced by some logic that definesmaxMajorProtVer
by analyzing the last giventransitionIntraShelleyTrigger
. And the per-era values used in (A) should instead all simply usemaxMajorProtVer
.The text was updated successfully, but these errors were encountered: