-
Notifications
You must be signed in to change notification settings - Fork 24
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
Check LND has required version and build tags on start LNDK. #111
Conversation
Thanks for the PR @kannapoix! This is really useful. I'll try to give it a look this week. |
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 again for the PR @kannapoix! 🚀
It's looking good to me so far, though I still need to test it out. Just a few nits and the following things:
- Re: the rc candidates. Actually, 0.18.0-beta > 0.18.0-beta.rc, the rcs are just test versions ahead of the official release, so I think we can assume our users won't be running those. Looks like 0.18.0-beta officially just came out today :)
- The integration tests are failing because they're running lnd v17 (which seems to show that your code is working correctly!). If you can, in a separate commit just bump the lnd submodule to v18. I think you can do that by:
cd
-ing intolnd
(in the rootlndk
dir) and switching to the v18 branch. - Feel free to ignore the codecov error, that's something I need to look into separately...
Thank you for your feedback. I will address the issue. |
2867eff
to
8cff2e0
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.
Hey thanks for making those changes @kannapoix! I did some tests on some LND nodes of different versions and the changes are working well 🎊
I think we're pretty close. The main thing is make itest
fails because the skip_version_check
field is added to Cfg
, which needs to be updated in src/cli.rs
and tests/integration_tests.rs
. If you could rebase over the most recent master that'd be great too.
src/lib.rs
Outdated
return Err(()); | ||
} | ||
|
||
if !has_build_tags(&version, None) { |
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'm thinking let's move this below the if !args.skip_version_check scope because even if skip_version_check is set, we can check if the right build tags are set
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.
Oh, I see. I misunderstood. I'll fix it.
src/lib.rs
Outdated
|
||
if !has_version(&version, None) { | ||
error!( | ||
"The LND version {} is not compatible with LNDK. Please updates to version {}.{}.{}-{}", |
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.
nit: update* typo
Sorry, I overlooked it. |
@kannapoix Thank you, appreciate it! |
ee130e7
to
18c2a1d
Compare
I believe the skip version check option for the CLI is no longer necessary, as #104 has changed the CLI implementation so that it now simply connects to an already running LNDK server. I can't run integration tests on my ARM Mac, because bitcoind crate brings binary for Intel Mac. |
EDIT: If you're just talking about the cli, yes that probably makes sense. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #111 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 1 1
Lines 96 97 +1
======================================
- Misses 96 97 +1 ☔ View full report in Codecov by Sentry. |
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.
@kannapoix Looks like the integration tests are passing. 🎊 And the code looks good. It's super close to merge-ready.
Just one final comment below and it would be great if you could squash the commits into two: 1) the main changes (LND version and build tag checks), 2) the skip_version_check option.
f90685f
to
6abdb00
Compare
LNDK verifies that the version of LND running alongside it is compatible with LNDK. If users need to bypass this version check for any reason, they can use the skip-version-check option.
6abdb00
to
21dfc92
Compare
Commits squashed into 'main changes', 'skip version check option', and 'bump lnd'. |
This PR resolves #30
Check version and build tags of connecting LND at the start of LNDK.
We could make the
has_version
function smaller, but I chose clarity over shotness.The
has_version
andhas_tags
functions have an optionalrequirement
argument, so we can test these functions with constants dedicated to the unit testing.I have found that LND does not strictly follow semantic versioning.
LND always release with
beta
pre-release version. Release candidate versions are tagged with something likebeta.rc1
. If I understand correctly,0.18.0-beta
<0.18.0-beta.rc
right?