@@ -558,7 +558,9 @@ func (pb *ProposalBuilder) initSignerData(
558
558
}
559
559
560
560
func (pb * ProposalBuilder ) build (ctx context.Context , lid types.LayerID ) error {
561
- start := time .Now ()
561
+ for _ , ss := range pb .signers .signers {
562
+ ss .latency .start = time .Now ()
563
+ }
562
564
if err := pb .initSharedData (ctx , lid ); err != nil {
563
565
return err
564
566
}
@@ -571,8 +573,8 @@ func (pb *ProposalBuilder) build(ctx context.Context, lid types.LayerID) error {
571
573
var eg errgroup.Group
572
574
eg .SetLimit (pb .cfg .workersLimit )
573
575
for _ , ss := range signers {
574
- ss .latency .start = start
575
576
eg .Go (func () error {
577
+ start := time .Now ()
576
578
if err := pb .initSignerData (ctx , ss , lid ); err != nil {
577
579
if errors .Is (err , errAtxNotAvailable ) {
578
580
ss .log .Debug ("smesher doesn't have atx that targets this epoch" ,
@@ -591,14 +593,15 @@ func (pb *ProposalBuilder) build(ctx context.Context, lid types.LayerID) error {
591
593
)
592
594
}
593
595
ss .session .prev = lid
594
- ss .latency .data = time .Now ( )
596
+ ss .latency .data = time .Since ( start )
595
597
return nil
596
598
})
597
599
}
598
600
if err := eg .Wait (); err != nil {
599
601
return err
600
602
}
601
603
604
+ start := time .Now ()
602
605
any := false
603
606
for _ , ss := range signers {
604
607
if n := len (ss .session .eligibilities .proofs [lid ]); n == 0 {
@@ -629,14 +632,16 @@ func (pb *ProposalBuilder) build(ctx context.Context, lid types.LayerID) error {
629
632
return fmt .Errorf ("encode votes: %w" , err )
630
633
}
631
634
for _ , ss := range signers {
632
- ss .latency .tortoise = time .Now ( )
635
+ ss .latency .tortoise = time .Since ( start )
633
636
}
634
637
638
+ start = time .Now ()
635
639
meshHash := pb .decideMeshHash (ctx , lid )
636
640
for _ , ss := range signers {
637
- ss .latency .hash = time .Now ( )
641
+ ss .latency .hash = time .Since ( start )
638
642
}
639
643
644
+ start = time .Now ()
640
645
for _ , ss := range signers {
641
646
proofs := ss .session .eligibilities .proofs [lid ]
642
647
if len (proofs ) == 0 {
@@ -654,7 +659,7 @@ func (pb *ProposalBuilder) build(ctx context.Context, lid types.LayerID) error {
654
659
)
655
660
656
661
txs := pb .conState .SelectProposalTXs (lid , len (proofs ))
657
- ss .latency .txs = time .Now ( )
662
+ ss .latency .txs = time .Since ( start )
658
663
659
664
// needs to be saved before publishing, as we will query it in handler
660
665
if ss .session .ref == types .EmptyBallotID {
@@ -667,6 +672,7 @@ func (pb *ProposalBuilder) build(ctx context.Context, lid types.LayerID) error {
667
672
}
668
673
669
674
eg .Go (func () error {
675
+ start := time .Now ()
670
676
proposal := createProposal (
671
677
& ss .session ,
672
678
pb .shared .beacon ,
@@ -686,7 +692,8 @@ func (pb *ProposalBuilder) build(ctx context.Context, lid types.LayerID) error {
686
692
zap .Error (err ),
687
693
)
688
694
} else {
689
- ss .latency .publish = time .Now ()
695
+ ss .latency .publish = time .Since (start )
696
+ ss .latency .end = time .Now ()
690
697
ss .log .Info ("proposal created" ,
691
698
log .ZContext (ctx ),
692
699
zap .Inline (proposal ),
0 commit comments