-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Protocol parameter update with guard rail script #5834
base: master
Are you sure you want to change the base?
Changes from all commits
42e68a8
5ada26a
47f4fed
d51f9a4
f66cdf8
53c8999
1f69b0f
b64a6f9
3526a7c
c34c11f
53d15f9
d1a4a41
a3b0ca0
4655aa1
64a08d4
6ea0cbc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,10 @@ | |
, defaultByronProtocolParamsJsonValue | ||
, defaultYamlConfig | ||
, defaultConwayGenesis | ||
, defaultCommitteeHotAuthCertFp | ||
, defaultCommitteeHotKeyPair | ||
, defaultCommitteeHotVkeyFp | ||
, defaultCommitteeHotSkeyFp | ||
, defaultCommitteeKeyPair | ||
, defaultCommitteeVkeyFp | ||
, defaultCommitteeSkeyFp | ||
|
@@ -26,6 +30,7 @@ | |
, defaultSpoKeys | ||
, defaultShelleyGenesis | ||
, defaultGenesisFilepath | ||
, defaultV3CostModel | ||
, defaultYamlHardforkViaConfig | ||
, defaultMainnetTopology | ||
, plutusV3NonSpendingScript | ||
|
@@ -60,6 +65,7 @@ | |
import qualified Data.Aeson.Key as Key | ||
import qualified Data.Aeson.KeyMap as KeyMapAeson | ||
import qualified Data.Default.Class as DefaultClass | ||
import qualified Data.Map.Strict as Map | ||
import Data.Maybe | ||
import Data.Proxy | ||
import Data.Ratio | ||
|
@@ -69,6 +75,7 @@ | |
import Data.Time (UTCTime) | ||
import Data.Typeable | ||
import qualified Data.Vector as Vector | ||
import GHC.Int | ||
import GHC.Stack | ||
import Lens.Micro | ||
import Numeric.Natural | ||
|
@@ -107,6 +114,76 @@ | |
Nothing -> Left $ AlonzoGenErrTooMuchPrecision r | ||
Just s -> return s | ||
|
||
maxTxExUnits = Api.toAlonzoExUnits | ||
$ Api.ExecutionUnits | ||
{ Api.executionSteps = 100000000000 | ||
, Api.executionMemory = 1400000000 | ||
} | ||
maxBlockExUnits = Api.toAlonzoExUnits | ||
$ Api.ExecutionUnits | ||
{ Api.executionSteps = 20000000000 | ||
, Api.executionMemory = 62000000 | ||
} | ||
apiCostModels = | ||
let pv1 = Api.AnyPlutusScriptVersion Api.PlutusScriptV1 | ||
pv2 = Api.AnyPlutusScriptVersion Api.PlutusScriptV2 | ||
pv3 = Api.AnyPlutusScriptVersion Api.PlutusScriptV3 | ||
in mconcat [ Map.singleton pv1 defaultV1CostModel | ||
, Map.singleton pv2 defaultV2CostModel | ||
, Map.singleton pv3 defaultV3CostModel | ||
] | ||
defaultV1CostModel = Api.CostModel | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are those V1 and V2 values the same as in default genesis in cardano-api? Maybe it would be better to reference values from the default genesis there instead of redefining them here? Same with V3 - maybe it would be better to just update single elements in the list instead? |
||
[ 205665, 812, 1, 1, 1000, 571, 0, 1, 1000, 24177, 4, 1, 1000, 32, 117366, 102, 4 | ||
, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 100, 100 | ||
, 23000, 100, 19537, 32, 175354, 32, 46417, 4, 221973, 511, 0, 1, 89141, 32, 497525 | ||
, 14068, 4, 2, 196500, 453240, 220, 0, 1, 1, 1000, 28662, 4, 2, 245000, 216773, 62 | ||
, 1, 1060367, 12586, 1, 208512, 421, 1, 187000, 1000, 52998, 1, 80436, 32, 43249, 32 | ||
, 1000, 32, 80556, 1, 57667, 4, 1000, 10, 197145, 156, 1, 197145, 156, 1, 204924, 473 | ||
, 1, 208896, 511, 1, 52467, 32, 64832, 32, 65493, 32, 22558, 32, 16563, 32, 76511, 32 | ||
, 196500, 453240, 220, 0, 1, 1, 69522, 11687, 0, 1, 60091, 32, 196500, 453240, 220, 0 | ||
, 1, 1, 196500, 453240, 220, 0, 1, 1, 806990, 30482, 4, 1927926, 82523, 4, 265318, 0 | ||
, 4, 0, 85931, 32, 205665, 812, 1, 1, 41182, 32, 212342, 32, 31220, 32, 32696, 32, 43357 | ||
, 32, 32247, 32, 38314, 32, 57996947, 18975, 10 | ||
] | ||
defaultV2CostModel = Api.CostModel | ||
[ 205665, 812, 1, 1, 1000, 571, 0, 1, 1000, 24177, 4, 1, 1000, 32, 117366, 10475, 4 | ||
, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 100, 100 | ||
, 23000, 100, 19537, 32, 175354, 32, 46417, 4, 221973, 511, 0, 1, 89141, 32, 497525 | ||
, 14068, 4, 2, 196500, 453240, 220, 0, 1, 1, 1000, 28662, 4, 2, 245000, 216773, 62 | ||
, 1, 1060367, 12586, 1, 208512, 421, 1, 187000, 1000, 52998, 1, 80436, 32, 43249, 32 | ||
, 1000, 32, 80556, 1, 57667, 4, 1000, 10, 197145, 156, 1, 197145, 156, 1, 204924, 473 | ||
, 1, 208896, 511, 1, 52467, 32, 64832, 32, 65493, 32, 22558, 32, 16563, 32, 76511, 32 | ||
, 196500, 453240, 220, 0, 1, 1, 69522, 11687, 0, 1, 60091, 32, 196500, 453240, 220, 0 | ||
, 1, 1, 196500, 453240, 220, 0, 1, 1, 1159724, 392670, 0, 2, 806990, 30482, 4, 1927926 | ||
, 82523, 4, 265318, 0, 4, 0, 85931, 32, 205665, 812, 1, 1, 41182, 32, 212342, 32, 31220 | ||
, 32, 32696, 32, 43357, 32, 32247, 32, 38314, 32, 35892428, 10, 9462713, 1021, 10, 38887044 | ||
, 32947, 10 | ||
] | ||
|
||
|
||
-- | Proposing script (protocol parameter update) fails to execute unless this is set to 0 | ||
cekStartupCost_exBudgetCPU :: Int64 | ||
Check warning on line 165 in cardano-testnet/src/Testnet/Defaults.hs GitHub Actions / build
|
||
cekStartupCost_exBudgetCPU = 1 | ||
Check warning on line 166 in cardano-testnet/src/Testnet/Defaults.hs GitHub Actions / build
|
||
|
||
cekLamCost_exBudgetMemory :: Int64 | ||
Check warning on line 168 in cardano-testnet/src/Testnet/Defaults.hs GitHub Actions / build
|
||
cekLamCost_exBudgetMemory = 1 | ||
Check warning on line 169 in cardano-testnet/src/Testnet/Defaults.hs GitHub Actions / build
|
||
|
||
defaultV3CostModel :: Api.CostModel | ||
defaultV3CostModel = Api.CostModel | ||
[ 205665, 812, 1, 1, 1000, 571, 0, 1, 1000, 24177, 4, 1, 1000, 32, 100, 10475, 4, 117366, 10475, 4, 103, 18 | ||
, 3209094, 6, 331451, 1, 65990684, 23097, 19, cekStartupCost_exBudgetCPU, cekLamCost_exBudgetMemory, 107 | ||
, 87060, 21, 16420089, 22, 2145798, 36, 3795345, 12, 889023, 1, 204237282, 23271, 36, 129165, 36, 189977790 | ||
, 85902, 36, 33012864, 36, 388443360, 1, 401885761, 72, 2331379, 72, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000 | ||
, 100, 23000, 100, 23000, 100, 23000, 100, 100, 100, 23000, 100 | ||
, 19537, 32, 175354, 32, 46417, 4, 221973, 511, 0, 1, 89141, 32, 497525, 14068, 4, 2, 196500, 453240, 220, 0, 1, 1, 1000, 28662 | ||
, 4, 2, 245000, 216773, 62, 1, 1060367, 12586, 1, 208512, 421, 1, 187000, 1000, 52998, 1, 80436, 32 | ||
, 43249, 1000, 32, 32, 80556, 1, 57667, 4, 1927926, 82523, 4, 1000, 10, 197145, 156, 1, 197145, 156, 1, 204924, 473, 1, 208896 | ||
, 511, 1, 52467, 32, 64832, 32, 65493, 32, 22558, 32, 16563, 32, 76511, 32, 196500, 453240, 220, 0 | ||
, 1, 1, 69522, 11687, 0, 1, 60091, 32, 196500, 453240, 220, 0, 1, 1, 196500, 453240, 220, 0, 1, 1, 1159724, 392670, 0, 2, 806990 | ||
, 30482, 4, 1927926, 82523, 4, 265318, 0, 4, 0, 85931, 32, 205665, 812, 1, 1, 41182 | ||
, 32, 212342, 32, 31220, 32, 32696, 32, 43357, 32, 32247, 32, 38314, 32, 35190005, 10, 57996947, 18975, 10, 39121781, 32260, 10 | ||
] | ||
|
||
defaultConwayGenesis :: ConwayGenesis StandardCrypto | ||
defaultConwayGenesis = | ||
let upPParams :: UpgradeConwayPParams Identity | ||
|
@@ -115,31 +192,31 @@ | |
, ucppDRepVotingThresholds = drepVotingThresholds | ||
, ucppCommitteeMinSize = 0 | ||
, ucppCommitteeMaxTermLength = EpochInterval 200 | ||
, ucppGovActionLifetime = EpochInterval 1 -- One Epoch | ||
, ucppGovActionDeposit = Coin 1_000_000 | ||
, ucppGovActionLifetime = EpochInterval 2 -- One Epoch | ||
, ucppGovActionDeposit = Coin 2_000_000 | ||
, ucppDRepDeposit = Coin 1_000_000 | ||
, ucppDRepActivity = EpochInterval 100 | ||
, ucppMinFeeRefScriptCostPerByte = 0 %! 1 -- FIXME GARBAGE VALUE | ||
, ucppPlutusV3CostModel = testingCostModelV3 | ||
} | ||
drepVotingThresholds = DRepVotingThresholds | ||
{ dvtMotionNoConfidence = 0 %! 1 | ||
, dvtCommitteeNormal = 1 %! 2 | ||
, dvtCommitteeNormal = 0 %! 2 | ||
, dvtCommitteeNoConfidence = 0 %! 1 | ||
, dvtUpdateToConstitution = 0 %! 2 -- TODO: Requires a constitutional committee when non-zero | ||
, dvtHardForkInitiation = 1 %! 2 | ||
, dvtPPNetworkGroup = 1 %! 2 | ||
, dvtPPEconomicGroup = 1 %! 2 | ||
, dvtPPTechnicalGroup = 1 %! 2 | ||
, dvtPPGovGroup = 1 %! 2 | ||
, dvtTreasuryWithdrawal = 1 %! 2 | ||
, dvtHardForkInitiation = 0 %! 2 | ||
, dvtPPNetworkGroup = 0 %! 2 | ||
, dvtPPEconomicGroup = 0 %! 2 | ||
, dvtPPTechnicalGroup = 0 %! 2 | ||
, dvtPPGovGroup = 0 %! 3 | ||
, dvtTreasuryWithdrawal = 0 %! 2 | ||
} | ||
poolVotingThresholds = PoolVotingThresholds | ||
{ pvtMotionNoConfidence = 1 %! 2 | ||
, pvtCommitteeNormal = 1 %! 2 | ||
, pvtCommitteeNoConfidence = 1 %! 2 | ||
, pvtHardForkInitiation = 1 %! 2 | ||
, pvtPPSecurityGroup = 1 %! 2 | ||
{ pvtMotionNoConfidence = 0 %! 2 | ||
, pvtCommitteeNormal = 0 %! 2 | ||
, pvtCommitteeNoConfidence = 0 %! 2 | ||
, pvtHardForkInitiation = 0 %! 2 | ||
, pvtPPSecurityGroup = 0 %! 2 | ||
} | ||
in ConwayGenesis | ||
{ cgUpgradePParams = upPParams | ||
|
@@ -523,13 +600,33 @@ | |
-> FilePath | ||
defaultDRepSkeyFp n = "drep-keys" </> ("drep" <> show n) </> "drep.skey" | ||
|
||
defaultCommitteeKeyPair :: Int -> KeyPair PaymentKey | ||
defaultCommitteeKeyPair n = | ||
defaultCommitteeKeyPair :: FilePath -> Int -> KeyPair CCColdKey | ||
defaultCommitteeKeyPair work n = | ||
KeyPair | ||
{ verificationKey = File $ work </> defaultCommitteeVkeyFp n | ||
, signingKey = File $ work </> defaultCommitteeSkeyFp n | ||
} | ||
|
||
defaultCommitteeHotKeyPair :: FilePath -> Int -> KeyPair CCHotKey | ||
defaultCommitteeHotKeyPair work n = | ||
KeyPair | ||
{ verificationKey = File $ defaultCommitteeVkeyFp n | ||
, signingKey = File $ defaultCommitteeSkeyFp n | ||
{ verificationKey = File $ work </> defaultCommitteeHotVkeyFp n | ||
, signingKey = File $ work </> defaultCommitteeHotSkeyFp n | ||
} | ||
|
||
defaultCommitteeHotAuthCertFp :: Int -> FilePath | ||
defaultCommitteeHotAuthCertFp n = "committee-keys" </> "committee" <> show n <>"hot.auth" | ||
|
||
defaultCommitteeHotVkeyFp | ||
:: Int -- ^ The Committee's index (starts at 1) | ||
-> FilePath | ||
defaultCommitteeHotVkeyFp n = "committee-keys" </> "committee" <> show n <> "hot.vkey" | ||
|
||
defaultCommitteeHotSkeyFp | ||
:: Int -- ^ The Committee's index (starts at 1) | ||
-> FilePath | ||
defaultCommitteeHotSkeyFp n = "committee-keys" </> "committee" <> show n <> "hot.skey" | ||
|
||
-- | The relative path to SPO cold verification key in directories created by cardano-testnet | ||
defaultSPOColdVKeyFp :: Int -> FilePath | ||
defaultSPOColdVKeyFp n = "pools-keys" </> "pool" <> show n </> "cold.vkey" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.