Skip to content

agnusmor/agglayer

 
 

Repository files navigation


Logo Logo

Agglayer

The Agglayer (Aggregation layer) provides a common language for secure, atomic, interoperability among heterogeneous chains. (WIP)


Test workflow Quality workflow codecov


Logo

Table of Contents

Overview

Agglayer is the Rust-based service designed to:

  1. Receive updates from Agglayer-connected chains
  2. Verify their validity
  3. Send them to the L1 for final settlement.

To find out more about Agglayer, please visit the more detailed documentation.

Warning

  • Some of the content in this section discusses technology in development and not ready for release. As such, all APIs and configuration are subject to change. The code is still being audited, so please contact the Polygon team if you would like to use it in production.

Repository Structure

The crates and their functions within the Agglayer repo are as follows:

Crate Description
agglayer-aggregator-notifier Contains implementations for Certifier which applies new Certificate on top of an existing state and computes the proof, as well as EpochPacker, which handles the packing of an epoch
agglayer-certificate-orchestrator Manages the orchestration and handling of certificates; also handles current_epoch, which allows non-orchestrators to push a proven certificate
agglayer-clock Defines the pace of the Agglayer in terms of epoch with support for two clocks: time (for testing) and block (for listening for L1 blocks)
agglayer-config Manages configuration settings and parameters for Agglayer components
agglayer-contracts Contains smart contracts and related logic
agglayer-gcp-kms Provides integration with GCP's Key Management Service for secure key handling
agglayer-node Responsible for spawning and running the different components of the node
agglayer-prover-types Defines data structures and types used by the prover
agglayer-prover Responsible for running everything related to the prover
agglayer-signer Manages signing operations
agglayer-storage Contains two layers: a physical layer for abstracting RocksDB and a logic layer for exposing the interface to other crates so that they may interact with the storage
agglayer-telemetry Handles telemetry and monitoring functionalities
agglayer-types Defines common data types and structures
agglayer The CLI for interacting with the Agglayer
pessimistic-proof-program Implements the pessimistic proof program
pessimistic-proof-test-suite Provides a suite of tests for validating the functionality of the pessimistic proof program
pessimistic-proof Contains the core logic and implementation of the pessimistic proof mechanism

Prerequisites

Before working with the repository, you’ll need the following:

Succinct Prover Network

You’ll need to submit a unique Ethereum address to Succinct for access to their proving network. To get access:

  1. Follow the instructions here to use Foundry to generate a new private key or retrieve an existing one.
  2. Apply for access for the public address associated with your private key to Succinct Network here.

Software Requirements

Hardware Recommendations

With SP1, you do not need to generate proofs locally on your machine.

However, if you’d like to run a prover locally (not recommended), you’ll need roughly 40-50GB of available RAM.

Installation

To install the Agglayer repository, please run the following:

git clone https://github.com/agglayer/agglayer
cd agglayer

To build Agglayer locally, please run:

cargo build

Running the Pessimistic Proof Test Suite

To run the Pessimistic Proof Test Suite with test inputs in Native Rust Execution, please run the following:

cargo test --package pessimistic-proof-test-suite

You can find the test inputs here: ./agglayer/crates/pessimistic-proof-test-suite

Running SP1 Proof Generation Locally (Not Recommended)

The Succinct Prover Network is the best way to generate Pessimistic Proofs for Agglayer.

For those with the hardware and know-how, however, you can run the Pessimistic Proof program in a local SP1 Prover with the following commands:

cargo run --package pessimistic-proof-test-suite --bin ppgen

Development

Contributions are very welcomed, the guidelines are currently not available (WIP)

Support

Feel free to open an issue if you have any feature request or bug report.

Resources

License

Copyright (c) 2024 PT Services DMCC

Licensed under either of

at your option.

The SPDX license identifier for this project is MIT OR Apache-2.0.

About

Rust implementation of the Agglayer.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 97.2%
  • Shell 2.7%
  • Dockerfile 0.1%