-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add dispute structs * Replace judgmentSignatureSize with Ed25519SignatureSize
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 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
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,37 @@ | ||
package block | ||
|
||
import ( | ||
"github.com/eigerco/strawberry/internal/crypto" | ||
) | ||
|
||
type DisputeExtrinsic struct { | ||
Verdicts []Verdict | ||
Culprits []Culprit | ||
Faults []Fault | ||
} | ||
|
||
type Verdict struct { | ||
ReportHash crypto.Hash // H, hash of the work report | ||
EpochIndex uint32 // ⌊τ/E⌋ - N2, epoch index | ||
Judgments []Judgment // ⟦{⊺,⊥},NV,E⟧⌊2/3V⌋+1 | ||
} | ||
|
||
type Culprit struct { | ||
ReportHash crypto.Hash // H, hash of the work report | ||
ValidatorEd25519PublicKey crypto.Ed25519PublicKey // He | ||
Signature [crypto.Ed25519SignatureSize]byte // E | ||
} | ||
|
||
type Fault struct { | ||
ReportHash crypto.Hash // H, hash of the work report | ||
IsValid bool // {⊺,⊥} | ||
ValidatorEd25519PublicKey crypto.Ed25519PublicKey // He | ||
Signature [crypto.Ed25519SignatureSize]byte // E | ||
} | ||
|
||
// Judgment represents a single judgment with a signature | ||
type Judgment struct { | ||
IsValid bool // v: {⊺,⊥} | ||
ValidatorIndex uint16 // i: NV | ||
Signature [crypto.Ed25519SignatureSize]byte // s: E | ||
} |
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