-
Notifications
You must be signed in to change notification settings - Fork 25
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
For release 10.3 #1376
base: main
Are you sure you want to change the base?
For release 10.3 #1376
Conversation
c5712c4
to
0279690
Compare
0279690
to
2b0f104
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some really good progress.
Hopefully my comments unblock you and you can continue progressing further
ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Eras.hs
Show resolved
Hide resolved
ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Eras.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Eras.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus-cardano/src/shelley/Ouroboros/Consensus/Shelley/Ledger/Config.hs
Outdated
Show resolved
Hide resolved
...consensus-cardano/src/ouroboros-consensus-cardano/Ouroboros/Consensus/Cardano/CanHardFork.hs
Outdated
Show resolved
Hide resolved
...os-consensus-protocol/src/ouroboros-consensus-protocol/Ouroboros/Consensus/Protocol/Praos.hs
Outdated
Show resolved
Hide resolved
...os-consensus-protocol/src/ouroboros-consensus-protocol/Ouroboros/Consensus/Protocol/Praos.hs
Outdated
Show resolved
Hide resolved
...s-consensus-protocol/src/ouroboros-consensus-protocol/Ouroboros/Consensus/Protocol/TPraos.hs
Outdated
Show resolved
Hide resolved
...s-consensus-protocol/src/ouroboros-consensus-protocol/Ouroboros/Consensus/Protocol/TPraos.hs
Outdated
Show resolved
Hide resolved
@@ -392,7 +397,7 @@ mkShelleyGlobals TPraosConfig{..} = SL.Globals { | |||
, slotsPerKESPeriod = tpraosSlotsPerKESPeriod | |||
, stabilityWindow = SL.computeStabilityWindow k tpraosLeaderF | |||
, randomnessStabilisationWindow = SL.computeRandomnessStabilisationWindow k tpraosLeaderF | |||
, securityParameter = k | |||
, securityParameter = nonZeroOr k $ error "The security parameter cannot be zero." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try pushing this NonZero
type further into SecurityParam
, securityParameter = nonZeroOr k $ error "The security parameter cannot be zero." | |
, securityParameter = k |
Because then this invariant will propagate throughout the whole system, instead of having a random error
call here.
If we push it far enough it will become a deserializaition failure somewhere in a json or cbor decoder, rather than an exception in pure code.
1e5ae5a
to
58b5304
Compare
-- | The "tip" to prune snapshots from. | ||
-- | ||
-- `SecurityParam` has been updated to use `NonZero` but we need to prune from | ||
-- @0@ in some cases. | ||
-- | ||
-- Rather than using a plain `Word64` we use this to be able to distinguish that | ||
-- we are indeed using | ||
-- 1. @0@ in places where it is necessary | ||
-- 2. the security parameter as is, in other places | ||
data LedgerDBPruneTip = LedgerDBPruneTipZero | LedgerDBPruneTip SecurityParam |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be in the LedgerDB folder. Also some rewording:
-- | The "tip" to prune snapshots from. | |
-- | |
-- `SecurityParam` has been updated to use `NonZero` but we need to prune from | |
-- @0@ in some cases. | |
-- | |
-- Rather than using a plain `Word64` we use this to be able to distinguish that | |
-- we are indeed using | |
-- 1. @0@ in places where it is necessary | |
-- 2. the security parameter as is, in other places | |
data LedgerDBPruneTip = LedgerDBPruneTipZero | LedgerDBPruneTip SecurityParam | |
-- | How many ledger states to keep in the LedgerDB after a prune. | |
-- | |
-- Rather than using a plain `Word64` we use this to be able to distinguish that | |
-- we are indeed using | |
-- 1. @0@ in places where it is necessary, namely when completing the replay of the ImmutableDB blocks as part of opening the ChainDB | |
-- 2. the security parameter as is, in other places, note it is a strictly positive value | |
data LedgerDBPruneNum = LedgerDBPruneZero | LedgerDBPruneNum SecurityParam |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or LedgerDBPruneN
or just LedgerDBPrune
Description
Please include a meaningful description of the PR and link the relevant issues
this PR might resolve.
Also note that: