Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dkg/pedersen/reshare.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ func RunReshareDKG(ctx context.Context, config *Config, board *Board, shares []s

// Validate that AddedPeers and RemovedPeers are disjoint sets
for _, addedPeer := range config.Reshare.AddedPeers {
for _, removedPeer := range config.Reshare.RemovedPeers {
if addedPeer == removedPeer {
return nil, errors.New("peer cannot be both added and removed", z.Any("peer_id", addedPeer))
}
if slices.Contains(config.Reshare.RemovedPeers, addedPeer) {
return nil, errors.New("peer cannot be both added and removed", z.Any("peer_id", addedPeer))
}
}

Expand Down Expand Up @@ -126,6 +124,7 @@ func RunReshareDKG(ctx context.Context, config *Config, board *Board, shares []s
for _, removedPeerID := range config.Reshare.RemovedPeers {
if idx, ok := config.PeerMap[removedPeerID]; ok && idx.PeerIdx == int(node.Index) {
isRemoving = true

if idx.PeerIdx == thisNodeIndex {
thisIsRemovedNode = true
}
Expand All @@ -138,6 +137,7 @@ func RunReshareDKG(ctx context.Context, config *Config, board *Board, shares []s
for _, addedPeerID := range config.Reshare.AddedPeers {
if idx, ok := config.PeerMap[addedPeerID]; ok && idx.PeerIdx == int(node.Index) {
isNewlyAdded = true

if idx.PeerIdx == thisNodeIndex {
thisIsAddedNode = true
}
Expand Down
8 changes: 3 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/ipfs/go-log/v2 v2.9.0
github.com/jonboulle/clockwork v0.5.0
github.com/jsternberg/zap-logfmt v1.3.0
github.com/libp2p/go-libp2p v0.43.0
github.com/libp2p/go-libp2p v0.46.0
github.com/libp2p/go-msgio v0.3.0
github.com/multiformats/go-multiaddr v0.16.1
github.com/prometheus/client_golang v1.23.2
Expand Down Expand Up @@ -117,7 +117,6 @@ require (
github.com/ethereum/go-verkle v0.2.2 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/flynn/noise v1.1.0 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect
github.com/getsentry/sentry-go v0.31.1 // indirect
Expand All @@ -132,7 +131,6 @@ require (
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
github.com/google/cel-go v0.26.1 // indirect
github.com/google/go-containerregistry v0.20.6 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/graph-gophers/graphql-go v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect
Expand Down Expand Up @@ -225,8 +223,8 @@ require (
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/common v0.66.1 // indirect
github.com/prometheus/procfs v0.16.1 // indirect
github.com/quic-go/qpack v0.5.1 // indirect
github.com/quic-go/quic-go v0.55.0 // indirect
github.com/quic-go/qpack v0.6.0 // indirect
github.com/quic-go/quic-go v0.57.1 // indirect
github.com/quic-go/webtransport-go v0.9.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
Expand Down
Loading
Loading