Author

Topic: Do nodes share their mempool with each other? (Read 186 times)

hero member
Activity: 630
Merit: 731
Bitcoin g33k
December 23, 2022, 10:36:00 AM
#14
When a new node connects to the network, other nodes start to share new transactions with this new node they got. But do they share their mempool, when a node disconnects from the network for some time for example? I think that the mempool size is too large and it would be difficult to share their mempool state, but maybe I'm wrong...

No, the mempool is locally on each node and is not shared. A node (or better said the node operator) can decide for itself which transactions to pull and include in the local mempool, it can be configured on the node which transactions should be considered for a new block creation and on which criteria (thresholds) based upon.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
You'd have to burn around 7.5BTC to fully exhaust everyone's mempool
And let's not forget that if some crazy multi-millionaire ever thought of executing this meaningless attack, nodes could just adjust the mempool size limit and make it ever more costly to do it again.

Anyway, the fact that it costs 5 digits to pull off a successful mempool spam attack for no material gain shows how strong Bitcoin (and the Bitcoin price in particular) has become.
It also shows that the block space is expensive. If block size was 10 MBs, spamming the UTXO set (or blockchain in general) would be about 10 times cheaper. See what happens with BSV, where they have 1 GB blocks, and some even store movies in.
hero member
Activity: 1904
Merit: 541
When a new node connects to the network, other nodes start to share new transactions with this new node they got. But do they share their mempool, when a node disconnects from the network for some time for example? I think that the mempool size is too large and it would be difficult to share their mempool state, but maybe I'm wrong...

As far as I know mempool is like a waiting buffer or a waiting place for all the unconfirmed transaction before they are added to the
blockchain. While the Nodes is the computer that run the network software. Or in other terms it forms a network where
information can be shared or transacted.

Where the major function of Nodes are routing, storage, mining and wallet services. So if you know the difference beween Nodes and the mempool dude, You can able to find the right answer to your question anyway.






legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
I'm not a programmer. I believe it is possible to spam the mempool if nodes would keep the entire mempool. A single person can generate 1M transactions by burning 0.5 BTC. The mempool would be unable to store all of the valid transactions due to RAM usage. I suppose some nodes might keep some mempool transactions while keeping others on different nodes.
This type of spam like any other type of spam requires paying a lot of fee in total specially since it also increases the fee so for example if they start at 1 sat/vb they will increase it to 100 sat/vb while their older transactions with low fee would be dropped out of mempool.
With 0.5BTC you can only create about roughly 100k transactions not a million.

Assuming average tx size is 200vb, then that would take up 20MB of a mempool.

You'd have to burn around 7.5BTC to fully exhaust everyone's mempool.

Anyway, the fact that it costs 5 digits to pull off a successful mempool spam attack for no material gain shows how strong Bitcoin (and the Bitcoin price in particular) has become.
legendary
Activity: 3472
Merit: 10611
I'm not a programmer. I believe it is possible to spam the mempool if nodes would keep the entire mempool. A single person can generate 1M transactions by burning 0.5 BTC. The mempool would be unable to store all of the valid transactions due to RAM usage. I suppose some nodes might keep some mempool transactions while keeping others on different nodes.
This type of spam like any other type of spam requires paying a lot of fee in total specially since it also increases the fee so for example if they start at 1 sat/vb they will increase it to 100 sat/vb while their older transactions with low fee would be dropped out of mempool.
With 0.5BTC you can only create about roughly 100k transactions not a million.
jr. member
Activity: 84
Merit: 1
PandoraCash.com anonymous money
December 22, 2022, 09:55:51 PM
#9
When a new node connects to the network, other nodes start to share new transactions with this new node they got. But do they share their mempool, when a node disconnects from the network for some time for example? I think that the mempool size is too large and it would be difficult to share their mempool state, but maybe I'm wrong...

I'm not a programmer. I believe it is possible to spam the mempool if nodes would keep the entire mempool. A single person can generate 1M transactions by burning 0.5 BTC. The mempool would be unable to store all of the valid transactions due to RAM usage. I suppose some nodes might keep some mempool transactions while keeping others on different nodes.
sr. member
Activity: 1372
Merit: 348
December 22, 2022, 02:57:55 AM
#8
Then these nodes communicate with its peers to check the validity of transaction on the mempool.
They communicate to exchange unconfirmed transactions. Not to check / question its validity. That happens locally, and is done by each node individually.

Thank you for the correction and I stand corrected, yeah they communicate exchange information about unconfirmed transaction, no excuses I messed up there  Grin.
I messed up this line
Quote
Each Bitcoin node has its own mempool, where it stores the queue of transactions that it has checked and considers valid.

In addition we can also see the difference of mempool and blockchain function in this quotation.

Quote
The memory pool holds “fresh” or unconfirmed transactions (stored as individual transactions).
The blockchain holds “archived” or confirmed transactions  (packaged in “blocks”).

legendary
Activity: 1512
Merit: 7340
Farewell, Leo
December 21, 2022, 04:52:20 PM
#7
But do they share their mempool, when a node disconnects from the network for some time for example?
A node that disconnects from the network has to come back online, and reach the chain tip to start receiving unconfirmed transactions. Obviously they can't share the mempool with an offline computer.

Then these nodes communicate with its peers to check the validity of transaction on the mempool.
They communicate to exchange unconfirmed transactions. Not to check / question its validity. That happens locally, and is done by each node individually.
sr. member
Activity: 1372
Merit: 348
December 21, 2022, 04:28:58 PM
#6
Nodes serves as gateway to the mempool[1] so there is a need for nodes to share their mempool with each other in order for other nodes (peers) to perform its own check for the validity of transactions.

Quote
If the transaction passes the node's checks, the transaction is added to the node's mempool. That node will also broadcast it to other nodes, called peers. Each of these peers will perform its own checks — adding valid transactions to its mempool and then broadcasting the transaction along to its peers.

Here is a good presentation by Babypips about how mempool is shared by nodes[2]

It was stated that every node on Bitcoin network share information about new transaction, since transaction is not directly added to the blockchain they are first collected and stored at mempool.  Then these nodes communicate with its peers to check the validity of transaction on after performing its own check and adds valid transaction to the mempool.  



[1] https://www.blocknative.com/blog/mempool-nodes
[2] https://www.babypips.com/crypto/learn/what-is-a-mempool#:~:text=Also%20known%20as%20%E2%80%9Cmempool%E2%80%9D%20for,to%20a%20newly%20created%20block.
legendary
Activity: 2464
Merit: 4415
🔐BitcoinMessage.Tools🔑
December 21, 2022, 11:56:04 AM
#5
When a new node connects to the network, other nodes start to share new transactions with this new node they got. But do they share their mempool, when a node disconnects from the network for some time for example? I think that the mempool size is too large and it would be difficult to share their mempool state, but maybe I'm wrong...
A particular full node has its own subjective view regarding what to consider valid in the blockchain: it receives pieces of information from other nodes, verifies if everything is okay, and adds transactions to its local temporary storage of yet-to-be-confirmed financial transactions. Mempool is a completely optional feature: you, as an operator of your personal node, can decide whether to allocate memory for those unconfirmed transactions or not. The only drawback of you not having a mempool is that you can't tell other nodes about unconfirmed transactions, and you even can't see them until they get into the mined block. Some will say that without mempool, you will have an incomplete picture of the blockchain, and your node should no longer be considered "full" because you can't conduct full verification.
hero member
Activity: 1036
Merit: 642
Magic
December 21, 2022, 11:11:00 AM
#4
But do they share their mempool, when a node disconnects from the network for some time for example?

When the node goes offline it will not share any information, it will simply be updated as soon as it comes back online.


Quote
I think that the mempool size is too large and it would be difficult to share their mempool state, but maybe I'm wrong...

The mempool is quite small as it will only contain unconfirmed transactions (usually a few MB). If a transaction has a too small fee, it will be deleted from the mempool after some days, so the mempool will never be to big.

What you maybe mean is the blockchain, that is a few hundred GB of data. This will indeed take some days to synchronies if you start your node for the first time.
legendary
Activity: 952
Merit: 1386
December 21, 2022, 07:38:59 AM
#3
When a new node connects to the network, other nodes start to share new transactions with this new node they got. But do they share their mempool, when a node disconnects from the network for some time for example? I think that the mempool size is too large and it would be difficult to share their mempool state, but maybe I'm wrong...

Think about it that way - transaction could be unconfirmed (is stored in the mempool) or confirmed (kept in block chain). Each new transaction must be populated  and known to other nodes - otherwise miners would not be aware given transaction exists and will not be able to include it in their mined blocks.

Why do you think mempool is 'too large' to be synchronised?
legendary
Activity: 3472
Merit: 10611
December 21, 2022, 07:37:52 AM
#2
There is a "mempool" message defined in the P2P protocol that the nodes can send each other to receive a list of transaction hashes that is in the other node's mempool and then request to receive any of the transactions they don't have using a "getdata" message.
jr. member
Activity: 33
Merit: 22
December 21, 2022, 07:22:22 AM
#1
When a new node connects to the network, other nodes start to share new transactions with this new node they got. But do they share their mempool, when a node disconnects from the network for some time for example? I think that the mempool size is too large and it would be difficult to share their mempool state, but maybe I'm wrong...
Jump to: