status-im / status-mobile

a free (libre) open source, mobile OS for Ethereum
https://status.app
Mozilla Public License 2.0
3.88k stars 984 forks source link

No incoming transactions for tokens on Mainnet are shown in Transaction History #5749

Closed Serhy closed 5 years ago

Serhy commented 6 years ago

Type: Bug Summary: 1)There are no incoming transactions for tokens on Mainnet are displayed in the Transaction History. However, they are visible as mined (with 12confirations) in Etherscan. Note: amount for tokens in Wallet main screen displayed correct (as expected). 2) Outgoing token transactions are shown as 0 ETH instead of token and amount

Expected behavior

Incoming transactions for tokens on Mainnet are shown in Transaction History

Actual behavior

No incoming transactions for tokens on Mainnet are shown in Transaction History

Reproduction

Additional Information

Logs

TF session with logs for account that received tokens but they are not displayed in Transaction History and 0 ETH instead tokens (see from the beginning of the session) https://app.testfairy.com/projects/4803622-status/builds/8579390/sessions/4400497345/?accessToken=f3c-LdDfNNQB8wrk5O3sXNAujlE

annadanchenko commented 6 years ago
  1. note that on Ropsten for same account all is working fine: can see incoming token transactions, can see outgoing token transactions with token and amount instead of 0 ETH. So, issue is only on mainnet
  2. It was working fine in 0.9.26 and 0.9.25 - now when we check same scenario issue can be reproduced on these older releases too. So, it looks like there is some API change on etherscan or similar integration issue
Serhy commented 6 years ago

Request to Etherscan API did not retrieve latest ERC20 transaction received by address: For the address https://api.etherscan.io/api?module=account&action=txlist&address=0xb9f914fe1c6edae2351fb42276868470083a3cd2&startblock=0&endblock=99999999&sort=desc&apikey=DMddddddddDMVP3H2STAMSAUV7BYFw&nocache=true this what was retrieved (by the 04 Sep 2018 16:24:25 GMT): Logs1.txt

https://etherscan.io/address/0xb9f914fe1c6edae2351fb42276868470083a3cd2#tokentxns - shows all correctly.

See there in attached txt for etherscan Api request: Tx hash: 0x07019b26f0803e360fb588a1d872880e630facbc60cc53f586ad60134748f1f1 - retrieved OK However there are no next three ERC20 Tx followed by above (which is nonce=87): 0x4939fdfea1cf4c07bd61c0c5030bf6e88a10692c0eaeffe79d8aa145a847b2cf, 0x066ac550318b489ebb8f953cba2de6ab461ff7ca5327bcb7deb8e4eafd0b7d9b and 0xabd97e051052871ce42ec3f6229ab06d2c450b8b774686b50f67861a45cc0725

Ethereum Accounts, Address and Contracts
The Ethereum BlockChain Explorer, API and Analytics Platform
goranjovic commented 6 years ago

The cause of the problem is that json-rpc endpoint we use to get the token transfer events times out with a 500 - server internal error for any block range larger than around 10 days worth of blocks.

This used to work up until a few days ago, and still does work for ropsten.

The request I used to test the issue:

POST https://mainnet.infura.io/z6GCTmjdP3FETEJmMBI4

