mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-24 20:37:17 +00:00
Better logging for "Produced attestation..." (#2301)
This commit is contained in:
parent
a1e4199e3a
commit
b3742544ee
@ -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)),
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user