Documentation
¶
Index ¶
- Constants
- Variables
- func EncryptedTxnSubmissionLess(a, b EncryptedTxnSubmission) bool
- func EncryptedTxnSubmissionsAreConsecutive(a, b EncryptedTxnSubmission) bool
- func EonLess(a, b Eon) bool
- func EpochSecretKeyFromBytes(b []byte) (*crypto.EpochSecretKey, error)
- func NewDecryptionKeysExtendedValidator(logger log.Logger, config Config, sc SlotCalculator, et EonTracker) pubsub.ValidatorEx
- type BeaconChainSlotCalculator
- type BlockEvent
- type BlockListener
- type BlockTracker
- type Config
- type DecryptedTxnsPool
- func (p *DecryptedTxnsPool) AddDecryptedTxns(mark DecryptionMark, txnBatch TxnBatch)
- func (p *DecryptedTxnsPool) DecryptedTxns(mark DecryptionMark) (TxnBatch, bool)
- func (p *DecryptedTxnsPool) DeleteDecryptedTxnsUpToSlot(slot uint64) uint64
- func (p *DecryptedTxnsPool) Wait(ctx context.Context, mark DecryptionMark) error
- type DecryptionKeysListener
- type DecryptionKeysProcessor
- type DecryptionKeysSignatureData
- func (d DecryptionKeysSignatureData) HashSSZ() ([32]byte, error)
- func (d DecryptionKeysSignatureData) Sign(key *ecdsa.PrivateKey) ([]byte, error)
- func (d DecryptionKeysSignatureData) Validate() error
- func (d DecryptionKeysSignatureData) Verify(signature []byte, address libcommon.Address) (bool, error)
- type DecryptionKeysValidator
- type DecryptionMark
- type EncryptedTxnSubmission
- type EncryptedTxnsPool
- type Eon
- type EonIndex
- type EonTracker
- type IdentityPreimage
- func (ip *IdentityPreimage) Clone() clonable.Clonable
- func (ip *IdentityPreimage) DecodeSSZ(buf []byte, _ int) error
- func (ip *IdentityPreimage) EncodeSSZ(dst []byte) ([]byte, error)
- func (ip *IdentityPreimage) EncodingSizeSSZ() int
- func (ip *IdentityPreimage) HashSSZ() ([32]byte, error)
- func (ip *IdentityPreimage) String() string
- type IdentityPreimages
- type KsmEonTracker
- type P2pConfig
- type Pool
- type ProcessedMark
- type SlotCalculator
- type TxnBatch
- type TxnIndex
Constants ¶
View Source
const ( ProtocolVersion = "/shutter/0.1.0" DecryptionKeysTopic = "decryptionKeys" )
Variables ¶
View Source
var ( ErrTooManyIdentityPreimages = errors.New("too many identity preimages") ErrIncorrectIdentityPreimageSize = errors.New("incorrect identity preimage size") )
View Source
var ( ErrInstanceIdMismatch = errors.New("instance id mismatch") ErrMissingGnosisExtraData = errors.New("missing gnosis extra data") ErrSlotTooLarge = errors.New("slot too large") ErrSlotInThePast = errors.New("slot in the past") ErrSlotInTheFuture = errors.New("slot in the future") ErrTxnPointerTooLarge = errors.New("txn pointer too large") ErrEonTooLarge = errors.New("eon too large") ErrEonInThePast = errors.New("eon in the past") ErrEonInTheFuture = errors.New("eon in the future") ErrEonNotInRecent = errors.New("eon not in recent") ErrEmptyKeys = errors.New("empty keys") ErrTooManyKeys = errors.New("too many keys") ErrIgnoreMsg = errors.New("ignoring msg") ErrInvalidSignature = errors.New("invalid signature") ErrInvalidKey = errors.New("invalid key") ErrSignersThresholdMismatch = errors.New("signers threshold mismatch") ErrDuplicateSigners = errors.New("duplicate signers") ErrUnorderedSigners = errors.New("unordered signers") ErrSignaturesLenMismatch = errors.New("signatures len mismatch") )
View Source
var ErrInvalidKeyperIndex = errors.New("invalid keyper index")
View Source
var ErrTimestampBeforeGenesis = errors.New("timestamp before genesis")
Functions ¶
func EncryptedTxnSubmissionLess ¶
func EncryptedTxnSubmissionLess(a, b EncryptedTxnSubmission) bool
func EncryptedTxnSubmissionsAreConsecutive ¶
func EncryptedTxnSubmissionsAreConsecutive(a, b EncryptedTxnSubmission) bool
func EpochSecretKeyFromBytes ¶
func EpochSecretKeyFromBytes(b []byte) (*crypto.EpochSecretKey, error)
func NewDecryptionKeysExtendedValidator ¶
func NewDecryptionKeysExtendedValidator(logger log.Logger, config Config, sc SlotCalculator, et EonTracker) pubsub.ValidatorEx
Types ¶
type BeaconChainSlotCalculator ¶
type BeaconChainSlotCalculator struct {
// contains filtered or unexported fields
}
func NewBeaconChainSlotCalculator ¶
func NewBeaconChainSlotCalculator(genesisTimestamp uint64, secondsPerSlot uint64) BeaconChainSlotCalculator
func (BeaconChainSlotCalculator) CalcCurrentSlot ¶
func (sc BeaconChainSlotCalculator) CalcCurrentSlot() uint64
func (BeaconChainSlotCalculator) CalcSlot ¶
func (sc BeaconChainSlotCalculator) CalcSlot(timestamp uint64) (uint64, error)
func (BeaconChainSlotCalculator) CalcSlotAge ¶
func (sc BeaconChainSlotCalculator) CalcSlotAge(slot uint64) time.Duration
func (BeaconChainSlotCalculator) SecondsPerSlot ¶
func (sc BeaconChainSlotCalculator) SecondsPerSlot() uint64
type BlockEvent ¶
type BlockListener ¶
type BlockListener struct {
// contains filtered or unexported fields
}
func NewBlockListener ¶
func NewBlockListener(logger log.Logger, stateChangesClient stateChangesClient) BlockListener
func (BlockListener) RegisterObserver ¶
func (bl BlockListener) RegisterObserver(o event.Observer[BlockEvent]) event.UnregisterFunc
type BlockTracker ¶
type BlockTracker struct {
// contains filtered or unexported fields
}
func NewBlockTracker ¶
func NewBlockTracker(logger log.Logger, blockListener BlockListener) BlockTracker
type Config ¶
type Config struct { P2pConfig Enabled bool InstanceId uint64 ChainId *uint256.Int BeaconChainGenesisTimestamp uint64 SecondsPerSlot uint64 SequencerContractAddress string ValidatorRegistryContractAddress string KeyBroadcastContractAddress string KeyperSetManagerContractAddress string MaxNumKeysPerMessage uint64 ReorgDepthAwareness uint64 MaxPooledEncryptedTxns int EncryptedGasLimit uint64 EncryptedTxnsLookBackDistance uint64 MaxDecryptionKeysDelay time.Duration }
func ConfigByChainName ¶
type DecryptedTxnsPool ¶
type DecryptedTxnsPool struct {
// contains filtered or unexported fields
}
func NewDecryptedTxnsPool ¶
func NewDecryptedTxnsPool() *DecryptedTxnsPool
func (*DecryptedTxnsPool) AddDecryptedTxns ¶
func (p *DecryptedTxnsPool) AddDecryptedTxns(mark DecryptionMark, txnBatch TxnBatch)
func (*DecryptedTxnsPool) DecryptedTxns ¶
func (p *DecryptedTxnsPool) DecryptedTxns(mark DecryptionMark) (TxnBatch, bool)
func (*DecryptedTxnsPool) DeleteDecryptedTxnsUpToSlot ¶
func (p *DecryptedTxnsPool) DeleteDecryptedTxnsUpToSlot(slot uint64) uint64
func (*DecryptedTxnsPool) Wait ¶
func (p *DecryptedTxnsPool) Wait(ctx context.Context, mark DecryptionMark) error
type DecryptionKeysListener ¶
type DecryptionKeysListener struct {
// contains filtered or unexported fields
}
func NewDecryptionKeysListener ¶
func NewDecryptionKeysListener(logger log.Logger, config Config, validator pubsub.ValidatorEx) DecryptionKeysListener
func (DecryptionKeysListener) RegisterObserver ¶
func (dkl DecryptionKeysListener) RegisterObserver(observer event.Observer[*proto.DecryptionKeys]) event.UnregisterFunc
type DecryptionKeysProcessor ¶
type DecryptionKeysProcessor struct {
// contains filtered or unexported fields
}
func NewDecryptionKeysProcessor ¶
func NewDecryptionKeysProcessor( logger log.Logger, config Config, encryptedTxnsPool *EncryptedTxnsPool, decryptedTxnsPool *DecryptedTxnsPool, blockListener BlockListener, slotCalculator SlotCalculator, ) DecryptionKeysProcessor
func (DecryptionKeysProcessor) Enqueue ¶
func (dkp DecryptionKeysProcessor) Enqueue(msg *proto.DecryptionKeys)
type DecryptionKeysSignatureData ¶
type DecryptionKeysSignatureData struct { InstanceId uint64 Eon EonIndex Slot uint64 TxnPointer uint64 IdentityPreimages *solid.ListSSZ[*IdentityPreimage] }
func (DecryptionKeysSignatureData) HashSSZ ¶
func (d DecryptionKeysSignatureData) HashSSZ() ([32]byte, error)
func (DecryptionKeysSignatureData) Sign ¶
func (d DecryptionKeysSignatureData) Sign(key *ecdsa.PrivateKey) ([]byte, error)
func (DecryptionKeysSignatureData) Validate ¶
func (d DecryptionKeysSignatureData) Validate() error
type DecryptionKeysValidator ¶
type DecryptionKeysValidator struct {
// contains filtered or unexported fields
}
func NewDecryptionKeysValidator ¶
func NewDecryptionKeysValidator(config Config, sc SlotCalculator, et EonTracker) DecryptionKeysValidator
func (DecryptionKeysValidator) Validate ¶
func (v DecryptionKeysValidator) Validate(msg *proto.DecryptionKeys) error
type DecryptionMark ¶
type EncryptedTxnSubmission ¶
type EncryptedTxnSubmission struct { EonIndex EonIndex TxnIndex TxnIndex IdentityPrefix [32]byte Sender libcommon.Address EncryptedTransaction []byte GasLimit *big.Int BlockNum uint64 }
EncryptedTxnSubmission mimics contracts.SequencerTransactionSubmitted but without the "Raw" attribute to save memory.
func EncryptedTxnSubmissionFromLogEvent ¶
func EncryptedTxnSubmissionFromLogEvent(event *contracts.SequencerTransactionSubmitted) EncryptedTxnSubmission
func (EncryptedTxnSubmission) IdentityPreimageBytes ¶
func (ets EncryptedTxnSubmission) IdentityPreimageBytes() []byte
type EncryptedTxnsPool ¶
type EncryptedTxnsPool struct {
// contains filtered or unexported fields
}
func NewEncryptedTxnsPool ¶
func NewEncryptedTxnsPool(logger log.Logger, config Config, cb bind.ContractBackend, bl BlockListener) *EncryptedTxnsPool
func (*EncryptedTxnsPool) DeleteUpTo ¶
func (etp *EncryptedTxnsPool) DeleteUpTo(eon EonIndex, to TxnIndex)
func (*EncryptedTxnsPool) Txns ¶
func (etp *EncryptedTxnsPool) Txns(eon EonIndex, from, to TxnIndex, gasLimit uint64) ([]EncryptedTxnSubmission, error)
type Eon ¶
type EonTracker ¶
type IdentityPreimage ¶
type IdentityPreimage [identityPreimageSize]byte
func IdentityPreimageFromBytes ¶
func IdentityPreimageFromBytes(b []byte) (*IdentityPreimage, error)
func (*IdentityPreimage) Clone ¶
func (ip *IdentityPreimage) Clone() clonable.Clonable
func (*IdentityPreimage) EncodeSSZ ¶
func (ip *IdentityPreimage) EncodeSSZ(dst []byte) ([]byte, error)
func (*IdentityPreimage) EncodingSizeSSZ ¶
func (ip *IdentityPreimage) EncodingSizeSSZ() int
func (*IdentityPreimage) HashSSZ ¶
func (ip *IdentityPreimage) HashSSZ() ([32]byte, error)
func (*IdentityPreimage) String ¶
func (ip *IdentityPreimage) String() string
type IdentityPreimages ¶
type IdentityPreimages []*IdentityPreimage
func (IdentityPreimages) ToListSSZ ¶
func (ips IdentityPreimages) ToListSSZ() *solid.ListSSZ[*IdentityPreimage]
type KsmEonTracker ¶
type KsmEonTracker struct {
// contains filtered or unexported fields
}
func NewKsmEonTracker ¶
func NewKsmEonTracker(logger log.Logger, config Config, bl BlockListener, cb bind.ContractBackend) *KsmEonTracker
func (*KsmEonTracker) CurrentEon ¶
func (et *KsmEonTracker) CurrentEon() (Eon, bool)
func (*KsmEonTracker) EonByBlockNum ¶
func (et *KsmEonTracker) EonByBlockNum(blockNum uint64) (Eon, bool)
type P2pConfig ¶
type P2pConfig struct { PrivateKey *ecdsa.PrivateKey ListenPort uint64 BootstrapNodes []string }
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func NewPool ¶
func NewPool( logger log.Logger, config Config, secondaryTxnProvider txnprovider.TxnProvider, contractBackend bind.ContractBackend, stateChangesClient stateChangesClient, ) *Pool
func (Pool) ProvideTxns ¶
func (p Pool) ProvideTxns(ctx context.Context, opts ...txnprovider.ProvideOption) ([]types.Transaction, error)
type ProcessedMark ¶
type SlotCalculator ¶
type TxnBatch ¶
type TxnBatch struct { Transactions []types.Transaction TotalGasLimit uint64 }
Source Files
¶
- block_listener.go
- block_tracker.go
- config.go
- decrypted_txns_pool.go
- decryption_keys_listener.go
- decryption_keys_processor.go
- decryption_keys_signature_data.go
- decryption_keys_validator.go
- encrypted_txn_submission.go
- encrypted_txns_pool.go
- eon.go
- eon_tracker.go
- pool.go
- slot_calculator.go
- state_changes_client.go
Directories
¶
Path | Synopsis |
---|---|
internal
|
|
testhelpers
Package testhelpers is a generated GoMock package.
|
Package testhelpers is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.