node info should show worker counts

This commit is contained in:
Cassandra Heart 2024-11-18 02:03:37 -06:00
parent c9be69ba28
commit 61179c13a0
No known key found for this signature in database
GPG Key ID: 6352152859385958
7 changed files with 1297 additions and 1268 deletions

View File

@ -988,3 +988,14 @@ func (e *DataClockConsensusEngine) createParallelDataClientsFromBaseMultiaddr(
)
return clients, nil
}
func (e *DataClockConsensusEngine) GetWorkerCount() uint32 {
count := uint32(0)
for _, client := range e.clients {
if client != nil {
count++
}
}
return count
}

View File

@ -20,4 +20,5 @@ type ExecutionEngine interface {
GetSeniority() *big.Int
GetRingPosition() int
AnnounceProverJoin()
GetWorkerCount() uint32
}

View File

@ -1540,3 +1540,7 @@ func (e *TokenExecutionEngine) getAddressFromSignature(
return altAddr.FillBytes(make([]byte, 32)), nil
}
func (e *TokenExecutionEngine) GetWorkerCount() uint32 {
return e.clock.GetWorkerCount()
}

View File

@ -1275,5 +1275,6 @@ func printNodeInfo(cfg *config.Config) {
fmt.Println("Seniority: " + new(big.Int).SetBytes(
nodeInfo.PeerSeniority,
).String())
fmt.Println("Active Workers:", nodeInfo.Workers)
printBalance(cfg)
}

File diff suppressed because it is too large Load Diff

View File

@ -63,6 +63,7 @@ message NodeInfoResponse {
bytes version = 4;
bytes peer_seniority = 5;
int32 prover_ring = 6;
uint32 workers = 7;
}
message PutPeerInfoRequest {

View File

@ -184,6 +184,7 @@ func (r *RPCServer) GetNodeInfo(
),
PeerSeniority: seniority.FillBytes(make([]byte, 32)),
ProverRing: int32(ring),
Workers: r.executionEngines[0].GetWorkerCount(),
}, nil
}