Skip to content

Fix infinite recursion in EthPrecompiles PrecompileProvider methods#2962

Merged
rakita merged 2 commits intobluealloy:mainfrom
sashaodessa:main
Sep 12, 2025
Merged

Fix infinite recursion in EthPrecompiles PrecompileProvider methods#2962
rakita merged 2 commits intobluealloy:mainfrom
sashaodessa:main

Conversation

@sashaodessa
Copy link
Contributor

Description

  • What: Replace self-recursive implementations of warm_addresses and contains with proper delegation to precompiles.
  • Where: crates/handler/src/precompile_provider.rs
  • Why: Self-recursion caused a potential stack overflow at runtime and made the methods non-functional.

Changes

  • warm_addresses now returns Box::new(self.precompiles.addresses().cloned()).
  • contains now calls self.precompiles.contains(address).

Impact

  • Eliminates stack overflow risk and restores correct precompile lookups.
  • No behavior change beyond fixing the bug; public API remains the same.

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 11, 2025

CodSpeed Performance Report

Merging #2962 will not alter performance

Comparing sashaodessa:main (af36f5a) with main (66e4593)

Summary

✅ 173 untouched

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.

this should use fully qualified syntax instead Self::<>(self, ..)

@sashaodessa
Copy link
Contributor Author

@mattsse merge?

@rakita rakita merged commit fe8d4be into bluealloy:main Sep 12, 2025
31 checks passed
@github-actions github-actions bot mentioned this pull request Sep 12, 2025
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.

3 participants