Versions in this module Expand all Collapse all v1 v1.0.1 Apr 21, 2023 Changes in this version + var ErrEmptyCommittedSeals = errors.New("empty committed seals") + var ErrEmptyParentCommittedSeals = errors.New("empty parent committed seals") + var ErrInvalidCommittedSealLength = errors.New("invalid committed seal length") + var ErrInvalidCommittedSealType = errors.New("invalid committed seal type") + var ErrInvalidSignature = errors.New("invalid signature") + var ErrInvalidValidator = errors.New("invalid validator type") + var ErrInvalidValidators = errors.New("invalid validators type") + var ErrNonValidatorCommittedSeal = errors.New("found committed seal signed by non validator") + var ErrNotEnoughCommittedSeals = errors.New("not enough seals to seal block") + var ErrRepeatedCommittedSeal = errors.New("repeated seal in committed seals") + var ErrSignerMismatch = errors.New("mismatch address between signer and message sender") + var ErrValidatorNotFound = errors.New("validator not found in validator set") + var IstanbulDigest = types.StringToHash("0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365") + var IstanbulExtraSeal = 65 + var IstanbulExtraVanity = 32 + func UseIstanbulHeaderHashInTest(t *testing.T, signer Signer) + type AggregatedSeal struct + Bitmap *big.Int + Signature []byte + func (s *AggregatedSeal) MarshalRLPWith(ar *fastrlp.Arena) *fastrlp.Value + func (s *AggregatedSeal) Num() int + func (s *AggregatedSeal) UnmarshalRLPFrom(p *fastrlp.Parser, v *fastrlp.Value) error + type BLSKeyManager struct + func (s *BLSKeyManager) Address() types.Address + func (s *BLSKeyManager) Ecrecover(sig, digest []byte) (types.Address, error) + func (s *BLSKeyManager) GenerateCommittedSeals(sealMap map[types.Address][]byte, set validators.Validators) (Seals, error) + func (s *BLSKeyManager) NewEmptyCommittedSeals() Seals + func (s *BLSKeyManager) NewEmptyValidators() validators.Validators + func (s *BLSKeyManager) SignCommittedSeal(data []byte) ([]byte, error) + func (s *BLSKeyManager) SignIBFTMessage(msg []byte) ([]byte, error) + func (s *BLSKeyManager) SignProposerSeal(data []byte) ([]byte, error) + func (s *BLSKeyManager) Type() validators.ValidatorType + func (s *BLSKeyManager) VerifyCommittedSeal(set validators.Validators, addr types.Address, rawSignature []byte, ...) error + func (s *BLSKeyManager) VerifyCommittedSeals(rawCommittedSeal Seals, message []byte, vals validators.Validators) (int, error) + type ECDSAKeyManager struct + func (s *ECDSAKeyManager) Address() types.Address + func (s *ECDSAKeyManager) Ecrecover(sig, digest []byte) (types.Address, error) + func (s *ECDSAKeyManager) GenerateCommittedSeals(sealMap map[types.Address][]byte, _ validators.Validators) (Seals, error) + func (s *ECDSAKeyManager) NewEmptyCommittedSeals() Seals + func (s *ECDSAKeyManager) NewEmptyValidators() validators.Validators + func (s *ECDSAKeyManager) SignCommittedSeal(message []byte) ([]byte, error) + func (s *ECDSAKeyManager) SignIBFTMessage(msg []byte) ([]byte, error) + func (s *ECDSAKeyManager) SignProposerSeal(message []byte) ([]byte, error) + func (s *ECDSAKeyManager) Type() validators.ValidatorType + func (s *ECDSAKeyManager) VerifyCommittedSeal(vals validators.Validators, address types.Address, signature []byte, ...) error + func (s *ECDSAKeyManager) VerifyCommittedSeals(rawCommittedSeal Seals, digest []byte, vals validators.Validators) (int, error) + type IstanbulExtra struct + CommittedSeals Seals + ParentCommittedSeals Seals + ProposerSeal []byte + RoundNumber *uint64 + Validators validators.Validators + func (i *IstanbulExtra) MarshalRLPTo(dst []byte) []byte + func (i *IstanbulExtra) MarshalRLPWith(ar *fastrlp.Arena) *fastrlp.Value + func (i *IstanbulExtra) UnmarshalRLP(input []byte) error + func (i *IstanbulExtra) UnmarshalRLPFrom(p *fastrlp.Parser, v *fastrlp.Value) error + type KeyManager interface + Address func() types.Address + Ecrecover func(sig []byte, msg []byte) (types.Address, error) + GenerateCommittedSeals func(sealsByValidator map[types.Address][]byte, vals validators.Validators) (Seals, error) + NewEmptyCommittedSeals func() Seals + NewEmptyValidators func() validators.Validators + SignCommittedSeal func(hash []byte) ([]byte, error) + SignIBFTMessage func(msg []byte) ([]byte, error) + SignProposerSeal func(hash []byte) ([]byte, error) + Type func() validators.ValidatorType + VerifyCommittedSeal func(vals validators.Validators, signer types.Address, sig, hash []byte) error + VerifyCommittedSeals func(seals Seals, hash []byte, vals validators.Validators) (int, error) + func NewBLSKeyManager(manager secrets.SecretsManager) (KeyManager, error) + func NewBLSKeyManagerFromKeys(ecdsaKey *ecdsa.PrivateKey, blsKey *bls_sig.SecretKey) KeyManager + func NewECDSAKeyManager(manager secrets.SecretsManager) (KeyManager, error) + func NewECDSAKeyManagerFromKey(key *ecdsa.PrivateKey) KeyManager + func NewKeyManagerFromType(secretManager secrets.SecretsManager, validatorType validators.ValidatorType) (KeyManager, error) + type Seals interface + MarshalRLPWith func(ar *fastrlp.Arena) *fastrlp.Value + Num func() int + UnmarshalRLPFrom func(*fastrlp.Parser, *fastrlp.Value) error + type SerializedSeal [][]byte + func (s *SerializedSeal) MarshalRLPWith(ar *fastrlp.Arena) *fastrlp.Value + func (s *SerializedSeal) Num() int + func (s *SerializedSeal) UnmarshalRLPFrom(p *fastrlp.Parser, v *fastrlp.Value) error + type Signer interface + Address func() types.Address + CalculateHeaderHash func(*types.Header) (types.Hash, error) + CreateCommittedSeal func([]byte) ([]byte, error) + EcrecoverFromHeader func(*types.Header) (types.Address, error) + EcrecoverFromIBFTMessage func([]byte, []byte) (types.Address, error) + FilterHeaderForHash func(*types.Header) (*types.Header, error) + GetIBFTExtra func(*types.Header) (*IstanbulExtra, error) + GetValidators func(*types.Header) (validators.Validators, error) + InitIBFTExtra func(*types.Header, validators.Validators, Seals) + SignIBFTMessage func([]byte) ([]byte, error) + Type func() validators.ValidatorType + VerifyCommittedSeal func(validators.Validators, types.Address, []byte, []byte) error + VerifyCommittedSeals func(hash types.Hash, committedSeals Seals, validators validators.Validators, ...) error + VerifyParentCommittedSeals func(parentHash types.Hash, header *types.Header, ...) error + WriteCommittedSeals func(header *types.Header, roundNumber uint64, sealMap map[types.Address][]byte) (*types.Header, error) + WriteProposerSeal func(*types.Header) (*types.Header, error) + type SignerImpl struct + func NewSigner(keyManager KeyManager, parentKeyManager KeyManager) *SignerImpl + func (s *SignerImpl) Address() types.Address + func (s *SignerImpl) CalculateHeaderHash(header *types.Header) (types.Hash, error) + func (s *SignerImpl) CreateCommittedSeal(hash []byte) ([]byte, error) + func (s *SignerImpl) EcrecoverFromHeader(header *types.Header) (types.Address, error) + func (s *SignerImpl) EcrecoverFromIBFTMessage(signature, digest []byte) (types.Address, error) + func (s *SignerImpl) FilterHeaderForHash(header *types.Header) (*types.Header, error) + func (s *SignerImpl) GetIBFTExtra(header *types.Header) (*IstanbulExtra, error) + func (s *SignerImpl) GetParentCommittedSeals(header *types.Header) (Seals, error) + func (s *SignerImpl) GetValidators(header *types.Header) (validators.Validators, error) + func (s *SignerImpl) InitIBFTExtra(header *types.Header, validators validators.Validators, ...) + func (s *SignerImpl) SignIBFTMessage(msg []byte) ([]byte, error) + func (s *SignerImpl) Type() validators.ValidatorType + func (s *SignerImpl) VerifyCommittedSeal(validators validators.Validators, signer types.Address, signature, hash []byte) error + func (s *SignerImpl) VerifyCommittedSeals(hash types.Hash, committedSeals Seals, validators validators.Validators, ...) error + func (s *SignerImpl) VerifyParentCommittedSeals(parentHash types.Hash, header *types.Header, ...) error + func (s *SignerImpl) WriteCommittedSeals(header *types.Header, roundNumber uint64, sealMap map[types.Address][]byte) (*types.Header, error) + func (s *SignerImpl) WriteProposerSeal(header *types.Header) (*types.Header, error)