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

Make tree settings configurable #9821

Closed
Tracked by #8742
mattsse opened this issue Jul 25, 2024 · 0 comments · Fixed by #9833
Closed
Tracked by #8742

Make tree settings configurable #9821

mattsse opened this issue Jul 25, 2024 · 0 comments · Fixed by #9833
Assignees
Labels
C-enhancement New feature or request

Comments

@mattsse
Copy link
Collaborator

mattsse commented Jul 25, 2024

currently we rely on constants for certain tree settings

/// 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;

it would be useful to have a way to configure these easily, we already have a way to configure certain values:

block_buffer_limit: u32,
max_invalid_header_cache_length: u32,

let state = EngineApiTreeState::new(
DEFAULT_BLOCK_BUFFER_LIMIT,
DEFAULT_MAX_INVALID_HEADER_CACHE_LENGTH,

TODO

  • introduce a treeconfig type that has these as fields, and defaults are the constants
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
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants