This commit is contained in:
Cassandra Heart 2023-12-01 23:44:24 -06:00 committed by GitHub
parent 00a471e84d
commit e381165568
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 43 additions and 16 deletions

View File

@ -812,11 +812,11 @@ func logoVersion(width int) string {
out += " ####################################### ########\n"
out += " ############################# ##\n"
out += " \n"
out += " Quilibrium Node - v1.1.7 Dawn\n"
out += " Quilibrium Node - v1.1.8 Dawn\n"
out += " \n"
out += " DB Console\n"
} else {
out = "Quilibrium Node - v1.1.7 Dawn - DB Console\n"
out = "Quilibrium Node - v1.1.8 Dawn - DB Console\n"
}
return out
}

View File

@ -332,6 +332,8 @@ func (e *CeremonyDataClockConsensusEngine) Start(
panic(err)
}
}
latest = e.performSanityCheck(latest)
}
}
}()

View File

@ -704,7 +704,7 @@ func (e *CeremonyDataClockConsensusEngine) commitLongestPath(
zap.Int("commit_depth", len(runningFrames[0])),
)
for _, s := range runningFrames[0][1:] {
for _, s := range runningFrames[0][0:] {
s := s
txn, err := e.clockStore.NewTransaction()
if err != nil {

View File

@ -52,13 +52,13 @@ type DataConsensusEngine interface {
}
func GetMinimumVersionCutoff() time.Time {
return time.Date(2023, time.November, 3, 0, 0, 0, 0, time.UTC)
return time.Date(2023, time.December, 2, 7, 0, 0, 0, time.UTC)
}
func GetMinimumVersion() []byte {
return []byte{0x01, 0x01, 0x05}
return []byte{0x01, 0x01, 0x08}
}
func GetVersion() []byte {
return []byte{0x01, 0x01, 0x06}
return []byte{0x01, 0x01, 0x08}
}

View File

@ -14,6 +14,8 @@ var ErrInvalidStateTransition = errors.New("invalid state transition")
type CeremonyApplicationState int
const V118_CUTOFF = uint64(45000)
var CEREMONY_ADDRESS = []byte{
// SHA3-256("q_kzg_ceremony")
0x34, 0x00, 0x1b, 0xe7, 0x43, 0x2c, 0x2e, 0x66,
@ -750,6 +752,7 @@ func (a *CeremonyApplication) ApplyTransition(
return a, nil
case CEREMONY_APPLICATION_STATE_IN_PROGRESS:
a.StateCount++
for i, url := range transition.TypeUrls {
switch url {
case protobufs.CeremonySeenProverAttestationType:
@ -774,6 +777,7 @@ func (a *CeremonyApplication) ApplyTransition(
if err = a.applySeenProverAttestation(seenProverAtt); err != nil {
return nil, errors.Wrap(err, "apply transition")
}
a.StateCount = 0
case protobufs.CeremonyDroppedProverAttestationType:
droppedProverAtt := &protobufs.CeremonyDroppedProverAttestation{}
err := proto.Unmarshal(transition.TransitionInputs[i], droppedProverAtt)
@ -796,6 +800,7 @@ func (a *CeremonyApplication) ApplyTransition(
if err = a.applyDroppedProverAttestation(droppedProverAtt); err != nil {
return nil, errors.Wrap(err, "apply transition")
}
a.StateCount = 0
case protobufs.CeremonyTranscriptCommitType:
transcriptCommit := &protobufs.CeremonyTranscriptCommit{}
err := proto.Unmarshal(transition.TransitionInputs[i], transcriptCommit)
@ -806,6 +811,7 @@ func (a *CeremonyApplication) ApplyTransition(
if err = a.applyTranscriptCommit(transcriptCommit); err != nil {
return nil, errors.Wrap(err, "apply transition")
}
a.StateCount = 0
default:
return a, nil
}
@ -850,6 +856,10 @@ func (a *CeremonyApplication) ApplyTransition(
}
}
if currentFrameNumber > V118_CUTOFF && a.StateCount > 100 {
shouldReset = true
}
if shouldReset {
a.LobbyState = CEREMONY_APPLICATION_STATE_OPEN
a.StateCount = 0
@ -877,6 +887,7 @@ func (a *CeremonyApplication) ApplyTransition(
return a, nil
case CEREMONY_APPLICATION_STATE_FINALIZING:
a.StateCount++
for i, url := range transition.TypeUrls {
switch url {
case protobufs.CeremonySeenProverAttestationType:
@ -901,6 +912,7 @@ func (a *CeremonyApplication) ApplyTransition(
if err = a.applySeenProverAttestation(seenProverAtt); err != nil {
return nil, errors.Wrap(err, "apply transition")
}
a.StateCount = 0
case protobufs.CeremonyDroppedProverAttestationType:
droppedProverAtt := &protobufs.CeremonyDroppedProverAttestation{}
err := proto.Unmarshal(transition.TransitionInputs[i], droppedProverAtt)
@ -923,6 +935,7 @@ func (a *CeremonyApplication) ApplyTransition(
if err = a.applyDroppedProverAttestation(droppedProverAtt); err != nil {
return nil, errors.Wrap(err, "apply transition")
}
a.StateCount = 0
case protobufs.CeremonyTranscriptShareType:
transcriptShare := &protobufs.CeremonyTranscriptShare{}
err := proto.Unmarshal(transition.TransitionInputs[i], transcriptShare)
@ -933,6 +946,7 @@ func (a *CeremonyApplication) ApplyTransition(
if err = a.applyTranscriptShare(transcriptShare); err != nil {
return nil, errors.Wrap(err, "apply transition")
}
a.StateCount = 0
default:
return a, nil
}
@ -970,6 +984,10 @@ func (a *CeremonyApplication) ApplyTransition(
}
}
if currentFrameNumber > V118_CUTOFF && a.StateCount > 100 {
shouldReset = true
}
if shouldReset {
a.LobbyState = CEREMONY_APPLICATION_STATE_OPEN
a.StateCount = 0
@ -999,6 +1017,7 @@ func (a *CeremonyApplication) ApplyTransition(
return a, nil
case CEREMONY_APPLICATION_STATE_VALIDATING:
a.StateCount++
for i, url := range transition.TypeUrls {
switch url {
case protobufs.CeremonyTranscriptType:
@ -1011,6 +1030,7 @@ func (a *CeremonyApplication) ApplyTransition(
if err = a.applyTranscript(transcript); err != nil {
return nil, errors.Wrap(err, "apply transition")
}
a.StateCount = 0
default:
return a, nil
}

View File

@ -233,5 +233,5 @@ func printLogo() {
func printVersion() {
fmt.Println(" ")
fmt.Println(" Quilibrium Node - v1.1.7 Dawn")
fmt.Println(" Quilibrium Node - v1.1.8 Dawn")
}

View File

@ -117,20 +117,22 @@ func NewBlossomSub(
}
}
blossomOpts := []blossomsub.Option{}
blossomOpts := []blossomsub.Option{
blossomsub.WithPeerExchange(true),
}
if tracer != nil {
blossomOpts = append(blossomOpts, blossomsub.WithEventTracer(tracer))
}
blossomOpts = append(blossomOpts, blossomsub.WithPeerScore(
&blossomsub.PeerScoreParams{
SkipAtomicValidation: false,
BitmaskScoreCap: 0,
BitmaskScoreCap: 100,
IPColocationFactorWeight: -1,
IPColocationFactorThreshold: 6,
BehaviourPenaltyWeight: -1,
BehaviourPenaltyWeight: -80,
BehaviourPenaltyThreshold: 100,
BehaviourPenaltyDecay: .5,
DecayInterval: time.Minute,
DecayInterval: 10 * time.Second,
DecayToZero: .1,
RetainScore: 5 * time.Minute,
AppSpecificScore: func(p peer.ID) float64 {
@ -140,10 +142,10 @@ func NewBlossomSub(
},
&blossomsub.PeerScoreThresholds{
SkipAtomicValidation: false,
GossipThreshold: -100,
PublishThreshold: -100,
GraylistThreshold: -100,
AcceptPXThreshold: 1,
GossipThreshold: -2000,
PublishThreshold: -5000,
GraylistThreshold: -10000,
AcceptPXThreshold: 100,
OpportunisticGraftThreshold: 2,
}))
@ -533,7 +535,10 @@ func discoverPeers(
go func() {
for {
time.Sleep(30 * time.Second)
discover()
if len(h.Network().Peers()) == 0 {
logger.Info("reinitiating discovery")
discover()
}
}
}()