-
Notifications
You must be signed in to change notification settings - Fork 93
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
Periodical external pathfinding scores merge #449
base: main
Are you sure you want to change the base?
Conversation
e0b7070
to
58acc12
Compare
5858404
to
fdf2b5d
Compare
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.
Thanks! Did a first pass, already looks pretty good!
5a42ff9
to
0cf5774
Compare
619c9c9
to
6ded8af
Compare
7bf68af
to
14167eb
Compare
async fn sync_external_scores( | ||
logger: &Logger, scorer: &Mutex<CombinedScorer<Arc<Graph>, Arc<Logger>>>, | ||
node_metrics: &RwLock<NodeMetrics>, kv_store: Arc<DynStore>, url: &String, | ||
) -> () { |
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.
Should this return a Result
?
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.
I don't think so - this function cannot fail?
src/scoring.rs
Outdated
match body { | ||
Err(e) => { | ||
log_error!(logger, "Failed to read external scores update: {}", e); | ||
return; |
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.
Let's avoid these explicit returns
if possible.
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.
Indeed, not necessary. I wanted to exit the parent function with these returns, but just letting it run would have the same result.
In this current revision I now have a few real ones, after unwrapping the matches a bit.
14167eb
to
1a4b051
Compare
Comments addressed. Now need to decide in lightningdevkit/rust-lightning#3562 how to read the combined scorer from disk (with local and merged data), and apply that in this PR. |
7c9309d
to
d6bb7cf
Compare
Save external pathfinding scores in a cache so that they will be available immediately after a node restart. Otherwise there might be a time window where new scores need to be downloaded still and the node operates on local data only.
d6bb7cf
to
5ae6a35
Compare
Fixes #313
Depends on lightningdevkit/rust-lightning#3562
Export functionality in #458