Documentation ¶
Overview ¶
Package guard signs attestations and posts to attestation collector and destination.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttestationCollectorAttestationScanner ¶
type AttestationCollectorAttestationScanner struct {
// contains filtered or unexported fields
}
AttestationCollectorAttestationScanner fetches attestations for particular origin-destination pair. TODO: this needs to become an interface.
func NewAttestationCollectorAttestationScanner ¶
func NewAttestationCollectorAttestationScanner(domain domains.DomainClient, originID, destinationID uint32, db db.SynapseDB, signer signer.Signer, interval time.Duration) AttestationCollectorAttestationScanner
NewAttestationCollectorAttestationScanner creates a new attestation collector attestation scanner.
func (AttestationCollectorAttestationScanner) FindLatestNonce ¶
func (a AttestationCollectorAttestationScanner) FindLatestNonce(ctx context.Context) (nonce uint32, err error)
FindLatestNonce fetches the latest cached nonce for a given chain. TODO (joe): there was a bug in this code not covered by current tests. Make sure to add a test that covers when latestNonce is not zero.
type AttestationDoubleCheckOnOriginVerifier ¶ added in v0.0.70
type AttestationDoubleCheckOnOriginVerifier struct {
// contains filtered or unexported fields
}
AttestationDoubleCheckOnOriginVerifier double checks attestations on origin. TODO: this needs to become an interface.
func NewAttestationDoubleCheckOnOriginVerifier ¶ added in v0.0.70
func NewAttestationDoubleCheckOnOriginVerifier( originDomain domains.DomainClient, attestationDomain domains.DomainClient, destinationDomain domains.DomainClient, db db.SynapseDB, bondedSigner signer.Signer, unbondedSigner signer.Signer, interval time.Duration) AttestationDoubleCheckOnOriginVerifier
NewAttestationDoubleCheckOnOriginVerifier creates a new attestation double-check-on-origin verifier.
func (AttestationDoubleCheckOnOriginVerifier) FindOldestGuardUnsignedAndUnverifiedAttestation ¶ added in v0.0.70
func (a AttestationDoubleCheckOnOriginVerifier) FindOldestGuardUnsignedAndUnverifiedAttestation(ctx context.Context) (types.InProgressAttestation, error)
FindOldestGuardUnsignedAndUnverifiedAttestation fetches the oldest attestation that still needs to be signed by the guard and needs to be verified.
type AttestationGuardCollectorSubmitter ¶ added in v0.0.73
type AttestationGuardCollectorSubmitter struct {
// contains filtered or unexported fields
}
AttestationGuardCollectorSubmitter submits the signed attestation (by both notary and guard) to the Attestation Collector. TODO: this needs to become an interface.
func NewAttestationGuardCollectorSubmitter ¶ added in v0.0.73
func NewAttestationGuardCollectorSubmitter( originDomain domains.DomainClient, attestationDomain domains.DomainClient, destinationDomain domains.DomainClient, db db.SynapseDB, bondedSigner signer.Signer, unbondedSigner signer.Signer, interval time.Duration) AttestationGuardCollectorSubmitter
NewAttestationGuardCollectorSubmitter creates a new attestation guard collector submitter.
func (AttestationGuardCollectorSubmitter) FindOldestGuardUnsubmittedSignedInProgressAttestation ¶ added in v0.0.73
func (a AttestationGuardCollectorSubmitter) FindOldestGuardUnsubmittedSignedInProgressAttestation(ctx context.Context) (types.InProgressAttestation, error)
FindOldestGuardUnsubmittedSignedInProgressAttestation fetches the oldest signed attestation (by both notary and guard) that has not yet been submitted to the Attestation Collector.
type AttestationGuardCollectorVerifier ¶ added in v0.0.74
type AttestationGuardCollectorVerifier struct {
// contains filtered or unexported fields
}
AttestationGuardCollectorVerifier verifies the signed attestation (by both notary and guard) is posted successfully on the Attestation Collector. TODO: this needs to become an interface.
func NewAttestationGuardCollectorVerifier ¶ added in v0.0.74
func NewAttestationGuardCollectorVerifier( originDomain domains.DomainClient, attestationDomain domains.DomainClient, destinationDomain domains.DomainClient, db db.SynapseDB, bondedSigner signer.Signer, unbondedSigner signer.Signer, interval time.Duration) AttestationGuardCollectorVerifier
NewAttestationGuardCollectorVerifier creates a new attestation guard collector verifier.
func (AttestationGuardCollectorVerifier) FindOldestGuardSubmittedToCollectorInProgressAttestation ¶ added in v0.0.74
func (a AttestationGuardCollectorVerifier) FindOldestGuardSubmittedToCollectorInProgressAttestation(ctx context.Context) (types.InProgressAttestation, error)
FindOldestGuardSubmittedToCollectorInProgressAttestation fetches the oldest signed attestation (by both notary and guard) that has been submitted to the Attestation Collector.
type AttestationGuardDestinationSubmitter ¶ added in v0.0.75
type AttestationGuardDestinationSubmitter struct {
// contains filtered or unexported fields
}
AttestationGuardDestinationSubmitter submits the signed attestation (by both notary and guard) to the Destination. TODO: this needs to become an interface.
func NewAttestationGuardDestinationSubmitter ¶ added in v0.0.75
func NewAttestationGuardDestinationSubmitter( originDomain domains.DomainClient, attestationDomain domains.DomainClient, destinationDomain domains.DomainClient, db db.SynapseDB, bondedSigner signer.Signer, unbondedSigner signer.Signer, interval time.Duration) AttestationGuardDestinationSubmitter
NewAttestationGuardDestinationSubmitter creates a new attestation guard destination submitter.
func (AttestationGuardDestinationSubmitter) FindOldestGuardConfirmedOnCollector ¶ added in v0.0.75
func (a AttestationGuardDestinationSubmitter) FindOldestGuardConfirmedOnCollector(ctx context.Context) (types.InProgressAttestation, error)
FindOldestGuardConfirmedOnCollector fetches the oldest signed attestation (by both notary and guard) that has been submitted to and confirmed on the Attestation Collector.
type AttestationGuardDestinationVerifier ¶ added in v0.0.76
type AttestationGuardDestinationVerifier struct {
// contains filtered or unexported fields
}
AttestationGuardDestinationVerifier verifies the signed attestation (by both notary and guard) is posted successfully on the Destination. TODO: this needs to become an interface.
func NewAttestationGuardDestinationVerifier ¶ added in v0.0.76
func NewAttestationGuardDestinationVerifier( originDomain domains.DomainClient, attestationDomain domains.DomainClient, destinationDomain domains.DomainClient, db db.SynapseDB, bondedSigner signer.Signer, unbondedSigner signer.Signer, interval time.Duration) AttestationGuardDestinationVerifier
NewAttestationGuardDestinationVerifier creates a new attestation guard destination verifier.
func (AttestationGuardDestinationVerifier) FindOldestSubmittedToDestinationInProgressAttestation ¶ added in v0.0.76
func (a AttestationGuardDestinationVerifier) FindOldestSubmittedToDestinationInProgressAttestation(ctx context.Context) (types.InProgressAttestation, error)
FindOldestSubmittedToDestinationInProgressAttestation fetches the oldest signed attestation (by both notary and guard) that has been submitted to the Destination.
type AttestationGuardSigner ¶ added in v0.0.72
type AttestationGuardSigner struct {
// contains filtered or unexported fields
}
AttestationGuardSigner signs the attestation after it has been verified on origin. TODO: this needs to become an interface.
func NewAttestationGuardSigner ¶ added in v0.0.72
func NewAttestationGuardSigner( originDomain domains.DomainClient, attestationDomain domains.DomainClient, destinationDomain domains.DomainClient, db db.SynapseDB, bondedSigner signer.Signer, unbondedSigner signer.Signer, interval time.Duration) AttestationGuardSigner
NewAttestationGuardSigner creates a new attestation guard signer.
func (AttestationGuardSigner) FindOldestGuardUnsignedAndVerifiedAttestation ¶ added in v0.0.72
func (a AttestationGuardSigner) FindOldestGuardUnsignedAndVerifiedAttestation(ctx context.Context) (types.InProgressAttestation, error)
FindOldestGuardUnsignedAndVerifiedAttestation fetches the oldest attestation that still needs to be signed by the guard but has been verified on origin.
type Guard ¶
type Guard struct {
// contains filtered or unexported fields
}
Guard in the current version scans the attestation collector for notary signed attestations, signs them, and posts to destination chains. TODO: Note right now, I have threads for each origin-destination pair and do no batching at all.
Source Files ¶
- attestation_collector_attestation_scanner.go
- attestation_double_check_on_origin_verifier.go
- attestation_guard_collector_submitter.go
- attestation_guard_collector_verifier.go
- attestation_guard_destination_submitter.go
- attestation_guard_destination_verifier.go
- attestation_guard_signer.go
- doc.go
- guard.go
- logger.go