mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-12-25 08:05: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 += " ############################# ##\n"
|
||||||
out += " \n"
|
out += " \n"
|
||||||
out += " Quilibrium Node - v1.1.7 – Dawn\n"
|
out += " Quilibrium Node - v1.1.8 – Dawn\n"
|
||||||
out += " \n"
|
out += " \n"
|
||||||
out += " DB Console\n"
|
out += " DB Console\n"
|
||||||
} else {
|
} else {
|
||||||
out = "Quilibrium Node - v1.1.7 – Dawn - DB Console\n"
|
out = "Quilibrium Node - v1.1.8 – Dawn - DB Console\n"
|
||||||
}
|
}
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
@ -332,6 +332,8 @@ func (e *CeremonyDataClockConsensusEngine) Start(
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
latest = e.performSanityCheck(latest)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
@ -704,7 +704,7 @@ func (e *CeremonyDataClockConsensusEngine) commitLongestPath(
|
|||||||
zap.Int("commit_depth", len(runningFrames[0])),
|
zap.Int("commit_depth", len(runningFrames[0])),
|
||||||
)
|
)
|
||||||
|
|
||||||
for _, s := range runningFrames[0][1:] {
|
for _, s := range runningFrames[0][0:] {
|
||||||
s := s
|
s := s
|
||||||
txn, err := e.clockStore.NewTransaction()
|
txn, err := e.clockStore.NewTransaction()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -52,13 +52,13 @@ type DataConsensusEngine interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetMinimumVersionCutoff() time.Time {
|
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 {
|
func GetMinimumVersion() []byte {
|
||||||
return []byte{0x01, 0x01, 0x05}
|
return []byte{0x01, 0x01, 0x08}
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetVersion() []byte {
|
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
|
type CeremonyApplicationState int
|
||||||
|
|
||||||
|
const V118_CUTOFF = uint64(45000)
|
||||||
|
|
||||||
var CEREMONY_ADDRESS = []byte{
|
var CEREMONY_ADDRESS = []byte{
|
||||||
// SHA3-256("q_kzg_ceremony")
|
// SHA3-256("q_kzg_ceremony")
|
||||||
0x34, 0x00, 0x1b, 0xe7, 0x43, 0x2c, 0x2e, 0x66,
|
0x34, 0x00, 0x1b, 0xe7, 0x43, 0x2c, 0x2e, 0x66,
|
||||||
@ -750,6 +752,7 @@ func (a *CeremonyApplication) ApplyTransition(
|
|||||||
|
|
||||||
return a, nil
|
return a, nil
|
||||||
case CEREMONY_APPLICATION_STATE_IN_PROGRESS:
|
case CEREMONY_APPLICATION_STATE_IN_PROGRESS:
|
||||||
|
a.StateCount++
|
||||||
for i, url := range transition.TypeUrls {
|
for i, url := range transition.TypeUrls {
|
||||||
switch url {
|
switch url {
|
||||||
case protobufs.CeremonySeenProverAttestationType:
|
case protobufs.CeremonySeenProverAttestationType:
|
||||||
@ -774,6 +777,7 @@ func (a *CeremonyApplication) ApplyTransition(
|
|||||||
if err = a.applySeenProverAttestation(seenProverAtt); err != nil {
|
if err = a.applySeenProverAttestation(seenProverAtt); err != nil {
|
||||||
return nil, errors.Wrap(err, "apply transition")
|
return nil, errors.Wrap(err, "apply transition")
|
||||||
}
|
}
|
||||||
|
a.StateCount = 0
|
||||||
case protobufs.CeremonyDroppedProverAttestationType:
|
case protobufs.CeremonyDroppedProverAttestationType:
|
||||||
droppedProverAtt := &protobufs.CeremonyDroppedProverAttestation{}
|
droppedProverAtt := &protobufs.CeremonyDroppedProverAttestation{}
|
||||||
err := proto.Unmarshal(transition.TransitionInputs[i], droppedProverAtt)
|
err := proto.Unmarshal(transition.TransitionInputs[i], droppedProverAtt)
|
||||||
@ -796,6 +800,7 @@ func (a *CeremonyApplication) ApplyTransition(
|
|||||||
if err = a.applyDroppedProverAttestation(droppedProverAtt); err != nil {
|
if err = a.applyDroppedProverAttestation(droppedProverAtt); err != nil {
|
||||||
return nil, errors.Wrap(err, "apply transition")
|
return nil, errors.Wrap(err, "apply transition")
|
||||||
}
|
}
|
||||||
|
a.StateCount = 0
|
||||||
case protobufs.CeremonyTranscriptCommitType:
|
case protobufs.CeremonyTranscriptCommitType:
|
||||||
transcriptCommit := &protobufs.CeremonyTranscriptCommit{}
|
transcriptCommit := &protobufs.CeremonyTranscriptCommit{}
|
||||||
err := proto.Unmarshal(transition.TransitionInputs[i], transcriptCommit)
|
err := proto.Unmarshal(transition.TransitionInputs[i], transcriptCommit)
|
||||||
@ -806,6 +811,7 @@ func (a *CeremonyApplication) ApplyTransition(
|
|||||||
if err = a.applyTranscriptCommit(transcriptCommit); err != nil {
|
if err = a.applyTranscriptCommit(transcriptCommit); err != nil {
|
||||||
return nil, errors.Wrap(err, "apply transition")
|
return nil, errors.Wrap(err, "apply transition")
|
||||||
}
|
}
|
||||||
|
a.StateCount = 0
|
||||||
default:
|
default:
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
@ -850,6 +856,10 @@ func (a *CeremonyApplication) ApplyTransition(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if currentFrameNumber > V118_CUTOFF && a.StateCount > 100 {
|
||||||
|
shouldReset = true
|
||||||
|
}
|
||||||
|
|
||||||
if shouldReset {
|
if shouldReset {
|
||||||
a.LobbyState = CEREMONY_APPLICATION_STATE_OPEN
|
a.LobbyState = CEREMONY_APPLICATION_STATE_OPEN
|
||||||
a.StateCount = 0
|
a.StateCount = 0
|
||||||
@ -877,6 +887,7 @@ func (a *CeremonyApplication) ApplyTransition(
|
|||||||
|
|
||||||
return a, nil
|
return a, nil
|
||||||
case CEREMONY_APPLICATION_STATE_FINALIZING:
|
case CEREMONY_APPLICATION_STATE_FINALIZING:
|
||||||
|
a.StateCount++
|
||||||
for i, url := range transition.TypeUrls {
|
for i, url := range transition.TypeUrls {
|
||||||
switch url {
|
switch url {
|
||||||
case protobufs.CeremonySeenProverAttestationType:
|
case protobufs.CeremonySeenProverAttestationType:
|
||||||
@ -901,6 +912,7 @@ func (a *CeremonyApplication) ApplyTransition(
|
|||||||
if err = a.applySeenProverAttestation(seenProverAtt); err != nil {
|
if err = a.applySeenProverAttestation(seenProverAtt); err != nil {
|
||||||
return nil, errors.Wrap(err, "apply transition")
|
return nil, errors.Wrap(err, "apply transition")
|
||||||
}
|
}
|
||||||
|
a.StateCount = 0
|
||||||
case protobufs.CeremonyDroppedProverAttestationType:
|
case protobufs.CeremonyDroppedProverAttestationType:
|
||||||
droppedProverAtt := &protobufs.CeremonyDroppedProverAttestation{}
|
droppedProverAtt := &protobufs.CeremonyDroppedProverAttestation{}
|
||||||
err := proto.Unmarshal(transition.TransitionInputs[i], droppedProverAtt)
|
err := proto.Unmarshal(transition.TransitionInputs[i], droppedProverAtt)
|
||||||
@ -923,6 +935,7 @@ func (a *CeremonyApplication) ApplyTransition(
|
|||||||
if err = a.applyDroppedProverAttestation(droppedProverAtt); err != nil {
|
if err = a.applyDroppedProverAttestation(droppedProverAtt); err != nil {
|
||||||
return nil, errors.Wrap(err, "apply transition")
|
return nil, errors.Wrap(err, "apply transition")
|
||||||
}
|
}
|
||||||
|
a.StateCount = 0
|
||||||
case protobufs.CeremonyTranscriptShareType:
|
case protobufs.CeremonyTranscriptShareType:
|
||||||
transcriptShare := &protobufs.CeremonyTranscriptShare{}
|
transcriptShare := &protobufs.CeremonyTranscriptShare{}
|
||||||
err := proto.Unmarshal(transition.TransitionInputs[i], transcriptShare)
|
err := proto.Unmarshal(transition.TransitionInputs[i], transcriptShare)
|
||||||
@ -933,6 +946,7 @@ func (a *CeremonyApplication) ApplyTransition(
|
|||||||
if err = a.applyTranscriptShare(transcriptShare); err != nil {
|
if err = a.applyTranscriptShare(transcriptShare); err != nil {
|
||||||
return nil, errors.Wrap(err, "apply transition")
|
return nil, errors.Wrap(err, "apply transition")
|
||||||
}
|
}
|
||||||
|
a.StateCount = 0
|
||||||
default:
|
default:
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
@ -970,6 +984,10 @@ func (a *CeremonyApplication) ApplyTransition(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if currentFrameNumber > V118_CUTOFF && a.StateCount > 100 {
|
||||||
|
shouldReset = true
|
||||||
|
}
|
||||||
|
|
||||||
if shouldReset {
|
if shouldReset {
|
||||||
a.LobbyState = CEREMONY_APPLICATION_STATE_OPEN
|
a.LobbyState = CEREMONY_APPLICATION_STATE_OPEN
|
||||||
a.StateCount = 0
|
a.StateCount = 0
|
||||||
@ -999,6 +1017,7 @@ func (a *CeremonyApplication) ApplyTransition(
|
|||||||
|
|
||||||
return a, nil
|
return a, nil
|
||||||
case CEREMONY_APPLICATION_STATE_VALIDATING:
|
case CEREMONY_APPLICATION_STATE_VALIDATING:
|
||||||
|
a.StateCount++
|
||||||
for i, url := range transition.TypeUrls {
|
for i, url := range transition.TypeUrls {
|
||||||
switch url {
|
switch url {
|
||||||
case protobufs.CeremonyTranscriptType:
|
case protobufs.CeremonyTranscriptType:
|
||||||
@ -1011,6 +1030,7 @@ func (a *CeremonyApplication) ApplyTransition(
|
|||||||
if err = a.applyTranscript(transcript); err != nil {
|
if err = a.applyTranscript(transcript); err != nil {
|
||||||
return nil, errors.Wrap(err, "apply transition")
|
return nil, errors.Wrap(err, "apply transition")
|
||||||
}
|
}
|
||||||
|
a.StateCount = 0
|
||||||
default:
|
default:
|
||||||
return a, nil
|
return a, nil
|
||||||
}
|
}
|
||||||
|
@ -233,5 +233,5 @@ func printLogo() {
|
|||||||
|
|
||||||
func printVersion() {
|
func printVersion() {
|
||||||
fmt.Println(" ")
|
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 {
|
if tracer != nil {
|
||||||
blossomOpts = append(blossomOpts, blossomsub.WithEventTracer(tracer))
|
blossomOpts = append(blossomOpts, blossomsub.WithEventTracer(tracer))
|
||||||
}
|
}
|
||||||
blossomOpts = append(blossomOpts, blossomsub.WithPeerScore(
|
blossomOpts = append(blossomOpts, blossomsub.WithPeerScore(
|
||||||
&blossomsub.PeerScoreParams{
|
&blossomsub.PeerScoreParams{
|
||||||
SkipAtomicValidation: false,
|
SkipAtomicValidation: false,
|
||||||
BitmaskScoreCap: 0,
|
BitmaskScoreCap: 100,
|
||||||
IPColocationFactorWeight: -1,
|
IPColocationFactorWeight: -1,
|
||||||
IPColocationFactorThreshold: 6,
|
IPColocationFactorThreshold: 6,
|
||||||
BehaviourPenaltyWeight: -1,
|
BehaviourPenaltyWeight: -80,
|
||||||
BehaviourPenaltyThreshold: 100,
|
BehaviourPenaltyThreshold: 100,
|
||||||
BehaviourPenaltyDecay: .5,
|
BehaviourPenaltyDecay: .5,
|
||||||
DecayInterval: time.Minute,
|
DecayInterval: 10 * time.Second,
|
||||||
DecayToZero: .1,
|
DecayToZero: .1,
|
||||||
RetainScore: 5 * time.Minute,
|
RetainScore: 5 * time.Minute,
|
||||||
AppSpecificScore: func(p peer.ID) float64 {
|
AppSpecificScore: func(p peer.ID) float64 {
|
||||||
@ -140,10 +142,10 @@ func NewBlossomSub(
|
|||||||
},
|
},
|
||||||
&blossomsub.PeerScoreThresholds{
|
&blossomsub.PeerScoreThresholds{
|
||||||
SkipAtomicValidation: false,
|
SkipAtomicValidation: false,
|
||||||
GossipThreshold: -100,
|
GossipThreshold: -2000,
|
||||||
PublishThreshold: -100,
|
PublishThreshold: -5000,
|
||||||
GraylistThreshold: -100,
|
GraylistThreshold: -10000,
|
||||||
AcceptPXThreshold: 1,
|
AcceptPXThreshold: 100,
|
||||||
OpportunisticGraftThreshold: 2,
|
OpportunisticGraftThreshold: 2,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
@ -533,7 +535,10 @@ func discoverPeers(
|
|||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
time.Sleep(30 * time.Second)
|
time.Sleep(30 * time.Second)
|
||||||
discover()
|
if len(h.Network().Peers()) == 0 {
|
||||||
|
logger.Info("reinitiating discovery")
|
||||||
|
discover()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user