From ad3d2d943bf2680419b4109b578bb884eb7ca4b9 Mon Sep 17 00:00:00 2001 From: positiveblue Date: Wed, 4 Jan 2023 14:12:48 -0800 Subject: [PATCH 1/2] ci: fix lint VSC permissions error --- tools/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/Dockerfile b/tools/Dockerfile index 7589278..0e973b2 100644 --- a/tools/Dockerfile +++ b/tools/Dockerfile @@ -11,6 +11,9 @@ RUN cd /tmp \ && mkdir -p /tmp/build/.modcache \ && cd /tmp/tools \ && go install -trimpath -tags=tools github.com/golangci/golangci-lint/cmd/golangci-lint \ - && chmod -R 777 /tmp/build/ + && chmod -R 777 /tmp/build/ \ + && git config --global --add safe.directory /build + # The last line is needed to ensure that go build is able to gather + # information from the vsc used in the builds to get the commit hash. WORKDIR /build From 5a5207dc0131bccb362d4b7d9075ee75f2648446 Mon Sep 17 00:00:00 2001 From: positiveblue Date: Wed, 28 Dec 2022 23:58:07 -0800 Subject: [PATCH 2/2] rpcserver: format rpcLog error We were using `Error(, )` instead of `Errorf(, )`. The error was appended at the end of the message instead of replacing the `%v` tag in the message. --- rpcserver.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rpcserver.go b/rpcserver.go index 4d2e303..cd07460 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -238,7 +238,9 @@ func (s *rpcServer) Stop() error { } // serverHandler is the main event loop of the server. -func (s *rpcServer) serverHandler(blockChan chan int32, blockErrChan chan error) { +func (s *rpcServer) serverHandler(blockChan chan int32, + blockErrChan chan error) { + defer s.wg.Done() for { @@ -275,7 +277,7 @@ func (s *rpcServer) serverHandler(blockChan chan int32, blockErrChan chan error) } } - rpcLog.Error("Unknown server error: %v", err) + rpcLog.Errorf("Unknown server error: %v", err) case height := <-blockChan: rpcLog.Infof("Received new block notification: "+