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

Use Arc<ChainSpec> in SystemCaller #12264

Closed
mattsse opened this issue Nov 1, 2024 · 2 comments · Fixed by #12268
Closed

Use Arc<ChainSpec> in SystemCaller #12264

mattsse opened this issue Nov 1, 2024 · 2 comments · Fixed by #12268
Assignees
Labels
C-debt Refactor of code section that is hard to understand or maintain C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started

Comments

@mattsse
Copy link
Collaborator

mattsse commented Nov 1, 2024

Describe the feature

This must be an Arc<ChainSpec> so that we enforce cheap clones

chain_spec: Chainspec,

and can prevent this issue where we clone the arced type -.-

impl<DB, EvmConfig> EthExecutionStrategy<DB, EvmConfig>
where
EvmConfig: Clone,
{
/// Creates a new [`EthExecutionStrategy`]
pub fn new(state: State<DB>, chain_spec: Arc<ChainSpec>, evm_config: EvmConfig) -> Self {
let system_caller = SystemCaller::new(evm_config.clone(), (*chain_spec).clone());
Self { state, chain_spec, evm_config, system_caller }
}
}

Additional context

No response

@mattsse mattsse added C-enhancement New feature or request S-needs-triage This issue needs to be labelled labels Nov 1, 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 and removed S-needs-triage This issue needs to be labelled labels Nov 1, 2024
@stevencartavia
Copy link
Contributor

🙋🏽‍♂️

@mattsse
Copy link
Collaborator Author

mattsse commented Nov 1, 2024

cool, this has higher prio so prio this before others

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-debt Refactor of code section that is hard to understand or maintain C-enhancement New feature or request 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