Skip to content

Commit

Permalink
Revert "fix: grpc remote connection verification"
Browse files Browse the repository at this point in the history
This reverts commit 7e2cfdc.
  • Loading branch information
k-yang committed Feb 22, 2023
1 parent e68e58f commit d9f69c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
11 changes: 2 additions & 9 deletions feeder/eventstream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package eventstream

import (
"context"
"crypto/tls"
"sync"
"sync/atomic"
"time"
Expand All @@ -11,7 +10,6 @@ import (
"github.com/NibiruChain/pricefeeder/types"
"github.com/rs/zerolog"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
)

var _ types.EventStream = (*Stream)(nil)
Expand All @@ -24,12 +22,7 @@ type wsI interface {

// Dial opens two connections to the given endpoint, one for the websocket and one for the oracle grpc.
func Dial(tendermintRPCEndpoint string, grpcEndpoint string, logger zerolog.Logger) *Stream {
// TODO(k-yang): do proper certificate checking
grpcCreds := credentials.NewTLS(&tls.Config{
InsecureSkipVerify: true,
})
grpcConn, err := grpc.Dial(grpcEndpoint, grpc.WithTransportCredentials(grpcCreds))

grpcConn, err := grpc.Dial(grpcEndpoint, grpc.WithInsecure())
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -132,7 +125,7 @@ func (s *Stream) paramsLoop(oracleClient oracletypes.QueryClient, logger zerolog
case <-tick.C:
newParams, err := fetchParams()
if err != nil {
logger.Err(err).Msg("param update failed")
logger.Err(err).Msg("param update")
break
}

Expand Down
1 change: 0 additions & 1 deletion feeder/eventstream/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func (w *ws) loop() {
// read messages and also handles reconnection.
for {
_, bytes, err := w.connection.ReadMessage()
w.logger.Debug().Bytes("ws connection bytes", bytes).Msg("received message from ws connection")
if err != nil {
if w.connectionClosed.Load() {
// if the connection was closed, then we exit
Expand Down
8 changes: 1 addition & 7 deletions feeder/priceposter/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package priceposter

import (
"context"
"crypto/tls"
"time"

"github.com/NibiruChain/nibiru/app"
Expand All @@ -16,7 +15,6 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/rs/zerolog"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
)

var _ types.PricePoster = (*Client)(nil)
Expand Down Expand Up @@ -44,11 +42,7 @@ type deps struct {
}

func Dial(grpcEndpoint string, chainID string, keyBase keyring.Keyring, validator sdk.ValAddress, feeder sdk.AccAddress, logger zerolog.Logger) *Client {
// TODO(k-yang): do proper certificate checking
creds := credentials.NewTLS(&tls.Config{
InsecureSkipVerify: true,
})
conn, err := grpc.Dial(grpcEndpoint, grpc.WithTransportCredentials(creds))
conn, err := grpc.Dial(grpcEndpoint, grpc.WithInsecure())
if err != nil {
panic(err)
}
Expand Down

0 comments on commit d9f69c7

Please sign in to comment.