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

Messaging/transacting take too long to be processed if there is a 'Pending...' tx message #5293

Closed Serhy closed 6 years ago

Serhy commented 6 years ago

Type: Bug

Summary: On Mainnet, once there is a transaction sent in 1-1 chat that will take too much time to be mined (or put into a block) which is also visible as Pending... status of /send message - further messages or transactions start to take way too long time for processing:

App UI does not lag, but it's communication lags.

Note 1: it might be that https://github.com/status-im/status-react/pull/5221 has an impact on this. Note 2: Maybe transcations sent from Ropsten also bring this issue, but I could not reproduce it: even with lowest gas price (0.00000001) transaction mined in <1-2 minutes.

Expected behavior

Messages and transactions are sent instantly doesn't matter if there are pending transactions that contact has sent

Actual behavior

Message and transaction processing takes up to 1-2 minutes if there is a transaction in Pending... state that contact sent

Reproduction

Additional Information

Logs

TF session for Contact1 above: from 02:00 https://app.testfairy.com/projects/4803622-status/builds/8535945/sessions/4397065312/?accessToken=U3EQnCAOggTbqIOmwW5dJr4oGBM

TestFairy: Status 0.9.23 (6249) @2018
annadanchenko commented 6 years ago

might be connected with https://github.com/status-im/status-react/issues/5296 and both can have same root cause after merged https://github.com/status-im/status-react/pull/5221 ? @dmitryn

dmitryn commented 6 years ago

i was able to reproduce it. shh.extPost doesn't work (it stops firing callbacks https://github.com/status-im/status-react/blob/develop/src/status_im/transport/shh.cljs#L56) after any transaction with low gas (0.0000001) has been sent.

GitHub
status-im/status-react
status-react - a free (libre) open source, mobile OS for Ethereum
dmitryn commented 6 years ago

geth.2018-08-16.log

Message was sent at ~10:54 Signal received at 10:55:50

dmitryn commented 6 years ago

status-react logs:

13:54:01 Transaction sign request queued 13:54:23 chat message sent 13:55:50 Signal envelope.sent received

