From fe04a2045c3080797c6f93bf7cd2e12192b8f68f Mon Sep 17 00:00:00 2001 From: Bitflash Date: Sun, 2 Aug 2026 11:04:00 -0300 Subject: Add consensus block size limit (#111, from #110) CheckBlock() validated block size against MAX_SIZE, the serializer's generic 32 MB guard rather than a block rule; MAX_BLOCK_SIZE did not exist in this tree at all, because Bitcoin's 1 MB cap arrived in 0.3.x, after the 0.1.0 this fork came from. A miner could produce a 32 MB block and every node would download, verify and store it. Original work by mtg0001 in #110, rebased over #109 with the self-test conflict resolved, plus a comment explaining why the inherited count-against-bytes test stays. Measured before choosing the number: 5709 blocks read from blk0001.dat give a largest block of 34,290 bytes and a median of 216, so 1 MB leaves 29x of headroom and rejects nothing that exists. A node built from this branch then synced genesis to 5706 on the live network with zero size-limit rejections and zero CheckBlock errors -- the same test that caught BIP30 rejecting a real block at height 859. --- src/makefile.mingw | 1 + 1 file changed, 1 insertion(+) (limited to 'src/makefile.mingw') diff --git a/src/makefile.mingw b/src/makefile.mingw index 5025acb..9bbfef1 100644 --- a/src/makefile.mingw +++ b/src/makefile.mingw @@ -112,3 +112,4 @@ tests: test_bip32.exe bitflash.exe ./bitflash.exe -selftest=wallet-keypool ./bitflash.exe -selftest=wallet-hd ./bitflash.exe -selftest=net-message + ./bitflash.exe -selftest=consensus-limits -- cgit v1.2.3