Payload Commit Service
Once the snapshots are generated and uploaded to a decentralized storage medium like IPFS, the payload commit service ensures that the record of the same is registered on the protocol. It also performs some housekeeping functions, such as caching finalized snapshots against an epoch. The following sequence diagram provides a complete picture of its functions.
- Upon receiving the snapshot dataset's CID from snapshot builder processes, this service prepares an EIP-712 signed message containing the same. This identifies the snapshotter on the protocol state smart contract.
- Submits the signed message to the relayer (if configured); otherwise, it uses an internal transaction manager to submit it as a transaction to the protocol state smart contract.
- It also processes the finalization of snapshots for a given epoch:
- If the finalized snapshot for a given project against an
epochId
has the same CID as generated by snapshot builders, store the contents of the snapshot on a local disk cache. - Else, it fetches the finalized snapshot dataset from IPFS and stores it in the local disk cache.
- If the finalized snapshot for a given project against an
- Generates a Snapshotter report