stateproofmsg

package
v0.0.0-...-8fce49c Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MessageMaxSize

func MessageMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

Types

type Message

type Message struct {

	// BlockHeadersCommitment contains a commitment on all light block headers within a state proof interval.
	BlockHeadersCommitment []byte `codec:"b,allocbound=crypto.Sha256Size"`
	VotersCommitment       []byte `codec:"v,allocbound=crypto.SumhashDigestSize"`
	LnProvenWeight         uint64 `codec:"P"`
	FirstAttestedRound     uint64 `codec:"f"`
	LastAttestedRound      uint64 `codec:"l"`
	// contains filtered or unexported fields
}

Message represents the message that the state proofs are attesting to. This message can be used by lightweight client and gives it the ability to verify proofs on the Algorand's state. In addition to that proof, this message also contains fields that are needed in order to verify the next state proofs (VotersCommitment and LnProvenWeight).

func (*Message) CanMarshalMsg

func (_ *Message) CanMarshalMsg(z interface{}) bool

func (*Message) CanUnmarshalMsg

func (_ *Message) CanUnmarshalMsg(z interface{}) bool

func (*Message) Hash

func (m *Message) Hash() sp.MessageHash

Hash returns a hashed representation fitting the state proof messages.

func (*Message) MarshalMsg

func (z *Message) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*Message) MsgIsZero

func (z *Message) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*Message) Msgsize

func (z *Message) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (Message) ToBeHashed

func (m Message) ToBeHashed() (protocol.HashID, []byte)

ToBeHashed returns the bytes of the message.

func (*Message) UnmarshalMsg

func (z *Message) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*Message) UnmarshalMsgWithState

func (z *Message) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

Jump to

Keyboard shortcuts

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