Skip to content

core: StateTransition refactoring #31669

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mralj
Copy link

@mralj mralj commented Apr 18, 2025

This PR refactors the state_transition file. This was to make it easier to maintain this code and bring future changes and updates. I'm deriving this from my experience working on rollup-geth and implementing various EIPs/RIPs such as EIP-7706

I tried to make this PR small so that it's easy to review and give feedback on whether you like these changes.
The general overview of the PR:

  1. There is a lot of gas handling logic, all of which has been moved to state_transition_gas.go
  2. I have extracted hardfork-specific stuff to separate functions, e.g., preCheckGasLondon. The benefit of this is that the logic is well contained, the caller functions are smaller, and it'll be easier to add new hardfork logic in the future
  3. Some functions could've been split even further, but I didn't want to overkill it 😅
  4. I haven't changed the flow of the logic, nor added any new features
  5. All tests pass

P.S.
I've opened the PR from personal fork instead from rollup-geth fork, as it was easier for me to do so.

added missing method comments
@mralj mralj requested a review from rjl493456442 as a code owner April 18, 2025 07:28
@fjl fjl changed the title state_transition refactor core: StateTransition refactoring Apr 24, 2025
@fjl fjl self-assigned this Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants