From 60076bde31e7ada7814afe17afb163aa23d42ad8 Mon Sep 17 00:00:00 2001 From: mpetrun5 Date: Wed, 4 Sep 2024 14:54:59 +0200 Subject: [PATCH] Show resharing start params --- .github/workflows/deploy_stage.yml | 2 +- tss/ecdsa/resharing/resharing.go | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy_stage.yml b/.github/workflows/deploy_stage.yml index fffb39f5..6d0b8d6f 100644 --- a/.github/workflows/deploy_stage.yml +++ b/.github/workflows/deploy_stage.yml @@ -6,7 +6,7 @@ name: Sygma Devnet on: push: branches: - - main + - test env: ENVIRONMENT: STAGE diff --git a/tss/ecdsa/resharing/resharing.go b/tss/ecdsa/resharing/resharing.go index f84b7dd2..1f753366 100644 --- a/tss/ecdsa/resharing/resharing.go +++ b/tss/ecdsa/resharing/resharing.go @@ -7,6 +7,7 @@ import ( "context" "encoding/json" "errors" + "fmt" "math/big" "github.com/ChainSafe/sygma-relayer/comm" @@ -201,6 +202,16 @@ func (r *Resharing) validateStartParams(params startParams) error { slices.Sort(r.key.Peers) // if relayer is already part of the active subset, check if peer subset // in starting params is same as one saved in keyshare + + fmt.Println("OLD SUBSET") + for _, peer := range params.OldSubset { + fmt.Println(peer.Pretty()) + } + fmt.Println("INTERSECTION") + for _, peer := range common.PeersIntersection(r.key.Peers, r.Host.Peerstore().Peers()) { + fmt.Println(peer.Pretty()) + } + if len(r.key.Peers) != 0 && !slices.Equal(params.OldSubset, common.PeersIntersection(r.key.Peers, r.Host.Peerstore().Peers())) { return errors.New("invalid peers subset in start params") }