sea-orm integration + rust-lightning persitence layer#95
Open
dcorral wants to merge 1 commit intoRGB-Tools:masterfrom
Open
sea-orm integration + rust-lightning persitence layer#95dcorral wants to merge 1 commit intoRGB-Tools:masterfrom
dcorral wants to merge 1 commit intoRGB-Tools:masterfrom
Conversation
40b884c to
60ab584
Compare
60ab584 to
8aceb21
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces file-based persistence with SQLite database using sea-orm ORM.
Changes
New database tables:
mnemonic- encrypted mnemonic storagekv_store- LDK persistence (channel manager, payments, swaps, network graph, scorer)config- configuration key/value pairs (indexer_url, proxy_url, etc.)revoked_token- revoked auth token IDschannel_peer- channel peer pubkey/address mappingMigrated to database:
Architecture:
DatabaseConnectionviaArcSeaOrmKvStoreimplements rust-lightning'sKVStoreSynctraitrust-lightning submodule (
961313c→b061470):KVStoreSynctrait across 8 filesrgb_utils/mod.rs: replaced file I/O (read_rgb_transfer_info,write_rgb_transfer_info,parse_rgb_payment_info,get_rgb_channel_info_path) with KVStore namespace-based read/write operations usingRGB_PRIMARY_NS+ secondary namespaces (channel_info,payment_info_inbound,payment_info_outbound,transfer_info, etc.)ChannelContext,ChannelManager,OutboundPayments,KeysManager: addedrgb_kv_store: Arc<dyn KVStoreSync + Send + Sync>field, threaded through constructors and deserializationcolor_commitment,color_htlc,color_closing: now take&dyn KVStoreSyncinstead of reading files directlyis_channel_rgb,get_rgb_channel_info,rename_rgb_files,filter_first_hops,is_payment_rgb: switched from path-based lookups to KVStore readsIMPORTANT!
This PR depends on RGB-Tools/rust-lightning#17 and .submodule must be updated to point to the right RGB-Tools fork before merging