From 32a47d7d45c13b459bcf0c301c5b3c9cbf8785ee Mon Sep 17 00:00:00 2001 From: Ron Date: Fri, 25 Oct 2024 11:55:57 +0800 Subject: [PATCH] Fix closed connection (#1322) * Fix closed connection * Throw error * Update relayer/relays/parachain/scanner.go Co-authored-by: Vincent Geddes <117534+vgeddes@users.noreply.github.com> --------- Co-authored-by: Vincent Geddes <117534+vgeddes@users.noreply.github.com> --- relayer/relays/parachain/main.go | 2 +- relayer/relays/parachain/scanner.go | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/relayer/relays/parachain/main.go b/relayer/relays/parachain/main.go index 44f6d710e3..f00e32d8e8 100644 --- a/relayer/relays/parachain/main.go +++ b/relayer/relays/parachain/main.go @@ -86,7 +86,7 @@ func (relay *Relay) Start(ctx context.Context, eg *errgroup.Group) error { return fmt.Errorf("unable to connect to ethereum: beefy: %w", err) } - err = relay.relaychainConn.Connect(ctx) + err = relay.relaychainConn.ConnectWithHeartBeat(ctx, 30*time.Second) if err != nil { return err } diff --git a/relayer/relays/parachain/scanner.go b/relayer/relays/parachain/scanner.go index 58a8dabad9..055e4ee73e 100644 --- a/relayer/relays/parachain/scanner.go +++ b/relayer/relays/parachain/scanner.go @@ -5,10 +5,11 @@ import ( "context" "errors" "fmt" - "github.com/ethereum/go-ethereum/accounts/abi" "reflect" "strings" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/snowfork/go-substrate-rpc-client/v4/scale" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -122,7 +123,10 @@ func (s *Scanner) findTasks( return nil, err } - s.gatherProofInputs(tasks) + err = s.gatherProofInputs(tasks) + if err != nil { + return nil, fmt.Errorf("gather proof input: %w", err) + } return tasks, nil }