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

fix(cli): set receipts pruning for chain without deposit contract #9782

Merged
merged 5 commits into from
Jul 25, 2024

Conversation

emhane
Copy link
Member

@emhane emhane commented Jul 24, 2024

  • Sets receipts prune mode to PruneMode::Full, for chains that don't have deposit contract in ChainSpec

@emhane emhane added C-bug An unexpected or incorrect behavior A-cli Related to the reth CLI A-op-reth Related to Optimism and op-reth labels Jul 24, 2024
crates/node/core/src/args/pruning.rs Show resolved Hide resolved
Comment on lines 342 to 345
let config = self.node_config().prune_config();
if config.is_some() {
return config
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this an unrelated fix attempt that ranks cli settings higher than what's in the toml?

I don't think we need to do this because we update the toml settings

/// Save prune config to the toml file if node is a full node.
fn save_pruning_config_if_full_node(
reth_config: &mut reth_config::Config,
config: &NodeConfig,
config_path: impl AsRef<std::path::Path>,
) -> eyre::Result<()> {

Copy link
Member Author

Choose a reason for hiding this comment

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

not unrelated, blocks syncing op mainnet full node. see docs for PruningArgs flags.

Copy link
Collaborator

Choose a reason for hiding this comment

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

this will ignore all toml settings which I think is incorrect because this always falls back to the default args if run with --full, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah but that's the usual behaviour for any linux tool: cli args have precedence over files. and we have shipped this help for cli --full flag since at least January

/// Run full node. Only the most recent [`MINIMUM_PRUNING_DISTANCE`] block states are stored.
/// This flag takes priority over pruning configuration in reth.toml.
#[arg(long, default_value_t = false)]
pub full: bool,

@emhane emhane requested a review from mattsse July 25, 2024 11:55
Comment on lines 342 to 345
let config = self.node_config().prune_config();
if config.is_some() {
return config
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

please undo then this is g2m

@emhane emhane requested a review from mattsse July 25, 2024 16:15
@emhane emhane changed the title fix(cli): enable receipts pruning for chain without deposit contract fix(cli): set receipts pruning for chain without deposit contract Jul 25, 2024
@mattsse mattsse added this pull request to the merge queue Jul 25, 2024
Merged via the queue into main with commit f175f6e Jul 25, 2024
32 checks passed
@mattsse mattsse deleted the emhane/op-full-node branch July 25, 2024 17:33
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-op-reth Related to Optimism and op-reth C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants