-
Notifications
You must be signed in to change notification settings - Fork 86
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
ChainDB: ChainDB should be able to return chain fragments with associated ledger states #1440
Comments
This will be required for the implementation of the local state query protocol also (#1366). |
Due to concerns about laziness, will implement , getPastLedger :: STM m (Point -> Maybe (ExtLedgerState blk)) instead. |
Turns out, this is not implementable (either function). The problem is that computing an arbitrary ledger state may involve reading from disk, and hence this cannot live in STM. We need to split up block production in order to do this; that is, we need to close #786 first. |
Marking as high priority because required to fix a bug (#1437). |
1446: Add ability to get past ledger states r=edsko a=edsko This also fixes a regression in the tests where non-saturated chains (fewer than `k` blocks) were ruled out; fortunately, this was a regression in the tests only, not in the code. Running 1M tests on the in-memory ledger DB: ``` # cabal run test-storage -- -p InMemory --quickcheck-tests=1000000 Up to date ouroboros-storage Storage LedgerDB InMemory Serialisation ChainSummary: OK (5.80s) +++ OK, passed 1000000 tests. Genesis length: OK (1.21s) +++ OK, passed 1000000 tests. current: OK (1.21s) +++ OK, passed 1000000 tests. Push incrementsLength: OK (2.26s) +++ OK, passed 1000000 tests (64.0082% saturated). lengthMatchesNumBlocks: OK (2.08s) +++ OK, passed 1000000 tests (63.9868% saturated). matchesPolicy: OK (2.38s) +++ OK, passed 1000000 tests (63.9719% saturated). expectedLedger: OK (3.02s) +++ OK, passed 1000000 tests (63.9387% saturated). pastLedger: OK (3.76s) +++ OK, passed 1000000 tests: 96.4751% within reach 63.9570% saturated Rollback maxRollbackGenesisZero: OK (1.26s) +++ OK, passed 1000000 tests. ledgerDbMaxRollback: OK (2.83s) +++ OK, passed 1000000 tests (63.9984% saturated). switchSameChain: OK (3.35s) +++ OK, passed 1000000 tests (63.9431% saturated). switchMatchesPolicy: OK (3.84s) +++ OK, passed 1000000 tests (64.0446% saturated). switchExpectedLedger: OK (4.99s) +++ OK, passed 1000000 tests (64.0571% saturated). pastAfterSwitch: OK (5.34s) +++ OK, passed 1000000 tests: 92.9097% within reach 63.9944% saturated ``` All 14 tests passed (43.35s) Closes #1440. Co-authored-by: Edsko de Vries <[email protected]>
This will be required in order to be able to create a fork in block production; see #1437 for details. The tentative API proposal is
The text was updated successfully, but these errors were encountered: