-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
verrpc: add GetVersion endpoint #4163
Conversation
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.
Great to see this, we probably should have added this a long time ago.
Did a quick first pass, looks good!
I was wondering if now was the time to also start tackling the wallet unlocker state problem.
We could add a simple Unlocked
boolean flag to this new version service.
Then we only need a way to signal that a sub server should also be registered when the WalletUnlocker
service is spun up. I was thinking of a marker interface. If the subserver implements it, it's added/registered to the wallet unlocker, if not, it's skipped.
What do you think? It probably also depends on the release you were targeting with this. If this PR should go in with 0.10.0
then the whole unlocker thing is probably out of scope.
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.
As you say, making sure the endpoint is always reachable (also if wallet is still locked) would be nice.
updated to compile build tags and go version into
|
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.
LGTM, only nits at this point 🎉
f8d161c
to
38b2dea
Compare
We'll do the validation during construction of the runtime so that we can safely use the AppPreRelease field externally without needing to normalize it.
The version field in getinfo is kept the same for backwards compatibility.
38b2dea
to
f93a8ab
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.
LGTM 💎
I think we should also tack on the "unlocked" status as that resolves existing issues users have with the current RPC lifecycle with a single field. However, we can do this in the rc phase, not enough to block this PR IMO.
// strings. In particular it MUST only contain characters in | ||
// semanticAlphabet. | ||
for _, r := range AppPreRelease { | ||
if !strings.ContainsRune(semanticAlphabet, r) { |
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.
Nice change to panic instead of silently omit characters.
var log btclog.Logger | ||
|
||
// Subsystem defines the logging code for this subsystem. | ||
const Subsystem = "VRPC" |
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.
Pretty cool that lnd
will now ship with an integrated VR PC for the next major release 😎
Building on Windows is no longer working.
|
Thanks for the report, @githorray! Can you please try if #4190 fixes the problem? |
string app_pre_release = 7; | ||
|
||
/// The list of build tags that were supplied during comilation. | ||
repeated string build_tags = 8; |
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.
Looking at how this field is used in lightninglabs/loop#181 with the string matching and all, shouldn't we replace this with a compatibility flagged enum? It is a compilation symbol leaking into the runtime interface.
@guggero and I ran into the problem that Worth mentioning in release notes @cfromknecht? |
I don't think it's necessary. Our install docs are pretty clear that you should build with the makefile. There are a host of other things that you'd be missing if you install via |
This PR adds a minimal
verrpc
subserver that is purely responsible for servingversion information about the running daemon. Though some of this information is
displayed via
GetInfo
, it is useful to have a single endpoint and service for thispurpose so that the chances of breaking changes are mitigated.
Third-party applications may not have the ability to be tightly synced with the
daemon, e.g. a mobile app connecting remotely via RPC. In order to support
proto version desynchronization, these apps typically come installed with several
historical versions of the proto files (especially when breaking changes have
been introduced). Apps can then determine the version of the daemon by trying
to decode various requests and looking for signals that indicate the version.
With
verrpc
, these headaches are largely eliminated. There may still be a needto package multiple proto versions, but this makes it dead simple to map the
correct version. The intent (crosses fingers) is that this endpoint would never
undergo breaking changes so that app developers have a stable API they rely
on to determine versioning info.
In the future, we could consider separating the initialization of the
verrpc
subserver to be active for wallet unlocking as well, but those protos don't
experience nearly as much churn as the others.