Bitcoin Forum
May 08, 2024, 06:44:19 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Chain reorg question  (Read 152 times)
Gabrics (OP)
Full Member
***
Offline Offline

Activity: 183
Merit: 112

Just digging around


View Profile WWW
January 10, 2020, 08:26:16 PM
Merited by o_e_l_e_o (1)
 #1

Hi,

What happens after chain reorg with the transactions confirmed on the shorter chain (lets assume a somewhat possible 3 blocks reorg), but not included in the longer chain? I believe those are not in the mempool anymore as they were included in a block earlier.
Does Bitcoin core re-queues the transactions from the overwritten blocks?
Does it x-reference which transactions were included in the loosing but not he winning fork?

Can someone please someone enlighten me? Wink

Thanks
1715193859
Hero Member
*
Offline Offline

Posts: 1715193859

View Profile Personal Message (Offline)

Ignore
1715193859
Reply with quote  #2

1715193859
Report to moderator
1715193859
Hero Member
*
Offline Offline

Posts: 1715193859

View Profile Personal Message (Offline)

Ignore
1715193859
Reply with quote  #2

1715193859
Report to moderator
1715193859
Hero Member
*
Offline Offline

Posts: 1715193859

View Profile Personal Message (Offline)

Ignore
1715193859
Reply with quote  #2

1715193859
Report to moderator
"Bitcoin: mining our own business since 2009" -- Pieter Wuille
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715193859
Hero Member
*
Offline Offline

Posts: 1715193859

View Profile Personal Message (Offline)

Ignore
1715193859
Reply with quote  #2

1715193859
Report to moderator
1715193859
Hero Member
*
Offline Offline

Posts: 1715193859

View Profile Personal Message (Offline)

Ignore
1715193859
Reply with quote  #2

1715193859
Report to moderator
HeRetiK
Legendary
*
Offline Offline

Activity: 2926
Merit: 2091


Cashback 15%


View Profile
January 10, 2020, 08:38:13 PM
 #2

Does it x-reference which transactions were included in the loosing but not he winning fork?

No. Orphaned blocks and their transactions are not stored and referenced. Some blockchain explorers may store the orphaned blocks that they received in their database for public viewing, but that's unrelated to how the Bitcoin protocol works.


What happens after chain reorg with the transactions confirmed on the shorter chain (lets assume a somewhat possible 3 blocks reorg), but not included in the longer chain? I believe those are not in the mempool anymore as they were included in a block earlier.
Does Bitcoin core re-queues the transactions from the overwritten blocks?

"The" mempool does not exist. Every node has their own mempool. That means while nodes that followed the "losing" fork will have removed the transaction from their mempool, other nodes that have been following the "winning" fork all along will still have the transactions in their mempool -- given, of course, the transactions have not yet been included in the "winning" chain as well.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
January 10, 2020, 08:43:18 PM
 #3

If a block is orphaned most of the transactions will normally appear in the unorphaned block anyway (especially is consensus rules aren't changed).

In addition, I'm not sure about whether they'd be recycled back into the mempool but my instinct tells me they would... I know they're recycled the other way around so the signature doesn't have to be verified twice (once entering the mempool and once entering the block) so blocks can be added a lot faster.
Gabrics (OP)
Full Member
***
Offline Offline

Activity: 183
Merit: 112

Just digging around


View Profile WWW
January 11, 2020, 06:37:07 AM
 #4

Thanks for the inputs.
So I conclude:
The winning fork has its own version of pending transactions (mempool) which will still have the transactions not included in the overtaking chain. The nodes which followed the shorter version for a while will not have these, but will get to know about them when these pending transactions eventually will be included in a block.

Pretty smart IMHO Smiley
nc50lc
Legendary
*
Offline Offline

Activity: 2408
Merit: 5591


Self-proclaimed Genius


View Profile
January 11, 2020, 07:14:55 AM
 #5

Thanks for the inputs.
So I conclude:
The winning fork has its own version of pending transactions (mempool) which will still have the transactions not included in the overtaking chain. The nodes which followed the shorter version for a while will not have these, but will get to know about them when these pending transactions eventually will be included in a block.
They won't wait for those transaction to get included in a block in order to "know" them.
The transactions from the orphaned block that weren't included to the latest block(s) of the longest will be added to their mempool again.

The book: Mastering bitcoin used the term "queued up again" that lightly indicates that the node will move them from the orphaned block back to mempool.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
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!