Crate eigensdk

Source
Expand description

§EigenSDK-rs

EigenSDK-rs is an initiative for rust developers to build AVSs on eigenlayer.

§Installation

cargo add eigensdk --features full

§Overview

List of crates in the repository :-

§Removed eigen-logging crate

The internal eigen-logging crate has been removed in favor of the community-standard tracing crate.

  • All calls to eigen_logging::info(), eigen_logging::warn(), eigen_logging::error(), eigen_logging::debug() have been replaced by tracing::{info!, warn!, error!, debug!} macros.
  • Logs in services crates are now annotated with #[instrument] to automatically capture metadata information in the logs.

To configure the logging, you can use the tracing-subscriber crate.

// Example of how to configure the logging
tracing::subscriber::set_global_default(
    tracing_subscriber::fmt::Subscriber::builder()
        .with_max_level(Level::INFO)
        .with_ansi(false)
        .finish(),
)
.unwrap();

For more details, see:

§Examples

You can run any example using the command cargo run --example <example-name>

Example :

cargo run --example get_quorum_count

§Generating and saving anvil state

  • Copy env
cp ./crates/m2_contracts/.env.example ./crates/m2_contracts/.env 
cp ./crates/operator_sets_contracts/.env.example ./crates/operator_sets_contracts/.env
  • Run the command
make dump-state

§Contract Bindings

The main branch of this repo is intended to be syncronized with mainnet version of core contracts.

To update the bindings of this repo, run:

make bindings

This command will generate the bindings files in the folder: crates/utils.

Important: this command requires Docker installed and running since it uses a container to generate the bindings.

§Contributor Guidelines

We are actively looking for contributors. Thank you for your interest. We have strict ci checks in place. In case of any questions and support, feel free to raise an issue.

§Branches

  • main - Points to the latest mainnet release of contracts.
  • testnet - Points to the latest testnet release of contracts.
  • dev - Points to the latest dev branch of the contracts.

§PR

To test locally :-

You need foundry to successfully run it.

cargo test --workspace

At least 1 approving review is required to merge the PR.

§lint

make lint

§To run fireblocks tests

Add the following variables to your env

  • FIREBLOCKS_API_KEY
  • FIREBLOCKS_PRIVATE_KEY_PATH
  • FIREBLOCKS_API_URL

and then run the following command

make fireblocks-tests

§Test Coverage

Test coverage should aim to be around 80%.

Here’s how to generate test coverage reports:

Install llvm tools:

make deps

Run the tests with coverage instrumentations:

make coverage

Open the coverage html report in a web browser:

open target/llvm-cov/html/index.html

§Supported Rust Version

Rolling MSRV policy of 6 months. The current MSRV is 1.82

§Release process

The step-by-step process to make a release is documented in RELEASE.md.

§Disclaimer

🚧 EigenSDK-rs is under active development and has not been audited. EigenSDK-rs is rapidly being upgraded, features may be added, removed or otherwise improved or modified and interfaces will have breaking changes. EigenSDK-rs should be used only for testing purposes and not in production. EigenSDK-rs is provided “as is” and Eigen Labs, Inc. does not guarantee its functionality or provide support for its use in production. 🚧

§Credits

§Security Bugs

Please report security vulnerabilities to security@eigenlabs.org. Do NOT report security bugs via Github Issues.

§Support

Join our telegram channel .

Modules§

client_avsregistryclient-avsregistry
AvsRegistry methods for reading, writing and subscribing purposes.
client_elcontractsclient-elcontracts
Convenience methods for AVSs developers to call Eigen layer contract methods
client_ethclient-eth
client_fireblocksclient-fireblocks
commoncommon
crypto_blscrypto-bls
crypto_bn254crypto-bn254
metricsmetrics
metrics_collectors_economicmetrics-collectors-economic
metrics_collectors_rpc_callsmetrics-collectors-rpc-calls
nodeapinodeapi
services_avsregistryservices-avsregistry
AVS Registry Service
services_blsaggregationservices-blsaggregation
BLS Agreggation Service crate.
services_operatorsinfoservices-operatorsinfo
Operators Info Service
signersigner
testing_utilstesting-utils
testing utilities for eigenlayer
typestypes
utilsutils
This module exports generated bindings.