Skip to content

Conversation

@dimartiro
Copy link

Description

This PR introduces a forking-support feature flag that allows conditional compilation of the chain forking functionality. When enabled (which is the default), the crate uses the lazy loading backend that supports forking from remote chains by fetching state on-demand. When disabled, it falls back to the standard sc_service::new_db_backend, resulting in a lighter build that doesn't include the lazy loading infrastructure.

This separation is particularly useful during debugging sessions where the lazy loading backend is not needed, allowing developers to isolate and troubleshoot issues without the additional complexity of the remote state fetching layer

@iulianbarbu iulianbarbu self-requested a review January 29, 2026 08:30
Copy link

@re-gius re-gius left a comment

Choose a reason for hiding this comment

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

Avoid code duplication for new_client method. Apart from that, looks good to me

Ok((Arc::new(client), backend, keystore_container.keystore(), task_manager))
}

#[cfg(not(feature = "forking-support"))]
Copy link

Choose a reason for hiding this comment

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

You should avoid duplicating critical code in this case, so it's better to leave it as a single function new_client and use #[cfg(not(feature = "forking-support"))]/#[cfg(feature = "forking-support")] inside its body for the different execution flows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants