proto

package
v0.16.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

README

Generating Go code from propeller.proto

The propeller.proto file imports p2p/proto/common.proto from the upstream starknet-p2p-specs repository. Since the upstream module is not on the Buf Schema Registry, we use buf export + protoc directly.

From the project root:

# 1. Export upstream .proto sources (needed for import resolution)
buf export \
  "https://github.com/starknet-io/starknet-p2p-specs.git#branch=bcfa353a169c859e4d5d97757caccbe76f75bc06,depth=1" \
  -o /tmp/starknet-p2p-specs-proto

# 2. Generate Go code
protoc \
  --go_out=. \
  --go_opt=paths=source_relative \
  --go_opt=Mp2p/proto/common.proto=github.com/starknet-io/starknet-p2p-specs/p2p/proto/common \
  -I /tmp/starknet-p2p-specs-proto \
  -I . \
  consensus/propeller/proto/propeller.proto

This produces propeller.pb.go in this directory.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_consensus_propeller_proto_propeller_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type MerkleProof

type MerkleProof struct {

	// The sibling hashes needed to reconstruct the path from the leaf to the root.
	// Each hash is 32 bytes.
	Siblings []*common.Hash256 `protobuf:"bytes,1,rep,name=siblings,proto3" json:"siblings,omitempty"`
	// contains filtered or unexported fields
}

A Merkle proof consisting of sibling hashes used to verify that a leaf belongs to a Merkle tree. Each sibling hash is 32 bytes (SHA-256). The siblings are ordered from leaf level to root level.

func (*MerkleProof) Descriptor deprecated

func (*MerkleProof) Descriptor() ([]byte, []int)

Deprecated: Use MerkleProof.ProtoReflect.Descriptor instead.

func (*MerkleProof) GetSiblings

func (x *MerkleProof) GetSiblings() []*common.Hash256

func (*MerkleProof) ProtoMessage

func (*MerkleProof) ProtoMessage()

func (*MerkleProof) ProtoReflect

func (x *MerkleProof) ProtoReflect() protoreflect.Message

func (*MerkleProof) Reset

func (x *MerkleProof) Reset()

func (*MerkleProof) String

func (x *MerkleProof) String() string

type PropellerUnit

