LearnBitcoin

Bitcoin Dev Archive 2013

Access to Mempool

2 messages, 28 Dec 2013. Started by Jeremy Spilman.

Jeremy Spilman, Mike Hearn

Permalink Original thread on gnusha.org

Jeremy Spilman permalink original

I was reading there are some commands to access a peer's mempool state. The purpose being to allow miners to recover faster after a reboot, I think?

Reading peer mempool definitely allows recovering faster after a reboot. So does persisting mempool in a database locally. But what can you learn about a node from its mempool? Basically, are there distinguishing features in the mempool, or could there be?

Are there transactions you can receive which go into your own mempool but which you don't forward? How about 'nLockTime' transactions?

Is this new feature off by default? Which clients support it?

By the way, are there recommended places to go to compare features implemented by different wallet software?

Sorry, so many questions...

Mike Hearn in reply to Jeremy Spilman permalink original
Quoted text (5 lines)
>
> I was reading there are some commands to access a peer's mempool state.
> The purpose being to allow miners to recover faster after a reboot, I
> think?
>

The "mempool" command allows nodes to request the contents of a peers memory pool, yes.

It is currently used by SPV clients to find transactions that were broadcast before they were started up (but not yet confirmed).

Quoted text (2 lines)
> Reading peer mempool definitely allows recovering faster after a reboot.
> So does persisting mempool in a database locally.

0.9 has code to save the mempool to disk.

Quoted text (4 lines)
> But what can you learn about a node from its mempool? Basically, are there
> distinguishing
> features in the mempool, or could there be?
>

Er, you mean, distinguishing features beyond the nodes IP address?

The contents of the mempool may vary depending on when the node was started and what it saw at what times. I guess it's distinguishing in a way, but not in any important way. Nodes are not intended to be completely indistinguishable, just indistinguishable enough that it doesn't matter which you connect to.

Quoted text (2 lines)
> Are there transactions you can receive which go into your own mempool but
> which you don't forward?

I don't think so, unless there are quirks to do with sendrawtransaction RPCs or strangely crafted wallet spends. Normally if a tx is in the mempool it will be relayed.

Quoted text (3 lines)
> By the way, are there recommended places to go to compare features
> implemented by different wallet software?
>

I don't know of any such place, but I'm sure people have compiled tables somewhere.