Optimizing P2P Mempool Data without RPC

8 replies 103 views
bear21Full Member
Posts: 8 · Reputation: 441
#1Sep 19, 2018, 11:52 PM
Been diving deep into on-chain data and hit this crazy latency wall. Using the standard Bitcoin Core RPCs is just too slow with the disk I/O and all that indexing mess. So I made this thing called Mempool Oracle, a custom C-engine that skips the RPC nonsense and talks directly to the P2P network.
2 Reply Quote Share
j0hn.ga5Newbie
Posts: 98 · Reputation: 19
#2Sep 20, 2018, 07:58 AM
Totally makes sense to skip the slow RPCs for mempool data. I mean, why keep hitting `getrawmempool` over and over and then get shocked when your node starts acting up? But honestly, Bitcoin Core has better options already like ZMQ or direct connections. So, not a wild idea, just needs better phrasing.
3 Reply Quote Share
bear21Full Member
Posts: 8 · Reputation: 441
#3Sep 21, 2018, 01:15 PM
Thanks for the feedback, BattleDog. You hit the nail on the head about the terminology. I get it, calling it 'interception' is a bit of a stretch. It’s really just a fancy listener that connects like a regular peer and gathers the data without messing with relaying.
4 Reply Quote Share
gang2015Member
Posts: 682 · Reputation: 62
#4Sep 21, 2018, 05:29 PM
What’s with the license though? I couldn’t find any on the repo I checked out. No license usually means all rights reserved, right? Just a heads-up for anyone who wants to use it.
0 Reply Quote Share
0xNodeMember
Posts: 671 · Reputation: 80
#5Sep 21, 2018, 07:55 PM
Is this thing only for the mempool? Could I possibly fetch a confirmed TX from days ago just using memory? Like, if I prune the blockchain but keep the UTXO sets around... that could be super useful.
4 Reply Quote Share
bear21Full Member
Posts: 8 · Reputation: 441
#6Sep 21, 2018, 10:30 PM
@ABCbits, you’re right. I messed up with the license when I first pushed the code. Just added the MIT license now, so anyone can use it properly. @NotATether, right now the engine’s all about the mempool for live unconfirmed transactions. But yeah, you could tweak it for historical TXs, though memory limits would be a big problem.
2 Reply Quote Share
0xNodeMember
Posts: 671 · Reputation: 80
#7Sep 22, 2018, 12:20 AM
Sure, you might grab transactions really fast, but honestly, only mining pools are gonna profit from that. Plus, you need a solid internet connection. Still, sounds interesting.
2 Reply Quote Share
gang2015Member
Posts: 682 · Reputation: 62
#8Sep 24, 2018, 02:54 AM
You mentioned automatic trading as a benefit, but is there anything else? I mean, mining pools are probably already using specialized tools for unconfirmed TXs to make blocks quickly.
6 Reply Quote Share
bear21Full Member
Posts: 8 · Reputation: 441
#9Sep 24, 2018, 07:38 AM
@NotATether and @ABCbits, great questions! Mining pools focus on fee revenue, but I’m all about the info value. They parse unconfirmed TXs for blocks, but my engine looks at the lag between Layer 1 and Layer 2 markets.
0 Reply Quote Share

Related topics