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

Add custom registered precompiles to the active precompile list #21

Merged
merged 2 commits into from
Apr 18, 2024

Conversation

nddeluca
Copy link
Member

@nddeluca nddeluca commented Apr 18, 2024

This update ensures that all registered custom precompiles that can be called from the state machine are returned in the active list.

Resolves #20

precompiles = PrecompiledAddressesHomestead
}

// TODO: Consider performance improvements here to prevent iteration & allocations on every call.
Copy link
Member Author

Choose a reason for hiding this comment

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

Tracking at #22

@@ -151,19 +152,29 @@ func init() {
}

// ActivePrecompiles returns the precompiles enabled with the current configuration.
func ActivePrecompiles(rules params.Rules) []common.Address {
func ActivePrecompiles(rules params.Rules) (precompiles []common.Address) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Added #23 to track duplicated logic between this file and extended_contracts.go

@nddeluca nddeluca merged commit 031b717 into master Apr 18, 2024
6 checks passed
@nddeluca nddeluca deleted the nd-add-custom-precompiles-to-active-list branch April 18, 2024 17:13
mergify bot pushed a commit that referenced this pull request Apr 18, 2024
* fix: Ensure that registered custom precompiles are returned in the
active precompile list

* add todo to track dynamic registration vs forcing an init order

(cherry picked from commit 031b717)

# Conflicts:
#	core/vm/contracts.go
nddeluca added a commit that referenced this pull request Apr 30, 2024
nddeluca added a commit that referenced this pull request May 1, 2024
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.

ActivePrecompiles do not return registered precompiles
2 participants