Skip to content

Conversation

@ARR4N
Copy link
Collaborator

@ARR4N ARR4N commented Jul 22, 2025

Why this should be merged

ava-labs/coreth has a partitioned state-address space, achieved by setting or clearing a specific bit in the hash used to key the space. This change allows such behaviour to be achieved with pure libevm instead of the StateDB wrapping that coreth currently uses.

How this works

Introduction of state.StateDBHooks interface, including a TransformStateKey() method that allows for arbitrary change of state key. If registered, this hook will be honoured by StateDB.{Get,GetCommitted,State}Key() methods unless they receive a stateconf.SkipStateKeyTransformation option.

How this was tested

Unit test of SetState() -> GetState() + GetCommittedState() round trip with and without options to skip.

@ARR4N ARR4N marked this pull request as ready for review July 22, 2025 02:43
@ARR4N ARR4N requested a review from StephenButtolph July 22, 2025 02:43
@ARR4N ARR4N requested a review from a team July 22, 2025 02:45
@StephenButtolph StephenButtolph merged commit 464de82 into main Jul 22, 2025
12 checks passed
@StephenButtolph StephenButtolph deleted the arr4n/state-hash-override branch July 22, 2025 17:08
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