-
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
chainkit: expose getblockheader #8111
chainkit: expose getblockheader #8111
Conversation
Not sure why so many protos were changed with this. |
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.
Useful RPC call! Straight forward changes.
Comments mainly about getting the commits to build, and also seeing why you're generating diff protos.
If I build using - var err error
- var annotatedContext context.Context
- annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/AddInvoice", runtime.WithHTTPPathPattern("/v1/invoices"))
+ rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/lnrpc.Lightning/AddInvoice", runtime.WithHTTPPathPattern("/v1/invoices"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
- resp, md, err := local_request_Lightning_AddInvoice_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ resp, md, err := local_request_Lightning_AddInvoice_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
} |
Looks like the RPC build step is using a bookworm Docker image, with a newer protobuf compiler? Swtich to bookworm: Digest: sha256:445f34008a77b0b98bf1821bf7ef5e37bb63cc42d22ee7c21cc17041070d134f
Status: Downloaded newer image for golang:1.21.0-alpine
Building protobuf compiler docker image...
#0 building with "default" instance using docker driver
#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s
#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 1.26kB done
#2 DONE 0.0s
#3 [internal] load metadata for docker.io/library/golang:1.21.0-bookworm
#3 ...
#4 [auth] library/golang:pull token for registry-1.docker.io
#4 DONE 0.0s
#3 [internal] load metadata for docker.io/library/golang:1.21.0-bookworm
#3 DONE 1.0s
#5 [1/4] FROM docker.io/library/golang:1.21.0-bookworm@sha256:640f192f24852cd875514e18a01977ae87692dca466abed7705ad3c4670b6993 Compiler install: #6 3.259 After this operation, 252 MB of additional disk space will be used.
#6 3.259 Get:1 http://deb.debian.org/debian bookworm/main amd64 libicu72 amd64 72.1-3 [9376 kB]
#6 3.372 Get:2 http://deb.debian.org/debian bookworm/main amd64 libxml2 amd64 2.9.14+dfsg-1.3~deb12u1 [687 kB]
#6 3.372 Get:3 http://deb.debian.org/debian bookworm/main amd64 libz3-4 amd64 4.8.12-3.1 [7216 kB]
#6 3.425 Get:4 http://deb.debian.org/debian bookworm/main amd64 libllvm14 amd64 1:14.0.6-12 [21.8 MB]
#6 3.575 Get:5 http://deb.debian.org/debian bookworm/main amd64 libclang-cpp14 amd64 1:14.0.6-12 [11.1 MB]
#6 3.651 Get:6 http://deb.debian.org/debian bookworm/main amd64 clang-format-14 amd64 1:14.0.6-12 [75.0 kB]
#6 3.652 Get:7 http://deb.debian.org/debian bookworm/main amd64 clang-format amd64 1:14.0-55.7~deb12u1 [5256 B]
#6 3.652 Get:8 http://deb.debian.org/debian bookworm/main amd64 zlib1g-dev amd64 1:1.2.13.dfsg-1 [916 kB]
#6 3.659 Get:9 http://deb.debian.org/debian bookworm/main amd64 libprotobuf32 amd64 3.21.12-3 [932 kB]
#6 3.666 Get:10 http://deb.debian.org/debian bookworm/main amd64 libprotobuf-lite32 amd64 3.21.12-3 [261 kB]
#6 3.667 Get:11 http://deb.debian.org/debian bookworm/main amd64 libprotobuf-dev amd64 3.21.12-3 [1283 kB]
#6 3.676 Get:12 http://deb.debian.org/debian bookworm/main amd64 libprotoc32 amd64 3.21.12-3 [829 kB]
#6 3.682 Get:13 http://deb.debian.org/debian bookworm/main amd64 protobuf-compiler amd64 3.21.12-3 [83.9 kB]
#6 3.803 debconf: delaying package configuration, since apt-utils is not installed
#6 3.826 Fetched 54.6 MB in 0s (118 MB/s)
#6 3.840 Selecting previously unselected package libicu72:amd64.
#6 3.840 (Reading database ... rpc-check target detects incorrect compiler version: Verifying protos.
cd ./lnrpc; ../scripts/check-rest-annotations.sh
if test -n "$(git status --porcelain)"; then echo "Protos not properly formatted or not compiled with v3.4.0"; git status; git diff; exit 1; fi
Protos not properly formatted or not compiled with v3.4.0 |
Ah, the error message in the |
a18b068
to
3e8a50c
Compare
This worked, and the issue with testing before is from not updating the protos and Added a CLI command and itest + release note change, should be ready now. |
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.
utACK, LGTM (pending proper CI run with acceptable level of green).
3e8a50c
to
3cc350b
Compare
Addressed feedback; the latst windows itest failure looked unrelated. The linter failures are for 3 81-char lines, which are similar to other 81-char lines in those files and IIUC can't cleanly be shortened according to our style guidelines. |
Line ref? |
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 🌷
Pending CI (just approved again)
3cc350b
to
4ba332c
Compare
4ba332c
to
459a60e
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.
tACK, LGTM 🎉
Change Description
Description of change / link to associated issue.
Addresses lightninglabs/taproot-assets#315.
Expose the
GetBlockHeader
call fromChainKit
. This was already available from each possiblechain.Interface
, but not available for users ofChainKit
; a similar call was added toNeutrinoKit
, but that would not work for users not running with a Neutrino backend.Steps to Test
Steps for reviewers to follow to test the change.
Compile and run
lncli chain getbestblock
to get a block hash. Use that as an argument forlncli chain getblockheader
and a hex block header should be returned.Pull Request Checklist
Testing
Code Style and Documentation
[skip ci]
in the commit message for small changes.📝 Please see our Contribution Guidelines for further guidance.