verification

package
v0.25.15-debug-tx-dedup Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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) 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) 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) 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) 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