WH-1934: upgrade golang to 1.19 (#1941)
* upgrade to golang 1.19.3 Co-authored-by: tbjump <> Co-authored-by: tbjump <unknown>
This commit is contained in:
parent
31dfbef6e7
commit
091ee0877d
|
@ -48,7 +48,7 @@ jobs:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-go@v2
|
- uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: "1.17.5"
|
go-version: "1.19.3"
|
||||||
- run: make node
|
- run: make node
|
||||||
|
|
||||||
algorand:
|
algorand:
|
||||||
|
@ -233,7 +233,7 @@ jobs:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-go@v2
|
- uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: "1.19.0"
|
go-version: "1.19.3"
|
||||||
- run: curl https://get.ignite.com/cli@v0.23.0 | bash && mv ignite /usr/local/bin/
|
- run: curl https://get.ignite.com/cli@v0.23.0 | bash && mv ignite /usr/local/bin/
|
||||||
- run: cd wormchain && make proto -B && make test
|
- run: cd wormchain && make proto -B && make test
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ jobs:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-go@v2
|
- uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: "1.17.5"
|
go-version: "1.19.3"
|
||||||
- name: Install formatter
|
- name: Install formatter
|
||||||
run: go install golang.org/x/tools/cmd/goimports@latest
|
run: go install golang.org/x/tools/cmd/goimports@latest
|
||||||
- name: Formatting checks
|
- name: Formatting checks
|
||||||
|
|
|
@ -5,15 +5,12 @@ linters:
|
||||||
# Enable specific linter
|
# Enable specific linter
|
||||||
# https://golangci-lint.run/usage/linters/#enabled-by-default-linters
|
# https://golangci-lint.run/usage/linters/#enabled-by-default-linters
|
||||||
enable:
|
enable:
|
||||||
- deadcode
|
|
||||||
- errcheck
|
- errcheck
|
||||||
- gosimple
|
- gosimple
|
||||||
- govet
|
- govet
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- structcheck
|
|
||||||
- typecheck
|
- typecheck
|
||||||
- unused
|
- unused
|
||||||
- varcheck
|
|
||||||
- gosec
|
- gosec
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
The following dependencies are required for local development:
|
The following dependencies are required for local development:
|
||||||
|
|
||||||
- [Go](https://golang.org/dl/) >= 1.17.5
|
- [Go](https://golang.org/dl/) >= 1.19.3
|
||||||
- [Tilt](http://tilt.dev/) >= 0.20.8
|
- [Tilt](http://tilt.dev/) >= 0.20.8
|
||||||
- Any of the local Kubernetes clusters supported by Tilt.
|
- Any of the local Kubernetes clusters supported by Tilt.
|
||||||
We strongly recommend [minikube](https://kubernetes.io/docs/setup/learning-environment/minikube/) >=
|
We strongly recommend [minikube](https://kubernetes.io/docs/setup/learning-environment/minikube/) >=
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
|
# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
|
||||||
FROM docker.io/golang:1.17.5@sha256:90d1ab81f3d157ca649a9ff8d251691b810d95ea6023a03cdca139df58bca599
|
FROM docker.io/golang:1.19.3@sha256:dc76ef03e54c34a00dcdca81e55c242d24b34d231637776c4bb5c1a8e8514253
|
||||||
|
|
||||||
RUN useradd -u 1000 -U -m -d /home/lint lint
|
RUN useradd -u 1000 -U -m -d /home/lint lint
|
||||||
USER 1000
|
USER 1000
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
|
# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
|
||||||
FROM docker.io/golang:1.17.5@sha256:90d1ab81f3d157ca649a9ff8d251691b810d95ea6023a03cdca139df58bca599 AS go-tools
|
FROM docker.io/golang:1.19.3@sha256:dc76ef03e54c34a00dcdca81e55c242d24b34d231637776c4bb5c1a8e8514253 AS go-tools
|
||||||
|
|
||||||
# Support additional root CAs
|
# Support additional root CAs
|
||||||
COPY README.md cert.pem* /certs/
|
COPY README.md cert.pem* /certs/
|
||||||
|
@ -15,7 +15,7 @@ RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/go \
|
||||||
cd /app/tools && CGO_ENABLED=0 ./build.sh
|
cd /app/tools && CGO_ENABLED=0 ./build.sh
|
||||||
|
|
||||||
# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
|
# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
|
||||||
FROM docker.io/golang:1.17.5@sha256:90d1ab81f3d157ca649a9ff8d251691b810d95ea6023a03cdca139df58bca599 AS go-build
|
FROM docker.io/golang:1.19.3@sha256:dc76ef03e54c34a00dcdca81e55c242d24b34d231637776c4bb5c1a8e8514253 AS go-build
|
||||||
|
|
||||||
# Support additional root CAs
|
# Support additional root CAs
|
||||||
COPY README.md cert.pem* /certs/
|
COPY README.md cert.pem* /certs/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM --platform=linux/amd64 docker.io/golang:1.17.5@sha256:90d1ab81f3d157ca649a9ff8d251691b810d95ea6023a03cdca139df58bca599 AS bitcoin-build
|
FROM docker.io/golang:1.19.3@sha256:dc76ef03e54c34a00dcdca81e55c242d24b34d231637776c4bb5c1a8e8514253 AS bitcoin-build
|
||||||
|
|
||||||
ARG ARCH=amd64
|
ARG ARCH=amd64
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module github.com/certusone/wormhole/clients/eth
|
module github.com/certusone/wormhole/clients/eth
|
||||||
|
|
||||||
go 1.17
|
go 1.19
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/certusone/wormhole/node v0.0.0-20210722131135-a191017d22d0
|
github.com/certusone/wormhole/node v0.0.0-20210722131135-a191017d22d0
|
||||||
|
|
|
@ -99,7 +99,7 @@ frequency). Light clients have much lower hardware requirements.
|
||||||
For security reasons, we do not provide a pre-built binary. You need to check out the repo and build the
|
For security reasons, we do not provide a pre-built binary. You need to check out the repo and build the
|
||||||
guardiand binary from source. A Git repo is much harder to tamper with than release binaries.
|
guardiand binary from source. A Git repo is much harder to tamper with than release binaries.
|
||||||
|
|
||||||
To build the Wormhole node, you need [Go](https://golang.org/dl/) >= 1.17.5.
|
To build the Wormhole node, you need [Go](https://golang.org/dl/) >= 1.19.0
|
||||||
|
|
||||||
First, check out the version of the Wormhole repo that you want to deploy:
|
First, check out the version of the Wormhole repo that you want to deploy:
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module github.com/certusone/wormhole/near
|
module github.com/certusone/wormhole/near
|
||||||
|
|
||||||
go 1.17
|
go 1.19
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/tidwall/gjson v1.14.1 // indirect
|
github.com/tidwall/gjson v1.14.1 // indirect
|
||||||
|
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -179,7 +179,7 @@ func runInjectGovernanceVAA(cmd *cobra.Command, args []string) {
|
||||||
}
|
}
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
|
|
||||||
b, err := ioutil.ReadFile(path)
|
b, err := os.ReadFile(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("failed to read file: %v", err)
|
log.Fatalf("failed to read file: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@ package guardiand
|
||||||
import (
|
import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/wormhole-foundation/wormhole/sdk/vaa"
|
"github.com/wormhole-foundation/wormhole/sdk/vaa"
|
||||||
|
@ -27,7 +27,7 @@ var AdminClientGovernanceVAAVerifyCmd = &cobra.Command{
|
||||||
func runGovernanceVAAVerify(cmd *cobra.Command, args []string) {
|
func runGovernanceVAAVerify(cmd *cobra.Command, args []string) {
|
||||||
path := args[0]
|
path := args[0]
|
||||||
|
|
||||||
b, err := ioutil.ReadFile(path)
|
b, err := os.ReadFile(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("failed to read file: %v", err)
|
log.Fatalf("failed to read file: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ func loadGuardianKey(filename string) (*ecdsa.PrivateKey, error) {
|
||||||
return nil, fmt.Errorf("invalid block type: %s", p.Type)
|
return nil, fmt.Errorf("invalid block type: %s", p.Type)
|
||||||
}
|
}
|
||||||
|
|
||||||
b, err := ioutil.ReadAll(p.Body)
|
b, err := io.ReadAll(p.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to read file: %w", err)
|
return nil, fmt.Errorf("failed to read file: %w", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,10 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
_ "net/http/pprof" // #nosec G108 we are using a custom router (`router := mux.NewRouter()`) and thus not automatically expose pprof.
|
_ "net/http/pprof" // #nosec G108 we are using a custom router (`router := mux.NewRouter()`) and thus not automatically expose pprof.
|
||||||
"os"
|
"os"
|
||||||
|
"os/signal"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"github.com/certusone/wormhole/node/pkg/watchers/wormchain"
|
"github.com/certusone/wormhole/node/pkg/watchers/wormchain"
|
||||||
|
|
||||||
|
@ -437,7 +439,7 @@ func runNode(cmd *cobra.Command, args []string) {
|
||||||
go func() {
|
go func() {
|
||||||
logger.Info("status server listening on [::]:6060")
|
logger.Info("status server listening on [::]:6060")
|
||||||
// SECURITY: If making changes, ensure that we always do `router := mux.NewRouter()` before this to avoid accidentally exposing pprof
|
// SECURITY: If making changes, ensure that we always do `router := mux.NewRouter()` before this to avoid accidentally exposing pprof
|
||||||
logger.Error("status server crashed", zap.Error(http.ListenAndServe(*statusAddr, router)))
|
logger.Error("status server crashed", zap.Error(http.ListenAndServe(*statusAddr, router))) // #nosec G114 local status server not vulnerable to DoS attack
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -801,6 +803,14 @@ func runNode(cmd *cobra.Command, args []string) {
|
||||||
rootCtx, rootCtxCancel = context.WithCancel(context.Background())
|
rootCtx, rootCtxCancel = context.WithCancel(context.Background())
|
||||||
defer rootCtxCancel()
|
defer rootCtxCancel()
|
||||||
|
|
||||||
|
sigterm := make(chan os.Signal, 1)
|
||||||
|
signal.Notify(sigterm, syscall.SIGTERM)
|
||||||
|
go func() {
|
||||||
|
<-sigterm
|
||||||
|
logger.Info("Received sigterm. exiting.")
|
||||||
|
rootCtxCancel()
|
||||||
|
}()
|
||||||
|
|
||||||
// Ethereum lock event channel
|
// Ethereum lock event channel
|
||||||
lockC := make(chan *common.MessagePublication)
|
lockC := make(chan *common.MessagePublication)
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
publicrpcv1 "github.com/certusone/wormhole/node/pkg/proto/publicrpc/v1"
|
publicrpcv1 "github.com/certusone/wormhole/node/pkg/proto/publicrpc/v1"
|
||||||
"github.com/certusone/wormhole/node/pkg/supervisor"
|
"github.com/certusone/wormhole/node/pkg/supervisor"
|
||||||
|
@ -82,7 +83,8 @@ func publicwebServiceRunnable(
|
||||||
})))
|
})))
|
||||||
|
|
||||||
srv := &http.Server{
|
srv := &http.Server{
|
||||||
Handler: mux,
|
Handler: mux,
|
||||||
|
ReadHeaderTimeout: 3 * time.Second,
|
||||||
}
|
}
|
||||||
|
|
||||||
// TLS setup
|
// TLS setup
|
||||||
|
|
|
@ -440,7 +440,7 @@ func runSpy(cmd *cobra.Command, args []string) {
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
logger.Info("status server listening on [::]:6060")
|
logger.Info("status server listening on [::]:6060")
|
||||||
logger.Error("status server crashed", zap.Error(http.ListenAndServe(*statusAddr, router)))
|
logger.Error("status server crashed", zap.Error(http.ListenAndServe(*statusAddr, router))) // #nosec G114 local status server not vulnerable to DoS attack
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module github.com/certusone/wormhole/node
|
module github.com/certusone/wormhole/node
|
||||||
|
|
||||||
go 1.17
|
go 1.19
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go/bigtable v1.10.1
|
cloud.google.com/go/bigtable v1.10.1
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
@ -80,7 +80,7 @@ func getSequencesForTxhash(txhash string, fcd string, contractAddressLogKey stri
|
||||||
return []uint64{}, fmt.Errorf("failed to get message: %w", err)
|
return []uint64{}, fmt.Errorf("failed to get message: %w", err)
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
txBody, err := ioutil.ReadAll(resp.Body)
|
txBody, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return []uint64{}, fmt.Errorf("failed to read message: %w", err)
|
return []uint64{}, fmt.Errorf("failed to read message: %w", err)
|
||||||
}
|
}
|
||||||
|
@ -349,7 +349,7 @@ func main() {
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
blocksBody, err := ioutil.ReadAll(resp.Body)
|
blocksBody, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("failed to read log: %v", err)
|
log.Fatalf("failed to read log: %v", err)
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -2,7 +2,6 @@ package common
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/libp2p/go-libp2p/core/crypto"
|
"github.com/libp2p/go-libp2p/core/crypto"
|
||||||
|
@ -11,7 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetOrCreateNodeKey(logger *zap.Logger, path string) (crypto.PrivKey, error) {
|
func GetOrCreateNodeKey(logger *zap.Logger, path string) (crypto.PrivKey, error) {
|
||||||
b, err := ioutil.ReadFile(path)
|
b, err := os.ReadFile(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
logger.Info("No node key found, generating a new one...", zap.String("path", path))
|
logger.Info("No node key found, generating a new one...", zap.String("path", path))
|
||||||
|
@ -26,7 +25,7 @@ func GetOrCreateNodeKey(logger *zap.Logger, path string) (crypto.PrivKey, error)
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = ioutil.WriteFile(path, s, 0600)
|
err = os.WriteFile(path, s, 0600)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to write node key: %w", err)
|
return nil, fmt.Errorf("failed to write node key: %w", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ package common
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
@ -22,7 +21,7 @@ func TestGetOrCreateNodeKeyWithNewPath(t *testing.T) {
|
||||||
assert.NotNil(t, privKey1)
|
assert.NotNil(t, privKey1)
|
||||||
|
|
||||||
// Re-read the generated privKey file back into memory
|
// Re-read the generated privKey file back into memory
|
||||||
b, _ := ioutil.ReadFile(path)
|
b, _ := os.ReadFile(path)
|
||||||
privKey2, _ := crypto.UnmarshalPrivateKey(b)
|
privKey2, _ := crypto.UnmarshalPrivateKey(b)
|
||||||
|
|
||||||
// Make sure we got the same key
|
// Make sure we got the same key
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"math/big"
|
"math/big"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
@ -102,7 +102,7 @@ func (gov *ChainGovernor) queryCoinGecko() error {
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
responseData, err := ioutil.ReadAll(response.Body)
|
responseData, err := io.ReadAll(response.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
gov.logger.Error("cgov: failed to parse coin gecko response, reverting to configured prices", zap.Error(err))
|
gov.logger.Error("cgov: failed to parse coin gecko response, reverting to configured prices", zap.Error(err))
|
||||||
gov.revertAllPrices()
|
gov.revertAllPrices()
|
||||||
|
|
|
@ -4,7 +4,6 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/diamondburned/arikawa/v3/api"
|
"github.com/diamondburned/arikawa/v3/api"
|
||||||
|
@ -12,6 +11,8 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/wormhole-foundation/wormhole/sdk/vaa"
|
"github.com/wormhole-foundation/wormhole/sdk/vaa"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
"golang.org/x/text/cases"
|
||||||
|
"golang.org/x/text/language"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DiscordNotifier struct {
|
type DiscordNotifier struct {
|
||||||
|
@ -138,6 +139,7 @@ func (d *DiscordNotifier) MissingSignaturesOnObservation(o Observation, hasSigs,
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, cn := range d.chans {
|
for _, cn := range d.chans {
|
||||||
|
caser := cases.Title(language.English)
|
||||||
if _, err := d.c.SendMessage(cn.ID, messageText,
|
if _, err := d.c.SendMessage(cn.ID, messageText,
|
||||||
discord.Embed{
|
discord.Embed{
|
||||||
Title: "Message with missing signatures",
|
Title: "Message with missing signatures",
|
||||||
|
@ -145,7 +147,7 @@ func (d *DiscordNotifier) MissingSignaturesOnObservation(o Observation, hasSigs,
|
||||||
{Name: "Message ID", Value: wrapCode(o.MessageID()), Inline: true},
|
{Name: "Message ID", Value: wrapCode(o.MessageID()), Inline: true},
|
||||||
{Name: "Digest", Value: wrapCode(hex.EncodeToString(o.SigningMsg().Bytes())), Inline: true},
|
{Name: "Digest", Value: wrapCode(hex.EncodeToString(o.SigningMsg().Bytes())), Inline: true},
|
||||||
{Name: "Quorum", Value: quorumText, Inline: true},
|
{Name: "Quorum", Value: quorumText, Inline: true},
|
||||||
{Name: "Source Chain", Value: strings.Title(o.GetEmitterChain().String()), Inline: false},
|
{Name: "Source Chain", Value: caser.String(o.GetEmitterChain().String()), Inline: false},
|
||||||
{Name: "Missing Guardians", Value: missingText.String(), Inline: false},
|
{Name: "Missing Guardians", Value: missingText.String(), Inline: false},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -26,6 +26,7 @@ type GossipMessage struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Types that are assignable to Message:
|
// Types that are assignable to Message:
|
||||||
|
//
|
||||||
// *GossipMessage_SignedObservation
|
// *GossipMessage_SignedObservation
|
||||||
// *GossipMessage_SignedHeartbeat
|
// *GossipMessage_SignedHeartbeat
|
||||||
// *GossipMessage_SignedVaaWithQuorum
|
// *GossipMessage_SignedVaaWithQuorum
|
||||||
|
|
|
@ -101,6 +101,7 @@ type GovernanceMessage struct {
|
||||||
// Random nonce for disambiguation. Must be identical across all nodes.
|
// Random nonce for disambiguation. Must be identical across all nodes.
|
||||||
Nonce uint32 `protobuf:"varint,3,opt,name=nonce,proto3" json:"nonce,omitempty"`
|
Nonce uint32 `protobuf:"varint,3,opt,name=nonce,proto3" json:"nonce,omitempty"`
|
||||||
// Types that are assignable to Payload:
|
// Types that are assignable to Payload:
|
||||||
|
//
|
||||||
// *GovernanceMessage_GuardianSet
|
// *GovernanceMessage_GuardianSet
|
||||||
// *GovernanceMessage_ContractUpgrade
|
// *GovernanceMessage_ContractUpgrade
|
||||||
// *GovernanceMessage_BridgeRegisterChain
|
// *GovernanceMessage_BridgeRegisterChain
|
||||||
|
|
|
@ -23,7 +23,6 @@ type NodePrivilegedServiceClient interface {
|
||||||
//
|
//
|
||||||
// A consensus majority of nodes on the network will have to inject the VAA within the
|
// A consensus majority of nodes on the network will have to inject the VAA within the
|
||||||
// VAA timeout window for it to reach consensus.
|
// VAA timeout window for it to reach consensus.
|
||||||
//
|
|
||||||
InjectGovernanceVAA(ctx context.Context, in *InjectGovernanceVAARequest, opts ...grpc.CallOption) (*InjectGovernanceVAAResponse, error)
|
InjectGovernanceVAA(ctx context.Context, in *InjectGovernanceVAARequest, opts ...grpc.CallOption) (*InjectGovernanceVAAResponse, error)
|
||||||
// FindMissingMessages will detect message sequence gaps in the local VAA store for a
|
// FindMissingMessages will detect message sequence gaps in the local VAA store for a
|
||||||
// specific emitter chain and address. Start and end slots are the lowest and highest
|
// specific emitter chain and address. Start and end slots are the lowest and highest
|
||||||
|
@ -147,7 +146,6 @@ type NodePrivilegedServiceServer interface {
|
||||||
//
|
//
|
||||||
// A consensus majority of nodes on the network will have to inject the VAA within the
|
// A consensus majority of nodes on the network will have to inject the VAA within the
|
||||||
// VAA timeout window for it to reach consensus.
|
// VAA timeout window for it to reach consensus.
|
||||||
//
|
|
||||||
InjectGovernanceVAA(context.Context, *InjectGovernanceVAARequest) (*InjectGovernanceVAAResponse, error)
|
InjectGovernanceVAA(context.Context, *InjectGovernanceVAARequest) (*InjectGovernanceVAAResponse, error)
|
||||||
// FindMissingMessages will detect message sequence gaps in the local VAA store for a
|
// FindMissingMessages will detect message sequence gaps in the local VAA store for a
|
||||||
// specific emitter chain and address. Start and end slots are the lowest and highest
|
// specific emitter chain and address. Start and end slots are the lowest and highest
|
||||||
|
|
|
@ -210,6 +210,7 @@ type FilterEntry struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Types that are assignable to Filter:
|
// Types that are assignable to Filter:
|
||||||
|
//
|
||||||
// *FilterEntry_EmitterFilter
|
// *FilterEntry_EmitterFilter
|
||||||
// *FilterEntry_BatchFilter
|
// *FilterEntry_BatchFilter
|
||||||
// *FilterEntry_BatchTransactionFilter
|
// *FilterEntry_BatchTransactionFilter
|
||||||
|
@ -450,6 +451,7 @@ type SubscribeSignedVAAByTypeResponse struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Types that are assignable to VaaType:
|
// Types that are assignable to VaaType:
|
||||||
|
//
|
||||||
// *SubscribeSignedVAAByTypeResponse_SignedVaa
|
// *SubscribeSignedVAAByTypeResponse_SignedVaa
|
||||||
// *SubscribeSignedVAAByTypeResponse_SignedBatchVaa
|
// *SubscribeSignedVAAByTypeResponse_SignedBatchVaa
|
||||||
VaaType isSubscribeSignedVAAByTypeResponse_VaaType `protobuf_oneof:"vaa_type"`
|
VaaType isSubscribeSignedVAAByTypeResponse_VaaType `protobuf_oneof:"vaa_type"`
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
|
|
||||||
"cloud.google.com/go/logging"
|
"cloud.google.com/go/logging"
|
||||||
"github.com/blendle/zapdriver"
|
"github.com/blendle/zapdriver"
|
||||||
|
@ -85,7 +85,7 @@ func New(ctx context.Context, project string, serviceAccountJSON []byte, labels
|
||||||
func (s *Telemetry) WrapLogger(logger *zap.Logger) *zap.Logger {
|
func (s *Telemetry) WrapLogger(logger *zap.Logger) *zap.Logger {
|
||||||
tc := zapcore.NewCore(
|
tc := zapcore.NewCore(
|
||||||
s.encoder,
|
s.encoder,
|
||||||
zapcore.AddSync(ioutil.Discard),
|
zapcore.AddSync(io.Discard),
|
||||||
zap.InfoLevel,
|
zap.InfoLevel,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
@ -190,7 +190,7 @@ func (e *Watcher) Run(ctx context.Context) error {
|
||||||
logger.Error("query latest block response error", zap.String("network", networkName), zap.Error(err))
|
logger.Error("query latest block response error", zap.String("network", networkName), zap.Error(err))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
blocksBody, err := ioutil.ReadAll(resp.Body)
|
blocksBody, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("query latest block response read error", zap.String("network", networkName), zap.Error(err))
|
logger.Error("query latest block response read error", zap.String("network", networkName), zap.Error(err))
|
||||||
errC <- err
|
errC <- err
|
||||||
|
@ -237,7 +237,7 @@ func (e *Watcher) Run(ctx context.Context) error {
|
||||||
logger.Error("query tx response error", zap.String("network", networkName), zap.Error(err))
|
logger.Error("query tx response error", zap.String("network", networkName), zap.Error(err))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
txBody, err := ioutil.ReadAll(resp.Body)
|
txBody, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("query tx response read error", zap.String("network", networkName), zap.Error(err))
|
logger.Error("query tx response read error", zap.String("network", networkName), zap.Error(err))
|
||||||
resp.Body.Close()
|
resp.Body.Close()
|
||||||
|
|
|
@ -14,7 +14,6 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -53,7 +52,7 @@ func serveCache(w http.ResponseWriter, req *http.Request, cacheDir string) (stri
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.New("error reading request")
|
return "", errors.New("error reading request")
|
||||||
}
|
}
|
||||||
req.Body = ioutil.NopCloser(bytes.NewReader(reqBody))
|
req.Body = io.NopCloser(bytes.NewReader(reqBody))
|
||||||
|
|
||||||
hashBytes := sha256.Sum256(reqBody)
|
hashBytes := sha256.Sum256(reqBody)
|
||||||
hashHex := hex.EncodeToString(hashBytes[:])
|
hashHex := hex.EncodeToString(hashBytes[:])
|
||||||
|
@ -76,7 +75,7 @@ func returnFile(w http.ResponseWriter, fileName string) {
|
||||||
func (s *ForwardingCachingServer) ProxyReq(logger *zap.Logger, req *http.Request) *http.Request {
|
func (s *ForwardingCachingServer) ProxyReq(logger *zap.Logger, req *http.Request) *http.Request {
|
||||||
reqBody, err := io.ReadAll(req.Body)
|
reqBody, err := io.ReadAll(req.Body)
|
||||||
check(err)
|
check(err)
|
||||||
req.Body = ioutil.NopCloser(bytes.NewReader(reqBody))
|
req.Body = io.NopCloser(bytes.NewReader(reqBody))
|
||||||
|
|
||||||
url := fmt.Sprintf("%s%s", s.upstreamHost, req.RequestURI)
|
url := fmt.Sprintf("%s%s", s.upstreamHost, req.RequestURI)
|
||||||
proxyReq, _ := http.NewRequest(req.Method, url, bytes.NewReader(reqBody))
|
proxyReq, _ := http.NewRequest(req.Method, url, bytes.NewReader(reqBody))
|
||||||
|
@ -123,7 +122,7 @@ func (s *ForwardingCachingServer) ServeHTTP(w http.ResponseWriter, req *http.Req
|
||||||
}
|
}
|
||||||
|
|
||||||
reqBody := s.RewriteReq(origReqBody)
|
reqBody := s.RewriteReq(origReqBody)
|
||||||
req.Body = ioutil.NopCloser(bytes.NewReader(reqBody))
|
req.Body = io.NopCloser(bytes.NewReader(reqBody))
|
||||||
|
|
||||||
cache_status := ""
|
cache_status := ""
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
@ -84,7 +84,7 @@ func (n HttpNearRpc) Query(ctx context.Context, s string) ([]byte, error) {
|
||||||
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
result, err := ioutil.ReadAll(resp.Body)
|
result, err := io.ReadAll(resp.Body)
|
||||||
if resp.StatusCode == 200 {
|
if resp.StatusCode == 200 {
|
||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -140,7 +140,7 @@ func (e *Watcher) Run(ctx context.Context) error {
|
||||||
logger.Error("query latest block response error", zap.Error(err))
|
logger.Error("query latest block response error", zap.Error(err))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
blocksBody, err := ioutil.ReadAll(resp.Body)
|
blocksBody, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("query latest block response read error", zap.Error(err))
|
logger.Error("query latest block response read error", zap.Error(err))
|
||||||
errC <- err
|
errC <- err
|
||||||
|
@ -185,7 +185,7 @@ func (e *Watcher) Run(ctx context.Context) error {
|
||||||
logger.Error("query tx response error", zap.Error(err))
|
logger.Error("query tx response error", zap.Error(err))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
txBody, err := ioutil.ReadAll(resp.Body)
|
txBody, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("query tx response read error", zap.Error(err))
|
logger.Error("query tx response read error", zap.Error(err))
|
||||||
resp.Body.Close()
|
resp.Body.Close()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module github.com/certusone/wormhole/node/tools
|
module github.com/certusone/wormhole/node/tools
|
||||||
|
|
||||||
go 1.17
|
go 1.19
|
||||||
|
|
||||||
require github.com/go-delve/delve v1.7.2
|
require github.com/go-delve/delve v1.7.2
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ esac
|
||||||
|
|
||||||
# Install Go
|
# Install Go
|
||||||
ARCH=amd64
|
ARCH=amd64
|
||||||
GO=1.17.5
|
GO=1.19.3
|
||||||
|
|
||||||
(
|
(
|
||||||
if [[ -d /usr/local/go ]]; then
|
if [[ -d /usr/local/go ]]; then
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module github.com/wormhole-foundation/wormhole/sdk
|
module github.com/wormhole-foundation/wormhole/sdk
|
||||||
|
|
||||||
go 1.17
|
go 1.19
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/ethereum/go-ethereum v1.10.21
|
github.com/ethereum/go-ethereum v1.10.21
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module github.com/certusone/wormhole/node/tools
|
module github.com/certusone/wormhole/node/tools
|
||||||
|
|
||||||
go 1.17
|
go 1.19
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/bufbuild/buf v1.0.0
|
github.com/bufbuild/buf v1.0.0
|
||||||
|
|
Loading…
Reference in New Issue