diff --git a/validator/client/validator_attest.go b/validator/client/validator_attest.go index a9abdd764..a3b30d896 100644 --- a/validator/client/validator_attest.go +++ b/validator/client/validator_attest.go @@ -126,26 +126,26 @@ func (v *validator) AttestToBlockHead(ctx context.Context, slot uint64, idx stri // TODO(#1366): Use BLS to generate an aggregate signature. attestation.AggregateSignature = []byte("signed") - log.WithField( - "blockRoot", fmt.Sprintf("%#x", attData.BeaconBlockRootHash32), - ).Info("Current beacon chain head block") log.WithFields(logrus.Fields{ - "justifiedEpoch": attData.JustifiedEpoch - params.BeaconConfig().GenesisEpoch, - "shard": attData.Shard, - "slot": slot - params.BeaconConfig().GenesisSlot, - }).Infof("%v Attesting to beacon chain head...", truncatedPk) + "shard": attData.Shard, + "slot": slot - params.BeaconConfig().GenesisSlot, + "validator": truncatedPk, + }).Info("Attesting to beacon chain head...") - log.Infof("Produced attestation with block root: %#x", attestation.Data.BeaconBlockRootHash32) attResp, err := v.attesterClient.AttestHead(ctx, attestation) if err != nil { log.Errorf("Could not submit attestation to beacon node: %v", err) return } log.WithFields(logrus.Fields{ - "attestationHash": fmt.Sprintf("%#x", attResp.AttestationHash), + "headHash": fmt.Sprintf("%#x", attData.BeaconBlockRootHash32), + "sourceHash": fmt.Sprintf("%#x", attData.JustifiedBlockRootHash32), + "targetHash": fmt.Sprintf("%#x", attData.EpochBoundaryRootHash32), + "slot": attData.Slot - params.BeaconConfig().GenesisSlot, "shard": attData.Shard, - "slot": slot - params.BeaconConfig().GenesisSlot, - }).Infof("%v successfully attested", truncatedPk) + "attestationHash": fmt.Sprintf("%#x", attResp.AttestationHash), + "validator": truncatedPk, + }).Info("Attested latest head") span.AddAttributes( trace.Int64Attribute("slot", int64(slot-params.BeaconConfig().GenesisSlot)), trace.StringAttribute("attestationHash", fmt.Sprintf("%#x", attResp.AttestationHash)), diff --git a/validator/client/validator_attest_test.go b/validator/client/validator_attest_test.go index 9ba2cdca9..90e45adef 100644 --- a/validator/client/validator_attest_test.go +++ b/validator/client/validator_attest_test.go @@ -154,7 +154,7 @@ func TestAttestToBlockHead_AttestsCorrectly(t *testing.T) { if !proto.Equal(generatedAttestation, expectedAttestation) { t.Errorf("Incorrectly attested head, wanted %v, received %v", expectedAttestation, generatedAttestation) } - testutil.AssertLogsContain(t, hook, "successfully attested") + testutil.AssertLogsContain(t, hook, "Attested latest head") } func TestAttestToBlockHead_DoesNotAttestBeforeDelay(t *testing.T) {