Bitcoin Forum
April 28, 2024, 02:13:12 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Mempool taking a while to fill up on node  (Read 78 times)
NotATether (OP)
Legendary
*
Offline Offline

Activity: 1582
Merit: 6697


bitcoincleanup.com / bitmixlist.org


View Profile WWW
March 21, 2024, 08:26:35 AM
Merited by vapourminer (1), ABCbits (1)
 #1

After you start a Bitcoin Core node, it is very common to see that the node's mempool is empty for a long time, even if you are connected to a lot of outgoing peers. Why is that? Sometimes I notice that my node takes several minutes (as in almost an hour) to start fetching mempool transactions. It is a bit annoying and I would prefer the mempool transactions are loaded faster.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
"Your bitcoin is secured in a way that is physically impossible for others to access, no matter for what reason, no matter how good the excuse, no matter a majority of miners, no matter what." -- Greg Maxwell
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714313592
Hero Member
*
Offline Offline

Posts: 1714313592

View Profile Personal Message (Offline)

Ignore
1714313592
Reply with quote  #2

1714313592
Report to moderator
1714313592
Hero Member
*
Offline Offline

Posts: 1714313592

View Profile Personal Message (Offline)

Ignore
1714313592
Reply with quote  #2

1714313592
Report to moderator
pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10505



View Profile
March 21, 2024, 09:15:57 AM
Merited by vapourminer (1), NotATether (1), Charles-Tim (1)
 #2

After you start a Bitcoin Core node, it is very common to see that the node's mempool is empty for a long time,
Are you measuring this time after your node catches up with the network and syncs? Because if you are syncing and your UTXO set is not up to date, you are not capable of verifying newer transactions so your mempool is not supposed to fill up yet.

As far as I can tell the following is the code responsible for it; if your node is at least 24 hours behind it is considered in the IBD state so any tx messages that it receives (and supposed to place in its mempool) are ignored.
https://github.com/bitcoin/bitcoin/blob/bf1b6383dbbfdd0c96a161d4693a48bf3a6b6150/src/net_processing.cpp#L4292

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
NotATether (OP)
Legendary
*
Offline Offline

Activity: 1582
Merit: 6697


bitcoincleanup.com / bitmixlist.org


View Profile WWW
March 21, 2024, 12:13:02 PM
Merited by vjudeu (1)
 #3

After you start a Bitcoin Core node, it is very common to see that the node's mempool is empty for a long time,
Are you measuring this time after your node catches up with the network and syncs? Because if you are syncing and your UTXO set is not up to date, you are not capable of verifying newer transactions so your mempool is not supposed to fill up yet.

I was actually counting from the time Bitcoin core starts finding and connecting to other peers via DNS. debug.log usually has this message that says "waiting for 6000 seconds before querying DNS seeds", which is what I was referring to.

Quote
As far as I can tell the following is the code responsible for it; if your node is at least 24 hours behind it is considered in the IBD state so any tx messages that it receives (and supposed to place in its mempool) are ignored.
https://github.com/bitcoin/bitcoin/blob/bf1b6383dbbfdd0c96a161d4693a48bf3a6b6150/src/net_processing.cpp#L4292

That doesn't really make any sense to do that though. Sure the node will not have a way to verify that mempool transactions are valid, while it is doing IBD, but what is stopping it from just collecting the top few vMB (like the default 300vMB) of transactions, and then only verify those transactions after the IBD is done and discard or keep them accordingly?

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
vjudeu
Hero Member
*****
Offline Offline

Activity: 664
Merit: 1527



View Profile
March 21, 2024, 12:37:17 PM
Merited by pooya87 (2), ABCbits (2), vapourminer (1), Charles-Tim (1)
 #4

Quote
what is stopping it from just collecting the top few vMB (like the default 300vMB) of transactions, and then only verify those transactions after the IBD is done and discard or keep them accordingly?
You can do so, if you really want. The software is just not written in that way. There are many ways to optimize things, for example you could download things backwards, and start from the last block. Then, initially, your node would have SPV-level, and it would keep downloading things, proving that everything is correct, and is more and more deeply confirmed. And finally, you could reach the Genesis Block, and be sure that everything is valid. The only reason why it is not the case, is that nobody implemented it in that way, and you have only full nodes, or SPV nodes, and you don't have for example "SPV nodes, which are gradually converted into full nodes".

Also, in the same way, technically you could have things like "unprune blocks", which could allow going from 1 GB last blocks, for example into 100 GB last blocks, without waiting for 99 GB new blocks, but you simply don't have such features, because nobody wrote it in that way (even though it is possible to do so).

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10505



View Profile
March 21, 2024, 01:48:25 PM
 #5

That doesn't really make any sense to do that though. Sure the node will not have a way to verify that mempool transactions are valid, while it is doing IBD, but what is stopping it from just collecting the top few vMB (like the default 300vMB) of transactions, and then only verify those transactions after the IBD is done and discard or keep them accordingly?
It requires a lot of developers' work to write a ton of code handling these cases and rewriting a lot of the logic that makes your node work.

For example when you receive a tx, it is handled as a peer sending you that tx and that peer is going to be evaluated so that you can "ban" it in case it was malicious and were sending you invalid txs. The devs have to re-write the code to handle this case and skip the peer score logic.

They'll also have to write additional logic to skip a bunch of your mempool preference such as minimum fee since your node has no idea what fee they're paying (UTXO set not yet up-to-date).

It's just easier to ignore the tx when your node is during IBD.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!