{
    "id": 2,
    "jsonrpc": "2.0",
    "method": "eth_getLogs",
    "params": [
        {
            "address": [
                "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
                "0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0",
                "0xd26114cd6ee289accf82350c8d8487fedb8a0c07",
                "0xd4fa1460f537bb9085d22c7bccb5dd450ef28e3a",
                "0x1985365e9f78359a9b6ad760e32412f4a445e862",
                "0x595832f8fc6bf59c85c527fec3740a1b7a361269",
                "0xb97048628db6b661d4c2aa833e95dbe1a905b280",
                "0xedbaf3c5100302dcdda53269322f3730b1f0416d",
                "0xa74476443119a942de498590fe1f2454d7d4ac0d",
                "0x4156d3342d5c385a87d264f90653733592000581",
                "0xb8c77482e45f1f44de1745f52c74426c631bdd52",
                "0x0d8775f648430679a709e98d2b0cb6250d2887ef",
                "0xdd974d5c2e2928dea5f71b9825b8b646686bd200",
                "0xe0b7927c4af23765cb51314a0e0521a9645f0e2a",
                "0x5ca9a71b1d01849c0a95490cc00559717fcf0d1d",
                "0xf230b790e05390fc8295f4d3f60332c93bed42e2",
                "0x5af2be193a6abca9c8817001f45744777db30756",
                "0x255aa6df07540cb5d3d297f0d0d4d84cb52bc8e6",
                "0x744d70fdbe2ba4cf95131626614a1763df805b9e",
                "0xaec2e87e0a235266d9c5adc9deb4b2e29b54d009",
                "0x6810e776880c02933d47db1b9fc05908e5386b96",
                "0xb64ef51c888972c908cfacf59b47c1afbc0ab8ac",
                "0x4470bb87d77b963a013db939be332f927f2b992e",
                "0x419d0d8bdd9af5e606ae2232ed285aff190e711b",
                "0x41e5560054824ea6b0732e656e3ad64e20e94e45",
                "0x888666ca69e0f178ded6d75b5726cee99a87d698",
                "0xb7cb1c96db6b22b0d3d9536e0108d062bd488f74",
                "0xcb97e65f07da24d46bcdd078ebebd7c6e6e3d750",
                "0xe41d2489571d322189246dafa5ebde1f4699f498",
                "0x1f573d6fb3f13d689ff844b4ce37794d79a7ff1c",
                "0xf433089366899d83a9f26a773d59ec7ecf30355e",
                "0xc42209accc14029c1012fb5680d95fbd6036e2a0",
                "0x514910771af9ca656af840dff83e8264ecf986ca",
                "0x818fc6c2ec5986bc6e2cbf00939d90556ab12ce5",
                "0x960b236a07cf122663c4303350609a66a7b288c0",
                "0x40395044ac3c0c57051906da938b54bd6557f212",
                "0xb63b606ac810a52cca15e44bb630fd42d8d1d83d",
                "0xef68e7c694f40c8202821edf525de3782458639f",
                "0x7a41e0517a5eca4fdbc7fbeba4d4c47b9ff6dc63",
                "0x0cf0ee63788a0849fe5297f3407f701e122cc023",
                "0xf970b8e36e23f7fc3fd752eea86f8be8d83375a6",
                "0x667088b212ce3d06a1b553a7221e1fd19000d9af",
                "0x08711d3b02c8758f2fb3ab4e80228418a7f8e39c",
                "0xbeb9ef514a379b997e0798fdcc901ee474b6d9a1",
                "0x51db5ad35c671a87207d88fc11d593ac0c8415bd",
                "0xe3818504c1b32bf1557b16c238b2e01fd3149c17",
                "0x697beac28b09e122c4332d163985e8a73121b97f",
                "0x957c30ab0426e0c93cd8241e2c60392d08c6ac8e",
                "0xe7775a6e9bcf904eb39da2b68c5efb4f9360e08c",
                "0x12b19d3e2ccc14da04fae33e63652ce469b3f2fd",
                "0x7c5a0ce9267ed19b22f8cae653f198e3e8daf098",
                "0x983f6d60db79ea8ca4eb9968c6aff8cfa04b3c63",
                "0x8f8221afbb33998d8584a2b05749ba73c37a938a",
                "0x12480e24eb5bec1a9d4369cab6a80cad3c0a377a",
                "0x0f5d2fb29fb7d3cfee444a200298f468908cc942",
                "0x27054b13b1b798b345b591a4d22e6562d47ea75a",
                "0x48f775efbe4f5ece6e0df2f7b5932df56823b990",
                "0xaf30d2a7e90d7dc361c8c4585e9bb7d2f6f15bc7",
                "0x12fef5e57bf45873cd9b62e9dbd7bfb99e32d73e",
                "0xf0ee6b27b759c9893ce4f094b49ad28fd15a23e4",
                "0x4dc3643dbc642b72c158e7f3d2ff232df61cb6ce",
                "0x90528aeb3a2b736b780fd1b6c478bb7e1d643170",
                "0x881ef48211982d01e2cb7092c915e647cd40d85c",
                "0xcb94be6f13a1182e4a4b6140cb7bf2025d28e41b",
                "0xaaaf91d9b90df800df4f55c205fd6989c977e73a",
                "0x168296bb09e24a88805cb9c33356536b980d3fc5",
                "0xac3da587eac229c9896d919abc235ca4fd7f72c1",
                "0xf3db5fa2c66b7af3eb0c0b782510816cbe4813b8",
                "0x014b50466590340d41307cc54dcee990c8d58aa8",
                "0x0abdace70d3790235af448c88547603b945604ea",
                "0x08d32b0da63e2c3bcf8019c9c5d849d7a9d791e6",
                "0xced4e93198734ddaff8492d525bd258d49eb388e",
                "0x29d75277ac7f0335b2165d0895e8725cbf658d73",
                "0xb2f7eb1f2c37645be61d73953035360e768d81e6",
                "0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c",
                "0x0d88ed6e74bbfd96b831231638b66c05571e824f",
                "0x6531f133e6deebe7f2dce5a0441aa7ef330b4e53",
                "0xd4c435f5b09f855c3317c8524cb1f586e42795fa",
                "0x006bea43baa3f7a6f765f14f10a1a1b08334ef45",
                "0x4df812f6064def1e5e029f1ca858777cc98d2d81",
                "0x2c974b2d0ba1716e644c1fc59982a89ddd2ff724",
                "0x7728dfef5abd468669eb7f9b48a7f70a501ed29d",
                "0x6c2adc2073994fb2ccc5032cc2906fa221e9b391",
                "0x2fe6ab85ebbf7776fee46d191ee4cea322cecf51",
                "0x08f5a9235b08173b7569f83645d2c7fb55e8ccd8",
                "0x9af4f26941677c706cfecf6d3379ff01bb85d5ab",
                "0x42d6622dece394b54999fbd73d108123806f6a18",
                "0x80046305aaab08f6033b56a360c184391165dc2d",
                "0x96a65609a7b84e8842732deb08f56c3e21ac6f8a",
                "0x2e071d2966aa7d8decb1005885ba1977d6038a65",
                "0x9b11efcaaa1890f6ee52c6bb7cf8153ac5d74139",
                "0x06012c8cf97bead5deae237070f9587f8e7a266d",
                "0xb2c0782ae4a299f7358758b2d15da9bf29e1dd99",
                "0xdcaad9fd9a74144d226dbf94ce6162ca9f09ed7e",
                "0x41a322b28d0ff354040e2cbc676f0320d8c8850d"
            ],
            "fromBlock": "0x5F60DC",
            "topics": [
                "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
                null,
                "0x00000000000000000000000058d8c3d70ce4fa4b9fb10a665c8712238746f2ff"
            ]
        }
    ]
}
dmitryn commented 6 years ago

