Skip to content
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

Switch over to the new LedgerDB API #815

Merged
merged 9 commits into from
Feb 22, 2024
Merged

Conversation

jorisdral
Copy link
Contributor

Description

Please include a meaningful description of the PR and link the relevant issues
this PR might resolve.

@jorisdral jorisdral self-assigned this Dec 5, 2023
@jorisdral jorisdral force-pushed the jdral/ledgerdb2-switch branch from 9f5a80e to 6db160d Compare December 8, 2023 14:43
jorisdral added a commit that referenced this pull request Dec 13, 2023
# Description

Follow-up to #510

This PR includes changes to the alternative LedgerDB API that are
required for integration, which is happening in #815. These changes
include:


* LedgerDB API changes:
   * The LedgerDB can now be closed
  * The LedgerDB API now exposes `getToplevelConfig`
* Forker acquisition is refactored because we now have three variants
instead of two, and we can't reuse `StaticEither`
  * Remove the STM function argument from forker acquisition
  * Forker acquisition now requires passing in a resource registry
* Moved `QueryBatchSize` to the API level, because it's not
implementation specific
* Forkers now have a `forkerRangeReadTablesDefault` function that uses a
`QueryBatchSize` that is configured for the whole LedgerDB.
  * `AnnLedgerError` now holds a `Forker`. 
   * Added a few helper functions
* V1 implementation:
  * Export more definitions from the `Snapshots` module
* Refactored resource acquisition for backing store handles and db
changelogs
* Forkers are no longer implemented as separate handles, but stored
directly in the `LedgerDBEnv`. This ensures better concurrency behaviour
with respect to closing the LedgerDB and closing forkers. Note: forkers
are now implemented similar to ChainDB followers.
  * Expose `LedgerDbSerialiseConstraints` 
  * Small renamings/refactorings
@jorisdral jorisdral force-pushed the jdral/ledgerdb2-switch branch 2 times, most recently from 20149b4 to 30d4e25 Compare December 13, 2023 15:58
@jorisdral jorisdral force-pushed the jdral/ledgerdb2-switch branch 3 times, most recently from c85fdc2 to 4a927f5 Compare December 22, 2023 10:41
Non-integrated parts:
* db-analyser
* ChainDB arguments and initialisation
* LedgerDB OnDisk QSM tests: LedgerDB initialisation and new commands
* LocalStateQuery server tests: LedgerDB initialisation
* ChainDB QSM tests: LedgerDB initialisation and new commands

Other TODOs:
* Use InnerOpenCont for LedgerDB initialisation
* Put the BackingStore in a resource registry on LedgerDB initialisation
* Move tests into the correct module hierarchy
* Remove/tweak the `Show Forker` instance
@jorisdral jorisdral force-pushed the jdral/ledgerdb2-switch branch from 4a927f5 to 4a7deb2 Compare December 22, 2023 10:54
@jorisdral jorisdral force-pushed the jdral/ledgerdb2-switch branch 2 times, most recently from a2430f1 to c657bcc Compare December 22, 2023 17:31
@jasagredo jasagredo marked this pull request as ready for review February 22, 2024 14:34
@jasagredo jasagredo merged commit 2bee0c5 into utxo-hd-8.2.1 Feb 22, 2024
2 of 45 checks passed
@jasagredo jasagredo deleted the jdral/ledgerdb2-switch branch February 22, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants