Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement reth's maxperf Cargo profile #256

Merged
merged 3 commits into from
May 13, 2024
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
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ default-members = ["bin/mev"]
[workspace.package]
version = "0.3.0"

[profile.release]
lto = "thin"
strip = "debuginfo"

[profile.maxperf]
inherits = "release"
lto = "fat"
codegen-units = 1
incremental = false

[workspace.dependencies]
ethereum-consensus = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "cf3c404043230559660810bc0c9d6d5a8498d819" }
beacon-api-client = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "cf3c404043230559660810bc0c9d6d5a8498d819" }
Expand Down
11 changes: 8 additions & 3 deletions bin/mev/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
mod cmd;

use clap::{CommandFactory, Parser, Subcommand};
use eyre::OptionExt;
use std::{future::Future, path::PathBuf};
use clap::{Parser, Subcommand};
use std::future::Future;
use tokio::signal;
use tracing::warn;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};

#[cfg(feature = "build")]
use ::{clap::CommandFactory, eyre::OptionExt, std::path::PathBuf};

const MINIMAL_PRESET_NOTICE: &str =
"`minimal-preset` feature is enabled. The `minimal` consensus preset is being used.";

Expand Down Expand Up @@ -60,6 +62,7 @@ fn run_task_until_signal(task: impl Future<Output = eyre::Result<()>>) -> eyre::
})
}

#[cfg(feature = "build")]
fn parse_custom_chain_config_directory() -> eyre::Result<Option<PathBuf>> {
let matches = Cli::command().get_matches();
let (_, matches) = matches.subcommand().ok_or_eyre("missing subcommand")?;
Expand All @@ -78,7 +81,9 @@ fn parse_custom_chain_config_directory() -> eyre::Result<Option<PathBuf>> {
}

fn main() -> eyre::Result<()> {
#[cfg(feature = "build")]
let custom_chain_config_directory = parse_custom_chain_config_directory()?;

let cli = Cli::parse();

match cli.command {
Expand Down
1 change: 1 addition & 0 deletions nix/mev-rs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ let
commonArgs = {
pname = "mev-rs";
src = crane.cleanCargoSource (crane.path ../.);
CARGO_PROFILE = "maxperf";
cargoExtraArgs = "--locked ${feature-set}";
buildInputs = lib.optionals pkgs.stdenv.isLinux [
openssl
Expand Down
Loading