aurora-is-near / aurora-relayer

[DEPRECATED] Web3-compatible relayer server for Aurora.
https://aurora-is-near.github.io/aurora-relayer/
Creative Commons Zero v1.0 Universal
26 stars 13 forks source link

eth_getFilterChanges changes #307

Closed pustovalov closed 2 years ago

pustovalov commented 2 years ago

Example 1

{
    "jsonrpc": "2.0",
    "method": "eth_newFilter",
    "params": [
        {
            "address": ["0xC6e5185438e1730959c1eF3551059A3feC744E90"]
        }
    ],
    "id": 2
}

Before:

{
    "jsonrpc": "2.0",
    "method": "eth_getFilterChanges",
    "params": ["0x2f3a627ff38f479d99301b6a486155c4"],
    "id": 2
}
Response ``` { "jsonrpc": "2.0", "id": 2, "result": [ { "blockNumber": "0x407df3a", "blockHash": "0x6f0e3ce8cd93b4c157fc11287c916bf20a28d5ab166183414daf616439d05696", "transactionIndex": "0x0", "transactionHash": "0x579a3bd4895103864a8e540884b987cf446a21330e9f3ddc6fb9f2ddf656c51f", "logIndex": "0x0", "address": "0x8f975ac6defd2c9d50c58babf4b1f880e6de7996", "topics": "{\"\\\\x17eabd0a66fa631f7537cefdd5df6aa25d5ac904cf7596e958d43a75a00d0d68\",\"\\\\x000000000000000000000000000000000000000000000000000000000000289e\"}", "data": "0x00000000000000000000000000000000000000000000d86f1931a9df354b6697000000000000000000000000053c335593fd25803acc88a63b93747a33be616d", "removed": false }, { "blockNumber": "0x407df3b", "blockHash": "0xde8bf272da0228bcf50615731ec4e81c4de6b2d2c9a709ae45a7b8da32e8590f", "transactionIndex": "0x0", "transactionHash": "0x17c2d173d0dac6ac957db02d644422e23a6dfd012367c00d414f058d97568b21", "logIndex": "0x0", "address": "0xb12bfca5a55806aaf64e99521918a4bf0fc40802", "topics": "{\"\\\\xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\",\"\\\\x000000000000000000000000fe13c6d06121a27cae69e634ac25e8d3316d3048\",\"\\\\x000000000000000000000000c7689e5315a8b237ac7ab62119df299dd8c4b6d5\"}", "data": "0x000000000000000000000000000000000000000000000000000000003b9aca00", "removed": false }, { "blockNumber": "0x407df3b", "blockHash": "0xde8bf272da0228bcf50615731ec4e81c4de6b2d2c9a709ae45a7b8da32e8590f", "transactionIndex": "0x0", "transactionHash": "0x17c2d173d0dac6ac957db02d644422e23a6dfd012367c00d414f058d97568b21", "logIndex": "0x1", "address": "0xb12bfca5a55806aaf64e99521918a4bf0fc40802", "topics": "{\"\\\\x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925\",\"\\\\x000000000000000000000000fe13c6d06121a27cae69e634ac25e8d3316d3048\",\"\\\\x000000000000000000000000335ac99bb3e51bdbf22025f092ebc1cf2c5cc619\"}", "data": "0xfffffffffffffffffffffffffffffffffffffffffffffffffffff16db6268464", "removed": false }, { "blockNumber": "0x407df3b", "blockHash": "0xde8bf272da0228bcf50615731ec4e81c4de6b2d2c9a709ae45a7b8da32e8590f", "transactionIndex": "0x0", "transactionHash": "0x17c2d173d0dac6ac957db02d644422e23a6dfd012367c00d414f058d97568b21", "logIndex": "0x2", "address": "0xe301ed8c7630c9678c39e4e45193d1e7dfb914f7", "topics": "{\"\\\\xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\",\"\\\\x000000000000000000000000c7689e5315a8b237ac7ab62119df299dd8c4b6d5\",\"\\\\x000000000000000000000000fe13c6d06121a27cae69e634ac25e8d3316d3048\"}", "data": "0x00000000000000000000000000000000000000000000019aeb41a4e517654c90", "removed": false }, { "blockNumber": "0x407df3b", "blockHash": "0xde8bf272da0228bcf50615731ec4e81c4de6b2d2c9a709ae45a7b8da32e8590f", "transactionIndex": "0x0", "transactionHash": "0x17c2d173d0dac6ac957db02d644422e23a6dfd012367c00d414f058d97568b21", "logIndex": "0x3", "address": "0xe301ed8c7630c9678c39e4e45193d1e7dfb914f7", "topics": "{\"\\\\xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\",\"\\\\x000000000000000000000000c7689e5315a8b237ac7ab62119df299dd8c4b6d5\",\"\\\\x000000000000000000000000041aba00c57dd47abc37a2931df569a2a2cc57be\"}", "data": "0x0000000000000000000000000000000000000000000000003f4e9c78ec31005a", "removed": false }, { "blockNumber": "0x407df3b", "blockHash": "0xde8bf272da0228bcf50615731ec4e81c4de6b2d2c9a709ae45a7b8da32e8590f", "transactionIndex": "0x0", "transactionHash": "0x17c2d173d0dac6ac957db02d644422e23a6dfd012367c00d414f058d97568b21", "logIndex": "0x4", "address": "0xc7689e5315a8b237ac7ab62119df299dd8c4b6d5", "topics": "{\"\\\\xc2c0245e056d5fb095f04cd6373bc770802ebd1e6c918eb78fdef843cdb37b0f\"}", "data": "0x000000000000000000000000b12bfca5a55806aaf64e99521918a4bf0fc40802000000000000000000000000e301ed8c7630c9678c39e4e45193d1e7dfb914f7000000000000000000000000000000000000000000000000000000003b9aca0000000000000000000000000000000000000000000000019aeb41a4e517654c90000000000000000000000000bef0c8cd420b76e9d31509abbfd7f8c9f664527c000000000000000000000000fe13c6d06121a27cae69e634ac25e8d3316d3048", "removed": false } ] } ```

