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

[wip] ArbSys precompile support #7754

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Apr 22, 2024

Motivation

Draft PR implementing support for chain-specific precompiles

Solution

  1. Add DatabaseExt::get_block_number method handling NUMBER opcode invocations. Currently it overrides it via l1BlockNumber if we are on arbitrum network.
  2. Add ArbSys precompile impl (currently only arbBlockNumber method).
  3. Keep track of precompiles for each fork via ForkSpecificPrecompiles which injects and removes precompiles on fork switches.

Impl is not ideal as we'd have to duplicate logic for other chains. This can be made better by only using Ordinary precompiles which do not require DB generic and thus it will be possible to put custom network logic into some kind of object-safe trait which can be then stored on Fork

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.

None yet

1 participant