Skip to content

Commit

Permalink
Replace judgmentSignatureSize with Ed25519SignatureSize
Browse files Browse the repository at this point in the history
  • Loading branch information
bamzedev committed Jul 30, 2024
1 parent 5aca0f6 commit 95e8262
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
26 changes: 12 additions & 14 deletions internal/block/dispute.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package block

import "github.com/eigerco/strawberry/internal/crypto"

const (
judgmentSignatureSize = 64 // Size of Ed25519 signature
import (
"github.com/eigerco/strawberry/internal/crypto"
)

type DisputeExtrinsic struct {
Expand All @@ -19,21 +17,21 @@ type Verdict struct {
}

type Culprit struct {
ReportHash crypto.Hash // H, hash of the work report
ValidatorEd25519PublicKey crypto.Ed25519PublicKey // He
Signature [judgmentSignatureSize]byte // E
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 [judgmentSignatureSize]byte // E
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 [judgmentSignatureSize]byte // s: E
IsValid bool // v: {⊺,⊥}
ValidatorIndex uint16 // i: NV
Signature [crypto.Ed25519SignatureSize]byte // s: E
}
1 change: 1 addition & 0 deletions internal/crypto/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const (
BandersnatchSize = 32
Ed25519PublicSize = 32
Ed25519PrivateSize = 64
Ed25519SignatureSize = 64
BLSSize = 144
BandersnatchRingSize = 144
MetadataSize = 128
Expand Down

0 comments on commit 95e8262

Please sign in to comment.