fix: handle large consensus batches

This commit is contained in:
Cassandra Heart 2023-10-05 17:01:16 -05:00
parent 520d6562f9
commit 5bce33216f
No known key found for this signature in database
GPG Key ID: 6352152859385958

View File

@ -687,12 +687,12 @@ func (e *CeremonyDataClockConsensusEngine) commitLongestPath(
zap.Int("commit_depth", len(runningFrames[0])), zap.Int("commit_depth", len(runningFrames[0])),
) )
for _, s := range runningFrames[0][1:] {
txn, err := e.clockStore.NewTransaction() txn, err := e.clockStore.NewTransaction()
if err != nil { if err != nil {
return nil, errors.Wrap(err, "commit longest path") return nil, errors.Wrap(err, "commit longest path")
} }
for _, s := range runningFrames[0][1:] {
e.logger.Info( e.logger.Info(
"committing candidate", "committing candidate",
zap.Uint64("frame_number", s.FrameNumber), zap.Uint64("frame_number", s.FrameNumber),
@ -796,7 +796,6 @@ func (e *CeremonyDataClockConsensusEngine) commitLongestPath(
} }
} }
} }
}
if err := txn.Commit(); err != nil { if err := txn.Commit(); err != nil {
e.logger.Error( e.logger.Error(
@ -805,6 +804,7 @@ func (e *CeremonyDataClockConsensusEngine) commitLongestPath(
) )
return nil, errors.Wrap(err, "commit longest path") return nil, errors.Wrap(err, "commit longest path")
} }
}
runningFrames = [][]*protobufs.ClockFrame{ runningFrames = [][]*protobufs.ClockFrame{
{nextRunningFrames[0][currentDepth+1]}, {nextRunningFrames[0][currentDepth+1]},