08-16 13:53:56.668 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :wallet/sign-transaction
08-16 13:54:01.788 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :signal-event {"type":"sign-request.queued","event":{"id":"ab3b4cb1-6e9e-460b-ab55-1517720d1898","method":"eth_sendTransaction","args":{"from":"0xf84e72a8b067993a758f12f8a25bb839a27e8777","to":"0xfce4986b196964bb415f8b6ad4c00a212fd957bc","gas":"0x5208","gasPrice":"0x64","value":"0x92f96e98800","nonce":null,"input":"0x","data":"0x"},"message_id":""}}
08-16 13:54:01.790 13734 13804 D ReactNativeJS: DEBUG [status-im.ui.screens.events:392] - :event-str {"type":"sign-request.queued","event":{"id":"ab3b4cb1-6e9e-460b-ab55-1517720d1898","method":"eth_sendTransaction","args":{"from":"0xf84e72a8b067993a758f12f8a25bb839a27e8777","to":"0xfce4986b196964bb415f8b6ad4c00a212fd957bc","gas":"0x5208","gasPrice":"0x64","value":"0x92f96e98800","nonce":null,"input":"0x","data":"0x"},"message_id":""}}
08-16 13:54:01.791 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.instabug:24] - Signal event: {"type":"sign-request.queued","event":{"id":"ab3b4cb1-6e9e-460b-ab55-1517720d1898","method":"eth_sendTransaction","args":{"from":"0xf84e72a8b067993a758f12f8a25bb839a27e8777","to":"0xfce4986b196964bb415f8b6ad4c00a212fd957bc","gas":"0x5208","gasPrice":"0x64","value":"0x92f96e98800","nonce":null,"input":"0x","data":"0x"},"message_id":""}}
08-16 13:54:01.800 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :sign-request-queued
08-16 13:54:01.837 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :check-transactions-queue
08-16 13:54:01.853 13734 13804 D ReactNativeJS: DEBUG [status-im.native-module.impl.module:106] - :approve-sign-request true ab3b4cb1-6e9e-460b-ab55-1517720d1898
08-16 13:54:02.738 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :status-im.ui.screens.wallet.send.events/transaction-completed
08-16 13:54:02.788 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :send-transaction-message 0x045f2e783aa4c03195b8ce93fa5003d31f8dfa108494040eca673e86da9c54aec1d10743026fb5a5345d0bb34ad030205bd24ca13644e186df4559bb6a1c3111f2
08-16 13:54:02.924 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :transport/set-message-envelope-hash 0x045f2e783aa4c03195b8ce93fa5003d31f8dfa108494040eca673e86da9c54aec1d10743026fb5a5345d0bb34ad030205bd24ca13644e186df4559bb6a1c3111f2
08-16 13:54:03.024 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :update-transactions-success
08-16 13:54:03.274 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :update-transactions-success
08-16 13:54:03.628 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :signal-event {"type":"envelope.sent","event":{"hash":"0x984abe0cf8c11f8082777d9a62cd5be538f4db93553af347882908c16af3789a"}}
08-16 13:54:03.629 13734 13804 D ReactNativeJS: DEBUG [status-im.ui.screens.events:392] - :event-str {"type":"envelope.sent","event":{"hash":"0x984abe0cf8c11f8082777d9a62cd5be538f4db93553af347882908c16af3789a"}}
08-16 13:54:03.630 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.instabug:24] - Signal event: {"type":"envelope.sent","event":{"hash":"0x984abe0cf8c11f8082777d9a62cd5be538f4db93553af347882908c16af3789a"}}
08-16 13:54:03.636 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :signals/envelope-status 0x984abe0cf8c11f8082777d9a62cd5be538f4db93553af347882908c16af3789a
08-16 13:54:05.036 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :close-transaction-sent-screen 0x045f2e783aa4c03195b8ce93fa5003d31f8dfa108494040eca673e86da9c54aec1d10743026fb5a5345d0bb34ad030205bd24ca13644e186df4559bb6a1c3111f2
08-16 13:54:05.043 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :navigate-back
08-16 13:54:05.219 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:54:05.265 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:54:05.281 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set :layout-height
08-16 13:54:05.433 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:54:05.475 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:54:05.499 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :check-transactions-queue
08-16 13:54:05.502 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :load-more-messages
08-16 13:54:05.598 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:54:05.718 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :sync-wallet-transactions
08-16 13:54:05.720 13734 13804 D ReactNativeJS: DEBUG [status-im.wallet.transactions:73] - Syncing transactions data..
08-16 13:54:05.743 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.transactions:60] - HTTP GET https://api.etherscan.io/api?module=account&action=txlist&address=0xf84e72a8b067993a758f12f8a25bb839a27e8777&startblock=0&endblock=99999999&sort=desc&apikey=DMSI4UAAKUBVGCDMVP3H2STAMSAUV7BYFI?q=json
08-16 13:54:05.938 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :update-transactions-success
08-16 13:54:16.635 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :navigate-back
08-16 13:54:18.069 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :navigate-to-chat 0x045f2e783aa4c03195b8ce93fa5003d31f8dfa108494040eca673e86da9c54aec1d10743026fb5a5345d0bb34ad030205bd24ca13644e186df4559bb6a1c3111f2
08-16 13:54:18.254 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:54:18.399 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:54:18.416 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set :layout-height
08-16 13:54:18.456 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:54:18.474 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :load-more-messages
08-16 13:54:19.372 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:54:19.491 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :hide-tab-bar
08-16 13:54:19.548 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set :layout-height
08-16 13:54:20.169 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-input-text h
08-16 13:54:20.212 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :update-text-selection
08-16 13:54:20.362 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:54:20.407 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-input-text he
08-16 13:54:20.456 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :update-text-selection
08-16 13:54:20.536 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:54:20.587 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-input-text hel
08-16 13:54:20.636 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :update-text-selection
08-16 13:54:20.695 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:54:20.740 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-input-text hell
08-16 13:54:20.792 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :update-text-selection
08-16 13:54:20.868 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:54:20.889 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :sync-wallet-transactions
08-16 13:54:20.891 13734 13804 D ReactNativeJS: DEBUG [status-im.wallet.transactions:73] - Syncing transactions data..
08-16 13:54:20.930 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.transactions:60] - HTTP GET https://api.etherscan.io/api?module=account&action=txlist&address=0xf84e72a8b067993a758f12f8a25bb839a27e8777&startblock=0&endblock=99999999&sort=desc&apikey=DMSI4UAAKUBVGCDMVP3H2STAMSAUV7BYFI?q=json
08-16 13:54:20.970 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-input-text hello
08-16 13:54:21.012 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :update-text-selection
08-16 13:54:21.071 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:54:21.121 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:54:21.161 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :update-transactions-success
08-16 13:54:23.385 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :send-current-message
08-16 13:54:23.532 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:54:23.573 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :load-more-messages
08-16 13:54:23.581 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :update-text-selection
08-16 13:54:23.640 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:54:35.969 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :sync-wallet-transactions
08-16 13:54:35.971 13734 13804 D ReactNativeJS: DEBUG [status-im.wallet.transactions:73] - Syncing transactions data..
08-16 13:54:35.994 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.transactions:60] - HTTP GET https://api.etherscan.io/api?module=account&action=txlist&address=0xf84e72a8b067993a758f12f8a25bb839a27e8777&startblock=0&endblock=99999999&sort=desc&apikey=DMSI4UAAKUBVGCDMVP3H2STAMSAUV7BYFI?q=json
08-16 13:54:36.190 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :update-transactions-success
08-16 13:54:51.019 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :sync-wallet-transactions
08-16 13:54:51.020 13734 13804 D ReactNativeJS: DEBUG [status-im.wallet.transactions:73] - Syncing transactions data..
08-16 13:54:51.047 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.transactions:60] - HTTP GET https://api.etherscan.io/api?module=account&action=txlist&address=0xf84e72a8b067993a758f12f8a25bb839a27e8777&startblock=0&endblock=99999999&sort=desc&apikey=DMSI4UAAKUBVGCDMVP3H2STAMSAUV7BYFI?q=json
08-16 13:54:51.270 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :update-transactions-success
08-16 13:54:56.495 13734 13804 I ReactNativeJS: INFO [status-im.utils.ethereum.core:151] - {"meta":null,"cnt":2,"arr":[{"ns":null,"name":"code","fqn":"code","_hash":null,"cljs$lang$protocol_mask$partition0$":2153775105,"cljs$lang$protocol_mask$partition1$":4096},-32700,{"ns":null,"name":"message","fqn":"message","_hash":null,"cljs$lang$protocol_mask$partition0$":2153775105,"cljs$lang$protocol_mask$partition1$":4096},"502 Bad Gateway <html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n</body>\r\n</html>\r\n"],"__hash":null,"cljs$lang$protocol_mask$partition0$":16647951,"cljs$lang$protocol_mask$partition1$":139268}
08-16 13:55:06.068 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :sync-wallet-transactions
08-16 13:55:06.070 13734 13804 D ReactNativeJS: DEBUG [status-im.wallet.transactions:73] - Syncing transactions data..
08-16 13:55:06.089 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.transactions:60] - HTTP GET https://api.etherscan.io/api?module=account&action=txlist&address=0xf84e72a8b067993a758f12f8a25bb839a27e8777&startblock=0&endblock=99999999&sort=desc&apikey=DMSI4UAAKUBVGCDMVP3H2STAMSAUV7BYFI?q=json
08-16 13:55:08.220 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :update-transactions-success
08-16 13:55:21.109 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :sync-wallet-transactions
08-16 13:55:21.110 13734 13804 D ReactNativeJS: DEBUG [status-im.wallet.transactions:73] - Syncing transactions data..
08-16 13:55:21.124 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.transactions:60] - HTTP GET https://api.etherscan.io/api?module=account&action=txlist&address=0xf84e72a8b067993a758f12f8a25bb839a27e8777&startblock=0&endblock=99999999&sort=desc&apikey=DMSI4UAAKUBVGCDMVP3H2STAMSAUV7BYFI?q=json
08-16 13:55:21.328 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :update-transactions-success
08-16 13:55:36.148 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :sync-wallet-transactions
08-16 13:55:36.149 13734 13804 D ReactNativeJS: DEBUG [status-im.wallet.transactions:73] - Syncing transactions data..
08-16 13:55:36.163 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.transactions:60] - HTTP GET https://api.etherscan.io/api?module=account&action=txlist&address=0xf84e72a8b067993a758f12f8a25bb839a27e8777&startblock=0&endblock=99999999&sort=desc&apikey=DMSI4UAAKUBVGCDMVP3H2STAMSAUV7BYFI?q=json
08-16 13:55:36.345 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :update-transactions-success
08-16 13:55:50.156 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :transport/set-message-envelope-hash 0x045f2e783aa4c03195b8ce93fa5003d31f8dfa108494040eca673e86da9c54aec1d10743026fb5a5345d0bb34ad030205bd24ca13644e186df4559bb6a1c3111f2
08-16 13:55:50.239 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :signal-event {"type":"envelope.sent","event":{"hash":"0x505b7205b579d6997f377a079fa5de9e5329e787674f19a17cefeceb12221d20"}}
08-16 13:55:50.241 13734 13804 D ReactNativeJS: DEBUG [status-im.ui.screens.events:392] - :event-str {"type":"envelope.sent","event":{"hash":"0x505b7205b579d6997f377a079fa5de9e5329e787674f19a17cefeceb12221d20"}}
08-16 13:55:50.242 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.instabug:24] - Signal event: {"type":"envelope.sent","event":{"hash":"0x505b7205b579d6997f377a079fa5de9e5329e787674f19a17cefeceb12221d20"}}
08-16 13:55:50.262 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :signals/envelope-status 0x505b7205b579d6997f377a079fa5de9e5329e787674f19a17cefeceb12221d20
08-16 13:55:50.374 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :set-chat-ui-props
08-16 13:55:50.404 13734 13804 D ReactNativeJS: DEBUG [status-im.utils.handlers:37] - Handling re-frame event:  :load-more-messages
dmitryn commented 6 years ago

