Documentation ¶
Index ¶
- Constants
- Variables
- type Commander
- type Config
- type EVMEngine
- type Engine
- func (e *Engine) ReloadConf(config ethereum.Config)
- func (e *Engine) SetupEthereumEngine(client ethereum.Client, forwarder ethereum.Forwarder, config ethereum.Config, ...) error
- func (e *Engine) SetupSecondaryEthereumEngine(client ethereum.Client, forwarder ethereum.Forwarder, config ethereum.Config, ...) error
- func (e *Engine) Start()
- func (e *Engine) Stop()
- func (e *Engine) UpdateCollateralStartingBlock(b uint64)
- func (e *Engine) UpdateMultisigControlStartingBlock(b uint64)
- func (e *Engine) UpdateStakingStartingBlock(b uint64)
- func (e *Engine) UpdateStartingBlock(address string, block uint64)
- func (e *Engine) VerifyHeartbeat(ctx context.Context, height uint64, chainID string, contract string, ...) error
- type Forwarder
- func (f *Forwarder) Ack(evt *commandspb.ChainEvent) bool
- func (f *Forwarder) Forward(ctx context.Context, evt *commandspb.ChainEvent, pubkey string) error
- func (f *Forwarder) ForwardFromSelf(evt *commandspb.ChainEvent)
- func (f *Forwarder) GetState(k string) ([]byte, []types.StateProvider, error)
- func (f *Forwarder) Keys() []string
- func (f *Forwarder) LoadState(ctx context.Context, p *types.Payload) ([]types.StateProvider, error)
- func (f *Forwarder) Namespace() types.SnapshotNamespace
- func (f *Forwarder) OnTick(ctx context.Context, t time.Time)
- func (f *Forwarder) ReloadConf(cfg Config)
- func (f *Forwarder) Stopped() bool
- type NoopEngine
- func (e *NoopEngine) ReloadConf(_ ethereum.Config)
- func (e *NoopEngine) SetupEthereumEngine(_ ethereum.Client, _ ethereum.Forwarder, _ ethereum.Config, ...) error
- func (e *NoopEngine) SetupSecondaryEthereumEngine(_ ethereum.Client, _ ethereum.Forwarder, _ ethereum.Config, ...) error
- func (e *NoopEngine) Start()
- func (e *NoopEngine) Stop()
- func (e *NoopEngine) UpdateCollateralStartingBlock(b uint64)
- func (e *NoopEngine) UpdateMultisigControlStartingBlock(b uint64)
- func (e *NoopEngine) UpdateStakingStartingBlock(b uint64)
- func (e *NoopEngine) UpdateStartingBlock(_ string, _ uint64)
- func (e *NoopEngine) VerifyHeartbeat(_ context.Context, _ uint64, _ string, _ string, _ uint64) error
- type TimeService
- type Tracker
- func (t *Tracker) GetState(_ string) ([]byte, []types.StateProvider, error)
- func (t *Tracker) Keys() []string
- func (t *Tracker) LoadState(ctx context.Context, payload *types.Payload) ([]types.StateProvider, error)
- func (t *Tracker) Namespace() types.SnapshotNamespace
- func (t *Tracker) OnStateLoaded(_ context.Context) error
- func (t *Tracker) OnTick(ctx context.Context, tt time.Time)
- func (t *Tracker) ProcessHeartbeat(address, chainID string, height uint64, blockTime uint64) error
- func (t *Tracker) RegisterForwarder(fwd EVMEngine, chainID string, addresses ...string)
- func (t *Tracker) Stopped() bool
- func (t *Tracker) UpdateContractBlock(address, chainID string, height uint64)
- type ValidatorTopology
- type Witness
Constants ¶
const (
DefaultKeepHashesDuration = 24 * 2 * time.Hour
)
Variables ¶
var ( // ErrEvtAlreadyExist we have already handled this event. ErrEvtAlreadyExist = errors.New("event already exist") // ErrPubKeyNotAllowlisted this pubkey is not part of the allowlist. ErrPubKeyNotAllowlisted = errors.New("pubkey not allowlisted") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Level specifies the logging level of the Event Forwarder engine. Level encoding.LogLevel `long:"log-level"` RetryRate encoding.Duration `long:"retry-rate"` KeepHashesDurationForTestOnlyDoNotChange encoding.Duration // a list of allowlisted blockchain queue public keys BlockchainQueueAllowlist []string `description:" " long:"blockchain-queue-allowlist"` // Ethereum groups the configuration related to Ethereum implementation of // the Event Forwarder. Ethereum ethereum.Config `group:"Ethereum" namespace:"ethereum"` EVMBridges []ethereum.Config `group:"EVMBridges" namespace:"evmbridges"` EthCall ethcall.Config `group:"EthCall" namespace:"ethcall"` }
Config represents governance specific configuration.
func NewDefaultConfig ¶
func NewDefaultConfig() Config
NewDefaultConfig creates an instance of the package specific configuration.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) ReloadConf ¶
ReloadConf updates the internal configuration of the Event Forwarder engine.
func (*Engine) SetupEthereumEngine ¶
func (*Engine) SetupSecondaryEthereumEngine ¶ added in v0.76.0
func (*Engine) UpdateCollateralStartingBlock ¶ added in v0.69.0
func (*Engine) UpdateMultisigControlStartingBlock ¶
func (*Engine) UpdateStakingStartingBlock ¶
func (*Engine) UpdateStartingBlock ¶ added in v0.77.0
type Forwarder ¶
type Forwarder struct {
// contains filtered or unexported fields
}
Forwarder receive events from the blockchain queue and will try to send them to the vega chain. this will select a node in the network to forward the event.
func New ¶
func New(log *logging.Logger, cfg Config, cmd Commander, timeService TimeService, top ValidatorTopology, ) *Forwarder
New creates a new instance of the event forwarder.
func (*Forwarder) Ack ¶
func (f *Forwarder) Ack(evt *commandspb.ChainEvent) bool
Ack will return true if the event is newly acknowledged. If the event already exist and was already acknowledged, this will return false.
func (*Forwarder) Forward ¶
func (f *Forwarder) Forward(ctx context.Context, evt *commandspb.ChainEvent, pubkey string) error
Forward will forward a ChainEvent to the tendermint network. We expect the pubkey to be an ed25519, hex encoded, key.
func (*Forwarder) ForwardFromSelf ¶
func (f *Forwarder) ForwardFromSelf(evt *commandspb.ChainEvent)
ForwardFromSelf will forward event seen by the node itself, not from an external service like the eef for example.
func (*Forwarder) Namespace ¶
func (f *Forwarder) Namespace() types.SnapshotNamespace
func (*Forwarder) ReloadConf ¶
ReloadConf updates the internal configuration of the Event Forwarder engine.
type NoopEngine ¶
type NoopEngine struct {
// contains filtered or unexported fields
}
NoopEngine can be use as a stub for the Engine. It does nothing.
func NewNoopEngine ¶
func NewNoopEngine(log *logging.Logger, config ethereum.Config) *NoopEngine
func (*NoopEngine) ReloadConf ¶
func (e *NoopEngine) ReloadConf(_ ethereum.Config)
func (*NoopEngine) SetupEthereumEngine ¶
func (*NoopEngine) SetupSecondaryEthereumEngine ¶ added in v0.76.0
func (*NoopEngine) Start ¶
func (e *NoopEngine) Start()
func (*NoopEngine) Stop ¶
func (e *NoopEngine) Stop()
func (*NoopEngine) UpdateCollateralStartingBlock ¶ added in v0.69.0
func (e *NoopEngine) UpdateCollateralStartingBlock(b uint64)
func (*NoopEngine) UpdateMultisigControlStartingBlock ¶
func (e *NoopEngine) UpdateMultisigControlStartingBlock(b uint64)
func (*NoopEngine) UpdateStakingStartingBlock ¶
func (e *NoopEngine) UpdateStakingStartingBlock(b uint64)
func (*NoopEngine) UpdateStartingBlock ¶ added in v0.77.0
func (e *NoopEngine) UpdateStartingBlock(_ string, _ uint64)
func (*NoopEngine) VerifyHeartbeat ¶ added in v0.77.0
type TimeService ¶
type Tracker ¶ added in v0.77.0
type Tracker struct {
// contains filtered or unexported fields
}
func NewTracker ¶ added in v0.77.0
func NewTracker(log *logging.Logger, witness Witness, ts TimeService) *Tracker
func (*Tracker) Namespace ¶ added in v0.77.0
func (t *Tracker) Namespace() types.SnapshotNamespace
func (*Tracker) OnStateLoaded ¶ added in v0.77.0
func (*Tracker) ProcessHeartbeat ¶ added in v0.77.0
func (*Tracker) RegisterForwarder ¶ added in v0.77.0
func (*Tracker) UpdateContractBlock ¶ added in v0.77.0
UpdateContractBlock if an external engine has processed a chain-event for the contract at this address then the last-seen block for the contract is updated.