Skip to content

Commit

Permalink
Add assurance structs (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
bamzedev authored Jul 31, 2024
1 parent d89e21c commit 4b17aed
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions internal/block/assurance.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package block

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

// Assurance represents a single validator's attestation of data availability
// for work reports on specific cores. It is part of the Assurances Extrinsic (E_A).
// Each Assurance contains:
// - An anchor to the parent block
// - A bitstring flag indicating availability for each core
// - The index of the attesting validator (0 to 1023)
// - A signature validating the assurance
// Assurances must be ordered by validator index in the extrinsic.
type Assurance struct {
Anchor crypto.Hash // Parent block hash (a ∈ H)
Flag bool // Bitstring of assurances, one bit per core (f ∈ B_C)
ValidatorIndex uint16 // Index of the attesting validator (v ∈ N_V)
Signature [crypto.Ed25519SignatureSize]byte // Ed25519 signature (s ∈ E)
}

type AssurancesExtrinsic []Assurance
1 change: 1 addition & 0 deletions internal/block/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ type Extrinsic struct {
ET []*TicketProof
EP *PreimageExtrinsic
ED *DisputeExtrinsic
EA *AssurancesExtrinsic
}

0 comments on commit 4b17aed

Please sign in to comment.