-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High transaction volumes causing problems for miners #2333
Comments
Mining 1-2 MB blocks in ZCash makes no economic sense at all, bitcoin network pays several thousands dollars in fees for 1 MB blocks. If it takes more than 5 seconds to build new block template I encourage miners to mine empty blocks instead. So please either optimise it or remove 20% tax if you are not capable to deploy fix or raise fees to some decent level like 1000x from current price via hard fork. |
The former is a time spent on building merkle tree on a pool side, the latter is how much time spent to call It takes 3.26 seconds to produce block template with just 57 transactions in zcashd on decent hardware. Up to 3% of block time. |
+1 . I notice pool freezing, because of transaction spam. |
I am working on a patch to completely ignore mempool for now, will mine empty blocks. |
I'm seeing similar issues with slow getblocktemplate today. It hasn't been reported above, but I'm also seeing extremely large RSS after running a node for several weeks. After some digging, I think this could be related: bitcoin/bitcoin#6876. Leaving aside the issue of whether or not this is actually intentional transaction spam, I think it's fair to expect getblocktemplate to handle these worst-case situations without become extremely slow. |
I can confirm the issue as well. Those large spam blocks cause huge CPU usage and even crashed some of my nodes on lower-spec machines. |
Looks like it started around block #106077 (0000000030728e6b5b5484473812dd3c8ff4a857693fa1a48b457bfd72661c17) at 19:35:35 GMT yesterday (Sunday 30th Apr). Looking at a single sample, an amount of ZEC is unshielded (e.g. txn c18cd332d4e09b9e53a4a9e23d32206d997aa7ece9d7bd41872d1b6fd2bbca79 unshielded 82.74963511 ZEC into t1QMCGKi92v85Jmar2PD3SjQF8Eadbd2y4q), then sent in a single transaction with 100s of small outputs (e.g. t1QMCGKi92v85Jmar2PD3SjQF8Eadbd2y4q sent 82.74963511 ZEC to 1869 outputs - tx c00782ba18f2ae70b60b983fb273c2160020a10e4cab27db39e8a5c59320071c), which then seem to get (partially?) re-aggregated into other addresses. Some of the addresses involved t1VoqSxHh1ZnWBRFyHh6diWM4whimFzhjcJ have been around for a while (and have been part of similar patterns of transactions in the past). |
@sammy007 wore:
We are not "pretending that it's fine". This started at 9:08 UTC which was only 2 hours before you filed the ticket; please give us time to analyse the issue thoroughly. There's not going to be any knee-jerk reaction where we raise fees (at all, let alone by 1000-fold) unless we have strong evidence that it is required. Nor would raising fees require a hard fork, if it were required. |
Spam started more than 12 hours ago. And this is not my duty to watch network state. |
Indeed the large blocks do seem to have started around block 106077, which was at 2017-04-30 19:35:35 UTC, which is just under 20 hours ago. I stand corrected. |
@daira: My bad. It looks like the activity comes in waves. |
This is quite critical problem. Pool is suffering. |
We've been looking into this for the last ten hours or so. Here's what we've established:
We are still in the middle of investigating several parts of the code, and will post another update later on. |
Here is the log output for
The bottlenecks are:
|
As the primary bottleneck is transparent signature validation, I've opened #2335 to switch to libsecp256k1 for validation, which should be "anywhere between 2.5 and 5.5 times faster" per bitcoin/bitcoin#6954. @sammy007 @a1binos @zapv0lt @gobitfly @miningpoolhub please test this PR in your infrastructure and let me know how much latency this removes compared to the current release (either overall, or using the benchmark patch I linked in my last comment). |
Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
Intel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz
|
This is getting pretty severe now, zcashd becomes unresponsive and takes 100% CPU on 4 cores. My pool is not functioning correctly because zcashd is freezing, you cannot even do zcash-cli getinfo without it hanging for 10 seconds. the process is now back to 100% cpu usage, even going as high as 400% an error in the console window is [POOL] [ZCASH] (Thread 1) Could not parse rpc data from daemon instance 0 Check top, and zcashd is taking 100% CPU Usage. 100% per thread at 400% CPU ZCASHD is on ubuntu server 64bit with 48GB ram allocated to the virtual machine. ZCASHD debug.log spammed, with new blocks, when this is happening cpu usage spikes to 100% per CPU core. 2017-05-02 21:14:54 CreateNewBlock(): total size 1982104 |
@Xandrah per our chat in #zcash on Rocket.Chat, the reason for the lock-up (and likely for the ballooning memory usage) is because |
Got about the same results as Sammy with the pr. |
If the "activity" seems to be "in waves", i'd suggest that this is f2pool processing dayly payments. Its hashrate grew up noticebly the last few days. Unlike flypool - its the only matching in hash power opponent, which processes just-in-time on-the-fly micropayments when miners reach their "threshold" - f2pool makes all the payments (hundreds of tons of them, eventually) just 1 time per day, nearly the morning of China time. |
Red flag: Nathan mistakenly thought that the Incident Response team had required this ticket to be prioritised for 1.0.9. In fact the opposite was true, the Incident Response team (me as Executive Coordinator) had decided that we would take steps to fix the problem in the short term explicitly under the assumption that this would not imply that this ticket would be prioritised for 1.0.9. |
The next step on this issue is diagnosis, experimentation, and benchmarking. Why does this issue not happen in Bitcoin? |
For some historical context 0.11.x bitcoind had major performance issues(it couldn't properly handle mining/propagation of 1MB blocks without the relay network and had some pretty severe performance degradation with mempools larger than a few megabytes) these were fairly well known issues at the time, and these issues were largely resolved with the 0.12 bitcoin core release(diagnosis, experimentation, benchmarking and of course writing the code to resolve them was done). When I was operating a pool with 0.11.x I had to do a lot of mostly manual mempool monitoring and limiting to prevent GBT call times from being excessive. The performance issues were not due to a single cause but multiple factors and required major rewrites of a number of internal bitcoin core components to resolve. Since zcash is a fork of 0.11.2 I would expect it to have those same issues bitcoin had back then. You may want to rebase on top of bitcoin 0.14.1 since it has many performance improvements since 0.11.2. |
@jameshilliard Thanks for the context! Looks like we have our work cut out for us. |
Switch to libsecp256k1-based validation for ECDSA Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6983 - bitcoin/bitcoin#6954 Part of #2333.
Add ability for node to reject tx from mempool by number of tx inputs Implement short-term solution described in #2343 so that users can respond promptly to critical short-term problems caused by quadratic validation scaling, such as the getblocktemplate latency, block propagation latency, and mempool size inflation issues described in #2333.
#2342, adding the |
The original problem was mitigated by adding |
Note, incidentally, that we solved this without raising fees (denominated in ZEC) at all. |
There is tx spam ongoing, I see many blocks with up to 2 MB size with just ~50 tx. RPC
getblocktemplate
poll leads to timeouts (I have 5s timeout). This is not ok and I believegetblocktemplate
must take less than 5s on decent hardwareIntel(R) Xeon(R) CPU E3-1245 v5 @ 3.50GHz
. Load average is 1.5.You seems don't care about it, dev channel is silent and only cosmetic changes discussed there so far. It seems I must create a patch to ignore transactions at all and mine empty blocks if you are going to pretend that it's fine.
Consequences:
The text was updated successfully, but these errors were encountered: