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

Subscription "newPendingTransactions" doesn't work properly #8714

Closed
madnadyka opened this issue May 25, 2018 · 15 comments
Closed

Subscription "newPendingTransactions" doesn't work properly #8714

madnadyka opened this issue May 25, 2018 · 15 comments
Assignees
Labels
F3-annoyance 💩 The client behaves within expectations, however this “expected behaviour” itself is at issue. M6-rpcapi 📣 RPC API. P5-sometimesoon 🌲 Issue is worth doing soon. Z0-unconfirmed 🤔 Issue might be valid, but it’s not yet known.
Milestone

Comments

@madnadyka
Copy link

I'm running:

  • Which Parity version?: 1.11.1
  • Which operating system?: Linux
  • How installed?: binaries
  • Are you fully synchronized?: no
  • Which network are you connected to?: ethereum
  • Did you try to restart the node?: yes

Subscription "newPendingTransactions" doesn't work properly - I am receiving only small part of all new pending transactions. In version 1.10.4 this subscription is ok.

@Tbaut
Copy link
Contributor

Tbaut commented May 25, 2018

Can you provide an example as well as how you subscribe to new pending transactions and verify that it's not working as expected?

@Tbaut Tbaut added P5-sometimesoon 🌲 Issue is worth doing soon. F3-annoyance 💩 The client behaves within expectations, however this “expected behaviour” itself is at issue. M6-rpcapi 📣 RPC API. labels May 25, 2018
@Tbaut Tbaut added this to the 1.12 milestone May 25, 2018
@iFA88
Copy link

iFA88 commented May 25, 2018

I also use this, it seems it works without issue with Parity/v1.11.1-beta-6654d0216-20180515/x86_64-linux-gnu/rustc1.25.0. I receive about 4-10 new pending TX in every 10 sec.

@madnadyka
Copy link
Author

I display in my program quantity of received by subscription pending tx per minute. Displaying data is a dictionary, where key is timestamp and value is tx quantity (not sorted by timestamp, yellow color) :
parity v1.10.4:
2018-05-27 20 20 17
parity v1.11.1:
2018-05-27 20 59 34
and after restart node parity v1.11.1:
2018-05-27 21 26 08

@Tbaut
Copy link
Contributor

Tbaut commented May 28, 2018

Can you share how you subscribe? This visual way of checking is not very straightforward for us to pinpoint problems?
Did you have a look at the resources of the computer? It could also miss events because of lagging behind (v1.11.1 is more demanding in terms of CPU usage: #8696). A safer way to make sure not to miss any transaction would be to use the trace API: https://wiki.parity.io/JSONRPC-trace-module.html)

@madnadyka
Copy link
Author

By websocket in my program (python):

def subscribe_transactions(self):
self.ws.send_str('{"jsonrpc":"2.0","id": 2, "method": "eth_subscribe", "params": ["newPendingTransactions"]}')

CPU of server with my program - 2 GB, CPU of server with node - 8 GB

@Tbaut Tbaut added the Z0-unconfirmed 🤔 Issue might be valid, but it’s not yet known. label May 28, 2018
@Tbaut
Copy link
Contributor

Tbaut commented May 28, 2018

This could be due to the new transaction queue, @tomusdrw can you have a look?

@tomusdrw tomusdrw self-assigned this Jun 1, 2018
@Tbaut
Copy link
Contributor

Tbaut commented Jun 11, 2018

we can't downgrade due to the recent security alert

You can downgrade to the latest stable release, v1.10.6 that also has the security patch ;)

@tomusdrw
Copy link
Collaborator

@madnadyka I can't reproduce the issue on 11.4, pending subscription returns all transactions that are entering the pool. Perhaps your pool is full and only small portion of transactions actually get there? Try increasing the pool size with --txqueue-size=32000 for instance.

You can compare the results by running with -ltxqueue=debug (look for Added to the pool) and the pending filter, for me the amounts of the two are equal.
The only difference is that 1.11 returns imports in batches (for performance reasons) - if we are attempting to import a larger set of transactions the notification will be triggered only after the entire batch is imported.

@iFA88
Copy link

iFA88 commented Jun 29, 2018

Few months before I have issued also, that the parity_pendingTransactions request sometimes hanging forever, but then I have used filter to get the pending transactions.

@tomusdrw
Copy link
Collaborator

Yeah, parity_pendingTransations is quite heavy (especially with large pools), cause it has to get the entire pending set and serialize all transactions to JSON, the response payload on it's own is huge.

In 1.11.x series it has an optional limit parameter, that allows you to query only the tip of the pool (like 100 best transactions) - that should work much faster.

@iFA88
Copy link

iFA88 commented Jun 29, 2018

Getting 10-15k pending transaction have taken 6-12 sec. This is a great speed, idk why was hanging.

@5chdn 5chdn modified the milestones: 2.0, 2.1 Jul 17, 2018
@5chdn 5chdn modified the milestones: 2.1, 2.2 Sep 11, 2018
@tzapu
Copy link
Contributor

tzapu commented Sep 12, 2018

@5chdn i don't think i have seen the limit param in the docs for parity_pendingTransations, is there some place specific we should look for the latest docs and not in the wiki? Does it have, or could it have a "just hashes" flag as well? :P

@5chdn
Copy link
Contributor

5chdn commented Sep 12, 2018

Yeah, the wiki. We are having automated API docs soon (tm), we just need to make the CI pipeline actually finish.

@tzapu
Copy link
Contributor

tzapu commented Sep 12, 2018

@madnadyka if still of any interest, i have tested newPendingTransactions with almost all versions of parity since it was added, it always seemed fine, including 1.11.xx

@5chdn 5chdn modified the milestones: 2.2, 2.3 Oct 29, 2018
@tomusdrw
Copy link
Collaborator

tomusdrw commented Nov 8, 2018

Please re-open if the issues persists. We now also have #9745 to efficiently query the pool content.

@tomusdrw tomusdrw closed this as completed Nov 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F3-annoyance 💩 The client behaves within expectations, however this “expected behaviour” itself is at issue. M6-rpcapi 📣 RPC API. P5-sometimesoon 🌲 Issue is worth doing soon. Z0-unconfirmed 🤔 Issue might be valid, but it’s not yet known.
Projects
None yet
Development

No branches or pull requests

6 participants