-
Notifications
You must be signed in to change notification settings - Fork 87
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
Fix more thunks #1793
Fix more thunks #1793
Conversation
See the commits messages for more details. I'm still waiting for IntersectMBO/cardano-ledger#746 to be merged. UPDATE: merged & updated this PR. |
When running the mock Praos ThreadNet tests with the `checktvarinvariant` flag on, we were seeing the following failure: simple convergence: FAIL (52.75s) *** Failed! (after 26 tests and 1 shrink): Exception: Invariant violation: nbPastChunks (2) /= PSQ.size pastChunksInfo (1) CallStack (from HasCallStack): error, called at src/Control/Monad/Class/MonadSTM/Strict.hs:174:31 in .. checkInvariant, called at src/Ouroboros/Consensus/Util/MonadSTM/StrictMVar.hs:167:5 in .. updateMVar, called at src/Ouroboros/Consensus/Storage/ImmutableDB/Impl/Index/Cache.hs:572:22 in .. getChunkInfo, called at src/Ouroboros/Consensus/Storage/ImmutableDB/Impl/Index/Cache.hs:665:5 in .. When there are multiple concurrent cache misses for the same epoch, multiple threads will concurrently try to insert the same epoch in the cache, incrementing `nbPastChunks` each time, even when the same epoch is already in the cache, violating the invariant `nbPastChunks == PSQ.size pastChunksInfo`. Fix it by only incrementing `nbPastChunks` when the new chunk was not already in the cache.
6d8e7ca
to
ed1f096
Compare
ed1f096
to
0b33f54
Compare
CI is failing because the Byron This means that users would have to replay their ledger from scratch, taking many minutes on startup. With the current elision done in |
I have updated the golden tests because of #1798 (comment). |
This brings in IntersectMBO/cardano-ledger#746, fixing a thunk.
The LedgerState type changed, which will require a replay from genesis for nodes upgrading to a version including this change. The UPIState is only sent through the LocalStateQuery protocol, which is not actively being used yet.
c4838c9
to
a88cad4
Compare
bors r+ |
Fix thunks in Praos
ImmutableDB.Cache: fix concurrency bug
Bump dependency on cardano-ledger