FlatPepsi (OP)
Newbie
Offline
Activity: 8
Merit: 1
|
|
July 16, 2018, 04:12:02 PM |
|
Let's say I start up a new full node, with nothing but the code & the embedded Genesis block. My node then asks nearby nodes for blocks to build up my chain.
As I start getting blocks 1, 2, and 3 from 2009, is each block validated using today's current rules?
I'm thinking that there has to have been ancient blocks in the chain that, at the time were valid, but new security rules have since made them invalid. For example, does famous block 501726 still cause problems?
|
|
|
|
|
|
|
|
"The nature of Bitcoin is such that once version 0.1 was released, the
core design was set in stone for the rest of its lifetime." -- Satoshi
|
|
|
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
|
|
|
|
Kallisteiros
Copper Member
Member
Offline
Activity: 85
Merit: 122
|
Yes, the full node doesn't just blindly trust other nodes with whatever blocks they send your way, but actually validates every block and all transactions in it starting from genesis. If a block turns out to be invalid, it is discarded, and the peer giving you such invalid blocks may be banned.
When consensus rules are updated, and a new version is out, the new rules are usually applied starting from specific future point. Within the code, there is a switch saying: if the block height is less than this, validate it using old rules, otherwise with the new ones. Also keep in mind that this creates a hard fork, causing the nodes with the old and new software ban each other and have two different chains.
|
|
|
|
Kallisteiros
Copper Member
Member
Offline
Activity: 85
Merit: 122
|
|
July 16, 2018, 09:01:01 PM |
|
With that being said, block 501726 was always valid under all consensus rules, even though it was a weird block. Some software might have choked on it, but the network continued to build on top of it.
|
|
|
|
aleksej996
Sr. Member
Offline
Activity: 490
Merit: 389
Do not trust the government
|
|
July 17, 2018, 01:30:32 PM |
|
By default Bitcoin Core assumes blocks that came before a block with certain hard-coded hex value are valid. In the latest version, all blocks before block no. 506067 are assumed valid unless specified otherwise with an -assumevalid argument.
|
|
|
|
Kallisteiros
Copper Member
Member
Offline
Activity: 85
Merit: 122
|
|
July 17, 2018, 02:28:54 PM |
|
Ah right, forgot about that update. There are also checkpoints, which force selection of a particular chain (go up to block 295000), but IIRC the validation was still performed, unlike with assumevalid (that allows to skip validation but does not the node to accept the chain if a valid longer one with more work is presented).
|
|
|
|
achow101
Moderator
Legendary
Offline
Activity: 3388
Merit: 6631
Just writing some code
|
By default Bitcoin Core assumes blocks that came before a block with certain hard-coded hex value are valid. In the latest version, all blocks before block no. 506067 are assumed valid unless specified otherwise with an -assumevalid argument.
No, that is not true. The scripts are assumed to be valid, but the blocks themselves are not. They are still checked for everything else, just the transaction scripts are not verified.
|
|
|
|
aleksej996
Sr. Member
Offline
Activity: 490
Merit: 389
Do not trust the government
|
|
July 19, 2018, 10:26:22 AM |
|
By default Bitcoin Core assumes blocks that came before a block with certain hard-coded hex value are valid. In the latest version, all blocks before block no. 506067 are assumed valid unless specified otherwise with an -assumevalid argument.
No, that is not true. The scripts are assumed to be valid, but the blocks themselves are not. They are still checked for everything else, just the transaction scripts are not verified. Thanks for clarification It makes sense
|
|
|
|
|