From ab700df59466f84dd9a7a9e36fdb62a96fe766d1 Mon Sep 17 00:00:00 2001 From: Cassandra Heart <7929478+CassOnMars@users.noreply.github.com> Date: Tue, 20 Feb 2024 01:59:03 -0600 Subject: [PATCH] v1.2.10 (#57) * v1.2.10 * v1.2.10 --- node/app/db_console.go | 4 ++-- .../consensus/ceremony/broadcast_messaging.go | 8 -------- node/consensus/ceremony/consensus_frames.go | 7 +++++++ node/consensus/ceremony/peer_messaging.go | 14 ++++++++----- node/consensus/consensus_engine.go | 6 +++--- .../ceremony/ceremony_execution_engine.go | 20 +++++++++++++------ node/main.go | 4 ++-- 7 files changed, 37 insertions(+), 26 deletions(-) diff --git a/node/app/db_console.go b/node/app/db_console.go index ae32158..e5e5899 100644 --- a/node/app/db_console.go +++ b/node/app/db_console.go @@ -886,11 +886,11 @@ func logoVersion(width int) string { 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 += " DB Console\n" } else { - out = "Quilibrium Node - v1.2.9 – Dawn - DB Console\n" + out = "Quilibrium Node - v1.2.10 – Dawn - DB Console\n" } return out } diff --git a/node/consensus/ceremony/broadcast_messaging.go b/node/consensus/ceremony/broadcast_messaging.go index ed3a55c..02adb90 100644 --- a/node/consensus/ceremony/broadcast_messaging.go +++ b/node/consensus/ceremony/broadcast_messaging.go @@ -128,10 +128,6 @@ func (e *CeremonyDataClockConsensusEngine) handleCeremonyPeerListAnnounce( address []byte, any *anypb.Any, ) error { - if bytes.Equal(peerID, e.pubSub.GetPeerID()) { - return nil - } - announce := &protobufs.CeremonyPeerListAnnounce{} if err := any.UnmarshalTo(announce); err != nil { return errors.Wrap(err, "handle ceremony peer list announce") @@ -284,10 +280,6 @@ func (e *CeremonyDataClockConsensusEngine) handleClockFrameData( any *anypb.Any, isSync bool, ) error { - if isSync && bytes.Equal(peerID, e.pubSub.GetPeerID()) { - return nil - } - frame := &protobufs.ClockFrame{} if err := any.UnmarshalTo(frame); err != nil { return errors.Wrap(err, "handle clock frame data") diff --git a/node/consensus/ceremony/consensus_frames.go b/node/consensus/ceremony/consensus_frames.go index ba16361..5f947b0 100644 --- a/node/consensus/ceremony/consensus_frames.go +++ b/node/consensus/ceremony/consensus_frames.go @@ -151,6 +151,13 @@ func (e *CeremonyDataClockConsensusEngine) GetMostAheadPeer() ( 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 var peer []byte = nil for _, v := range e.peerMap { diff --git a/node/consensus/ceremony/peer_messaging.go b/node/consensus/ceremony/peer_messaging.go index 4cbb7b6..68bd243 100644 --- a/node/consensus/ceremony/peer_messaging.go +++ b/node/consensus/ceremony/peer_messaging.go @@ -72,7 +72,7 @@ func (e *CeremonyDataClockConsensusEngine) GetCompressedSyncFrames( if parent != nil { if !bytes.Equal(frame.ParentSelector, parent) { - e.logger.Info( + e.logger.Debug( "peer specified out of consensus head, seeking backwards for fork", ) } @@ -95,7 +95,11 @@ func (e *CeremonyDataClockConsensusEngine) GetCompressedSyncFrames( parent, ) if err != nil { - from = frame.FrameNumber - 16 + if frame.FrameNumber > 18 { + from = frame.FrameNumber - 16 + } else { + from = 2 + } e.logger.Debug("peer fully out of sync, rewinding sync head to min") break } @@ -121,9 +125,9 @@ func (e *CeremonyDataClockConsensusEngine) GetCompressedSyncFrames( } for { - if to == 0 || to-from > 32 { - if max > from+31 { - to = from + 32 + if to == 0 || to-from > 16 { + if max > from+15 { + to = from + 16 } else { to = max + 1 } diff --git a/node/consensus/consensus_engine.go b/node/consensus/consensus_engine.go index d0f8b08..97cce14 100644 --- a/node/consensus/consensus_engine.go +++ b/node/consensus/consensus_engine.go @@ -51,13 +51,13 @@ type DataConsensusEngine interface { } 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 { - return []byte{0x01, 0x02, 0x09} + return []byte{0x01, 0x02, 0x0A} } func GetVersion() []byte { - return []byte{0x01, 0x02, 0x09} + return []byte{0x01, 0x02, 0x0A} } diff --git a/node/execution/intrinsics/ceremony/ceremony_execution_engine.go b/node/execution/intrinsics/ceremony/ceremony_execution_engine.go index 4de6e15..fe23818 100644 --- a/node/execution/intrinsics/ceremony/ceremony_execution_engine.go +++ b/node/execution/intrinsics/ceremony/ceremony_execution_engine.go @@ -62,6 +62,8 @@ type CeremonyExecutionEngine struct { frameProver qcrypto.FrameProver } +const validCeremonySelector = "253f3a6383dcfe91cf49abd20204b3e6ef5afd4c70c1968bb1f0b827a72af53b" + func NewCeremonyExecutionEngine( logger *zap.Logger, engineConfig *config.EngineConfig, @@ -93,16 +95,22 @@ func NewCeremonyExecutionEngine( var proverKeys [][]byte rebuildGenesisFrame := false - if frame != nil && - len(frame.AggregateProofs[0].InclusionCommitments[0].Data) < 2000 { - logger.Warn("corrupted genesis frame detected, rebuilding") - - err = clockStore.ResetDataClockFrames(intrinsicFilter) + if frame != nil { + selector, err := frame.GetSelector() if err != nil { panic(err) } - rebuildGenesisFrame = true + if selector.Text(16) != validCeremonySelector { + logger.Warn("corrupted genesis frame detected, rebuilding") + + err = clockStore.ResetDataClockFrames(intrinsicFilter) + if err != nil { + panic(err) + } + + rebuildGenesisFrame = true + } } if err != nil && errors.Is(err, store.ErrNotFound) || rebuildGenesisFrame { diff --git a/node/main.go b/node/main.go index fef32f1..b657290 100644 --- a/node/main.go +++ b/node/main.go @@ -66,7 +66,7 @@ func main() { if *memprofile != "" { go func() { for { - time.Sleep(20 * time.Minute) + time.Sleep(5 * time.Minute) f, err := os.Create(*memprofile) if err != nil { log.Fatal(err) @@ -306,5 +306,5 @@ func printLogo() { func printVersion() { fmt.Println(" ") - fmt.Println(" Quilibrium Node - v1.2.9 – Dawn") + fmt.Println(" Quilibrium Node - v1.2.10 – Dawn") }