Documentation ¶
Overview ¶
Package base contains the base sql implementation
Index ¶
- Variables
- func GetAllModels() (allModels []interface{})
- type AcceptedAttestation
- type BlockEndModel
- type CommittedMessage
- func (c CommittedMessage) Body() []byte
- func (c CommittedMessage) DestinationDomain() uint32
- func (c CommittedMessage) Encode() ([]byte, error)
- func (c CommittedMessage) Header() types.Header
- func (c CommittedMessage) Leaf() [32]byte
- func (c CommittedMessage) Message() []byte
- func (c CommittedMessage) Nonce() uint32
- func (c CommittedMessage) OptimisticSeconds() uint32
- func (c CommittedMessage) OriginDomain() uint32
- func (c CommittedMessage) Recipient() common.Hash
- func (c CommittedMessage) Sender() common.Hash
- func (c CommittedMessage) Tips() types.Tips
- func (c CommittedMessage) ToLeaf() (leaf [32]byte, err error)
- func (c CommittedMessage) Version() uint16
- type DispatchMessage
- type InProgressAttestation
- func (t InProgressAttestation) Attestation() types.Attestation
- func (t InProgressAttestation) AttestationState() types.AttestationState
- func (t InProgressAttestation) Destination() uint32
- func (t InProgressAttestation) GuardSignatures() []types.Signature
- func (t InProgressAttestation) Nonce() uint32
- func (t InProgressAttestation) NotarySignatures() []types.Signature
- func (t InProgressAttestation) Origin() uint32
- func (t InProgressAttestation) OriginDispatchBlockNumber() uint64
- func (t InProgressAttestation) Root() [32]byte
- func (t InProgressAttestation) SignedAttestation() types.SignedAttestation
- func (t InProgressAttestation) SubmittedToAttestationCollectorTime() *time.Time
- func (t InProgressAttestation) SubmittedToDestinationTime() *time.Time
- type ProcessedEthTx
- type RawEthTX
- type SignedAttestation
- func (s SignedAttestation) Attestation() types.Attestation
- func (s SignedAttestation) Destination() uint32
- func (s SignedAttestation) GuardSignatures() []types.Signature
- func (s SignedAttestation) Nonce() uint32
- func (s SignedAttestation) NotarySignatures() []types.Signature
- func (s SignedAttestation) Origin() uint32
- func (s SignedAttestation) Root() [32]byte
- type Store
- func (s Store) DB() *gorm.DB
- func (s Store) GetDelinquentMessages(ctx context.Context, destinationDomain uint32) ([]types.Message, error)
- func (s Store) GetMessageLatestBlockEnd(ctx context.Context, domainID uint32) (blockNumber uint32, err error)
- func (s Store) GetNonceForChainID(ctx context.Context, fromAddress common.Address, chainID *big.Int) (nonce uint64, err error)
- func (s Store) MarkConfirmedOnDestination(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
- func (s Store) MarkGuardConfirmedOnAttestationCollector(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
- func (s Store) MarkNotaryConfirmedOnAttestationCollector(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
- func (s Store) MarkVerifiedOnOrigin(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
- func (s Store) ReUpdateGuardSubmittedToAttestationCollectorTime(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
- func (s Store) ReUpdateNotarySubmittedToAttestationCollectorTime(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
- func (s Store) RetrieveInProgressAttestation(ctx context.Context, originID, destinationID, nonce uint32) (attestation types.InProgressAttestation, err error)
- func (s Store) RetrieveLatestCachedNonce(ctx context.Context, originID, destinationID uint32) (_ uint32, err error)
- func (s Store) RetrieveLatestCommittedMessageNonce(ctx context.Context, domainID uint32) (_ uint32, err error)
- func (s Store) RetrieveNewestConfirmedInProgressAttestation(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
- func (s Store) RetrieveNewestConfirmedOnDestination(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
- func (s Store) RetrieveOldestGuardConfirmedOnCollector(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
- func (s Store) RetrieveOldestGuardSubmittedToCollectorUnconfirmed(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
- func (s Store) RetrieveOldestGuardUnsignedAndUnverifiedInProgressAttestation(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
- func (s Store) RetrieveOldestGuardUnsignedAndVerifiedInProgressAttestation(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
- func (s Store) RetrieveOldestGuardUnsubmittedSignedInProgressAttestation(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
- func (s Store) RetrieveOldestSubmittedToDestinationUnconfirmed(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
- func (s Store) RetrieveOldestUnconfirmedSubmittedInProgressAttestation(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
- func (s Store) RetrieveOldestUnsignedInProgressAttestation(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
- func (s Store) RetrieveOldestUnsubmittedSignedInProgressAttestation(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
- func (s Store) RetrieveSignedAttestationByNonce(ctx context.Context, domainID, nonce uint32) (attestation types.SignedAttestation, err error)
- func (s Store) StoreAcceptedAttestation(ctx context.Context, attestation types.Attestation) error
- func (s Store) StoreCommittedMessage(ctx context.Context, domainID uint32, message types.CommittedMessage) error
- func (s Store) StoreDispatchMessage(ctx context.Context, message types.Message) error
- func (s Store) StoreExistingSignedInProgressAttestation(ctx context.Context, signedAttestation types.SignedAttestation) error
- func (s Store) StoreMessageLatestBlockEnd(ctx context.Context, domainID uint32, blockNumber uint32) error
- func (s Store) StoreNewInProgressAttestation(ctx context.Context, attestation types.Attestation, ...) error
- func (s Store) StoreProcessedTx(ctx context.Context, tx *types.Transaction) error
- func (s Store) StoreRawTx(ctx context.Context, tx *types.Transaction, chainID *big.Int, ...) error
- func (s Store) StoreSignedAttestations(ctx context.Context, attestation types.SignedAttestation) error
- func (s Store) UpdateGuardSignature(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
- func (s Store) UpdateGuardSubmittedToAttestationCollectorTime(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
- func (s Store) UpdateNotarySignature(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
- func (s Store) UpdateNotarySubmittedToAttestationCollectorTime(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
- func (s Store) UpdateSubmittedToDestinationTime(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
Constants ¶
This section is empty.
Variables ¶
var ( // NonceFieldName is the field name of the nonce. NonceFieldName string // DomainIDFieldName gets the chain id field name. DomainIDFieldName string // BlockNumberFieldName is the name of the block number field. BlockNumberFieldName string // LeafIndexFieldName is the field name of the leaf index. LeafIndexFieldName string // OriginFieldName is the name of the origin field. OriginFieldName string // DestinationFieldName is the name of the destination field. DestinationFieldName string // AttestationStateFieldName is the name of the attestation state field. AttestationStateFieldName string )
Functions ¶
func GetAllModels ¶
func GetAllModels() (allModels []interface{})
GetAllModels gets all models to migrate see: https://medium.com/@SaifAbid/slice-interfaces-8c78f8b6345d for an explanation of why we can't do this at initialization time
Types ¶
type AcceptedAttestation ¶
type AcceptedAttestation struct { // AAOrigin is the chainID of the Origin contract. AAOrigin uint32 `gorm:"column:origin"` // AADestination is the chainID of the Destination contract. AADestination uint32 `gorm:"column:destination"` // AANonce is the nonce of the attestation. AANonce uint32 `gorm:"column:nonce"` // AARoot is the root of the attestation. AARoot string `gorm:"column:root"` }
AcceptedAttestation is used to track every received accepted attestation over all mirrors. Monitoring uses these accepted attestations' nonces to check for missing messages on destination chains.
type BlockEndModel ¶
type BlockEndModel struct { // CreatedAt is the creation time CreatedAt time.Time // UpdatedAt is the update time UpdatedAt time.Time // DeletedAt time DeletedAt gorm.DeletedAt `gorm:"index"` // DomainID is the chain id of the chain we're watching blocks on. This is our primary index. DomainID uint32 `gorm:"column:domain_id;primaryKey;autoIncrement:false"` // BlockHeight is the highest height we've seen on the chain BlockNumber uint32 `gorm:"block_number"` }
BlockEndModel is used to make sure we haven't missed any events while offline. since we event source - rather than use a state machine this is needed to make sure we haven't missed any events by allowing us to go back and source any events we may have missed.
this does not inherit from gorm.model to allow us to use ChainID as a primary key.
type CommittedMessage ¶
type CommittedMessage struct { gorm.Model CMVersion uint16 `gorm:"column:cm_version"` // CMDomainID is the id of the domain we're renaming CMDomainID uint32 `gorm:"column:domain_id;uniqueIndex:cm_idx_id"` // CMMessage is the fully detailed message that was created CMMessage []byte `gorm:"column:message"` // CMLeaf is the leaf CMLeaf []byte `gorm:"column:leaf"` // CMOrigin returns the slip-44 of the message CMOrigin uint32 `gorm:"column:origin"` // CMSender is the sender of the message CMSender []byte `gorm:"column:sender"` // CMNonce is the nonce of the message CMNonce uint32 `gorm:"column:nonce;uniqueIndex:cm_idx_id"` // CMDestination is the sip-44 destination of the message CMDestination uint32 `gorm:"column:destination"` // CMRecipient is the recipient of the message CMRecipient []byte `gorm:"column:recipient"` // CMBody is the body of the message CMBody []byte `gorm:"column:body"` // CMOptimisticSeconds is the optimistic seconds of the message CMOptimisticSeconds uint32 `gorm:"column:optimistic_seconds"` // CMNotaryTip is the notarytip CMNotaryTip []byte `gorm:"column:notary_tip"` // CMBroadcasterTip is the relayer tip CMBroadcasterTip []byte `gorm:"column:broadcaster_tip"` // CMProverTip is the prover tip CMProverTip []byte `gorm:"column:prover_tip"` // CMExecutorTip is the processor tip CMExecutorTip []byte `gorm:"column:executor_tip"` }
CommittedMessage is a committed message it allows for querying on both the committed message and the underlying fields.
func (CommittedMessage) Body ¶
func (c CommittedMessage) Body() []byte
Body is the message contents.
func (CommittedMessage) DestinationDomain ¶
func (c CommittedMessage) DestinationDomain() uint32
DestinationDomain is the slip-44 id of the destination.
func (CommittedMessage) Encode ¶
func (c CommittedMessage) Encode() ([]byte, error)
Encode encodes the message Deprecated: will be removed.
func (CommittedMessage) Header ¶
func (c CommittedMessage) Header() types.Header
Header gets the header.
func (CommittedMessage) Message ¶
func (c CommittedMessage) Message() []byte
Message gets the message.
func (CommittedMessage) Nonce ¶
func (c CommittedMessage) Nonce() uint32
Nonce is the count of all previous messages to the destination.
func (CommittedMessage) OptimisticSeconds ¶
func (c CommittedMessage) OptimisticSeconds() uint32
OptimisticSeconds gets the optimistic seconds count.
func (CommittedMessage) OriginDomain ¶
func (c CommittedMessage) OriginDomain() uint32
OriginDomain returns the Slip-44 ID.
func (CommittedMessage) Recipient ¶
func (c CommittedMessage) Recipient() common.Hash
Recipient is the address of the recipient.
func (CommittedMessage) Sender ¶
func (c CommittedMessage) Sender() common.Hash
Sender is the address of the sender.
func (CommittedMessage) ToLeaf ¶
func (c CommittedMessage) ToLeaf() (leaf [32]byte, err error)
ToLeaf converts a leaf to a keccac256.
func (CommittedMessage) Version ¶
func (c CommittedMessage) Version() uint16
Version gets the message version.
type DispatchMessage ¶
type DispatchMessage struct { // DMOrigin is the origin chainID of the message. DMOrigin uint32 `gorm:"column:origin"` // DMSender is the sender of the message. DMSender string `gorm:"column:sender"` // DMNonce is the nonce of the message. DMNonce uint32 `gorm:"column:nonce"` // DMDestination is the destination chainID of the message. DMDestination uint32 `gorm:"column:destination"` // DMRecipient is the recipient of the message. DMRecipient string `gorm:"column:recipient"` // DMOptimisticSeconds is the optimistic seconds of the message. DMOptimisticSeconds uint32 `gorm:"column:optimistic_seconds"` // DMNotaryTip is the notary tip of the message. DMNotaryTip []byte `gorm:"column:notary_tip"` // DMBroadcasterTip is the broadcaster tip of the message. DMBroadcasterTip []byte `gorm:"column:broadcaster_tip"` // DMProverTip is the prover tip of the message. DMProverTip []byte `gorm:"column:prover_tip"` // DMExecutorTip is the executor tip of the message. DMExecutorTip []byte `gorm:"column:executor_tip"` // DMBody is the body of the message. DMBody []byte `gorm:"column:body"` }
DispatchMessage is used to store information about dispatched messages from the Origin contract. Monitoring uses these messages' nonces to check for missing messages on destination chains.
type InProgressAttestation ¶ added in v0.0.58
type InProgressAttestation struct { // IPOrigin is the origin of the attestation IPOrigin uint32 `gorm:"column:origin;primaryKey;index:idx_origin_destination_state;autoIncrement:false;->;<-:create"` // IPDestination is the destination of the attestation IPDestination uint32 `gorm:"column:destination;primaryKey;index:idx_origin_destination_state;autoIncrement:false;->;<-:create"` // IPNonce is the nonce of the attestation IPNonce uint32 `gorm:"column:nonce;primaryKey;autoIncrement:false;->;<-:create"` // IPRoot is the root of the signed attestation IPRoot []byte `gorm:"column:root;not null;->;<-:create"` // IPNotarySignature stores the raw notary signature IPNotarySignature []byte `gorm:"column:notary_signature;default:NULL"` // IPGuardSignature stores the raw guard signature IPGuardSignature []byte `gorm:"column:guard_signature;default:NULL"` // IPOriginDispatchBlockNumber stores when message was dispatched on origin IPOriginDispatchBlockNumber uint64 `gorm:"column:origin_dispatch_block_number;<-"` // IPSubmittedToAttestationCollectorTime is time when signed attestation was submitted to AttestationCollector IPSubmittedToAttestationCollectorTime sql.NullTime `gorm:"column:submitted_to_attestation_collector_time;type:TIMESTAMP NULL;<-:update"` // IPSubmittedToDestinationTime is time when signed attestation was submitted to Destination IPSubmittedToDestinationTime sql.NullTime `gorm:"column:submitted_to_destination_time;type:TIMESTAMP NULL;<-:update"` // IPAttestationState is the current state of the attestation IPAttestationState uint32 `gorm:"column:attestation_state;index:idx_origin_destination_state;autoIncrement:false;<-"` }
InProgressAttestation stores attestations to be processed.
func (InProgressAttestation) Attestation ¶ added in v0.0.58
func (t InProgressAttestation) Attestation() types.Attestation
Attestation gets the attestation.
func (InProgressAttestation) AttestationState ¶ added in v0.0.58
func (t InProgressAttestation) AttestationState() types.AttestationState
AttestationState gets the state of the attestation.
func (InProgressAttestation) Destination ¶ added in v0.0.58
func (t InProgressAttestation) Destination() uint32
Destination gets the destination of the in-progress attestation.
func (InProgressAttestation) GuardSignatures ¶ added in v0.0.58
func (t InProgressAttestation) GuardSignatures() []types.Signature
GuardSignatures currently just returns the lone guard signature. TODO (joe): fix this to return all guard signatures.
func (InProgressAttestation) Nonce ¶ added in v0.0.58
func (t InProgressAttestation) Nonce() uint32
Nonce gets the nonce of the in-progress attestation.
func (InProgressAttestation) NotarySignatures ¶ added in v0.0.58
func (t InProgressAttestation) NotarySignatures() []types.Signature
NotarySignatures currently just returns the lone notary signature. TODO (joe): fix this to return all notary signatures.
func (InProgressAttestation) Origin ¶ added in v0.0.58
func (t InProgressAttestation) Origin() uint32
Origin gets the origin of the in-progress attestation.
func (InProgressAttestation) OriginDispatchBlockNumber ¶ added in v0.0.58
func (t InProgressAttestation) OriginDispatchBlockNumber() uint64
OriginDispatchBlockNumber gets the block number when message was dispatched on origin.
func (InProgressAttestation) Root ¶ added in v0.0.58
func (t InProgressAttestation) Root() [32]byte
Root gets the root of the in-progress attestation.
func (InProgressAttestation) SignedAttestation ¶ added in v0.0.58
func (t InProgressAttestation) SignedAttestation() types.SignedAttestation
SignedAttestation gets the signed attestation.
func (InProgressAttestation) SubmittedToAttestationCollectorTime ¶ added in v0.0.58
func (t InProgressAttestation) SubmittedToAttestationCollectorTime() *time.Time
SubmittedToAttestationCollectorTime gets the time when attestation was sent to AttestationCollector.
func (InProgressAttestation) SubmittedToDestinationTime ¶ added in v0.0.75
func (t InProgressAttestation) SubmittedToDestinationTime() *time.Time
SubmittedToDestinationTime gets the time when attestation was sent to the Destination.
type ProcessedEthTx ¶
type ProcessedEthTx struct { TxHash string `gorm:"txhash;uniqueIndex:idx_txhash;size:66"` // RawTx is the raw serialized transaction RawTx []byte `gorm:"column:raw_tx"` // RawEthTx is the txid that caused the event RawEthTx uint // OriginatingEvent is the event that originated the tx EthTx RawEthTX `gorm:"foreignkey:RawEthTx"` // GasFeeCap contains the gas fee cap stored in wei GasFeeCap uint64 // GasTipCap contains the gas tip cap stored in wei GasTipCap uint64 }
ProcessedEthTx contains a processed ethereum transaction.
type RawEthTX ¶
type RawEthTX struct { gorm.Model // From is the sender of the transaction From string `gorm:"from"` // To is the contract address the transaction was sent to. To string `gorm:"index"` // ChainID is the chain id the transaction hash will be sent on ChainID uint64 `gorm:"column:chain_id;uniqueIndex:idx_id"` // Nonce is the nonce of the raw evm tx Nonce uint64 `gorm:"column:nonce;uniqueIndex:idx_id"` // RawTx is the raw serialized transaction RawTx []byte `gorm:"column:raw_tx"` }
RawEthTX contains a raw evm transaction that is unsigned note: idx_id contains a composite index of (chain_id,nonce)
type SignedAttestation ¶
type SignedAttestation struct { gorm.Model // SAOrigin is the origin of the attestation SAOrigin uint32 `gorm:"column:origin_id;uniqueIndex:sa_idx_id"` // SADestination is the destination of the attestation SADestination uint32 `gorm:"column:destination_id;uniqueIndex:sa_idx_id"` // SANonce is the nonce of the attestation SANonce uint32 `gorm:"column:nonce;uniqueIndex:sa_idx_id"` // SARoot is the root of the signed attestation SARoot []byte `gorm:"column:root"` // SANotarySignature stores the raw notary signature SANotarySignature []byte `gorm:"column:notary_signature"` // SAGuardSignature stores the raw guard signature SAGuardSignature []byte `gorm:"column:guard_signature"` }
SignedAttestation stores attestations. TODO (joe): This needs to be updated for the multiple signatures model. Fix coming soon.
func (SignedAttestation) Attestation ¶
func (s SignedAttestation) Attestation() types.Attestation
Attestation gets the attestation.
func (SignedAttestation) Destination ¶ added in v0.0.34
func (s SignedAttestation) Destination() uint32
Destination gets the destination of the signed attestation.
func (SignedAttestation) GuardSignatures ¶ added in v0.0.51
func (s SignedAttestation) GuardSignatures() []types.Signature
GuardSignatures gets the guard signatures of the signed attestation note: this can fail on decoding TODO (joe): Fix this. Right now, just returning the single guard signature.
func (SignedAttestation) Nonce ¶
func (s SignedAttestation) Nonce() uint32
Nonce gets the nonce of the signed attestation.
func (SignedAttestation) NotarySignatures ¶ added in v0.0.51
func (s SignedAttestation) NotarySignatures() []types.Signature
NotarySignatures gets the notary signatures of the signed attestation note: this can fail on decoding TODO (joe): Fix this. Right now, just returning the single guard signature.
func (SignedAttestation) Origin ¶ added in v0.0.34
func (s SignedAttestation) Origin() uint32
Origin gets the origin of the signed attestation.
func (SignedAttestation) Root ¶
func (s SignedAttestation) Root() [32]byte
Root gets the root of the signed attestation.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the sqlite store. It extends the base store for sqlite specific queries.
func (Store) GetDelinquentMessages ¶
func (s Store) GetDelinquentMessages(ctx context.Context, destinationDomain uint32) ([]types.Message, error)
GetDelinquentMessages gets messages that were sent on the origin chain, but never received on the destination chain.
func (Store) GetMessageLatestBlockEnd ¶
func (s Store) GetMessageLatestBlockEnd(ctx context.Context, domainID uint32) (blockNumber uint32, err error)
GetMessageLatestBlockEnd gets the latest block end for a given domain.
func (Store) GetNonceForChainID ¶
func (s Store) GetNonceForChainID(ctx context.Context, fromAddress common.Address, chainID *big.Int) (nonce uint64, err error)
GetNonceForChainID gets a nonce for a chainid.
func (Store) MarkConfirmedOnDestination ¶ added in v0.0.76
func (s Store) MarkConfirmedOnDestination(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
MarkConfirmedOnDestination confirms that we posted the signed attestation on the Destination.
func (Store) MarkGuardConfirmedOnAttestationCollector ¶ added in v0.0.74
func (s Store) MarkGuardConfirmedOnAttestationCollector(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
MarkGuardConfirmedOnAttestationCollector confirms that the Guard posted the signed attestation on the Attestation Collector.
func (Store) MarkNotaryConfirmedOnAttestationCollector ¶ added in v0.0.74
func (s Store) MarkNotaryConfirmedOnAttestationCollector(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
MarkNotaryConfirmedOnAttestationCollector confirms that the Notary posted the signed attestation on the Attestation Collector.
func (Store) MarkVerifiedOnOrigin ¶ added in v0.0.70
func (s Store) MarkVerifiedOnOrigin(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
MarkVerifiedOnOrigin marks the attestation as having been verified on origin.
func (Store) ReUpdateGuardSubmittedToAttestationCollectorTime ¶ added in v0.0.74
func (s Store) ReUpdateGuardSubmittedToAttestationCollectorTime(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
ReUpdateGuardSubmittedToAttestationCollectorTime sets the time the attestation was sent to Attestation Collector by the Guard when resubmitting.
func (Store) ReUpdateNotarySubmittedToAttestationCollectorTime ¶ added in v0.0.74
func (s Store) ReUpdateNotarySubmittedToAttestationCollectorTime(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
ReUpdateNotarySubmittedToAttestationCollectorTime sets the time attestation was sent to Attestation Collector by the Notary when resubmitting.
func (Store) RetrieveInProgressAttestation ¶ added in v0.0.58
func (s Store) RetrieveInProgressAttestation(ctx context.Context, originID, destinationID, nonce uint32) (attestation types.InProgressAttestation, err error)
RetrieveInProgressAttestation retrieves a in-progress attestation by <origin, destination, nonce>. This is mainly used for testing.
func (Store) RetrieveLatestCachedNonce ¶ added in v0.0.58
func (s Store) RetrieveLatestCachedNonce(ctx context.Context, originID, destinationID uint32) (_ uint32, err error)
RetrieveLatestCachedNonce retrieves the latest nonce cached for given origin-destination pair. TODO (joe): Currently, we are grabbing ALL the nonces rather than just asking the origin for the most recent one. We are calling getHistoricalRoot with the next nonce that we haven't seen. Later, we will replace this with calling suggestAttestation for our particular destination and only getting the latest one.
func (Store) RetrieveLatestCommittedMessageNonce ¶
func (s Store) RetrieveLatestCommittedMessageNonce(ctx context.Context, domainID uint32) (_ uint32, err error)
RetrieveLatestCommittedMessageNonce gets the latest commitedd message by nonce.
func (Store) RetrieveNewestConfirmedInProgressAttestation ¶ added in v0.0.58
func (s Store) RetrieveNewestConfirmedInProgressAttestation(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
RetrieveNewestConfirmedInProgressAttestation retrieves the newest in-progress attestation that has been confirmed on the AttestationCollector.
func (Store) RetrieveNewestConfirmedOnDestination ¶ added in v0.0.76
func (s Store) RetrieveNewestConfirmedOnDestination(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
RetrieveNewestConfirmedOnDestination retrieves the newest in-progress attestation that has been signed by both the guard and notary and submitted to the attestation collector, and also the destination and has been confirmed on the destination.
func (Store) RetrieveOldestGuardConfirmedOnCollector ¶ added in v0.0.74
func (s Store) RetrieveOldestGuardConfirmedOnCollector(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
RetrieveOldestGuardConfirmedOnCollector retrieves the oldest in-progress attestation that has been signed by both the guard and notary and submitted to the attestation collector, and confirmed on the Attestation Collector.
func (Store) RetrieveOldestGuardSubmittedToCollectorUnconfirmed ¶ added in v0.0.73
func (s Store) RetrieveOldestGuardSubmittedToCollectorUnconfirmed(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
RetrieveOldestGuardSubmittedToCollectorUnconfirmed retrieves the oldest in-progress attestation that has been signed by both the guard and notary and submitted to the attestation collector, but not yet confirmed.
func (Store) RetrieveOldestGuardUnsignedAndUnverifiedInProgressAttestation ¶ added in v0.0.70
func (s Store) RetrieveOldestGuardUnsignedAndUnverifiedInProgressAttestation(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
RetrieveOldestGuardUnsignedAndUnverifiedInProgressAttestation retrieves the oldest in-progress attestation that has been signed by a notary but not a guard and it has not been verified on the origin.
func (Store) RetrieveOldestGuardUnsignedAndVerifiedInProgressAttestation ¶ added in v0.0.70
func (s Store) RetrieveOldestGuardUnsignedAndVerifiedInProgressAttestation(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
RetrieveOldestGuardUnsignedAndVerifiedInProgressAttestation retrieves the oldest in-progress attestation that has been signed by a notary but not a guard and it has been verified on the origin.
func (Store) RetrieveOldestGuardUnsubmittedSignedInProgressAttestation ¶ added in v0.0.72
func (s Store) RetrieveOldestGuardUnsubmittedSignedInProgressAttestation(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
RetrieveOldestGuardUnsubmittedSignedInProgressAttestation retrieves the oldest in-progress attestation that has been signed by both the guard and notary but not yet submitted.
func (Store) RetrieveOldestSubmittedToDestinationUnconfirmed ¶ added in v0.0.75
func (s Store) RetrieveOldestSubmittedToDestinationUnconfirmed(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
RetrieveOldestSubmittedToDestinationUnconfirmed retrieves the oldest in-progress attestation that has been signed by both the guard and notary and submitted to the attestation collector, and also the destination but not yet confirmed on the destination.
func (Store) RetrieveOldestUnconfirmedSubmittedInProgressAttestation ¶ added in v0.0.58
func (s Store) RetrieveOldestUnconfirmedSubmittedInProgressAttestation(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
RetrieveOldestUnconfirmedSubmittedInProgressAttestation retrieves the oldest in-progress attestation that has been signed and submitted but not yet confirmed on the AttestationCollector.
func (Store) RetrieveOldestUnsignedInProgressAttestation ¶ added in v0.0.58
func (s Store) RetrieveOldestUnsignedInProgressAttestation(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
RetrieveOldestUnsignedInProgressAttestation retrieves the oldest in-progress attestation that has not yet been signed. TODO (joe): Eventually we will not try to sign ALL the nonces, we really just want the latest one, so we will want to replace this with RetrieveNewestUnsignedInProgressAttestation. For Notary MVP, we want to sign all the nonces though so we will just get the oldest and go in order.
func (Store) RetrieveOldestUnsubmittedSignedInProgressAttestation ¶ added in v0.0.58
func (s Store) RetrieveOldestUnsubmittedSignedInProgressAttestation(ctx context.Context, originID, destinationID uint32) (_ types.InProgressAttestation, err error)
RetrieveOldestUnsubmittedSignedInProgressAttestation retrieves the oldest in-progress attestation that has been signed but not yet submitted.
func (Store) RetrieveSignedAttestationByNonce ¶
func (s Store) RetrieveSignedAttestationByNonce(ctx context.Context, domainID, nonce uint32) (attestation types.SignedAttestation, err error)
RetrieveSignedAttestationByNonce retrieves a signed attestation by nonce. TODO (joe): This will need to be updated after we make the Global Registry changes.
func (Store) StoreAcceptedAttestation ¶
StoreAcceptedAttestation stores an accepted attestation from a destination.
func (Store) StoreCommittedMessage ¶
func (s Store) StoreCommittedMessage(ctx context.Context, domainID uint32, message types.CommittedMessage) error
StoreCommittedMessage stores a raw committed message building off the leaf index this method is idempotent.
func (Store) StoreDispatchMessage ¶
StoreDispatchMessage takes a message and stores the information.
func (Store) StoreExistingSignedInProgressAttestation ¶ added in v0.0.68
func (s Store) StoreExistingSignedInProgressAttestation(ctx context.Context, signedAttestation types.SignedAttestation) error
StoreExistingSignedInProgressAttestation stores signed in-progress attestation only if it hasn't already been stored.
func (Store) StoreMessageLatestBlockEnd ¶
func (s Store) StoreMessageLatestBlockEnd(ctx context.Context, domainID uint32, blockNumber uint32) error
StoreMessageLatestBlockEnd stores the latest message block height we've observed.
func (Store) StoreNewInProgressAttestation ¶ added in v0.0.58
func (s Store) StoreNewInProgressAttestation(ctx context.Context, attestation types.Attestation, originDispathBlockNumber uint64) error
StoreNewInProgressAttestation stores in-progress attestation only if it hasn't already been stored.
func (Store) StoreProcessedTx ¶
StoreProcessedTx stores a processed text.
func (Store) StoreRawTx ¶
func (s Store) StoreRawTx(ctx context.Context, tx *types.Transaction, chainID *big.Int, from common.Address) error
StoreRawTx stores a raw transaction.
func (Store) StoreSignedAttestations ¶
func (s Store) StoreSignedAttestations(ctx context.Context, attestation types.SignedAttestation) error
StoreSignedAttestations stores signed attestations.
func (Store) UpdateGuardSignature ¶ added in v0.0.72
func (s Store) UpdateGuardSignature(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
UpdateGuardSignature sets the guard signature of the in-progress Attestation.
func (Store) UpdateGuardSubmittedToAttestationCollectorTime ¶ added in v0.0.73
func (s Store) UpdateGuardSubmittedToAttestationCollectorTime(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
UpdateGuardSubmittedToAttestationCollectorTime sets the time the attestation was sent to Attestation Collector by the Guard.
func (Store) UpdateNotarySignature ¶ added in v0.0.68
func (s Store) UpdateNotarySignature(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
UpdateNotarySignature sets the notary signature of the in-progress Attestation.
func (Store) UpdateNotarySubmittedToAttestationCollectorTime ¶ added in v0.0.73
func (s Store) UpdateNotarySubmittedToAttestationCollectorTime(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
UpdateNotarySubmittedToAttestationCollectorTime sets the time attestation was sent to Attestation Collector by the Notary.
func (Store) UpdateSubmittedToDestinationTime ¶ added in v0.0.75
func (s Store) UpdateSubmittedToDestinationTime(ctx context.Context, inProgressAttestation types.InProgressAttestation) error
UpdateSubmittedToDestinationTime sets the time the attestation was sent to the Destination.