Skip to content

Instantly share code, notes, and snippets.

View Wondertan's full-sized avatar

Hlib Kanunnikov Wondertan

View GitHub Profile
@Wondertan
Wondertan / concord.go
Last active May 6, 2023 20:56
Interfaces for heterogenous consensus algorigthms over p2p network.
// ProposalData is arbitrary data that Proposers agree on.
//
// Alternative names: consensus.Data, Contract, or can remove alias altogether.
type ProposalData = []byte
// ValidatorFunc validates the ProposalData and reports back to the Concord
// Q: Verify vs Validate? Quick googling suggests that Validate suits better, but might be wrong.
type ValidatorFunc func(context.Context, ProposalData) (bool, error)
// ProposeFunc builds ProposalData.