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: add TreeConfig #9833

Merged

Conversation

fgimenez
Copy link
Member

@fgimenez fgimenez commented Jul 26, 2024

Closes #9821

The configuration is done at the launcher level (which adds a new dep to reth-ethereum-node), we could do it at the service level too, let me know wdyt

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

one suggestion

and we can re-export that type from etherem-engine like we did with other types already

pub use reth_engine_tree::{
chain::{ChainEvent, ChainOrchestrator},
engine::EngineApiEvent,
};

Comment on lines 56 to 62
/// Engine tree configuration builder.
#[derive(Debug, Default)]
pub struct TreeConfigBuilder {
persistence_threshold: Option<u64>,
block_buffer_limit: Option<u32>,
max_invalid_header_cache_length: Option<u32>,
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the builder type is redundant here if we move the with setters to Treeconfig directly so you can configure it like TreeConfig::default().with_().with()

Copy link
Member Author

Choose a reason for hiding this comment

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

makes sense, done

Comment on lines -52 to -58
/// Maximum number of blocks to be kept only in memory without triggering persistence.
const PERSISTENCE_THRESHOLD: u64 = 256;
/// Number of pending blocks that cannot be executed due to missing parent and
/// are kept in cache.
const DEFAULT_BLOCK_BUFFER_LIMIT: u32 = 256;
/// Number of invalid headers to keep in cache.
const DEFAULT_MAX_INVALID_HEADER_CACHE_LENGTH: u32 = 256;
Copy link
Collaborator

Choose a reason for hiding this comment

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

lets keep the constants but move to config

@mattsse mattsse added the C-enhancement New feature or request label Jul 26, 2024
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

very nice

@fgimenez fgimenez added this pull request to the merge queue Jul 26, 2024
Merged via the queue into paradigmxyz:main with commit 77f5ed1 Jul 26, 2024
33 checks passed
@fgimenez fgimenez deleted the fgimenez/configurable-tree-settings branch July 26, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make tree settings configurable
2 participants