Skip to content

Commit

Permalink
Merge branch 'main' into feat/add-header-fields
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvladco committed Jul 26, 2024
2 parents a949e71 + 241ec1d commit 989dcb0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/block/block.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
package block

// Block represents the main block structure
type Block struct {
Header *Header
Extrinsic *Extrinsic
}

// Extrinsic represents the block extrinsic data
type Extrinsic struct {
ET []*TicketProof
}
20 changes: 20 additions & 0 deletions internal/block/ticket.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package block

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

const (
maxTicketsPerBlock = 16 // `K` in the paper. The maximum number of tickets which may be submitted in a single extrinsic.
ticketProofSize = 784 // Size of F̄[]γz⟨XT ⌢ η′2 r⟩
)

// Ticket represents a single ticket (C in equation 50)
type Ticket struct {

Check failure on line 11 in internal/block/ticket.go

View workflow job for this annotation

GitHub Actions / Lint

Ticket redeclared in this block
Identifier crypto.Hash // y ∈ H 32bytes hash
EntryIndex uint8 // r ∈ Nn (0, 1)
}

// TicketProof represents a proof of a valid ticket
type TicketProof struct {
EntryIndex uint8 // r ∈ Nn (0, 1)
Proof [ticketProofSize]byte // RingVRF proof
}

0 comments on commit 989dcb0

Please sign in to comment.