LightInbox

Git Source

Inherits: StatementInbox, InterfaceLightInbox

LightInbox is the child of StatementInbox contract, that is used chains other than the Synapse Chain. In addition to the functionality of StatementInbox, it also:

  • Accepts Notary Attestations and passes them to the Destination contract.
  • Accepts Attestation Reports and initiates a dispute between the Notary and the Guard.

Functions

constructor

constructor(uint32 synapseDomain_) MessagingBase("0.0.3", synapseDomain_);

initialize

Initializes LightInbox contract:

  • Sets msg.sender as the owner of the contract
  • Sets agentManager, origin and destination addresses
function initialize(address agentManager_, address origin_, address destination_) external initializer;

submitAttestation

Accepts an attestation signed by a Notary and passes it to Destination contract to save.

Attestation is created whenever a Notary-signed snapshot is saved in Summit on Synapse Chain.

  • Saved Attestation could be later used to prove the inclusion of message in the Origin Merkle Tree.
  • Messages coming from chains included in the Attestation's snapshot could be proven.
  • Proof only exists for messages that were sent prior to when the Attestation's snapshot was taken.

Will revert if any of these is true:

  • Attestation payload is not properly formatted.
  • Attestation signer is not an active Notary for local domain.
  • Attestation signer is in Dispute.
  • Attestation's snapshot root has been previously submitted.
  • Attestation's data hash doesn't match the hash of provided agentRoot and snapshot gas data.
function submitAttestation(
    bytes memory attPayload,
    bytes memory attSignature,
    bytes32 agentRoot_,
    uint256[] memory snapGas_
) external returns (bool wasAccepted);

Parameters

NameTypeDescription
attPayloadbytesRaw payload with Attestation data
attSignaturebytesNotary signature for the attestation
agentRoot_bytes32
snapGas_uint256[]

Returns

NameTypeDescription
wasAcceptedboolWhether the Attestation was accepted

submitAttestationReport

Accepts a Guard's attestation report signature, as well as Notary signature for the reported Attestation.

AttestationReport is a Guard statement saying "Reported attestation is invalid".

  • This results in an opened Dispute between the Guard and the Notary.
  • Note: Guard could (but doesn't have to) form a AttestationReport and use attestation signature from verifyAttestation() successful call that led to Notary being slashed in Summit on Synapse Chain.

Will revert if any of these is true:

  • Attestation payload is not properly formatted.
  • Attestation Report signer is not an active Guard.
  • Attestation signer is not an active Notary for local domain.
function submitAttestationReport(bytes memory attPayload, bytes memory arSignature, bytes memory attSignature)
    external
    returns (bool wasAccepted);

Parameters

NameTypeDescription
attPayloadbytesRaw payload with Attestation data that Guard reports as invalid
arSignaturebytesGuard signature for the report
attSignaturebytesNotary signature for the reported attestation

Returns

NameTypeDescription
wasAcceptedboolWhether the Report was accepted (resulting in Dispute between the agents)