Documentation
¶
Index ¶
- func BatchIDEqual(a BatchID, b BatchID) bool
- func BatchIDToString(id BatchID) string
- func BatchRequestsDataHashWithSerialize(br BatchedRequests) []byte
- type AssemblerConsensusPosition
- type Batch
- type BatchAttestation
- type BatchAttestationFragment
- type BatchID
- type BatchSequence
- type BatchedRequests
- type ConfigSequence
- type DecisionNum
- type Logger
- type OrderedBatchAttestation
- type OrderingInfo
- type PartyID
- type ShardID
- type SimpleBatch
- type SimpleBatchAttestationFragment
- func (s *SimpleBatchAttestationFragment) ConfigSequence() ConfigSequence
- func (s *SimpleBatchAttestationFragment) Deserialize(bytes []byte) error
- func (s *SimpleBatchAttestationFragment) Digest() []byte
- func (s *SimpleBatchAttestationFragment) Primary() PartyID
- func (s *SimpleBatchAttestationFragment) Seq() BatchSequence
- func (s *SimpleBatchAttestationFragment) Serialize() []byte
- func (s *SimpleBatchAttestationFragment) SetSignature(sig []byte)
- func (s *SimpleBatchAttestationFragment) Shard() ShardID
- func (s *SimpleBatchAttestationFragment) Signature() []byte
- func (s *SimpleBatchAttestationFragment) Signer() PartyID
- func (s *SimpleBatchAttestationFragment) String() string
- func (s *SimpleBatchAttestationFragment) ToBeSigned() []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchIDEqual ¶ added in v0.0.19
func BatchIDToString ¶
func BatchRequestsDataHashWithSerialize ¶
func BatchRequestsDataHashWithSerialize(br BatchedRequests) []byte
BatchRequestsDataHashWithSerialize is a reference implementation for how Digest should work, if computed with serialization. It is used only in tests, as it is slower that the cumulative version implemented in Digest(), above.
Types ¶
type AssemblerConsensusPosition ¶ added in v0.0.19
type AssemblerConsensusPosition struct { DecisionNum DecisionNum BatchIndex int }
type Batch ¶ added in v0.0.19
type Batch interface { BatchID Requests() BatchedRequests }
type BatchAttestation ¶ added in v0.0.16
type BatchAttestation interface { Fragments() []BatchAttestationFragment Digest() []byte Seq() BatchSequence Primary() PartyID Shard() ShardID Serialize() []byte Deserialize([]byte) error }
type BatchAttestationFragment ¶ added in v0.0.16
type BatchID ¶
type BatchID interface { // Shard the shard from which this batch was produced. Shard() ShardID // Primary is the Party ID of the primary batcher which produces this batch. Primary() PartyID // Seq is the sequence number of this batch. Seq() BatchSequence // Digest is the digest of the requests in this batch. Digest() []byte }
BatchID is the tuple that identifies a batch.
type BatchSequence ¶
type BatchSequence uint64
BatchSequence is the number a primary batcher assigns to the batches it produces.
type BatchedRequests ¶
type BatchedRequests [][]byte
BatchedRequests are used to represent a batch of requests.
The requests can be: 1. Client TXs - in the batchers and assemblers 2. Consensus requests, .i.e. control events submitted from batchers to consensus.
func (*BatchedRequests) Deserialize ¶
func (br *BatchedRequests) Deserialize(bytes []byte) error
func (*BatchedRequests) Digest ¶
func (br *BatchedRequests) Digest() []byte
Digest calculates a sha256 digest on a safe representation of the BatchedRequests. This is equivalent to BatchRequestsDataHashWithSerialize, yet faster, and consumes less extra memory.
func (*BatchedRequests) Serialize ¶
func (br *BatchedRequests) Serialize() []byte
func (*BatchedRequests) SizeBytes ¶
func (br *BatchedRequests) SizeBytes() int64
SizeBytes counts the cumulative size of the requests. A `nil` and empty slice returns 0.
type ConfigSequence ¶ added in v0.0.19
type ConfigSequence uint64
ConfigSequence numbers configuration changes, as delivered by a config TX and the corresponding config block. It starts from 0 (on the genesis block) and increases by 1 with every config change.
type DecisionNum ¶
type DecisionNum uint64
DecisionNum is the number the consensus nodes assign to each decision they produce.
type OrderedBatchAttestation ¶ added in v0.0.19
type OrderedBatchAttestation interface { BatchAttestation() BatchAttestation // OrderingInfo is an opaque object that provides extra information on the order of the batch attestation and // metadata to be used in the construction of the block. OrderingInfo() OrderingInfo }
OrderedBatchAttestation carries the BatchAttestation and information on the actual order of the batch from the consensus cluster. This information is used when appending to the ledger, and helps the assembler to recover following a shutdown or a failure.
type OrderingInfo ¶ added in v0.0.19
OrderingInfo is an opaque object that provides extra information on the order of the batch attestation and metadata to be used in the construction of the block.
type ShardID ¶
type ShardID uint16
ShardID identifies a shard, should be >0. Value math.MaxUint16 is reserved.
type SimpleBatch ¶
type SimpleBatch struct {
// contains filtered or unexported fields
}
func NewSimpleBatch ¶
func NewSimpleBatch(seq BatchSequence, shard ShardID, primary PartyID, requests BatchedRequests) *SimpleBatch
func (*SimpleBatch) Digest ¶
func (sb *SimpleBatch) Digest() []byte
func (*SimpleBatch) Primary ¶
func (sb *SimpleBatch) Primary() PartyID
func (*SimpleBatch) Requests ¶
func (sb *SimpleBatch) Requests() BatchedRequests
func (*SimpleBatch) Seq ¶
func (sb *SimpleBatch) Seq() BatchSequence
func (*SimpleBatch) Shard ¶
func (sb *SimpleBatch) Shard() ShardID
type SimpleBatchAttestationFragment ¶
type SimpleBatchAttestationFragment struct {
// contains filtered or unexported fields
}
func NewSimpleBatchAttestationFragment ¶
func NewSimpleBatchAttestationFragment(shard ShardID, primary PartyID, seq BatchSequence, digest []byte, signer PartyID, configSqn ConfigSequence) *SimpleBatchAttestationFragment
NewSimpleBatchAttestationFragment creates a new, unsigned, SimpleBatchAttestationFragment.
func (*SimpleBatchAttestationFragment) ConfigSequence ¶ added in v0.0.19
func (s *SimpleBatchAttestationFragment) ConfigSequence() ConfigSequence
func (*SimpleBatchAttestationFragment) Deserialize ¶
func (s *SimpleBatchAttestationFragment) Deserialize(bytes []byte) error
Deserialize unmarshalls every field including the signature, using an auxiliary ASN1 struct and asn1.Unmarshal.
func (*SimpleBatchAttestationFragment) Digest ¶
func (s *SimpleBatchAttestationFragment) Digest() []byte
func (*SimpleBatchAttestationFragment) Primary ¶
func (s *SimpleBatchAttestationFragment) Primary() PartyID
func (*SimpleBatchAttestationFragment) Seq ¶
func (s *SimpleBatchAttestationFragment) Seq() BatchSequence
func (*SimpleBatchAttestationFragment) Serialize ¶
func (s *SimpleBatchAttestationFragment) Serialize() []byte
Serialize marshals every field including the signature, using an auxiliary ASN1 struct and asn1.Marshal.
func (*SimpleBatchAttestationFragment) SetSignature ¶
func (s *SimpleBatchAttestationFragment) SetSignature(sig []byte)
func (*SimpleBatchAttestationFragment) Shard ¶
func (s *SimpleBatchAttestationFragment) Shard() ShardID
func (*SimpleBatchAttestationFragment) Signature ¶
func (s *SimpleBatchAttestationFragment) Signature() []byte
func (*SimpleBatchAttestationFragment) Signer ¶
func (s *SimpleBatchAttestationFragment) Signer() PartyID
func (*SimpleBatchAttestationFragment) String ¶
func (s *SimpleBatchAttestationFragment) String() string
func (*SimpleBatchAttestationFragment) ToBeSigned ¶
func (s *SimpleBatchAttestationFragment) ToBeSigned() []byte
ToBeSigned marshals every field except the signature, using an auxiliary ASN1 struct and asn1.Marshal.