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

docs: config chapter #3173

Merged
merged 6 commits into from
Jun 19, 2023
Merged

docs: config chapter #3173

merged 6 commits into from
Jun 19, 2023

Conversation

onbjerg
Copy link
Member

@onbjerg onbjerg commented Jun 15, 2023

Adds a reference on how to configure reth using reth.toml, as well as describing some of the tradeoffs of increasing/decreasing values.

@onbjerg onbjerg added C-docs An addition or correction to our documentation C-enhancement New feature or request labels Jun 15, 2023
@onbjerg
Copy link
Member Author

onbjerg commented Jun 15, 2023

cc @mattsse

  • what is the threshold for when peers are banned? in reference to [peers.reputation_weights]
  • what is peers.refill_slots_interval
  • when do we use low/medium/high/max for peer backoffs?
  • what is the diff between the session command and event buffer? command are from us, events are from them?

@codecov
Copy link

codecov bot commented Jun 15, 2023

Codecov Report

Merging #3173 (1df3745) into main (a967996) will increase coverage by 0.08%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #3173      +/-   ##
==========================================
+ Coverage   69.74%   69.83%   +0.08%     
==========================================
  Files         527      530       +3     
  Lines       70208    71387    +1179     
==========================================
+ Hits        48970    49853     +883     
- Misses      21238    21534     +296     
Flag Coverage Δ
integration-tests 16.40% <ø> (-0.19%) ⬇️
unit-tests 64.85% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 87 files with indirect coverage changes

Copy link
Collaborator

@shekhirin shekhirin left a comment

Choose a reason for hiding this comment

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

good stuff

book/run/config.md Outdated Show resolved Hide resolved
### `total_difficulty`

The total difficulty stage calculates the total difficulty reached for each header in the chain.
Copy link
Collaborator

Choose a reason for hiding this comment

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

worth mentioning it also validates the TD according to consensus rules?

Reth places a configuration file named `reth.toml` in the data directory specified when starting the node. It is written in the [TOML] format.

The default data directory is platform dependent and can be found by running `reth node --help`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe put same lines here, so you wouldn't need to run the CLI or go elsewhere in the book to find the config?

reth/book/cli/init.md

Lines 9 to 16 in 017c9ce

--datadir <DATA_DIR>
The path to the data dir for all reth files and subdirectories.
Defaults to the OS-specific data directory:
- Linux: `$XDG_DATA_HOME/reth/` or `$HOME/.local/share/reth/`
- Windows: `{FOLDERID_RoamingAppData}/reth/`
- macOS: `$HOME/Library/Application Support/reth/`

@mattsse
Copy link
Collaborator

mattsse commented Jun 19, 2023

what is the threshold for when peers are banned? in reference to [peers.reputation_weights]

all peers start out with 0 reputation and earn reputation over time (simple reward for how long they're connected) but lose reputation on certain errors that are categorized in units via weights. The weights convert error variants into the reputation value via: weight * units

/// The default reputation of a peer
pub(crate) const DEFAULT_REPUTATION: Reputation = 0;
/// The minimal unit we're measuring reputation
const REPUTATION_UNIT: i32 = -1024;

if a peer drops below the BANNED_REPUTATION for example too many disconnects, we ban it (temp or perma, perma for protocol violations)

what is peers.refill_slots_interval

This is a chosen interval at which we try to fill outgoing connections slots by initiating outgoing connections to available peers

when do we use low/medium/high/max for peer backoffs?

This depends on the error kind: ptal at this impl:

fn should_backoff(&self) -> Option<BackoffKind> {

we convert the error to BackoffKind::{Low,Medium,High}

what is the diff between the session command and event buffer? command are from us, events are from them?

session command buffer is the channel size from the manager (producer) TO the active session (consumer)
event buffer is the channel size of the channel that all sessions (producer) share with the manager (consumer)

@onbjerg onbjerg marked this pull request as ready for review June 19, 2023 17:31
@onbjerg onbjerg requested a review from gakonst as a code owner June 19, 2023 17:31
@onbjerg onbjerg requested a review from shekhirin June 19, 2023 17:32
book/run/config.md Outdated Show resolved Hide resolved
@onbjerg onbjerg requested a review from shekhirin June 19, 2023 17:56
Copy link
Collaborator

@shekhirin shekhirin left a comment

Choose a reason for hiding this comment

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

LGTM

@onbjerg onbjerg enabled auto-merge June 19, 2023 18:03
@onbjerg onbjerg added this pull request to the merge queue Jun 19, 2023
Merged via the queue into main with commit c702efb Jun 19, 2023
@onbjerg onbjerg deleted the onbjerg/book-config branch June 19, 2023 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-docs An addition or correction to our documentation C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants