Skip to content

Commit

Permalink
fix: Hk Hv and Hs
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvladco committed Jul 26, 2024
1 parent a032b01 commit 38726ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 11 additions & 4 deletions internal/block/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@ import (
"github.com/eigerco/strawberry/internal/time"
)

const NumberOfValidators uint16 = 1023

// Header as defined in the section 5 in the paper
type Header struct {
ParentHash crypto.Hash // Hp
PriorStateRoot crypto.Hash // Hr
ExtrinsicHash crypto.Hash // Hx
TimeSlotIndex time.Timeslot // Ht
EpochMarker []crypto.Hash // He
EpochMarker *Epoch // He
WinningTicketsMarker [time.TimeslotsPerEpoch]*Ticket // Hw
JudgementsMarkers []crypto.Hash // Hj
BlockAuthorKey []byte // Hk
VRFSignature []byte // Hv
BlockSealSignature []byte // Hs
PublicKeyIndex uint16 // Hk
VRFSignature crypto.BandersnatchSignature // Hv
BlockSealSignature crypto.BandersnatchSignature // Hs
}

type Epoch struct {
Keys [NumberOfValidators]crypto.BandersnatchPublicKey
Entropy crypto.Hash
}
4 changes: 4 additions & 0 deletions internal/crypto/bandersnatch.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package crypto

type BandersnatchPublicKey [BandersnatchSize]byte
type BandersnatchSignature [96]byte

0 comments on commit 38726ac

Please sign in to comment.