type PropellerUnit struct {

	// The shards assigned to this unit's peer.
	Shards *ShardsOfPeer `protobuf:"bytes,1,opt,name=shards,proto3" json:"shards,omitempty"`
	// The position of this shard in the erasure coding scheme.
	Index uint64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"`
	// The Merkle root of all shards, used to verify shard integrity.
	MerkleRoot *common.Hash256 `protobuf:"bytes,3,opt,name=merkle_root,json=merkleRoot,proto3" json:"merkle_root,omitempty"`
	// The Merkle proof that this shard belongs to the tree with the given root.
	MerkleProof *MerkleProof `protobuf:"bytes,4,opt,name=merkle_proof,json=merkleProof,proto3" json:"merkle_proof,omitempty"`
	// The peer ID of the original publisher who created and signed this unit.
	Publisher *common.PeerID `protobuf:"bytes,5,opt,name=publisher,proto3" json:"publisher,omitempty"`
	// Cryptographic signature from the publisher over the merkle_root.
	Signature []byte `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"`
	// Committee identifier for multiplexing different message streams.
	CommitteeId *common.Hash256 `protobuf:"bytes,7,opt,name=committee_id,json=committeeId,proto3" json:"committee_id,omitempty"`
	// A strictly increasing number, to avoid replays.
	// Current implementation is nanoseconds since UNIX_EPOCH.
	// TODO(guyn): CRITICAL: protect against replay attacks using this timestamp
	Nonce uint64 `protobuf:"varint,8,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// contains filtered or unexported fields
}

A single unit in the Propeller protocol containing shards of erasure-coded data along with cryptographic proofs for verification.

func (*PropellerUnit) Descriptor deprecated

func (*PropellerUnit) Descriptor() ([]byte, []int)

Deprecated: Use PropellerUnit.ProtoReflect.Descriptor instead.

func (*PropellerUnit) GetCommitteeId

func (x *PropellerUnit) GetCommitteeId() *common.Hash256

func (*PropellerUnit) GetIndex

func (x *PropellerUnit) GetIndex() uint64

func (*PropellerUnit) GetMerkleProof

func (x *PropellerUnit) GetMerkleProof() *MerkleProof

func (*PropellerUnit) GetMerkleRoot

func (x *PropellerUnit) GetMerkleRoot() *common.Hash256

func (*PropellerUnit) GetNonce

func (x *PropellerUnit) GetNonce() uint64

func (*PropellerUnit) GetPublisher

func (x *PropellerUnit) GetPublisher() *common.PeerID

func (*PropellerUnit) GetShards

func (x *PropellerUnit) GetShards() *ShardsOfPeer

func (*PropellerUnit) GetSignature

func (x *PropellerUnit) GetSignature() []byte

func (*PropellerUnit) ProtoMessage

func (*PropellerUnit) ProtoMessage()

func (*PropellerUnit) ProtoReflect

func (x *PropellerUnit) ProtoReflect() protoreflect.Message

func (*PropellerUnit) Reset

func (x *PropellerUnit) Reset()

func (*PropellerUnit) String

func (x *PropellerUnit) String() string

type PropellerUnitBatch

type PropellerUnitBatch struct {
	Batch []*PropellerUnit `protobuf:"bytes,1,rep,name=batch,proto3" json:"batch,omitempty"`
	// contains filtered or unexported fields
}

A batch of PropellerUnits for efficient transmission.

func (*PropellerUnitBatch) Descriptor deprecated

func (*PropellerUnitBatch) Descriptor() ([]byte, []int)

Deprecated: Use PropellerUnitBatch.ProtoReflect.Descriptor instead.

func (*PropellerUnitBatch) GetBatch

func (x *PropellerUnitBatch) GetBatch() []*PropellerUnit

func (*PropellerUnitBatch) ProtoMessage

func (*PropellerUnitBatch) ProtoMessage()

func (*PropellerUnitBatch) ProtoReflect

func (x *PropellerUnitBatch) ProtoReflect() protoreflect.Message

func (*PropellerUnitBatch) Reset

func (x *PropellerUnitBatch) Reset()

func (*PropellerUnitBatch) String

func (x *PropellerUnitBatch) String() string

type Shard

type Shard struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

A single erasure-coded fragment of the original message.

func (*Shard) Descriptor deprecated

func (*Shard) Descriptor() ([]byte, []int)

Deprecated: Use Shard.ProtoReflect.Descriptor instead.

func (*Shard) GetData

func (x *Shard) GetData() []byte

func (*Shard) ProtoMessage

func (*Shard) ProtoMessage()

func (*Shard) ProtoReflect

func (x *Shard) ProtoReflect() protoreflect.Message

func (*Shard) Reset

func (x *Shard) Reset()

func (*Shard) String

func (x *Shard) String() string

type ShardsOfPeer

type ShardsOfPeer struct {
	Shards []*Shard `protobuf:"bytes,1,rep,name=shards,proto3" json:"shards,omitempty"`
	// contains filtered or unexported fields
}

A collection of shards assigned to a single peer. The proto-encoded bytes of this message are used as Merkle tree leaf data, ensuring cross-language determinism.

func (*ShardsOfPeer) Descriptor deprecated

func (*ShardsOfPeer) Descriptor() ([]byte, []int)

Deprecated: Use ShardsOfPeer.ProtoReflect.Descriptor instead.

func (*ShardsOfPeer) GetShards

func (x *ShardsOfPeer) GetShards() []*Shard

func (*ShardsOfPeer) ProtoMessage

func (*ShardsOfPeer) ProtoMessage()

func (*ShardsOfPeer) ProtoReflect

func (x *ShardsOfPeer) ProtoReflect() protoreflect.Message

func (*ShardsOfPeer) Reset

func (x *ShardsOfPeer) Reset()

func (*ShardsOfPeer) String

func (x *ShardsOfPeer) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL