more small adjustments

This commit is contained in:
Cassandra Heart 2024-10-24 22:15:36 -05:00
parent d57757730d
commit 33015adc53
No known key found for this signature in database
GPG Key ID: 6352152859385958
3 changed files with 17 additions and 12 deletions

View File

@ -201,16 +201,15 @@ func (e *DataClockConsensusEngine) handleClockFrame(
return errors.Wrap(err, "handle clock frame data")
}
for _, trie := range e.GetFrameProverTries()[:1] {
if trie.Contains(addr.Bytes()) {
e.logger.Info(
"prover not in trie at frame, address may be in fork",
zap.Binary("address", address),
zap.Binary("filter", frame.Filter),
zap.Uint64("frame_number", frame.FrameNumber),
)
return nil
}
trie := e.GetFrameProverTries()[0]
if !trie.Contains(addr.Bytes()) {
e.logger.Info(
"prover not in trie at frame, address may be in fork",
zap.Binary("address", address),
zap.Binary("filter", frame.Filter),
zap.Uint64("frame_number", frame.FrameNumber),
)
return nil
}
e.logger.Info(

View File

@ -101,6 +101,7 @@ func (e *DataClockConsensusEngine) HandlePreMidnightMint(
) (*protobufs.PreMidnightMintResponse, error) {
addr, err := e.handleMint(t)
if err != nil {
e.logger.Error("error while handling pre-midnight mint", zap.Error(err))
return nil, err
}
@ -222,6 +223,11 @@ func (e *DataClockConsensusEngine) handleMint(
return nil, errors.Wrap(application.ErrInvalidStateTransition, "handle mint")
}
e.logger.Debug(
"got pre-midnight mint request",
zap.String("peer", peerId.String()),
)
if len(t.Proofs) >= 3 &&
len(t.Proofs) < 204 &&
bytes.Equal(

View File

@ -64,8 +64,8 @@ func (e *DataClockConsensusEngine) runPreMidnightProofWorker() {
for {
tries := e.GetFrameProverTries()
if len(tries) == 0 {
e.logger.Info("waiting for more frame info to appear")
if len(tries) == 0 || e.pubSub.GetNetworkPeersCount() < 3 {
e.logger.Info("waiting for more peer info to appear")
time.Sleep(10 * time.Second)
continue
}