More span tags in validator (#2162)

* add more tags to spans when proposing a block

* more stuff tags on attestation span

* add slot
This commit is contained in:
Preston Van Loon 2019-04-04 20:23:48 -05:00 committed by GitHub
parent ae4425ac2d
commit f670a134a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,9 @@ var delay = params.BeaconConfig().SecondsPerSlot / 2
func (v *validator) AttestToBlockHead(ctx context.Context, slot uint64) {
ctx, span := trace.StartSpan(ctx, "validator.AttestToBlockHead")
defer span.End()
span.AddAttributes(
trace.StringAttribute("validator", fmt.Sprintf("%#x", v.key.PublicKey.Marshal())),
)
v.waitToSlotMidpoint(ctx, slot)
@ -132,6 +135,14 @@ func (v *validator) AttestToBlockHead(ctx context.Context, slot uint64) {
"shard": attData.Shard,
"slot": slot - params.BeaconConfig().GenesisSlot,
}).Info("Beacon node processed attestation successfully")
span.AddAttributes(
trace.Int64Attribute("slot", int64(slot-params.BeaconConfig().GenesisSlot)),
trace.StringAttribute("attestationHash", fmt.Sprintf("%#x", attResp.AttestationHash)),
trace.Int64Attribute("shard", int64(attData.Shard)),
trace.StringAttribute("blockRoot", fmt.Sprintf("%#x", attestation.Data.BeaconBlockRootHash32)),
trace.Int64Attribute("justifiedEpoch", int64(attData.JustifiedEpoch-params.BeaconConfig().GenesisEpoch)),
trace.StringAttribute("bitfield", fmt.Sprintf("%#x", aggregationBitfield)),
)
}
// waitToSlotMidpoint waits until halfway through the current slot period