verification

package
v0.30.8 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: AGPL-3.0 Imports: 12 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeTimeoutMessage added in v0.29.0

func MakeTimeoutMessage(view uint64, newestQCView uint64) []byte

MakeTimeoutMessage generates the message we have to sign in order to be able to contribute to Active Pacemaker protocol. Each replica signs with the highest QC view known to that replica.

func MakeVoteMessage added in v0.20.0

func MakeVoteMessage(view uint64, blockID flow.Identifier) []byte

MakeVoteMessage generates the message we have to sign in order to be able to verify signatures without having the full block. To that effect, each data structure that is signed contains the sometimes redundant view number and block ID; this allows us to create the signed message and verify the signed message without having the full block contents.

Types

type CombinedSigner

type CombinedSigner struct {
	// contains filtered or unexported fields
}

CombinedSigner creates votes for the main consensus. When a participant votes for a block, it _always_ provide the staking signature as part of their vote. Furthermore, the participant can _optionally_ also provide a random beacon signature. Through their staking signature, a participant always contributes to HotStuff's progress. Participation in the random beacon is optional (but encouraged). This allows nodes that failed the DKG to still contribute only to consensus (as fallback). TODO: to be replaced by CombinedSignerV3 for mature V2 solution. The difference between V2 and V3 is that V2 will sign 2 sigs, whereas V3 only sign 1 sig.

func NewCombinedSigner

func NewCombinedSigner(
	staking module.Local,
	beaconKeyStore module.RandomBeaconKeyStore,
) *CombinedSigner

NewCombinedSigner creates a new combined signer with the given dependencies: - the staking signer is used to create and verify aggregatable signatures for Hotstuff - the beaconKeyStore is used to get threshold-signers by epoch/view; - the signer ID is used as the identity when creating signatures;

func (*CombinedSigner) CreateProposal

func (c *CombinedSigner) CreateProposal(block *model.Block) (*model.Proposal, error)

CreateProposal will create a proposal with a combined signature for the given block.

func (*CombinedSigner) CreateTimeout added in v0.29.0

func (c *CombinedSigner) CreateTimeout(curView uint64, newestQC *flow.QuorumCertificate, lastViewTC *flow.TimeoutCertificate) (*model.TimeoutObject, error)

CreateTimeout will create a signed timeout object for the given view. Timeout objects are only signed with the staking key (not beacon key).

func (*CombinedSigner) CreateVote

func (c *CombinedSigner) CreateVote(block *model.Block) (*model.Vote, error)

CreateVote will create a vote with a combined signature for the given block.

type CombinedSignerV3 added in v0.23.9

type CombinedSignerV3 struct {
	// contains filtered or unexported fields
}

CombinedSignerV3 creates votes for the main consensus. When a participant votes for a block, it _always_ provide the staking signature as part of their vote. Furthermore, the participant can _optionally_ also provide a random beacon signature. Through their staking signature, a participant always contributes to HotStuff's progress. Participation in the random beacon is optional (but encouraged). This allows nodes that failed the DKG to still contribute only to consensus (as fallback). TODO: to be replaced by CombinedSignerV3 for mature V2 solution. The difference between V2 and V3 is that V2 will sign 2 sigs, whereas V3 only sign 1 sig.

func NewCombinedSignerV3 added in v0.23.9

func NewCombinedSignerV3(
	staking module.Local,
	beaconKeyStore module.RandomBeaconKeyStore,
) *CombinedSignerV3

NewCombinedSignerV3 creates a new combined signer with the given dependencies: - the staking signer is used to create and verify aggregatable signatures for Hotstuff - the beaconKeyStore is used to get threshold-signers by epoch/view; - the signer ID is used as the identity when creating signatures;

func (*CombinedSignerV3) CreateProposal added in v0.23.9

func (c *CombinedSignerV3) CreateProposal(block *model.Block) (*model.Proposal, error)

CreateProposal will create a proposal with a combined signature for the given block.

func (*CombinedSignerV3) CreateTimeout added in v0.29.0

func (c *CombinedSignerV3) CreateTimeout(curView uint64, newestQC *flow.QuorumCertificate, lastViewTC *flow.TimeoutCertificate) (*model.TimeoutObject, error)

CreateTimeout will create a signed timeout object for the given view. Timeout objects are only signed with the staking key (not beacon key).

func (*CombinedSignerV3) CreateVote added in v0.23.9

func (c *CombinedSignerV3) CreateVote(block *model.Block) (*model.Vote, error)

CreateVote will create a vote with a combined signature for the given block.

type SignerMetricsWrapper

type SignerMetricsWrapper struct {
	// contains filtered or unexported fields
}

SignerMetricsWrapper implements the hotstuff.SignerVerifier interface. It wraps a hotstuff.SignerVerifier instance and measures the time which the HotStuff's core logic spends in the hotstuff.Signer component, i.e. the with crypto-related operations. The measured time durations are reported as values for the SignerProcessingDuration metric. TODO: to be moved to consensus/hotstuff/signature

func NewMetricsWrapper

func NewMetricsWrapper(signer hotstuff.Signer, metrics module.HotstuffMetrics) *SignerMetricsWrapper

func (SignerMetricsWrapper) CreateProposal

func (w SignerMetricsWrapper) CreateProposal(block *model.Block) (*model.Proposal, error)

func (SignerMetricsWrapper) CreateTimeout added in v0.29.0

func (w SignerMetricsWrapper) CreateTimeout(curView uint64,
	newestQC *flow.QuorumCertificate,
	lastViewTC *flow.TimeoutCertificate) (*model.TimeoutObject, error)

func (SignerMetricsWrapper) CreateVote

func (w SignerMetricsWrapper) CreateVote(block *model.Block) (*model.Vote, error)

type StakingSigner added in v0.23.9

type StakingSigner struct {
	// contains filtered or unexported fields
}

StakingSigner creates votes for the collector clusters consensus. When a participant votes for a block, it _always_ provide the staking signature as part of their vote. StakingSigner is responsible for creating correctly signed proposals and votes.

func NewStakingSigner added in v0.23.9

func NewStakingSigner(
	me module.Local,
) *StakingSigner

NewStakingSigner instantiates a StakingSigner, which signs votes and proposals with the staking key. The generated signatures are aggregatable.

func (*StakingSigner) CreateProposal added in v0.23.9

func (c *StakingSigner) CreateProposal(block *model.Block) (*model.Proposal, error)

CreateProposal will create a proposal with a staking signature for the given block.

func (*StakingSigner) CreateTimeout added in v0.29.0

func (c *StakingSigner) CreateTimeout(curView uint64, newestQC *flow.QuorumCertificate, lastViewTC *flow.TimeoutCertificate) (*model.TimeoutObject, error)

CreateTimeout will create a signed timeout object for the given view.

func (*StakingSigner) CreateVote added in v0.23.9

func (c *StakingSigner) CreateVote(block *model.Block) (*model.Vote, error)

CreateVote will create a vote with a staking signature for the given block.

Jump to

Keyboard shortcuts

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