InterfaceSummit
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
Name | Type | Description |
---|---|---|
rcptNotaryIndex | uint32 | Index of Receipt Notary in Agent Merkle Tree |
attNotaryIndex | uint32 | Index of Attestation Notary in Agent Merkle Tree |
sigIndex | uint256 | Index of stored Notary signature |
attNonce | uint32 | Nonce of the attestation used for proving the executed message |
paddedTips | uint256 | Padded encoded paid tips information |
rcptPayload | bytes | Raw payload with message execution receipt |
Returns
Name | Type | Description |
---|---|---|
wasAccepted | bool | Whether 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
Name | Type | Description |
---|---|---|
guardIndex | uint32 | Index of Guard in Agent Merkle Tree |
sigIndex | uint256 | Index of stored Agent signature |
snapPayload | bytes | Raw 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
Name | Type | Description |
---|---|---|
notaryIndex | uint32 | Index of Notary in Agent Merkle Tree |
sigIndex | uint256 | Index of stored Agent signature |
agentRoot | bytes32 | Current root of the Agent Merkle Tree |
snapPayload | bytes | Raw payload with snapshot data |
Returns
Name | Type | Description |
---|---|---|
attPayload | bytes | Raw 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
Name | Type | Description |
---|---|---|
queuePopped | bool | Whether 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
Name | Type | Description |
---|---|---|
origin | uint32 | Domain of chain to withdraw tips on |
amount | uint256 | Amount 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
Name | Type | Description |
---|---|---|
actor | address | Address of the actor |
origin | uint32 | Domain where the tips were initially paid |
Returns
Name | Type | Description |
---|---|---|
earned | uint128 | Total amount of origin tips the actor has earned so far |
claimed | uint128 | Total 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
Name | Type | Description |
---|---|---|
origin | uint32 | Domain of origin chain |
Returns
Name | Type | Description |
---|---|---|
statePayload | bytes | Raw payload with latest active Guard state for origin |