Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Support for EIP 1898- Add blockHash to JSON-RPC methods which accept a default block parameter #973

Open
BlinkyStitt opened this issue May 15, 2020 · 1 comment

Comments

@BlinkyStitt
Copy link

  • I asked about this on gitter: [ ]

Expected Behavior

To keep compatability with geth, we should be able to eth_call (and a few other functions) with a block hash instead of just with a block number.

Current Behavior

   > {
   >   "id": 8,
   >   "jsonrpc": "2.0",
   >   "method": "eth_call",
   >   "params": [
   >     {
   >       "data": "0x6a0e839f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
   >       "to": "0xc67880e7504469ff5e2d5d72544b46c5c5c376b2"
   >     },
   >     {
   >       "blockHash": "0x4fe7ff2948ebb290e699961bd2429c80ed2a252ce1e530d38ae14a4e46decef6",
   >       "requireCanonical": true
   >     }
   >   ]
   > }
(node:24287) UnhandledPromiseRejectionWarning: Error: Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: 0x[object Object]
    at Object.t.toBuffer (/home/ski/.config/yarn/global/node_modules/ganache-cli/build/ganache-core.node.cli.js:2:125309)
    at Object.number (/home/ski/.config/yarn/global/node_modules/ganache-cli/build/ganache-core.node.cli.js:2:60422)
    at v.A.getEffectiveBlockNumber (/home/ski/.config/yarn/global/node_modules/ganache-cli/build/ganache-core.node.cli.js:17:117015)
    at v.isFallbackBlock (/home/ski/.config/yarn/global/node_modules/ganache-cli/build/ganache-core.node.cli.js:53:1410076)
    at v.getBlock (/home/ski/.config/yarn/global/node_modules/ganache-cli/build/ganache-core.node.cli.js:53:1411696)
    at v.A.getReadyCall (/home/ski/.config/yarn/global/node_modules/ganache-cli/build/ganache-core.node.cli.js:17:120760)
    at v.A.readyCall (/home/ski/.config/yarn/global/node_modules/ganache-cli/build/ganache-core.node.cli.js:17:120833)
    at v.A.processCall (/home/ski/.config/yarn/global/node_modules/ganache-cli/build/ganache-core.node.cli.js:17:121026)
    at i (/home/ski/.config/yarn/global/node_modules/ganache-cli/build/ganache-core.node.cli.js:37:208518)
    at c (/home/ski/.config/yarn/global/node_modules/ganache-cli/build/ganache-core.node.cli.js:37:212918)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:24287) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1031)

Context

https://eips.ethereum.org/EIPS/eip-1898 explains all the newly supported parameters.

Re-orgs are currently hard to handle since I can't specify the hash

Your Environment

  • Version used: Ganache CLI v6.9.1 (ganache-core: 2.10.2)
  • NodeJS Version: [ ] 6.x, [ ] 7.x (unsupported), [ ] 8.x, [ ] 9.x, [x] 12.16.1
  • I intend to submit a pull request to fix this issue: [ ]
@davidmurdoch davidmurdoch transferred this issue from trufflesuite/ganache-cli-archive Aug 19, 2021
@kevinbluer kevinbluer added this to the 7.1.0 milestone Sep 8, 2021
@kevinbluer
Copy link
Member

Hey @wysenynja, thanks for raising this! We've added to the backlog and will get to it soon 😀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Backlog
Development

No branches or pull requests

2 participants