-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Modularise RelationalDB #6224
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
base: a1q123456/modularise-wallet-db-and-manifest
Are you sure you want to change the base?
Modularise RelationalDB #6224
Conversation
b7d8cbe to
32296b7
Compare
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
dd1a1a9 to
cf67641
Compare
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## a1q123456/modularise-wallet-db-and-manifest #6224 +/- ##
===========================================================================
Coverage 79.2% 79.2%
===========================================================================
Files 843 843
Lines 71717 71694 -23
Branches 8285 8284 -1
===========================================================================
- Hits 56794 56780 -14
+ Misses 14923 14914 -9
🚀 New features to boost your workflow:
|
| std::uint32_t minLedger; | ||
| std::uint32_t maxLedger; |
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.
Maybe use LedgerRange?
| using AccountTx = | ||
| std::pair<std::shared_ptr<Transaction>, std::shared_ptr<TxMeta>>; | ||
| using AccountTxs = std::vector<AccountTx>; | ||
| using txnMetaLedgerType = std::tuple<Blob, Blob, std::uint32_t>; |
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.
Better to avoid pairs and tuples if possible because they decrease readability
| closeTransactionDB() = 0; | ||
| }; | ||
|
|
||
| template <class T, class C> |
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.
Please add concepts on T and C to improve compilation errors on misuse. Probably std::is_arithmetic and that std::is_convertible.
| closeTransactionDB() override; | ||
|
|
||
| std::optional<LedgerHeader> | ||
| getLedgerInfoByIndex(LedgerIndex ledgerSeq) override; |
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.
Please add docs comments for added methods for consistency
| std::optional<LedgerHeader> | ||
| getNewestLedgerInfo() override; | ||
|
|
||
| SQLiteDatabase( |
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.
Maybe move the implementation into cpp file?
High Level Overview of Change
This PR modularise xrpld/rdb
Context of Change
The rdb module was not properly designed. We have 3 classes:
RelationalDBand adds some more pure virtual methodsSQLiteDatabaseand implements all the methods.The factory function
RelationalDB::initmethod checks the config and only returns an instance of SQLiteDatabaseImp, we can see in the code base that we are doingdynamic_cast<SQLiteDatabase*>(app.getRelationalDb())everywhere.To address this problem and help modularise app/tx, the rdb module needs to be refactored and moved to libxrpl.
This PR is part of the modularisation of the transactors. See all PRs here:
#6222
#6223
#6224
#6225
#6226
#6227
#6228
Type of Change
.gitignore, formatting, dropping support for older tooling)API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)