mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-07 10:12:19 +00:00
2cb8430ad4
* Add validator_log.go * Use new logging scheme * Go fmt * Better name * Tests * Tests * Merge refs/heads/master into better-logging * Merge branch 'master' of git+ssh://github.com/prysmaticlabs/prysm into better-logging * Add wg.done, moved logging before span end * Merge branch 'better-logging' of git+ssh://github.com/prysmaticlabs/prysm into better-logging
35 lines
1020 B
Go
35 lines
1020 B
Go
package client
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
|
|
"github.com/prysmaticlabs/prysm/shared/bytesutil"
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
type attSubmitted struct {
|
|
data *ethpb.AttestationData
|
|
indices []uint64
|
|
}
|
|
|
|
func (v *validator) LogAttestationsSubmitted() {
|
|
v.attLogsLock.Lock()
|
|
defer v.attLogsLock.Unlock()
|
|
|
|
for _, attLog := range v.attLogs {
|
|
log.WithFields(logrus.Fields{
|
|
"Slot": attLog.data.Slot,
|
|
"CommitteeIndex": attLog.data.CommitteeIndex,
|
|
"BeaconBlockRoot": fmt.Sprintf("%#x", bytesutil.Trunc(attLog.data.BeaconBlockRoot)),
|
|
"SourceEpoch": attLog.data.Source.Epoch,
|
|
"SourceRoot": fmt.Sprintf("%#x", bytesutil.Trunc(attLog.data.Source.Root)),
|
|
"TargetEpoch": attLog.data.Target.Epoch,
|
|
"TargetRoot": fmt.Sprintf("%#x", bytesutil.Trunc(attLog.data.Target.Root)),
|
|
"ValidatorIndices": attLog.indices,
|
|
}).Info("Submitted new unaggregated attestations")
|
|
}
|
|
|
|
v.attLogs = make(map[[32]byte]*attSubmitted)
|
|
}
|