Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

eth_getFilterChanges on Block Filter returns previous block on first poll #7816

Closed
dylanjw opened this issue Feb 5, 2018 · 0 comments
Closed
Labels
F2-bug 🐞 The client fails to follow expected behavior. M6-rpcapi 📣 RPC API. P5-sometimesoon 🌲 Issue is worth doing soon.
Milestone

Comments

@dylanjw
Copy link

dylanjw commented Feb 5, 2018

Before filing a new issue, please provide the following information.

I'm running:

  • Which Parity version?: Parity/v1.8.7-stable-e322fd8-20180124/x86_64-linux-gnu/rustc1.23.0
  • Which operating system?: Linux
  • How installed?: binaries
  • Are you fully synchronized?: no
  • Which network are you connected to?: ropsten
  • Did you try to restart the node?: yes

_Your issue description goes here below. Try to include actual vs. expected behavior and steps to reproduce the issue.

The first poll of a newly created block filter returns the last block. The expected behavior on first poll is to return only changes since the creation of the blockFilter.

The following example is with an unsynced parity node using the ropstein chain. The last block is the genesis block.

Checking the latest block:

curl --data '{"method":"eth_getBlockByNumber","params":["latest", false], "id":0,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
{
  "jsonrpc": "2.0",
  "result": {
    "author": "0x0000000000000000000000000000000000000000",
    "difficulty": "0x100000",
    "extraData": "0x3535353535353535353535353535353535353535353535353535353535353535",
    "gasLimit": "0x1000000",
    "gasUsed": "0x0",
    "hash": "0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d",
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "miner": "0x0000000000000000000000000000000000000000",
    "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "nonce": "0x0000000000000042",
    "number": "0x0",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "sealFields": [
      "0xa00000000000000000000000000000000000000000000000000000000000000000",
      "0x880000000000000042"
    ],
    "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    "size": "0x21c",
    "stateRoot": "0x217b0bbcfb72e2d57e28f33cb361b9983513177755dc3f33ce3e7022ed62b77b",
    "timestamp": "0x0",
    "totalDifficulty": "0x100000",
    "transactions": [],
    "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "uncles": []
  },
  "id": 0
}

Creation of the block filter:

curl --data '{"method":"eth_newBlockFilter","id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545                 
{"jsonrpc":"2.0","result":"0x0","id":1}

First poll with expected empty result. Instead it returns the hash of the genesis block present before filter creation.

curl --data '{"method":"eth_getFilterChanges","params":["0x0"], "id":2,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
{"jsonrpc":"2.0","result":["0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"],"id":2}

Subsequent polls are empty as expected:

 curl --data '{"method":"eth_getFilterChanges","params":["0x0"], "id":3,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545
{"jsonrpc":"2.0","result":[],"id":3}

This has been tested on a synced client as well, with similar results.

@5chdn 5chdn added F2-bug 🐞 The client fails to follow expected behavior. P5-sometimesoon 🌲 Issue is worth doing soon. M6-rpcapi 📣 RPC API. labels Feb 6, 2018
@5chdn 5chdn added this to the 1.10 milestone Feb 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F2-bug 🐞 The client fails to follow expected behavior. M6-rpcapi 📣 RPC API. P5-sometimesoon 🌲 Issue is worth doing soon.
Projects
None yet
Development

No branches or pull requests

2 participants