After:

{
    "jsonrpc": "2.0",
    "method": "eth_getFilterChanges",
    "params": ["0x01fda01c3c834c4a8872c3118b598909"],
    "id": 2
}
{
    "jsonrpc": "2.0",
    "id": 2,
    "result": [
        {
            "blockNumber": "0x407db1b",
            "blockHash": "0xa371a959ff76ab368e6081d24c328e28c84e2dabea310eea9ba0e4b341bec2fd",
            "transactionIndex": "0x1",
            "transactionHash": "0x606f4ee15e7cee9f93e7bd270c019b7f9ffcd8b00c91ee8e57ec43ba64f32ec7",
            "logIndex": "0x0",
            "address": "0xc6e5185438e1730959c1ef3551059a3fec744e90",
            "topics": [
                "0x2d452398cb8bb9e5cdadeaabfe0a5d66bf83abdf317ed5633a64528f5bee7458",
                "0x000000000000000000000000ae4fac24dcdae0132c6d04f564dcf059616e9423",
                "0x000000000000000000000000000000000000000000000000000000001301780e",
                "0x000000000000000000000000f2b7e347ca4ec2a0f139b1d3073d679911295a2a"
            ],
            "data": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "removed": false
        },
        {
            "blockNumber": "0x407db1c",
            "blockHash": "0xe5ca295c39400175d85273779f0d9519af3fd49239a892c2d876360521a9a5c4",
            "transactionIndex": "0x0",
            "transactionHash": "0x3694fdcaa5c1550e77ac0da07a95f5668df896c35729d8408e7e9d43a430bb26",
            "logIndex": "0x0",
            "address": "0xc6e5185438e1730959c1ef3551059a3fec744e90",
            "topics": [
                "0x2d452398cb8bb9e5cdadeaabfe0a5d66bf83abdf317ed5633a64528f5bee7458",
                "0x0000000000000000000000003195949f267702723bc614cae037cdc8d1e94786",
                "0x0000000000000000000000000000000000000000000000000000000014bc0ed3",
                "0x000000000000000000000000f2f3776b9f69a9302c897aec26b59027e01d36cc"
            ],
            "data": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "removed": false
        },
        {
            "blockNumber": "0x407db1d",
            "blockHash": "0x5d9e20b3380ce8c2e66858b87d404ee6aa242f7dc36c272e267bb00e1daa8ab3",
            "transactionIndex": "0x4",
            "transactionHash": "0xc4d48535b7ca08c4a154a15752da5a8984c9bafab5128e3acfef912e9d6034e5",
            "logIndex": "0x0",
            "address": "0xc6e5185438e1730959c1ef3551059a3fec744e90",
            "topics": [
                "0x2d452398cb8bb9e5cdadeaabfe0a5d66bf83abdf317ed5633a64528f5bee7458",
                "0x0000000000000000000000003195949f267702723bc614cae037cdc8d1e94786",
                "0x0000000000000000000000000000000000000000000000000000000014bc22ac",
                "0x000000000000000000000000b3072378821cdafac340bf18a0fbf15c72feb83b"
            ],
            "data": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "removed": false
        },
        {
            "blockNumber": "0x407db25",
            "blockHash": "0x6103f12ae05578ed9c082e703048d364b716caba41331dc312d291cb08556fae",
            "transactionIndex": "0x1",
            "transactionHash": "0xdf1c4f8f137a3280d73cae77624149e28c290f1bf4f523a7a7d22efacdb7d4d6",
            "logIndex": "0x0",
            "address": "0xc6e5185438e1730959c1ef3551059a3fec744e90",
            "topics": [
                "0x2d452398cb8bb9e5cdadeaabfe0a5d66bf83abdf317ed5633a64528f5bee7458",
                "0x0000000000000000000000003195949f267702723bc614cae037cdc8d1e94786",
                "0x0000000000000000000000000000000000000000000000000000000014bc22ac",
                "0x000000000000000000000000f2b7e347ca4ec2a0f139b1d3073d679911295a2a"
            ],
            "data": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "removed": false
        },
        {
            "blockNumber": "0x407db25",
            "blockHash": "0x6103f12ae05578ed9c082e703048d364b716caba41331dc312d291cb08556fae",
            "transactionIndex": "0x2",
            "transactionHash": "0x110d1ca9a133d465b0cc04199817c9c7606e549cbe1bdd6213e0c1edbdbc56bc",
            "logIndex": "0x0",
            "address": "0xc6e5185438e1730959c1ef3551059a3fec744e90",
            "topics": [
                "0x2d452398cb8bb9e5cdadeaabfe0a5d66bf83abdf317ed5633a64528f5bee7458",
                "0x000000000000000000000000ca9511b610ba5fc7e311fdef9ce16050ee4449e9",
                "0x0000000000000000000000000000000000000000000000000000001ce9499d40",
                "0x000000000000000000000000f2f3776b9f69a9302c897aec26b59027e01d36cc"
            ],
            "data": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "removed": false
        },
        {
            "blockNumber": "0x407db26",
            "blockHash": "0xb4ff6be252948f5293644991bbfc91d3147be8f21a55babd314a48e12dd73c59",
            "transactionIndex": "0x0",
            "transactionHash": "0x8bf9d6464772d1ada3b96488baaa34d3b3d70943a36efbf4bcb17baeef4d5cdf",
            "logIndex": "0x0",
            "address": "0xc6e5185438e1730959c1ef3551059a3fec744e90",
            "topics": [
                "0x2d452398cb8bb9e5cdadeaabfe0a5d66bf83abdf317ed5633a64528f5bee7458",
                "0x000000000000000000000000ca9511b610ba5fc7e311fdef9ce16050ee4449e9",
                "0x0000000000000000000000000000000000000000000000000000001d110d5294",
                "0x000000000000000000000000b3072378821cdafac340bf18a0fbf15c72feb83b"
            ],
            "data": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "removed": false
        }
    ]
}

Example 2

{
    "jsonrpc": "2.0",
    "method": "eth_newFilter",
    "params": [
        {
            "address": ["0xC6e5185438e1730959c1eF3551059A3feC744E90"],
            "topics": [
                [],
                [],
                "0x00000000000000000000000000000000000000000000000000000000136af5d7"
            ]
        }
    ],
    "id": 2
}

Before:

Response ``` { "jsonrpc": "2.0", "id": 2, "result": [ { "blockNumber": "0x407e299", "blockHash": "0x8dba38e60dde90598acc51177231e0501726796087a21a3d0447586e1ff1ca4c", "transactionIndex": "0x0", "transactionHash": "0xc81fe03fb37f9e929a0064ba10fcaef37cad68f0e4c0805db7d25f24e1dc6da5", "logIndex": "0x0", "address": "0x4c7c89ed1f09ecce6445e249db0bdc714965731f", "topics": "{\"\\\\x17eabd0a66fa631f7537cefdd5df6aa25d5ac904cf7596e958d43a75a00d0d68\",\"\\\\x000000000000000000000000000000000000000000000000000000000000b2c2\"}", "data": "0x000000000000000000000000000000000000000000000000000000000680dcd5000000000000000000000000053c335593fd25803acc88a63b93747a33be616d", "removed": false }, { "blockNumber": "0x407e299", "blockHash": "0x8dba38e60dde90598acc51177231e0501726796087a21a3d0447586e1ff1ca4c", "transactionIndex": "0x1", "transactionHash": "0xf3b192028bdd95983a71429fcf8ae9fae82a2699aa284262a85cf974b8ea0e9d", "logIndex": "0x0", "address": "0x1862ce6d919ab54b4900418f87195c3d09b802bc", "topics": "{\"\\\\x43dd06cd14239ec6c5a1b4ea9c2def7d8940aeda88ead0ab6fb960ce3c3c412d\"}", "data": "0x00000000000000000000000000000000000000000000000000000000000f1f18", "removed": false }, { "blockNumber": "0x407e29b", "blockHash": "0xd56c076f7693094b465c8007a963dd6a6bc99ec91a23cf3e64c357b763d4048b", "transactionIndex": "0x0", "transactionHash": "0x79f27c6f581eea06d41ff0afcf5e245f3714d7aa4eb9778bcfcd920de848134e", "logIndex": "0x0", "address": "0xdd170e697d7aded472a9284f07576c3449284502", "topics": "{\"\\\\x17eabd0a66fa631f7537cefdd5df6aa25d5ac904cf7596e958d43a75a00d0d68\",\"\\\\x000000000000000000000000000000000000000000000000000000000001f02e\"}", "data": "0x0000000000000000000000000000000000000000000000000000000005f66a38000000000000000000000000b8af1be8169bc0e6345facb383be58a6b4d04ee4", "removed": false }, { "blockNumber": "0x407e29b", "blockHash": "0xd56c076f7693094b465c8007a963dd6a6bc99ec91a23cf3e64c357b763d4048b", "transactionIndex": "0x1", "transactionHash": "0xcf9c4c6e00506c0f4399b29e2e132302cea0ff5230cf9c346e84aa61ba24bc5b", "logIndex": "0x0", "address": "0xc6e5185438e1730959c1ef3551059a3fec744e90", "topics": "{\"\\\\x2d452398cb8bb9e5cdadeaabfe0a5d66bf83abdf317ed5633a64528f5bee7458\",\"\\\\x000000000000000000000000ca9511b610ba5fc7e311fdef9ce16050ee4449e9\",\"\\\\x0000000000000000000000000000000000000000000000000000001cee4b5a40\",\"\\\\x000000000000000000000000b3072378821cdafac340bf18a0fbf15c72feb83b\"}", "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "removed": false }, { "blockNumber": "0x407e29e", "blockHash": "0x4aaa2e37ee76dc46dda9dfed44192e97256f103f29fabefb6dfff41ec5a87a94", "transactionIndex": "0x0", "transactionHash": "0xf8d16641b5bca896b8a0e58f3f57923b9f7632237039fc1dbcb8b57955c4dabf", "logIndex": "0x0", "address": "0xe3520349f477a5f6eb06107066048508498a291b", "topics": "{\"\\\\x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925\",\"\\\\x000000000000000000000000ae657b4e0ea7e03943ac9402b8379c233e06d4cc\",\"\\\\x000000000000000000000000c90db0d8713414d78523436dc347419164544a3f\"}", "data": "0x0000000000000000000000000000000000000000000000007cb12bb5bfabc80f", "removed": false }, { "blockNumber": "0x407e29e", "blockHash": "0x4aaa2e37ee76dc46dda9dfed44192e97256f103f29fabefb6dfff41ec5a87a94", "transactionIndex": "0x0", "transactionHash": "0xf8d16641b5bca896b8a0e58f3f57923b9f7632237039fc1dbcb8b57955c4dabf", "logIndex": "0x1", "address": "0xe3520349f477a5f6eb06107066048508498a291b", "topics": "{\"\\\\xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\",\"\\\\x000000000000000000000000ae657b4e0ea7e03943ac9402b8379c233e06d4cc\",\"\\\\x000000000000000000000000c90db0d8713414d78523436dc347419164544a3f\"}", "data": "0x0000000000000000000000000000000000000000000000007cb12bb5bfabc80f", "removed": false } ] } ```

