Skip to content

Conversation

zerosnacks
Copy link
Member

@zerosnacks zerosnacks commented Sep 9, 2025

Motivation

In order to make it easier to figure out the supported precompiles and system contracts as a user I think it makes sense to add an eth_config-like RPC method: https://eips.ethereum.org/EIPS/eip-7910

Closes: #11433

This completes the work required to make Foundry ready for Osaka.

Closes: #11428

Solution

Adds eth_config-like endpoint inspired by the actual eth_config specification with notable exceptions:

Spec compliant:

  • Note: the activation timestamp is always 0 as the configuration is set at moment of forking.
  • Note: the next and last fields are always null as this node does not participate in any forking on the network.

Not spec compliant:

The fork_id is always 0x00000000 as this node does not participate in any forking on the network. For all intended purposes you can consider this unused by Anvil.

Another thing that may be confusing to people is that we currently do not explicitly support all effects of system contracts yet, notably: #10357

Example output:

cast rpc eth_config
{
   "current":{
      "activationTime":0,
      "blobSchedule":{
         "baseFeeUpdateFraction":5007716,
         "max":9,
         "target":6
      },
      "chainId":"0x7a69",
      "forkId":"0x00000000",
      "precompiles":{
         "BLAKE2F":"0x0000000000000000000000000000000000000009",
         "BLS12_G1ADD":"0x000000000000000000000000000000000000000b",
         "BLS12_G1MSM":"0x000000000000000000000000000000000000000c",
         "BLS12_G2ADD":"0x000000000000000000000000000000000000000d",
         "BLS12_G2MSM":"0x000000000000000000000000000000000000000e",
         "BLS12_MAP_FP2_TO_G2":"0x0000000000000000000000000000000000000011",
         "BLS12_MAP_FP_TO_G1":"0x0000000000000000000000000000000000000010",
         "BLS12_PAIRING_CHECK":"0x000000000000000000000000000000000000000f",
         "BN254_ADD":"0x0000000000000000000000000000000000000006",
         "BN254_MUL":"0x0000000000000000000000000000000000000007",
         "BN254_PAIRING":"0x0000000000000000000000000000000000000008",
         "ECREC":"0x0000000000000000000000000000000000000001",
         "ID":"0x0000000000000000000000000000000000000004",
         "KZG_POINT_EVALUATION":"0x000000000000000000000000000000000000000a",
         "MODEXP":"0x0000000000000000000000000000000000000005",
         "RIPEMD160":"0x0000000000000000000000000000000000000003",
         "SHA256":"0x0000000000000000000000000000000000000002"
      },
      "systemContracts":{
         "BEACON_ROOTS_ADDRESS":"0x000f3df6d732807ef1319fb7b8bb8522d0beac02",
         "CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS":"0x0000bbddc7ce488642fb579f8b00f3a590007251",
         "DEPOSIT_CONTRACT_ADDRESS":"0x00000000219ab540356cbb839cbe05303d7705fa",
         "HISTORY_STORAGE_ADDRESS":"0x0000f90827f1c53a10cb7a02335b175320002935",
         "WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS":"0x00000961ef480eb55e80d19ad83579a64c007002"
      }
   },
   "next":null,
   "last":null
}

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@zerosnacks zerosnacks moved this to Ready For Review in Foundry Sep 9, 2025
@zerosnacks zerosnacks marked this pull request as ready for review September 9, 2025 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready For Review
Development

Successfully merging this pull request may close these issues.

feat(anvil): add eth_config RPC endpoint for Osaka hardfork meta: make Foundry ready for Fusaka
1 participant