diff --git a/CODEOWNERS b/CODEOWNERS deleted file mode 100644 index b9f504c7..00000000 --- a/CODEOWNERS +++ /dev/null @@ -1,24 +0,0 @@ -# CODEOWNERS TODO(template) -# -# This file defines code ownership for this repository. -# Code owners are automatically requested for review when someone opens a pull request. -# -# 📖 Learn more: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners - -# ============================================================================= -# GLOBAL OWNERS -# ============================================================================= -# These owners will be requested for review on ALL pull requests -# Uncomment and customize the line below: - -* @NethermindEth/zk-engineering -# * @username1 @username2 - -# ============================================================================= -# PATH-BASED OWNERSHIP -# ============================================================================= -# Define owners for specific files or directories -# Examples: - -# *.md @username -# /docs/ @username1 @username2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9db1fc7f..a74d5b96 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,17 +1,10 @@ # Contributor's guide -## Commit signing - -Enable [commit signing](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) - -```sh -git config commit.gpgsign true -``` - ## Prerequisites * [Rust](https://www.rust-lang.org/tools/install) * [Protobuf](https://protobuf.dev/installation/) +* [Docker](https://www.docker.com/) * [cargo deny](https://github.com/EmbarkStudios/cargo-deny) * [oas3-gen](https://github.com/eklipse2k8/oas3-gen) @@ -23,17 +16,25 @@ Install a pre-push git hook: git config core.hooksPath .githooks ``` -## Running the Rust Documentation Locally -After cloning the repository, follow the instructions below to run the documentation locally: +## Building +To build the project with all its crates, run: ```sh -cargo doc +cargo build --workspace --all-features ``` -Docs for `TODO(template) template_crate`: +## Run Unit and Integration Tests +To run all tests - unit and integration - run: + +```sh +cargo test --workspace --all-features +``` + +## Running the Rust Documentation Locally +To build the documentation locally: ```sh -RUSTDOCFLAGS="--html-in-header katex-header.html" cargo doc --no-deps -p template_crate --open +cargo doc --workspace --all-features --no-deps ``` ## Performance diff --git a/README.md b/README.md index 4e5f7a56..f19e0252 100644 --- a/README.md +++ b/README.md @@ -1,146 +1,51 @@ -# :crab: RUST PROJECT TEMPLATE - TODO(template) PUT PROJECT NAME HERE - -[![Docs](https://github.com/NethermindEth/rust-template/actions/workflows/docs.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/docs.yml) -[![Lint](https://github.com/NethermindEth/rust-template/actions/workflows/linter.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/linter.yml) -[![Build](https://github.com/NethermindEth/rust-template/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/build-and-test.yml) -[![Dependencies](https://github.com/NethermindEth/rust-template/actions/workflows/dependency-audit.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/dependency-audit.yml) -[![UB](https://github.com/NethermindEth/rust-template/actions/workflows/ub-detection.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/ub-detection.yml) -[![Coverage](https://github.com/NethermindEth/rust-template/actions/workflows/coverage.yml/badge.svg)](https://github.com/NethermindEth/rust-template/actions/workflows/coverage.yml) - - -![Rust](https://img.shields.io/badge/rust-stable-orange.svg) - +# Pluto +[![Docs](https://github.com/NethermindEth/charon-rs/actions/workflows/docs.yml/badge.svg)](https://github.com/NethermindEth/charon-rs/actions/workflows/docs.yml) +[![Lint](https://github.com/NethermindEth/charon-rs/actions/workflows/linter.yml/badge.svg)](https://github.com/NethermindEth/charon-rs/actions/workflows/linter.yml) +[![Build](https://github.com/NethermindEth/charon-rs/actions/workflows/test.yml/badge.svg)](https://github.com/NethermindEth/charon-rs/actions/workflows/test.yml) +[![Dependencies](https://github.com/NethermindEth/charon-rs/actions/workflows/dependency-audit.yml/badge.svg)](https://github.com/NethermindEth/charon-rs/actions/workflows/dependency-audit.yml) +![Coverage](https://github.com/NethermindEth/charon-rs/wiki/coverage.svg) + +![Rust](https://img.shields.io/badge/rust-1.89-orange.svg) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) - -[![Crates.io](https://img.shields.io/crates/v/{{CRATE_NAME}}.svg)](https://crates.io/crates/{{CRATE_NAME}}) -[![Documentation](https://docs.rs/{{CRATE_NAME}}/badge.svg)](https://docs.rs/{{CRATE_NAME}}) - -TODO(template) describe the project - -## TODO(template) - rust template usage (remove this section after setup) - -This is a rust template from ZKE team :rocket: (a focus on cryptographic libs in sync Rust). - -:bike: To use it - find `TODO(template)` over the repository and set appropriate values. - -- [ ] Settings -> Collaborators and teams - add your team group as admins for the repo (e.g. [zk-engineering](https://github.com/orgs/NethermindEth/teams/zk-engineering)) -- [ ] Settings -> General -> Pull Requests - allow only `Allow squash merging`, also tick `Automatically delete head branches` -- [ ] Settings -> Pages -> Build and deployment -> Source Github Actions -- [ ] Update the description of the repo at the repo's page, add tag topics -- [ ] Introduce necessary sections at the repo's page (releases, deployments etc) -- [ ] Add a website url (if applicable) or a docs page (see [docs](./.github/workflows/docs.yml) flow for public repos) -- [ ] Add [all contributors](https://allcontributors.org/docs/en/cli/installation) -- [ ] Import protection rulesets (see below) in the repo settings (Settings -> Rules -> Rulesets -> Import a ruleset) -- [ ] For binary crates with specific requirements to Rust features consider also [pinning](https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file) the rust toolchain version - -Main branch protection - -```json -{ - "id": 4981961, - "name": "Main protection", - "target": "branch", - "source_type": "Repository", - "source": "NethermindEth/rust-template", - "enforcement": "active", - "conditions": { - "ref_name": { - "exclude": [], - "include": [ - "~DEFAULT_BRANCH" - ] - } - }, - "rules": [ - { - "type": "deletion" - }, - { - "type": "non_fast_forward" - }, - { - "type": "required_deployments", - "parameters": { - "required_deployment_environments": [] - } - }, - { - "type": "required_signatures" - }, - { - "type": "pull_request", - "parameters": { - "required_approving_review_count": 1, - "dismiss_stale_reviews_on_push": false, - "require_code_owner_review": false, - "require_last_push_approval": false, - "required_review_thread_resolution": true, - "automatic_copilot_code_review_enabled": false, - "allowed_merge_methods": [ - "merge", - "squash", - "rebase" - ] - } - } - ], - "bypass_actors": [] -} -``` - -Signed commits - -```json -{ - "id": 4982030, - "name": "Signed commits", - "target": "branch", - "source_type": "Repository", - "source": "NethermindEth/rust-template", - "enforcement": "active", - "conditions": { - "ref_name": { - "exclude": [], - "include": [ - "~ALL" - ] - } - }, - "rules": [ - { - "type": "required_signatures" - } - ], - "bypass_actors": [] -} -``` - -## How to use - -To generate a new project from this template, you need to install [cargo-generate](https://github.com/cargo-generate/cargo-generate) and run: - -```sh -cargo install cargo-generate - -cargo generate --git https://github.com/NethermindEth/rust-template -``` + +Pluto is an alternative implementation of [Charon](https://github.com/ObolNetwork/charon/), a distributed validator middleware client for Ethereum Staking. It enables a group of independent operators to safely run a single validator by coordinating duties across multiple nodes. + +Pluto, like Charon, is used by stakers to distribute the responsibility of running Ethereum Validators across a number of different instances and client implementations. + +See the official docs at https://docs.obol.org/ for introductions and key concepts. + +## Documentation + +The [Obol Docs](https://docs.obol.org/) website is the best place to get started. +The important sections are [intro](https://docs.obol.org/learn/charon), +[key concepts](https://docs.obol.org/docs/int/key-concepts) and [charon](https://docs.obol.org/docs/charon/intro). + +## Version compatibility + +Considering [semver](https://semver.org) as the project's versioning scheme, two given versions of Charon are: + - **compatible** if their `MAJOR` number is the same, `MINOR` and `PATCH` numbers differ + - **incompatible** if their `MAJOR` number differs + +There are several reasons to justify a new `MAJOR` release, for example: + - a new Ethereum hardfork + - an old Ethereum hardfork is removed due to network inactivity + - modifications to the internal P2P network or consensus mechanism requiring deep changes to the codebase + +The `charon dkg` subcommand **is more restrictive** than this general compatibility promise; all peers should use matching `MAJOR` and `MINOR` versions of Charon for the DKG process, patch versions may differ though it is recommended to use the latest patch of any version. ## Examples -See [examples](./examples/). +Examples are located in crate-specific example folders: -## License +- [P2P](crates/charon-p2p/examples/metrics.rs) +- [Peerinfo](crates/peerinfo/examples/peerinfo.rs) +- [Relay Server](crates/relay-server/examples/relay_server.rs) +- [Tracing](crates/tracing/examples/basic.rs) -TODO(template) - update [license](https://www.notion.so/nethermind/Open-Source-Software-Usage-and-Licensing-Policy-1c3360fc38d080fd9e61c29b35d1d5af) if needed. -For commercial licenses it is required to get an approve from Legal. +## License Apache 2.0 ## Would like to contribute? -see [Contributing](./CONTRIBUTING.md). +See [Contributing](./CONTRIBUTING.md).