After:

{
    "jsonrpc": "2.0",
    "id": 2,
    "result": [
        {
            "blockNumber": "0x407df24",
            "blockHash": "0xb5ca4dbea0efdc8e7ec8dd7b57f34dcdcdec8807644ef383f7b4ab7638852e00",
            "transactionIndex": "0x1",
            "transactionHash": "0xdd6f4fe70b3905fff876fb472685bb7c5c6f896f830b718de7a08c4b6c239ae6",
            "logIndex": "0x0",
            "address": "0xc6e5185438e1730959c1ef3551059a3fec744e90",
            "topics": [
                "0x2d452398cb8bb9e5cdadeaabfe0a5d66bf83abdf317ed5633a64528f5bee7458",
                "0x000000000000000000000000ae4fac24dcdae0132c6d04f564dcf059616e9423",
                "0x00000000000000000000000000000000000000000000000000000000136af5d7",
                "0x000000000000000000000000b3072378821cdafac340bf18a0fbf15c72feb83b"
            ],
            "data": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "removed": false
        },
        {
            "blockNumber": "0x407df51",
            "blockHash": "0xa9fd5dafba1fabcdda4e83f1cde34679f8bd744f9266a6bfe736a34ad37e6cc6",
            "transactionIndex": "0x0",
            "transactionHash": "0x82784c8c17eb33f60ae2a7ece10b2318ed924211c895fe4a38822066e5afca92",
            "logIndex": "0x0",
            "address": "0xc6e5185438e1730959c1ef3551059a3fec744e90",
            "topics": [
                "0x2d452398cb8bb9e5cdadeaabfe0a5d66bf83abdf317ed5633a64528f5bee7458",
                "0x000000000000000000000000ae4fac24dcdae0132c6d04f564dcf059616e9423",
                "0x00000000000000000000000000000000000000000000000000000000136af5d7",
                "0x000000000000000000000000f2f3776b9f69a9302c897aec26b59027e01d36cc"
            ],
            "data": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "removed": false
        },
        {
            "blockNumber": "0x407df54",
            "blockHash": "0xcb506fe369dcb2009dcb043b6d4ae3798fea090e0527ce8c3ba4e77f62a295ab",
            "transactionIndex": "0x0",
            "transactionHash": "0xe2323f582d58257e03d1a482007e46cdcbd958b3fac0d91eb75b0ab4b1460aa7",
            "logIndex": "0x0",
            "address": "0xc6e5185438e1730959c1ef3551059a3fec744e90",
            "topics": [
                "0x2d452398cb8bb9e5cdadeaabfe0a5d66bf83abdf317ed5633a64528f5bee7458",
                "0x000000000000000000000000ae4fac24dcdae0132c6d04f564dcf059616e9423",
                "0x00000000000000000000000000000000000000000000000000000000136af5d7",
                "0x000000000000000000000000f2b7e347ca4ec2a0f139b1d3073d679911295a2a"
            ],
            "data": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "removed": false
        }
    ]
}

