-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes: #4402 the result of the partition could be that some block crosses local threshold, but doesn't cross the global threshold. lets say in total weight the fractions would be 55/45. 55 voting in support, 45 voting against the block. once local threshold is crossed 55-side will be always voting in support, 45-side will be seeing that block crosses local threshold, but not global, but won't have data to vote for the block. as such it won't be possible to reach global threshold indefinitely, as it will always remain at ~10 of total weight, as 45-side will never ask for the block. the change is to force 45-side to ask for the block even if it crossed local threshold. other changes: - make traces shorter by removing all unnecessary data (new types to communicate with tortoise) and encoding byte arrays (ids, node) with base64 - enable lfs for tortoise/data/ - collect traces from multiple ci tests for regression testing
- Loading branch information
Showing
34 changed files
with
397 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tortoise/data/*.json filter=lfs diff=lfs merge=lfs -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package types | ||
|
||
import "github.com/spacemeshos/go-spacemesh/log" | ||
|
||
type AtxTortoiseData struct { | ||
ID ATXID `json:"id"` | ||
Smesher NodeID `json:"node"` | ||
TargetEpoch EpochID `json:"target"` | ||
BaseHeight uint64 `json:"base"` | ||
Height uint64 `json:"height"` | ||
Weight uint64 `json:"weight"` | ||
} | ||
|
||
type BallotTortoiseData struct { | ||
ID BallotID `json:"id"` | ||
Layer LayerID `json:"lid"` | ||
Eligibilities uint32 `json:"elig"` | ||
AtxID ATXID `json:"atxid"` | ||
Opinion Opinion `json:"opinion"` | ||
EpochData *ReferenceData `json:"epochdata"` | ||
Ref *BallotID `json:"ref"` | ||
Malicious bool `json:"mal"` | ||
} | ||
|
||
func (b *BallotTortoiseData) SetMalicious() { | ||
b.Malicious = true | ||
} | ||
|
||
func (b *BallotTortoiseData) MarshalLogObject(encoder log.ObjectEncoder) error { | ||
encoder.AddString("id", b.ID.String()) | ||
encoder.AddUint32("layer", b.Layer.Uint32()) | ||
encoder.AddString("atxid", b.AtxID.String()) | ||
encoder.AddObject("opinion", &b.Opinion) | ||
encoder.AddUint32("elig", b.Eligibilities) | ||
if b.EpochData != nil { | ||
encoder.AddObject("epochdata", b.EpochData) | ||
} else if b.Ref != nil { | ||
encoder.AddString("ref", b.Ref.String()) | ||
} | ||
encoder.AddBool("malicious", b.Malicious) | ||
return nil | ||
} | ||
|
||
type ReferenceData struct { | ||
Beacon Beacon `json:"beacon"` | ||
ActiveSet []ATXID `json:"set"` | ||
Eligibilities uint32 `json:"elig"` | ||
} | ||
|
||
func (r *ReferenceData) MarshalLogObject(encoder log.ObjectEncoder) error { | ||
encoder.AddString("beacon", r.Beacon.String()) | ||
encoder.AddInt("set size", len(r.ActiveSet)) | ||
encoder.AddUint32("elig", r.Eligibilities) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.