Skip to content

Commit

Permalink
Show resharing start params
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrun5 committed Sep 4, 2024
1 parent a73baff commit 60076bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Sygma Devnet
on:
push:
branches:
- main
- test

env:
ENVIRONMENT: STAGE
Expand Down
11 changes: 11 additions & 0 deletions tss/ecdsa/resharing/resharing.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"encoding/json"
"errors"
"fmt"
"math/big"

"github.com/ChainSafe/sygma-relayer/comm"
Expand Down Expand Up @@ -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")
}
Expand Down

0 comments on commit 60076bd

Please sign in to comment.