I really just want a simple question answered.
JUSTIN: Would that be possible? Can you answer?
Why does this sampling of blocks from 2205900 -> 2205923 - which were added to the chain as valid, only switch between 2 different algo's? According to the consensus code in Verge, shouldn't these have been discarded as invalid?
JUSTIN: Would that be possible? Can you answer?
Why does this sampling of blocks from 2205900 -> 2205923 - which were added to the chain as valid, only switch between 2 different algo's? According to the consensus code in Verge, shouldn't these have been discarded as invalid?
Code:
2205923 - 62b24a19f15716f1679bad531ef4b7c14b3d58d980c5490a0a135c2b1857a139 22nd May 2018 06:55:17 lyra2re
2205922 - f11c4423c21bbe77907937ea40d45ad69572498f2ee3d160b90c0afed2b941cf 22nd May 2018 06:55:17 lyra2re
2205921 - 65ecfa324c69ff64fcbb6657eb70e981289f0b6c922435c89db3451ab0f960e4 22nd May 2018 06:55:17 lyra2re
2205920 - 03fd6163763bd2d686d39ae6e1c3b4663cdaed206e7ea0284e847d13e6d6198c 22nd May 2018 06:55:17 lyra2re
2205919 - 7e458fc3c5706ec9ddf95cedc254d616dda49764d0c34f788d5bd92519cff0ca 22nd May 2018 06:55:16 lyra2re
2205918 - 078ddfdc760995dbb96ccce33fc37dec853f1465b95eeb87bd499048f7e6333b 22nd May 2018 06:55:16 lyra2re
2205917 - 00000000083bb16892848cc890317370315f52ed3566e364c4264be4e20f77de 22nd May 2018 06:55:16 scrypt
2205916 - 000000001a16b654d11d879efc7bb9fef711f946c69df324a1cc5a2fb240a4a6 22nd May 2018 06:55:16 scrypt
2205915 - 0000000004b4258574fefe34f3a0690ff3d8d7050fc67773ff5e349767306086 22nd May 2018 06:55:16 scrypt
2205914 - 000000000d2edddbc12448148b710c4c49794e6e74fb820069377da1633dd447 22nd May 2018 06:55:16 scrypt
2205913 - 000000001f507a7a23a1a55860c19c1226d5edba0453043db4b884cb6de5c028 22nd May 2018 06:55:15 scrypt
2205912 - 0000000049fb9df391abbd8ab42cdb77cffb7b4941bb65ed3aa5589a100e8594 22nd May 2018 06:55:15 scrypt
2205911 - 81e8d7899d20b0e1ea00a458e92bffc4716389e55cf3e4947d44eed220e873b8 22nd May 2018 06:55:15 lyra2re
2205910 - 70d35dbf84cbf4a1b3cd1ed2e12d65c4e0776c2186aa1cec956b7c7382b7b6a3 22nd May 2018 06:55:15 lyra2re
2205909 - d8017bd566bcc7359c6b995357756fccb325e1a8ef0e6153c7587c1434dc982b 22nd May 2018 06:55:15 lyra2re
2205908 - 2079b84323d04234895f4ee6da8c28518b52e97b59da4501a1195349f9f94467 22nd May 2018 06:55:15 lyra2re
2205907 - 0d14bc8be431ae5734c8cd791cf5e285338a5cec1a8bb4c9849209da5921b77b 22nd May 2018 06:55:14 lyra2re
2205906 - f6a63a5c746b91d4ab6f79aaa799c80e899d2026032c515a2cf482bd0e97b85f 22nd May 2018 06:55:14 lyra2re
2205905 - 000000001a8645b501a5ca405883c34aa0c5edebfe4343ed967d978e66a45d95 22nd May 2018 06:55:14 scrypt
2205904 - 00000000233ee973c1ee798b3ae073953bc43b0280e5eef9bfeaea15c8c44c60 22nd May 2018 06:55:14 scrypt
2205903 - 000000000326ed66ebda4c4b0c391757648ecf6668d2da9b1ab03d19ecc46bcf 22nd May 2018 06:55:14 scrypt
2205902 - 000000007f4bf76e0bc1f0ecabeac939f924dde177d01364a725778902a5565b 22nd May 2018 06:55:14 scrypt
2205901 - 0000000050dd9cea6865263e4f64f8121560476ce400803dedf2c34e68b1c971 22nd May 2018 06:55:13 scrypt
2205900 - 00000000a8c64d3176a056c35722f9255e5231191d4b5dfc2f039256586d3ad8 22nd May 2018 06:55:13 scrypt
Well, no, this is allowed. This is the commit that mitigate the timewarp attack using a single algorithm https://github.com/vergecurrency/VERGE/commit/80c81aef63272231fc39c2af4b8db9f3f2e9d328
It seems that the purpose of the patch is to only allow 5 of the last teen blocks to be mined with the same algorithm, which it seems to achive (there seems to be a small bug which allows 6 blocks with the same algorithm in a row. Not sure if that is on purpose, but it is probably not too critical).
Ummmmm that's not how coding works. If it's programmed to only let 5, it should not let 6. So either his code is flawed or there's another exploit they're using.
I linked to the code, you could just read it you know...
Anyway:
AcceptBlock() checks if the newly submitted block is valid. One of the checks is calling CheckPrevAlgo() with the parent block to the one being checked.
CheckPrevAlgo() checks if more than SAME_ALGO_MAX_COUNT (5) of the previous SAME_ALGO_MAX_COUNT*2 (10) blocks are mined using the same algorithm as the one being checked. if so, it is invalid. This means that a block is valid if no more than 5 of the previous 10 blocks where mined using the algorithm for the block being tested, leading to 6 of any 11 subsequent blocks can have the same algorithm.
I think the intent was to only allow 5 blocks with the same algorithm in a group of 10 blocks, so it appears to be a bit buggy, but as i said, i don't think it makes much of a difference as it still prevents the chain to be mined only with one algorithm, which was the intent.
It seems that there are much worse issues with Verge such as measuring chain trust simply based on the length of the chain as well as the ability to game the difficulty adjustment to force the difficulty down. We should probably focus on those issues instead of some comparatively unimportant oversight in how the rule to prevent blocks only being mined with a single algorithm was implemented.