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") }