@@ -10,6 +10,7 @@ import (
10
10
"os"
11
11
"runtime/debug"
12
12
"sort"
13
+ "strconv"
13
14
"sync"
14
15
"time"
15
16
@@ -1029,6 +1030,7 @@ func (cs *State) handleMsg(ctx context.Context, mi msgInfo, fsyncUponCompletion
1029
1030
err = cs .setProposal (msg .Proposal , mi .ReceiveTime )
1030
1031
if cs .config .GossipTransactionHashOnly && ! cs .isProposer (cs .privValidatorPubKey .Address ()) {
1031
1032
created := cs .tryCreateProposalBlock (msg .Proposal .Height , msg .Proposal .Round , msg .Proposal .Header , msg .Proposal .LastCommit , msg .Proposal .Evidence , msg .Proposal .ProposerAddress )
1033
+ cs .metrics .ProposalBlockCreated .With ("success" , strconv .FormatBool (created )).Add (1 )
1032
1034
if created {
1033
1035
if fsyncUponCompletion {
1034
1036
if err := cs .wal .FlushAndSync (); err != nil { // fsync
@@ -2467,12 +2469,17 @@ func (cs *State) tryCreateProposalBlock(height int64, round int32, header types.
2467
2469
cs .metrics .BlockGossipPartsReceived .With ("matches_current" , "false" ).Add (1 )
2468
2470
return false
2469
2471
}
2470
-
2471
- if cs .Proposal == nil || len (cs .blockExec .GetMissingTxs (cs .Proposal .TxKeys )) != 0 {
2472
+ if cs .Proposal == nil {
2473
+ return false
2474
+ }
2475
+ txKeys := cs .Proposal .TxKeys
2476
+ cs .metrics .ProposalTxsCount .Set (float64 (len (cs .Proposal .TxKeys )))
2477
+ missingTxKeys := cs .blockExec .GetMissingTxs (txKeys )
2478
+ if len (missingTxKeys ) != 0 {
2472
2479
//cs.logger.Info("PSULOG - cannot create block, either proposal is missing or we have missing keys", "proposal", cs.Proposal)
2480
+ cs .metrics .MissingTxsCount .Set (float64 (len (cs .blockExec .GetMissingTxs (cs .Proposal .TxKeys ))))
2473
2481
return false
2474
2482
} else {
2475
- txKeys := cs .Proposal .TxKeys
2476
2483
//block := types.MakeBlock(height, cs.blockExec.GetTxsForKeys(txKeys), lastCommit, evidence, false)
2477
2484
block := cs .state .MakeBlock (height , cs .blockExec .GetTxsForKeys (txKeys ), lastCommit , evidence , proposerAddress , false )
2478
2485
// We have full proposal block. Set txs in proposal block from mempool
0 commit comments