Add ArcSwap to update Mint configuration at runtime #503
No reviewers
Labels
No labels
DB & Storage
Deployment
Error Handling & Logging
Maintenance
Payment Backend
backport
backport v0.13.x
backport v0.14.x
backport v0.15.x
bindings
blocked
bug
cdk-sql
ci
cli
deps
documentation
duplicate
enhancement
good first issue
help wanted
invalid
keep-open
ldk-node-ui
migrations
mint
mutation-testing
needs rebase
needs review
new nut
nut change
question
ready
rust-version
rustfmt
stacked hold
stale
testing
wallet
weekly-report
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cashubtc/cdk!503
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "swappable-config"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
The main goal is to change settings without having multiple RwLock everywhere, instead having ArcSwap to update the configuration without having access to a mutable reference to the Mint.
This will allow the RPC Server, or any other medium to update the Mint without minimum contention.
This is a pre-requisite for #476
Notes to the reviewers
Suggested CHANGELOG Updates
CHANGED
ADDED
REMOVED
FIXED
Checklist
just final-checkbefore committing@ -0,0 +1,128 @@//! Active mint configurationDoes this need to be
pub?@ -0,0 +1,128 @@//! Active mint configurationThe fact that it is accessed through
get_config()(that I think I should rename toload()), I think it should be pub, at least pub(crate).I'll think if that can be transparent, with something like Deref or something similar.
@ -0,0 +1,128 @@//! Active mint configurationI think these new names are better (9272347), what do you think?
@ -0,0 +1,128 @@//! Active mint configurationThat’s better. 👍
deps under the -Z minimal-version comment are for deps that are not a direct dep of ours, but whatever dependency of ours that pull them in does not properly define their minimal version. Since this is a direct dep of ours can we just move this above the comment.
@ -40,20 +42,14 @@ pub use types::{MeltQuote, MintQuote};/// Cashu MintThink the quote_ttl should also be in the swapable config?
@ -0,0 +25,4 @@/// Mint configuration////// This struct is used to configure the mint, and it is wrapped inside a ArcSwap, so it can be/// updated at runtime without locking the shared config nor without requiriming a mutable reference@thesimplekid this PR is ready for another round of reviews.
ACK
712fa5176d