mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
Enhance block by root log (#13472)
This commit is contained in:
parent
c3dbfa66d0
commit
f3ef1b64d6
@ -79,13 +79,6 @@ func (s *Service) processPendingAtts(ctx context.Context) error {
|
||||
seen := s.seenPendingBlocks[bRoot]
|
||||
s.pendingQueueLock.RUnlock()
|
||||
if !seen {
|
||||
// Pending attestation's missing block has not arrived yet.
|
||||
log.WithFields(logrus.Fields{
|
||||
"currentSlot": s.cfg.clock.CurrentSlot(),
|
||||
"attSlot": attestations[0].Message.Aggregate.Data.Slot,
|
||||
"attCount": len(attestations),
|
||||
"blockRoot": hex.EncodeToString(bytesutil.Trunc(bRoot[:])),
|
||||
}).Debug("Requesting block for pending attestation")
|
||||
pendingRoots = append(pendingRoots, bRoot)
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ func TestProcessPendingAtts_NoBlockRequestBlock(t *testing.T) {
|
||||
a := ðpb.AggregateAttestationAndProof{Aggregate: ðpb.Attestation{Data: ðpb.AttestationData{Target: ðpb.Checkpoint{Root: make([]byte, 32)}}}}
|
||||
r.blkRootToPendingAtts[[32]byte{'A'}] = []*ethpb.SignedAggregateAttestationAndProof{{Message: a}}
|
||||
require.NoError(t, r.processPendingAtts(context.Background()))
|
||||
require.LogsContain(t, hook, "Requesting block for pending attestation")
|
||||
require.LogsContain(t, hook, "Requesting block by root")
|
||||
}
|
||||
|
||||
func TestProcessPendingAtts_HasBlockSaveUnAggregatedAtt(t *testing.T) {
|
||||
|
@ -126,7 +126,6 @@ func (s *Service) processPendingBlocks(ctx context.Context) error {
|
||||
// Request parent block if not in the pending queue and not in the database.
|
||||
isParentBlockInDB := s.cfg.beaconDB.HasBlock(ctx, parentRoot)
|
||||
if !inPendingQueue && !isParentBlockInDB && s.hasPeer() {
|
||||
log.WithFields(logrus.Fields{"currentSlot": b.Block().Slot(), "parentRoot": hex.EncodeToString(parentRoot[:])}).Debug("Requesting parent block")
|
||||
parentRoots = append(parentRoots, parentRoot)
|
||||
continue
|
||||
}
|
||||
@ -283,6 +282,8 @@ func (s *Service) sendBatchRootRequest(ctx context.Context, roots [][32]byte, ra
|
||||
r := roots[i]
|
||||
if s.seenPendingBlocks[r] || s.cfg.chain.BlockBeingSynced(r) {
|
||||
roots = append(roots[:i], roots[i+1:]...)
|
||||
} else {
|
||||
log.WithField("blockRoot", fmt.Sprintf("%#x", r)).Debug("Requesting block by root")
|
||||
}
|
||||
}
|
||||
s.pendingQueueLock.RUnlock()
|
||||
|
Loading…
Reference in New Issue
Block a user