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

feat(bin): node --full flag #3965

Merged
merged 9 commits into from
Jul 31, 2023
Merged

feat(bin): node --full flag #3965

merged 9 commits into from
Jul 31, 2023

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Jul 27, 2023

Resolves #3960

Adds a flag that enables a full node pruning configuration. It takes precedence over pruning configured via reth.toml.

The rationale behind chosen values:

  1. 128 blocks is the number from Geth full node: https://geth.ethereum.org/docs/fundamentals/sync-modes#full-sync.
  2. transaction_lookup: None is required to be able to serve eth_getTransactionByHash and similar RPCs which require tx_hash -> tx_number mapping.
  3. receipts: Some(PruneMode::Before(11052984)) is required for CL to be able to reconstruct the deposits cache. The beacon deposit contract was deployed on this block: https://etherscan.io/tx/0xe75fb554e433e03763a1560646ee22dcb74e5274b34c5ad644e7c0f619a7e1d0.

The flag is hidden from --help until we're ready for production use:

reth (alexey/node-full-flag) cargo run --quiet -- node --help | rg fullreth (alexey/node-full-flag)

@shekhirin shekhirin added A-cli Related to the reth CLI A-pruning Related to pruning or full node labels Jul 27, 2023
@shekhirin shekhirin marked this pull request as ready for review July 27, 2023 16:01
@shekhirin shekhirin requested a review from onbjerg as a code owner July 27, 2023 16:01
@shekhirin shekhirin requested a review from joshieDo July 27, 2023 16:01
@codecov
Copy link

codecov bot commented Jul 27, 2023

Codecov Report

Merging #3965 (9ccc2e9) into main (dee14c7) will decrease coverage by 0.05%.
The diff coverage is 36.84%.

Impacted file tree graph

Files Changed Coverage Δ
bin/reth/src/node/mod.rs 12.06% <0.00%> (-0.12%) ⬇️
crates/rpc/rpc-builder/src/lib.rs 64.15% <0.00%> (ø)
bin/reth/src/args/pruning_args.rs 11.76% <11.76%> (ø)
bin/reth/src/init.rs 97.20% <100.00%> (+0.01%) ⬆️
crates/primitives/src/chain/spec.rs 96.42% <100.00%> (+0.02%) ⬆️
crates/primitives/src/hardfork.rs 100.00% <100.00%> (ø)

... and 11 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.23% <7.89%> (-0.03%) ⬇️
unit-tests 64.13% <36.84%> (-0.05%) ⬇️

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

Components Coverage Δ
reth binary 25.63% <11.53%> (-0.07%) ⬇️
blockchain tree 83.04% <ø> (ø)
pipeline 90.03% <ø> (ø)
storage (db) 74.30% <ø> (ø)
trie 94.70% <ø> (ø)
txpool 45.40% <ø> (-0.61%) ⬇️
networking 77.54% <ø> (+0.03%) ⬆️
rpc 58.34% <0.00%> (-0.02%) ⬇️
consensus 63.51% <ø> (ø)
revm 33.10% <ø> (ø)
payload builder 6.58% <ø> (ø)
primitives 88.03% <100.00%> (-0.03%) ⬇️

Comment on lines 27 to 29
// Beacon Deposit Contract deployment block
// https://etherscan.io/tx/0xe75fb554e433e03763a1560646ee22dcb74e5274b34c5ad644e7c0f619a7e1d0
receipts: Some(PruneMode::Before(11052984)),
Copy link
Member

Choose a reason for hiding this comment

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

Would add a note here that this is mainnet specific, so this does not work on Sepolia. Thinking about it a bit more - we should either make this handle all our known networks (incl. Sepolia), or (for now) block it so --full only works on mainnet. Wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

Mainnet: 11052984
Goerli: 4367322
Sepolia: 1273020
Gnosis: 19469077
Holesky: 1 probably, don't prune receipts at all

@onbjerg onbjerg added the M-changelog This change should be included in the changelog label Jul 31, 2023
@shekhirin shekhirin requested a review from gakonst as a code owner July 31, 2023 14:41
@onbjerg onbjerg enabled auto-merge July 31, 2023 15:53
@onbjerg onbjerg added this pull request to the merge queue Jul 31, 2023
Merged via the queue into main with commit 9a7911b Jul 31, 2023
24 checks passed
@onbjerg onbjerg deleted the alexey/node-full-flag branch July 31, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Related to the reth CLI A-pruning Related to pruning or full node M-changelog This change should be included in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Node --full flag for full node pruning
3 participants