diff --git a/chain/exchange/client.go b/chain/exchange/client.go index fa9ed2974cd..e5fa4fdf4f5 100644 --- a/chain/exchange/client.go +++ b/chain/exchange/client.go @@ -395,7 +395,7 @@ func (c *client) sendRequestToPeer(ctx context.Context, peer peer.ID, req *Reque return nil, xerrors.Errorf("failed to get protocols for peer: %w", err) } if len(supported) == 0 || (supported[0] != BlockSyncProtocolID && supported[0] != ChainExchangeProtocolID) { - return nil, xerrors.Errorf("peer %s does not support protocols %s", + return nil, xerrors.Errorf("peer %s does not support protocols %s (supported: %s)", peer, []string{BlockSyncProtocolID, ChainExchangeProtocolID}) } diff --git a/chain/sync_test.go b/chain/sync_test.go index 9c6d89c7cb1..dd68048b8ac 100644 --- a/chain/sync_test.go +++ b/chain/sync_test.go @@ -5,9 +5,12 @@ import ( "fmt" "os" "strings" + "syscall" "testing" "time" + "golang.org/x/sys/unix" + "github.com/filecoin-project/go-state-types/crypto" "github.com/filecoin-project/go-state-types/network" @@ -344,6 +347,8 @@ func (tu *syncTestUtil) waitIdentify(from int, pid peer.ID) { } if time.Now().After(deadline) { + fmt.Printf("peer didn't advertise chain xchg support: %+v\n", epi) + unix.Kill(os.Getpid(), syscall.SIGQUIT) tu.t.Fatalf("peer didn't advertise chain xchg support: %+v", epi) } diff --git a/node/modules/services.go b/node/modules/services.go index 011b8916313..a8c2ca36e7a 100644 --- a/node/modules/services.go +++ b/node/modules/services.go @@ -97,6 +97,7 @@ func RunPeerMgr(mctx helpers.MetricsCtx, lc fx.Lifecycle, pmgr *peermgr.PeerMgr) func RunChainExchange(h host.Host, svc exchange.Server) { h.SetStreamHandler(exchange.BlockSyncProtocolID, svc.HandleStream) // old h.SetStreamHandler(exchange.ChainExchangeProtocolID, svc.HandleStream) // new + log.Error("debug - register chain xchg") } func waitForSync(stmgr *stmgr.StateManager, epochs int, subscribe func()) {