diff --git a/node/consensus/global/event_distributor.go b/node/consensus/global/event_distributor.go index 9200a42..1a6a81d 100644 --- a/node/consensus/global/event_distributor.go +++ b/node/consensus/global/event_distributor.go @@ -1,6 +1,7 @@ package global import ( + "bytes" "encoding/hex" "fmt" "math/rand" @@ -81,7 +82,18 @@ func (e *GlobalConsensusEngine) eventDistributorLoop() { e.publishKeyRegistry() } if e.proposer != nil { - e.evaluateForProposals(data) + workers, err := e.workerManager.RangeWorkers() + if err != nil { + e.logger.Error("could not retrieve workers", zap.Error(err)) + } else { + allocated := true + for _, w := range workers { + allocated = allocated && w.Allocated + } + if !allocated { + e.evaluateForProposals(data) + } + } } } @@ -402,6 +414,17 @@ func (e *GlobalConsensusEngine) evaluateForProposals( continue } + allocated := false + for _, prover := range info { + if bytes.Equal(prover.Address, e.getProverAddress()) { + allocated = true + } + } + + if allocated { + continue + } + size := e.hypergraph.GetSize(&key, path) resp, err := e.hypergraph.GetChildrenForPath( e.ctx,