This commit is contained in:
Jim McDonald 2020-11-27 15:26:22 +00:00
parent 68fb49a21b
commit aed5402fbb
No known key found for this signature in database
GPG Key ID: 89CEB61B2AD2A5E7
5 changed files with 28 additions and 8 deletions

View File

@ -278,18 +278,18 @@ func (s *Service) fetchAccountsForWallet(ctx context.Context, wallet e2wtypes.Wa
}
// Ensure we can unlock the account with a known passphrase.
unlocked := false
if unlocker, isUnlocker := account.(e2wtypes.AccountLocker); isUnlocker {
unlocked := false
for _, passphrase := range s.passphrases {
if err := unlocker.Unlock(ctx, passphrase); err == nil {
unlocked = true
break
}
}
if !unlocked {
log.Warn().Str("account", name).Msg("Failed to unlock account with any passphrase")
continue
}
}
if !unlocked {
log.Warn().Str("account", name).Msg("Failed to unlock account with any passphrase")
continue
}
// Set up account as unknown to beacon chain.

View File

@ -76,8 +76,12 @@ func (s *Service) Subscribe(ctx context.Context,
epoch spec.Epoch,
accounts map[spec.ValidatorIndex]e2wtypes.Account,
) (map[spec.Slot]map[spec.CommitteeIndex]*beaconcommitteesubscriber.Subscription, error) {
started := time.Now()
if len(accounts) == 0 {
// Nothing to do.
return map[spec.Slot]map[spec.CommitteeIndex]*beaconcommitteesubscriber.Subscription{}, nil
}
started := time.Now()
log := log.With().Uint64("epoch", uint64(epoch)).Logger()
log.Trace().Msg("Subscribing")

View File

@ -30,6 +30,11 @@ func (s *Service) scheduleAttestations(ctx context.Context,
validatorIndices []spec.ValidatorIndex,
notCurrentSlot bool,
) {
if len(validatorIndices) == 0 {
// Nothing to do.
return
}
started := time.Now()
log.Trace().Uint64("epoch", uint64(epoch)).Msg("Scheduling attestations")

View File

@ -28,6 +28,11 @@ func (s *Service) scheduleProposals(ctx context.Context,
validatorIndices []spec.ValidatorIndex,
notCurrentSlot bool,
) {
if len(validatorIndices) == 0 {
// Nothing to do.
return
}
started := time.Now()
log.Trace().Uint64("epoch", uint64(epoch)).Msg("Scheduling proposals")

View File

@ -69,13 +69,19 @@ func (s *Service) SubmitAttestations(ctx context.Context, attestations []*spec.A
data, err2 := json.Marshal(attestations)
if err2 != nil {
log.Error().Err(err).Msg("Failed to marshal JSON")
} else {
log.Warn().Err(err).Str("data", string(data)).Msg("Invalid signature!")
}
log.Warn().Err(err).Str("data", string(data)).Msg("Invalid signature!")
default:
log.Warn().Err(err).Msg("Failed to submit attestation")
}
} else {
log.Trace().Msg("Submitted attestations")
data, err := json.Marshal(attestations)
if err != nil {
log.Error().Err(err).Msg("Failed to marshal JSON")
} else {
log.Trace().Str("data", string(data)).Msg("Submitted attestations")
}
}
}(ctx, sem, &wg, name, submitter)
}