notary

package
v0.0.107 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package notary scans origin chains for messages to its destination and signs attestations and posts to AttestationCollector.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttestationProducer

type AttestationProducer struct {
	// contains filtered or unexported fields
}

AttestationProducer updates a producer. TODO: this needs to become an interface.

func NewAttestationProducer

func NewAttestationProducer(domain domains.DomainClient, db db.SynapseDB, signer signer.Signer, interval time.Duration) AttestationProducer

NewAttestationProducer creates an attestation producer.

func (AttestationProducer) FindLatestNonce

func (a AttestationProducer) FindLatestNonce(ctx context.Context) (nonce uint32, err error)

FindLatestNonce fetches the latest nonce for a given chain.

func (AttestationProducer) Start

Start starts the update producer.

type AttestationSubmitter

type AttestationSubmitter struct {
	// contains filtered or unexported fields
}

AttestationSubmitter submits updates continuously.

func NewAttestationSubmitter

func NewAttestationSubmitter(domain domains.DomainClient, db db.SynapseDB, signer signer.Signer, interval time.Duration) AttestationSubmitter

NewAttestationSubmitter creates an update producer.

func (AttestationSubmitter) Start

Start runs the update submitter.

type Notary

type Notary struct {
	// contains filtered or unexported fields
}

Notary in the current version scans the origins for new messages, signs them, and posts to attestation collector. TODO: Note right now, I have threads for each origin-destination pair and do no batching at all in terms of calls to the origin. Right now, for this MVP, this is the simplest path and we can make improvements later.

func NewNotary

func NewNotary(ctx context.Context, cfg config.NotaryConfig) (_ Notary, err error)

NewNotary creates a new notary.

func (Notary) Start

func (u Notary) Start(ctx context.Context) error

Start starts the notary.

type OriginAttestationScanner added in v0.0.58

type OriginAttestationScanner struct {
	// contains filtered or unexported fields
}

OriginAttestationScanner fetches merkle roots for particular origin-destination pair. TODO: this needs to become an interface.

func NewOriginAttestationScanner added in v0.0.58

func NewOriginAttestationScanner(
	originDomain domains.DomainClient,
	attestationDomain domains.DomainClient,
	destinationDomain domains.DomainClient,
	db db.SynapseDB,
	bondedSigner signer.Signer,
	unbondedSigner signer.Signer,
	interval time.Duration) OriginAttestationScanner

NewOriginAttestationScanner creates a new origin attestation scanner.

func (OriginAttestationScanner) FindLatestNonce added in v0.0.58

func (a OriginAttestationScanner) FindLatestNonce(ctx context.Context) (nonce uint32, err error)

FindLatestNonce fetches the latest nonce for a given chain.

func (OriginAttestationScanner) Start added in v0.0.58

Start starts the OriginAttestationScanner.

type OriginAttestationSigner added in v0.0.58

type OriginAttestationSigner struct {
	// contains filtered or unexported fields
}

OriginAttestationSigner signs unsigned attestations that have been fetched for particular origin-destination pair. TODO: this needs to become an interface.

func NewOriginAttestationSigner added in v0.0.58

func NewOriginAttestationSigner(
	originDomain domains.DomainClient,
	attestationDomain domains.DomainClient,
	destinationDomain domains.DomainClient,
	db db.SynapseDB,
	bondedSigner signer.Signer,
	unbondedSigner signer.Signer,
	interval time.Duration) OriginAttestationSigner

NewOriginAttestationSigner creates a new origin attestation signer.

func (OriginAttestationSigner) FindNewestUnsignedAttestation added in v0.0.96

func (a OriginAttestationSigner) FindNewestUnsignedAttestation(ctx context.Context) (types.InProgressAttestation, error)

FindNewestUnsignedAttestation fetches the newest attestation that still needs to be signed.

func (OriginAttestationSigner) Start added in v0.0.58

Start starts the OriginAttestationSigner.

type OriginAttestationSubmitter added in v0.0.58

type OriginAttestationSubmitter struct {
	// contains filtered or unexported fields
}

OriginAttestationSubmitter submits signed attestations to the attestation collector for particular origin-destination pair. TODO: this needs to become an interface.

func NewOriginAttestationSubmitter added in v0.0.58

func NewOriginAttestationSubmitter(
	originDomain domains.DomainClient,
	attestationDomain domains.DomainClient,
	destinationDomain domains.DomainClient,
	db db.SynapseDB,
	bondedSigner signer.Signer,
	unbondedSigner signer.Signer,
	interval time.Duration) OriginAttestationSubmitter

NewOriginAttestationSubmitter creates a new origin attestation submitter.

func (OriginAttestationSubmitter) FindNewestUnsubmittedAttestation added in v0.0.96

func (a OriginAttestationSubmitter) FindNewestUnsubmittedAttestation(ctx context.Context) (types.InProgressAttestation, error)

FindNewestUnsubmittedAttestation fetches the newest unsubmitted attestation that has been signed.

func (OriginAttestationSubmitter) Start added in v0.0.58

Start starts the OriginAttestationSubmitter.

type OriginAttestationVerifier added in v0.0.58

type OriginAttestationVerifier struct {
	// contains filtered or unexported fields
}

OriginAttestationVerifier verifies that the AttestationCollector in fact posted submitted attestations and if not resubmits. TODO: this needs to become an interface.

func NewOriginAttestationVerifier added in v0.0.58

func NewOriginAttestationVerifier(
	originDomain domains.DomainClient,
	attestationDomain domains.DomainClient,
	destinationDomain domains.DomainClient,
	db db.SynapseDB,
	bondedSigner signer.Signer,
	unbondedSigner signer.Signer,
	interval time.Duration) OriginAttestationVerifier

NewOriginAttestationVerifier creates a new origin attestation verifier.

func (OriginAttestationVerifier) FindNewestUnconfirmedAttestation added in v0.0.96

func (a OriginAttestationVerifier) FindNewestUnconfirmedAttestation(ctx context.Context) (types.InProgressAttestation, error)

FindNewestUnconfirmedAttestation fetches the newest attestation that still needs to be confirmed.

func (OriginAttestationVerifier) Start added in v0.0.58

Start starts the OriginAttestationVerifier.

Directories

Path Synopsis
Package api contains the API for the notary.
Package api contains the API for the notary.
Package cmd provides the command line interface for the notary.
Package cmd provides the command line interface for the notary.
Package main provides the main function for the Notary.
Package main provides the main function for the Notary.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL