Bitcoin Forum
May 17, 2024, 01:53:59 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why do nodes receive unconfirmed transactions while they're at IBD?  (Read 97 times)
BlackHatCoiner (OP)
Legendary
*
Online Online

Activity: 1526
Merit: 7377


Farewell, Leo


View Profile
October 29, 2022, 07:51:09 PM
 #1

I was just testing a clean machine and realized this; why does a syncing node have a mempool? A node that hasn't reached the chain tip can't know if the received unconfirmed transactions are valid or not. I don't know if it propagates them too (haven't made any github search), but since it receives them, and keeps them in memory (confirmed it with a getmempoolinfo), I presume that it's reasonable to propagate them as well.

But, since it hasn't reached the chain tip, the conclusion is that it receives (and propagates) transactions whose validity hasn't been checked (by consensus rules' enforcement). Is this true? If yes, why? Can't there be an attack established on non-synced nodes who'll propagate invalid transactions and have their IP blacklisted?

I'm confident that there's always an answer for everything in Bitcoin Core.

Edit: I misinterpreted getmempoolinfo. With a getrawmempool, it returns an empty array. So... no mempool for non-synced nodes?

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
pooya87
Legendary
*
Offline Offline

Activity: 3458
Merit: 10564



View Profile
October 30, 2022, 04:19:52 AM
Last edit: October 30, 2022, 04:35:22 AM by pooya87
 #2

There are two ways to send mempool transactions. One is through a tx message which is rejected right away if it is received by a node that is currently syncing (Initial Block Download)
https://github.com/bitcoin/bitcoin/blob/4f270d2b63913b86c4366756031c5003837075d6/src/net_processing.cpp#L3977

Another way (the main way) is through an inv message which is rejected only if the txrelay returns false. Although I can't figure out whether there is a connection with IBD and if this line returns false if the node is during IBD.
https://github.com/bitcoin/bitcoin/blob/4f270d2b63913b86c4366756031c5003837075d6/src/net_processing.cpp#L1062-L1063

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
nc50lc
Legendary
*
Offline Offline

Activity: 2422
Merit: 5604


Self-proclaimed Genius


View Profile
October 30, 2022, 04:28:49 AM
 #3

Edit: I misinterpreted getmempoolinfo. With a getrawmempool, it returns an empty array. So... no mempool for non-synced nodes?
getmempoolinfo should also return with empty "size" if it's empty.
This is a wild guess but I think you've used getmemoryinfo instead of getmempoolinfo the first time you tried.

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
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!