Skip to content

Update eth_getStorageAt docs with whitelisted storage slots#588

Merged
ptrus merged 1 commit intomainfrom
ptrus/feature/getstorageat-whitelist
Aug 26, 2025
Merged

Update eth_getStorageAt docs with whitelisted storage slots#588
ptrus merged 1 commit intomainfrom
ptrus/feature/getstorageat-whitelist

Conversation

@ptrus
Copy link
Copy Markdown
Member

@ptrus ptrus commented May 23, 2025

Merge once Sapphire with oasisprotocol/oasis-sdk#2215 is live.

@netlify
Copy link
Copy Markdown

netlify bot commented May 23, 2025

Deploy Preview for oasisprotocol-sapphire-paratime ready!

Name Link
🔨 Latest commit 9d24e21
🔍 Latest deploy log https://app.netlify.com/projects/oasisprotocol-sapphire-paratime/deploys/68ad619381247e00080dc35a
😎 Deploy Preview https://deploy-preview-588--oasisprotocol-sapphire-paratime.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@rube-de
Copy link
Copy Markdown
Contributor

rube-de commented May 23, 2025

I was about to update the hyperlane docs, to no use the branch pb/storage-workaround and make the custom modifications on top of the current main branch.
But if we have the magic slots, we can update the hyperlane docs to use the CLI as normal.

Let me add it to this branch.
Edit: sorry OPL is in Docs, added here oasisprotocol/docs#1264

@ptrus
Copy link
Copy Markdown
Member Author

ptrus commented Jul 15, 2025

This should now finally be live on testnet. Can someone try it out? @rube-de ?

@rube-de
Copy link
Copy Markdown
Contributor

rube-de commented Jul 18, 2025

I tried it with the unchanged Hyperlane CLI to the deploy the core contracts, which uses eth_getStorageAt for the implementation slot
0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc
https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/2fe58b3be76295c2ca1e72387316cc9e7d0c51e3/typescript/sdk/src/deploy/proxy.ts#L29

it fails with

Deploying mailbox on sapphiretestnet with constructor args (23295)...
Pending https://explorer.oasis.io/testnet/sapphire/tx/0x54530e469e54e98eb04a8ea69749a0c8810698b6ecb64fedd043059e2dfb5706 (waiting 1 blocks for confirmation)
Error: bad result from backend (method="getStorageAt", params={"address":"0x0372e0D5e6357Bc9462216059183Da1FAcfBAcaf","blockTag":"latest","position":"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103"}, result="0x0", error={"reason":"hex data is odd-length","code":"INVALID_ARGUMENT","argument":"value","value":"0x0"}, code=SERVER_ERROR, version=providers/5.8.0)
    at Logger.makeError (file:///Users/work/.nvm/versions/node/v22.14.0/lib/node_modules/@hyperlane-xyz/cli/cli-bundle/index.js:332426:21)
    at Logger.throwError (file:///Users/work/.nvm/versions/node/v22.14.0/lib/node_modules/@hyperlane-xyz/cli/cli-bundle/index.js:332435:20)
    at HyperlaneSmartProvider.<anonymous> (file:///Users/work/.nvm/versions/node/v22.14.0/lib/node_modules/@hyperlane-xyz/cli/cli-bundle/index.js:334625:58)
    at step (file:///Users/work/.nvm/versions/node/v22.14.0/lib/node_modules/@hyperlane-xyz/cli/cli-bundle/index.js:333034:23)
    at Object.next (file:///Users/work/.nvm/versions/node/v22.14.0/lib/node_modules/@hyperlane-xyz/cli/cli-bundle/index.js:333015:53)
    at fulfilled (file:///Users/work/.nvm/versions/node/v22.14.0/lib/node_modules/@hyperlane-xyz/cli/cli-bundle/index.js:333006:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  reason: 'bad result from backend',
  code: 'SERVER_ERROR',
  method: 'getStorageAt',
  params: {
    address: '0x0372e0D5e6357Bc9462216059183Da1FAcfBAcaf',
    blockTag: 'latest',
    position: '0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103'
  },
  result: '0x0',
  error: Error: hex data is odd-length (argument="value", value="0x0", code=INVALID_ARGUMENT, version=bytes/5.8.0)
      at Logger.makeError (file:///Users/work/.nvm/versions/node/v22.14.0/lib/node_modules/@hyperlane-xyz/cli/cli-bundle/index.js:332426:21)
      at Logger.throwError (file:///Users/work/.nvm/versions/node/v22.14.0/lib/node_modules/@hyperlane-xyz/cli/cli-bundle/index.js:332435:20)
      at Logger.throwArgumentError (file:///Users/work/.nvm/versions/node/v22.14.0/lib/node_modules/@hyperlane-xyz/cli/cli-bundle/index.js:332438:21)
      at hexlify (file:///Users/work/.nvm/versions/node/v22.14.0/lib/node_modules/@hyperlane-xyz/cli/cli-bundle/index.js:329469:24)
      at HyperlaneSmartProvider.<anonymous> (file:///Users/work/.nvm/versions/node/v22.14.0/lib/node_modules/@hyperlane-xyz/cli/cli-bundle/index.js:334622:71)
      at step (file:///Users/work/.nvm/versions/node/v22.14.0/lib/node_modules/@hyperlane-xyz/cli/cli-bundle/index.js:333034:23)
      at Object.next (file:///Users/work/.nvm/versions/node/v22.14.0/lib/node_modules/@hyperlane-xyz/cli/cli-bundle/index.js:333015:53)
      at fulfilled (file:///Users/work/.nvm/versions/node/v22.14.0/lib/node_modules/@hyperlane-xyz/cli/cli-bundle/index.js:333006:58)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
    reason: 'hex data is odd-length',
    code: 'INVALID_ARGUMENT',
    argument: 'value',
    value: '0x0'
  }
}

@ptrus
Copy link
Copy Markdown
Member Author

ptrus commented Jul 18, 2025

Is that on testnet? Because I just tested getStorageAt on testnet (on my test contract) and it works:

 curl -s -H 'Content-Type: application/json' \
  -d '{
    "jsonrpc": "2.0",
    "id": "0x1",
    "method": "eth_getStorageAt",
    "params": [
      "0x167b24eBDE47EC971ed84D656D3375705044B9E0",
      "0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103",
      "latest"
    ]
  }' https://testnet.sapphire.oasis.io/

{"jsonrpc":"2.0","id":"0x1","result":"0x1111111111111111111111111111111111111111"}

@ptrus
Copy link
Copy Markdown
Member Author

ptrus commented Jul 18, 2025

But for address: '0x0372e0D5e6357Bc9462216059183Da1FAcfBAcaf' indeed, an empty value is returned.

curl -s -H 'Content-Type: application/json' \
  -d '{
    "jsonrpc": "2.0",
    "id": "0x1",
    "method": "eth_getStorageAt",
    "params": [
      "0x0372e0D5e6357Bc9462216059183Da1FAcfBAcaf",
      "0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103",
      "latest"
    ]
  }' https://testnet.sapphire.oasis.io/

{"jsonrpc":"2.0","id":"0x1","result":"0x0"}

oh maybe it expects a different value when empty? (e.g. maybe not stripped, but 0x0000...). I remember such cases in past with some apps.

@ptrus ptrus force-pushed the ptrus/feature/getstorageat-whitelist branch from 1d30078 to 7f3f586 Compare July 25, 2025 11:54
@ptrus
Copy link
Copy Markdown
Member Author

ptrus commented Jul 28, 2025

@rube-de can you please retry this? The testnet gateways were just updated to now return non-stripped zero values which is more standard and compatible with various clients (oasisprotocol/oasis-web3-gateway#595).

curl -s -H 'Content-Type: application/json' \
  -d '{
    "jsonrpc": "2.0",
    "id": "0x1",
    "method": "eth_getStorageAt",
    "params": [
      "0x0372e0D5e6357Bc9462216059183Da1FAcfBAcaf",
      "0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103",
      "latest"
    ]
  }' https://testnet.sapphire.oasis.io/

{"jsonrpc":"2.0","id":"0x1","result":"0x0000000000000000000000000000000000000000000000000000000000000000"}

This should fix the error you posted above:

result: '0x0',
error: Error: hex data is odd-length

@rube-de
Copy link
Copy Markdown
Contributor

rube-de commented Jul 28, 2025

I ran again hyperlane core deploy, it seem to work now

✅ Core contract deployments complete:

    staticMerkleRootMultisigIsmFactory: "0x5069856e9430FC0b8dF5a5156515F74a7a5A0533"
    staticMessageIdMultisigIsmFactory: "0x8A24fee90E089A68ac76DEa8BDE91b55f6a20886"
    staticAggregationIsmFactory: "0x98D35c10AB64Ac69F3F1e870A9d6cA3CC98E8f31"
    staticAggregationHookFactory: "0x6A0fbDD8b547E0E64d0364Cf2E374aaacB3A3fF4"
    domainRoutingIsmFactory: "0xEDEef8a6610dB576d603f0a858795BDf44dB6260"
    staticMerkleRootWeightedMultisigIsmFactory: "0xff252937A3f5a22Dff1d6643408309C3A87493B3"
    staticMessageIdWeightedMultisigIsmFactory: "0x63136dA0057C32611e2a94d1B9A6B05fc382e8eE"
    proxyAdmin: "0xCFE163914f58d16e6Faf5aD3635E791BB302F5c8"
    mailbox: "0x8628fd175B92e62d9164f2fE2E764d599C2db6e8"
    interchainAccountRouter: "0x5be53726403F88E49fb9718401C47A4dAb4D4124"
    validatorAnnounce: "0x47F4A2a13A1Ee3b4E76a3BbAcD7eBc2bb2D240B8"
    testRecipient: "0xA130c7C01B9dc096aD0E045526a6637B3320eC7f"
    merkleTreeHook: "0x74bB5a5F20438964E0c48260DF01fD9D9c233B48"

@ptrus
Copy link
Copy Markdown
Member Author

ptrus commented Jul 29, 2025

Nice! Let's wait for the next Sapphire Mainnet release, then we can merge the updates.

@ptrus
Copy link
Copy Markdown
Member Author

ptrus commented Aug 26, 2025

This should also be live on mainnet now, so let's merge it.

@ptrus ptrus requested a review from rube-de August 26, 2025 07:24
@ptrus ptrus force-pushed the ptrus/feature/getstorageat-whitelist branch from 7f3f586 to 9d24e21 Compare August 26, 2025 07:26
@ptrus ptrus merged commit 894a14b into main Aug 26, 2025
21 of 23 checks passed
@ptrus ptrus deleted the ptrus/feature/getstorageat-whitelist branch August 26, 2025 13:23
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.

2 participants