mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-11-20 15:15:18 +00:00
v1.2.14 (#67)
This commit is contained in:
parent
012156e072
commit
96490478ef
@ -886,11 +886,11 @@ func logoVersion(width int) string {
|
||||
out += " ####################################### ########\n"
|
||||
out += " ############################# ##\n"
|
||||
out += " \n"
|
||||
out += " Quilibrium Node - v1.2.13 – Dawn\n"
|
||||
out += " Quilibrium Node - v1.2.14 – Dawn\n"
|
||||
out += " \n"
|
||||
out += " DB Console\n"
|
||||
} else {
|
||||
out = "Quilibrium Node - v1.2.13 – Dawn - DB Console\n"
|
||||
out = "Quilibrium Node - v1.2.14 – Dawn - DB Console\n"
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
@ -410,10 +410,15 @@ func (e *CeremonyDataClockConsensusEngine) runLoop() {
|
||||
case dataFrame := <-dataFrameCh:
|
||||
if latestFrame, err = e.collect(dataFrame); err != nil {
|
||||
e.logger.Error("could not collect", zap.Error(err))
|
||||
continue
|
||||
}
|
||||
|
||||
dataFrame, err := e.dataTimeReel.Head()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
go func() {
|
||||
e.frameChan <- latestFrame
|
||||
e.frameChan <- dataFrame
|
||||
}()
|
||||
|
||||
if bytes.Equal(
|
||||
@ -421,7 +426,7 @@ func (e *CeremonyDataClockConsensusEngine) runLoop() {
|
||||
e.provingKeyAddress,
|
||||
) {
|
||||
var nextFrame *protobufs.ClockFrame
|
||||
if nextFrame, err = e.prove(latestFrame); err != nil {
|
||||
if nextFrame, err = e.prove(dataFrame); err != nil {
|
||||
e.logger.Error("could not prove", zap.Error(err))
|
||||
e.state = consensus.EngineStateCollecting
|
||||
continue
|
||||
@ -445,6 +450,15 @@ func (e *CeremonyDataClockConsensusEngine) runLoop() {
|
||||
e.logger.Error("could not collect", zap.Error(err))
|
||||
continue
|
||||
}
|
||||
|
||||
if latestFrame == nil ||
|
||||
latestFrame.FrameNumber < dataFrame.FrameNumber {
|
||||
latestFrame, err = e.dataTimeReel.Head()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
go func() {
|
||||
e.frameChan <- latestFrame
|
||||
}()
|
||||
|
@ -233,8 +233,6 @@ func (e *CeremonyDataClockConsensusEngine) sync(
|
||||
return latest, errors.Wrap(err, "sync")
|
||||
}
|
||||
|
||||
firstPass := true
|
||||
|
||||
var syncMsg *protobufs.CeremonyCompressedSync
|
||||
for syncMsg, err = s.Recv(); err == nil; syncMsg, err = s.Recv() {
|
||||
e.logger.Info(
|
||||
@ -251,21 +249,11 @@ func (e *CeremonyDataClockConsensusEngine) sync(
|
||||
// so let's not penalize their score and make everyone else suffer,
|
||||
// let's just move on:
|
||||
if syncMsg.FromFrameNumber == 0 &&
|
||||
syncMsg.ToFrameNumber == 0 &&
|
||||
firstPass {
|
||||
syncMsg.ToFrameNumber == 0 {
|
||||
if err := cc.Close(); err != nil {
|
||||
e.logger.Error("error while closing connection", zap.Error(err))
|
||||
}
|
||||
|
||||
e.peerMapMx.Lock()
|
||||
if _, ok := e.peerMap[string(peerId)]; ok {
|
||||
e.uncooperativePeersMap[string(peerId)] = e.peerMap[string(peerId)]
|
||||
e.uncooperativePeersMap[string(peerId)].timestamp = time.Now().
|
||||
UnixMilli()
|
||||
delete(e.peerMap, string(peerId))
|
||||
}
|
||||
e.peerMapMx.Unlock()
|
||||
|
||||
return currentLatest, errors.Wrap(ErrNoNewFrames, "sync")
|
||||
}
|
||||
|
||||
@ -273,7 +261,6 @@ func (e *CeremonyDataClockConsensusEngine) sync(
|
||||
if next, err = e.decompressAndStoreCandidates(
|
||||
peerId,
|
||||
syncMsg,
|
||||
e.logger.Info,
|
||||
); err != nil && !errors.Is(err, ErrNoNewFrames) {
|
||||
e.logger.Error(
|
||||
"could not decompress and store candidate",
|
||||
|
@ -7,7 +7,6 @@ import (
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"go.uber.org/zap"
|
||||
"go.uber.org/zap/zapcore"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
@ -184,7 +183,6 @@ func (e *CeremonyDataClockConsensusEngine) GetCompressedSyncFrames(
|
||||
func (e *CeremonyDataClockConsensusEngine) decompressAndStoreCandidates(
|
||||
peerId []byte,
|
||||
syncMsg *protobufs.CeremonyCompressedSync,
|
||||
loggerFunc func(msg string, fields ...zapcore.Field),
|
||||
) (*protobufs.ClockFrame, error) {
|
||||
if len(syncMsg.TruncatedClockFrames) == 0 {
|
||||
return nil, ErrNoNewFrames
|
||||
@ -207,13 +205,13 @@ func (e *CeremonyDataClockConsensusEngine) decompressAndStoreCandidates(
|
||||
for _, frame := range syncMsg.TruncatedClockFrames {
|
||||
frame := frame
|
||||
commits := (len(frame.Input) - 516) / 74
|
||||
loggerFunc(
|
||||
e.logger.Info(
|
||||
"processing frame",
|
||||
zap.Uint64("frame_number", frame.FrameNumber),
|
||||
zap.Int("aggregate_commits", commits),
|
||||
)
|
||||
for j := 0; j < commits; j++ {
|
||||
loggerFunc(
|
||||
e.logger.Info(
|
||||
"processing commit",
|
||||
zap.Uint64("frame_number", frame.FrameNumber),
|
||||
zap.Int("commit_index", j),
|
||||
@ -223,7 +221,7 @@ func (e *CeremonyDataClockConsensusEngine) decompressAndStoreCandidates(
|
||||
for _, a := range syncMsg.Proofs {
|
||||
a := a
|
||||
if bytes.Equal(a.FrameCommit, commit) {
|
||||
loggerFunc(
|
||||
e.logger.Info(
|
||||
"found matching proof",
|
||||
zap.Uint64("frame_number", frame.FrameNumber),
|
||||
zap.Int("commit_index", j),
|
||||
@ -254,7 +252,7 @@ func (e *CeremonyDataClockConsensusEngine) decompressAndStoreCandidates(
|
||||
for k, c := range aggregateProof.Commitments {
|
||||
k := k
|
||||
c := c
|
||||
loggerFunc(
|
||||
e.logger.Info(
|
||||
"adding inclusion commitment",
|
||||
zap.Uint64("frame_number", frame.FrameNumber),
|
||||
zap.Int("commit_index", j),
|
||||
@ -283,7 +281,7 @@ func (e *CeremonyDataClockConsensusEngine) decompressAndStoreCandidates(
|
||||
if bytes.Equal(s.Hash, h) {
|
||||
if output != nil {
|
||||
if l == 0 {
|
||||
loggerFunc(
|
||||
e.logger.Info(
|
||||
"found first half of matching segment data",
|
||||
zap.Uint64("frame_number", frame.FrameNumber),
|
||||
zap.Int("commit_index", j),
|
||||
@ -293,7 +291,7 @@ func (e *CeremonyDataClockConsensusEngine) decompressAndStoreCandidates(
|
||||
output.Address = s.Data[:32]
|
||||
output.Output = s.Data[32:]
|
||||
} else {
|
||||
loggerFunc(
|
||||
e.logger.Info(
|
||||
"found second half of matching segment data",
|
||||
zap.Uint64("frame_number", frame.FrameNumber),
|
||||
zap.Int("commit_index", j),
|
||||
@ -312,7 +310,7 @@ func (e *CeremonyDataClockConsensusEngine) decompressAndStoreCandidates(
|
||||
break
|
||||
}
|
||||
} else {
|
||||
loggerFunc(
|
||||
e.logger.Info(
|
||||
"found matching segment data",
|
||||
zap.Uint64("frame_number", frame.FrameNumber),
|
||||
zap.Int("commit_index", j),
|
||||
@ -357,10 +355,11 @@ func (e *CeremonyDataClockConsensusEngine) decompressAndStoreCandidates(
|
||||
); err != nil {
|
||||
return nil, errors.Wrap(err, "decompress and store candidates")
|
||||
}
|
||||
|
||||
final = frame
|
||||
}
|
||||
|
||||
loggerFunc(
|
||||
e.logger.Info(
|
||||
"decompressed and stored sync for range",
|
||||
zap.Uint64("from", syncMsg.FromFrameNumber),
|
||||
zap.Uint64("to", syncMsg.ToFrameNumber),
|
||||
|
@ -59,5 +59,5 @@ func GetMinimumVersion() []byte {
|
||||
}
|
||||
|
||||
func GetVersion() []byte {
|
||||
return []byte{0x01, 0x02, 0x0D}
|
||||
return []byte{0x01, 0x02, 0x0E}
|
||||
}
|
||||
|
@ -732,6 +732,14 @@ func (d *DataTimeReel) forkChoice(
|
||||
true,
|
||||
)
|
||||
if err != nil {
|
||||
d.logger.Error(
|
||||
"store corruption: a discontinuity has been found in your time reel",
|
||||
zap.String(
|
||||
"selector",
|
||||
hex.EncodeToString(leftIndex.ParentSelector),
|
||||
),
|
||||
zap.Uint64("frame_number", leftIndex.FrameNumber-1),
|
||||
)
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
@ -1386,7 +1386,11 @@ func (e *CeremonyExecutionEngine) VerifyExecution(
|
||||
parent, err := e.clockStore.GetParentDataClockFrame(
|
||||
append(
|
||||
p2p.GetBloomFilter(application.CEREMONY_ADDRESS, 256, 3),
|
||||
p2p.GetBloomFilterIndices(application.CEREMONY_ADDRESS, 65536, 24)...,
|
||||
p2p.GetBloomFilterIndices(
|
||||
application.CEREMONY_ADDRESS,
|
||||
65536,
|
||||
24,
|
||||
)...,
|
||||
),
|
||||
frame.FrameNumber-1,
|
||||
frame.ParentSelector,
|
||||
|
@ -307,5 +307,5 @@ func printLogo() {
|
||||
|
||||
func printVersion() {
|
||||
fmt.Println(" ")
|
||||
fmt.Println(" Quilibrium Node - v1.2.13 – Dawn")
|
||||
fmt.Println(" Quilibrium Node - v1.2.14 – Dawn")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user