Closed Overtorment closed 10 months ago
the simplest reproduce via cli:
ghost@aaa ~/Documents/BlueWallet (master) $ echo '{"id": 1, "method": "mempool.get_fee_histogram"}' | timeout 2 openssl s_client -quiet -connect mainnet.foundationdevices.com:50002 2>/dev/null
{"id":1,"jsonrpc":"2.0","result":[[27889368,100881],[22845567,126619],[22724691,137840],[22600154,98850],[22486736,308271],[22486735,1719],[22369618,421321],[22369617,1728],[22023025,160777],[20069870,235856],[19884105,365156],[19346694,238659],[19259937,261092],[19088738,451530],[19004274,274935],[17179864,433889],[15561473,449891],[14081858,547996],[13944697,514368],[13721939,1227255],[13721938,826320],[13721867,313],[13463845,1199234],[13421771,7720317],[13421770,20800],[13421769,4480],[13421765,320],[13421757,320],[13421741,640],[13379958,756597],[13215282,7425741],[13215281,650],[13215253,325],[12897798,360093],[3179089,2429899],[1075353,2808101],[378110,3091556],[286695,3403828],[247651,3750236],[147806,4118023],[89953,4523492],[49660,5003589],[49577,5560166],[42737,5942062],[30447,6640875],[25266,7314508],[3,12497731],[2,12454954],[1,41262532],[0,14505752]]}
ghost@aaa ~/Documents/BlueWallet (master) $ date
Thu 28 Sep 2023 04:33:08 PM BST
ghost@aaa ~/Documents/BlueWallet (master) $ echo '{"id": 1, "method": "mempool.get_fee_histogram"}' | timeout 2 openssl s_client -quiet -connect mainnet.foundationdevices.com:50002 2>/dev/null
{"id":1,"jsonrpc":"2.0","result":[[41,100873],[26,139494],[23,102018],[20,130427],[17,206945],[16,139543],[14,197296],[12,208098],[10,220605],[7,228755],[6,239697],[4,2103924],[3,8113006],[2,32246863],[1,77769095],[0,37829703]]}
ghost@aaa ~/Documents/BlueWallet (master) $ date
Thu 28 Sep 2023 04:33:13 PM BST
You're probably right there may be a bug. I'm looking at the code in Fulcrum and comparing it to ElectrumX: https://github.com/spesmilo/electrumx/blob/bbd985a95db63cada13254bb766f174e9ab674d0/electrumx/server/mempool.py#L154. I tried to just emulate their algorithm but I see they have since updated it.
I will work on porting over the new changes to the algorithm.
Ok, I pushed this commit: https://github.com/cculianu/Fulcrum/commit/1ad892de035b049fffcfe24ef939007a32725b09 -- this should address the issue.
Note that I am traveling and thus may not be able to do a new release anytime soon to fix this. :/
Is there any way you can build Fulcrum yourself against master and test this and provide feedback that the issue is indeed solve? I was unable to reproduce because I don't have my server online right now.
Ok well, 3 things:
.. it's also possible this is not a Fulcrum issue at all but rather the server itself is griefing its users for some reason or other (there are incentives to do this, of course, if one is also a miner).
Yeah it's weird that the same server can return normal and faulty fees in consecutive requests. Probably need to reach out to Foundationdevices to investigate
Hey, I run the fulcrum node at Foundation. This is indeed an odd situation. I want to reassure anybody coming across this issue that we are not involved in manipulating the fees reported by our nodes in any way. We don't mine or encourage our users to pay high fees unnecessarily. The reason we haven't seen this issue in the past is because we don't use fulcrum to report fees to our Envoy users, but rather mempool.space
Some notes about our setup: we run two load-balanced fulcrum servers based on a "least connections" selection. We do this so we can safely update without downtime for our users by shifting traffic to one of the nodes, upgrading the other, and repeating that process until both are updated. So, maybe the weirdness seen where consecutive requests will return different results is due to that fact? Another thing is that we run our config with peering=false
- not sure if that is relevant or not.
Anyway, apologies for the issues on our end. I will upgrade to 1.9.2
today, and hopefully that resolves the issue.
@nickmonad Thanks for chiming in with more info on the issue. Sorry for insinuating it might be intentional on your part -- it's just such a mystery is all! I believe you that you aren't involved in manipulating fees and who knows maybe it is some esoteric bug. I do hope that the new code and the new setup will mean everything is resolved. Thanks for responding and being informative and helpful!
@cculianu All good, thanks for cutting a new release with a possible fix.
@Overtorment I ran your mempool.get_fee_histogram
commands above on our updated servers and it seems to report consistent, expected results?
Well since I haven't heard any complaints about this continuing to happen.. will close this issue. If it happens can re-open.
i was debugging unsusually high fees, and discovered that Fulcrum electrum server run by Foundationdevices occasionally returns bogus fee histogram, which leads to unusually high fees for the clients:
this is reproduceable occasionally (maybe its this specific server issue..?), and adequate response looks like this (that was run few minutes apart):