Example 3

Before:

$ http post http://localhost:8545 jsonrpc=2.0 id=1 method=eth_newFilter params:='[ {} ]'
{
    "id": "1",
    "jsonrpc": "2.0",
    "result": "0x49b6748420554a7b8fd382bc771e39ba"
}

$ http post http://localhost:8545 jsonrpc=2.0 id=1 method=eth_getFilterChanges params:='["0x49b6748420554a7b8fd382bc771e39ba"]' -vv

{
    "id": "1",
    "jsonrpc": "2.0",
    "method": "eth_getFilterChanges",
    "params": [
        "0x49b6748420554a7b8fd382bc771e39ba"
    ]
}

{
    "id": "1",
    "jsonrpc": "2.0",
    "result": [
        {
            "address": "0xc6e5185438e1730959c1ef3551059a3fec744e90",
            "blockHash": "0xa94a97a0dd894e2b1f5c0693f4a5428438c802655ccf6d0d0582a0d297998296",
            "blockNumber": "0x4091a62",
            "data": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "logIndex": "0x0",
            "removed": false,
            "topics": "{\"\\\\x2d452398cb8bb9e5cdadeaabfe0a5d66bf83abdf317ed5633a64528f5bee7458\",\"\\\\x0000000000000000000000003195949f267702723bc614cae037cdc8d1e94786\",\"\\\\x00000000000000000000000000000000000000000000000000000000166012cd\",\"\\\\x000000000000000000000000f2b7e347ca4ec2a0f139b1d3073d679911295a2a\"}",
            "transactionHash": "0x15147f112af2e620e3d37a6a58d2e345d7d017da27ac74965883e1cd08ecadee",
            "transactionIndex": "0x0"
        }
    ]
}

