Skip to content

Commit

Permalink
feat: use stable rust toolchain (#264)
Browse files Browse the repository at this point in the history
Remove the 'different-binary-name' feature.
Remove the 'more_qualified_paths' feature.
Unexport the 'superstruct_ssr' macro and keep it private.
  • Loading branch information
zvolin authored Aug 28, 2023
1 parent 3bcec66 commit e538f6b
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 37 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
- name: checkout
uses: actions/checkout@v1

- name: install rust nightly
- name: install rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: stable
default: true
override: true

Expand All @@ -31,7 +31,7 @@ jobs:
- name: generate tag name
id: tag
run: |
echo "::set-output name=release_tag::nightly-${GITHUB_SHA}"
echo "::set-output name=release_tag::${GITHUB_SHA}"
- name: release
uses: softprops/action-gh-release@v1
Expand All @@ -49,10 +49,10 @@ jobs:
- name: checkout
uses: actions/checkout@v1

- name: install rust nightly
- name: install rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: stable
default: true
override: true

Expand All @@ -70,7 +70,7 @@ jobs:
- name: generate tag name
id: tag
run: |
echo "::set-output name=release_tag::nightly-${GITHUB_SHA}"
echo "::set-output name=release_tag::${GITHUB_SHA}"
- name: release
uses: softprops/action-gh-release@v1
Expand All @@ -88,10 +88,10 @@ jobs:
- name: checkout
uses: actions/checkout@v1

- name: install rust nightly
- name: install rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: stable
default: true
override: true

Expand All @@ -115,7 +115,7 @@ jobs:
- name: generate tag name
id: tag
run: |
echo "::set-output name=release_tag::nightly-${GITHUB_SHA}"
echo "::set-output name=release_tag::${GITHUB_SHA}"
- name: release
uses: softprops/action-gh-release@v1
Expand All @@ -133,10 +133,10 @@ jobs:
- name: checkout
uses: actions/checkout@v1

- name: install rust nightly
- name: install rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: stable
default: true
override: true

Expand All @@ -154,7 +154,7 @@ jobs:
- name: generate tag name
id: tag
run: |
echo "::set-output name=release_tag::nightly-${GITHUB_SHA}"
echo "::set-output name=release_tag::${GITHUB_SHA}"
- name: release
uses: softprops/action-gh-release@v1
Expand All @@ -172,10 +172,10 @@ jobs:
- name: checkout
uses: actions/checkout@v1

- name: install rust nightly
- name: install rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
toolchain: stable
default: true
override: true

Expand All @@ -202,7 +202,7 @@ jobs:
- name: generate tag name
id: tag
run: |
echo "::set-output name=release_tag::nightly-${GITHUB_SHA}"
echo "::set-output name=release_tag::${GITHUB_SHA}"
- name: release
uses: softprops/action-gh-release@v1
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/cargo@v1
Expand All @@ -32,7 +32,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/cargo@v1
Expand All @@ -47,7 +47,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
toolchain: stable
override: true
components: rustfmt
- uses: Swatinem/rust-cache@v2
Expand All @@ -63,7 +63,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
toolchain: stable
override: true
components: clippy
- uses: Swatinem/rust-cache@v2
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ A comprehensive breakdown of config options is available in the [config.md](./co

### Using Helios as a Library

Helios can be imported into any Rust project. Helios requires the Rust nightly toolchain to compile.
Helios can be imported into any Rust project.

```rust
use std::{str::FromStr, env};
Expand Down Expand Up @@ -212,7 +212,7 @@ To learn more about [helios](https://github.com/a16z/helios) benchmarking and to

## Contributing

All contributions to Helios are welcome. Before opening a PR, please submit an issue detailing the bug or feature. When opening a PR, please ensure that your contribution builds on the nightly rust toolchain, has been linted with `cargo fmt`, and contains tests when applicable.
All contributions to Helios are welcome. Before opening a PR, please submit an issue detailing the bug or feature. When opening a PR, please ensure that your contribution builds, has been linted with `cargo fmt`, and contains tests when applicable.

## Telegram

Expand Down
5 changes: 1 addition & 4 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
cargo-features = ["different-binary-name"]

[package]
name = "cli"
version = "0.4.1"
edition = "2021"

[[bin]]
name = "cli"
filename = "helios"
name = "helios"
path = "src/main.rs"

[dependencies]
Expand Down
2 changes: 0 additions & 2 deletions consensus/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(more_qualified_paths)]

pub mod database;
pub mod errors;
pub mod rpc;
Expand Down
4 changes: 1 addition & 3 deletions consensus/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ use ssz_rs::prelude::*;

use superstruct::superstruct;

use crate::superstruct_ssz;

use self::primitives::{ByteList, ByteVector, U64};
use self::utils::{header_deserialize, u256_deserialize};
use self::utils::{header_deserialize, superstruct_ssz, u256_deserialize};

pub mod primitives;
mod utils;
Expand Down
14 changes: 8 additions & 6 deletions consensus/src/types/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ struct Beacon {
beacon: Header,
}

#[macro_export]
macro_rules! superstruct_ssz {
($type:ty) => {
($type:tt) => {
impl ssz_rs::Merkleized for $type {
fn hash_tree_root(&mut self) -> Result<Node, MerkleizationError> {
match self {
<$type>::Bellatrix(inner) => inner.hash_tree_root(),
<$type>::Capella(inner) => inner.hash_tree_root(),
$type::Bellatrix(inner) => inner.hash_tree_root(),
$type::Capella(inner) => inner.hash_tree_root(),
}
}
}
Expand All @@ -70,8 +69,8 @@ macro_rules! superstruct_ssz {
impl ssz_rs::Serialize for $type {
fn serialize(&self, buffer: &mut Vec<u8>) -> Result<usize, SerializeError> {
match self {
<$type>::Bellatrix(inner) => inner.serialize(buffer),
<$type>::Capella(inner) => inner.serialize(buffer),
$type::Bellatrix(inner) => inner.serialize(buffer),
$type::Capella(inner) => inner.serialize(buffer),
}
}
}
Expand All @@ -89,6 +88,9 @@ macro_rules! superstruct_ssz {
};
}

/// this has to go after macro definition
pub(crate) use superstruct_ssz;

impl From<ExecutionPayload> for Block {
fn from(value: ExecutionPayload) -> Block {
let empty_nonce = "0x0000000000000000".to_string();
Expand Down
1 change: 0 additions & 1 deletion rust-toolchain

This file was deleted.

0 comments on commit e538f6b

Please sign in to comment.