Documentation ¶
Index ¶
- Constants
- Variables
- func ConsensusVersionMaxSize() (s int)
- func Decode(b []byte, objptr msgp.Unmarshaler) error
- func DecodeJSON(b []byte, objptr interface{}) error
- func DecodeMsgp(b []byte, objptr msgp.Unmarshaler) (err error)
- func DecodeReflect(b []byte, objptr interface{}) error
- func DecodeStream(r io.Reader, objptr interface{}) error
- func Encode(obj msgp.Marshaler) []byte
- func EncodeJSON(obj interface{}) []byte
- func EncodeJSONStrict(obj interface{}) []byte
- func EncodeMsgp(obj msgp.Marshaler) []byte
- func EncodeReflect(obj interface{}) []byte
- func EncodeStream(w io.Writer, obj interface{})
- func EncodingTest(template msgpMarshalUnmarshal) error
- func ErrorMaxSize() (s int)
- func HashIDMaxSize() (s int)
- func NetworkIDMaxSize() (s int)
- func NewEncoder(w io.Writer) *codec.Encoder
- func NewJSONEncoder(w io.Writer) *codec.Encoder
- func PutEncodingBuf(buf *EncodingBuf)
- func RandomizeObject(template interface{}) (interface{}, error)
- func RandomizeObjectField(template interface{}) (interface{}, error)
- func RunEncodingTest(t *testing.T, template msgpMarshalUnmarshal)
- func StateProofTypeMaxSize() (s int)
- func TagMaxSize() (s int)
- func TxTypeMaxSize() (s int)
- type ConsensusVersion
- func (_ ConsensusVersion) CanMarshalMsg(z interface{}) bool
- func (_ *ConsensusVersion) CanUnmarshalMsg(z interface{}) bool
- func (z ConsensusVersion) MarshalMsg(b []byte) (o []byte)
- func (z ConsensusVersion) MsgIsZero() bool
- func (z ConsensusVersion) Msgsize() (s int)
- func (z *ConsensusVersion) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *ConsensusVersion) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type Decoder
- type EncodingBuf
- type Error
- func (_ Error) CanMarshalMsg(z interface{}) bool
- func (_ *Error) CanUnmarshalMsg(z interface{}) bool
- func (err Error) Error() string
- func (z Error) MarshalMsg(b []byte) (o []byte)
- func (z Error) MsgIsZero() bool
- func (z Error) Msgsize() (s int)
- func (z *Error) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *Error) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type HashID
- func (_ HashID) CanMarshalMsg(z interface{}) bool
- func (_ *HashID) CanUnmarshalMsg(z interface{}) bool
- func (z HashID) MarshalMsg(b []byte) (o []byte)
- func (z HashID) MsgIsZero() bool
- func (z HashID) Msgsize() (s int)
- func (z *HashID) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *HashID) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type MsgpDecoderBytes
- type NetworkID
- func (_ NetworkID) CanMarshalMsg(z interface{}) bool
- func (_ *NetworkID) CanUnmarshalMsg(z interface{}) bool
- func (z NetworkID) MarshalMsg(b []byte) (o []byte)
- func (z NetworkID) MsgIsZero() bool
- func (z NetworkID) Msgsize() (s int)
- func (z *NetworkID) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *NetworkID) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type SortStateProofType
- type StateProofType
- func (_ StateProofType) CanMarshalMsg(z interface{}) bool
- func (_ *StateProofType) CanUnmarshalMsg(z interface{}) bool
- func (z StateProofType) MarshalMsg(b []byte) (o []byte)
- func (z StateProofType) MsgIsZero() bool
- func (z StateProofType) Msgsize() (s int)
- func (z *StateProofType) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *StateProofType) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type Tag
- func (_ Tag) CanMarshalMsg(z interface{}) bool
- func (_ *Tag) CanUnmarshalMsg(z interface{}) bool
- func (z Tag) MarshalMsg(b []byte) (o []byte)
- func (tag Tag) MaxMessageSize() uint64
- func (z Tag) MsgIsZero() bool
- func (z Tag) Msgsize() (s int)
- func (z *Tag) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *Tag) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type TxType
- func (_ TxType) CanMarshalMsg(z interface{}) bool
- func (_ *TxType) CanUnmarshalMsg(z interface{}) bool
- func (z TxType) MarshalMsg(b []byte) (o []byte)
- func (z TxType) MsgIsZero() bool
- func (z TxType) Msgsize() (s int)
- func (z *TxType) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *TxType) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
Constants ¶
const ( // StateProofBasic is our initial state proof setup. using falcon keys and subset-sum hash StateProofBasic StateProofType = 0 // NumStateProofTypes is the max number of types of state proofs // that we support. This is used as an allocation bound for a map // containing different stateproof types in msgpack encoding. NumStateProofTypes int = 1 )
const AgreementVoteTagMaxSize = 1228
AgreementVoteTagMaxSize is the maximum size of an AgreementVoteTag message
const ConsensusCurrentVersion = ConsensusV39
ConsensusCurrentVersion is the latest version and should be used when a specific version is not provided.
const ConsensusFuture = ConsensusVersion(
"future",
)
ConsensusFuture is a protocol that should not appear in any production network, but is used to test features before they are released.
const ConsensusV10 = ConsensusVersion("v10")
ConsensusV10 introduces fast partition recovery.
const ConsensusV11 = ConsensusVersion("v11")
ConsensusV11 introduces efficient encoding of SignedTxn using SignedTxnInBlock.
const ConsensusV12 = ConsensusVersion("v12")
ConsensusV12 increases the maximum length of a version string.
const ConsensusV13 = ConsensusVersion(
"https://github.com/algorand/spec/tree/0c8a9dc44d7368cc266d5407b79fb3311f4fc795",
)
ConsensusV13 makes the consensus version a meaningful string.
const ConsensusV14 = ConsensusVersion(
"https://github.com/algorand/spec/tree/2526b6ae062b4fe5e163e06e41e1d9b9219135a9",
)
ConsensusV14 adds tracking of closing amounts in ApplyData, and enables genesis hash in transactions.
const ConsensusV15 = ConsensusVersion(
"https://github.com/algorand/spec/tree/a26ed78ed8f834e2b9ccb6eb7d3ee9f629a6e622",
)
ConsensusV15 adds tracking of reward distributions in ApplyData.
const ConsensusV16 = ConsensusVersion(
"https://github.com/algorand/spec/tree/22726c9dcd12d9cddce4a8bd7e8ccaa707f74101",
)
ConsensusV16 fixes domain separation in Credentials and requires GenesisHash.
const ConsensusV17 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/5615adc36bad610c7f165fa2967f4ecfa75125f0",
)
ConsensusV17 points to 'final' spec commit for 2019 june release
const ConsensusV18 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/6c6bd668be0ab14098e51b37e806c509f7b7e31f",
)
ConsensusV18 points to reward calculation spec commit
const ConsensusV19 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/0e196e82bfd6e327994bec373c4cc81bc878ef5c",
)
ConsensusV19 points to 'final' spec commit for 2019 nov release
const ConsensusV20 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/4a9db6a25595c6fd097cf9cc137cc83027787eaa",
)
ConsensusV20 points to adding the decimals field to assets
const ConsensusV21 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/8096e2df2da75c3339986317f9abe69d4fa86b4b",
)
ConsensusV21 fixes a bug in credential.lowestOutput
const ConsensusV22 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/57016b942f6d97e6d4c0688b373bb0a2fc85a1a2",
)
ConsensusV22 allows tuning the upgrade delay.
const ConsensusV23 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/e5f565421d720c6f75cdd186f7098495caf9101f",
)
ConsensusV23 fixes lease behavior.
const ConsensusV24 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/3a83c4c743f8b17adfd73944b4319c25722a6782",
)
ConsensusV24 include the applications, rekeying and AVM v2
const ConsensusV25 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/bea19289bf41217d2c0af30522fa222ef1366466",
)
ConsensusV25 adds support for AssetCloseAmount in the ApplyData
const ConsensusV26 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/ac2255d586c4474d4ebcf3809acccb59b7ef34ff",
)
ConsensusV26 adds support for TEAL 3, initial rewards calculation and merkle tree hash commitments
const ConsensusV27 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/d050b3cade6d5c664df8bd729bf219f179812595",
)
ConsensusV27 updates ApplyDelta.EvalDelta.LocalDeltas format
const ConsensusV28 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/65b4ab3266c52c56a0fa7d591754887d68faad0a",
)
ConsensusV28 introduces new TEAL features, larger program size, fee pooling and longer asset max URL
const ConsensusV29 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/abc54f79f9ad679d2d22f0fb9909fb005c16f8a1",
)
ConsensusV29 fixes application update by using ExtraProgramPages in size calculations
const ConsensusV30 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/bc36005dbd776e6d1eaf0c560619bb183215645c",
)
ConsensusV30 introduces AVM 1.0 and TEAL 5, increases the app opt in limit to 50, and allows costs to be pooled in grouped stateful transactions.
const ConsensusV31 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/85e6db1fdbdef00aa232c75199e10dc5fe9498f6",
)
ConsensusV31 enables the batch verification for ed25519 signatures, Fix reward calculation issue, introduces the ability to force an expired participation offline, enables TEAL 6 ( AVM 1.1 ) and add support for creating state proof keys.
const ConsensusV32 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/d5ac876d7ede07367dbaa26e149aa42589aac1f7",
)
ConsensusV32 enables the unlimited assets.
const ConsensusV33 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/830a4e673148498cc7230a0d1ba1ed0a5471acc6",
)
ConsensusV33 enables large blocks, the deeper block history for TEAL and catchpoint generation round after lowering in-memory deltas size (320 -> 4).
const ConsensusV34 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/2dd5435993f6f6d65691140f592ebca5ef19ffbd",
)
ConsensusV34 enables the TEAL v7 opcodes, stateproofs, shorter lambda to 1.7s.
const ConsensusV35 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/433d8e9a7274b6fca703d91213e05c7e6a589e69",
)
ConsensusV35 updates the calculation of total stake in state proofs.
const ConsensusV36 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/44fa607d6051730f5264526bf3c108d51f0eadb6",
)
ConsensusV36 adds box storage in TEAL v8
const ConsensusV37 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/1ac4dd1f85470e1fb36c8a65520e1313d7dfed5e",
)
ConsensusV37 is a technical upgrade and released in the same time as ConsensusV38. It is needed to allow nodes to build up a necessary state to support state proofs related options in ConsensusV38
const ConsensusV38 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/abd3d4823c6f77349fc04c3af7b1e99fe4df699f",
)
ConsensusV38 enables state proof verification using a special tracker, TEAL v9 resources sharing, pre-check ECDSA curve and extra features, and shortens the lambda to 1.5s.
const ConsensusV39 = ConsensusVersion(
"https://github.com/algorandfoundation/specs/tree/925a46433742afb0b51bb939354bd907fa88bf95",
)
ConsensusV39 enables dynamic filter timeouts, a deadline timeout of 4 seconds, TEAL v10 logicSig opcode budget pooling along with elliptic curve ops on some pairing friendly curves.
const ConsensusV7 = ConsensusVersion("v7")
ConsensusV7 increases MaxBalLookback to 320 in preparation for the twin seeds change.
const ConsensusV8 = ConsensusVersion("v8")
ConsensusV8 uses the new parameters and seed derivation policy from the agreement protocol's security analysis.
const ConsensusV9 = ConsensusVersion("v9")
ConsensusV9 increases min balance to 100,000 microAlgos.
const ConsensusVAlpha1 = ConsensusVersion("alpha1")
ConsensusVAlpha1 is the first consensus protocol for AlphaNet, which is the same as v32, but with a 2-second filter timeout and 5M block size.
const ConsensusVAlpha2 = ConsensusVersion("alpha2")
ConsensusVAlpha2 is the second consensus protocol for AlphaNet, which increases the filter timeout to 3.5 seconds and uses 5MiB blocks.
const ConsensusVAlpha3 = ConsensusVersion("alpha3")
ConsensusVAlpha3 uses the same parameters as ConsensusV33.
const ConsensusVAlpha4 = ConsensusVersion("alpha4")
ConsensusVAlpha4 uses the same parameters as ConsensusV34.
const ConsensusVAlpha5 = ConsensusVersion("alpha5")
ConsensusVAlpha5 uses the same parameters as ConsensusV36.
const DEPRECATEDConsensusV0 = ConsensusVersion("v0")
DEPRECATEDConsensusV0 is a baseline version of the Algorand consensus protocol. at the time versioning was introduced. It is now deprecated.
const DEPRECATEDConsensusV1 = ConsensusVersion("v1")
DEPRECATEDConsensusV1 adds support for Genesis ID in transactions, but does not require it (transactions missing a GenesisID value are still allowed). It is now deprecated.
const DEPRECATEDConsensusV2 = ConsensusVersion("v2")
DEPRECATEDConsensusV2 fixes a bug in the agreement protocol where proposalValues fail to commit to the original period and sender of a block.
const DEPRECATEDConsensusV3 = ConsensusVersion("v3")
DEPRECATEDConsensusV3 adds support for fine-grained ephemeral keys.
const DEPRECATEDConsensusV4 = ConsensusVersion("v4")
DEPRECATEDConsensusV4 adds support for a min balance and a transaction that closes out an account.
const DEPRECATEDConsensusV5 = ConsensusVersion("v5")
DEPRECATEDConsensusV5 sets MinTxnFee to 1000 and fixes a blance lookback bug
const DEPRECATEDConsensusV6 = ConsensusVersion("v6")
DEPRECATEDConsensusV6 adds support for explicit ephemeral-key parameters
const MsgDigestSkipTagMaxSize = 69
MsgDigestSkipTagMaxSize is the maximum size of a MsgDigestSkipTag message
const MsgOfInterestTagMaxSize = 45
MsgOfInterestTagMaxSize is the maximum size of a MsgOfInterestTag message
const NetIDVerificationTagMaxSize = 215
NetIDVerificationTagMaxSize is the maximum size of a NetIDVerificationTag message
const NetPrioResponseTagMaxSize = 850
NetPrioResponseTagMaxSize is the maximum size of a NetPrioResponseTag message
const PingReplyTagMaxSize = 8
PingReplyTagMaxSize is the maximum size of a PingReplyTag message
const PingTagMaxSize = 8
PingTagMaxSize is the maximum size of a PingTag message
const ProposalPayloadTagMaxSize = 5247980
ProposalPayloadTagMaxSize is the maximum size of a ProposalPayloadTag message This value is dominated by the MaxTxnBytesPerBlock
const StateProofSigTagMaxSize = 6378
StateProofSigTagMaxSize is the maximum size of a StateProofSigTag message
const TagLength = 2
TagLength specifies the length of protocol tags.
const TopicMsgRespTagMaxSize = 6 * 1024 * 1024
TopicMsgRespTagMaxSize is the maximum size of a TopicMsgRespTag message This is a response to a topic message request (either UE or MI) and the largest possible response is the largest possible block. Matches current network.MaxMessageLength
const TxnTagMaxSize = 4620031
TxnTagMaxSize is the maximum size of a TxnTag message. This is equal to SignedTxnMaxSize() which is size of just a single message containing maximum Stateproof. Since Stateproof transactions can't be batched we don't need to multiply by MaxTxnBatchSize.
const UniEnsBlockReqTagMaxSize = 67
UniEnsBlockReqTagMaxSize is the maximum size of a UniEnsBlockReqTag message
const VoteBundleTagMaxSize = 6 * 1024 * 1024
VoteBundleTagMaxSize is the maximum size of a VoteBundleTag message Matches current network.MaxMessageLength
Variables ¶
var CodecHandle *codec.MsgpackHandle
CodecHandle is used to instantiate msgpack encoders and decoders with our settings (canonical, paranoid about decoding errors)
var ErrInvalidObject = errors.New("unmarshalled object is invalid")
ErrInvalidObject is used to state that an object decoding has failed because it's invalid.
var JSONHandle *codec.JsonHandle
JSONHandle is used to instantiate JSON encoders and decoders with our settings (canonical, paranoid about decoding errors)
var JSONStrictHandle *codec.JsonHandle
JSONStrictHandle is the same as JSONHandle but with MapKeyAsString=true for correct maps[int]interface{} encoding
var TagList = []Tag{ AgreementVoteTag, MsgOfInterestTag, MsgDigestSkipTag, NetIDVerificationTag, NetPrioResponseTag, PingTag, PingReplyTag, ProposalPayloadTag, StateProofSigTag, TopicMsgRespTag, TxnTag, UniEnsBlockReqTag, VoteBundleTag, }
TagList is a list of all currently used protocol tags.
var TagMap map[Tag]struct{}
TagMap is a map of all currently used protocol tags.
Functions ¶
func ConsensusVersionMaxSize ¶
func ConsensusVersionMaxSize() (s int)
MaxSize returns a maximum valid message size for this message type
func Decode ¶
func Decode(b []byte, objptr msgp.Unmarshaler) error
Decode attempts to decode a msgpack-encoded byte buffer into an object instance pointed to by objptr.
func DecodeJSON ¶
DecodeJSON attempts to decode a JSON-encoded byte buffer into an object instance pointed to by objptr
func DecodeMsgp ¶
func DecodeMsgp(b []byte, objptr msgp.Unmarshaler) (err error)
DecodeMsgp attempts to decode a msgpack-encoded byte buffer into an object instance pointed to by objptr, requiring that we pre- generated the code for doing so using msgp.
func DecodeReflect ¶
DecodeReflect attempts to decode a msgpack-encoded byte buffer into an object instance pointed to by objptr, using reflection.
func DecodeStream ¶
DecodeStream is like Decode but reads from an io.Reader instead.
func EncodeJSON ¶
func EncodeJSON(obj interface{}) []byte
EncodeJSON returns a JSON-encoded byte buffer for a given object
func EncodeJSONStrict ¶
func EncodeJSONStrict(obj interface{}) []byte
EncodeJSONStrict returns a JSON-encoded byte buffer for a given object It is the same EncodeJSON but encodes map's int keys as strings
func EncodeMsgp ¶
EncodeMsgp returns a msgpack-encoded byte buffer, requiring that we pre-generated the code for doing so using msgp.
func EncodeReflect ¶
func EncodeReflect(obj interface{}) []byte
EncodeReflect returns a msgpack-encoded byte buffer for a given object, using reflection.
func EncodeStream ¶
EncodeStream is like Encode but writes to an io.Writer instead.
func EncodingTest ¶
func EncodingTest(template msgpMarshalUnmarshal) error
EncodingTest tests that our two msgpack codecs (msgp and go-codec) agree on encodings and decodings of random values of the type of template, returning an error if there is a mismatch.
func ErrorMaxSize ¶
func ErrorMaxSize() (s int)
MaxSize returns a maximum valid message size for this message type
func HashIDMaxSize ¶
func HashIDMaxSize() (s int)
MaxSize returns a maximum valid message size for this message type
func NetworkIDMaxSize ¶
func NetworkIDMaxSize() (s int)
MaxSize returns a maximum valid message size for this message type
func NewEncoder ¶
NewEncoder returns an encoder object writing bytes into [w].
func NewJSONEncoder ¶
NewJSONEncoder returns an encoder object writing bytes into [w].
func PutEncodingBuf ¶
func PutEncodingBuf(buf *EncodingBuf)
PutEncodingBuf places a byte slice into the pool of temporary buffers for encoding. The caller gives up ownership of the byte slice when passing it to PutEncodingBuf().
func RandomizeObject ¶
func RandomizeObject(template interface{}) (interface{}, error)
RandomizeObject returns a random object of the same type as template
func RandomizeObjectField ¶
func RandomizeObjectField(template interface{}) (interface{}, error)
RandomizeObjectField returns a random object of the same type as template where a single field was modified.
func RunEncodingTest ¶
RunEncodingTest runs several iterations of encoding/decoding consistency testing of object type specified by template.
func StateProofTypeMaxSize ¶
func StateProofTypeMaxSize() (s int)
MaxSize returns a maximum valid message size for this message type
func TagMaxSize ¶
func TagMaxSize() (s int)
MaxSize returns a maximum valid message size for this message type
func TxTypeMaxSize ¶
func TxTypeMaxSize() (s int)
MaxSize returns a maximum valid message size for this message type
Types ¶
type ConsensusVersion ¶
type ConsensusVersion string
ConsensusVersion is a string that identifies a version of the consensus protocol.
func (ConsensusVersion) CanMarshalMsg ¶
func (_ ConsensusVersion) CanMarshalMsg(z interface{}) bool
func (*ConsensusVersion) CanUnmarshalMsg ¶
func (_ *ConsensusVersion) CanUnmarshalMsg(z interface{}) bool
func (ConsensusVersion) MarshalMsg ¶
func (z ConsensusVersion) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (ConsensusVersion) MsgIsZero ¶
func (z ConsensusVersion) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (ConsensusVersion) Msgsize ¶
func (z ConsensusVersion) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*ConsensusVersion) UnmarshalMsg ¶
func (z *ConsensusVersion) UnmarshalMsg(bts []byte) (o []byte, err error)
func (*ConsensusVersion) UnmarshalMsgWithState ¶
func (z *ConsensusVersion) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Decoder ¶
type Decoder interface {
Decode(objptr interface{}) error
}
Decoder is our interface for a thing that can decode objects.
func NewDecoder ¶
NewDecoder returns a decoder object reading bytes from [r].
func NewDecoderBytes ¶
NewDecoderBytes returns a decoder object reading bytes from [b].
func NewJSONDecoder ¶
NewJSONDecoder returns a json decoder object reading bytes from [r].
type EncodingBuf ¶
type EncodingBuf struct {
// contains filtered or unexported fields
}
EncodingBuf is a wrapper for a byte slice that can be used for encoding
func GetEncodingBuf ¶
func GetEncodingBuf() *EncodingBuf
GetEncodingBuf returns a byte slice that can be used for encoding a temporary message. The byte slice has zero length but potentially non-zero capacity. The caller gets full ownership of the byte slice, but is encouraged to return it using PutEncodingBuf().
func (*EncodingBuf) Bytes ¶
func (eb *EncodingBuf) Bytes() []byte
Bytes returns the underlying byte slice
func (*EncodingBuf) Update ¶
func (eb *EncodingBuf) Update(v []byte) *EncodingBuf
Update updates the underlying byte slice to the given one if its capacity exceeds the current one.
type Error ¶
type Error ConsensusVersion
Error is used to indicate that an unsupported protocol has been detected.
func (Error) CanMarshalMsg ¶
func (*Error) CanUnmarshalMsg ¶
func (Error) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (Error) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Error) UnmarshalMsgWithState ¶
UnmarshalMsg implements msgp.Unmarshaler
type HashID ¶
type HashID string
HashID is a domain separation prefix for an object type that might be hashed This ensures, for example, the hash of a transaction will never collide with the hash of a vote
const ( AppIndex HashID = "appID" // ARCReserved is used to reserve prefixes starting with `arc` to // ARCs-related hashes https://github.com/algorandfoundation/ARCs // The prefix for ARC-XXXX should start with: // "arcXXXX" (where "XXXX" is the 0-padded number of the ARC) // For example ARC-0003 can use any prefix starting with "arc0003" ARCReserved HashID = "arc" AuctionBid HashID = "aB" AuctionDeposit HashID = "aD" AuctionOutcomes HashID = "aO" AuctionParams HashID = "aP" AuctionSettlement HashID = "aS" AgreementSelector HashID = "AS" BlockHeader256 HashID = "B256" BlockHeader HashID = "BH" BalanceRecord HashID = "BR" Credential HashID = "CR" Genesis HashID = "GE" KeysInMSS HashID = "KP" MerkleArrayNode HashID = "MA" MerkleVectorCommitmentBottomLeaf HashID = "MB" Message HashID = "MX" NetIdentityChallenge HashID = "NIC" NetIdentityChallengeResponse HashID = "NIR" NetIdentityVerificationMessage HashID = "NIV" NetPrioResponse HashID = "NPR" OneTimeSigKey1 HashID = "OT1" OneTimeSigKey2 HashID = "OT2" PaysetFlat HashID = "PF" Payload HashID = "PL" Program HashID = "Program" ProgramData HashID = "ProgData" ProposerSeed HashID = "PS" ParticipationKeys HashID = "PK" Seed HashID = "SD" SpecialAddr HashID = "SpecialAddr" SignedTxnInBlock HashID = "STIB" StateProofCoin HashID = "spc" StateProofMessage HashID = "spm" StateProofPart HashID = "spp" StateProofSig HashID = "sps" StateProofVerCtx HashID = "spv" TestHashable HashID = "TE" TxGroup HashID = "TG" TxnMerkleLeaf HashID = "TL" Transaction HashID = "TX" Vote HashID = "VO" )
Hash IDs for specific object types, in lexicographic order. Hash IDs must be PREFIX-FREE (no hash ID is a prefix of another).
func (HashID) CanMarshalMsg ¶
func (*HashID) CanUnmarshalMsg ¶
func (HashID) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (HashID) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*HashID) UnmarshalMsgWithState ¶
UnmarshalMsg implements msgp.Unmarshaler
type MsgpDecoderBytes ¶
type MsgpDecoderBytes struct {
// contains filtered or unexported fields
}
MsgpDecoderBytes is a []byte decoder into msgp-encoded objects
func NewMsgpDecoderBytes ¶
func NewMsgpDecoderBytes(b []byte) *MsgpDecoderBytes
NewMsgpDecoderBytes returns a decoder object reading bytes from [b]. that works with msgp-serialized objects
func (*MsgpDecoderBytes) Consumed ¶
func (d *MsgpDecoderBytes) Consumed() int
Consumed returns number of bytes consumed so far.
func (*MsgpDecoderBytes) Decode ¶
func (d *MsgpDecoderBytes) Decode(objptr msgp.Unmarshaler) error
Decode an objptr from from a byte stream
func (*MsgpDecoderBytes) Remaining ¶
func (d *MsgpDecoderBytes) Remaining() int
Remaining returns number of bytes remained in the input buffer.
type NetworkID ¶
type NetworkID string
The NetworkID type is used for strings that identify distinct named networks
func (NetworkID) CanMarshalMsg ¶
func (*NetworkID) CanUnmarshalMsg ¶
func (NetworkID) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (NetworkID) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*NetworkID) UnmarshalMsgWithState ¶
UnmarshalMsg implements msgp.Unmarshaler
type SortStateProofType ¶
type SortStateProofType []StateProofType
SortStateProofType implements sorting by StateProofType keys for canonical encoding of maps in msgpack format.
func (SortStateProofType) Len ¶
func (a SortStateProofType) Len() int
func (SortStateProofType) Less ¶
func (a SortStateProofType) Less(i, j int) bool
func (SortStateProofType) Swap ¶
func (a SortStateProofType) Swap(i, j int)
type StateProofType ¶
type StateProofType uint64
StateProofType identifies a particular configuration of state proofs.
func (StateProofType) CanMarshalMsg ¶
func (_ StateProofType) CanMarshalMsg(z interface{}) bool
func (*StateProofType) CanUnmarshalMsg ¶
func (_ *StateProofType) CanUnmarshalMsg(z interface{}) bool
func (StateProofType) MarshalMsg ¶
func (z StateProofType) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (StateProofType) MsgIsZero ¶
func (z StateProofType) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (StateProofType) Msgsize ¶
func (z StateProofType) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*StateProofType) UnmarshalMsg ¶
func (z *StateProofType) UnmarshalMsg(bts []byte) (o []byte, err error)
func (*StateProofType) UnmarshalMsgWithState ¶
func (z *StateProofType) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Tag ¶
type Tag string
Tag represents a message type identifier. Messages have a Tag field. Handlers can register to a given Tag. e.g., the agreement service can register to handle agreements with the Agreement tag.
const ( AgreementVoteTag Tag = "AV" MsgOfInterestTag Tag = "MI" MsgDigestSkipTag Tag = "MS" NetPrioResponseTag Tag = "NP" NetIDVerificationTag Tag = "NI" PingTag Tag = "pi" PingReplyTag Tag = "pj" ProposalPayloadTag Tag = "PP" StateProofSigTag Tag = "SP" TopicMsgRespTag Tag = "TS" TxnTag Tag = "TX" //UniCatchupReqTag Tag = "UC" was replaced by UniEnsBlockReqTag UniEnsBlockReqTag Tag = "UE" //UniEnsBlockResTag Tag = "US" was used for wsfetcherservice //UniCatchupResTag Tag = "UT" was used for wsfetcherservice VoteBundleTag Tag = "VB" )
Tags, in lexicographic sort order of tag values to avoid duplicates. These tags must not contain a comma character because lists of tags are encoded using a comma separator (see network/msgOfInterest.go). The tags must be 2 bytes long.
func (Tag) CanMarshalMsg ¶
func (*Tag) CanUnmarshalMsg ¶
func (Tag) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (Tag) MaxMessageSize ¶
MaxMessageSize returns the maximum size of a message for a given tag
func (Tag) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Tag) UnmarshalMsgWithState ¶
UnmarshalMsg implements msgp.Unmarshaler
type TxType ¶
type TxType string
TxType is the type of the transaction written to the ledger
const ( // PaymentTx indicates a payment transaction PaymentTx TxType = "pay" // KeyRegistrationTx indicates a transaction that registers participation keys KeyRegistrationTx TxType = "keyreg" // AssetConfigTx creates, re-configures, or destroys an asset AssetConfigTx TxType = "acfg" // AssetTransferTx transfers assets between accounts (optionally closing) AssetTransferTx TxType = "axfer" // AssetFreezeTx changes the freeze status of an asset AssetFreezeTx TxType = "afrz" // ApplicationCallTx allows creating, deleting, and interacting with an application ApplicationCallTx TxType = "appl" // StateProofTx records a state proof StateProofTx TxType = "stpf" // UnknownTx signals an error UnknownTx TxType = "unknown" )
func (TxType) CanMarshalMsg ¶
func (*TxType) CanUnmarshalMsg ¶
func (TxType) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (TxType) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*TxType) UnmarshalMsgWithState ¶
UnmarshalMsg implements msgp.Unmarshaler