Skip to content

Conversation

@dipkakwani
Copy link
Member

@dipkakwani dipkakwani commented Nov 6, 2025

Resolves NethermindEth/Surge#193

The existing implementation for L1SLOAD precompile takes L1 contract address, storage key and block number as input and outputs the storage value. For the provers to verify l1sload output, block number should always be set as anchor block id, therefore it is not required as an input to the precompile.

Changes

  • Remove block id from precompile input
  • Extract anchor block id from anchor transaction and cache it for L1 RPC
  • Add new tests for JsonRpcL1StorageProviderTests

Types of changes

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

Also tested locally:

curl -X POST http://localhost:8547   -H "Content-Type: application/json"   -d '{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [{
      "to": "0x0000000000000000000000000000000000010001",
      "data": "0x624ec8F33DA83707f360D6d25136AA0741713BC40000000000000000000000000000000000000000000000000000000000000000"
    }, "latest"],
    "id": 1
  }'
{"jsonrpc":"2.0","result":"0x0000000000000000000000000000000000000000000000000000000000000001","id":1}

Documentation

Requires documentation update

  • Yes
  • No

Requires explanation in Release Notes

  • Yes
  • No

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.

[Task]: Remove Block Id from L1SLOAD precompile (NMC, Reth)

2 participants