It's not reproducible on ios simulator.

dmitryn commented 6 years ago

After this change https://github.com/status-im/status-react/pull/3889/files we started using fixed thread pool to execute web3 calls (sendWeb3Request and sendWeb3PrivateRequest)

It seems that those calls are getting queued and some time later they get executed one after another.

GitHub
issue 3690: Use thread pool instead of new threads on Android by pacamara · Pull Request #3889 · status-im/status-react
Fixes #3690 : "Use thread pool instead of new threads on Android" Summary: Replaces use of new Thread() with a global StatusThreadPoolExecutor class per the requirement in issue #3690. St...
pacamara commented 6 years ago

@dmitryn Ouch, yes it looks like the thread pool executor needs to be switched from unbounded queue to bounded with as @audriu suggested a higher max pool size. It's only a few lines which need changing, shall I submit a PR to fix it?

dmitryn commented 6 years ago

@pacamara yes, please go ahead and submit a PR. I'll test it then.

On Thu, Aug 16, 2018, 9:43 PM pacamara notifications@github.com wrote:

@dmitryn https://github.com/dmitryn Ouch, yes it looks like the thread pool executor needs to be switched from unbounded queue to bounded with as @audriu https://github.com/audriu suggested a higher max pool size. It's only a few lines which need changing, shall I submit a PR to fix it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/status-im/status-react/issues/5293#issuecomment-413645995, or mute the thread https://github.com/notifications/unsubscribe-auth/AABdHAJix0LSGf7JWYTGbbMlCrHZm1pbks5uRb1pgaJpZM4Vf8US .

pacamara commented 6 years ago

@dmitryn OK will do, should be ready soon. Apologies for the extra work generated by this, I should have thought more critically about what the threads in the pool are doing. :beers:

dmitryn commented 6 years ago

After user signs in, init-whisper creates discovery filter (newMessageFilter) which does polling every 500ms by calling shhext_getNewFilterMessages using status web3 provider: https://github.com/status-im/status-react/blob/develop/src/status_im/utils/web3_provider.cljs#L12 https://github.com/status-im/web3.js/blob/feature/shhext/lib/utils/config.js#L75 https://github.com/status-im/web3.js/blob/feature/shhext/lib/web3/requestmanager.js#L196

GitHub
status-im/web3.js
web3.js - Ethereum JavaScript API
GitHub
status-im/web3.js
web3.js - Ethereum JavaScript API
pacamara commented 6 years ago

@dmitryn @audriu OK done! Thinking more about it, decided it's a better fit to stick with current unbounded queue scheme, but increase size and allow core threads to time out. Behaviour verified via native android test, will post as gist. :beers: