header

package
v0.15.0-beta Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_p2p_proto_sync_header_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type BlockHeadersRequest

type BlockHeadersRequest struct {
	Iteration *common1.Iteration `protobuf:"bytes,1,opt,name=iteration,proto3" json:"iteration,omitempty"`
	// contains filtered or unexported fields
}

func (*BlockHeadersRequest) Descriptor deprecated

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

Deprecated: Use BlockHeadersRequest.ProtoReflect.Descriptor instead.

func (*BlockHeadersRequest) GetIteration

func (x *BlockHeadersRequest) GetIteration() *common1.Iteration

func (*BlockHeadersRequest) ProtoMessage

func (*BlockHeadersRequest) ProtoMessage()

func (*BlockHeadersRequest) ProtoReflect

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

func (*BlockHeadersRequest) Reset

func (x *BlockHeadersRequest) Reset()

func (*BlockHeadersRequest) String

func (x *BlockHeadersRequest) String() string

type BlockHeadersResponse

type BlockHeadersResponse struct {

	// Types that are valid to be assigned to HeaderMessage:
	//
	//	*BlockHeadersResponse_Header
	//	*BlockHeadersResponse_Fin
	HeaderMessage isBlockHeadersResponse_HeaderMessage `protobuf_oneof:"header_message"`
	// contains filtered or unexported fields
}

Responses are sent ordered by the order given in the request.

func (*BlockHeadersResponse) Descriptor deprecated

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

Deprecated: Use BlockHeadersResponse.ProtoReflect.Descriptor instead.

func (*BlockHeadersResponse) GetFin

func (x *BlockHeadersResponse) GetFin() *common.Fin

func (*BlockHeadersResponse) GetHeader

func (x *BlockHeadersResponse) GetHeader() *SignedBlockHeader

func (*BlockHeadersResponse) GetHeaderMessage

func (x *BlockHeadersResponse) GetHeaderMessage() isBlockHeadersResponse_HeaderMessage

func (*BlockHeadersResponse) ProtoMessage

func (*BlockHeadersResponse) ProtoMessage()

func (*BlockHeadersResponse) ProtoReflect

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

func (*BlockHeadersResponse) Reset

func (x *BlockHeadersResponse) Reset()

func (*BlockHeadersResponse) String

func (x *BlockHeadersResponse) String() string

type BlockHeadersResponse_Fin

type BlockHeadersResponse_Fin struct {
	Fin *common.Fin `protobuf:"bytes,2,opt,name=fin,proto3,oneof"` // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its header.
}

type BlockHeadersResponse_Header

type BlockHeadersResponse_Header struct {
	Header *SignedBlockHeader `protobuf:"bytes,1,opt,name=header,proto3,oneof"`
}

type NewBlock

type NewBlock struct {

	// Types that are valid to be assigned to MaybeFull:
	//
	//	*NewBlock_Id
	//	*NewBlock_Header
	MaybeFull isNewBlock_MaybeFull `protobuf_oneof:"maybe_full"`
	// contains filtered or unexported fields
}

sent to all peers (except the ones this was received from, if any). for a fraction of peers, also send the GetBlockHeaders response (as if they asked for it for this block)

func (*NewBlock) Descriptor deprecated

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

Deprecated: Use NewBlock.ProtoReflect.Descriptor instead.

func (*NewBlock) GetHeader

func (x *NewBlock) GetHeader() *BlockHeadersResponse

func (*NewBlock) GetId

func (x *NewBlock) GetId() *common.BlockID

func (*NewBlock) GetMaybeFull

func (x *NewBlock) GetMaybeFull() isNewBlock_MaybeFull

func (*NewBlock) ProtoMessage

func (*NewBlock) ProtoMessage()

func (*NewBlock) ProtoReflect

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

func (*NewBlock) Reset

func (x *NewBlock) Reset()

func (*NewBlock) String

func (x *NewBlock) String() string

type NewBlock_Header

type NewBlock_Header struct {
	Header *BlockHeadersResponse `protobuf:"bytes,2,opt,name=header,proto3,oneof"`
}

type NewBlock_Id

type NewBlock_Id struct {
	Id *common.BlockID `protobuf:"bytes,1,opt,name=id,proto3,oneof"`
}

type SignedBlockHeader

type SignedBlockHeader struct {
	BlockHash           *common.Hash                 `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` //  For the structure of the block hash, see https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/header/#block_hash
	ParentHash          *common.Hash                 `protobuf:"bytes,2,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty"`
	Number              uint64                       `protobuf:"varint,3,opt,name=number,proto3" json:"number,omitempty"` // This can be deduced from context. We can consider removing this field.
	Time                uint64                       `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"`     // Encoded in Unix time.
	SequencerAddress    *common.Address              `protobuf:"bytes,5,opt,name=sequencer_address,json=sequencerAddress,proto3" json:"sequencer_address,omitempty"`
	StateRoot           *common.Hash                 `protobuf:"bytes,6,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty"`                                 // Patricia root of contract and class patricia tries. Each of those tries are of height 251. Same as in L1. Later more trees will be included
	StateDiffCommitment *common1.StateDiffCommitment `protobuf:"bytes,7,opt,name=state_diff_commitment,json=stateDiffCommitment,proto3" json:"state_diff_commitment,omitempty"` // The state diff commitment returned  by the Starknet Feeder Gateway
	// For more info, see https://community.starknet.io/t/introducing-p2p-authentication-and-mismatch-resolution-in-v0-12-2/97993
	// The leaves contain a hash of the transaction hash and transaction signature.
	Transactions           *common.Patricia              `protobuf:"bytes,8,opt,name=transactions,proto3" json:"transactions,omitempty"`                               // By order of execution. TBD: required? the client can execute (powerful machine) and match state diff
	Events                 *common.Patricia              `protobuf:"bytes,9,opt,name=events,proto3" json:"events,omitempty"`                                           // By order of issuance. TBD: in receipts?
	Receipts               *common.Hash                  `protobuf:"bytes,10,opt,name=receipts,proto3" json:"receipts,omitempty"`                                      // By order of issuance. This is a patricia root. No need for length because it's the same length as transactions.
	ProtocolVersion        string                        `protobuf:"bytes,11,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"` // Starknet version
	L1GasPriceFri          *common.Uint128               `protobuf:"bytes,12,opt,name=l1_gas_price_fri,json=l1GasPriceFri,proto3" json:"l1_gas_price_fri,omitempty"`
	L1GasPriceWei          *common.Uint128               `protobuf:"bytes,13,opt,name=l1_gas_price_wei,json=l1GasPriceWei,proto3" json:"l1_gas_price_wei,omitempty"`
	L1DataGasPriceFri      *common.Uint128               `protobuf:"bytes,14,opt,name=l1_data_gas_price_fri,json=l1DataGasPriceFri,proto3" json:"l1_data_gas_price_fri,omitempty"`
	L1DataGasPriceWei      *common.Uint128               `protobuf:"bytes,15,opt,name=l1_data_gas_price_wei,json=l1DataGasPriceWei,proto3" json:"l1_data_gas_price_wei,omitempty"`
	L2GasPriceFri          *common.Uint128               `protobuf:"bytes,16,opt,name=l2_gas_price_fri,json=l2GasPriceFri,proto3" json:"l2_gas_price_fri,omitempty"`
	L2GasPriceWei          *common.Uint128               `protobuf:"bytes,17,opt,name=l2_gas_price_wei,json=l2GasPriceWei,proto3" json:"l2_gas_price_wei,omitempty"`
	L1DataAvailabilityMode common.L1DataAvailabilityMode `` /* 161-byte string literal not displayed */
	// for now, we assume a small consensus, so this fits in 1M. Else, these will be repeated and extracted from this message.
	Signatures []*common.ConsensusSignature `protobuf:"bytes,19,rep,name=signatures,proto3" json:"signatures,omitempty"` // can be more explicit here about the signature structure as this is not part of account abstraction
	// contains filtered or unexported fields
}

Note: commitments may change to be for the previous blocks like comet/tendermint hash of block header sent to L1

func (*SignedBlockHeader) Descriptor deprecated

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

Deprecated: Use SignedBlockHeader.ProtoReflect.Descriptor instead.

func (*SignedBlockHeader) GetBlockHash

func (x *SignedBlockHeader) GetBlockHash() *common.Hash

func (*SignedBlockHeader) GetEvents

func (x *SignedBlockHeader) GetEvents() *common.Patricia

func (*SignedBlockHeader) GetL1DataAvailabilityMode

func (x *SignedBlockHeader) GetL1DataAvailabilityMode() common.L1DataAvailabilityMode

func (*SignedBlockHeader) GetL1DataGasPriceFri

func (x *SignedBlockHeader) GetL1DataGasPriceFri() *common.Uint128

func (*SignedBlockHeader) GetL1DataGasPriceWei

func (x *SignedBlockHeader) GetL1DataGasPriceWei() *common.Uint128

func (*SignedBlockHeader) GetL1GasPriceFri

func (x *SignedBlockHeader) GetL1GasPriceFri() *common.Uint128

func (*SignedBlockHeader) GetL1GasPriceWei

func (x *SignedBlockHeader) GetL1GasPriceWei() *common.Uint128

func (*SignedBlockHeader) GetL2GasPriceFri

func (x *SignedBlockHeader) GetL2GasPriceFri() *common.Uint128

func (*SignedBlockHeader) GetL2GasPriceWei

func (x *SignedBlockHeader) GetL2GasPriceWei() *common.Uint128

func (*SignedBlockHeader) GetNumber

func (x *SignedBlockHeader) GetNumber() uint64

func (*SignedBlockHeader) GetParentHash

func (x *SignedBlockHeader) GetParentHash() *common.Hash

func (*SignedBlockHeader) GetProtocolVersion

func (x *SignedBlockHeader) GetProtocolVersion() string

func (*SignedBlockHeader) GetReceipts

func (x *SignedBlockHeader) GetReceipts() *common.Hash

func (*SignedBlockHeader) GetSequencerAddress

func (x *SignedBlockHeader) GetSequencerAddress() *common.Address

func (*SignedBlockHeader) GetSignatures

func (x *SignedBlockHeader) GetSignatures() []*common.ConsensusSignature

func (*SignedBlockHeader) GetStateDiffCommitment

func (x *SignedBlockHeader) GetStateDiffCommitment() *common1.StateDiffCommitment

func (*SignedBlockHeader) GetStateRoot

func (x *SignedBlockHeader) GetStateRoot() *common.Hash

func (*SignedBlockHeader) GetTime

func (x *SignedBlockHeader) GetTime() uint64

func (*SignedBlockHeader) GetTransactions

func (x *SignedBlockHeader) GetTransactions() *common.Patricia

func (*SignedBlockHeader) ProtoMessage

func (*SignedBlockHeader) ProtoMessage()

func (*SignedBlockHeader) ProtoReflect

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

func (*SignedBlockHeader) Reset

func (x *SignedBlockHeader) Reset()

func (*SignedBlockHeader) String

func (x *SignedBlockHeader) String() string

Jump to

Keyboard shortcuts

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