Versions in this module Expand all Collapse all v1 v1.0.1 Apr 21, 2023 Changes in this version + const ConsensusName + const ExtraSeal + const ExtraVanity + var PolyBFTMixDigest = types.StringToHash("adce6e5230abe012342a44e4e9b6d05997d6f015387ae0e59be924afc7ec70c1") + func Factory(params *consensus.Params) (consensus.Consensus, error) + func GenesisPostHookFactory(config *chain.Chain, engineName string) func(txn *state.Transition) error + func GetIbftExtraClean(extraRaw []byte) ([]byte, error) + func NewStateProvider(transition *state.Transition) contract.Provider + func NewValidatorSet(valz AccountSet, logger hclog.Logger) *validatorSet + type AccountSet []*ValidatorMetadata + func (as *AccountSet) GetTotalVotingPower() *big.Int + func (as *AccountSet) Unmarshal(b []byte) error + func (as AccountSet) ApplyDelta(validatorsDelta *ValidatorSetDelta) (AccountSet, error) + func (as AccountSet) ContainsAddress(address types.Address) bool + func (as AccountSet) ContainsNodeID(nodeID string) bool + func (as AccountSet) Copy() AccountSet + func (as AccountSet) Equals(other AccountSet) bool + func (as AccountSet) GetAddresses() []types.Address + func (as AccountSet) GetAddressesAsSet() map[types.Address]struct{} + func (as AccountSet) GetBlsKeys() []*bls.PublicKey + func (as AccountSet) GetFilteredValidators(bitmap bitmap.Bitmap) (AccountSet, error) + func (as AccountSet) GetValidatorMetadata(address types.Address) *ValidatorMetadata + func (as AccountSet) Hash() (types.Hash, error) + func (as AccountSet) Index(addr types.Address) int + func (as AccountSet) Len() int + func (as AccountSet) Marshal() ([]byte, error) + func (as AccountSet) String() string + func (as AccountSet) ToAPIBinding() []*contractsapi.Validator + type BlockBuilder struct + func NewBlockBuilder(params *BlockBuilderParams) *BlockBuilder + func (b *BlockBuilder) Block() *types.Block + func (b *BlockBuilder) Build(handler func(h *types.Header)) (*types.FullBlock, error) + func (b *BlockBuilder) Fill() + func (b *BlockBuilder) GetState() *state.Transition + func (b *BlockBuilder) Receipts() []*types.Receipt + func (b *BlockBuilder) Reset() error + func (b *BlockBuilder) WriteTx(tx *types.Transaction) error + type BlockBuilderParams struct + BlockTime time.Duration + Coinbase types.Address + Executor *state.Executor + GasLimit uint64 + Logger hcf.Logger + Parent *types.Header + TxPool txPoolInterface + type BridgeConfig struct + CheckpointManagerAddr types.Address + EventTrackerStartBlocks map[types.Address]uint64 + ExitHelperAddr types.Address + JSONRPCEndpoint string + RootERC1155PredicateAddr types.Address + RootERC20PredicateAddr types.Address + RootERC721PredicateAddr types.Address + RootNativeERC20Addr types.Address + StateSenderAddr types.Address + type BridgeTransport interface + Multicast func(msg interface{}) + type CheckpointData struct + BlockRound uint64 + CurrentValidatorsHash types.Hash + EpochNumber uint64 + EventRoot types.Hash + NextValidatorsHash types.Hash + func (c *CheckpointData) Copy() *CheckpointData + func (c *CheckpointData) Hash(chainID uint64, blockNumber uint64, blockHash types.Hash) (types.Hash, error) + func (c *CheckpointData) MarshalRLPWith(ar *fastrlp.Arena) *fastrlp.Value + func (c *CheckpointData) UnmarshalRLPWith(v *fastrlp.Value) error + func (c *CheckpointData) Validate(parentCheckpoint *CheckpointData, currentValidators AccountSet, ...) error + func (c *CheckpointData) ValidateBasic(parentCheckpoint *CheckpointData) error + type CheckpointManager interface + BuildEventRoot func(epoch uint64) (types.Hash, error) + GenerateExitProof func(exitID uint64) (types.Proof, error) + PostBlock func(req *PostBlockRequest) error + type CheckpointStore struct + type CommitmentMessageSigned struct + AggSignature Signature + Message *contractsapi.StateSyncCommitment + PublicKeys [][]byte + func (cm *CommitmentMessageSigned) ContainsStateSync(stateSyncID uint64) bool + func (cm *CommitmentMessageSigned) DecodeAbi(txData []byte) error + func (cm *CommitmentMessageSigned) EncodeAbi() ([]byte, error) + func (cm *CommitmentMessageSigned) Hash() (types.Hash, error) + func (cm *CommitmentMessageSigned) VerifyStateSyncProof(proof []types.Hash, stateSync *contractsapi.StateSyncedEvent) error + type EpochStore struct + type ExitEvent struct + BlockNumber uint64 + Data []byte + EpochNumber uint64 + ID uint64 + Receiver ethgo.Address + Sender ethgo.Address + type Extra struct + Checkpoint *CheckpointData + Committed *Signature + Parent *Signature + Validators *ValidatorSetDelta + func GetIbftExtra(extraRaw []byte) (*Extra, error) + func (i *Extra) MarshalRLPTo(dst []byte) []byte + func (i *Extra) MarshalRLPWith(ar *fastrlp.Arena) *fastrlp.Value + func (i *Extra) UnmarshalRLP(input []byte) error + func (i *Extra) UnmarshalRLPWith(v *fastrlp.Value) error + func (i *Extra) ValidateDelta(oldValidators AccountSet, newValidators AccountSet) error + func (i *Extra) ValidateFinalizedData(header *types.Header, parent *types.Header, parents []*types.Header, ...) error + func (i *Extra) ValidateParentSignatures(blockNumber uint64, consensusBackend polybftBackend, parents []*types.Header, ...) error + type IBFTConsensusWrapper struct + type MessageSignature struct + From string + Signature []byte + type PendingCommitment struct + Epoch uint64 + MerkleTree *merkle.MerkleTree + func NewPendingCommitment(epoch uint64, stateSyncEvents []*contractsapi.StateSyncedEvent) (*PendingCommitment, error) + func (cm *PendingCommitment) Hash() (types.Hash, error) + type PolyBFTConfig struct + BlockTime common.Duration + Bridge *BridgeConfig + EpochReward uint64 + EpochSize uint64 + Governance types.Address + InitialTrieRoot types.Hash + InitialValidatorSet []*Validator + MintableNativeToken bool + NativeTokenConfig *TokenConfig + SprintSize uint64 + func GetPolyBFTConfig(chainConfig *chain.Chain) (PolyBFTConfig, error) + func LoadPolyBFTConfig(chainConfigFile string) (PolyBFTConfig, error) + func (p *PolyBFTConfig) IsBridgeEnabled() bool + type Polybft struct + func (p *Polybft) Close() error + func (p *Polybft) FilterExtra(extra []byte) ([]byte, error) + func (p *Polybft) GetBlockCreator(h *types.Header) (types.Address, error) + func (p *Polybft) GetBridgeProvider() consensus.BridgeDataProvider + func (p *Polybft) GetSyncProgression() *progress.Progression + func (p *Polybft) GetValidators(blockNumber uint64, parents []*types.Header) (AccountSet, error) + func (p *Polybft) Initialize() error + func (p *Polybft) Multicast(msg *ibftProto.Message) + func (p *Polybft) PreCommitState(_ *types.Header, _ *state.Transition) error + func (p *Polybft) ProcessHeaders(_ []*types.Header) error + func (p *Polybft) Start() error + func (p *Polybft) VerifyHeader(header *types.Header) error + type PostBlockRequest struct + Epoch uint64 + FullBlock *types.FullBlock + IsEpochEndingBlock bool + type PostEpochRequest struct + FirstBlockOfEpoch uint64 + NewEpochID uint64 + SystemState SystemState + ValidatorSet *validatorSet + type PrioritizedValidator struct + Metadata *ValidatorMetadata + ProposerPriority *big.Int + type ProposerCalculator struct + func NewProposerCalculator(config *runtimeConfig, logger hclog.Logger) (*ProposerCalculator, error) + func NewProposerCalculatorFromSnapshot(pcs *ProposerSnapshot, config *runtimeConfig, logger hclog.Logger) *ProposerCalculator + func (pc *ProposerCalculator) GetSnapshot() (*ProposerSnapshot, bool) + func (pc *ProposerCalculator) PostBlock(req *PostBlockRequest) error + type ProposerSnapshot struct + Height uint64 + Proposer *PrioritizedValidator + Round uint64 + Validators []*PrioritizedValidator + func NewProposerSnapshot(height uint64, validators []*ValidatorMetadata) *ProposerSnapshot + func NewProposerSnapshotFromState(config *runtimeConfig) (*ProposerSnapshot, error) + func (pcs *ProposerSnapshot) CalcProposer(round, height uint64) (types.Address, error) + func (pcs *ProposerSnapshot) Copy() *ProposerSnapshot + func (pcs *ProposerSnapshot) GetLatestProposer(round, height uint64) (types.Address, error) + func (pcs ProposerSnapshot) GetTotalVotingPower() *big.Int + type ProposerSnapshotStore struct + type RootchainConfig struct + BLSAddress types.Address + BN256G2Address types.Address + CheckpointManagerAddress types.Address + ERC20TemplateAddress types.Address + ExitHelperAddress types.Address + JSONRPCAddr string + RootERC1155Address types.Address + RootERC1155PredicateAddress types.Address + RootERC20PredicateAddress types.Address + RootERC721Address types.Address + RootERC721PredicateAddress types.Address + RootNativeERC20Address types.Address + StateSenderAddress types.Address + func (r *RootchainConfig) ToBridgeConfig() *BridgeConfig + type Signature struct + AggregatedSignature []byte + Bitmap []byte + func (s *Signature) MarshalRLPWith(ar *fastrlp.Arena) *fastrlp.Value + func (s *Signature) UnmarshalRLPWith(v *fastrlp.Value) error + func (s *Signature) Verify(validators AccountSet, hash types.Hash, domain []byte, logger hclog.Logger) error + type State struct + CheckpointStore *CheckpointStore + EpochStore *EpochStore + ProposerSnapshotStore *ProposerSnapshotStore + StateSyncStore *StateSyncStore + type StateSyncManager interface + Close func() + Commitment func() (*CommitmentMessageSigned, error) + GetStateSyncProof func(stateSyncID uint64) (types.Proof, error) + Init func() error + PostBlock func(req *PostBlockRequest) error + PostEpoch func(req *PostEpochRequest) error + type StateSyncProof struct + Proof []types.Hash + StateSync *contractsapi.StateSyncedEvent + type StateSyncStore struct + type SystemState interface + GetEpoch func() (uint64, error) + GetNextCommittedIndex func() (uint64, error) + GetValidatorSet func() (AccountSet, error) + type SystemStateImpl struct + func NewSystemState(valSetAddr types.Address, stateRcvAddr types.Address, ...) *SystemStateImpl + func (s *SystemStateImpl) GetEpoch() (uint64, error) + func (s *SystemStateImpl) GetNextCommittedIndex() (uint64, error) + func (s *SystemStateImpl) GetValidatorSet() (AccountSet, error) + type TokenConfig struct + Decimals uint8 + Name string + Symbol string + type TransportMessage struct + EpochNumber uint64 + From string + Hash []byte + Signature []byte + type Validator struct + Address types.Address + Balance *big.Int + BlsKey string + BlsPrivateKey *bls.PrivateKey + BlsSignature string + MultiAddr string + Stake *big.Int + func (v *Validator) MarshalJSON() ([]byte, error) + func (v *Validator) String() string + func (v *Validator) ToValidatorMetadata() (*ValidatorMetadata, error) + func (v *Validator) UnmarshalBLSPublicKey() (*bls.PublicKey, error) + func (v *Validator) UnmarshalBLSSignature() (*bls.Signature, error) + func (v *Validator) UnmarshalJSON(data []byte) error + func (v Validator) ToValidatorInitAPIBinding() (*contractsapi.ValidatorInit, error) + type ValidatorInfo struct + Active bool + Address ethgo.Address + Commission *big.Int + Stake *big.Int + TotalStake *big.Int + WithdrawableRewards *big.Int + type ValidatorMetadata struct + Address types.Address + BlsKey *bls.PublicKey + IsActive bool + VotingPower *big.Int + func (v *ValidatorMetadata) Copy() *ValidatorMetadata + func (v *ValidatorMetadata) EqualAddressAndBlsKey(b *ValidatorMetadata) bool + func (v *ValidatorMetadata) Equals(b *ValidatorMetadata) bool + func (v *ValidatorMetadata) MarshalRLPWith(ar *fastrlp.Arena) *fastrlp.Value + func (v *ValidatorMetadata) String() string + func (v *ValidatorMetadata) UnmarshalRLPWith(val *fastrlp.Value) error + type ValidatorSet interface + Accounts func() AccountSet + HasQuorum func(signers map[types.Address]struct{}) bool + Includes func(address types.Address) bool + Len func() int + type ValidatorSetDelta struct + Added AccountSet + Removed bitmap.Bitmap + Updated AccountSet + func (d *ValidatorSetDelta) Copy() *ValidatorSetDelta + func (d *ValidatorSetDelta) Equals(other *ValidatorSetDelta) bool + func (d *ValidatorSetDelta) IsEmpty() bool + func (d *ValidatorSetDelta) MarshalRLPWith(ar *fastrlp.Arena) *fastrlp.Value + func (d *ValidatorSetDelta) String() string + func (d *ValidatorSetDelta) UnmarshalRLPWith(v *fastrlp.Value) error