diff --git a/relayer/chains/evm/client.go b/relayer/chains/evm/client.go index 465f4fc7..7bc3dbd9 100644 --- a/relayer/chains/evm/client.go +++ b/relayer/chains/evm/client.go @@ -27,12 +27,17 @@ func newClient(ctx context.Context, connectionContract, XcallContract common.Add return nil, err } - connection, err := bridgeContract.NewConnection(connectionContract, eth) + ethRpc, err := ethclient.DialContext(ctx, rpcUrl) + if err != nil { + return nil, err + } + + connection, err := bridgeContract.NewConnection(connectionContract, ethRpc) if err != nil { return nil, fmt.Errorf("error occured when creating connection cobtract: %v ", err) } - xcall, err := bridgeContract.NewXcall(XcallContract, eth) + xcall, err := bridgeContract.NewXcall(XcallContract, ethRpc) if err != nil { return nil, fmt.Errorf("error occured when creating eth client: %v ", err) } diff --git a/relayer/chains/icon/client.go b/relayer/chains/icon/client.go index 4f8edf9b..c7765bb3 100644 --- a/relayer/chains/icon/client.go +++ b/relayer/chains/icon/client.go @@ -265,12 +265,13 @@ func (c *Client) Monitor(ctx context.Context, reqUrl string, reqPtr, respPtr int return err } defer func() { - c.log.Debug(fmt.Sprintf("Monitor finish %s", conn.LocalAddr().String())) + c.log.Debug(fmt.Sprintf("Monitor finish %s", conn.RemoteAddr().String())) c.wsClose(conn) }() if err = c.wsRequest(conn, reqPtr); err != nil { return err } + c.log.Info("Monitoring started", zap.String("address", conn.RemoteAddr().String())) conn.SetPongHandler(func(string) error { return conn.SetReadDeadline(time.Now().Add(15 * time.Second)) }) diff --git a/relayer/chains/icon/listener.go b/relayer/chains/icon/listener.go index 7cc8cb7e..197529ab 100644 --- a/relayer/chains/icon/listener.go +++ b/relayer/chains/icon/listener.go @@ -102,6 +102,7 @@ func (p *Provider) Listener(ctx context.Context, lastSavedHeight uint64, incomin if errors.Is(err, context.Canceled) { return } + eventReq.Height = types.NewHexInt(int64(p.GetLastSavedBlockHeight())) time.Sleep(time.Second * 3) reconnect() p.log.Warn("error occured during monitor event", zap.Error(err))