Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions CODEOWNERS

This file was deleted.

27 changes: 14 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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
```

Comment on lines -3 to -10

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was important notice, since it's the first think that will break if a new developer makes a PR

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't enforce signing at the repo level; I recently found that I never had it enabled and I've been able to commit and push just fine.

We can update the docs again in case we happen to enable it.

## 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)

Expand All @@ -23,17 +16,25 @@ Install a pre-push git hook:
git config core.hooksPath .githooks
```

## Running the Rust Documentation Locally

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we suggest to use nix ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, Nix is used only to set up a reproducible environment and it's intended to be used by those already familiar with Nix; we don't want to force it as a dependency.

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
Expand Down
175 changes: 40 additions & 135 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,146 +1,51 @@
# :crab: RUST PROJECT TEMPLATE - TODO(template) PUT PROJECT NAME HERE
<!--`TODO(template) update each badge with your username and repository name.`-->
[![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)
<!-- You can replace them with a single badge if you create a main CI file that calls the other workflows
[![CI](https://github.com/{{USERNAME}}/{{REPOSITORY}}/workflows/CI/badge.svg)](https://github.com/{{USERNAME}}/{{REPOSITORY}}/actions)
-->
<!--`TODO(template) update with your rust version`
If you want to change from stable to Minimum Supported Rust Version (MSRV), replace the badge with:
![MSRV](https://img.shields.io/badge/rustc-1.70+-ab6000.svg) TODO(template) update specific version
-->
![Rust](https://img.shields.io/badge/rust-stable-orange.svg)
<!--`TODO(template) update license version if needed. Check LICENSE first`-->
# Pluto
Comment thread
emlautarom1 marked this conversation as resolved.
[![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)
<!--`TODO(template) update with your crate information. Remove if not needed.`-->
[![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),
Comment thread
emlautarom1 marked this conversation as resolved.
[key concepts](https://docs.obol.org/docs/int/key-concepts) and [charon](https://docs.obol.org/docs/charon/intro).
Comment thread
emlautarom1 marked this conversation as resolved.
Comment thread
emlautarom1 marked this conversation as resolved.

## 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
Comment thread
emlautarom1 marked this conversation as resolved.
- **incompatible** if their `MAJOR` number differs
Comment thread
emlautarom1 marked this conversation as resolved.

Comment thread
emlautarom1 marked this conversation as resolved.
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.
Comment thread
emlautarom1 marked this conversation as resolved.

## 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).