Skip to content

Commit

Permalink
Merge pull request #256 from ralexstokes/max-perf
Browse files Browse the repository at this point in the history
implement reth's `maxperf` Cargo profile
  • Loading branch information
ralexstokes authored May 13, 2024
2 parents 711d04d + 67311e1 commit 6612bff
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
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

0 comments on commit 6612bff

Please sign in to comment.