vechain / web3-gear

Proxy Thor's RESTful API to Eth JSON-RPC, to support Remix, Truffle and more.
MIT License
30 stars 17 forks source link

Duplicate filter changes #6

Closed plainerman closed 6 years ago

plainerman commented 6 years ago

I have only verified this for blockFilter as of now but this issue may be present in all filters.

When fetching the changes from a filter (eth_getFilterChanges) multiple times, it should only show the changes once. As of now, the filter change always includes one additional change (that repeats over several requests).

Requesting the filter changes twice (assuming no block has been found in-between) should return the following:

{
    "result": [
        "0x0001cca0a0ddc5bcf6207b8e1105190cb9b12020147cc833c849a2dac1300235",
        "0x0001cca19cda8c371faac5c59794b6bea7ebd78b5631828ca72b937722868378"
    ]
}
{
    "result": []
}

With the current implementation, the latest hash is persistently sent.

{
    "result": [
        "0x0001cca0a0ddc5bcf6207b8e1105190cb9b12020147cc833c849a2dac1300235",
        "0x0001cca19cda8c371faac5c59794b6bea7ebd78b5631828ca72b937722868378"
    ]
}
{
    "result": [
        "0x0001cca19cda8c371faac5c59794b6bea7ebd78b5631828ca72b937722868378"  # has already been included in the previous request
    ]
}