InterfaceSummit

Git Source

Functions

acceptReceipt

Accepts a receipt, which local AgentManager verified to have been signed by an active Notary.

Receipt is a statement about message execution status on the remote chain.

  • This will distribute the message tips across the off-chain actors once the receipt optimistic period is over.
  • Notary who signed the receipt is referenced as the "Receipt Notary".
  • Notary who signed the attestation on destination chain is referenced as the "Attestation Notary".

Will revert if any of these is true:

  • Called by anyone other than local AgentManager.
  • Receipt body payload is not properly formatted.
  • Receipt signer is in Dispute.
  • Receipt's snapshot root is unknown.
function acceptReceipt(
    uint32 rcptNotaryIndex,
    uint32 attNotaryIndex,
    uint256 sigIndex,
    uint32 attNonce,
    uint256 paddedTips,
    bytes memory rcptPayload
) external returns (bool wasAccepted);

Parameters

NameTypeDescription
rcptNotaryIndexuint32Index of Receipt Notary in Agent Merkle Tree
attNotaryIndexuint32Index of Attestation Notary in Agent Merkle Tree
sigIndexuint256Index of stored Notary signature
attNonceuint32Nonce of the attestation used for proving the executed message
paddedTipsuint256Padded encoded paid tips information
rcptPayloadbytesRaw payload with message execution receipt

Returns

NameTypeDescription
wasAcceptedboolWhether the receipt was accepted

acceptGuardSnapshot

Accepts a snapshot, which local AgentManager verified to have been signed by an active Guard.

Snapshot is a list of states for a set of Origin contracts residing on any of the chains. All the states in the Guard-signed snapshot become available for Notary signing. Will revert if any of these is true:

  • Called by anyone other than local AgentManager.
  • Snapshot payload is not properly formatted.
  • Snapshot contains a state older then the Guard has previously submitted.
function acceptGuardSnapshot(uint32 guardIndex, uint256 sigIndex, bytes memory snapPayload) external;

Parameters

NameTypeDescription
guardIndexuint32Index of Guard in Agent Merkle Tree
sigIndexuint256Index of stored Agent signature
snapPayloadbytesRaw payload with snapshot data

acceptNotarySnapshot

Accepts a snapshot, which local AgentManager verified to have been signed by an active Notary.

Snapshot is a list of states for a set of Origin contracts residing on any of the chains. Snapshot Merkle Root is calculated and saved for valid snapshots, i.e. snapshots which are only using states previously submitted by any of the Guards.

  • Notary could use states singed by the same of different Guards in their snapshot.
  • Notary could then proceed to sign the attestation for their submitted snapshot.

Will revert if any of these is true:

  • Called by anyone other than local AgentManager.
  • Snapshot payload is not properly formatted.
  • Snapshot contains a state older then the Notary has previously submitted.
  • Snapshot contains a state that no Guard has previously submitted.
function acceptNotarySnapshot(uint32 notaryIndex, uint256 sigIndex, bytes32 agentRoot, bytes memory snapPayload)
    external
    returns (bytes memory attPayload);

Parameters

NameTypeDescription
notaryIndexuint32Index of Notary in Agent Merkle Tree
sigIndexuint256Index of stored Agent signature
agentRootbytes32Current root of the Agent Merkle Tree
snapPayloadbytesRaw payload with snapshot data

Returns

NameTypeDescription
attPayloadbytesRaw payload with data for attestation derived from Notary snapshot.

distributeTips

Distributes tips using the first Receipt from the "receipt quarantine queue". Possible scenarios:

  • Receipt queue is empty => does nothing
  • Receipt optimistic period is not over => does nothing
  • Either of Notaries present in Receipt was slashed => receipt is deleted from the queue
  • Either of Notaries present in Receipt in Dispute => receipt is moved to the end of queue
  • None of the above => receipt tips are distributed

Returned value makes it possible to do the following: while (distributeTips()) {}

function distributeTips() external returns (bool queuePopped);

Returns

NameTypeDescription
queuePoppedboolWhether the first element was popped from the queue

withdrawTips

Withdraws locked base message tips from requested domain Origin to the recipient. This is done by a call to a local Origin contract, or by a manager message to the remote chain.

This will revert, if the pending balance of origin tips (earned-claimed) is lower than requested.

function withdrawTips(uint32 origin, uint256 amount) external;

Parameters

NameTypeDescription
originuint32Domain of chain to withdraw tips on
amountuint256Amount of tips to withdraw

actorTips

Returns earned and claimed tips for the actor. Note: Tips for address(0) belong to the Treasury.

function actorTips(address actor, uint32 origin) external view returns (uint128 earned, uint128 claimed);

Parameters

NameTypeDescription
actoraddressAddress of the actor
originuint32Domain where the tips were initially paid

Returns

NameTypeDescription
earneduint128Total amount of origin tips the actor has earned so far
claimeduint128Total amount of origin tips the actor has claimed so far

receiptQueueLength

Returns the amount of receipts in the "Receipt Quarantine Queue".

function receiptQueueLength() external view returns (uint256);

getLatestState

Returns the state with the highest known nonce submitted by any of the currently active Guards.

function getLatestState(uint32 origin) external view returns (bytes memory statePayload);

Parameters

NameTypeDescription
originuint32Domain of origin chain

Returns

NameTypeDescription
statePayloadbytesRaw payload with latest active Guard state for origin