Skip to content

Commit

Permalink
feat: raise fd limit of the binary (paradigmxyz#668)
Browse files Browse the repository at this point in the history
* raise fd limit of the binary

* Remove tracing and return error

* Ignore errors
  • Loading branch information
TechieBoy committed Jan 1, 2023
1 parent 1f6a943 commit 2084784
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ tracing-futures = "0.2"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

# io
fdlimit = "0.2.1"
walkdir = "2.3"
serde = "1.0"
serde_json = "1.0"
Expand Down
5 changes: 5 additions & 0 deletions bin/reth/src/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use crate::{
util::chainspec::{chain_spec_value_parser, ChainSpecification, Genesis},
};
use clap::{crate_version, Parser};
use fdlimit::raise_fd_limit;
use reth_consensus::BeaconConsensus;
use reth_db::{
cursor::DbCursorRO,
Expand Down Expand Up @@ -85,6 +86,10 @@ impl Command {
/// Execute `node` command
// TODO: RPC
pub async fn execute(&self) -> eyre::Result<()> {
// Raise the fd limit of the process.
// Does not do anything on windows.
raise_fd_limit();

let config: Config = confy::load_path(&self.config).unwrap_or_default();
info!("reth {} starting", crate_version!());

Expand Down

0 comments on commit 2084784

Please sign in to comment.