Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore refresh errors to prevent infinite loops #332

Merged
merged 1 commit into from
Jul 17, 2024
Merged
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
11 changes: 8 additions & 3 deletions chains/evm/listener/eventHandlers/event-handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,18 @@ func (eh *RefreshEventHandler) HandleEvents(

hash := refreshEvents[len(refreshEvents)-1].Hash
if hash == "" {
return fmt.Errorf("hash cannot be empty string")
log.Error().Msgf("Hash cannot be empty string")
return nil
}
topology, err := eh.topologyProvider.NetworkTopology(hash)
if err != nil {
return err
log.Error().Err(err).Msgf("Failed fetching network topology")
return nil
}
err = eh.topologyStore.StoreTopology(topology)
if err != nil {
return err
log.Error().Err(err).Msgf("Failed storing network topology")
return nil
}

eh.connectionGate.SetTopology(topology)
Expand All @@ -384,13 +387,15 @@ func (eh *RefreshEventHandler) HandleEvents(
err = eh.coordinator.Execute(context.Background(), []tss.TssProcess{resharing}, make(chan interface{}, 1))
if err != nil {
log.Err(err).Msgf("Failed executing ecdsa key refresh")
return nil
}
frostResharing := frostResharing.NewResharing(
eh.sessionID(startBlock), topology.Threshold, eh.host, eh.communication, eh.frostStorer,
)
err = eh.coordinator.Execute(context.Background(), []tss.TssProcess{frostResharing}, make(chan interface{}, 1))
if err != nil {
log.Err(err).Msgf("Failed executing frost key refresh")
return nil
}
return nil
}
Expand Down
Loading