From a0a8ffc4e7c6317ca81341fe10a0471659bb05f9 Mon Sep 17 00:00:00 2001 From: Cassandra Heart <7929478+CassOnMars@users.noreply.github.com> Date: Thu, 22 Feb 2024 00:07:17 -0600 Subject: [PATCH] v1.2.13 (#64) --- node/app/db_console.go | 4 ++-- node/consensus/ceremony/peer_messaging.go | 10 ++++------ node/consensus/consensus_engine.go | 4 ++-- node/consensus/time/data_time_reel.go | 7 +++++++ .../ceremony/ceremony_execution_engine.go | 1 + node/main.go | 2 +- node/store/clock.go | 14 +++++++++----- 7 files changed, 26 insertions(+), 16 deletions(-) diff --git a/node/app/db_console.go b/node/app/db_console.go index 9c064bc..8fef0c4 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.12 – Dawn\n" + out += " Quilibrium Node - v1.2.13 – Dawn\n" out += " \n" out += " DB Console\n" } else { - out = "Quilibrium Node - v1.2.12 – Dawn - DB Console\n" + out = "Quilibrium Node - v1.2.13 – Dawn - DB Console\n" } return out } diff --git a/node/consensus/ceremony/peer_messaging.go b/node/consensus/ceremony/peer_messaging.go index c5d4c4a..30fa572 100644 --- a/node/consensus/ceremony/peer_messaging.go +++ b/node/consensus/ceremony/peer_messaging.go @@ -104,6 +104,7 @@ func (e *CeremonyDataClockConsensusEngine) GetCompressedSyncFrames( e.filter, frame.FrameNumber-1, frame.ParentSelector, + true, ) if err != nil { from = 1 @@ -115,14 +116,11 @@ func (e *CeremonyDataClockConsensusEngine) GetCompressedSyncFrames( e.filter, frame.FrameNumber-1, parent, + true, ) if err != nil { - if frame.FrameNumber > 18 { - from = frame.FrameNumber - 16 - } else { - from = 2 - } - e.logger.Debug("peer fully out of sync, rewinding sync head to min") + from = 1 + e.logger.Debug("peer fully out of sync, rewinding sync head to start") break } diff --git a/node/consensus/consensus_engine.go b/node/consensus/consensus_engine.go index 2afcb43..62a6465 100644 --- a/node/consensus/consensus_engine.go +++ b/node/consensus/consensus_engine.go @@ -55,9 +55,9 @@ func GetMinimumVersionCutoff() time.Time { } func GetMinimumVersion() []byte { - return []byte{0x01, 0x02, 0x0B} + return []byte{0x01, 0x02, 0x0D} } func GetVersion() []byte { - return []byte{0x01, 0x02, 0x0C} + return []byte{0x01, 0x02, 0x0D} } diff --git a/node/consensus/time/data_time_reel.go b/node/consensus/time/data_time_reel.go index 5c14889..4a31245 100644 --- a/node/consensus/time/data_time_reel.go +++ b/node/consensus/time/data_time_reel.go @@ -416,6 +416,7 @@ func (d *DataTimeReel) addPending( frame.Filter, frame.FrameNumber, selector.FillBytes(make([]byte, 32)), + true, ); err != nil && existing == nil { d.logger.Debug( "not stored yet, save data candidate", @@ -524,6 +525,7 @@ func (d *DataTimeReel) processPending( d.filter, f, next.selector.FillBytes(make([]byte, 32)), + false, ) if err != nil && !errors.Is(err, store.ErrNotFound) { panic(err) @@ -597,6 +599,7 @@ func (d *DataTimeReel) getTotalDistance(frame *protobufs.ClockFrame) *big.Int { d.filter, index.FrameNumber-1, index.ParentSelector, + true, ) { distance, err := d.GetDistance(index) if err != nil { @@ -681,6 +684,7 @@ func (d *DataTimeReel) forkChoice( d.filter, rightIndex.FrameNumber-1, rightIndex.ParentSelector, + true, ) if err != nil { // If lineage cannot be verified, set it for later @@ -725,6 +729,7 @@ func (d *DataTimeReel) forkChoice( d.filter, leftIndex.FrameNumber-1, leftIndex.ParentSelector, + true, ) if err != nil { panic(err) @@ -734,6 +739,7 @@ func (d *DataTimeReel) forkChoice( d.filter, rightIndex.FrameNumber-1, rightIndex.ParentSelector, + true, ) if err != nil { // If lineage cannot be verified, set it for later @@ -788,6 +794,7 @@ func (d *DataTimeReel) forkChoice( d.filter, frameNumber, next, + false, ) if err != nil { panic(err) diff --git a/node/execution/intrinsics/ceremony/ceremony_execution_engine.go b/node/execution/intrinsics/ceremony/ceremony_execution_engine.go index fe23818..3d4b99d 100644 --- a/node/execution/intrinsics/ceremony/ceremony_execution_engine.go +++ b/node/execution/intrinsics/ceremony/ceremony_execution_engine.go @@ -1390,6 +1390,7 @@ func (e *CeremonyExecutionEngine) VerifyExecution( ), frame.FrameNumber-1, frame.ParentSelector, + false, ) if err != nil && !errors.Is(err, store.ErrNotFound) { return errors.Wrap(err, "verify execution") diff --git a/node/main.go b/node/main.go index bc1f5d5..ed53e86 100644 --- a/node/main.go +++ b/node/main.go @@ -306,5 +306,5 @@ func printLogo() { func printVersion() { fmt.Println(" ") - fmt.Println(" Quilibrium Node - v1.2.12 – Dawn") + fmt.Println(" Quilibrium Node - v1.2.13 – Dawn") } diff --git a/node/store/clock.go b/node/store/clock.go index 3e92d74..702007b 100644 --- a/node/store/clock.go +++ b/node/store/clock.go @@ -72,6 +72,7 @@ type ClockStore interface { filter []byte, frameNumber uint64, parentSelector []byte, + truncate bool, ) (*protobufs.ClockFrame, error) RangeCandidateDataClockFrames( filter []byte, @@ -850,6 +851,7 @@ func (p *PebbleClockStore) GetParentDataClockFrame( filter []byte, frameNumber uint64, parentSelector []byte, + truncate bool, ) (*protobufs.ClockFrame, error) { check := false data, closer, err := p.db.Get( @@ -880,11 +882,13 @@ func (p *PebbleClockStore) GetParentDataClockFrame( } } - if err := p.fillAggregateProofs(parent); err != nil { - return nil, errors.Wrap( - errors.Wrap(err, ErrInvalidData.Error()), - "get clock frame iterator value", - ) + if !truncate { + if err := p.fillAggregateProofs(parent); err != nil { + return nil, errors.Wrap( + errors.Wrap(err, ErrInvalidData.Error()), + "get clock frame iterator value", + ) + } } if closer != nil {