Documentation ¶
Index ¶
- Variables
- type Publisher
- func (p *Publisher) ExtractObscuroRelevantTransactions(block *types.Block) ([]*ethadapter.L1RespondSecretTx, []*ethadapter.L1RollupTx, ...)
- func (p *Publisher) FetchLatestSeqNo() (*big.Int, error)
- func (p *Publisher) GetBundleRangeFromManagementContract() (*big.Int, *big.Int, error)
- func (p *Publisher) GetImportantContracts() map[string]gethcommon.Address
- func (p *Publisher) HealthStatus(context.Context) host.HealthStatus
- func (p *Publisher) InitializeSecret(attestation *common.AttestationReport, ...) error
- func (p *Publisher) PublishCrossChainBundle(bundle *common.ExtCrossChainBundle) error
- func (p *Publisher) PublishRollup(producedRollup *common.ExtRollup)
- func (p *Publisher) PublishSecretResponse(secretResponse *common.ProducedSecretResponse) error
- func (p *Publisher) RequestSecret(attestation *common.AttestationReport) (gethcommon.Hash, error)
- func (p *Publisher) ResyncImportantContracts() error
- func (p *Publisher) Start() error
- func (p *Publisher) Stop() error
- type Repository
- func (r *Repository) FetchBlockByHeight(height *big.Int) (*types.Block, error)
- func (r *Repository) FetchNextBlock(prevBlockHash gethcommon.Hash) (*types.Block, bool, error)
- func (r *Repository) FetchObscuroReceipts(block *common.L1Block) (types.Receipts, error)
- func (r *Repository) HealthStatus(context.Context) host.HealthStatus
- func (r *Repository) Start() error
- func (r *Repository) Stop() error
- func (r *Repository) Subscribe(handler host.L1BlockHandler) func()
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoNextBlock = errors.New("no next block")
)
Functions ¶
This section is empty.
Types ¶
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
func NewL1Publisher ¶
func NewL1Publisher( hostData host.Identity, hostWallet wallet.Wallet, client ethadapter.EthClient, mgmtContract mgmtcontractlib.MgmtContractLib, repository host.L1BlockRepository, hostStopper *stopcontrol.StopControl, logger gethlog.Logger, maxWaitForL1Receipt time.Duration, retryIntervalForL1Receipt time.Duration, storage storage.Storage, ) *Publisher
func (*Publisher) ExtractObscuroRelevantTransactions ¶
func (p *Publisher) ExtractObscuroRelevantTransactions(block *types.Block) ([]*ethadapter.L1RespondSecretTx, []*ethadapter.L1RollupTx, []*ethadapter.L1SetImportantContractsTx)
ExtractObscuroRelevantTransactions will extract any transactions from the block that are relevant to obscuro todo (#2495) we should monitor for relevant L1 events instead of scanning every transaction in the block
func (*Publisher) GetBundleRangeFromManagementContract ¶ added in v0.24.1
func (*Publisher) GetImportantContracts ¶
func (p *Publisher) GetImportantContracts() map[string]gethcommon.Address
func (*Publisher) HealthStatus ¶
func (p *Publisher) HealthStatus(context.Context) host.HealthStatus
func (*Publisher) InitializeSecret ¶
func (p *Publisher) InitializeSecret(attestation *common.AttestationReport, encSecret common.EncryptedSharedEnclaveSecret) error
func (*Publisher) PublishCrossChainBundle ¶ added in v0.24.1
func (p *Publisher) PublishCrossChainBundle(bundle *common.ExtCrossChainBundle) error
func (*Publisher) PublishRollup ¶
func (*Publisher) PublishSecretResponse ¶
func (p *Publisher) PublishSecretResponse(secretResponse *common.ProducedSecretResponse) error
func (*Publisher) RequestSecret ¶
func (p *Publisher) RequestSecret(attestation *common.AttestationReport) (gethcommon.Hash, error)
func (*Publisher) ResyncImportantContracts ¶
ResyncImportantContracts will fetch the latest important contracts from the management contract and update the cached map Note: this should be run in a goroutine as it makes L1 transactions in series and will block. Cache is not overwritten until it completes.
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is a host service for subscribing to new blocks and looking up L1 data
func NewL1Repository ¶
func NewL1Repository(ethClient ethadapter.EthClient, obscuroRelevantContracts []gethcommon.Address, logger gethlog.Logger) *Repository
func (*Repository) FetchBlockByHeight ¶
func (*Repository) FetchNextBlock ¶
func (r *Repository) FetchNextBlock(prevBlockHash gethcommon.Hash) (*types.Block, bool, error)
FetchNextBlock calculates the next canonical block that should be sent to requester after a given hash. It returns the block and a bool for whether it is the latest known head
func (*Repository) FetchObscuroReceipts ¶
FetchObscuroReceipts returns all obscuro-relevant receipts for an L1 block
func (*Repository) HealthStatus ¶
func (r *Repository) HealthStatus(context.Context) host.HealthStatus
func (*Repository) Start ¶
func (r *Repository) Start() error
func (*Repository) Stop ¶
func (r *Repository) Stop() error
func (*Repository) Subscribe ¶
func (r *Repository) Subscribe(handler host.L1BlockHandler) func()
Subscribe will register a new block handler to receive new blocks as they arrive, returns unsubscribe func