Yes, every copy of the blockchain has to be the same, otherwise it wouldn't work
I don't think this is entirely true.
Hello !
I was wondering if you would take the hash of every file inside the blocks folder and
chainstate folder and compere these hashes of another system running bitcoin. Would these
be the same ? ( except ofcource the newest ones that are still written )
No. I think they might not be the same.
If I'm remembering correctly, Bitcoin Core keeps a record of all the orphaned blocks that it received. Since the system that you are comparing against might not have received the same orphaned blocks, the hashes of the files may not be the same.
correct
at the time it receives it, it was the tip, so it gets added to the append only file. but the file is just a sequential storing of the chaintip and since block propagations will "often" create a one block reorg based on delay for the stronger block to reach nodes, it is highly unlikely any two nodes that are not very closely connected (all the time) would have identical contents
if you want a unique set of hashes, you need to iteration though and only use the mainchain
James
"often" is relatively speaking, the one block reorg is expected even without any attack type scenario. There are a few 3, 6, 30 block reorgs causes by non-propagation events and those actually might be identical for most the nodes