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

Improve exex test setup #11527

Closed
mattsse opened this issue Oct 7, 2024 · 0 comments · Fixed by #11569
Closed

Improve exex test setup #11527

mattsse opened this issue Oct 7, 2024 · 0 comments · Fixed by #11569
Labels
A-exex Execution Extensions C-debt Refactor of code section that is hard to understand or maintain C-enhancement New feature or request C-test A change that impacts how or what we test D-good-first-issue Nice and easy! A great choice to get started

Comments

@mattsse
Copy link
Collaborator

mattsse commented Oct 7, 2024

Describe the feature

ref

pub async fn test_exex_context_with_chain_spec(
chain_spec: Arc<ChainSpec>,
) -> eyre::Result<(ExExContext<Adapter>, TestExExHandle)> {

this has some limitations:

  • the network always uses defaults

let network_manager = NetworkManager::new(
NetworkConfigBuilder::new(SecretKey::new(&mut rand::thread_rng()))
.build(provider_factory.clone()),
)
.await?;

but we use

config: NodeConfig::test(),

later the test setup uses random ports, so the network setup should also reflect that

see for ref

/// Get the [`NetworkConfigBuilder`].
pub fn network_config_builder(&self) -> eyre::Result<NetworkConfigBuilder> {
let secret_key = self.network_secret(&self.config().datadir())?;
let default_peers_path = self.config().datadir().known_peers();
let builder = self
.config()
.network
.network_config(
self.reth_config(),
self.config().chain.clone(),
secret_key,
default_peers_path,
)
.with_task_executor(Box::new(self.executor.clone()))
.set_head(self.head);

and

pub fn network_config(

there's an opportunity to simply fn network_config and introduce one function that doesn't need the additional inputs

cc @loocapro paradigmxyz/reth-exex-examples#26

Additional context

No response

@mattsse mattsse added C-enhancement New feature or request S-needs-triage This issue needs to be labelled labels Oct 7, 2024
@mattsse mattsse added D-good-first-issue Nice and easy! A great choice to get started C-debt Refactor of code section that is hard to understand or maintain C-test A change that impacts how or what we test and removed S-needs-triage This issue needs to be labelled labels Oct 7, 2024
@shekhirin shekhirin added the A-exex Execution Extensions label Oct 7, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Reth Tracker Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-exex Execution Extensions C-debt Refactor of code section that is hard to understand or maintain C-enhancement New feature or request C-test A change that impacts how or what we test D-good-first-issue Nice and easy! A great choice to get started
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants