[WIP] sync mempool after new block #7955

pull pstratem wants to merge 1 commits into bitcoin:master from pstratem:2016-04-26-mempoolsync changing 1 files +8 −0
  1. pstratem commented at 5:23 AM on April 27, 2016: contributor

    No description provided.

  2. Attempt to sync mempool after new block with nodes that support feefilter command. e8aa85dd11
  3. gmaxwell commented at 5:47 AM on April 27, 2016: contributor

    Alas, I like this a lot but I think we can't use the existing mempool command for it: It's not filtered by set inventory known. (it's also computationally expensive even when fee filter is used).

    What I'd like is a "TOPMEMPSYNC", which is functionally equal to mempool but considers only the top 2*BLK_SIZE txn in 'fee-rate' order (actual order can be implementation defined but should approximate mining preferences), and also filters its output through setinventoryknown. Then you can pick a peer and keep pulling from it every block and get one more block worth of transactions one block ahead of needing them.

  4. pstratem commented at 8:02 AM on April 27, 2016: contributor

    @gmaxwell agreed, i opened this pull since i'm actually using very similar code for a mining setup where the pool's getblocktemplate node has maxmempool=2 for performance reasons

  5. gmaxwell commented at 8:33 AM on April 27, 2016: contributor

    Go make a pass at actually implementing what I described? w/ the indexes in place it should take less than a half hour to give it a shot. (also, I'd like it for the block relay testing I'm doing... having to wait hours after it starts to get good stats is lame).

  6. pstratem commented at 8:41 AM on April 27, 2016: contributor

    @gmaxwell will do, i'm not sure you want to filter through setinventoryknown though, since you might have filtered things out for having too low a fee which are now valid

  7. gmaxwell commented at 9:04 AM on April 27, 2016: contributor

    To bad, so sad. -- it doesn't need to be perfect, ... otherwise the overhead of sending 2 blocks worth where it would end up sending the same txn over and over again makes it less attractive. With the filtering it would add basically no protocol overhead to run this with a single peer for the first 24 hours that you're up or so.

  8. pstratem commented at 9:18 AM on April 27, 2016: contributor

    @gmaxwell it's just sending the transaction ids, 2 * MAX_BLOCK_SIZE / 250 * 23 = 256000

    which yeah isn't optimal... but i guess it could be short ids actually? it is once per block

  9. gmaxwell commented at 9:42 AM on April 27, 2016: contributor

    Overhead equal to 1/4 a maximum size block, every block.. vs no overhead compared to regular relay (only sending IDs you haven't seen before)... it's not even comparable. The short ID stuff works much better in the context of blocks because you don't need them for fetching and can salt with the block hash.

  10. MarcoFalke added the label P2P on Apr 27, 2016
  11. pstratem commented at 2:36 AM on April 28, 2016: contributor

    @gmaxwell i guess i need a BIP if im going to add a protocol message?

  12. gmaxwell commented at 6:16 AM on April 28, 2016: contributor

    Not to write the code and begin testing with it! It would be such a simple spec, there would be no reason to not go write a BIP for it right away too...

    Though I also think it would get subsumed by a greater mempool sync BIP later. But that is going to take a while, this can easily be done now and would be useful now.

  13. pstratem commented at 1:21 AM on May 17, 2016: contributor

    Moving to issue

  14. pstratem closed this on May 17, 2016

  15. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-19 00:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me