prysm-pulse/validator/client/log.go
Raul Jordan 091525deb8
Revert Stream Duties (#6473)
* ensure gazelle
* fix up propose test
* build
* comment
2020-07-02 17:50:05 +00:00

37 lines
1.1 KiB
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
attesterIndices []uint64
aggregatorIndices []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)),
"AttesterIndices": attLog.attesterIndices,
"AggregatorIndices": attLog.aggregatorIndices,
}).Info("Submitted new attestations")
}
v.attLogs = make(map[[32]byte]*attSubmitted)
}