mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-26 00:25:17 +00:00
v1.1.8 (#27)
This commit is contained in:
parent
00a471e84d
commit
e381165568
@ -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
|
||||
}
|
||||
|
@ -332,6 +332,8 @@ func (e *CeremonyDataClockConsensusEngine) Start(
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
latest = e.performSanityCheck(latest)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
@ -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 {
|
||||
|
@ -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}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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")
|
||||
}
|
||||
|
@ -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,8 +535,11 @@ func discoverPeers(
|
||||
go func() {
|
||||
for {
|
||||
time.Sleep(30 * time.Second)
|
||||
if len(h.Network().Peers()) == 0 {
|
||||
logger.Info("reinitiating discovery")
|
||||
discover()
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
logger.Info("completed initial peer discovery")
|
||||
|
Loading…
Reference in New Issue
Block a user