Elapsed time: 66.011515833s

After:

$ http post http://localhost:8545 jsonrpc=2.0 id=1 method=eth_newFilter params:='[ {} ]'
{
    "id": "1",
    "jsonrpc": "2.0",
    "result": "0x9fd7c62d97e34af4ad5769a6f701b21a"
}

$ http post http://localhost:8545 jsonrpc=2.0 id=1 method=eth_getFilterChanges params:='["0x9fd7c62d97e34af4ad5769a6f701b21a"]' -vv

{
    "id": "1",
    "jsonrpc": "2.0",
    "method": "eth_getFilterChanges",
    "params": [
        "0x9fd7c62d97e34af4ad5769a6f701b21a"
    ]
}

{
    "id": "1",
    "jsonrpc": "2.0",
    "result": [
        {
            "address": "0xc42c30ac6cc15fac9bd938618bcaa1a1fae8501d",
            "blockHash": "0xa22ce950a113b6d625028d28994b7312e0a629b6f96fbf1706ddfe358e2a644c",
            "blockNumber": "0x4091af0",
            "data": "0x00000000000000000000000000000000000000000039e7139a8c08fa06000000",
            "logIndex": "0x0",
            "removed": false,
            "topics": [
                "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
                "0x0000000000000000000000008e9a13c2a93224b4584ef3a3b3df0a578945c883",
                "0x00000000000000000000000063da4db6ef4e7c62168ab03982399f9588fcd198"
            ],
            "transactionHash": "0xc85a56cf1efb7650dcdb50e0b332b1774a300bbe06171661735d07054449ff17",
            "transactionIndex": "0x0"
        }
    ]
}

Elapsed time: 0.017864625s