-
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.
- Loading branch information
Showing
2 changed files
with
40 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,39 @@ | ||
package block | ||
|
||
import "github.com/eigerco/strawberry/internal/crypto" | ||
|
||
const ( | ||
judgmentSignatureSize = 64 // Size of Ed25519 signature | ||
) | ||
|
||
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 [judgmentSignatureSize]byte // E | ||
} | ||
|
||
type Fault struct { | ||
ReportHash crypto.Hash // H, hash of the work report | ||
IsValid bool // {⊺,⊥} | ||
ValidatorEd25519PublicKey crypto.Ed25519PublicKey // He | ||
Signature [judgmentSignatureSize]byte // E | ||
} | ||
|
||
// Judgment represents a single judgment with a signature | ||
type Judgment struct { | ||
IsValid bool // v: {⊺,⊥} | ||
ValidatorIndex uint16 // i: NV | ||
Signature [judgmentSignatureSize]byte // s: E | ||
} |