Mine observations are quite similar to what @goranjovic found out.

Seems like Infura has issues with eth_getLogs request with fromBlock=0x0 parameter (which is quite heavy operation by the way https://blog.infura.io/not-all-api-calls-are-equal-3659c119bb6c).

I only managed to get successful response by providing exact block number in fromBlock and toBlock parameters.

Optimization we could possibly make is once we know block number with earliest transaction for given account we could request logs starting from that block number, but not from the block 0.

Infura Blog
Scaling INFURA: Not All API Calls are Equal – Infura Blog
The INFURA team continues to grow and scale along with Ethereum itself. As a core infrastructure provider to the public Ethereum networks…
mandrigin commented 6 years ago

@dmitryn it looks like it is a problem with latest geth see: https://github.com/ethereum/go-ethereum/pull/17610 and https://github.com/ethereum/go-ethereum/issues/17611 for example

lukaszfryc commented 5 years ago

On latest mobile sync we agreed this issue is not a relase blocker. It's a problem with external API that happens for previous app versions as well. I'm removing release label but adding high-severity.

Graeme-Code commented 5 years ago

Noticed this issue on ios 2.2.29. Should this be moved into shortlist on projects board?

lukaszfryc commented 5 years ago

@goranjovic @dmitryn any updates on it? Some users may find Status Wallet unreliable if they come across this issue. Imagine seeing "no tx found" in 1-1 chat and not seeing any TXs in the history even though someone is telling you that he already sent you the tokens. It's pretty bad experience.

chadyj commented 5 years ago

Ping @goranjovic any updates on this? Cc @oskarth

status-github-bot[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

mandrigin commented 5 years ago

Is that still the case? Do we still get timeouts for these tokens?

goranjovic commented 5 years ago

@mandrigin it would still happen if we still used so large queries. It doesn't because we now query only the last couple of weeks worth of blocks. The downside is that we only query the last couple of weeks.

churik commented 5 years ago

It is still happening on release 0.11.0

churik commented 5 years ago

Mostly it is fixed by #8005 But still:

Should be fully closed after merge #8221

churik commented 5 years ago

closed in https://github.com/status-im/status-react/pull/8228