mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-11-14 12:15:18 +00:00
parent
f8726882de
commit
ab700df594
@ -886,11 +886,11 @@ func logoVersion(width int) string {
|
|||||||
out += " ####################################### ########\n"
|
out += " ####################################### ########\n"
|
||||||
out += " ############################# ##\n"
|
out += " ############################# ##\n"
|
||||||
out += " \n"
|
out += " \n"
|
||||||
out += " Quilibrium Node - v1.2.9 – Dawn\n"
|
out += " Quilibrium Node - v1.2.10 – Dawn\n"
|
||||||
out += " \n"
|
out += " \n"
|
||||||
out += " DB Console\n"
|
out += " DB Console\n"
|
||||||
} else {
|
} else {
|
||||||
out = "Quilibrium Node - v1.2.9 – Dawn - DB Console\n"
|
out = "Quilibrium Node - v1.2.10 – Dawn - DB Console\n"
|
||||||
}
|
}
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
@ -128,10 +128,6 @@ func (e *CeremonyDataClockConsensusEngine) handleCeremonyPeerListAnnounce(
|
|||||||
address []byte,
|
address []byte,
|
||||||
any *anypb.Any,
|
any *anypb.Any,
|
||||||
) error {
|
) error {
|
||||||
if bytes.Equal(peerID, e.pubSub.GetPeerID()) {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
announce := &protobufs.CeremonyPeerListAnnounce{}
|
announce := &protobufs.CeremonyPeerListAnnounce{}
|
||||||
if err := any.UnmarshalTo(announce); err != nil {
|
if err := any.UnmarshalTo(announce); err != nil {
|
||||||
return errors.Wrap(err, "handle ceremony peer list announce")
|
return errors.Wrap(err, "handle ceremony peer list announce")
|
||||||
@ -284,10 +280,6 @@ func (e *CeremonyDataClockConsensusEngine) handleClockFrameData(
|
|||||||
any *anypb.Any,
|
any *anypb.Any,
|
||||||
isSync bool,
|
isSync bool,
|
||||||
) error {
|
) error {
|
||||||
if isSync && bytes.Equal(peerID, e.pubSub.GetPeerID()) {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
frame := &protobufs.ClockFrame{}
|
frame := &protobufs.ClockFrame{}
|
||||||
if err := any.UnmarshalTo(frame); err != nil {
|
if err := any.UnmarshalTo(frame); err != nil {
|
||||||
return errors.Wrap(err, "handle clock frame data")
|
return errors.Wrap(err, "handle clock frame data")
|
||||||
|
@ -151,6 +151,13 @@ func (e *CeremonyDataClockConsensusEngine) GetMostAheadPeer() (
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e.logger.Info(
|
||||||
|
"checking peer list",
|
||||||
|
zap.Int("peers", len(e.peerMap)),
|
||||||
|
zap.Int("uncooperative_peers", len(e.uncooperativePeersMap)),
|
||||||
|
zap.Uint64("current_head_frame", frame.FrameNumber),
|
||||||
|
)
|
||||||
|
|
||||||
max := frame.FrameNumber
|
max := frame.FrameNumber
|
||||||
var peer []byte = nil
|
var peer []byte = nil
|
||||||
for _, v := range e.peerMap {
|
for _, v := range e.peerMap {
|
||||||
|
@ -72,7 +72,7 @@ func (e *CeremonyDataClockConsensusEngine) GetCompressedSyncFrames(
|
|||||||
|
|
||||||
if parent != nil {
|
if parent != nil {
|
||||||
if !bytes.Equal(frame.ParentSelector, parent) {
|
if !bytes.Equal(frame.ParentSelector, parent) {
|
||||||
e.logger.Info(
|
e.logger.Debug(
|
||||||
"peer specified out of consensus head, seeking backwards for fork",
|
"peer specified out of consensus head, seeking backwards for fork",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -95,7 +95,11 @@ func (e *CeremonyDataClockConsensusEngine) GetCompressedSyncFrames(
|
|||||||
parent,
|
parent,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if frame.FrameNumber > 18 {
|
||||||
from = frame.FrameNumber - 16
|
from = frame.FrameNumber - 16
|
||||||
|
} else {
|
||||||
|
from = 2
|
||||||
|
}
|
||||||
e.logger.Debug("peer fully out of sync, rewinding sync head to min")
|
e.logger.Debug("peer fully out of sync, rewinding sync head to min")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -121,9 +125,9 @@ func (e *CeremonyDataClockConsensusEngine) GetCompressedSyncFrames(
|
|||||||
}
|
}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
if to == 0 || to-from > 32 {
|
if to == 0 || to-from > 16 {
|
||||||
if max > from+31 {
|
if max > from+15 {
|
||||||
to = from + 32
|
to = from + 16
|
||||||
} else {
|
} else {
|
||||||
to = max + 1
|
to = max + 1
|
||||||
}
|
}
|
||||||
|
@ -51,13 +51,13 @@ type DataConsensusEngine interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetMinimumVersionCutoff() time.Time {
|
func GetMinimumVersionCutoff() time.Time {
|
||||||
return time.Date(2024, time.February, 19, 0, 0, 0, 0, time.UTC)
|
return time.Date(2024, time.February, 20, 7, 0, 0, 0, time.UTC)
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetMinimumVersion() []byte {
|
func GetMinimumVersion() []byte {
|
||||||
return []byte{0x01, 0x02, 0x09}
|
return []byte{0x01, 0x02, 0x0A}
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetVersion() []byte {
|
func GetVersion() []byte {
|
||||||
return []byte{0x01, 0x02, 0x09}
|
return []byte{0x01, 0x02, 0x0A}
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,8 @@ type CeremonyExecutionEngine struct {
|
|||||||
frameProver qcrypto.FrameProver
|
frameProver qcrypto.FrameProver
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const validCeremonySelector = "253f3a6383dcfe91cf49abd20204b3e6ef5afd4c70c1968bb1f0b827a72af53b"
|
||||||
|
|
||||||
func NewCeremonyExecutionEngine(
|
func NewCeremonyExecutionEngine(
|
||||||
logger *zap.Logger,
|
logger *zap.Logger,
|
||||||
engineConfig *config.EngineConfig,
|
engineConfig *config.EngineConfig,
|
||||||
@ -93,8 +95,13 @@ func NewCeremonyExecutionEngine(
|
|||||||
var proverKeys [][]byte
|
var proverKeys [][]byte
|
||||||
|
|
||||||
rebuildGenesisFrame := false
|
rebuildGenesisFrame := false
|
||||||
if frame != nil &&
|
if frame != nil {
|
||||||
len(frame.AggregateProofs[0].InclusionCommitments[0].Data) < 2000 {
|
selector, err := frame.GetSelector()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if selector.Text(16) != validCeremonySelector {
|
||||||
logger.Warn("corrupted genesis frame detected, rebuilding")
|
logger.Warn("corrupted genesis frame detected, rebuilding")
|
||||||
|
|
||||||
err = clockStore.ResetDataClockFrames(intrinsicFilter)
|
err = clockStore.ResetDataClockFrames(intrinsicFilter)
|
||||||
@ -104,6 +111,7 @@ func NewCeremonyExecutionEngine(
|
|||||||
|
|
||||||
rebuildGenesisFrame = true
|
rebuildGenesisFrame = true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if err != nil && errors.Is(err, store.ErrNotFound) || rebuildGenesisFrame {
|
if err != nil && errors.Is(err, store.ErrNotFound) || rebuildGenesisFrame {
|
||||||
origin, inclusionProof, proverKeys = CreateGenesisState(
|
origin, inclusionProof, proverKeys = CreateGenesisState(
|
||||||
|
@ -66,7 +66,7 @@ func main() {
|
|||||||
if *memprofile != "" {
|
if *memprofile != "" {
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
time.Sleep(20 * time.Minute)
|
time.Sleep(5 * time.Minute)
|
||||||
f, err := os.Create(*memprofile)
|
f, err := os.Create(*memprofile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
@ -306,5 +306,5 @@ func printLogo() {
|
|||||||
|
|
||||||
func printVersion() {
|
func printVersion() {
|
||||||
fmt.Println(" ")
|
fmt.Println(" ")
|
||||||
fmt.Println(" Quilibrium Node - v1.2.9 – Dawn")
|
fmt.Println(" Quilibrium Node - v1.2.10 – Dawn")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user