mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-23 11:57:18 +00:00
d26839c1f2
* Add validator_log.go * Use new logging scheme * Go fmt * Better name * Tests * Tests * Add wg.done, moved logging before span end * Add aggregator indices to submit attestation log * Rename * Fixed test * Add proposer index Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
37 lines
1.1 KiB
Go
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)
|
|
}
|