Documentation ¶
Index ¶
- func FetchLightHeaders(l BlockHeaderFetcher, stateProofInterval uint64, latestRound basics.Round) ([]bookkeeping.LightBlockHeader, error)
- func GenerateProofOfLightBlockHeaders(stateProofInterval uint64, blkHdrArr lightBlockHeaders, blockIndex uint64) (*merklearray.SingleLeafProof, error)
- func GenerateStateProofMessage(l BlockHeaderFetcher, round basics.Round) (stateproofmsg.Message, error)
- func GetOldestExpectedStateProof(latestHeader *bookkeeping.BlockHeader) basics.Round
- func SigFromAddrMaxSize() (s int)
- func SpProverMaxSize() (s int)
- type Accounts
- type Address
- type BlockHeaderFetcher
- type Ledger
- type Network
- type SortAddress
- type TransactionSender
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchLightHeaders ¶
func FetchLightHeaders(l BlockHeaderFetcher, stateProofInterval uint64, latestRound basics.Round) ([]bookkeeping.LightBlockHeader, error)
FetchLightHeaders returns the headers of the blocks in the interval
func GenerateProofOfLightBlockHeaders ¶
func GenerateProofOfLightBlockHeaders(stateProofInterval uint64, blkHdrArr lightBlockHeaders, blockIndex uint64) (*merklearray.SingleLeafProof, error)
GenerateProofOfLightBlockHeaders sets up a tree over the blkHdrArr and returns merkle proof over one of the blocks.
func GenerateStateProofMessage ¶
func GenerateStateProofMessage(l BlockHeaderFetcher, round basics.Round) (stateproofmsg.Message, error)
GenerateStateProofMessage returns a stateproof message that contains all the necessary data for proving on Algorand's state. In addition, it also includes the trusted data for the next stateproof verification
func GetOldestExpectedStateProof ¶
func GetOldestExpectedStateProof(latestHeader *bookkeeping.BlockHeader) basics.Round
GetOldestExpectedStateProof returns the lowest round for which the node should create a state proof.
func SigFromAddrMaxSize ¶
func SigFromAddrMaxSize() (s int)
MaxSize returns a maximum valid message size for this message type
func SpProverMaxSize ¶
func SpProverMaxSize() (s int)
MaxSize returns a maximum valid message size for this message type
Types ¶
type Accounts ¶
type Accounts interface { StateProofKeys(basics.Round) []account.StateProofSecretsForRound DeleteStateProofKey(id account.ParticipationID, round basics.Round) error }
Accounts captures the aspects of the AccountManager that are used by this package.
type Address ¶
Address is required for the msgpack sort binding, since it looks for Address and not basics.Address
type BlockHeaderFetcher ¶
type BlockHeaderFetcher interface {
BlockHdr(round basics.Round) (bookkeeping.BlockHeader, error)
}
BlockHeaderFetcher captures the aspects of the Ledger that is used to fetch block headers
type Ledger ¶
type Ledger interface { Latest() basics.Round Wait(basics.Round) chan struct{} GenesisHash() crypto.Digest BlockHdr(basics.Round) (bookkeeping.BlockHeader, error) VotersForStateProof(basics.Round) (*ledgercore.VotersForRound, error) RegisterVotersCommitListener(listener ledgercore.VotersCommitListener) UnregisterVotersCommitListener() }
Ledger captures the aspects of the ledger that are used by this package.
type Network ¶
type Network interface { Broadcast(ctx context.Context, tag protocol.Tag, data []byte, wait bool, except network.Peer) error RegisterHandlers([]network.TaggedMessageHandler) }
Network captures the aspects of the gossip network protocol that are used by this package.
type SortAddress ¶
type SortAddress = basics.SortAddress
SortAddress implements sorting by Address keys for canonical encoding of maps in msgpack format.
type TransactionSender ¶
type TransactionSender interface {
BroadcastInternalSignedTxGroup([]transactions.SignedTxn) error
}
TransactionSender is an interface that captures the node's ability to broadcast a new transaction.
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker builds state proofs, by broadcasting signatures using this node's participation keys, by collecting signatures sent by others, and by sending out the resulting state proof in a transaction.
func NewWorker ¶
func NewWorker(genesisDir string, log logging.Logger, accts Accounts, ledger Ledger, net Network, txnSender TransactionSender) *Worker
NewWorker constructs a new Worker, as used by the node.
func (*Worker) OnPrepareVoterCommit ¶
func (spw *Worker) OnPrepareVoterCommit(oldBase basics.Round, newBase basics.Round, votersFetcher ledgercore.LedgerForSPBuilder)
OnPrepareVoterCommit is a function called by the voters tracker when it's preparing to commit rnd. It gives the builder the chance to persist the data it needs.