Skip to content

Commit

Permalink
revert some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rkapka committed Feb 1, 2024
1 parent 407bb2f commit f6dcc91
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion validator/accounts/testing/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (_ *Validator) SubmitSignedContributionAndProof(_ context.Context, _ primit
panic("implement me")
}

func (_ *Validator) LogSubmittedAtts(_ primitives.Slot) {
func (_ *Validator) LogSubmittedAtts() {
panic("implement me")
}

Expand Down
2 changes: 1 addition & 1 deletion validator/client/iface/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type Validator interface {
SubmitAggregateAndProof(ctx context.Context, slot primitives.Slot, pubKey [fieldparams.BLSPubkeyLength]byte)
SubmitSyncCommitteeMessage(ctx context.Context, slot primitives.Slot, pubKey [fieldparams.BLSPubkeyLength]byte)
SubmitSignedContributionAndProof(ctx context.Context, slot primitives.Slot, pubKey [fieldparams.BLSPubkeyLength]byte)
LogSubmittedAtts(slot primitives.Slot)
LogSubmittedAtts()
LogSubmittedSyncCommitteeMessages()
UpdateDomainDataCaches(ctx context.Context, slot primitives.Slot)
WaitForKeymanagerInitialization(ctx context.Context) error
Expand Down
9 changes: 2 additions & 7 deletions validator/client/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"sync/atomic"

"github.com/prysmaticlabs/prysm/v4/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v4/encoding/bytesutil"
ethpb "github.com/prysmaticlabs/prysm/v4/proto/prysm/v1alpha1"
"github.com/sirupsen/logrus"
Expand All @@ -19,15 +18,10 @@ type submittedAtt struct {
}

// LogSubmittedAtts logs info about submitted attestations.
func (v *validator) LogSubmittedAtts(slot primitives.Slot) {
func (v *validator) LogSubmittedAtts() {
v.attLogsLock.Lock()
defer v.attLogsLock.Unlock()

if len(v.submittedAtts) == 0 {
return
}

log.Infof("Submitted new attestations for slot %d", slot)
for _, attLog := range v.submittedAtts {
attesterPubkeys := make([]string, len(attLog.attesterPubkeys))
for i, p := range attLog.attesterPubkeys {
Expand All @@ -38,6 +32,7 @@ func (v *validator) LogSubmittedAtts(slot primitives.Slot) {
aggregatorPubkeys[i] = fmt.Sprintf("%#x", bytesutil.Trunc(p))
}
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,
Expand Down
4 changes: 2 additions & 2 deletions validator/client/testutil/mock_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ func (*FakeValidator) SubmitAggregateAndProof(_ context.Context, _ primitives.Sl
func (*FakeValidator) SubmitSyncCommitteeMessage(_ context.Context, _ primitives.Slot, _ [fieldparams.BLSPubkeyLength]byte) {
}

// LogAttestationsSubmitted for mocking.
func (*FakeValidator) LogSubmittedAtts(_ primitives.Slot) {}
// LogSubmittedAtts for mocking.
func (*FakeValidator) LogSubmittedAtts() {}

// UpdateDomainDataCaches for mocking.
func (*FakeValidator) UpdateDomainDataCaches(context.Context, primitives.Slot) {}
Expand Down
4 changes: 3 additions & 1 deletion validator/client/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -967,11 +967,13 @@ func (v *validator) logDuties(slot primitives.Slot, currentEpochDuties []*ethpb.
}
if len(attesterKeys[i]) > 0 {
slotLog = slotLog.WithFields(logrus.Fields{
"slot": epochStartSlot + i,
"slotInEpoch": (epochStartSlot + i) % params.BeaconConfig().SlotsPerEpoch,
"attesterCount": len(attesterKeys[i]),
"attesterPubkeys": attesterKeys[i],
})
}
slotLog.Infof("Schedule for slot %d (slot %d in epoch)", epochStartSlot+i, (epochStartSlot+i)%params.BeaconConfig().SlotsPerEpoch)
slotLog.Infof("Duties schedule")
}
}

Expand Down

0 comments on commit f6dcc91

Please sign in to comment.