Skip to content

Commit

Permalink
Fix mainnet coin v2 upgrade for new chains (#1130)
Browse files Browse the repository at this point in the history
* fix coinV2Upgrade guard or new mainnet chains

* set vuln797Fix to True for new mainnet chains
  • Loading branch information
larskuhtz authored Aug 4, 2020
1 parent 18d45f6 commit 2357a4a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Chainweb/Version.hs
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,6 @@ vuln797Fix Mainnet01 cid h
| cid == unsafeChainId 7 = h >= 121451
| cid == unsafeChainId 8 = h >= 121452
| cid == unsafeChainId 9 = h >= 121451
| otherwise = error $ "invalid chain id " <> sshow cid
vuln797Fix _ _ _ = True
{-# INLINE vuln797Fix #-}

Expand All @@ -777,7 +776,7 @@ coinV2Upgrade Mainnet01 cid h
| cid == unsafeChainId 7 = h == 140809
| cid == unsafeChainId 8 = h == 140808
| cid == unsafeChainId 9 = h == 140808
| otherwise = error $ "invalid chain id " <> sshow cid
-- new chains on mainnet start already with v2 deployed in the genesis block
coinV2Upgrade Testnet04 cid h
| chainIdInt @Int cid >= 10 && chainIdInt @Int cid < 20 = h == 337000
| otherwise = h == 1
Expand Down

0 comments on commit 2357a4a

Please sign in to comment.