Skip to content

Conversation

@ARR4N
Copy link
Collaborator

@ARR4N ARR4N commented Sep 26, 2024

Why this should be merged

The existing params.RulesHooks.PrecompileOverride hook can cause the vm.ActivePrecompiles() return values to be incorrect such that access lists aren't pre-populated with precompile addresses. This new hook rectifies the problem.

How this works

The hook receives the default values that would otherwise be returned by vm.ActivePrecompiles() and returns an override. Unlike PrecompileOverride() there is no need to return a boolean override flag too as propagating the hook's return value is sufficient and a noop is merely an echo.

The ability to override all addresses is necessary because PrecompileOverride() can disable a precompile.

How this was tested

Integration test of vm.ActivePrecompiles() before and after registering a hook.

@ARR4N ARR4N marked this pull request as ready for review September 26, 2024 10:13
@ARR4N ARR4N requested review from a team, ceyonur, darioush and michaelkaplan13 and removed request for a team September 26, 2024 10:13
@ARR4N ARR4N merged commit f1dba53 into libevm Sep 26, 2024
3 checks passed
@ARR4N ARR4N deleted the arr4n/active-precompiles-hook branch September 26, 2024 14:36
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