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

Upstream support for deposit transactions to anvil #1

Open
mdehoog opened this issue Sep 20, 2023 · 3 comments
Open

Upstream support for deposit transactions to anvil #1

mdehoog opened this issue Sep 20, 2023 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@mdehoog
Copy link
Owner

mdehoog commented Sep 20, 2023

anvil currently does not support the op-stack's deposit transaction.

This has resulted in a workaround in this codebase:

  • read deposit transactions from the payload passed to the engine API from op-node
  • use anvil_setBalance to increase the balance, according to the deposit tx's mint value
  • use anvil_impersonateAccount + eth_sendTransaction to send the deposit transaction as a legacy tx in anvil

op-node also expects deposit transactions to be returned on the RPC, so we also:

  • rewrite any requests that include the deposit tx hash, and replace them with the hash of the legacy tx we created
  • rewrite any responses that include the legacy tx, and replace them with the deposit tx

This is hacky and flaky. The ideal path is to upstream support for op-stack deposit transactions in anvil itself (probably behind a flag). This would mean we submit deposit txs directly to anvil, and remove the request / response rewriting.

@mdehoog mdehoog added enhancement New feature or request help wanted Extra attention is needed labels Sep 20, 2023
@roninjin10
Copy link

Since this got posted on twitter, note this is happening via op-reth already. No need to duplicate work here

@mdehoog
Copy link
Owner Author

mdehoog commented Oct 3, 2023

@roninjin10
Copy link

ethereum-optimism#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants