-
Notifications
You must be signed in to change notification settings - Fork 32
consensus: annotate headers with their slot's RelativeTime #1288
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
Conversation
...oros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus/NodeKernel.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/PeerSimulator/Run.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Genesis/Governor.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Genesis/Governor.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Genesis/Governor.hs
Outdated
Show resolved
Hide resolved
...ensus/src/ouroboros-consensus/Ouroboros/Consensus/MiniProtocol/BlockFetch/ClientInterface.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HeaderValidation.hs
Outdated
Show resolved
Hide resolved
...boros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/MiniProtocol/ChainSync/Client.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/test/consensus-test/Test/Consensus/MiniProtocol/BlockFetch/Client.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/test/consensus-test/Test/Consensus/MiniProtocol/ChainSync/Client.hs
Outdated
Show resolved
Hide resolved
b76d77c
to
2b11f09
Compare
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HeaderValidation.hs
Outdated
Show resolved
Hide resolved
...ensus/src/ouroboros-consensus/Ouroboros/Consensus/MiniProtocol/BlockFetch/ClientInterface.hs
Outdated
Show resolved
Hide resolved
...boros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/MiniProtocol/ChainSync/Client.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Util/AnchoredFragment.hs
Outdated
Show resolved
Hide resolved
ouroboros-consensus/src/unstable-consensus-testlib/Test/Util/HeaderValidation.hs
Outdated
Show resolved
Hide resolved
1b5a867
to
6f9c71b
Compare
7296216
to
f40c927
Compare
...nsus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/Abstract/NoHardForks.hs
Outdated
Show resolved
Hide resolved
I pushed up some commits that improve some names&Haddock and also hide |
ccc97d4
to
566d1e5
Compare
I changed the representation of the fragment pair based on the conversation we had in today's office hours. I confirmed that the statemachine test fails (nicely) when I insert bugs in either ChainSel or Background's maintenance of the fragment with times. I introduced a bespoke strict pair type for clarity and to most easily satisfy the NoThunks tests (which are also enabled by the Cabal flags that enable the new invariant checking logic for the fragment pair). |
...oros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus/NodeKernel.hs
Show resolved
Hide resolved
c625852
to
4cb2c5e
Compare
I squashed in order to rebase. I also minized the diff. The next step is to split it into two or three separate commits. |
2effa46
to
ee2f301
Compare
|
||
instance ( HasHeader (Header blk) | ||
, StandardHash (HeaderWithTime blk) | ||
, Typeable blk |
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 is the root cause of all the additional Typeable blk
contexts in this commit. It's required to satisfy the superclass on the (upstream) HasHeader
. I don't see how to avoid it, sadly.
ba54272
to
b4424eb
Compare
b4424eb
to
75abfdf
Compare
I've made progress on this PR by rebasing on top of the many changes in |
I'm still making some progress there and do not want it to be merged yet.
870aa07
to
c8cdf94
Compare
29a098c
to
9a2a73e
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.
LGTM (but, once again, we might not want to merge this immediately, cf. #1288 (comment))
-> SlotForgeTimeOracle m blk | ||
-- ^ Slot forge time, see 'headerForgeUTCTime' and 'blockForgeUTCTime'. |
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.
I think we can just remove SlotForgeTimeOracle
completely
atomically $ LgrDB.setCurrent lgrDB ledger | ||
varChain <- newTVarIO chain | ||
varChain <- newTVarWithInvariantIO checkInternalChain $ InternalChain chain chainWithTime |
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.
Hmm, the invariant that is being checked in checkInternalChain
seems sufficiently lightweight that we could test it by default if e.g. assertions are enabled (which they are when running our tests in CI). However, TVar
invariants are not checked by default (only in the nightly tests, which have their own problems, chiefly that we have no notifications for when they fail), as they include the nothunks tests, which are extremely slow.
I don't think this should block this PR though.
9a2a73e
to
ca47595
Compare
- Define HeaderWithTime - In ChainDB, maintain a parallel selection with time annotations - Remove SlotForgeTimeOracle, as we no longer need to translate time in the BlockFetch client - Update BlockFetch client to operate on chains that use HeaderWithTime - Note that HeaderWithTime is hidden from the tracer events, at least for now. Co-authored-by: Damian Nadales <[email protected]> Co-authored-by: Nicolas Frisby <[email protected]> Co-authored-by: amesgen <[email protected]>
ca47595
to
eb8f344
Compare
This is a follow-up to #1288 that ensures - do not expose `HeaderWithTime` in `TraceGDDEvent` via `GDDDebugInfo` - do not store the chain fragment with `HeaderWithTime` in `DensityBounds` adding the "no changelog'' label, as the relevant changelog fragments are already included into "main" Draft PR to for integration with the node: IntersectMBO/cardano-node#6211
Introduce a new
HeaderWithTime
data type, which annotates each received header with the relative time of its slot as calculated by the ChainSync client.Partially addresses #1301