From 9d499dac7a5abddb0898e0844547ff33c3484ee8 Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Tue, 25 Oct 2022 22:39:23 +0200 Subject: [PATCH 01/13] Add cloudkms and generic Ecdsa signer --- .gitignore | 2 + node/pkg/ecdsasigner/cloudkms.go | 168 +++++++++++++++++++++++ node/pkg/ecdsasigner/ecdsaprivatekey.go | 18 +++ node/pkg/ecdsasigner/ecdsasigner.go | 12 ++ node/pkg/ecdsasigner/ecdsasigner_test.go | 47 +++++++ 5 files changed, 247 insertions(+) create mode 100644 node/pkg/ecdsasigner/cloudkms.go create mode 100644 node/pkg/ecdsasigner/ecdsaprivatekey.go create mode 100644 node/pkg/ecdsasigner/ecdsasigner.go create mode 100644 node/pkg/ecdsasigner/ecdsasigner_test.go diff --git a/.gitignore b/.gitignore index 2a0e5859a..1dcf2176e 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ bigtable-writer.json /solana/artifacts-testnet/ /solana/artifacts-devnet/ /solana/artifacts-mainnet/ +go.work +go.work.sum \ No newline at end of file diff --git a/node/pkg/ecdsasigner/cloudkms.go b/node/pkg/ecdsasigner/cloudkms.go new file mode 100644 index 000000000..b89f8d94a --- /dev/null +++ b/node/pkg/ecdsasigner/cloudkms.go @@ -0,0 +1,168 @@ +package ecdsasigner + +import "C" + +import ( + "context" + "crypto/ecdsa" + "fmt" + "math/big" + + "crypto/x509/pkix" + "encoding/asn1" + "encoding/pem" + + kms "cloud.google.com/go/kms/apiv1" + ethcommon "github.com/ethereum/go-ethereum/common" + ethcrypto "github.com/ethereum/go-ethereum/crypto" + "google.golang.org/api/option" + kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1" +) + +// Client is a client for interacting with the Google Cloud KMS API +type KMSClient struct { + keyId string + ctx context.Context + publicKey *ecdsa.PublicKey + client *kms.KeyManagementClient +} + +func NewKMSClient(ctx context.Context, keyId string, opts ...option.ClientOption) (*KMSClient, error) { + client, err := kms.NewKeyManagementClient(ctx, opts...) + if err != nil { + return nil, fmt.Errorf("Failed to initialize KMS client: %w", err) + } + + pubKey, err := getKMSPublicKey(ctx, keyId, *client) + if err != nil { + return nil, fmt.Errorf("Failed to get public key for KMS client: %w", err) + } + + return &KMSClient{ + keyId: keyId, + ctx: ctx, + publicKey: pubKey, + client: client, + }, nil +} + +// ECDSASigner methods +func (c KMSClient) Sign(digest []byte) ([]byte, error) { + req := &kmspb.AsymmetricSignRequest{ + Name: c.keyId, + Digest: &kmspb.Digest{ + Digest: &kmspb.Digest_Sha256{ + Sha256: digest, + }, + }, + } + + signResult, err := c.client.AsymmetricSign(c.ctx, req) + if err != nil { + return nil, fmt.Errorf("Failed to sign with KMS: %w", err) + } + + pubKey := ethcrypto.PubkeyToAddress(*c.publicKey) + + sig, err := parseSignature(signResult.Signature, digest, pubKey) + if err != nil { + return nil, fmt.Errorf("Failed to parse KMS signature: %w", err) + } + + return sig, nil +} + +func (c KMSClient) PublicKey() ecdsa.PublicKey { + return *c.publicKey +} + +// Private Functions +func getKMSPublicKey( + ctx context.Context, + keyId string, + client kms.KeyManagementClient, +) (*ecdsa.PublicKey, error) { + request := &kmspb.GetPublicKeyRequest{Name: keyId} + + kmsPublicKey, err := client.GetPublicKey(ctx, request) + if err != nil { + return nil, fmt.Errorf("Failed to fetch public key from the KMS API: %v", err) + } + + pemBlock, rest := pem.Decode([]byte(kmsPublicKey.Pem)) + if len(rest) > 0 { + return nil, fmt.Errorf("PEM block contains more than just public key") + } + + var pki struct { + Raw asn1.RawContent + Algorithm pkix.AlgorithmIdentifier + PublicKey asn1.BitString + } + if rest, err := asn1.Unmarshal(pemBlock.Bytes, &pki); err != nil { + return nil, fmt.Errorf("Failed to unmarshal KMS public key from pem block: %v", err) + } else if len(rest) != 0 { + return nil, fmt.Errorf("Trailing data after ASN.1 unmarshalling of the KMS public key") + } + + asn1Data := pki.PublicKey.RightAlign() + if asn1Data[0] != 4 { + return nil, fmt.Errorf("Only uncompressed public key is supported") + } + + secp256k1Curve := ethcrypto.S256() + p := secp256k1Curve.Params().P + plen := bitsToBytes(p.BitLen()) + + asn1PubKeyBytes := asn1Data[1:] + if len(asn1PubKeyBytes) != 2*plen { + return nil, fmt.Errorf("Public key has incorrect size, got %d, expects %d", len(asn1PubKeyBytes), 2*plen) + } + + var x, y big.Int + x.SetBytes(asn1PubKeyBytes[:plen]) + y.SetBytes(asn1PubKeyBytes[plen:]) + + if x.Cmp(p) >= 0 || y.Cmp(p) >= 0 || !secp256k1Curve.IsOnCurve(&x, &y) { + return nil, fmt.Errorf("kms input is not on curve") + } + + return &ecdsa.PublicKey{Curve: secp256k1Curve, X: &x, Y: &y}, nil +} + +func parseSignature(kmsSignature []byte, digest []byte, pubKey ethcommon.Address) ([]byte, error) { + var parsedSig struct{ R, S *big.Int } + if _, err := asn1.Unmarshal(kmsSignature, &parsedSig); err != nil { + return nil, fmt.Errorf("Fail to unmarshal KMS signature: %w", err) + } + + curveOrderLen := 32 + signature := make([]byte, 2*curveOrderLen) + + // left pad R and S with zeroes + rBytes := parsedSig.R.Bytes() + sBytes := parsedSig.S.Bytes() + copy(signature[curveOrderLen-len(rBytes):], rBytes) + copy(signature[len(signature)-len(sBytes):], sBytes) + + return appendV(signature, digest, pubKey) +} + +func appendV(sig []byte, digest []byte, pubKey ethcommon.Address) ([]byte, error) { + sigWithV := append(sig, 0) + + for i := 0; i < 4; i++ { + pk, err := ethcrypto.Ecrecover(digest, sigWithV) + signer_pk := ethcommon.BytesToAddress(ethcrypto.Keccak256(pk[1:])[12:]) + if err == nil && signer_pk == pubKey { + return sigWithV, nil + } + sigWithV = append(sig, byte(i)) + } + + return nil, fmt.Errorf("Can not append V for KMS signature") +} + +func bitsToBytes(bits int) int { + return (bits + 7) >> 3 +} diff --git a/node/pkg/ecdsasigner/ecdsaprivatekey.go b/node/pkg/ecdsasigner/ecdsaprivatekey.go new file mode 100644 index 000000000..7e3865f88 --- /dev/null +++ b/node/pkg/ecdsasigner/ecdsaprivatekey.go @@ -0,0 +1,18 @@ +package ecdsasigner + +import ( + "crypto/ecdsa" + "github.com/ethereum/go-ethereum/crypto" +) + +type ECDSAPrivateKey struct { + value *ecdsa.PrivateKey +} + +func (k ECDSAPrivateKey) Sign(digestHash []byte) (sig []byte, err error) { + return crypto.Sign(digestHash, k.value) +} + +func (k ECDSAPrivateKey) PublicKey() ecdsa.PublicKey { + return k.value.PublicKey +} diff --git a/node/pkg/ecdsasigner/ecdsasigner.go b/node/pkg/ecdsasigner/ecdsasigner.go new file mode 100644 index 000000000..a551e6b13 --- /dev/null +++ b/node/pkg/ecdsasigner/ecdsasigner.go @@ -0,0 +1,12 @@ +package ecdsasigner + +import ( + "crypto/ecdsa" +) + +type ECDSASigner interface { + // Sign generates a signature using the provided hasher. + Sign([]byte) (sig []byte, err error) + // PublicKey returns the public key. + PublicKey() ecdsa.PublicKey +} diff --git a/node/pkg/ecdsasigner/ecdsasigner_test.go b/node/pkg/ecdsasigner/ecdsasigner_test.go new file mode 100644 index 000000000..60bad2c96 --- /dev/null +++ b/node/pkg/ecdsasigner/ecdsasigner_test.go @@ -0,0 +1,47 @@ +package ecdsasigner + +import ( + "context" + "testing" + + ethcommon "github.com/ethereum/go-ethereum/common" + ethcrypto "github.com/ethereum/go-ethereum/crypto" + "github.com/stretchr/testify/assert" +) + +func TestKMS(t *testing.T) { + cloudKMSKeyName := "TODO" + bCtx := context.Background() + kmsClient, err := NewKMSClient(bCtx, cloudKMSKeyName) + if err != nil { + t.Fatalf("failed to setup KMS client: %v", err) + } + defer kmsClient.client.Close() + verifySigner(t, kmsClient) +} + +func TestPrivateKey(t *testing.T) { + gk, err := ethcrypto.GenerateKey() + if err != nil { + t.Fatal("Failed to generate key", err) + } + + verifySigner(t, ECDSAPrivateKey{value: gk}) +} + +func verifySigner(t *testing.T, guardianSigner ECDSASigner) { + digest := ethcrypto.Keccak256Hash([]byte("Hello")) + sig, err := guardianSigner.Sign(digest.Bytes()) + if err != nil { + t.Fatal(err) + } + + pk, err := ethcrypto.Ecrecover(digest.Bytes(), sig) + if err != nil { + t.Fatal(err) + } + + signerAddr := ethcommon.BytesToAddress(ethcrypto.Keccak256(pk[1:])[12:]) + guardianAddr := ethcrypto.PubkeyToAddress(guardianSigner.PublicKey()) + assert.Equal(t, signerAddr, guardianAddr, "Signer address should match guardian address") +} From 2ac4c4a949cc873efb8534f4bf484b65fd94d721 Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Tue, 25 Oct 2022 23:37:06 +0200 Subject: [PATCH 02/13] Add KMS support in Guardian node --- node/cmd/guardiand/node.go | 48 +++++++++++++++++++------ node/pkg/ecdsasigner/cloudkms.go | 6 ++-- node/pkg/ecdsasigner/ecdsaprivatekey.go | 6 ++-- node/pkg/p2p/p2p.go | 12 +++---- node/pkg/processor/broadcast.go | 2 +- node/pkg/processor/injection.go | 3 +- node/pkg/processor/message.go | 3 +- node/pkg/processor/processor.go | 15 ++++---- 8 files changed, 60 insertions(+), 35 deletions(-) diff --git a/node/cmd/guardiand/node.go b/node/cmd/guardiand/node.go index 807a7457e..07f043949 100644 --- a/node/cmd/guardiand/node.go +++ b/node/cmd/guardiand/node.go @@ -14,6 +14,7 @@ import ( "github.com/certusone/wormhole/node/pkg/alephium" "github.com/certusone/wormhole/node/pkg/db" + "github.com/certusone/wormhole/node/pkg/ecdsasigner" "github.com/certusone/wormhole/node/pkg/ethereum" "github.com/certusone/wormhole/node/pkg/notify/discord" "github.com/certusone/wormhole/node/pkg/telemetry" @@ -147,6 +148,11 @@ var ( bigTableTableName *string bigTableTopicName *string bigTableKeyPath *string + + cloudKMSEnabled *bool + cloudKMSKeyName *string + + guardianCredentialsFile *string ) func init() { @@ -256,7 +262,11 @@ func init() { bigTableInstanceName = NodeCmd.Flags().String("bigTableInstanceName", "", "BigTable instance name for storing events") bigTableTableName = NodeCmd.Flags().String("bigTableTableName", "", "BigTable table name to store events in") bigTableTopicName = NodeCmd.Flags().String("bigTableTopicName", "", "GCP topic name to publish to") - bigTableKeyPath = NodeCmd.Flags().String("bigTableKeyPath", "", "Path to json Service Account key") + + cloudKMSEnabled = NodeCmd.Flags().Bool("cloudKMSEnabled", false, "Turn on Cloud KMS support for Guardian Key") + cloudKMSKeyName = NodeCmd.Flags().String("cloudKMSKeyName", "", "Cloud KMS key name for Guardian Key") + + guardianCredentialsFile = NodeCmd.Flags().String("guardianCredentialsFile", "", "Path to json Service Account key") } var ( @@ -571,8 +581,13 @@ func runNode(cmd *cobra.Command, args []string) { if *bigTableTopicName == "" { logger.Fatal("Please specify --bigTableTopicName") } - if *bigTableKeyPath == "" { - logger.Fatal("Please specify --bigTableKeyPath") + if *guardianCredentialsFile == "" { + logger.Fatal("Please specify --guardianCredentialsFile") + } + } + if *cloudKMSEnabled { + if *cloudKMSKeyName == "" { + logger.Fatal("Please specify --cloudKMSKeyName") } } @@ -643,12 +658,25 @@ func runNode(cmd *cobra.Command, args []string) { defer db.Close() // Guardian key - gk, err := loadGuardianKey(*guardianKeyPath) - if err != nil { - logger.Fatal("failed to load guardian key", zap.Error(err)) + var guardianSigner ecdsasigner.ECDSASigner + if *cloudKMSEnabled { + bCtx := context.Background() + kmsClient, err := ecdsasigner.NewKMSClient(bCtx, *cloudKMSKeyName) + if err != nil { + log.Fatalf("Failed to setup KMS client: %v", err) + } + defer kmsClient.Client.Close() + guardianSigner = kmsClient + } else { + gk, err := loadGuardianKey(*guardianKeyPath) + if err != nil { + logger.Fatal("Failed to load guardian key from file", zap.Error(err)) + } + guardianSigner = ecdsasigner.ECDSAPrivateKey{Value: gk} } - guardianAddr := ethcrypto.PubkeyToAddress(gk.PublicKey).String() + guardianPubkey := guardianSigner.PublicKey() + guardianAddr := ethcrypto.PubkeyToAddress(guardianPubkey).String() logger.Info("Loaded guardian key", zap.String( "address", guardianAddr)) @@ -817,7 +845,7 @@ func runNode(cmd *cobra.Command, args []string) { // Run supervisor. supervisor.New(rootCtx, logger, func(ctx context.Context) error { if err := supervisor.Run(ctx, "p2p", p2p.Run( - obsvC, obsvReqC, obsvReqSendC, sendC, signedInC, priv, gk, gst, *p2pPort, *p2pNetworkID, *p2pBootstrap, *nodeName, *disableHeartbeatVerify, rootCtxCancel)); err != nil { + obsvC, obsvReqC, obsvReqSendC, sendC, signedInC, priv, &guardianSigner, gst, *p2pPort, *p2pNetworkID, *p2pBootstrap, *nodeName, *disableHeartbeatVerify, rootCtxCancel)); err != nil { return err } @@ -937,7 +965,7 @@ func runNode(cmd *cobra.Command, args []string) { obsvC, injectC, signedInC, - gk, + &guardianSigner, gst, *unsafeDevMode, *devNumGuardians, @@ -969,7 +997,7 @@ func runNode(cmd *cobra.Command, args []string) { GcpInstanceName: *bigTableInstanceName, TableName: *bigTableTableName, TopicName: *bigTableTopicName, - GcpKeyFilePath: *bigTableKeyPath, + GcpKeyFilePath: *guardianCredentialsFile, } if err := supervisor.Run(ctx, "bigtable", reporter.BigTableWriter(attestationEvents, bigTableConnection)); err != nil { return err diff --git a/node/pkg/ecdsasigner/cloudkms.go b/node/pkg/ecdsasigner/cloudkms.go index b89f8d94a..3aef94da7 100644 --- a/node/pkg/ecdsasigner/cloudkms.go +++ b/node/pkg/ecdsasigner/cloudkms.go @@ -24,7 +24,7 @@ type KMSClient struct { keyId string ctx context.Context publicKey *ecdsa.PublicKey - client *kms.KeyManagementClient + Client *kms.KeyManagementClient } func NewKMSClient(ctx context.Context, keyId string, opts ...option.ClientOption) (*KMSClient, error) { @@ -42,7 +42,7 @@ func NewKMSClient(ctx context.Context, keyId string, opts ...option.ClientOption keyId: keyId, ctx: ctx, publicKey: pubKey, - client: client, + Client: client, }, nil } @@ -57,7 +57,7 @@ func (c KMSClient) Sign(digest []byte) ([]byte, error) { }, } - signResult, err := c.client.AsymmetricSign(c.ctx, req) + signResult, err := c.Client.AsymmetricSign(c.ctx, req) if err != nil { return nil, fmt.Errorf("Failed to sign with KMS: %w", err) } diff --git a/node/pkg/ecdsasigner/ecdsaprivatekey.go b/node/pkg/ecdsasigner/ecdsaprivatekey.go index 7e3865f88..17fd708ed 100644 --- a/node/pkg/ecdsasigner/ecdsaprivatekey.go +++ b/node/pkg/ecdsasigner/ecdsaprivatekey.go @@ -6,13 +6,13 @@ import ( ) type ECDSAPrivateKey struct { - value *ecdsa.PrivateKey + Value *ecdsa.PrivateKey } func (k ECDSAPrivateKey) Sign(digestHash []byte) (sig []byte, err error) { - return crypto.Sign(digestHash, k.value) + return crypto.Sign(digestHash, k.Value) } func (k ECDSAPrivateKey) PublicKey() ecdsa.PublicKey { - return k.value.PublicKey + return k.Value.PublicKey } diff --git a/node/pkg/p2p/p2p.go b/node/pkg/p2p/p2p.go index a6bd4db98..fc5b79a6b 100644 --- a/node/pkg/p2p/p2p.go +++ b/node/pkg/p2p/p2p.go @@ -2,13 +2,13 @@ package p2p import ( "context" - "crypto/ecdsa" "errors" "fmt" "strings" "time" node_common "github.com/certusone/wormhole/node/pkg/common" + "github.com/certusone/wormhole/node/pkg/ecdsasigner" "github.com/certusone/wormhole/node/pkg/vaa" "github.com/certusone/wormhole/node/pkg/version" "github.com/ethereum/go-ethereum/common" @@ -66,7 +66,7 @@ func signedObservationRequestDigest(b []byte) common.Hash { return ethcrypto.Keccak256Hash(append(signedObservationRequestPrefix, b...)) } -func Run(obsvC chan *gossipv1.SignedObservation, obsvReqC chan *gossipv1.ObservationRequest, obsvReqSendC chan *gossipv1.ObservationRequest, sendC chan []byte, signedInC chan *gossipv1.SignedVAAWithQuorum, priv crypto.PrivKey, gk *ecdsa.PrivateKey, gst *node_common.GuardianSetState, port uint, networkID string, bootstrapPeers string, nodeName string, disableHeartbeatVerify bool, rootCtxCancel context.CancelFunc) func(ctx context.Context) error { +func Run(obsvC chan *gossipv1.SignedObservation, obsvReqC chan *gossipv1.ObservationRequest, obsvReqSendC chan *gossipv1.ObservationRequest, sendC chan []byte, signedInC chan *gossipv1.SignedVAAWithQuorum, priv crypto.PrivKey, guardianSigner *ecdsasigner.ECDSASigner, gst *node_common.GuardianSetState, port uint, networkID string, bootstrapPeers string, nodeName string, disableHeartbeatVerify bool, rootCtxCancel context.CancelFunc) func(ctx context.Context) error { return func(ctx context.Context) (re error) { logger := supervisor.Logger(ctx) @@ -237,7 +237,7 @@ func Run(obsvC chan *gossipv1.SignedObservation, obsvReqC chan *gossipv1.Observa BootTimestamp: bootTime.UnixNano(), } - ourAddr := ethcrypto.PubkeyToAddress(gk.PublicKey) + ourAddr := ethcrypto.PubkeyToAddress((*guardianSigner).PublicKey()) if err := gst.SetHeartbeat(ourAddr, h.ID(), heartbeat); err != nil { panic(err) } @@ -252,7 +252,7 @@ func Run(obsvC chan *gossipv1.SignedObservation, obsvReqC chan *gossipv1.Observa // Sign the heartbeat using our node's guardian key. digest := heartbeatDigest(b) - sig, err := ethcrypto.Sign(digest.Bytes(), gk) + sig, err := (*guardianSigner).Sign(digest.Bytes()) if err != nil { panic(err) } @@ -299,7 +299,7 @@ func Run(obsvC chan *gossipv1.SignedObservation, obsvReqC chan *gossipv1.Observa // Sign the observation request using our node's guardian key. digest := signedObservationRequestDigest(b) - sig, err := ethcrypto.Sign(digest.Bytes(), gk) + sig, err := (*guardianSigner).Sign(digest.Bytes()) if err != nil { panic(err) } @@ -307,7 +307,7 @@ func Run(obsvC chan *gossipv1.SignedObservation, obsvReqC chan *gossipv1.Observa sReq := &gossipv1.SignedObservationRequest{ ObservationRequest: b, Signature: sig, - GuardianAddr: ethcrypto.PubkeyToAddress(gk.PublicKey).Bytes(), + GuardianAddr: ethcrypto.PubkeyToAddress((*guardianSigner).PublicKey()).Bytes(), } envelope := &gossipv1.GossipMessage{ diff --git a/node/pkg/processor/broadcast.go b/node/pkg/processor/broadcast.go index 9b7e812c4..19e17dfac 100644 --- a/node/pkg/processor/broadcast.go +++ b/node/pkg/processor/broadcast.go @@ -26,7 +26,7 @@ func (p *Processor) broadcastSignature(v *vaa.VAA, signature []byte, txhash []by digest := v.SigningMsg() obsv := gossipv1.SignedObservation{ - Addr: crypto.PubkeyToAddress(p.gk.PublicKey).Bytes(), + Addr: crypto.PubkeyToAddress((*p.guardianSigner).PublicKey()).Bytes(), Hash: digest.Bytes(), Signature: signature, TxHash: txhash, diff --git a/node/pkg/processor/injection.go b/node/pkg/processor/injection.go index e6826f5d6..9c7257107 100644 --- a/node/pkg/processor/injection.go +++ b/node/pkg/processor/injection.go @@ -6,7 +6,6 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/ethereum/go-ethereum/crypto" "go.uber.org/zap" "github.com/certusone/wormhole/node/pkg/supervisor" @@ -31,7 +30,7 @@ func (p *Processor) handleInjection(ctx context.Context, v *vaa.VAA) { zap.String("digest", hex.EncodeToString(digest.Bytes()))) // Sign the digest using our node's guardian key. - s, err := crypto.Sign(digest.Bytes(), p.gk) + s, err := (*p.guardianSigner).Sign(digest.Bytes()) if err != nil { panic(err) } diff --git a/node/pkg/processor/message.go b/node/pkg/processor/message.go index a4508917e..a2bfb41f4 100644 --- a/node/pkg/processor/message.go +++ b/node/pkg/processor/message.go @@ -10,7 +10,6 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/ethereum/go-ethereum/crypto" "go.uber.org/zap" "github.com/certusone/wormhole/node/pkg/common" @@ -139,7 +138,7 @@ func (p *Processor) handleMessage(ctx context.Context, k *common.MessagePublicat digest := v.SigningMsg() // Sign the digest using our node's guardian key. - s, err := crypto.Sign(digest.Bytes(), p.gk) + s, err := (*p.guardianSigner).Sign(digest.Bytes()) if err != nil { panic(err) } diff --git a/node/pkg/processor/processor.go b/node/pkg/processor/processor.go index 745e7108d..c888ad598 100644 --- a/node/pkg/processor/processor.go +++ b/node/pkg/processor/processor.go @@ -2,12 +2,11 @@ package processor import ( "context" - "crypto/ecdsa" "time" - "github.com/certusone/wormhole/node/pkg/notify/discord" - "github.com/certusone/wormhole/node/pkg/db" + "github.com/certusone/wormhole/node/pkg/ecdsasigner" + "github.com/certusone/wormhole/node/pkg/notify/discord" ethcommon "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" @@ -68,8 +67,8 @@ type Processor struct { // injectC is a channel of VAAs injected locally. injectC chan *vaa.VAA - // gk is the node's guardian private key - gk *ecdsa.PrivateKey + // Node's guardian signer + guardianSigner *ecdsasigner.ECDSASigner // devnetMode specified whether to submit transactions to the hardcoded Ethereum devnet devnetMode bool @@ -109,7 +108,7 @@ func NewProcessor( obsvC chan *gossipv1.SignedObservation, injectC chan *vaa.VAA, signedInC chan *gossipv1.SignedVAAWithQuorum, - gk *ecdsa.PrivateKey, + guardianSigner *ecdsasigner.ECDSASigner, gst *common.GuardianSetState, devnetMode bool, devnetNumGuardians uint, @@ -125,7 +124,7 @@ func NewProcessor( obsvC: obsvC, signedInC: signedInC, injectC: injectC, - gk: gk, + guardianSigner: guardianSigner, gst: gst, devnetMode: devnetMode, devnetNumGuardians: devnetNumGuardians, @@ -138,7 +137,7 @@ func NewProcessor( logger: supervisor.Logger(ctx), state: &aggregationState{vaaMap{}}, - ourAddr: crypto.PubkeyToAddress(gk.PublicKey), + ourAddr: crypto.PubkeyToAddress((*guardianSigner).PublicKey()), } } From 9d0ca6389f96f70e82ff0a205c1617bd8196eda9 Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Tue, 25 Oct 2022 23:37:58 +0200 Subject: [PATCH 03/13] Update typescript indentation to 4 --- clients/js/tsfmt.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/js/tsfmt.json b/clients/js/tsfmt.json index de6c94b6b..949838863 100644 --- a/clients/js/tsfmt.json +++ b/clients/js/tsfmt.json @@ -1,5 +1,5 @@ { - "indentSize": 2, + "indentSize": 4, "tabSize": 2, "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, "placeOpenBraceOnNewLineForFunctions": false, From 0dcc2cea949d3100964af9e89011f1f7f8487dd4 Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Wed, 26 Oct 2022 00:13:45 +0200 Subject: [PATCH 04/13] Generate test VAA using KMS --- clients/js/main.ts | 33 +- clients/js/package-lock.json | 1707 +++++++++++++++++++++++++++++- clients/js/package.json | 1 + clients/js/vaa.ts | 69 +- node/pkg/ecdsasigner/cloudkms.go | 2 - 5 files changed, 1781 insertions(+), 31 deletions(-) diff --git a/clients/js/main.ts b/clients/js/main.ts index 25d4f3128..6d369cb84 100644 --- a/clients/js/main.ts +++ b/clients/js/main.ts @@ -24,14 +24,15 @@ const GOVERNANCE_CHAIN = 1; const GOVERNANCE_EMITTER = "0000000000000000000000000000000000000000000000000000000000000004"; -function makeVAA( +async function makeVAA( emitterChain: number, targetChain: number, emitterAddress: string, signers: string[], sequence: string | undefined, - p: Payload -): VAA { + p: Payload, + useKMS: boolean +): Promise> { let v: VAA = { version: 1, guardianSetIndex: 0, @@ -45,7 +46,13 @@ function makeVAA( consistencyLevel: 0, payload: p, }; - v.signatures = vaa.sign(signers, v); + + if (useKMS) { + v.signatures = await vaa.signWithKMS(signers, v); + } else { + v.signatures = vaa.signWithKey(signers, v); + } + return v; } @@ -116,15 +123,17 @@ yargs(hideBin(process.argv)) "hex" ), }; - let v = makeVAA( + makeVAA( GOVERNANCE_CHAIN, 0, GOVERNANCE_EMITTER, argv["guardian-secret"].split(","), argv["sequence"], - payload + payload, + true + ).then((v) => + console.log(serialiseVAA(v)) ); - console.log(serialiseVAA(v)); } ) // Upgrade @@ -168,15 +177,17 @@ yargs(hideBin(process.argv)) "hex" ), }; - let v = makeVAA( + makeVAA( GOVERNANCE_CHAIN, toChainId(argv["chain"]), GOVERNANCE_EMITTER, argv["guardian-secret"].split(","), argv["sequence"], - payload - ); - console.log(serialiseVAA(v)); + payload, + true + ).then((v) => { + console.log(serialiseVAA(v)); + }); } ) ); diff --git a/clients/js/package-lock.json b/clients/js/package-lock.json index df3941ea7..19d32666c 100644 --- a/clients/js/package-lock.json +++ b/clients/js/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@celo-tools/celo-ethers-wrapper": "^0.1.0", "@certusone/wormhole-sdk": "^0.3.8", + "@google-cloud/kms": "^3.0.1", "@solana/web3.js": "^1.22.0", "@terra-money/terra.js": "^1.8.9", "axios": "^0.24.0", @@ -422,7 +423,6 @@ "version": "7.15.0", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.0.tgz", "integrity": "sha512-0v7oNOjr6YT9Z2RAOTv4T9aP+ubfx4Q/OhVtAet7PFDt0t9Oy6Jn+/rfC6b8HJ5zEqrQCiMxJfgtHpmIminmJQ==", - "dev": true, "bin": { "parser": "bin/babel-parser.js" }, @@ -1337,6 +1337,92 @@ "@ethersproject/strings": "^5.4.0" } }, + "node_modules/@google-cloud/kms": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@google-cloud/kms/-/kms-3.0.1.tgz", + "integrity": "sha512-xUrhzattC5mkNqbfMcIgBzwAab9eXCYrn1R1KYUNV5E96fK7ciT57bJESaUQvin7XKd18sQcLRD+uOJ6eTfXbg==", + "dependencies": { + "google-gax": "^3.0.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@grpc/grpc-js": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.7.3.tgz", + "integrity": "sha512-H9l79u4kJ2PVSxUNA08HMYAnUBLj9v6KjYQ7SQ71hOZcEXhShE/y5iQCesP8+6/Ik/7i2O0a10bPquIcYfufog==", + "dependencies": { + "@grpc/proto-loader": "^0.7.0", + "@types/node": ">=12.12.47" + }, + "engines": { + "node": "^8.13.0 || >=10.10.0" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.3.tgz", + "integrity": "sha512-5dAvoZwna2Py3Ef96Ux9jIkp3iZ62TUsV00p3wVBPNX5K178UbNi8Q7gQVqwXT1Yq9RejIGG9G2IPEo93T6RcA==", + "dependencies": { + "@types/long": "^4.0.1", + "lodash.camelcase": "^4.3.0", + "long": "^4.0.0", + "protobufjs": "^7.0.0", + "yargs": "^16.2.0" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@grpc/proto-loader/node_modules/protobufjs": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", + "integrity": "sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@grpc/proto-loader/node_modules/protobufjs/node_modules/long": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.0.tgz", + "integrity": "sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==" + }, + "node_modules/@grpc/proto-loader/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@improbable-eng/grpc-web": { "version": "0.14.1", "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.14.1.tgz", @@ -2021,6 +2107,11 @@ "@types/range-parser": "*" } }, + "node_modules/@types/linkify-it": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", + "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==" + }, "node_modules/@types/lodash": { "version": "4.14.171", "license": "MIT" @@ -2030,6 +2121,20 @@ "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" }, + "node_modules/@types/markdown-it": { + "version": "12.2.3", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", + "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", + "dependencies": { + "@types/linkify-it": "*", + "@types/mdurl": "*" + } + }, + "node_modules/@types/mdurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", + "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==" + }, "node_modules/@types/node": { "version": "16.4.1", "license": "MIT" @@ -2089,6 +2194,17 @@ "keypather": "^1.10.2" } }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, "node_modules/abstract-leveldown": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", @@ -2111,10 +2227,9 @@ } }, "node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", - "dev": true, + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", "bin": { "acorn": "bin/acorn" }, @@ -2122,6 +2237,14 @@ "node": ">=0.4.0" } }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", @@ -2136,6 +2259,38 @@ "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=" }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -2227,11 +2382,24 @@ "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, + "node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "engines": { + "node": ">=8" + } + }, "node_modules/asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -2705,6 +2873,11 @@ "ieee754": "^1.2.1" } }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, "node_modules/buffer-layout": { "version": "1.2.2", "license": "MIT", @@ -2804,6 +2977,17 @@ "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, + "node_modules/catharsis": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", + "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==", + "dependencies": { + "lodash": "^4.17.15" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -3268,6 +3452,11 @@ "node": "*" } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" + }, "node_modules/defer-to-connect": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", @@ -3375,6 +3564,17 @@ "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" }, + "node_modules/duplexify": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz", + "integrity": "sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw==", + "dependencies": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.0" + } + }, "node_modules/ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -3384,6 +3584,14 @@ "safer-buffer": "^2.1.0" } }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -3454,6 +3662,14 @@ "once": "^1.4.0" } }, + "node_modules/entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/errno": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", @@ -3574,6 +3790,96 @@ "node": ">=0.8.0" } }, + "node_modules/escodegen": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=4.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/escodegen/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/escodegen/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/espree": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", + "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", + "dependencies": { + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -4081,6 +4387,14 @@ "npm": ">=3" } }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "engines": { + "node": ">=6" + } + }, "node_modules/eventemitter3": { "version": "4.0.7", "license": "MIT" @@ -4207,11 +4521,21 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" + }, "node_modules/fast-safe-stringify": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.8.tgz", "integrity": "sha512-lXatBjf3WPjmWD6DpIZxkeSsCOwqI0maYMpgDlx8g4U2qi4lbjA9oH/HD2a87G+KfsUmo5WbJFmqBZlPxtptag==" }, + "node_modules/fast-text-encoding": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.6.tgz", + "integrity": "sha512-VhXlQgj9ioXCqGstD37E/HBeqEGV/qOD/kmbVG8h5xKBYvM1L3lR1Zn4555cQ8GkYbJa8aJSipLPndE1k6zK2w==" + }, "node_modules/fetch-ponyfill": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz", @@ -4357,6 +4681,62 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "node_modules/gaxios": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-5.0.2.tgz", + "integrity": "sha512-TjtV2AJOZoMQqRYoy5eM8cCQogYwazWNYLQ72QB0kwa6vHHruYkGmhhyrlzbmgNHK1dNnuP2WSH81urfzyN2Og==", + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.7" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/gaxios/node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gaxios/node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/gcp-metadata": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.0.1.tgz", + "integrity": "sha512-jiRJ+Fk7e8FH68Z6TLaqwea307OktJpDjmYnU7/li6ziwvVvU2RlrCyQo5vkdeP94chm0kcSCOOszvmuaioq3g==", + "dependencies": { + "gaxios": "^5.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -4447,6 +4827,207 @@ "node": ">=4" } }, + "node_modules/google-auth-library": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-8.6.0.tgz", + "integrity": "sha512-y6bw1yTWMVgs1vGJwBZ3uu+uIClfgxQfsEVcTNKjQeNQOVwox69+ZUgTeTAzrh+74hBqrk1gWyb9RsQVDI7seg==", + "dependencies": { + "arrify": "^2.0.0", + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "fast-text-encoding": "^1.0.0", + "gaxios": "^5.0.0", + "gcp-metadata": "^5.0.0", + "gtoken": "^6.1.0", + "jws": "^4.0.0", + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/google-gax": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-3.5.2.tgz", + "integrity": "sha512-AyP53w0gHcWlzxm+jSgqCR3Xu4Ld7EpSjhtNBnNhzwwWaIUyphH9kBGNIEH+i4UGkTUXOY29K/Re8EiAvkBRGw==", + "dependencies": { + "@grpc/grpc-js": "~1.7.0", + "@grpc/proto-loader": "^0.7.0", + "@types/long": "^4.0.0", + "abort-controller": "^3.0.0", + "duplexify": "^4.0.0", + "fast-text-encoding": "^1.0.3", + "google-auth-library": "^8.0.2", + "is-stream-ended": "^0.1.4", + "node-fetch": "^2.6.1", + "object-hash": "^3.0.0", + "proto3-json-serializer": "^1.0.0", + "protobufjs": "7.1.2", + "protobufjs-cli": "1.0.2", + "retry-request": "^5.0.0" + }, + "bin": { + "compileProtos": "build/tools/compileProtos.js", + "minifyProtoJson": "build/tools/minify.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/google-gax/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/google-gax/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/google-gax/node_modules/glob": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", + "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/google-gax/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/google-gax/node_modules/long": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.0.tgz", + "integrity": "sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==" + }, + "node_modules/google-gax/node_modules/minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/google-gax/node_modules/protobufjs": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", + "integrity": "sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/google-gax/node_modules/protobufjs-cli": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/protobufjs-cli/-/protobufjs-cli-1.0.2.tgz", + "integrity": "sha512-cz9Pq9p/Zs7okc6avH20W7QuyjTclwJPgqXG11jNaulfS3nbVisID8rC+prfgq0gbZE0w9LBFd1OKFF03kgFzg==", + "dependencies": { + "chalk": "^4.0.0", + "escodegen": "^1.13.0", + "espree": "^9.0.0", + "estraverse": "^5.1.0", + "glob": "^8.0.0", + "jsdoc": "^3.6.3", + "minimist": "^1.2.0", + "semver": "^7.1.2", + "tmp": "^0.2.1", + "uglify-js": "^3.7.7" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "protobufjs": "^7.0.0" + } + }, + "node_modules/google-gax/node_modules/semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/google-gax/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/google-p12-pem": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-4.0.1.tgz", + "integrity": "sha512-WPkN4yGtz05WZ5EhtlxNDWPhC4JIic6G8ePitwUWy4l+XPVYec+a0j0Ts47PDtW59y3RwAhUd9/h9ZZ63px6RQ==", + "dependencies": { + "node-forge": "^1.3.1" + }, + "bin": { + "gp12-pem": "build/src/bin/gp12-pem.js" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/google-protobuf": { "version": "3.20.1", "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.20.1.tgz", @@ -4478,6 +5059,19 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" }, + "node_modules/gtoken": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-6.1.2.tgz", + "integrity": "sha512-4ccGpzz7YAr7lxrT2neugmXQ3hP9ho2gcaityLVkiUecAiwiy60Ii8gRbZeOsXV19fYaRjgBSshs8kXw+NKCPQ==", + "dependencies": { + "gaxios": "^5.0.1", + "google-p12-pem": "^4.0.0", + "jws": "^4.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -4632,10 +5226,43 @@ "sshpk": "^1.7.0" }, "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" + "node": ">=0.8", + "npm": ">=1.3.7" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -4913,6 +5540,11 @@ "node": ">=0.10.0" } }, + "node_modules/is-stream-ended": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", + "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" + }, "node_modules/is-string": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz", @@ -5041,6 +5673,14 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, + "node_modules/js2xmlparser": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz", + "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==", + "dependencies": { + "xmlcreate": "^2.0.4" + } + }, "node_modules/jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", @@ -5054,6 +5694,42 @@ "jscrypto": "bin/cli.js" } }, + "node_modules/jsdoc": { + "version": "3.6.11", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.11.tgz", + "integrity": "sha512-8UCU0TYeIYD9KeLzEcAu2q8N/mx9O3phAGl32nmHlE0LpaJL71mMkP4d+QE5zWfNt50qheHtOZ0qoxVrsX5TUg==", + "dependencies": { + "@babel/parser": "^7.9.4", + "@types/markdown-it": "^12.2.3", + "bluebird": "^3.7.2", + "catharsis": "^0.9.0", + "escape-string-regexp": "^2.0.0", + "js2xmlparser": "^4.0.2", + "klaw": "^3.0.0", + "markdown-it": "^12.3.2", + "markdown-it-anchor": "^8.4.1", + "marked": "^4.0.10", + "mkdirp": "^1.0.4", + "requizzle": "^0.2.3", + "strip-json-comments": "^3.1.0", + "taffydb": "2.6.2", + "underscore": "~1.13.2" + }, + "bin": { + "jsdoc": "jsdoc.js" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/jsdoc/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "engines": { + "node": ">=8" + } + }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -5186,6 +5862,25 @@ "verror": "1.10.0" } }, + "node_modules/jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "dependencies": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, "node_modules/keccak": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", @@ -5214,6 +5909,14 @@ "json-buffer": "3.0.0" } }, + "node_modules/klaw": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", + "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", + "dependencies": { + "graceful-fs": "^4.1.9" + } + }, "node_modules/level-codec": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", @@ -5341,10 +6044,35 @@ "semver": "bin/semver" } }, + "node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/linkify-it": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", + "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", + "dependencies": { + "uc.micro": "^1.0.1" + } + }, "node_modules/lodash": { "version": "4.17.21", "license": "MIT" }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" + }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", @@ -5398,6 +6126,41 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, + "node_modules/markdown-it": { + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", + "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", + "dependencies": { + "argparse": "^2.0.1", + "entities": "~2.1.0", + "linkify-it": "^3.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "bin": { + "markdown-it": "bin/markdown-it.js" + } + }, + "node_modules/markdown-it-anchor": { + "version": "8.6.5", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.5.tgz", + "integrity": "sha512-PI1qEHHkTNWT+X6Ip9w+paonfIQ+QZP9sCeMYi47oqhH+EsW8CrJ8J7CzV19QVOj6il8ATGbK2nTECj22ZHGvQ==", + "peerDependencies": { + "@types/markdown-it": "*", + "markdown-it": "*" + } + }, + "node_modules/marked": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.1.1.tgz", + "integrity": "sha512-0cNMnTcUJPxbA6uWmCmjWz4NJRe/0Xfk2NhXCUHjew9qJzFN20krFnsUe7QynwqOwa5m1fZ4UDg0ycKFVC0ccw==", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 12" + } + }, "node_modules/md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -5408,6 +6171,11 @@ "safe-buffer": "^5.1.2" } }, + "node_modules/mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==" + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -5785,12 +6553,19 @@ }, "node_modules/node-fetch": { "version": "2.6.1", - "dev": true, "license": "MIT", "engines": { "node": "4.x || >=6.0.0" } }, + "node_modules/node-forge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", + "engines": { + "node": ">= 6.13.0" + } + }, "node_modules/node-gyp-build": { "version": "4.2.3", "license": "MIT", @@ -8488,6 +9263,14 @@ "node": ">=0.10.0" } }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "engines": { + "node": ">= 6" + } + }, "node_modules/object-inspect": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", @@ -8548,6 +9331,22 @@ "wrappy": "1" } }, + "node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", @@ -8657,6 +9456,14 @@ "node": ">= 0.6" } }, + "node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/prepend-http": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", @@ -8703,6 +9510,45 @@ "node": ">=0.10.0" } }, + "node_modules/proto3-json-serializer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-1.1.0.tgz", + "integrity": "sha512-SjXwUWe/vANGs/mJJTbw5++7U67nwsymg7qsoPtw6GiXqw3kUy8ByojrlEdVE2efxAdKreX8WkDafxvYW95ZQg==", + "dependencies": { + "protobufjs": "^7.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/proto3-json-serializer/node_modules/long": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.0.tgz", + "integrity": "sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==" + }, + "node_modules/proto3-json-serializer/node_modules/protobufjs": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", + "integrity": "sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/protobufjs": { "version": "6.11.3", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", @@ -8920,6 +9766,14 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, + "node_modules/requizzle": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", + "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", + "dependencies": { + "lodash": "^4.17.14" + } + }, "node_modules/resolve": { "version": "1.20.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", @@ -8941,6 +9795,39 @@ "lowercase-keys": "^1.0.0" } }, + "node_modules/retry-request": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-5.0.2.tgz", + "integrity": "sha512-wfI3pk7EE80lCIXprqh7ym48IHYdwmAAzESdbU8Q9l7pnRCk9LEhpbOTNKjz6FARLm/Bl5m+4F0ABxOkYUujSQ==", + "dependencies": { + "debug": "^4.1.1", + "extend": "^3.0.2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/retry-request/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/retry-request/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "node_modules/ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -9252,6 +10139,11 @@ "node": ">= 0.6" } }, + "node_modules/stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" + }, "node_modules/strict-uri-encode": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", @@ -9328,6 +10220,17 @@ "npm": ">=3" } }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/superagent": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/superagent/-/superagent-6.1.0.tgz", @@ -9539,6 +10442,11 @@ "node": ">=0.10.0" } }, + "node_modules/taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha512-y3JaeRSplks6NYQuCOj3ZFMO3j60rTwbuKCvZxsAraGYH2epusatvZ0baZYA01WsGqJBq/Dl6vOrMUJqyMj8kA==" + }, "node_modules/tar": { "version": "4.4.15", "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.15.tgz", @@ -9738,6 +10646,17 @@ "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" }, + "node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/type-detect": { "version": "0.1.1", "license": "MIT", @@ -9783,6 +10702,22 @@ "node": ">=4.2.0" } }, + "node_modules/uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + }, + "node_modules/uglify-js": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/ultron": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", @@ -9802,6 +10737,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/underscore": { + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", + "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==" + }, "node_modules/universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -10437,6 +11377,14 @@ "bs58check": "<3.0.0" } }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -10519,6 +11467,11 @@ "cookiejar": "^2.1.1" } }, + "node_modules/xmlcreate": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", + "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==" + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -10878,8 +11831,7 @@ "@babel/parser": { "version": "7.15.0", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.0.tgz", - "integrity": "sha512-0v7oNOjr6YT9Z2RAOTv4T9aP+ubfx4Q/OhVtAet7PFDt0t9Oy6Jn+/rfC6b8HJ5zEqrQCiMxJfgtHpmIminmJQ==", - "dev": true + "integrity": "sha512-0v7oNOjr6YT9Z2RAOTv4T9aP+ubfx4Q/OhVtAet7PFDt0t9Oy6Jn+/rfC6b8HJ5zEqrQCiMxJfgtHpmIminmJQ==" }, "@babel/plugin-transform-runtime": { "version": "7.15.0", @@ -11447,6 +12399,77 @@ "@ethersproject/strings": "^5.4.0" } }, + "@google-cloud/kms": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@google-cloud/kms/-/kms-3.0.1.tgz", + "integrity": "sha512-xUrhzattC5mkNqbfMcIgBzwAab9eXCYrn1R1KYUNV5E96fK7ciT57bJESaUQvin7XKd18sQcLRD+uOJ6eTfXbg==", + "requires": { + "google-gax": "^3.0.1" + } + }, + "@grpc/grpc-js": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.7.3.tgz", + "integrity": "sha512-H9l79u4kJ2PVSxUNA08HMYAnUBLj9v6KjYQ7SQ71hOZcEXhShE/y5iQCesP8+6/Ik/7i2O0a10bPquIcYfufog==", + "requires": { + "@grpc/proto-loader": "^0.7.0", + "@types/node": ">=12.12.47" + } + }, + "@grpc/proto-loader": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.3.tgz", + "integrity": "sha512-5dAvoZwna2Py3Ef96Ux9jIkp3iZ62TUsV00p3wVBPNX5K178UbNi8Q7gQVqwXT1Yq9RejIGG9G2IPEo93T6RcA==", + "requires": { + "@types/long": "^4.0.1", + "lodash.camelcase": "^4.3.0", + "long": "^4.0.0", + "protobufjs": "^7.0.0", + "yargs": "^16.2.0" + }, + "dependencies": { + "protobufjs": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", + "integrity": "sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "dependencies": { + "long": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.0.tgz", + "integrity": "sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==" + } + } + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + } + } + }, "@improbable-eng/grpc-web": { "version": "0.14.1", "resolved": "https://registry.npmjs.org/@improbable-eng/grpc-web/-/grpc-web-0.14.1.tgz", @@ -12042,6 +13065,11 @@ "@types/range-parser": "*" } }, + "@types/linkify-it": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", + "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==" + }, "@types/lodash": { "version": "4.14.171" }, @@ -12050,6 +13078,20 @@ "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" }, + "@types/markdown-it": { + "version": "12.2.3", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", + "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", + "requires": { + "@types/linkify-it": "*", + "@types/mdurl": "*" + } + }, + "@types/mdurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", + "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==" + }, "@types/node": { "version": "16.4.1" }, @@ -12096,6 +13138,14 @@ "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==", "dev": true }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "^5.0.0" + } + }, "abstract-leveldown": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", @@ -12115,10 +13165,15 @@ } }, "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", - "dev": true + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==" + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "requires": {} }, "acorn-walk": { "version": "8.2.0", @@ -12131,6 +13186,29 @@ "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=" }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "requires": { + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -12194,11 +13272,21 @@ "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" + }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -12593,6 +13681,11 @@ "ieee754": "^1.2.1" } }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, "buffer-layout": { "version": "1.2.2" }, @@ -12666,6 +13759,14 @@ "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, + "catharsis": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", + "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==", + "requires": { + "lodash": "^4.17.15" + } + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -13063,6 +14164,11 @@ "type-detect": "0.1.1" } }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" + }, "defer-to-connect": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", @@ -13150,6 +14256,17 @@ "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" }, + "duplexify": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz", + "integrity": "sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw==", + "requires": { + "end-of-stream": "^1.4.1", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1", + "stream-shift": "^1.0.0" + } + }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -13159,6 +14276,14 @@ "safer-buffer": "^2.1.0" } }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -13225,6 +14350,11 @@ "once": "^1.4.0" } }, + "entities": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", + "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==" + }, "errno": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", @@ -13322,6 +14452,61 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, + "escodegen": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", + "requires": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "optional": true + } + } + }, + "eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==" + }, + "espree": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.0.tgz", + "integrity": "sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==", + "requires": { + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" + }, "etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -13820,6 +15005,11 @@ "strip-hex-prefix": "1.0.0" } }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, "eventemitter3": { "version": "4.0.7" }, @@ -13934,11 +15124,21 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" + }, "fast-safe-stringify": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.8.tgz", "integrity": "sha512-lXatBjf3WPjmWD6DpIZxkeSsCOwqI0maYMpgDlx8g4U2qi4lbjA9oH/HD2a87G+KfsUmo5WbJFmqBZlPxtptag==" }, + "fast-text-encoding": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.6.tgz", + "integrity": "sha512-VhXlQgj9ioXCqGstD37E/HBeqEGV/qOD/kmbVG8h5xKBYvM1L3lR1Zn4555cQ8GkYbJa8aJSipLPndE1k6zK2w==" + }, "fetch-ponyfill": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz", @@ -14053,6 +15253,41 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "gaxios": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-5.0.2.tgz", + "integrity": "sha512-TjtV2AJOZoMQqRYoy5eM8cCQogYwazWNYLQ72QB0kwa6vHHruYkGmhhyrlzbmgNHK1dNnuP2WSH81urfzyN2Og==", + "requires": { + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.7" + }, + "dependencies": { + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" + }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + } + } + }, + "gcp-metadata": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.0.1.tgz", + "integrity": "sha512-jiRJ+Fk7e8FH68Z6TLaqwea307OktJpDjmYnU7/li6ziwvVvU2RlrCyQo5vkdeP94chm0kcSCOOszvmuaioq3g==", + "requires": { + "gaxios": "^5.0.0", + "json-bigint": "^1.0.0" + } + }, "gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", @@ -14122,6 +15357,152 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, + "google-auth-library": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-8.6.0.tgz", + "integrity": "sha512-y6bw1yTWMVgs1vGJwBZ3uu+uIClfgxQfsEVcTNKjQeNQOVwox69+ZUgTeTAzrh+74hBqrk1gWyb9RsQVDI7seg==", + "requires": { + "arrify": "^2.0.0", + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "fast-text-encoding": "^1.0.0", + "gaxios": "^5.0.0", + "gcp-metadata": "^5.0.0", + "gtoken": "^6.1.0", + "jws": "^4.0.0", + "lru-cache": "^6.0.0" + } + }, + "google-gax": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-3.5.2.tgz", + "integrity": "sha512-AyP53w0gHcWlzxm+jSgqCR3Xu4Ld7EpSjhtNBnNhzwwWaIUyphH9kBGNIEH+i4UGkTUXOY29K/Re8EiAvkBRGw==", + "requires": { + "@grpc/grpc-js": "~1.7.0", + "@grpc/proto-loader": "^0.7.0", + "@types/long": "^4.0.0", + "abort-controller": "^3.0.0", + "duplexify": "^4.0.0", + "fast-text-encoding": "^1.0.3", + "google-auth-library": "^8.0.2", + "is-stream-ended": "^0.1.4", + "node-fetch": "^2.6.1", + "object-hash": "^3.0.0", + "proto3-json-serializer": "^1.0.0", + "protobufjs": "7.1.2", + "protobufjs-cli": "1.0.2", + "retry-request": "^5.0.0" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "glob": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", + "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "long": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.0.tgz", + "integrity": "sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==" + }, + "minimatch": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", + "integrity": "sha512-9TPBGGak4nHfGZsPBohm9AWg6NoT7QTCehS3BIJABslyZbzxfV78QM2Y6+i741OPZIafFAaiiEMh5OyIrJPgtg==", + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "protobufjs": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", + "integrity": "sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + } + }, + "protobufjs-cli": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/protobufjs-cli/-/protobufjs-cli-1.0.2.tgz", + "integrity": "sha512-cz9Pq9p/Zs7okc6avH20W7QuyjTclwJPgqXG11jNaulfS3nbVisID8rC+prfgq0gbZE0w9LBFd1OKFF03kgFzg==", + "requires": { + "chalk": "^4.0.0", + "escodegen": "^1.13.0", + "espree": "^9.0.0", + "estraverse": "^5.1.0", + "glob": "^8.0.0", + "jsdoc": "^3.6.3", + "minimist": "^1.2.0", + "semver": "^7.1.2", + "tmp": "^0.2.1", + "uglify-js": "^3.7.7" + } + }, + "semver": { + "version": "7.3.8", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", + "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "google-p12-pem": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-4.0.1.tgz", + "integrity": "sha512-WPkN4yGtz05WZ5EhtlxNDWPhC4JIic6G8ePitwUWy4l+XPVYec+a0j0Ts47PDtW59y3RwAhUd9/h9ZZ63px6RQ==", + "requires": { + "node-forge": "^1.3.1" + } + }, "google-protobuf": { "version": "3.20.1", "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.20.1.tgz", @@ -14150,6 +15531,16 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" }, + "gtoken": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-6.1.2.tgz", + "integrity": "sha512-4ccGpzz7YAr7lxrT2neugmXQ3hP9ho2gcaityLVkiUecAiwiy60Ii8gRbZeOsXV19fYaRjgBSshs8kXw+NKCPQ==", + "requires": { + "gaxios": "^5.0.1", + "google-p12-pem": "^4.0.0", + "jws": "^4.0.0" + } + }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -14270,6 +15661,30 @@ "sshpk": "^1.7.0" } }, + "https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "requires": { + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -14440,6 +15855,11 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" }, + "is-stream-ended": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-stream-ended/-/is-stream-ended-0.1.4.tgz", + "integrity": "sha512-xj0XPvmr7bQFTvirqnFr50o0hQIh6ZItDqloxt5aJrR4NQsYeSsyFQERYGCAzfindAcnKjINnwEEgLx4IqVzQw==" + }, "is-string": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz", @@ -14537,6 +15957,14 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, + "js2xmlparser": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz", + "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==", + "requires": { + "xmlcreate": "^2.0.4" + } + }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", @@ -14547,6 +15975,35 @@ "resolved": "https://registry.npmjs.org/jscrypto/-/jscrypto-1.0.2.tgz", "integrity": "sha512-r+oNJLGTv1nkNMBBq3c70xYrFDgJOYVgs2OHijz5Ht+0KJ0yObD0oYxC9mN72KLzVfXw+osspg6t27IZvuTUxw==" }, + "jsdoc": { + "version": "3.6.11", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.11.tgz", + "integrity": "sha512-8UCU0TYeIYD9KeLzEcAu2q8N/mx9O3phAGl32nmHlE0LpaJL71mMkP4d+QE5zWfNt50qheHtOZ0qoxVrsX5TUg==", + "requires": { + "@babel/parser": "^7.9.4", + "@types/markdown-it": "^12.2.3", + "bluebird": "^3.7.2", + "catharsis": "^0.9.0", + "escape-string-regexp": "^2.0.0", + "js2xmlparser": "^4.0.2", + "klaw": "^3.0.0", + "markdown-it": "^12.3.2", + "markdown-it-anchor": "^8.4.1", + "marked": "^4.0.10", + "mkdirp": "^1.0.4", + "requizzle": "^0.2.3", + "strip-json-comments": "^3.1.0", + "taffydb": "2.6.2", + "underscore": "~1.13.2" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==" + } + } + }, "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -14649,6 +16106,25 @@ "verror": "1.10.0" } }, + "jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "requires": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, "keccak": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", @@ -14672,6 +16148,14 @@ "json-buffer": "3.0.0" } }, + "klaw": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", + "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", + "requires": { + "graceful-fs": "^4.1.9" + } + }, "level-codec": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", @@ -14799,9 +16283,31 @@ } } }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "linkify-it": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", + "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", + "requires": { + "uc.micro": "^1.0.1" + } + }, "lodash": { "version": "4.17.21" }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" + }, "lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", @@ -14851,6 +16357,29 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, + "markdown-it": { + "version": "12.3.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", + "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", + "requires": { + "argparse": "^2.0.1", + "entities": "~2.1.0", + "linkify-it": "^3.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + } + }, + "markdown-it-anchor": { + "version": "8.6.5", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.5.tgz", + "integrity": "sha512-PI1qEHHkTNWT+X6Ip9w+paonfIQ+QZP9sCeMYi47oqhH+EsW8CrJ8J7CzV19QVOj6il8ATGbK2nTECj22ZHGvQ==", + "requires": {} + }, + "marked": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.1.1.tgz", + "integrity": "sha512-0cNMnTcUJPxbA6uWmCmjWz4NJRe/0Xfk2NhXCUHjew9qJzFN20krFnsUe7QynwqOwa5m1fZ4UDg0ycKFVC0ccw==" + }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -14861,6 +16390,11 @@ "safe-buffer": "^5.1.2" } }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==" + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -15174,8 +16708,12 @@ "version": "2.0.2" }, "node-fetch": { - "version": "2.6.1", - "dev": true + "version": "2.6.1" + }, + "node-forge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==" }, "node-gyp-build": { "version": "4.2.3" @@ -17045,6 +18583,11 @@ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, + "object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==" + }, "object-inspect": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", @@ -17090,6 +18633,19 @@ "wrappy": "1" } }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, "p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", @@ -17175,6 +18731,11 @@ "integrity": "sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw=", "dev": true }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==" + }, "prepend-http": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", @@ -17206,6 +18767,40 @@ "set-immediate-shim": "^1.0.1" } }, + "proto3-json-serializer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-1.1.0.tgz", + "integrity": "sha512-SjXwUWe/vANGs/mJJTbw5++7U67nwsymg7qsoPtw6GiXqw3kUy8ByojrlEdVE2efxAdKreX8WkDafxvYW95ZQg==", + "requires": { + "protobufjs": "^7.0.0" + }, + "dependencies": { + "long": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.0.tgz", + "integrity": "sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==" + }, + "protobufjs": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz", + "integrity": "sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + } + } + } + }, "protobufjs": { "version": "6.11.3", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", @@ -17390,6 +18985,14 @@ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, + "requizzle": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.3.tgz", + "integrity": "sha512-YanoyJjykPxGHii0fZP0uUPEXpvqfBDxWV7s6GKAiiOsiqhX6vHNyW3Qzdmqp/iq/ExbhaGbVrjB4ruEVSM4GQ==", + "requires": { + "lodash": "^4.17.14" + } + }, "resolve": { "version": "1.20.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", @@ -17408,6 +19011,30 @@ "lowercase-keys": "^1.0.0" } }, + "retry-request": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-5.0.2.tgz", + "integrity": "sha512-wfI3pk7EE80lCIXprqh7ym48IHYdwmAAzESdbU8Q9l7pnRCk9LEhpbOTNKjz6FARLm/Bl5m+4F0ABxOkYUujSQ==", + "requires": { + "debug": "^4.1.1", + "extend": "^3.0.2" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, "ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -17640,6 +19267,11 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, + "stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" + }, "strict-uri-encode": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", @@ -17697,6 +19329,11 @@ "is-hex-prefixed": "1.0.0" } }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" + }, "superagent": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/superagent/-/superagent-6.1.0.tgz", @@ -17846,6 +19483,11 @@ } } }, + "taffydb": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", + "integrity": "sha512-y3JaeRSplks6NYQuCOj3ZFMO3j60rTwbuKCvZxsAraGYH2epusatvZ0baZYA01WsGqJBq/Dl6vOrMUJqyMj8kA==" + }, "tar": { "version": "4.4.15", "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.15.tgz", @@ -17990,6 +19632,14 @@ "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", + "requires": { + "prelude-ls": "~1.1.2" + } + }, "type-detect": { "version": "0.1.1" }, @@ -18021,6 +19671,16 @@ "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", "dev": true }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + }, + "uglify-js": { + "version": "3.17.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", + "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==" + }, "ultron": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", @@ -18037,6 +19697,11 @@ "which-boxed-primitive": "^1.0.2" } }, + "underscore": { + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", + "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==" + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -18585,6 +20250,11 @@ "bs58check": "<3.0.0" } }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" + }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -18647,6 +20317,11 @@ "cookiejar": "^2.1.1" } }, + "xmlcreate": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", + "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==" + }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/clients/js/package.json b/clients/js/package.json index 24673473e..3e5aa5366 100644 --- a/clients/js/package.json +++ b/clients/js/package.json @@ -6,6 +6,7 @@ "@certusone/wormhole-sdk": "^0.3.8", "@solana/web3.js": "^1.22.0", "@terra-money/terra.js": "^1.8.9", + "@google-cloud/kms": "^3.0.1", "axios": "^0.24.0", "binary-parser": "^2.0.2", "bn.js": "^5.2.0", diff --git a/clients/js/vaa.ts b/clients/js/vaa.ts index a29f02f64..887897891 100644 --- a/clients/js/vaa.ts +++ b/clients/js/vaa.ts @@ -2,6 +2,9 @@ import { Parser } from "binary-parser" import { ethers } from "ethers" import { solidityKeccak256 } from "ethers/lib/utils" import * as elliptic from "elliptic" +import { KeyManagementServiceClient } from "@google-cloud/kms" +import { signatureImport, signatureNormalize } from 'secp256k1' +import { createPublicKey } from 'crypto' export interface Signature { guardianSetIndex: number @@ -189,7 +192,7 @@ function vaaBody(vaa: VAA) { return body.join("") } -export function sign(signers: string[], vaa: VAA): Signature[] { +export function signWithKey(signers: string[], vaa: VAA): Signature[] { const body = vaaBody(vaa) const hash = solidityKeccak256(["bytes"], [solidityKeccak256(["bytes"], ["0x" + body])]) const ec = new elliptic.ec("secp256k1") @@ -209,6 +212,68 @@ export function sign(signers: string[], vaa: VAA): Signature[] { }) } +const kmsClient = new KeyManagementServiceClient({ + keyFile: "/tmp/credentials-file.json" +}) + +export async function signWithKMS(signers: string[], vaa: VAA): Promise { + const body = vaaBody(vaa) + const hash = solidityKeccak256(["bytes"], [solidityKeccak256(["bytes"], ["0x" + body])]) + const digest = Buffer.from(hash.substr(2), "hex") + + var signatures: Signature[] = [] + for (let i = 0; i < signers.length; i++) { + const keyName = signers[i] + const [signResponse] = await kmsClient.asymmetricSign({ + name: keyName, + digest: { + sha256: digest + } + }) + + const pubKey = await kmsClient.getPublicKey({ name: keyName }) + const p2 = createPublicKey(pubKey[0].pem) + let pubKeyBuf = p2.export({ format: "der", type: "spki" }); + pubKeyBuf = pubKeyBuf.slice(pubKeyBuf.length - 65) + + let _64 = signatureImport(signResponse.signature as Uint8Array); + const normalized = signatureNormalize(_64); + + const r = normalized.slice(0, 32) + const s = normalized.slice(32, 64) + const v = calculateV(normalized, digest, pubKeyBuf); + + const packed = [ + Buffer.from(r).toString("hex").padStart(64, "0"), + Buffer.from(s).toString("hex").padStart(64, "0"), + encode("uint8", v) + ].join("") + + signatures.push({ + guardianSetIndex: i, + signature: packed + }) + } + + return signatures +} + +function calculateV(signature: Uint8Array, hash: Buffer, uncompressPubKey: Buffer): number { + const { ecdsaRecover } = require("secp256k1"); + let recId = -1; + + for (let i = 0; i < 4; i++) { + const rec = ecdsaRecover(signature, i, hash, false); + if (Buffer.compare(rec, uncompressPubKey) == 0) { + recId = i; + break; + } + } + if (recId == -1) + throw new Error("Impossible to calculare the recovery id. should not happen"); + return recId; +} + // Parse an address of given length, and render it as hex const addressParser = (length: number) => new Parser() .endianess("big") @@ -381,7 +446,7 @@ function portalRegisterChainParser(m greedy: true, assert: str => str === "" }) -) + ) } function serialisePortalRegisterChain(payload: PortalRegisterChain): string { diff --git a/node/pkg/ecdsasigner/cloudkms.go b/node/pkg/ecdsasigner/cloudkms.go index 3aef94da7..961784309 100644 --- a/node/pkg/ecdsasigner/cloudkms.go +++ b/node/pkg/ecdsasigner/cloudkms.go @@ -1,7 +1,5 @@ package ecdsasigner -import "C" - import ( "context" "crypto/ecdsa" From 4e161c06581447e425888ebe8bc8158d857981ff Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Wed, 26 Oct 2022 10:11:16 +0200 Subject: [PATCH 05/13] Use pointer receiver for ECDSASigner --- clients/js/vaa.ts | 4 ++-- node/cmd/guardiand/node.go | 6 +++--- node/pkg/ecdsasigner/cloudkms.go | 8 +++----- node/pkg/ecdsasigner/ecdsaprivatekey.go | 4 ++-- node/pkg/ecdsasigner/ecdsasigner_test.go | 4 ++-- node/pkg/p2p/p2p.go | 10 +++++----- node/pkg/processor/broadcast.go | 2 +- node/pkg/processor/injection.go | 2 +- node/pkg/processor/message.go | 2 +- node/pkg/processor/processor.go | 6 +++--- 10 files changed, 23 insertions(+), 25 deletions(-) diff --git a/clients/js/vaa.ts b/clients/js/vaa.ts index 887897891..e4028bc6b 100644 --- a/clients/js/vaa.ts +++ b/clients/js/vaa.ts @@ -232,8 +232,8 @@ export async function signWithKMS(signers: string[], vaa: VAA): Promise }) const pubKey = await kmsClient.getPublicKey({ name: keyName }) - const p2 = createPublicKey(pubKey[0].pem) - let pubKeyBuf = p2.export({ format: "der", type: "spki" }); + const pubKeyObj = createPublicKey(pubKey[0].pem) + let pubKeyBuf = pubKeyObj.export({ format: "der", type: "spki" }); pubKeyBuf = pubKeyBuf.slice(pubKeyBuf.length - 65) let _64 = signatureImport(signResponse.signature as Uint8Array); diff --git a/node/cmd/guardiand/node.go b/node/cmd/guardiand/node.go index 07f043949..d11707cd8 100644 --- a/node/cmd/guardiand/node.go +++ b/node/cmd/guardiand/node.go @@ -672,7 +672,7 @@ func runNode(cmd *cobra.Command, args []string) { if err != nil { logger.Fatal("Failed to load guardian key from file", zap.Error(err)) } - guardianSigner = ecdsasigner.ECDSAPrivateKey{Value: gk} + guardianSigner = &ecdsasigner.ECDSAPrivateKey{Value: gk} } guardianPubkey := guardianSigner.PublicKey() @@ -845,7 +845,7 @@ func runNode(cmd *cobra.Command, args []string) { // Run supervisor. supervisor.New(rootCtx, logger, func(ctx context.Context) error { if err := supervisor.Run(ctx, "p2p", p2p.Run( - obsvC, obsvReqC, obsvReqSendC, sendC, signedInC, priv, &guardianSigner, gst, *p2pPort, *p2pNetworkID, *p2pBootstrap, *nodeName, *disableHeartbeatVerify, rootCtxCancel)); err != nil { + obsvC, obsvReqC, obsvReqSendC, sendC, signedInC, priv, guardianSigner, gst, *p2pPort, *p2pNetworkID, *p2pBootstrap, *nodeName, *disableHeartbeatVerify, rootCtxCancel)); err != nil { return err } @@ -965,7 +965,7 @@ func runNode(cmd *cobra.Command, args []string) { obsvC, injectC, signedInC, - &guardianSigner, + guardianSigner, gst, *unsafeDevMode, *devNumGuardians, diff --git a/node/pkg/ecdsasigner/cloudkms.go b/node/pkg/ecdsasigner/cloudkms.go index 961784309..622e71500 100644 --- a/node/pkg/ecdsasigner/cloudkms.go +++ b/node/pkg/ecdsasigner/cloudkms.go @@ -45,7 +45,7 @@ func NewKMSClient(ctx context.Context, keyId string, opts ...option.ClientOption } // ECDSASigner methods -func (c KMSClient) Sign(digest []byte) ([]byte, error) { +func (c *KMSClient) Sign(digest []byte) ([]byte, error) { req := &kmspb.AsymmetricSignRequest{ Name: c.keyId, Digest: &kmspb.Digest{ @@ -70,7 +70,7 @@ func (c KMSClient) Sign(digest []byte) ([]byte, error) { return sig, nil } -func (c KMSClient) PublicKey() ecdsa.PublicKey { +func (c *KMSClient) PublicKey() ecdsa.PublicKey { return *c.publicKey } @@ -147,15 +147,13 @@ func parseSignature(kmsSignature []byte, digest []byte, pubKey ethcommon.Address } func appendV(sig []byte, digest []byte, pubKey ethcommon.Address) ([]byte, error) { - sigWithV := append(sig, 0) - for i := 0; i < 4; i++ { + sigWithV := append(sig, byte(i)) pk, err := ethcrypto.Ecrecover(digest, sigWithV) signer_pk := ethcommon.BytesToAddress(ethcrypto.Keccak256(pk[1:])[12:]) if err == nil && signer_pk == pubKey { return sigWithV, nil } - sigWithV = append(sig, byte(i)) } return nil, fmt.Errorf("Can not append V for KMS signature") diff --git a/node/pkg/ecdsasigner/ecdsaprivatekey.go b/node/pkg/ecdsasigner/ecdsaprivatekey.go index 17fd708ed..1378ecfa9 100644 --- a/node/pkg/ecdsasigner/ecdsaprivatekey.go +++ b/node/pkg/ecdsasigner/ecdsaprivatekey.go @@ -9,10 +9,10 @@ type ECDSAPrivateKey struct { Value *ecdsa.PrivateKey } -func (k ECDSAPrivateKey) Sign(digestHash []byte) (sig []byte, err error) { +func (k *ECDSAPrivateKey) Sign(digestHash []byte) (sig []byte, err error) { return crypto.Sign(digestHash, k.Value) } -func (k ECDSAPrivateKey) PublicKey() ecdsa.PublicKey { +func (k *ECDSAPrivateKey) PublicKey() ecdsa.PublicKey { return k.Value.PublicKey } diff --git a/node/pkg/ecdsasigner/ecdsasigner_test.go b/node/pkg/ecdsasigner/ecdsasigner_test.go index 60bad2c96..0cc66efdb 100644 --- a/node/pkg/ecdsasigner/ecdsasigner_test.go +++ b/node/pkg/ecdsasigner/ecdsasigner_test.go @@ -16,7 +16,7 @@ func TestKMS(t *testing.T) { if err != nil { t.Fatalf("failed to setup KMS client: %v", err) } - defer kmsClient.client.Close() + defer kmsClient.Client.Close() verifySigner(t, kmsClient) } @@ -26,7 +26,7 @@ func TestPrivateKey(t *testing.T) { t.Fatal("Failed to generate key", err) } - verifySigner(t, ECDSAPrivateKey{value: gk}) + verifySigner(t, &ECDSAPrivateKey{Value: gk}) } func verifySigner(t *testing.T, guardianSigner ECDSASigner) { diff --git a/node/pkg/p2p/p2p.go b/node/pkg/p2p/p2p.go index fc5b79a6b..efb9cce4c 100644 --- a/node/pkg/p2p/p2p.go +++ b/node/pkg/p2p/p2p.go @@ -66,7 +66,7 @@ func signedObservationRequestDigest(b []byte) common.Hash { return ethcrypto.Keccak256Hash(append(signedObservationRequestPrefix, b...)) } -func Run(obsvC chan *gossipv1.SignedObservation, obsvReqC chan *gossipv1.ObservationRequest, obsvReqSendC chan *gossipv1.ObservationRequest, sendC chan []byte, signedInC chan *gossipv1.SignedVAAWithQuorum, priv crypto.PrivKey, guardianSigner *ecdsasigner.ECDSASigner, gst *node_common.GuardianSetState, port uint, networkID string, bootstrapPeers string, nodeName string, disableHeartbeatVerify bool, rootCtxCancel context.CancelFunc) func(ctx context.Context) error { +func Run(obsvC chan *gossipv1.SignedObservation, obsvReqC chan *gossipv1.ObservationRequest, obsvReqSendC chan *gossipv1.ObservationRequest, sendC chan []byte, signedInC chan *gossipv1.SignedVAAWithQuorum, priv crypto.PrivKey, guardianSigner ecdsasigner.ECDSASigner, gst *node_common.GuardianSetState, port uint, networkID string, bootstrapPeers string, nodeName string, disableHeartbeatVerify bool, rootCtxCancel context.CancelFunc) func(ctx context.Context) error { return func(ctx context.Context) (re error) { logger := supervisor.Logger(ctx) @@ -237,7 +237,7 @@ func Run(obsvC chan *gossipv1.SignedObservation, obsvReqC chan *gossipv1.Observa BootTimestamp: bootTime.UnixNano(), } - ourAddr := ethcrypto.PubkeyToAddress((*guardianSigner).PublicKey()) + ourAddr := ethcrypto.PubkeyToAddress(guardianSigner.PublicKey()) if err := gst.SetHeartbeat(ourAddr, h.ID(), heartbeat); err != nil { panic(err) } @@ -252,7 +252,7 @@ func Run(obsvC chan *gossipv1.SignedObservation, obsvReqC chan *gossipv1.Observa // Sign the heartbeat using our node's guardian key. digest := heartbeatDigest(b) - sig, err := (*guardianSigner).Sign(digest.Bytes()) + sig, err := guardianSigner.Sign(digest.Bytes()) if err != nil { panic(err) } @@ -299,7 +299,7 @@ func Run(obsvC chan *gossipv1.SignedObservation, obsvReqC chan *gossipv1.Observa // Sign the observation request using our node's guardian key. digest := signedObservationRequestDigest(b) - sig, err := (*guardianSigner).Sign(digest.Bytes()) + sig, err := guardianSigner.Sign(digest.Bytes()) if err != nil { panic(err) } @@ -307,7 +307,7 @@ func Run(obsvC chan *gossipv1.SignedObservation, obsvReqC chan *gossipv1.Observa sReq := &gossipv1.SignedObservationRequest{ ObservationRequest: b, Signature: sig, - GuardianAddr: ethcrypto.PubkeyToAddress((*guardianSigner).PublicKey()).Bytes(), + GuardianAddr: ethcrypto.PubkeyToAddress(guardianSigner.PublicKey()).Bytes(), } envelope := &gossipv1.GossipMessage{ diff --git a/node/pkg/processor/broadcast.go b/node/pkg/processor/broadcast.go index 19e17dfac..e7d6c0113 100644 --- a/node/pkg/processor/broadcast.go +++ b/node/pkg/processor/broadcast.go @@ -26,7 +26,7 @@ func (p *Processor) broadcastSignature(v *vaa.VAA, signature []byte, txhash []by digest := v.SigningMsg() obsv := gossipv1.SignedObservation{ - Addr: crypto.PubkeyToAddress((*p.guardianSigner).PublicKey()).Bytes(), + Addr: crypto.PubkeyToAddress(p.guardianSigner.PublicKey()).Bytes(), Hash: digest.Bytes(), Signature: signature, TxHash: txhash, diff --git a/node/pkg/processor/injection.go b/node/pkg/processor/injection.go index 9c7257107..ad6a78e9b 100644 --- a/node/pkg/processor/injection.go +++ b/node/pkg/processor/injection.go @@ -30,7 +30,7 @@ func (p *Processor) handleInjection(ctx context.Context, v *vaa.VAA) { zap.String("digest", hex.EncodeToString(digest.Bytes()))) // Sign the digest using our node's guardian key. - s, err := (*p.guardianSigner).Sign(digest.Bytes()) + s, err := p.guardianSigner.Sign(digest.Bytes()) if err != nil { panic(err) } diff --git a/node/pkg/processor/message.go b/node/pkg/processor/message.go index a2bfb41f4..014238abc 100644 --- a/node/pkg/processor/message.go +++ b/node/pkg/processor/message.go @@ -138,7 +138,7 @@ func (p *Processor) handleMessage(ctx context.Context, k *common.MessagePublicat digest := v.SigningMsg() // Sign the digest using our node's guardian key. - s, err := (*p.guardianSigner).Sign(digest.Bytes()) + s, err := p.guardianSigner.Sign(digest.Bytes()) if err != nil { panic(err) } diff --git a/node/pkg/processor/processor.go b/node/pkg/processor/processor.go index c888ad598..eb18e68e8 100644 --- a/node/pkg/processor/processor.go +++ b/node/pkg/processor/processor.go @@ -68,7 +68,7 @@ type Processor struct { injectC chan *vaa.VAA // Node's guardian signer - guardianSigner *ecdsasigner.ECDSASigner + guardianSigner ecdsasigner.ECDSASigner // devnetMode specified whether to submit transactions to the hardcoded Ethereum devnet devnetMode bool @@ -108,7 +108,7 @@ func NewProcessor( obsvC chan *gossipv1.SignedObservation, injectC chan *vaa.VAA, signedInC chan *gossipv1.SignedVAAWithQuorum, - guardianSigner *ecdsasigner.ECDSASigner, + guardianSigner ecdsasigner.ECDSASigner, gst *common.GuardianSetState, devnetMode bool, devnetNumGuardians uint, @@ -137,7 +137,7 @@ func NewProcessor( logger: supervisor.Logger(ctx), state: &aggregationState{vaaMap{}}, - ourAddr: crypto.PubkeyToAddress((*guardianSigner).PublicKey()), + ourAddr: crypto.PubkeyToAddress(guardianSigner.PublicKey()), } } From 3943f9dde5bb3067a22f5888e7d17c3a5d20428c Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Wed, 26 Oct 2022 10:16:20 +0200 Subject: [PATCH 06/13] Tidy the go modules --- node/go.mod | 13 +------------ node/go.sum | 26 -------------------------- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/node/go.mod b/node/go.mod index 7503f2952..88eec94c9 100644 --- a/node/go.mod +++ b/node/go.mod @@ -49,6 +49,7 @@ require ( ) require ( + cloud.google.com/go/kms v1.0.0 cloud.google.com/go/logging v1.4.2 cloud.google.com/go/pubsub v1.17.1 github.com/alephium/go-sdk v0.0.0-20220919082855-4fb3b6e48fc7 @@ -56,7 +57,6 @@ require ( github.com/blendle/zapdriver v1.3.1 github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce github.com/cosmos/cosmos-sdk v0.44.5 - github.com/go-delve/delve v1.9.1 github.com/go-test/deep v1.0.8 github.com/google/uuid v1.3.0 github.com/libp2p/go-libp2p-core v0.20.0 @@ -83,23 +83,19 @@ require ( github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/cheekybits/genny v1.0.0 // indirect - github.com/cilium/ebpf v0.7.0 // indirect github.com/confio/ics23/go v0.6.6 // indirect github.com/containerd/cgroups v1.0.4 // indirect github.com/coreos/go-systemd/v22 v22.3.2 // indirect - github.com/cosiner/argv v0.1.0 // indirect github.com/cosmos/btcutil v1.0.4 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/iavl v0.17.3 // indirect github.com/cosmos/ibc-go v1.1.3 // indirect github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect github.com/cosmos/ledger-go v0.9.2 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/danieljoos/wincred v1.0.2 // indirect github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect - github.com/derekparker/trie v0.0.0-20200317170641-1fdf38b7b0e9 // indirect github.com/dfuse-io/binary v0.0.0-20210216024852-4ae6830a495d // indirect github.com/dfuse-io/logging v0.0.0-20210109005628-b97a57253f70 // indirect github.com/dgraph-io/badger/v2 v2.2007.2 // indirect @@ -116,7 +112,6 @@ require ( github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect github.com/gin-gonic/gin v1.7.7 // indirect - github.com/go-delve/liner v1.2.3-0.20220127212407-d32d89dd2a5d // indirect github.com/go-kit/kit v0.10.0 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-ole/go-ole v1.2.5 // indirect @@ -134,7 +129,6 @@ require ( github.com/google/btree v1.0.1 // indirect github.com/google/flatbuffers v1.12.0 // indirect github.com/google/go-cmp v0.5.8 // indirect - github.com/google/go-dap v0.6.0 // indirect github.com/google/go-querystring v1.0.0 // indirect github.com/google/gopacket v1.1.19 // indirect github.com/googleapis/gax-go/v2 v2.1.1 // indirect @@ -240,11 +234,8 @@ require ( github.com/rjeczalik/notify v0.9.1 // indirect github.com/rogpeppe/go-internal v1.8.0 // indirect github.com/rs/cors v1.7.0 // indirect - github.com/russross/blackfriday/v2 v2.0.1 // indirect github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect - github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect - github.com/sirupsen/logrus v1.8.1 // indirect github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/afero v1.6.0 // indirect @@ -270,11 +261,9 @@ require ( github.com/zondax/hid v0.9.0 // indirect go.etcd.io/bbolt v1.3.5 // indirect go.opencensus.io v0.23.0 // indirect - go.starlark.net v0.0.0-20220816155156-cfacd8902214 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect go.uber.org/ratelimit v0.2.0 // indirect - golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4 // indirect golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect golang.org/x/net v0.0.0-20220812174116-3211cb980234 // indirect golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect diff --git a/node/go.sum b/node/go.sum index fc95d9752..626fd0887 100644 --- a/node/go.sum +++ b/node/go.sum @@ -253,8 +253,6 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.7.0 h1:1k/q3ATgxSXRdrmPfH8d7YK0GfqVsEKZAX9dQZvs56k= -github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= @@ -300,8 +298,6 @@ github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzA github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cosiner/argv v0.1.0 h1:BVDiEL32lwHukgJKP87btEPenzrrHUjajs/8yzaqcXg= -github.com/cosiner/argv v0.1.0/go.mod h1:EusR6TucWKX+zFgtdUsKT2Cvg45K5rtpCcWz4hK06d8= github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= github.com/cosmos/cosmos-sdk v0.44.3/go.mod h1:bA3+VenaR/l/vDiYzaiwbWvRPWHMBX2jG0ygiFtiBp0= @@ -325,10 +321,8 @@ github.com/cosmos/ledger-go v0.9.2/go.mod h1:oZJ2hHAZROdlHiwTg4t7kP+GKIIkBT+o6c9 github.com/cpuguy83/go-md2man v1.0.8/go.mod h1:N6JayAiVKtlHSnuTCeuLSQVs75hb8q+dYQLjr7cDsKY= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cucumber/godog v0.8.1/go.mod h1:vSh3r/lM+psC1BPXvdkSEuNjmXfpVqrMGYAElF6hxnA= github.com/cyberdelia/templates v0.0.0-20191230040416-20a325f050d4/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= @@ -351,8 +345,6 @@ github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/derekparker/trie v0.0.0-20200317170641-1fdf38b7b0e9 h1:G765iDCq7bP5opdrPkXk+4V3yfkgV9iGFuheWZ/X/zY= -github.com/derekparker/trie v0.0.0-20200317170641-1fdf38b7b0e9/go.mod h1:D6ICZm05D9VN1n/8iOtBxLpXtoGp6HDFUJ1RNVieOSE= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dfuse-io/binary v0.0.0-20210216024852-4ae6830a495d h1:EvEAQZ38olo+sALrqqCo345IeB2HH4im1deNOcjbi0s= @@ -440,7 +432,6 @@ github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJn github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -462,10 +453,6 @@ github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aev github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-chi/chi v4.1.1+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= -github.com/go-delve/delve v1.9.1 h1:HBvHO5anAntm2ORXKQJqH7R8bezmCuPO+Tf2SJZ2Ojw= -github.com/go-delve/delve v1.9.1/go.mod h1:CET1wODsRJ2vlNepWyFEatwXRJ8rnrbgqaf1d4+Hgi4= -github.com/go-delve/liner v1.2.3-0.20220127212407-d32d89dd2a5d h1:pxjSLshkZJGLVm0wv20f/H0oTWiq/egkoJQ2ja6LEvo= -github.com/go-delve/liner v1.2.3-0.20220127212407-d32d89dd2a5d/go.mod h1:biJCRbqp51wS+I92HMqn5H8/A0PAhxn2vyOT+JqhiGI= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -590,8 +577,6 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-dap v0.6.0 h1:Y1RHGUtv3R8y6sXq2dtGRMYrFB2hSqyFVws7jucrzX4= -github.com/google/go-dap v0.6.0/go.mod h1:5q8aYQFnHOAZEMP+6vmq25HKYAEwE+LF5yh7JKrrhSQ= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= @@ -1279,7 +1264,6 @@ github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.23.0 h1:UskrK+saS9P9Y789yNNulYKdARjPZuS35B8gJF2x60g= github.com/rs/zerolog v1.23.0/go.mod h1:6c7hFfxPOy7TacJc4Fcdi24/J0NKYGzjG8FWRI916Qo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= @@ -1316,7 +1300,6 @@ github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122/go.mod h1:b github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ= github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk= github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= @@ -1325,7 +1308,6 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -1351,7 +1333,6 @@ github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3 github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -1513,8 +1494,6 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.starlark.net v0.0.0-20220816155156-cfacd8902214 h1:MqijAN3S61c7KWasOk+zIqIjHQPN6WUra/X3+YAkQxQ= -go.starlark.net v0.0.0-20220816155156-cfacd8902214/go.mod h1:VZcBMdr3cT3PnBoWunTabuSEXwVAH+ZJ5zxfs3AdASk= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1545,8 +1524,6 @@ go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= go.uber.org/zap v1.22.0 h1:Zcye5DUgBloQ9BaT4qc9BnjOFog5TvBSAGkJ3Nf70c0= go.uber.org/zap v1.22.0/go.mod h1:H4siCOZOrAolnUPJEkfaSjDqyP+BDS0DdDWzwcgt3+U= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= -golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4 h1:QlVATYS7JBoZMVaf+cNjb90WD/beKVHnIxFKT4QaHVI= -golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1844,12 +1821,10 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1954,7 +1929,6 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From a7c6851d509f254c05bfdcecd7a7394d398de0a3 Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Sat, 29 Oct 2022 11:45:09 +0200 Subject: [PATCH 07/13] Use random bytes to test signature recovery --- clients/js/vaa.ts | 2 +- node/pkg/ecdsasigner/cloudkms.go | 2 +- node/pkg/ecdsasigner/ecdsasigner_test.go | 29 ++++++++++++++++++++++-- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/clients/js/vaa.ts b/clients/js/vaa.ts index e4028bc6b..46a590bdf 100644 --- a/clients/js/vaa.ts +++ b/clients/js/vaa.ts @@ -262,7 +262,7 @@ function calculateV(signature: Uint8Array, hash: Buffer, uncompressPubKey: Buffe const { ecdsaRecover } = require("secp256k1"); let recId = -1; - for (let i = 0; i < 4; i++) { + for (let i = 0; i < 2; i++) { const rec = ecdsaRecover(signature, i, hash, false); if (Buffer.compare(rec, uncompressPubKey) == 0) { recId = i; diff --git a/node/pkg/ecdsasigner/cloudkms.go b/node/pkg/ecdsasigner/cloudkms.go index 622e71500..5546fefd9 100644 --- a/node/pkg/ecdsasigner/cloudkms.go +++ b/node/pkg/ecdsasigner/cloudkms.go @@ -147,7 +147,7 @@ func parseSignature(kmsSignature []byte, digest []byte, pubKey ethcommon.Address } func appendV(sig []byte, digest []byte, pubKey ethcommon.Address) ([]byte, error) { - for i := 0; i < 4; i++ { + for i := 0; i < 2; i++ { sigWithV := append(sig, byte(i)) pk, err := ethcrypto.Ecrecover(digest, sigWithV) signer_pk := ethcommon.BytesToAddress(ethcrypto.Keccak256(pk[1:])[12:]) diff --git a/node/pkg/ecdsasigner/ecdsasigner_test.go b/node/pkg/ecdsasigner/ecdsasigner_test.go index 0cc66efdb..6a1b36ee7 100644 --- a/node/pkg/ecdsasigner/ecdsasigner_test.go +++ b/node/pkg/ecdsasigner/ecdsasigner_test.go @@ -2,8 +2,11 @@ package ecdsasigner import ( "context" + "math/big" "testing" + "crypto/rand" + ethcommon "github.com/ethereum/go-ethereum/common" ethcrypto "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/assert" @@ -26,11 +29,18 @@ func TestPrivateKey(t *testing.T) { t.Fatal("Failed to generate key", err) } - verifySigner(t, &ECDSAPrivateKey{Value: gk}) + for i := 0; i < 100; i++ { + verifySigner(t, &ECDSAPrivateKey{Value: gk}) + } } func verifySigner(t *testing.T, guardianSigner ECDSASigner) { - digest := ethcrypto.Keccak256Hash([]byte("Hello")) + bytes, err := randomBytes(1000000) + if err != nil { + t.Fatal(err) + } + + digest := ethcrypto.Keccak256Hash(bytes) sig, err := guardianSigner.Sign(digest.Bytes()) if err != nil { t.Fatal(err) @@ -45,3 +55,18 @@ func verifySigner(t *testing.T, guardianSigner ECDSASigner) { guardianAddr := ethcrypto.PubkeyToAddress(guardianSigner.PublicKey()) assert.Equal(t, signerAddr, guardianAddr, "Signer address should match guardian address") } + +func randomBytes(maxLength int64) ([]byte, error) { + randomInt, err := rand.Int(rand.Reader, big.NewInt(maxLength)) + if err != nil { + return nil, err + } + + bytes := make([]byte, randomInt.Int64()) + _, err = rand.Read(bytes) + if err != nil { + return nil, err + } + + return bytes, nil +} From 097b466920bac4aa7be0b017e88cfbe6fc7ca119 Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Sun, 30 Oct 2022 21:58:43 +0100 Subject: [PATCH 08/13] Use fixtures to test KMS signing & public key --- node/pkg/ecdsasigner/cloudkms.go | 14 +- node/pkg/ecdsasigner/cloudkms_test.go | 51 ++++++++ node/pkg/ecdsasigner/ecdsaprivatekey_test.go | 48 +++++++ node/pkg/ecdsasigner/ecdsasigner_test.go | 71 ++-------- .../cloudkms_digest_signature_fixture.json | 122 ++++++++++++++++++ 5 files changed, 245 insertions(+), 61 deletions(-) create mode 100644 node/pkg/ecdsasigner/cloudkms_test.go create mode 100644 node/pkg/ecdsasigner/ecdsaprivatekey_test.go create mode 100644 node/pkg/ecdsasigner/fixture/cloudkms_digest_signature_fixture.json diff --git a/node/pkg/ecdsasigner/cloudkms.go b/node/pkg/ecdsasigner/cloudkms.go index 5546fefd9..ce66d3fe8 100644 --- a/node/pkg/ecdsasigner/cloudkms.go +++ b/node/pkg/ecdsasigner/cloudkms.go @@ -60,14 +60,14 @@ func (c *KMSClient) Sign(digest []byte) ([]byte, error) { return nil, fmt.Errorf("Failed to sign with KMS: %w", err) } - pubKey := ethcrypto.PubkeyToAddress(*c.publicKey) + address := ethcrypto.PubkeyToAddress(*c.publicKey) - sig, err := parseSignature(signResult.Signature, digest, pubKey) + signature, err := parseSignature(signResult.Signature, digest, address) if err != nil { return nil, fmt.Errorf("Failed to parse KMS signature: %w", err) } - return sig, nil + return signature, nil } func (c *KMSClient) PublicKey() ecdsa.PublicKey { @@ -87,7 +87,13 @@ func getKMSPublicKey( return nil, fmt.Errorf("Failed to fetch public key from the KMS API: %v", err) } - pemBlock, rest := pem.Decode([]byte(kmsPublicKey.Pem)) + return convertToECDSAPublicKey(kmsPublicKey.Pem) +} + +func convertToECDSAPublicKey( + kmsPublicKeyPem string, +) (*ecdsa.PublicKey, error) { + pemBlock, rest := pem.Decode([]byte(kmsPublicKeyPem)) if len(rest) > 0 { return nil, fmt.Errorf("PEM block contains more than just public key") } diff --git a/node/pkg/ecdsasigner/cloudkms_test.go b/node/pkg/ecdsasigner/cloudkms_test.go new file mode 100644 index 000000000..013638086 --- /dev/null +++ b/node/pkg/ecdsasigner/cloudkms_test.go @@ -0,0 +1,51 @@ +package ecdsasigner + +import ( + "encoding/base64" + "encoding/json" + "os" + "testing" + + ethcrypto "github.com/ethereum/go-ethereum/crypto" +) + +type CloudKMSDigestSignature struct { + Digest string `json:"digest"` + Signature string `json:"signature"` +} + +func TestCloudKMS(t *testing.T) { + // Public key in PEM format returned from the Google KMS API + cloudKMSPublicKey := `-----BEGIN PUBLIC KEY----- +MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEvM64WybBvE80lglbeucaazgkOqM7C4+f +lT9nxEZvjfrPc6rrIm8MIaCSV2VlIp49i5uE6N4+GNlrt3lrWOFHkw== +-----END PUBLIC KEY-----` + ecdsaPublicKey, err := convertToECDSAPublicKey(cloudKMSPublicKey) + if err != nil { + t.Fatal("Failed to convert Cloud KMS public key to ECDSA public key", err) + } + cloudKMSAddress := ethcrypto.PubkeyToAddress(*ecdsaPublicKey) + + fixtureBytes, err := os.ReadFile("./fixture/cloudkms_digest_signature_fixture.json") + if err != nil { + t.Fatal("Failed to read fixture", err) + } + var cloudKMSDigestSignatures []CloudKMSDigestSignature + if err = json.Unmarshal(fixtureBytes, &cloudKMSDigestSignatures); err != nil { + t.Fatal("Failed to parse fixture", err) + } + + for _, cloudKMSDigestSignature := range cloudKMSDigestSignatures { + cloudKMSSignature, err := base64.StdEncoding.DecodeString(cloudKMSDigestSignature.Signature) + if err != nil { + t.Fatal("Failed to decode cloud KMS signature", err) + } + digest, err := base64.StdEncoding.DecodeString(cloudKMSDigestSignature.Digest) + if err != nil { + t.Fatal("Failed to decode digest", err) + } + + signature, err := parseSignature(cloudKMSSignature, digest, cloudKMSAddress) + verifySignature(t, digest, signature, cloudKMSAddress) + } +} diff --git a/node/pkg/ecdsasigner/ecdsaprivatekey_test.go b/node/pkg/ecdsasigner/ecdsaprivatekey_test.go new file mode 100644 index 000000000..a08a31736 --- /dev/null +++ b/node/pkg/ecdsasigner/ecdsaprivatekey_test.go @@ -0,0 +1,48 @@ +package ecdsasigner + +import ( + "math/big" + "testing" + + "crypto/rand" + ethcrypto "github.com/ethereum/go-ethereum/crypto" +) + +func TestPrivateKey(t *testing.T) { + gk, err := ethcrypto.GenerateKey() + if err != nil { + t.Fatal("Failed to generate key", err) + } + + signer := ECDSAPrivateKey{Value: gk} + address := ethcrypto.PubkeyToAddress(signer.PublicKey()) + + for i := 0; i < 100; i++ { + random, err := randomBytes(1000000) + if err != nil { + t.Fatal(err) + } + digest := ethcrypto.Keccak256Hash(random) + + signature, err := signer.Sign(digest.Bytes()) + if err != nil { + t.Fatal(err) + } + verifySignature(t, digest.Bytes(), signature, address) + } +} + +func randomBytes(maxLength int64) ([]byte, error) { + randomInt, err := rand.Int(rand.Reader, big.NewInt(maxLength)) + if err != nil { + return nil, err + } + + bytes := make([]byte, randomInt.Int64()) + _, err = rand.Read(bytes) + if err != nil { + return nil, err + } + + return bytes, nil +} diff --git a/node/pkg/ecdsasigner/ecdsasigner_test.go b/node/pkg/ecdsasigner/ecdsasigner_test.go index 6a1b36ee7..b4705154b 100644 --- a/node/pkg/ecdsasigner/ecdsasigner_test.go +++ b/node/pkg/ecdsasigner/ecdsasigner_test.go @@ -1,72 +1,29 @@ package ecdsasigner import ( - "context" - "math/big" "testing" - "crypto/rand" - ethcommon "github.com/ethereum/go-ethereum/common" ethcrypto "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/assert" ) -func TestKMS(t *testing.T) { - cloudKMSKeyName := "TODO" - bCtx := context.Background() - kmsClient, err := NewKMSClient(bCtx, cloudKMSKeyName) - if err != nil { - t.Fatalf("failed to setup KMS client: %v", err) - } - defer kmsClient.Client.Close() - verifySigner(t, kmsClient) -} - -func TestPrivateKey(t *testing.T) { - gk, err := ethcrypto.GenerateKey() - if err != nil { - t.Fatal("Failed to generate key", err) - } - - for i := 0; i < 100; i++ { - verifySigner(t, &ECDSAPrivateKey{Value: gk}) - } -} - -func verifySigner(t *testing.T, guardianSigner ECDSASigner) { - bytes, err := randomBytes(1000000) +func verifySignature( + t *testing.T, + digest []byte, + signature []byte, + expectedSignerAddress ethcommon.Address, +) { + signerPublicKey, err := ethcrypto.Ecrecover(digest, signature) if err != nil { t.Fatal(err) } - digest := ethcrypto.Keccak256Hash(bytes) - sig, err := guardianSigner.Sign(digest.Bytes()) - if err != nil { - t.Fatal(err) - } - - pk, err := ethcrypto.Ecrecover(digest.Bytes(), sig) - if err != nil { - t.Fatal(err) - } - - signerAddr := ethcommon.BytesToAddress(ethcrypto.Keccak256(pk[1:])[12:]) - guardianAddr := ethcrypto.PubkeyToAddress(guardianSigner.PublicKey()) - assert.Equal(t, signerAddr, guardianAddr, "Signer address should match guardian address") -} - -func randomBytes(maxLength int64) ([]byte, error) { - randomInt, err := rand.Int(rand.Reader, big.NewInt(maxLength)) - if err != nil { - return nil, err - } - - bytes := make([]byte, randomInt.Int64()) - _, err = rand.Read(bytes) - if err != nil { - return nil, err - } - - return bytes, nil + signerAddress := ethcommon.BytesToAddress(ethcrypto.Keccak256(signerPublicKey[1:])[12:]) + assert.Equal( + t, + signerAddress, + expectedSignerAddress, + "Recovered signer address doesn't match the expected signer address", + ) } diff --git a/node/pkg/ecdsasigner/fixture/cloudkms_digest_signature_fixture.json b/node/pkg/ecdsasigner/fixture/cloudkms_digest_signature_fixture.json new file mode 100644 index 000000000..2094c3735 --- /dev/null +++ b/node/pkg/ecdsasigner/fixture/cloudkms_digest_signature_fixture.json @@ -0,0 +1,122 @@ +[ + { + "signature": "MEQCIG+agL1SRIPFfq1N66LCnPfkFZlseM62EPnC9/bj4dixAiBnldpFC4nbCik/WDO7BqIVv6uQYJGNd51B8X5VJdZ95g==", + "digest": "7m/dB7MfbXTBl4RVkuw+xWtqoGjghwUd9ReLEABUjHA=" + }, + { + "signature": "MEUCIQDq6wA+aBn9opb/BNlPHF7zazrky5Eys9EnuYp69vG6lQIgCbOC7f0kR1eyysW6T3d6XVwI+38whx2Q6Ps+nsLL2H4=", + "digest": "uiQ3DmITRLe1siZSd63j71NhRN8HKDY0eAisNY/cXgw=" + }, + { + "signature": "MEQCIApWm6WvGiuGBmeVLjPWJItSh2bgT1QEJ1QmjJT8a9xyAiBLGksgdOZ+n5vJuCMd3yYRyH9UF0cNf25tpOt2y7yZMA==", + "digest": "52WvqOmm44lHbJdKV5mgIu7paCOe8B67cMiK1Aq90Xs=" + }, + { + "signature": "MEQCIHVknVSv2o6CquDr+2L2+Z1T2E0lmqvZn13JGp/LWgMaAiBBf/DFa+I3kFiU4Lb6Od68CPaCzRVszDEPnPvqMIqFGA==", + "digest": "A+qXZVjSd5CN8FTFTa3xt8IORmN1Y4ep1eCyGQ9tLh0=" + }, + { + "signature": "MEQCIHWWqqKEWheVmhKBEVz6ITAsGbeDhOkqg1gqFWWoBeZJAiBCZqlYCD2inZJcnegliAPUN5CzKRPDk25FeV2uidFzrw==", + "digest": "AlxbZ2P/EAOO8uT7Kw0Y6+Y4Aq4TO1eBmTb7PPu5+Pg=" + }, + { + "signature": "MEQCIDYBw7DPR1EqaczcWYKkOrqNv2fMFBg7FHw21vIxBHm5AiBOhCTAuC+6tQfj71cSGU4wf2N+7Qb18PdQM49HZ5m7uQ==", + "digest": "xXbe5NjcmTdZ8DmZdk6bxnjvHfAaBOw9Lrm67fozmhE=" + }, + { + "signature": "MEUCIQD8PvhOyPGGvn6rYftRStYlqBgrAA8aqtK/ZyiWznaRtwIgJqFppjsEXtKB36VOMMhYMVbREnNMI+vLcAnBfTLHHiA=", + "digest": "a7hTkoY8Ipqkilcch4JRKLjaoX4S5GAuzTCr1U2SUSM=" + }, + { + "signature": "MEUCIQCKeU1LV6bEpbALb0gbYIRNUCSEYm60UUg79WqbVmIoqwIgVl42J/erCBbNhmw2B6USMoJLkZSREmktkmVcVwz9uH8=", + "digest": "DmpJRXhcXUERjiYmuk0SRNX3O5l+bnASNeZIoWQk9QM=" + }, + { + "signature": "MEUCIQDH+ifQHNft/4a+ragf22XVSOTLt6pqLueZV/bdV1AnEwIgevr2h32bpUU66yHKAyDV/SOMtmGUCfmhOA1kn+vwglk=", + "digest": "4aZ4J1qjuNneZjRrX3wSJoPRDAMkrnlG2cTqFNbuUSA=" + }, + { + "signature": "MEQCIGmGE9+Gd5DW605jZOzlfcgAbSoNElWH4iWj0TH4qNtmAiB0OAnOp5y3GjAXO96b4r+l7OJo9d/oO7QsmouCgCM+4A==", + "digest": "ZrJVA6vY4ew3NiRSXao3qrfGf3wKApqXci6wx9AQ/44=" + }, + { + "signature": "MEQCIAnZPsqLuuQTyWDBFkDlFBIiA3NzfA0Azb3vg7n38DpFAiBalsVpUpS92Jc50Gylob+Ahn3KpkOVEZU618JNsLzDRw==", + "digest": "szZ/6U32BVkbwZ/KwQa2xfWN5ciHc8IO3dyQBd54hKA=" + }, + { + "signature": "MEUCIQCWg15lEqJuwNdAYBHKQf80Gp9f2Mot5Ap2b5wzyflTHAIgdFVPB2ON1Jfw0fJYeKtLELt22iyXVrALAi8l2/HCAsU=", + "digest": "C9FTLKWhahnJYmkUM9u7RlAu84g+AWaDVfH7IXo21zo=" + }, + { + "signature": "MEQCICE/ZH+A9ZZFUUM5taU7Jpv2peebraGpjIg07FHWhecdAiAer7QUqc9v1znlo0ERswrQVN5+t/ZQst4FaMj3KoiOxA==", + "digest": "ZoNNG145CbXwRiAUQ1Ju4pCC8/Oq/FUAPeCw/z7Nw4s=" + }, + { + "signature": "MEQCIHEYLZ0KqA6I4cyhHmvwGwLlV9gbvQ6vGOgtosHd3QNbAiAF9tUuyblp85dHtoD8uBsbtt9XHhmPizqH9p66VTzv9A==", + "digest": "+FvdcXbKDmimMFP+beoVRO25mmF2V9HSsCsd4L02cJE=" + }, + { + "signature": "MEUCIQCM/oF8362MoXoV3fnCCNCriunY4ne9JmhlyYr4GW4tiQIgDTxUVMcV8JwcNRBSZij0VEkevZ0iNGkJZx8pM5nspa8=", + "digest": "8KaHPPIIt8Gqu5v5v9vPqOHwOvaf25iZJPVp/f9ZtL8=" + }, + { + "signature": "MEUCIQDNQ4obkdMc5rPiNxlimZqoiwMYw89MRwHE/5+efzGyBAIgKuN5/Vb+ezVNc2Mn/n+BdKqiM7U0HKM/r9/sxULEkE4=", + "digest": "K8f5N927vh7/NBSP0qMr/9HMQV3v//tqEUa/6/rJ5Yw=" + }, + { + "signature": "MEUCIQDlYMqSVCfobeS0BvopGcp8QeOJTXTlqaP/OHrhv/lOFwIgLD9yic0cQLKKfFhf/1FRlu2hn5rkaJwABTqNKrcsdh0=", + "digest": "1zv+w9jpwaP4npzMTs1ipGHpGoFGAmidALiqkNOgmBI=" + }, + { + "signature": "MEQCIAGIPFqQQZKtufGL+SJb89H7yPPRlwPbxaO0Rvgejm6ZAiAobB0eLj31BVc0+Z6cWy+BcxDlmgdl0a/vf0fsFtCVLQ==", + "digest": "LNPenTPJvBD3sdWMSx1Z0Xf6tzfHgPYckmzScRMfnD4=" + }, + { + "signature": "MEUCIQC9OePqHMYjeHnIVIkBG/Z/q9KVkzijRHivJUH4OtIOwwIgXFC/ek/+ltxDjmrJSumVxueWUpmqdr/60hrFaLX5MWY=", + "digest": "X1aq0V685bGdMH53tRTPuxoTCC/owtdYEhDxvjjVEUs=" + }, + { + "signature": "MEUCIQCRLtSkAsEq95tNPEJPCIGxbAUODfsqdy27URyEtkkAzwIgNKDw8CHW6QAS/pjg1UOxOxS/U2hPB6tkyEhPgHxPerk=", + "digest": "/ZZuqf0mQDWtaKigpBIdxYoSvur+D/wkCnm1esNnLXQ=" + }, + { + "signature": "MEQCIAclSYfPqGv6HvXUQHcTEjnhNthPMGE0t5+sRMsqMHJDAiBdjIZ6dfVfIvesknhAeyURX/fVgNyTwi4AqphJWNPYxQ==", + "digest": "yGl1i6pYMZoY4fKbsd1gaXkvGVH5ojSaRo4R4WR7q9A=" + }, + { + "signature": "MEUCIQD68n9HJr1kOykfjbg6mNHjX8gwDpAS6fwBMZ3YPs1kLAIgILLMZP48pl3rS5jZpj9NKTNBCTVAs+vkoXHkOsQEyT8=", + "digest": "dmkk37HeI6SdI7v2O1VeNpQ4idZiZeEi6hNVMq6sk50=" + }, + { + "signature": "MEQCIFgpLvotVSPVP2GM+h96vaTlC9lm1QYQeXrWZvk7W1AtAiAakUst88xWBxgwtjyi7R+yplRvLRVVs3Y+/8TtidEzHg==", + "digest": "OnoJWJUazZQMq2gNeTzTBMhGN+bTDe0eg75Fbg+kcdU=" + }, + { + "signature": "MEQCIB/gN8Jm79+O9F+sSJgBYqVNPbhf65k1vrgTfL5PvimLAiA84mOmKs8bz0kirOQImX4OYwvFHtIM18s/vRjAGrbOVw==", + "digest": "FtlwJJaQvsZPvDhOh/ye+YGPHkTysgvP/SKfnP2iCLs=" + }, + { + "signature": "MEUCIQCddHfXrPQjlCdnaPBIYvpl7XtVPEl12sa51JTUIxVb8AIgEUVkiUXBohbNzvgUy8GiDmeP0MucmuVyamf/K6xb/vc=", + "digest": "3l/jE4pY8ZESvdDW/5pe/3WJz9sllTX69S3VuUwsxlQ=" + }, + { + "signature": "MEQCIGu9j4yjpXF9vpsFWXRopGrXncaFazoudmiybSns7nyRAiAzf92b3eC8qgqcVGNNizGd3qubGgTnQdyQHhWdq35xRg==", + "digest": "vkf9INsf9zr+d+n88eHoFdyurlKT2sUMsqT/AYtJ2E4=" + }, + { + "signature": "MEQCIA/QJLatCMTwuvH1rGZ0ean1ukvNpWAbuB0fPlQMBq0DAiAt5kiz+fYGOtz99kPgUS4J3XgXmE4OtiZsfwgDh7KP/w==", + "digest": "NVgPcOovWYqFXb1cNDWA4Ri2Yxvp8BV1s6HpvEJm8hM=" + }, + { + "signature": "MEQCIHflFjJNUFA6+pjg0eEOQ9S5oOGf8wzi64MFPas7yNjeAiAlEGWmHZGBa3dMyg1VCadm3w/M8cEZGoycNE1aEuiu9w==", + "digest": "TScv/cZZ0Sw81DXjKNg3m1FqvcHRijeQT12C2HpfuS8=" + }, + { + "signature": "MEQCIGL29z6RQn8PmQaueq/k+NyyD1k9hfnvEVN6hOQeU+cDAiBld3wGu2dLu3HS9/cw4nw6yTvN5Asle23wcMgKKXpg7g==", + "digest": "SqQVFpNTenYEM0wAtbYVxtPBugXlbWHty3LgRdhK1MU=" + }, + { + "signature": "MEUCIQCWMgntxIm4thF7OM/Fo5Mn7czAcGSGCKm2sTsnZd+tbgIgG1a9P4U/6t+9rn6sw4BgzGQdaLK1bMxbcdazv0l69Xs=", + "digest": "sGmURc2CG40ZJpuqHA373v8uoxnrPSwjTmJYOlJ5FMc=" + } +] \ No newline at end of file From 94f7edfde8b28353270ff22c91650f47e26febb3 Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Sun, 30 Oct 2022 22:51:48 +0100 Subject: [PATCH 09/13] Verify checksum for KMS signing during request & response --- node/pkg/ecdsasigner/cloudkms.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/node/pkg/ecdsasigner/cloudkms.go b/node/pkg/ecdsasigner/cloudkms.go index ce66d3fe8..195dfbfb3 100644 --- a/node/pkg/ecdsasigner/cloudkms.go +++ b/node/pkg/ecdsasigner/cloudkms.go @@ -4,6 +4,7 @@ import ( "context" "crypto/ecdsa" "fmt" + "hash/crc32" "math/big" "crypto/x509/pkix" @@ -15,6 +16,7 @@ import ( ethcrypto "github.com/ethereum/go-ethereum/crypto" "google.golang.org/api/option" kmspb "google.golang.org/genproto/googleapis/cloud/kms/v1" + "google.golang.org/protobuf/types/known/wrapperspb" ) // Client is a client for interacting with the Google Cloud KMS API @@ -53,13 +55,22 @@ func (c *KMSClient) Sign(digest []byte) ([]byte, error) { Sha256: digest, }, }, + DigestCrc32C: crc32Checksum(digest), } signResult, err := c.Client.AsymmetricSign(c.ctx, req) + if err != nil { return nil, fmt.Errorf("Failed to sign with KMS: %w", err) } + if !signResult.VerifiedDigestCrc32C { + return nil, fmt.Errorf("KMS signing request corrupted in-transit") + } + if signResult.SignatureCrc32C.Value != crc32Checksum(signResult.Signature).Value { + return nil, fmt.Errorf("KMS singing response corrupted in-transit") + } + address := ethcrypto.PubkeyToAddress(*c.publicKey) signature, err := parseSignature(signResult.Signature, digest, address) @@ -75,6 +86,14 @@ func (c *KMSClient) PublicKey() ecdsa.PublicKey { } // Private Functions +func crc32Checksum(data []byte) *wrapperspb.Int64Value { + // compute CRC32 + table := crc32.MakeTable(crc32.Castagnoli) + checksum := crc32.Checksum(data, table) + val := wrapperspb.Int64(int64(checksum)) + return val +} + func getKMSPublicKey( ctx context.Context, keyId string, From d0706cf5dee3fab61296d5c2f385686ff83a2e2f Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Mon, 31 Oct 2022 00:25:10 +0100 Subject: [PATCH 10/13] Trim leading byte zero for r and s in signature --- clients/js/main.ts | 10 ++++++++-- clients/js/vaa.ts | 2 +- node/pkg/ecdsasigner/cloudkms.go | 12 +++++++++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/clients/js/main.ts b/clients/js/main.ts index 6d369cb84..8202c4659 100644 --- a/clients/js/main.ts +++ b/clients/js/main.ts @@ -77,6 +77,12 @@ yargs(hideBin(process.argv)) describe: "VAA sequence", type: "string", }) + .option("use-kms", { + alias: "k", + required: false, + describe: "If KMS should be used", + type: "boolean", + }) // Registration .command( "registration", @@ -130,7 +136,7 @@ yargs(hideBin(process.argv)) argv["guardian-secret"].split(","), argv["sequence"], payload, - true + !!argv["use-kms"] ).then((v) => console.log(serialiseVAA(v)) ); @@ -184,7 +190,7 @@ yargs(hideBin(process.argv)) argv["guardian-secret"].split(","), argv["sequence"], payload, - true + !!argv["use-kms"] ).then((v) => { console.log(serialiseVAA(v)); }); diff --git a/clients/js/vaa.ts b/clients/js/vaa.ts index 46a590bdf..6b185e2d1 100644 --- a/clients/js/vaa.ts +++ b/clients/js/vaa.ts @@ -213,7 +213,7 @@ export function signWithKey(signers: string[], vaa: VAA): Signature[] { } const kmsClient = new KeyManagementServiceClient({ - keyFile: "/tmp/credentials-file.json" + keyFile: process.env.GUARDIAN_CREDENTIALS_FILE }) export async function signWithKMS(signers: string[], vaa: VAA): Promise { diff --git a/node/pkg/ecdsasigner/cloudkms.go b/node/pkg/ecdsasigner/cloudkms.go index 195dfbfb3..2836900ff 100644 --- a/node/pkg/ecdsasigner/cloudkms.go +++ b/node/pkg/ecdsasigner/cloudkms.go @@ -162,9 +162,8 @@ func parseSignature(kmsSignature []byte, digest []byte, pubKey ethcommon.Address curveOrderLen := 32 signature := make([]byte, 2*curveOrderLen) - // left pad R and S with zeroes - rBytes := parsedSig.R.Bytes() - sBytes := parsedSig.S.Bytes() + rBytes := trimLeftByte(parsedSig.R.Bytes(), byte(0)) + sBytes := trimLeftByte(parsedSig.S.Bytes(), byte(0)) copy(signature[curveOrderLen-len(rBytes):], rBytes) copy(signature[len(signature)-len(sBytes):], sBytes) @@ -187,3 +186,10 @@ func appendV(sig []byte, digest []byte, pubKey ethcommon.Address) ([]byte, error func bitsToBytes(bits int) int { return (bits + 7) >> 3 } + +func trimLeftByte(s []byte, c byte) []byte { + for len(s) > 0 && s[0] == c { + s = s[1:] + } + return s +} From e343e1899f76f55453914690d473155fa1576458 Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Fri, 11 Nov 2022 04:35:29 +0100 Subject: [PATCH 11/13] Fix tests --- clients/js/main.ts | 4 ++-- node/pkg/ecdsasigner/ecdsaprivatekey_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clients/js/main.ts b/clients/js/main.ts index af9aa938a..f5f077dbf 100644 --- a/clients/js/main.ts +++ b/clients/js/main.ts @@ -33,7 +33,7 @@ function makeVAA( signers: string[], sequence: string | undefined, p: Payload -): Promise> { +): VAA { let v: VAA = { version: 1, guardianSetIndex: 0, @@ -120,7 +120,7 @@ yargs(hideBin(process.argv)) argv["sequence"], payload ); - console.log(serialiseVAA(v)) + console.log(serialiseVAA(v)); } ) // Upgrade diff --git a/node/pkg/ecdsasigner/ecdsaprivatekey_test.go b/node/pkg/ecdsasigner/ecdsaprivatekey_test.go index a08a31736..84270ec5d 100644 --- a/node/pkg/ecdsasigner/ecdsaprivatekey_test.go +++ b/node/pkg/ecdsasigner/ecdsaprivatekey_test.go @@ -18,7 +18,7 @@ func TestPrivateKey(t *testing.T) { address := ethcrypto.PubkeyToAddress(signer.PublicKey()) for i := 0; i < 100; i++ { - random, err := randomBytes(1000000) + random, err := randomBytes(1000) if err != nil { t.Fatal(err) } From 5d62ea459174c23dd8555c6ea4737e90652a8521 Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Fri, 11 Nov 2022 06:35:52 +0100 Subject: [PATCH 12/13] Remove guardianCredentialsFile --- node/cmd/guardiand/node.go | 8 -------- node/pkg/reporter/bigtablewriter.go | 6 ++---- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/node/cmd/guardiand/node.go b/node/cmd/guardiand/node.go index 41efa0ec3..093e6c9b9 100644 --- a/node/cmd/guardiand/node.go +++ b/node/cmd/guardiand/node.go @@ -155,8 +155,6 @@ var ( cloudKMSEnabled *bool cloudKMSKeyName *string - - guardianCredentialsFile *string ) func init() { @@ -272,8 +270,6 @@ func init() { cloudKMSEnabled = NodeCmd.Flags().Bool("cloudKMSEnabled", false, "Turn on Cloud KMS support for Guardian Key") cloudKMSKeyName = NodeCmd.Flags().String("cloudKMSKeyName", "", "Cloud KMS key name for Guardian Key") - - guardianCredentialsFile = NodeCmd.Flags().String("guardianCredentialsFile", "", "Path to json Service Account key") } var ( @@ -598,9 +594,6 @@ func runNode(cmd *cobra.Command, args []string) { if *bigTableTopicName == "" { logger.Fatal("Please specify --bigTableTopicName") } - if *guardianCredentialsFile == "" { - logger.Fatal("Please specify --guardianCredentialsFile") - } } if *cloudKMSEnabled { if *cloudKMSKeyName == "" { @@ -1036,7 +1029,6 @@ func runNode(cmd *cobra.Command, args []string) { GcpInstanceName: *bigTableInstanceName, TableName: *bigTableTableName, TopicName: *bigTableTopicName, - GcpKeyFilePath: *guardianCredentialsFile, } if err := supervisor.Run(ctx, "bigtable", reporter.BigTableWriter(attestationEvents, bigTableConnection)); err != nil { return err diff --git a/node/pkg/reporter/bigtablewriter.go b/node/pkg/reporter/bigtablewriter.go index 65ec62b19..d9114a32f 100644 --- a/node/pkg/reporter/bigtablewriter.go +++ b/node/pkg/reporter/bigtablewriter.go @@ -8,7 +8,6 @@ import ( "github.com/certusone/wormhole/node/pkg/supervisor" "github.com/certusone/wormhole/node/pkg/vaa" "go.uber.org/zap" - "google.golang.org/api/option" "cloud.google.com/go/bigtable" "cloud.google.com/go/pubsub" @@ -17,7 +16,6 @@ import ( type BigTableConnectionConfig struct { GcpProjectID string GcpInstanceName string - GcpKeyFilePath string TableName string TopicName string } @@ -49,7 +47,7 @@ func BigTableWriter(events *AttestationEventReporter, connectionConfig *BigTable client, err := bigtable.NewClient(ctx, e.connectionConfig.GcpProjectID, e.connectionConfig.GcpInstanceName, - option.WithCredentialsFile(e.connectionConfig.GcpKeyFilePath)) + ) if err != nil { return fmt.Errorf("failed to create BigTable client: %w", err) } @@ -57,7 +55,7 @@ func BigTableWriter(events *AttestationEventReporter, connectionConfig *BigTable pubsubClient, err := pubsub.NewClient(ctx, e.connectionConfig.GcpProjectID, - option.WithCredentialsFile(e.connectionConfig.GcpKeyFilePath)) + ) if err != nil { logger.Error("failed to create GCP PubSub client", zap.Error(err)) return fmt.Errorf("failed to create GCP PubSub client: %w", err) From 8500b275636792fd192a3c89d4048ba9f2190a7d Mon Sep 17 00:00:00 2001 From: h0ngcha0 Date: Sun, 13 Nov 2022 10:12:08 +0100 Subject: [PATCH 13/13] Remove google-cloud/kms --- clients/js/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/clients/js/package.json b/clients/js/package.json index 65203cb7b..e62c9f83a 100644 --- a/clients/js/package.json +++ b/clients/js/package.json @@ -9,7 +9,6 @@ "@improbable-eng/grpc-web-node-http-transport": "^0.15.0", "@solana/web3.js": "^1.22.0", "@terra-money/terra.js": "^1.8.9", - "@google-cloud/kms": "^3.0.1", "axios": "^0.24.0", "binary-parser": "^2.0.2", "bn.js": "^5.2.0",