From 53d4664ab71525390f9148718c19eeb305505b18 Mon Sep 17 00:00:00 2001 From: Cassandra Heart <7929478+CassOnMars@users.noreply.github.com> Date: Sun, 18 Feb 2024 18:28:29 -0600 Subject: [PATCH] v1.2.9 (#51) --- .gitignore | 1 + node/app/db_console.go | 4 +-- .../ceremony_data_clock_consensus_engine.go | 28 +++++++++---------- node/consensus/ceremony/consensus_frames.go | 3 +- node/consensus/consensus_engine.go | 6 ++-- node/consensus/master/peer_messaging.go | 1 - node/main.go | 24 +++++++++++++++- 7 files changed, 45 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 64c4e06..e1d3bba 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ vouchers/ ceremony-client .config* .DS_Store +*.mprof diff --git a/node/app/db_console.go b/node/app/db_console.go index 3f1cc74..ae32158 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.8 – Dawn\n" + out += " Quilibrium Node - v1.2.9 – Dawn\n" out += " \n" out += " DB Console\n" } else { - out = "Quilibrium Node - v1.2.8 – Dawn - DB Console\n" + out = "Quilibrium Node - v1.2.9 – Dawn - DB Console\n" } return out } diff --git a/node/consensus/ceremony/ceremony_data_clock_consensus_engine.go b/node/consensus/ceremony/ceremony_data_clock_consensus_engine.go index aefa019..d6f6cf3 100644 --- a/node/consensus/ceremony/ceremony_data_clock_consensus_engine.go +++ b/node/consensus/ceremony/ceremony_data_clock_consensus_engine.go @@ -414,17 +414,17 @@ func (e *CeremonyDataClockConsensusEngine) runLoop() { e.frameChan <- latestFrame }() - var nextFrame *protobufs.ClockFrame - if nextFrame, err = e.prove(latestFrame); err != nil { - e.logger.Error("could not prove", zap.Error(err)) - e.state = consensus.EngineStateCollecting - continue - } - if bytes.Equal( e.frameProverTrie.FindNearest(e.provingKeyAddress).External.Key, e.provingKeyAddress, ) { + var nextFrame *protobufs.ClockFrame + if nextFrame, err = e.prove(latestFrame); err != nil { + e.logger.Error("could not prove", zap.Error(err)) + e.state = consensus.EngineStateCollecting + continue + } + e.dataTimeReel.Insert(nextFrame) if err = e.publishProof(nextFrame); err != nil { @@ -447,14 +447,14 @@ func (e *CeremonyDataClockConsensusEngine) runLoop() { e.frameChan <- latestFrame }() - var nextFrame *protobufs.ClockFrame - if nextFrame, err = e.prove(latestFrame); err != nil { - e.logger.Error("could not prove", zap.Error(err)) - e.state = consensus.EngineStateCollecting - continue - } - if e.frameProverTrie.Contains(e.provingKeyAddress) { + var nextFrame *protobufs.ClockFrame + if nextFrame, err = e.prove(latestFrame); err != nil { + e.logger.Error("could not prove", zap.Error(err)) + e.state = consensus.EngineStateCollecting + continue + } + e.dataTimeReel.Insert(nextFrame) if err = e.publishProof(nextFrame); err != nil { diff --git a/node/consensus/ceremony/consensus_frames.go b/node/consensus/ceremony/consensus_frames.go index d196c18..ba16361 100644 --- a/node/consensus/ceremony/consensus_frames.go +++ b/node/consensus/ceremony/consensus_frames.go @@ -206,7 +206,8 @@ func (e *CeremonyDataClockConsensusEngine) sync( &protobufs.ClockFramesRequest{ Filter: e.filter, FromFrameNumber: from, - ToFrameNumber: from + 8, + ToFrameNumber: maxFrame, + ParentSelector: latest.ParentSelector, }, grpc.MaxCallRecvMsgSize(600*1024*1024), ) diff --git a/node/consensus/consensus_engine.go b/node/consensus/consensus_engine.go index 74a0c5a..d0f8b08 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, 13, 7, 0, 0, 0, time.UTC) + return time.Date(2024, time.February, 19, 0, 0, 0, 0, time.UTC) } func GetMinimumVersion() []byte { - return []byte{0x01, 0x02, 0x04} + return []byte{0x01, 0x02, 0x09} } func GetVersion() []byte { - return []byte{0x01, 0x02, 0x08} + return []byte{0x01, 0x02, 0x09} } diff --git a/node/consensus/master/peer_messaging.go b/node/consensus/master/peer_messaging.go index 3799901..65e79d5 100644 --- a/node/consensus/master/peer_messaging.go +++ b/node/consensus/master/peer_messaging.go @@ -75,7 +75,6 @@ func (e *MasterClockConsensusEngine) handleClockFramesResponse( zap.Binary("peer_id", peerID), zap.Binary("expected_peer_id", e.syncingTarget), ) - return nil } e.syncingStatus = SyncStatusSynchronizing diff --git a/node/main.go b/node/main.go index 4fd35d8..fef32f1 100644 --- a/node/main.go +++ b/node/main.go @@ -7,10 +7,13 @@ import ( "flag" "fmt" "io/fs" + "log" "os" "os/signal" "path/filepath" + "runtime/pprof" "syscall" + "time" "source.quilibrium.com/quilibrium/monorepo/node/protobufs" @@ -50,11 +53,30 @@ var ( false, "print the peer id to stdout from the config and exit", ) + memprofile = flag.String( + "memprofile", + "", + "write memory profile after 20m to this file", + ) ) func main() { flag.Parse() + if *memprofile != "" { + go func() { + for { + time.Sleep(20 * time.Minute) + f, err := os.Create(*memprofile) + if err != nil { + log.Fatal(err) + } + pprof.WriteHeapProfile(f) + f.Close() + } + }() + } + if *balance { config, err := config.LoadConfig(*configDirectory, "") if err != nil { @@ -284,5 +306,5 @@ func printLogo() { func printVersion() { fmt.Println(" ") - fmt.Println(" Quilibrium Node - v1.2.8 – Dawn") + fmt.Println(" Quilibrium Node - v1.2.9 – Dawn") }