From 7840715559376820c09491e5073b1dfd1fb17b68 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 27 Jul 2024 16:30:27 -0700 Subject: [PATCH] Chang initial commit --- integration-test/bootstrap.sh | 2 +- .../configs/local-chang/alonzo-genesis.json | 365 ++++++++++++++++++ .../configs/local-chang/byron-genesis.json | 40 ++ .../configs/local-chang/byron/delegate.cert | 8 + .../configs/local-chang/byron/delegate.key | Bin 0 -> 130 bytes .../configs/local-chang/config.json | 106 +++++ .../configs/local-chang/conway-genesis.json | 298 ++++++++++++++ .../configs/local-chang/shelley-genesis.json | 50 +++ .../configs/local-chang/shelley/kes.skey | 5 + .../configs/local-chang/shelley/kes.vkey | 5 + .../configs/local-chang/shelley/node.cert | 5 + .../local-chang/shelley/operator.counter | 5 + .../configs/local-chang/shelley/operator.skey | 5 + .../configs/local-chang/shelley/operator.vkey | 5 + .../shelley/utxo-keys/payment.addr | 1 + .../local-chang/shelley/utxo-keys/utxo1.skey | 5 + .../local-chang/shelley/utxo-keys/utxo1.vkey | 5 + .../configs/local-chang/shelley/vrf.skey | 5 + .../configs/local-chang/shelley/vrf.vkey | 5 + .../configs/local-chang/topology.json | 9 + integration-test/docker-compose-chang.yml | 103 +++++ integration-test/docker-compose.yml | 4 + .../plutus_scripts/helloworldV3.plutus | 1 + integration-test/run_node.sh | 2 +- integration-test/run_pool.sh | 6 +- integration-test/run_tests.sh | 78 ++-- integration-test/test/base.py | 54 ++- integration-test/test/test_cardano_cli.py | 2 + integration-test/test/test_plutus.py | 75 +++- pycardano/backend/base.py | 6 +- pycardano/metadata.py | 9 +- pycardano/plutus.py | 9 + pycardano/txbuilder.py | 48 ++- pycardano/utils.py | 49 ++- pycardano/witness.py | 20 +- pyproject.toml | 3 +- test/pycardano/test_metadata.py | 9 +- test/pycardano/util.py | 2 + 38 files changed, 1350 insertions(+), 59 deletions(-) create mode 100644 integration-test/configs/local-chang/alonzo-genesis.json create mode 100644 integration-test/configs/local-chang/byron-genesis.json create mode 100644 integration-test/configs/local-chang/byron/delegate.cert create mode 100644 integration-test/configs/local-chang/byron/delegate.key create mode 100644 integration-test/configs/local-chang/config.json create mode 100644 integration-test/configs/local-chang/conway-genesis.json create mode 100644 integration-test/configs/local-chang/shelley-genesis.json create mode 100644 integration-test/configs/local-chang/shelley/kes.skey create mode 100644 integration-test/configs/local-chang/shelley/kes.vkey create mode 100644 integration-test/configs/local-chang/shelley/node.cert create mode 100644 integration-test/configs/local-chang/shelley/operator.counter create mode 100644 integration-test/configs/local-chang/shelley/operator.skey create mode 100644 integration-test/configs/local-chang/shelley/operator.vkey create mode 100644 integration-test/configs/local-chang/shelley/utxo-keys/payment.addr create mode 100644 integration-test/configs/local-chang/shelley/utxo-keys/utxo1.skey create mode 100644 integration-test/configs/local-chang/shelley/utxo-keys/utxo1.vkey create mode 100644 integration-test/configs/local-chang/shelley/vrf.skey create mode 100644 integration-test/configs/local-chang/shelley/vrf.vkey create mode 100644 integration-test/configs/local-chang/topology.json create mode 100644 integration-test/docker-compose-chang.yml create mode 100644 integration-test/plutus_scripts/helloworldV3.plutus diff --git a/integration-test/bootstrap.sh b/integration-test/bootstrap.sh index 5f7ac89c..be5f865f 100755 --- a/integration-test/bootstrap.sh +++ b/integration-test/bootstrap.sh @@ -20,7 +20,7 @@ NETWORK=$1 echo "Bootstrapping network: $NETWORK" -if [ "$NETWORK" = "local-alonzo" ] || [ "$NETWORK" = "local-vasil" ]; then +if [ "$NETWORK" = "local-alonzo" ] || [ "$NETWORK" = "local-vasil" ] || [ "$NETWORK" = "local-chang" ]; then echo "Updating byron startTime to present in local mode, $NETWORK era" jq -M ".startTime = ""$(date +%s)" configs/"$NETWORK"/byron-genesis.json > \ tmp_configs/"$NETWORK"/byron-genesis.json diff --git a/integration-test/configs/local-chang/alonzo-genesis.json b/integration-test/configs/local-chang/alonzo-genesis.json new file mode 100644 index 00000000..643a7810 --- /dev/null +++ b/integration-test/configs/local-chang/alonzo-genesis.json @@ -0,0 +1,365 @@ +{ + "collateralPercentage": 150, + "costModels": { + "PlutusV1": [ + 197209, + 0, + 1, + 1, + 396231, + 621, + 0, + 1, + 150000, + 1000, + 0, + 1, + 150000, + 32, + 2477736, + 29175, + 4, + 29773, + 100, + 29773, + 100, + 29773, + 100, + 29773, + 100, + 29773, + 100, + 29773, + 100, + 100, + 100, + 29773, + 100, + 150000, + 32, + 150000, + 32, + 150000, + 32, + 150000, + 1000, + 0, + 1, + 150000, + 32, + 150000, + 1000, + 0, + 8, + 148000, + 425507, + 118, + 0, + 1, + 1, + 150000, + 1000, + 0, + 8, + 150000, + 112536, + 247, + 1, + 150000, + 10000, + 1, + 136542, + 1326, + 1, + 1000, + 150000, + 1000, + 1, + 150000, + 32, + 150000, + 32, + 150000, + 32, + 1, + 1, + 150000, + 1, + 150000, + 4, + 103599, + 248, + 1, + 103599, + 248, + 1, + 145276, + 1366, + 1, + 179690, + 497, + 1, + 150000, + 32, + 150000, + 32, + 150000, + 32, + 150000, + 32, + 150000, + 32, + 150000, + 32, + 148000, + 425507, + 118, + 0, + 1, + 1, + 61516, + 11218, + 0, + 1, + 150000, + 32, + 148000, + 425507, + 118, + 0, + 1, + 1, + 148000, + 425507, + 118, + 0, + 1, + 1, + 2477736, + 29175, + 4, + 0, + 82363, + 4, + 150000, + 5000, + 0, + 1, + 150000, + 32, + 197209, + 0, + 1, + 1, + 150000, + 32, + 150000, + 32, + 150000, + 32, + 150000, + 32, + 150000, + 32, + 150000, + 32, + 150000, + 32, + 3345831, + 1, + 1 + ], + "PlutusV2": { + "addInteger-cpu-arguments-intercept": 205665, + "addInteger-cpu-arguments-slope": 812, + "addInteger-memory-arguments-intercept": 1, + "addInteger-memory-arguments-slope": 1, + "appendByteString-cpu-arguments-intercept": 1000, + "appendByteString-cpu-arguments-slope": 571, + "appendByteString-memory-arguments-intercept": 0, + "appendByteString-memory-arguments-slope": 1, + "appendString-cpu-arguments-intercept": 1000, + "appendString-cpu-arguments-slope": 24177, + "appendString-memory-arguments-intercept": 4, + "appendString-memory-arguments-slope": 1, + "bData-cpu-arguments": 1000, + "bData-memory-arguments": 32, + "blake2b_256-cpu-arguments-intercept": 117366, + "blake2b_256-cpu-arguments-slope": 10475, + "blake2b_256-memory-arguments": 4, + "cekApplyCost-exBudgetCPU": 23000, + "cekApplyCost-exBudgetMemory": 100, + "cekBuiltinCost-exBudgetCPU": 23000, + "cekBuiltinCost-exBudgetMemory": 100, + "cekConstCost-exBudgetCPU": 23000, + "cekConstCost-exBudgetMemory": 100, + "cekDelayCost-exBudgetCPU": 23000, + "cekDelayCost-exBudgetMemory": 100, + "cekForceCost-exBudgetCPU": 23000, + "cekForceCost-exBudgetMemory": 100, + "cekLamCost-exBudgetCPU": 23000, + "cekLamCost-exBudgetMemory": 100, + "cekStartupCost-exBudgetCPU": 100, + "cekStartupCost-exBudgetMemory": 100, + "cekVarCost-exBudgetCPU": 23000, + "cekVarCost-exBudgetMemory": 100, + "chooseData-cpu-arguments": 19537, + "chooseData-memory-arguments": 32, + "chooseList-cpu-arguments": 175354, + "chooseList-memory-arguments": 32, + "chooseUnit-cpu-arguments": 46417, + "chooseUnit-memory-arguments": 4, + "consByteString-cpu-arguments-intercept": 221973, + "consByteString-cpu-arguments-slope": 511, + "consByteString-memory-arguments-intercept": 0, + "consByteString-memory-arguments-slope": 1, + "constrData-cpu-arguments": 89141, + "constrData-memory-arguments": 32, + "decodeUtf8-cpu-arguments-intercept": 497525, + "decodeUtf8-cpu-arguments-slope": 14068, + "decodeUtf8-memory-arguments-intercept": 4, + "decodeUtf8-memory-arguments-slope": 2, + "divideInteger-cpu-arguments-constant": 196500, + "divideInteger-cpu-arguments-model-arguments-intercept": 453240, + "divideInteger-cpu-arguments-model-arguments-slope": 220, + "divideInteger-memory-arguments-intercept": 0, + "divideInteger-memory-arguments-minimum": 1, + "divideInteger-memory-arguments-slope": 1, + "encodeUtf8-cpu-arguments-intercept": 1000, + "encodeUtf8-cpu-arguments-slope": 28662, + "encodeUtf8-memory-arguments-intercept": 4, + "encodeUtf8-memory-arguments-slope": 2, + "equalsByteString-cpu-arguments-constant": 245000, + "equalsByteString-cpu-arguments-intercept": 216773, + "equalsByteString-cpu-arguments-slope": 62, + "equalsByteString-memory-arguments": 1, + "equalsData-cpu-arguments-intercept": 1060367, + "equalsData-cpu-arguments-slope": 12586, + "equalsData-memory-arguments": 1, + "equalsInteger-cpu-arguments-intercept": 208512, + "equalsInteger-cpu-arguments-slope": 421, + "equalsInteger-memory-arguments": 1, + "equalsString-cpu-arguments-constant": 187000, + "equalsString-cpu-arguments-intercept": 1000, + "equalsString-cpu-arguments-slope": 52998, + "equalsString-memory-arguments": 1, + "fstPair-cpu-arguments": 80436, + "fstPair-memory-arguments": 32, + "headList-cpu-arguments": 43249, + "headList-memory-arguments": 32, + "iData-cpu-arguments": 1000, + "iData-memory-arguments": 32, + "ifThenElse-cpu-arguments": 80556, + "ifThenElse-memory-arguments": 1, + "indexByteString-cpu-arguments": 57667, + "indexByteString-memory-arguments": 4, + "lengthOfByteString-cpu-arguments": 1000, + "lengthOfByteString-memory-arguments": 10, + "lessThanByteString-cpu-arguments-intercept": 197145, + "lessThanByteString-cpu-arguments-slope": 156, + "lessThanByteString-memory-arguments": 1, + "lessThanEqualsByteString-cpu-arguments-intercept": 197145, + "lessThanEqualsByteString-cpu-arguments-slope": 156, + "lessThanEqualsByteString-memory-arguments": 1, + "lessThanEqualsInteger-cpu-arguments-intercept": 204924, + "lessThanEqualsInteger-cpu-arguments-slope": 473, + "lessThanEqualsInteger-memory-arguments": 1, + "lessThanInteger-cpu-arguments-intercept": 208896, + "lessThanInteger-cpu-arguments-slope": 511, + "lessThanInteger-memory-arguments": 1, + "listData-cpu-arguments": 52467, + "listData-memory-arguments": 32, + "mapData-cpu-arguments": 64832, + "mapData-memory-arguments": 32, + "mkCons-cpu-arguments": 65493, + "mkCons-memory-arguments": 32, + "mkNilData-cpu-arguments": 22558, + "mkNilData-memory-arguments": 32, + "mkNilPairData-cpu-arguments": 16563, + "mkNilPairData-memory-arguments": 32, + "mkPairData-cpu-arguments": 76511, + "mkPairData-memory-arguments": 32, + "modInteger-cpu-arguments-constant": 196500, + "modInteger-cpu-arguments-model-arguments-intercept": 453240, + "modInteger-cpu-arguments-model-arguments-slope": 220, + "modInteger-memory-arguments-intercept": 0, + "modInteger-memory-arguments-minimum": 1, + "modInteger-memory-arguments-slope": 1, + "multiplyInteger-cpu-arguments-intercept": 69522, + "multiplyInteger-cpu-arguments-slope": 11687, + "multiplyInteger-memory-arguments-intercept": 0, + "multiplyInteger-memory-arguments-slope": 1, + "nullList-cpu-arguments": 60091, + "nullList-memory-arguments": 32, + "quotientInteger-cpu-arguments-constant": 196500, + "quotientInteger-cpu-arguments-model-arguments-intercept": 453240, + "quotientInteger-cpu-arguments-model-arguments-slope": 220, + "quotientInteger-memory-arguments-intercept": 0, + "quotientInteger-memory-arguments-minimum": 1, + "quotientInteger-memory-arguments-slope": 1, + "remainderInteger-cpu-arguments-constant": 196500, + "remainderInteger-cpu-arguments-model-arguments-intercept": 453240, + "remainderInteger-cpu-arguments-model-arguments-slope": 220, + "remainderInteger-memory-arguments-intercept": 0, + "remainderInteger-memory-arguments-minimum": 1, + "remainderInteger-memory-arguments-slope": 1, + "serialiseData-cpu-arguments-intercept": 1159724, + "serialiseData-cpu-arguments-slope": 392670, + "serialiseData-memory-arguments-intercept": 0, + "serialiseData-memory-arguments-slope": 2, + "sha2_256-cpu-arguments-intercept": 806990, + "sha2_256-cpu-arguments-slope": 30482, + "sha2_256-memory-arguments": 4, + "sha3_256-cpu-arguments-intercept": 1927926, + "sha3_256-cpu-arguments-slope": 82523, + "sha3_256-memory-arguments": 4, + "sliceByteString-cpu-arguments-intercept": 265318, + "sliceByteString-cpu-arguments-slope": 0, + "sliceByteString-memory-arguments-intercept": 4, + "sliceByteString-memory-arguments-slope": 0, + "sndPair-cpu-arguments": 85931, + "sndPair-memory-arguments": 32, + "subtractInteger-cpu-arguments-intercept": 205665, + "subtractInteger-cpu-arguments-slope": 812, + "subtractInteger-memory-arguments-intercept": 1, + "subtractInteger-memory-arguments-slope": 1, + "tailList-cpu-arguments": 41182, + "tailList-memory-arguments": 32, + "trace-cpu-arguments": 212342, + "trace-memory-arguments": 32, + "unBData-cpu-arguments": 31220, + "unBData-memory-arguments": 32, + "unConstrData-cpu-arguments": 32696, + "unConstrData-memory-arguments": 32, + "unIData-cpu-arguments": 43357, + "unIData-memory-arguments": 32, + "unListData-cpu-arguments": 32247, + "unListData-memory-arguments": 32, + "unMapData-cpu-arguments": 38314, + "unMapData-memory-arguments": 32, + "verifyEcdsaSecp256k1Signature-cpu-arguments": 20000000000, + "verifyEcdsaSecp256k1Signature-memory-arguments": 20000000000, + "verifyEd25519Signature-cpu-arguments-intercept": 9462713, + "verifyEd25519Signature-cpu-arguments-slope": 1021, + "verifyEd25519Signature-memory-arguments": 10, + "verifySchnorrSecp256k1Signature-cpu-arguments-intercept": 20000000000, + "verifySchnorrSecp256k1Signature-cpu-arguments-slope": 0, + "verifySchnorrSecp256k1Signature-memory-arguments": 20000000000 + } + }, + "executionPrices": { + "prMem": 0.0577, + "prSteps": 0.0000721 + }, + "lovelacePerUTxOWord": 34482, + "maxBlockExUnits": { + "exUnitsMem": 50000000, + "exUnitsSteps": 40000000000 + }, + "maxCollateralInputs": 3, + "maxTxExUnits": { + "exUnitsMem": 10000000, + "exUnitsSteps": 10000000000 + }, + "maxValueSize": 5000 +} \ No newline at end of file diff --git a/integration-test/configs/local-chang/byron-genesis.json b/integration-test/configs/local-chang/byron-genesis.json new file mode 100644 index 00000000..6eaa8b49 --- /dev/null +++ b/integration-test/configs/local-chang/byron-genesis.json @@ -0,0 +1,40 @@ +{ "bootStakeholders": + { "b733bf8070781d30a0c8d5ca66392188f78c6604b631629cd055f402": 1 } +, "heavyDelegation": + { "b733bf8070781d30a0c8d5ca66392188f78c6604b631629cd055f402": + { "omega": 0 + , "issuerPk": + "ckPV1Ypq8uRkxwoDj93p7cCm4G+uB9R8SGGOKyc6KyIR8NDVVwu1FS3AwSoUjra02uiF5AlAUXUvVqZvnT8nCw==" + , "delegatePk": + "MYL9xuLMepgsQxRtqOu57nJw16pMWel79j0APRV1NSqH3ZUeBu+p7XaNoVCzw7yemMb4vwLiRDcMnnqHXztFVA==" + , "cert": + "643985a3022fedf3d9aaee8ab18d35e0cdc894beb5edb502ca47c37cce678741dd502fba0c2b8ee38513e0a75f6ee2dcc0f05d5b3c1d7ce72cc1c22a8a910909" + } } +, "startTime": 1640212228 +, "nonAvvmBalances": + { "2657WMsDfac6ef4bngGRU7FmksmW8QRfAifshdj4XyDxPeVT4DbPeoiUgzRdKjYYF": + "10020000000" } +, "blockVersionData": + { "scriptVersion": 0 + , "slotDuration": "1000" + , "maxBlockSize": "2000000" + , "maxHeaderSize": "2000000" + , "maxTxSize": "4096" + , "maxProposalSize": "700" + , "mpcThd": "20000000000000" + , "heavyDelThd": "300000000000" + , "updateVoteThd": "1000000000000" + , "updateProposalThd": "100000000000000" + , "updateImplicit": "10000" + , "softforkRule": + { "initThd": "900000000000000" + , "minThd": "600000000000000" + , "thdDecrement": "50000000000000" + } + , "txFeePolicy": + { "summand": "155381000000000" , "multiplier": "43946000000" } + , "unlockStakeEpoch": "18446744073709551615" + } +, "protocolConsts": { "k": 10 , "protocolMagic": 42 } +, "avvmDistr": {} +} \ No newline at end of file diff --git a/integration-test/configs/local-chang/byron/delegate.cert b/integration-test/configs/local-chang/byron/delegate.cert new file mode 100644 index 00000000..dcdd366a --- /dev/null +++ b/integration-test/configs/local-chang/byron/delegate.cert @@ -0,0 +1,8 @@ +{ "omega": 0 +, "issuerPk": + "ckPV1Ypq8uRkxwoDj93p7cCm4G+uB9R8SGGOKyc6KyIR8NDVVwu1FS3AwSoUjra02uiF5AlAUXUvVqZvnT8nCw==" +, "delegatePk": + "MYL9xuLMepgsQxRtqOu57nJw16pMWel79j0APRV1NSqH3ZUeBu+p7XaNoVCzw7yemMb4vwLiRDcMnnqHXztFVA==" +, "cert": + "643985a3022fedf3d9aaee8ab18d35e0cdc894beb5edb502ca47c37cce678741dd502fba0c2b8ee38513e0a75f6ee2dcc0f05d5b3c1d7ce72cc1c22a8a910909" +} \ No newline at end of file diff --git a/integration-test/configs/local-chang/byron/delegate.key b/integration-test/configs/local-chang/byron/delegate.key new file mode 100644 index 0000000000000000000000000000000000000000..87e9c504c50013813414d19668726670cf17ffd8 GIT binary patch literal 130 zcmV-|0Db>hfSBn9`|!X8rQx69kXQzMKn-B0mNyC_3$K`i5n-QYN!}uv7;b9tQ8J?RJf!P_x6lo|wk?zXIY!Hw>P7hhIBIRR7&SN&o-= literal 0 HcmV?d00001 diff --git a/integration-test/configs/local-chang/config.json b/integration-test/configs/local-chang/config.json new file mode 100644 index 00000000..d5f44b21 --- /dev/null +++ b/integration-test/configs/local-chang/config.json @@ -0,0 +1,106 @@ +{ + "ByronGenesisFile": "./byron-genesis.json", + "ShelleyGenesisFile": "./shelley-genesis.json", + "AlonzoGenesisFile": "./alonzo-genesis.json", + "ConwayGenesisFile": "./conway-genesis.json", + "SocketPath": "db/node.socket", + "Protocol": "Cardano", + "PBftSignatureThreshold": 0.6, + "RequiresNetworkMagic": "RequiresMagic", + "LastKnownBlockVersion-Alt": 0, + "LastKnownBlockVersion-Major": 3, + "LastKnownBlockVersion-Minor": 1, + "ApplicationName": "cardano-sl", + "MinNodeVersion": "9.0", + "ApplicationVersion": 1, + "TurnOnLogging": true, + "TurnOnLogMetrics": true, + "minSeverity": "Debug", + "TracingVerbosity": "NormalVerbosity", + "setupBackends": [ + "KatipBK" + ], + "defaultBackends": [ + "KatipBK" + ], + "setupScribes": [ + { + "scKind": "FileSK", + "scName": "logs/mainnet.log", + "scFormat": "ScText" + }, + { + "scKind": "StdoutSK", + "scName": "stdout", + "scFormat": "ScText" + } + ], + "defaultScribes": [ + [ + "FileSK", + "logs/mainnet.log" + ], + [ + "StdoutSK", + "stdout" + ] + ], + "rotation": { + "rpLogLimitBytes": 5000000, + "rpKeepFilesNum": 3, + "rpMaxAgeHours": 24 + }, + "TraceBlockFetchClient": false, + "TraceBlockFetchDecisions": false, + "TraceBlockFetchProtocol": false, + "TraceBlockFetchProtocolSerialised": false, + "TraceBlockFetchServer": false, + "TraceBlockchainTime": false, + "TraceChainDb": true, + "TraceChainSyncClient": false, + "TraceChainSyncBlockServer": false, + "TraceChainSyncHeaderServer": false, + "TraceChainSyncProtocol": false, + "TraceDNSResolver": true, + "TraceDNSSubscription": true, + "TraceErrorPolicy": true, + "TraceLocalErrorPolicy": true, + "TraceForge": true, + "TraceHandshake": false, + "TraceIpSubscription": true, + "TraceLocalChainSyncProtocol": false, + "TraceLocalHandshake": false, + "TraceLocalTxSubmissionProtocol": false, + "TraceLocalTxSubmissionServer": false, + "TraceMempool": true, + "TraceMux": false, + "TraceTxInbound": false, + "TraceTxOutbound": false, + "TraceTxSubmissionProtocol": false, + "options": { + "mapBackends": { + "cardano.node.metrics": [ + "EKGViewBK" + ] + }, + "mapScribes": { + "cardano.node.metrics": [ + "FileSK::logs/mainnet.log" + ] + }, + "mapSeverity": { + "cardano.node.ChainDB": "Notice", + "cardano.node.DnsSubscription": "Debug" + } + }, + "EnableLogMetrics": false, + "EnableLogging": true, + "TestShelleyHardForkAtEpoch": 0, + "TestAllegraHardForkAtEpoch": 0, + "TestMaryHardForkAtEpoch": 0, + "TestAlonzoHardForkAtEpoch": 0, + "TestBabbageHardForkAtEpoch": 10, + "TestConwayHardForkAtEpoch": 11, + "EnableDevelopmentHardForkEras": true, + "ExperimentalProtocolsEnabled": true +} \ No newline at end of file diff --git a/integration-test/configs/local-chang/conway-genesis.json b/integration-test/configs/local-chang/conway-genesis.json new file mode 100644 index 00000000..61598cba --- /dev/null +++ b/integration-test/configs/local-chang/conway-genesis.json @@ -0,0 +1,298 @@ +{ + "poolVotingThresholds": { + "committeeNormal": 0.65, + "committeeNoConfidence": 0.65, + "hardForkInitiation": 0.51, + "motionNoConfidence": 0.6, + "ppSecurityGroup": 0.6 + }, + "dRepVotingThresholds": { + "motionNoConfidence": 0.67, + "committeeNormal": 0.67, + "committeeNoConfidence": 0.65, + "updateToConstitution": 0.75, + "hardForkInitiation": 0.6, + "ppNetworkGroup": 0.67, + "ppEconomicGroup": 0.67, + "ppTechnicalGroup": 0.67, + "ppGovGroup": 0.75, + "treasuryWithdrawal": 0.67 + }, + "committeeMinSize": 5, + "committeeMaxTermLength": 146, + "govActionLifetime": 14, + "govActionDeposit": 100000000000, + "dRepDeposit": 500000000, + "dRepActivity": 20, + "minFeeRefScriptCostPerByte": 15, + "plutusV3CostModel": [ + 100788, + 420, + 1, + 1, + 1000, + 173, + 0, + 1, + 1000, + 59957, + 4, + 1, + 11183, + 32, + 201305, + 8356, + 4, + 16000, + 100, + 16000, + 100, + 16000, + 100, + 16000, + 100, + 16000, + 100, + 16000, + 100, + 100, + 100, + 16000, + 100, + 94375, + 32, + 132994, + 32, + 61462, + 4, + 72010, + 178, + 0, + 1, + 22151, + 32, + 91189, + 769, + 4, + 2, + 85848, + 123203, + 7305, + -900, + 1716, + 549, + 57, + 85848, + 0, + 1, + 1, + 1000, + 42921, + 4, + 2, + 24548, + 29498, + 38, + 1, + 898148, + 27279, + 1, + 51775, + 558, + 1, + 39184, + 1000, + 60594, + 1, + 141895, + 32, + 83150, + 32, + 15299, + 32, + 76049, + 1, + 13169, + 4, + 22100, + 10, + 28999, + 74, + 1, + 28999, + 74, + 1, + 43285, + 552, + 1, + 44749, + 541, + 1, + 33852, + 32, + 68246, + 32, + 72362, + 32, + 7243, + 32, + 7391, + 32, + 11546, + 32, + 85848, + 123203, + 7305, + -900, + 1716, + 549, + 57, + 85848, + 0, + 1, + 90434, + 519, + 0, + 1, + 74433, + 32, + 85848, + 123203, + 7305, + -900, + 1716, + 549, + 57, + 85848, + 0, + 1, + 1, + 85848, + 123203, + 7305, + -900, + 1716, + 549, + 57, + 85848, + 0, + 1, + 955506, + 213312, + 0, + 2, + 270652, + 22588, + 4, + 1457325, + 64566, + 4, + 20467, + 1, + 4, + 0, + 141992, + 32, + 100788, + 420, + 1, + 1, + 81663, + 32, + 59498, + 32, + 20142, + 32, + 24588, + 32, + 20744, + 32, + 25933, + 32, + 24623, + 32, + 43053543, + 10, + 53384111, + 14333, + 10, + 43574283, + 26308, + 10, + 16000, + 100, + 16000, + 100, + 962335, + 18, + 2780678, + 6, + 442008, + 1, + 52538055, + 3756, + 18, + 267929, + 18, + 76433006, + 8868, + 18, + 52948122, + 18, + 1995836, + 36, + 3227919, + 12, + 901022, + 1, + 166917843, + 4307, + 36, + 284546, + 36, + 158221314, + 26549, + 36, + 74698472, + 36, + 333849714, + 1, + 254006273, + 72, + 2174038, + 72, + 2261318, + 64571, + 4, + 207616, + 8310, + 4, + 1293828, + 28716, + 63, + 0, + 1, + 1006041, + 43623, + 251, + 0, + 1 + ], + "constitution": { + "anchor": { + "url": "ipfs://QmQq5hWDNzvDR1ForEktAHrdCQmfSL2u5yctNpzDwoSBu4", + "dataHash": "23b43bebac48a4acc39e578715aa06635d6d900fa3ea7441dfffd6e43b914f7b" + }, + "script": "edcd84c10e36ae810dc50847477083069db796219b39ccde790484e0" + }, + "committee": { + "members": { + "scriptHash-7ceede7d6a89e006408e6b7c6acb3dd094b3f6817e43b4a36d01535b": 500, + "scriptHash-6095e643ea6f1cccb6e463ec34349026b3a48621aac5d512655ab1bf": 500, + "scriptHash-27999ed757d6dac217471ae61d69b1b067b8b240d9e3ff36eb66b5d0": 500, + "scriptHash-87f867a31c0f81360d4d7dcddb6b025ba8383db9bf77a2af7797799d": 500, + "scriptHash-a19a7ba1caede8f3ab3e5e2a928b3798d7d011af18fbd577f7aeb0ec": 500 + }, + "threshold": 0.67 + } +} \ No newline at end of file diff --git a/integration-test/configs/local-chang/shelley-genesis.json b/integration-test/configs/local-chang/shelley-genesis.json new file mode 100644 index 00000000..63aa1093 --- /dev/null +++ b/integration-test/configs/local-chang/shelley-genesis.json @@ -0,0 +1,50 @@ +{ + "maxLovelaceSupply": 1000000000000, + "securityParam": 1000000000, + "slotsPerKESPeriod": 1000000000, + "updateQuorum": 2, + "activeSlotsCoeff": 0.5, + "protocolParams": { + "minUTxOValue": 1000000, + "eMax": 18, + "extraEntropy": { + "tag": "NeutralNonce" + }, + "minFeeB": 155381, + "tau": 0.1, + "maxBlockBodySize": 65536, + "minPoolCost": 0, + "minFeeA": 44, + "maxTxSize": 16384, + "nOpt": 100, + "maxBlockHeaderSize": 1100, + "keyDeposit": 1000000, + "protocolVersion": { + "minor": 0, + "major": 7 + }, + "poolDeposit": 1000000, + "a0": 0.0, + "rho": 0.1, + "decentralisationParam": 0.1 + }, + "networkMagic": 42, + "initialFunds": { + "60d413c1745d306023e49589e658a7b7a4b4dda165ff5c97d8c8b979bf": 900000000000 + }, + "maxKESEvolutions": 60000000, + "networkId": "Testnet", + "genDelegs": { + "37c2ef3cfb83c1004fcc21c75f42fee8013ac994afde92c1af419d1c": { + "delegate": "5bd3a54bf30412243d4616c145c79467322164b81aa577814b74a520", + "vrf": "fb66920eb17f426d4f513535be0eed59859a0e83963860090bb6db571f8a5b55" + } + }, + "slotLength": 1, + "systemStart": "2021-12-21T03:17:14.803874404Z", + "staking": { + "pools": {}, + "stake": {} + }, + "epochLength": 4 +} \ No newline at end of file diff --git a/integration-test/configs/local-chang/shelley/kes.skey b/integration-test/configs/local-chang/shelley/kes.skey new file mode 100644 index 00000000..a9bfc0ca --- /dev/null +++ b/integration-test/configs/local-chang/shelley/kes.skey @@ -0,0 +1,5 @@ +{ + "type": "KesSigningKey_ed25519_kes_2^6", + "description": "KES Signing Key", + "cborHex": "59026051c2b5536d23bbd7ff92aa8b58a011fb57b669183b7083961ae979a7b2ad1fbcbf1ee580c9e39567b88562b370cdccd27cababc4812a2ce1a7a0c7369274cf5f18f3e4796482babf0ea8d4e97157d6221bb6448da0cf3f173bbc1b13e708e40c25559347cc225b6d916bf611bc133d265482d0c503e94493456bb607ce34fd7b51a13e8908d9d85582edbed89e0fd2a0fb34d45480cef5b277dbb46b23322ea191760cafdf5c2f3bc5307f2128c121e5f8f54fdf6ca2925c034fc11dcc933855b595493e629e717a1b2ced715dfac5bf42838928edd19c287d55c1ef04ecf31070fe52ab805cf813e752f001353ac637f8f3f76db4b8c0e12f8552335182af76683b819debaa623a730e12f2f7d9f63190c835e8211bdf86d2bf244e8ad114328621535a63fd1a1497389356220e818e5d2f530f50494401b7ee027172ca72093645465b2c83e0dcd1d9c4a81b6871849601a8706d95e3c58a4c0841fdfb214b0bb82ec1e18ba7bea9e4f3eb9a0abbb39e57a9ab96799379ca8cadeb2e1a8df84b3e0e7ca0af3d6665a12029f6cefe4d309c5b3fad5bec4ca7812d5bede426b6fff6f37da99a286cd837b327b35b645ca5bfabf0935ea87cbd29b3ce2b7b80f83f386a474c69f86f553e35069f40b04f9a6bb6a13b583c0a911126c8aed1301b4014e0ea8229d5dcce81a56836f5bb286bd28c1ee5c69fd358c16a4fdbd5b6e9b0ed1ef766dcf6c56c7a845104309c92a2013bd5a7c8354fb8a866b61b23e014a07a78ed5b69469f4121c97bce50864d8555b91e3c2d812f4760a6318750c7b71fccbc8bab1c54c0be28f60c97cc8e33cbd8da235e4ca9344c48f13d81a37459" +} diff --git a/integration-test/configs/local-chang/shelley/kes.vkey b/integration-test/configs/local-chang/shelley/kes.vkey new file mode 100644 index 00000000..8841f971 --- /dev/null +++ b/integration-test/configs/local-chang/shelley/kes.vkey @@ -0,0 +1,5 @@ +{ + "type": "KesVerificationKey_ed25519_kes_2^6", + "description": "KES Verification Key", + "cborHex": "58206e59b21f538b5fdbe50df62f793488f8783e19d261d3fd59a700d2c41963cec2" +} diff --git a/integration-test/configs/local-chang/shelley/node.cert b/integration-test/configs/local-chang/shelley/node.cert new file mode 100644 index 00000000..15c52608 --- /dev/null +++ b/integration-test/configs/local-chang/shelley/node.cert @@ -0,0 +1,5 @@ +{ + "type": "NodeOperationalCertificate", + "description": "", + "cborHex": "828458206e59b21f538b5fdbe50df62f793488f8783e19d261d3fd59a700d2c41963cec201005840853403f4d2e63e027b26f59c45ce81c74b1dfd708dc561b5ede5204262253451b7560f1c75425d3ee08fd4d933392f7fe3f1017efb3c8ee565a5493a061a270d582091934010118a86e2628e8188413cfa3eeac1237f3f699ebe16892f41671ccf3f" +} diff --git a/integration-test/configs/local-chang/shelley/operator.counter b/integration-test/configs/local-chang/shelley/operator.counter new file mode 100644 index 00000000..aae820c3 --- /dev/null +++ b/integration-test/configs/local-chang/shelley/operator.counter @@ -0,0 +1,5 @@ +{ + "type": "NodeOperationalCertificateIssueCounter", + "description": "Next certificate issue number: 2", + "cborHex": "8202582091934010118a86e2628e8188413cfa3eeac1237f3f699ebe16892f41671ccf3f" +} diff --git a/integration-test/configs/local-chang/shelley/operator.skey b/integration-test/configs/local-chang/shelley/operator.skey new file mode 100644 index 00000000..87464ad4 --- /dev/null +++ b/integration-test/configs/local-chang/shelley/operator.skey @@ -0,0 +1,5 @@ +{ + "type": "GenesisDelegateSigningKey_ed25519", + "description": "Genesis delegate operator key", + "cborHex": "5820351111fb3058c30c976b57f1b13e0e333243126768eae52133294cfe1481e943" +} diff --git a/integration-test/configs/local-chang/shelley/operator.vkey b/integration-test/configs/local-chang/shelley/operator.vkey new file mode 100644 index 00000000..6bd011f3 --- /dev/null +++ b/integration-test/configs/local-chang/shelley/operator.vkey @@ -0,0 +1,5 @@ +{ + "type": "GenesisDelegateVerificationKey_ed25519", + "description": "Genesis delegate operator key", + "cborHex": "582091934010118a86e2628e8188413cfa3eeac1237f3f699ebe16892f41671ccf3f" +} diff --git a/integration-test/configs/local-chang/shelley/utxo-keys/payment.addr b/integration-test/configs/local-chang/shelley/utxo-keys/payment.addr new file mode 100644 index 00000000..4d3d2e10 --- /dev/null +++ b/integration-test/configs/local-chang/shelley/utxo-keys/payment.addr @@ -0,0 +1 @@ +addr_test1vr2p8st5t5cxqglyjky7vk98k7jtfhdpvhl4e97cezuhn0cqcexl7 \ No newline at end of file diff --git a/integration-test/configs/local-chang/shelley/utxo-keys/utxo1.skey b/integration-test/configs/local-chang/shelley/utxo-keys/utxo1.skey new file mode 100644 index 00000000..896420b5 --- /dev/null +++ b/integration-test/configs/local-chang/shelley/utxo-keys/utxo1.skey @@ -0,0 +1,5 @@ +{ + "type": "GenesisUTxOSigningKey_ed25519", + "description": "Genesis Initial UTxO Signing Key", + "cborHex": "5820093be5cd3987d0c9fd8854ef908f7746b69e2d73320db6dc0f780d81585b84c2" +} diff --git a/integration-test/configs/local-chang/shelley/utxo-keys/utxo1.vkey b/integration-test/configs/local-chang/shelley/utxo-keys/utxo1.vkey new file mode 100644 index 00000000..157a8fd3 --- /dev/null +++ b/integration-test/configs/local-chang/shelley/utxo-keys/utxo1.vkey @@ -0,0 +1,5 @@ +{ + "type": "GenesisUTxOVerificationKey_ed25519", + "description": "Genesis Initial UTxO Verification Key", + "cborHex": "58208be8339e9f3addfa6810d59e2f072f85e64d4c024c087e0d24f8317c6544f62f" +} diff --git a/integration-test/configs/local-chang/shelley/vrf.skey b/integration-test/configs/local-chang/shelley/vrf.skey new file mode 100644 index 00000000..a5ff9e28 --- /dev/null +++ b/integration-test/configs/local-chang/shelley/vrf.skey @@ -0,0 +1,5 @@ +{ + "type": "VrfSigningKey_PraosVRF", + "description": "VRF Signing Key", + "cborHex": "5840b504af084d200455b08e72f0d278cf23bd9f2acddf834755d007e87536e19d1158cc502328977455f71db641249286ce07c11de5cb1f7429db0584eca3cabb7e" +} diff --git a/integration-test/configs/local-chang/shelley/vrf.vkey b/integration-test/configs/local-chang/shelley/vrf.vkey new file mode 100644 index 00000000..65c9592d --- /dev/null +++ b/integration-test/configs/local-chang/shelley/vrf.vkey @@ -0,0 +1,5 @@ +{ + "type": "VrfVerificationKey_PraosVRF", + "description": "VRF Verification Key", + "cborHex": "582058cc502328977455f71db641249286ce07c11de5cb1f7429db0584eca3cabb7e" +} diff --git a/integration-test/configs/local-chang/topology.json b/integration-test/configs/local-chang/topology.json new file mode 100644 index 00000000..dc92f2e8 --- /dev/null +++ b/integration-test/configs/local-chang/topology.json @@ -0,0 +1,9 @@ +{ + "Producers": [ + { + "addr": "172.20.0.102", + "port": 3000, + "valency": 1 + } + ] +} diff --git a/integration-test/docker-compose-chang.yml b/integration-test/docker-compose-chang.yml new file mode 100644 index 00000000..73866f83 --- /dev/null +++ b/integration-test/docker-compose-chang.yml @@ -0,0 +1,103 @@ +version: "3.5" + +networks: + cluster: + ipam: + config: + - subnet: 172.20.0.0/24 + +services: + + cardano-node: + image: ghcr.io/intersectmbo/cardano-node:${CARDANO_NODE_VERSION:-9.1.0} + platform: linux/amd64 + entrypoint: bash + environment: + NETWORK: "${NETWORK:-local-alonzo}" + CARDANO_NODE_SOCKET_PATH: "/ipc/node.socket" + command: /code/run_node.sh + + networks: + cluster: + ipv4_address: 172.20.0.101 + + volumes: + - .:/code + - /tmp:/tmp + - node-db:/data/db + - node-ipc:/ipc + ports: + - ${BFT_NODE_PORT:-3000}:3000 + logging: + driver: "json-file" + options: + max-size: "200k" + max-file: "10" + + cardano-pool: + image: ghcr.io/intersectmbo/cardano-node:${CARDANO_NODE_VERSION:-9.1.0} + platform: linux/amd64 + entrypoint: bash + environment: + NETWORK: "${NETWORK:-local-alonzo}" + command: /code/run_pool.sh + + networks: + cluster: + ipv4_address: 172.20.0.102 + + volumes: + - .:/code + - node-ipc:/ipc + logging: + driver: "json-file" + options: + max-size: "200k" + max-file: "10" + + ogmios: + image: cardanosolutions/ogmios:v6.5.0 + platform: linux/amd64 + environment: + NETWORK: "${NETWORK:-local-alonzo}" + + command: [ + "--host", "0.0.0.0", + "--node-socket", "/ipc/node.socket", + "--node-config", "/code/configs/${NETWORK:-local-alonzo}/config.json", + "--log-level-websocket", "Debug" + ] + volumes: + - .:/code + - node-ipc:/ipc + ports: + - ${OGMIOS_PORT:-1337}:1337 + logging: + driver: "json-file" + options: + max-size: "200k" + max-file: "10" + + kupo: + image: cardanosolutions/kupo:v2.4.0 + platform: linux/amd64 + environment: + NETWORK: "${NETWORK:-local}" + + command: [ + "--node-socket", "/ipc/node.socket", + "--node-config", "/code/configs/${NETWORK:-local-alonzo}/config.json", + "--host", "0.0.0.0", + "--since", "origin", + "--match", "*", + "--in-memory" + ] + volumes: + - .:/code + - node-ipc:/ipc + ports: + - ${KUPO_PORT:-1442}:1442 + +volumes: + node-db: + node-ipc: diff --git a/integration-test/docker-compose.yml b/integration-test/docker-compose.yml index 58d45fa2..b6cd3eb0 100644 --- a/integration-test/docker-compose.yml +++ b/integration-test/docker-compose.yml @@ -10,6 +10,7 @@ services: cardano-node: image: ghcr.io/intersectmbo/cardano-node:${CARDANO_NODE_VERSION:-8.9.2} + platform: linux/amd64 entrypoint: bash environment: NETWORK: "${NETWORK:-local-alonzo}" @@ -35,6 +36,7 @@ services: cardano-pool: image: ghcr.io/intersectmbo/cardano-node:${CARDANO_NODE_VERSION:-8.9.2} + platform: linux/amd64 entrypoint: bash environment: NETWORK: "${NETWORK:-local-alonzo}" @@ -55,6 +57,7 @@ services: ogmios: image: cardanosolutions/ogmios:v6.2.0 + platform: linux/amd64 environment: NETWORK: "${NETWORK:-local-alonzo}" @@ -76,6 +79,7 @@ services: kupo: image: cardanosolutions/kupo:v2.4.0 + platform: linux/amd64 environment: NETWORK: "${NETWORK:-local}" diff --git a/integration-test/plutus_scripts/helloworldV3.plutus b/integration-test/plutus_scripts/helloworldV3.plutus new file mode 100644 index 00000000..a2aa60c0 --- /dev/null +++ b/integration-test/plutus_scripts/helloworldV3.plutus @@ -0,0 +1 @@ +58e901010032323232323223223225333006323253330083371e6eb8c008c028dd5002a4410d48656c6c6f2c20576f726c642100100114a06644646600200200644a66601c00229404c94ccc030cdc79bae301000200414a226600600600260200026eb0c02cc030c030c030c030c030c030c030c030c024dd5180098049baa002375c600260126ea80188c02c0045261365653330043370e900018029baa001132325333009300b002149858dd7180480098031baa0011653330023370e900018019baa0011323253330073009002149858dd7180380098021baa001165734aae7555cf2ab9f5742ae881 \ No newline at end of file diff --git a/integration-test/run_node.sh b/integration-test/run_node.sh index 1069ded0..62b72168 100755 --- a/integration-test/run_node.sh +++ b/integration-test/run_node.sh @@ -1,6 +1,6 @@ #!/bin/bash -if [ "$NETWORK" = "local-alonzo" ] || [ "$NETWORK" = "local-vasil" ] +if [ "$NETWORK" = "local-alonzo" ] || [ "$NETWORK" = "local-vasil" ] || [ "$NETWORK" = "local-chang" ] then chmod 400 /code/tmp_configs/"$NETWORK"/shelley/*.skey chmod 400 /code/tmp_configs/"$NETWORK"/shelley/*.vkey diff --git a/integration-test/run_pool.sh b/integration-test/run_pool.sh index c49bf62d..d27bfc83 100644 --- a/integration-test/run_pool.sh +++ b/integration-test/run_pool.sh @@ -1,7 +1,7 @@ #!/bin/bash echo "$NETWORK" -if [ "$NETWORK" = "local-alonzo" ] || [ "$NETWORK" = "local-vasil" ] +if [ "$NETWORK" = "local-alonzo" ] || [ "$NETWORK" = "local-vasil" ] || [ "$NETWORK" = "local-chang" ] then # Waiting for BFT node to be ready @@ -15,7 +15,7 @@ done cardano-cli transaction build \ --tx-in 732bfd67e66be8e8288349fcaaa2294973ef6271cc189a239bb431275401b8e5#0 \ --tx-out "$(cat /code/keys/pool/full.addr)"+450000000000 \ - --change-address "$(cat /code/tmp_configs/local-alonzo/shelley/utxo-keys/payment.addr)" \ + --change-address "$(cat /code/tmp_configs/"$NETWORK"/shelley/utxo-keys/payment.addr)" \ --out-file tx.raw \ --testnet-magic 42 \ --certificate-file /code/keys/pool/stake.cert \ @@ -29,7 +29,7 @@ done cardano-cli transaction sign \ --tx-body-file tx.raw \ - --signing-key-file /code/tmp_configs/local-alonzo/shelley/utxo-keys/utxo1.skey \ + --signing-key-file /code/tmp_configs/"$NETWORK"/shelley/utxo-keys/utxo1.skey \ --signing-key-file /code/keys/pool/stake.skey \ --signing-key-file /code/keys/pool/cold.skey \ --testnet-magic 42 \ diff --git a/integration-test/run_tests.sh b/integration-test/run_tests.sh index 45670042..a561860c 100755 --- a/integration-test/run_tests.sh +++ b/integration-test/run_tests.sh @@ -11,47 +11,73 @@ poetry run pip install ogmios ########## # Alonzo # ########## +# +## Cleanup containers and volumes in case there is any running +#docker-compose down --volumes --remove-orphans +# +## Run alonzo integration tests +#./bootstrap.sh local-alonzo +# +## Launch containers +#docker-compose up -d +# +#export PAYMENT_KEY="$ROOT"/configs/local-alonzo/shelley/utxo-keys/utxo1.skey +#export EXTENDED_PAYMENT_KEY="$ROOT"/keys/extended.skey +#export POOL_ID=$(cat "$ROOT"/keys/pool/pool.id) +# +## Wait for stake pool to start producing blocks +#sleep 10 +# +## Cleanup +#docker-compose down --volumes --remove-orphans +# +########## +## Vasil # +########## +# +## Cleanup containers and volumes in case there is any running +#docker-compose down --volumes --remove-orphans +# +## Run integration tests +#./bootstrap.sh local-vasil +# +## Launch containers +#docker-compose up -d +# +#export PAYMENT_KEY="$ROOT"/configs/local-vasil/shelley/utxo-keys/utxo1.skey +#export EXTENDED_PAYMENT_KEY="$ROOT"/keys/extended.skey +#export POOL_ID=$(cat "$ROOT"/keys/pool/pool.id) +# +## Wait for stake pool to start producing blocks +#sleep 30 +# +#poetry run pytest -s -vv -n 4 "$ROOT"/test +# +## Cleanup +#docker-compose down --volumes --remove-orphans -# Cleanup containers and volumes in case there is any running -docker-compose down --volumes --remove-orphans - -# Run alonzo integration tests -./bootstrap.sh local-alonzo - -# Launch containers -docker-compose up -d - -export PAYMENT_KEY="$ROOT"/configs/local-alonzo/shelley/utxo-keys/utxo1.skey -export EXTENDED_PAYMENT_KEY="$ROOT"/keys/extended.skey -export POOL_ID=$(cat "$ROOT"/keys/pool/pool.id) - -# Wait for stake pool to start producing blocks -sleep 10 - -# Cleanup -docker-compose down --volumes --remove-orphans ######### -# Vasil # +# Chang # ######### # Cleanup containers and volumes in case there is any running -docker-compose down --volumes --remove-orphans +docker-compose -f docker-compose-chang.yml down --volumes --remove-orphans # Run integration tests -./bootstrap.sh local-vasil +./bootstrap.sh local-chang # Launch containers -docker-compose up -d +docker-compose -f docker-compose-chang.yml up -d -export PAYMENT_KEY="$ROOT"/configs/local-vasil/shelley/utxo-keys/utxo1.skey +export PAYMENT_KEY="$ROOT"/configs/local-chang/shelley/utxo-keys/utxo1.skey export EXTENDED_PAYMENT_KEY="$ROOT"/keys/extended.skey export POOL_ID=$(cat "$ROOT"/keys/pool/pool.id) # Wait for stake pool to start producing blocks -sleep 30 +#sleep 30 -poetry run pytest -s -vv "$ROOT"/test +poetry run pytest -m "not (CardanoCLI)" -s -vv -n 4 "$ROOT"/test # Cleanup -docker-compose down --volumes --remove-orphans \ No newline at end of file +docker-compose -f docker-compose-chang.yml down --volumes --remove-orphans \ No newline at end of file diff --git a/integration-test/test/base.py b/integration-test/test/base.py index 2491c4b2..c8fe88f6 100644 --- a/integration-test/test/base.py +++ b/integration-test/test/base.py @@ -10,6 +10,54 @@ TEST_RETRIES = 6 +def _fetch_protocol_param(self) -> ProtocolParameters: + with python_ogmios.Client(self.host, self.port, self.secure) as client: + protocol_parameters, _ = client.query_protocol_parameters.execute() + pyc_protocol_params = ProtocolParameters( + min_fee_constant=protocol_parameters.min_fee_constant.lovelace, + min_fee_coefficient=protocol_parameters.min_fee_coefficient, + min_pool_cost=protocol_parameters.min_stake_pool_cost.lovelace, + max_block_size=protocol_parameters.max_block_body_size.get("bytes"), + max_tx_size=protocol_parameters.max_transaction_size.get("bytes"), + max_block_header_size=protocol_parameters.max_block_header_size.get( + "bytes" + ), + key_deposit=protocol_parameters.stake_credential_deposit.lovelace, + pool_deposit=protocol_parameters.stake_pool_deposit.lovelace, + pool_influence=eval(protocol_parameters.stake_pool_pledge_influence), + monetary_expansion=eval(protocol_parameters.monetary_expansion), + treasury_expansion=eval(protocol_parameters.treasury_expansion), + decentralization_param=None, # TODO + extra_entropy=protocol_parameters.extra_entropy, + protocol_major_version=protocol_parameters.version.get("major"), + protocol_minor_version=protocol_parameters.version.get("minor"), + min_utxo=None, + price_mem=eval(protocol_parameters.script_execution_prices.get("memory")), + price_step=eval(protocol_parameters.script_execution_prices.get("cpu")), + max_tx_ex_mem=protocol_parameters.max_execution_units_per_transaction.get( + "memory" + ), + max_tx_ex_steps=protocol_parameters.max_execution_units_per_transaction.get( + "cpu" + ), + max_block_ex_mem=protocol_parameters.max_execution_units_per_block.get( + "memory" + ), + max_block_ex_steps=protocol_parameters.max_execution_units_per_block.get( + "cpu" + ), + max_val_size=protocol_parameters.max_value_size.get("bytes"), + collateral_percent=protocol_parameters.collateral_percentage, + max_collateral_inputs=protocol_parameters.max_collateral_inputs, + coins_per_utxo_word=ALONZO_COINS_PER_UTXO_WORD, + coins_per_utxo_byte=protocol_parameters.min_utxo_deposit_coefficient, + maximum_reference_scripts_size=protocol_parameters.max_ref_script_size, + min_fee_reference_scripts=protocol_parameters.min_fee_ref_scripts, + cost_models=self._parse_cost_models(protocol_parameters.plutus_cost_models), + ) + return pyc_protocol_params + + @retry(tries=10, delay=4) def check_chain_context(chain_context): print(f"Current chain tip: {chain_context.last_block_slot}") @@ -22,8 +70,12 @@ class TestBase: # TODO: Bring back kupo test KUPO_URL = "http://localhost:1442" + python_ogmios.OgmiosChainContext._fetch_protocol_param = _fetch_protocol_param chain_context = python_ogmios.OgmiosChainContext( - host="localhost", port=1337, network=Network.TESTNET + host="localhost", + port=1337, + network=Network.TESTNET, + refetch_chain_tip_interval=1, ) check_chain_context(chain_context) diff --git a/integration-test/test/test_cardano_cli.py b/integration-test/test/test_cardano_cli.py index 8a1d875c..1b484a8d 100644 --- a/integration-test/test/test_cardano_cli.py +++ b/integration-test/test/test_cardano_cli.py @@ -1,6 +1,7 @@ import os from pathlib import Path +import pytest from retry import retry from pycardano import ( @@ -15,6 +16,7 @@ from .base import TEST_RETRIES +@pytest.mark.CardanoCLI class TestCardanoCli: network_env = os.getenv("NETWORK", "local-alonzo") host_socket = os.getenv("DOCKER_HOST", None) diff --git a/integration-test/test/test_plutus.py b/integration-test/test/test_plutus.py index 93acf491..62abf8f4 100644 --- a/integration-test/test/test_plutus.py +++ b/integration-test/test/test_plutus.py @@ -1,5 +1,6 @@ import collections import time +from dataclasses import dataclass from typing import Dict, Union import cbor2 @@ -12,6 +13,18 @@ from .test_cardano_cli import TestCardanoCli +@dataclass +class HelloWorldDatum(PlutusData): + CONSTR_ID = 0 + owner: bytes + + +@dataclass +class HelloWorldRedeemer(PlutusData): + CONSTR_ID = 0 + msg: bytes + + class TestPlutus(TestBase): @retry(tries=TEST_RETRIES, backoff=1.5, delay=6, jitter=(0, 4)) def test_plutus_v1(self): @@ -263,7 +276,7 @@ def test_plutus_v2_ref_script(self): print(signed_tx.to_cbor_hex()) print("############### Submitting transaction ###############") self.chain_context.submit_tx(signed_tx) - time.sleep(3) + time.sleep(6) # ----------- Send ADA to the same script address without datum or script --------------- @@ -280,7 +293,7 @@ def test_plutus_v2_ref_script(self): print(signed_tx.to_cbor_hex()) print("############### Submitting transaction ###############") self.chain_context.submit_tx(signed_tx) - time.sleep(3) + time.sleep(6) # ----------- Taker take --------------- @@ -369,6 +382,63 @@ def test_get_plutus_script(self): assert utxos[0].output.script == forty_two_script + @retry(tries=TEST_RETRIES, backoff=1.5, delay=6, jitter=(0, 4)) + @pytest.mark.post_chang + def test_plutus_v3(self): + # ----------- Giver give --------------- + + with open("./plutus_scripts/helloworldV3.plutus", "r") as f: + script_hex = f.read() + hello_world_script = cbor2.loads(bytes.fromhex(script_hex)) + + script_hash = plutus_script_hash(PlutusV3Script(hello_world_script)) + + script_address = Address(script_hash, network=self.NETWORK) + + giver_address = Address(self.payment_vkey.hash(), network=self.NETWORK) + + builder = TransactionBuilder(self.chain_context) + builder.add_input_address(giver_address) + datum = HelloWorldDatum(owner=self.payment_vkey.hash().to_primitive()) + builder.add_output(TransactionOutput(script_address, 50000000, datum=datum)) + + signed_tx = builder.build_and_sign([self.payment_skey], giver_address) + + print("############### Transaction created ###############") + print(signed_tx) + print(signed_tx.to_cbor_hex()) + print("############### Submitting transaction ###############") + self.chain_context.submit_tx(signed_tx) + time.sleep(3) + + # ----------- Taker take --------------- + + redeemer = Redeemer(data=HelloWorldRedeemer(msg=b"Hello, World!")) + + utxo_to_spend = self.chain_context.utxos(script_address)[0] + + taker_address = Address(self.extended_payment_vkey.hash(), network=self.NETWORK) + + builder = TransactionBuilder(self.chain_context) + + builder.add_script_input( + utxo_to_spend, PlutusV3Script(hello_world_script), redeemer=redeemer + ) + take_output = TransactionOutput(taker_address, 25123456) + builder.add_output(take_output) + + builder.required_signers = [self.payment_vkey.hash()] + + signed_tx = builder.build_and_sign([self.payment_skey], taker_address) + + print("############### Transaction created ###############") + print(signed_tx) + print(signed_tx.to_cbor_hex()) + print("############### Submitting transaction ###############") + self.chain_context.submit_tx(signed_tx) + + self.assert_output(taker_address, take_output) + # class TestPlutusOgmiosOnly(TestPlutus): # @classmethod @@ -388,6 +458,7 @@ def evaluate_tx(tx: Transaction) -> Dict[str, ExecutionUnits]: return execution_units +@pytest.mark.CardanoCLI class TestPlutusCardanoCLI(TestPlutus): @classmethod def setup_class(cls): diff --git a/pycardano/backend/base.py b/pycardano/backend/base.py index aec6948a..7e3fb145 100644 --- a/pycardano/backend/base.py +++ b/pycardano/backend/base.py @@ -2,7 +2,7 @@ from dataclasses import dataclass from fractions import Fraction -from typing import Dict, List, Union +from typing import Dict, List, Optional, Union from pycardano.address import Address from pycardano.exception import InvalidArgumentException @@ -109,6 +109,10 @@ class ProtocolParameters: """A dict contains cost models for Plutus. The key will be "PlutusV1", "PlutusV2", etc. The value will be a dict of cost model parameters.""" + maximum_reference_scripts_size: Optional[Dict[str, int]] = None + + min_fee_reference_scripts: Optional[Dict[str, float]] = None + @typechecked class ChainContext: diff --git a/pycardano/metadata.py b/pycardano/metadata.py index 6ddfa708..17bb4a08 100644 --- a/pycardano/metadata.py +++ b/pycardano/metadata.py @@ -10,6 +10,7 @@ from pycardano.exception import DeserializeException, InvalidArgumentException from pycardano.hash import AUXILIARY_DATA_HASH_SIZE, AuxiliaryDataHash from pycardano.nativescript import NativeScript +from pycardano.plutus import PlutusV1Script, PlutusV2Script, PlutusV3Script from pycardano.serialization import ( ArrayCBORSerializable, CBORSerializable, @@ -87,9 +88,15 @@ class AlonzoMetadata(MapCBORSerializable): default=None, metadata={"optional": True, "key": 1, "object_hook": list_hook(NativeScript)}, ) - plutus_scripts: Optional[List[bytes]] = field( + plutus_v1_scripts: Optional[List[PlutusV1Script]] = field( default=None, metadata={"optional": True, "key": 2} ) + plutus_v2_scripts: Optional[List[PlutusV2Script]] = field( + default=None, metadata={"optional": True, "key": 3} + ) + plutus_v3_scripts: Optional[List[PlutusV3Script]] = field( + default=None, metadata={"optional": True, "key": 4} + ) def to_primitive(self) -> Primitive: return CBORTag(AlonzoMetadata.TAG, super(AlonzoMetadata, self).to_primitive()) diff --git a/pycardano/plutus.py b/pycardano/plutus.py index b1ee6e81..700b49d5 100644 --- a/pycardano/plutus.py +++ b/pycardano/plutus.py @@ -41,6 +41,7 @@ "ExecutionUnits", "PlutusV1Script", "PlutusV2Script", + "PlutusV3Script", "RawPlutusData", "Redeemer", "ScriptType", @@ -1014,6 +1015,10 @@ class PlutusV2Script(bytes): pass +class PlutusV3Script(bytes): + pass + + ScriptType = Union[bytes, NativeScript, PlutusV1Script, PlutusV2Script] """Script type. A Union type that contains all valid script types.""" @@ -1037,6 +1042,10 @@ def script_hash(script: ScriptType) -> ScriptHash: return ScriptHash( blake2b(bytes.fromhex("02") + script, SCRIPT_HASH_SIZE, encoder=RawEncoder) ) + elif isinstance(script, PlutusV3Script): + return ScriptHash( + blake2b(bytes.fromhex("03") + script, SCRIPT_HASH_SIZE, encoder=RawEncoder) + ) else: raise TypeError(f"Unexpected script type: {type(script)}") diff --git a/pycardano/txbuilder.py b/pycardano/txbuilder.py index 63ea93cc..62a0b5ad 100644 --- a/pycardano/txbuilder.py +++ b/pycardano/txbuilder.py @@ -40,6 +40,7 @@ ExecutionUnits, PlutusV1Script, PlutusV2Script, + PlutusV3Script, Redeemer, RedeemerTag, ScriptType, @@ -155,9 +156,9 @@ class TransactionBuilder: init=False, default_factory=lambda: {} ) - _reference_scripts: List[Union[NativeScript, PlutusV1Script, PlutusV2Script]] = ( - field(init=False, default_factory=lambda: []) - ) + _reference_scripts: List[ + Union[NativeScript, PlutusV1Script, PlutusV2Script, PlutusV3Script] + ] = field(init=False, default_factory=lambda: []) _should_estimate_execution_units: Optional[bool] = field(init=False, default=None) @@ -203,7 +204,7 @@ def add_script_input( self, utxo: UTxO, script: Optional[ - Union[UTxO, NativeScript, PlutusV1Script, PlutusV2Script] + Union[UTxO, NativeScript, PlutusV1Script, PlutusV2Script, PlutusV3Script] ] = None, datum: Optional[Datum] = None, redeemer: Optional[Redeemer] = None, @@ -212,7 +213,8 @@ def add_script_input( Args: utxo (UTxO): Script UTxO to be added. - script (Optional[Union[UTxO, NativeScript, PlutusV1Script, PlutusV2Script]]): A plutus script. + script (Optional[Union[UTxO, NativeScript, PlutusV1Script, PlutusV2Script, PlutusV3Script]]): + A plutus script. If not provided, the script will be inferred from the input UTxO (first arg of this method). The script can also be a specific UTxO whose output contains an inline script. datum (Optional[Datum]): A plutus datum to unlock the UTxO. @@ -263,7 +265,10 @@ def add_script_input( # collect potential scripts to fulfill the input candidate_scripts: List[ - Tuple[Union[NativeScript, PlutusV1Script, PlutusV2Script], Optional[UTxO]] + Tuple[ + Union[NativeScript, PlutusV1Script, PlutusV2Script, PlutusV3Script], + Optional[UTxO], + ] ] = [] if utxo.output.script: candidate_scripts.append((utxo.output.script, utxo)) @@ -290,6 +295,7 @@ def add_script_input( if candidate_utxo is not None: self.reference_inputs.add(candidate_utxo) self._reference_scripts.append(candidate_script) + break if not found_valid_script: raise InvalidArgumentException( f"Cannot find a valid script to fulfill the input UTxO: {utxo.input}." @@ -301,13 +307,15 @@ def add_script_input( def add_minting_script( self, - script: Union[UTxO, NativeScript, PlutusV1Script, PlutusV2Script], + script: Union[ + UTxO, NativeScript, PlutusV1Script, PlutusV2Script, PlutusV3Script + ], redeemer: Optional[Redeemer] = None, ) -> TransactionBuilder: """Add a minting script along with its datum and redeemer to this transaction. Args: - script (Union[UTxO, PlutusV1Script, PlutusV2Script]): A plutus script. + script (Union[UTxO, PlutusV1Script, PlutusV2Script, PlutusV3Script]): A plutus script. redeemer (Optional[Redeemer]): A plutus redeemer to unlock the UTxO. Returns: @@ -333,13 +341,15 @@ def add_minting_script( def add_withdrawal_script( self, - script: Union[UTxO, NativeScript, PlutusV1Script, PlutusV2Script], + script: Union[ + UTxO, NativeScript, PlutusV1Script, PlutusV2Script, PlutusV3Script + ], redeemer: Optional[Redeemer] = None, ) -> TransactionBuilder: """Add a withdrawal script along with its redeemer to this transaction. Args: - script (Union[UTxO, PlutusV1Script, PlutusV2Script]): A plutus script. + script (Union[UTxO, PlutusV1Script, PlutusV2Script, PlutusV3Script]): A plutus script. redeemer (Optional[Redeemer]): A plutus redeemer to unlock the UTxO. Returns: @@ -495,6 +505,10 @@ def script_data_hash(self) -> Optional[ScriptDataHash]: self.context.protocol_param.cost_models.get("PlutusV2") or PLUTUS_V2_COST_MODEL ) + if isinstance(s, PlutusV3Script): + cost_models[1] = self.context.protocol_param.cost_models.get( + "PlutusV3", {} + ) return script_data_hash( self.redeemers, list(self.datums.values()), CostModels(cost_models) ) @@ -875,7 +889,7 @@ def _build_tx_body(self) -> TransactionBody: self.auxiliary_data.hash() if self.auxiliary_data else None ), script_data_hash=self.script_data_hash, - required_signers=self.required_signers, + required_signers=self.required_signers if self.required_signers else None, validity_start=self.validity_start, collateral=( [c.input for c in self.collaterals] if self.collaterals else None @@ -941,6 +955,7 @@ def build_witness_set(self) -> TransactionWitnessSet: native_scripts: List[NativeScript] = [] plutus_v1_scripts: List[PlutusV1Script] = [] plutus_v2_scripts: List[PlutusV2Script] = [] + plutus_v3_scripts: List[PlutusV3Script] = [] for script in self.scripts: if isinstance(script, NativeScript): @@ -951,6 +966,8 @@ def build_witness_set(self) -> TransactionWitnessSet: plutus_v1_scripts.append(PlutusV1Script(script)) elif isinstance(script, PlutusV2Script): plutus_v2_scripts.append(script) + elif isinstance(script, PlutusV3Script): + plutus_v3_scripts.append(script) else: raise InvalidArgumentException( f"Unsupported script type: {type(script)}" @@ -960,6 +977,7 @@ def build_witness_set(self) -> TransactionWitnessSet: native_scripts=native_scripts if native_scripts else None, plutus_v1_script=plutus_v1_scripts if plutus_v1_scripts else None, plutus_v2_script=plutus_v2_scripts if plutus_v2_scripts else None, + plutus_v3_script=plutus_v3_scripts if plutus_v3_scripts else None, redeemer=self.redeemers if self.redeemers else None, plutus_data=list(self.datums.values()) if self.datums else None, ) @@ -977,11 +995,19 @@ def _estimate_fee(self): for redeemer in self.redeemers: plutus_execution_units += redeemer.ex_units + ref_script_size = 0 + for s in self._reference_scripts: + if isinstance(s, NativeScript): + ref_script_size += len(s.to_cbor()) + else: + ref_script_size += len(s) + estimated_fee = fee( self.context, len(self._build_full_fake_tx().to_cbor()), plutus_execution_units.steps, plutus_execution_units.mem, + ref_script_size, ) if self.fee_buffer is not None: estimated_fee += self.fee_buffer diff --git a/pycardano/utils.py b/pycardano/utils.py index af3a215a..23a6dda1 100644 --- a/pycardano/utils.py +++ b/pycardano/utils.py @@ -23,14 +23,57 @@ "min_lovelace_pre_alonzo", "min_lovelace_post_alonzo", "script_data_hash", + "tiered_reference_script_fee", ] +def tiered_reference_script_fee(context: ChainContext, scripts_size: int) -> int: + """Calculate fee for reference scripts. + + Args: + context (ChainContext): A chain context. + scripts_size (int): Size of reference scripts in bytes. + + Returns: + int: Fee for reference scripts. + + Raises: + ValueError: If scripts size exceeds maximum allowed size + """ + if ( + context.protocol_param.maximum_reference_scripts_size is None + or context.protocol_param.min_fee_reference_scripts is None + ): + return 0 + + max_size = context.protocol_param.maximum_reference_scripts_size["bytes"] + if scripts_size > max_size: + raise ValueError( + f"Reference scripts size: {scripts_size} exceeds maximum allowed size ({max_size})." + ) + + total = 0 + if scripts_size: + b = context.protocol_param.min_fee_reference_scripts["base"] + r = context.protocol_param.min_fee_reference_scripts["range"] + m = context.protocol_param.min_fee_reference_scripts["multiplier"] + + while scripts_size > r: + total += math.ceil(b * r) + scripts_size = math.ceil(scripts_size - r) + b = math.ceil(b * m) + + total += math.ceil(b * scripts_size) + + return total + + def fee( context: ChainContext, length: int, exec_steps: int = 0, max_mem_unit: int = 0, + ref_script_size: int = 0, ) -> int: """Calculate fee based on the length of a transaction's CBOR bytes and script execution. @@ -38,8 +81,9 @@ def fee( context (ChainConext): A chain context. length (int): The length of CBOR bytes, which could usually be derived by `len(tx.to_cbor())`. - exec_steps (Optional[int]): Number of execution steps run by plutus scripts in the transaction. - max_mem_unit (Optional[int]): Max numer of memory units run by plutus scripts in the transaction. + exec_steps (int): Number of execution steps run by plutus scripts in the transaction. + max_mem_unit (int): Max numer of memory units run by plutus scripts in the transaction. + ref_script_size (int): Size of referenced scripts in the transaction. Return: int: Minimum acceptable transaction fee. @@ -49,6 +93,7 @@ def fee( + math.ceil(context.protocol_param.min_fee_constant) + math.ceil(exec_steps * context.protocol_param.price_step) + math.ceil(max_mem_unit * context.protocol_param.price_mem) + + tiered_reference_script_fee(context, ref_script_size) ) diff --git a/pycardano/witness.py b/pycardano/witness.py index 9a62923d..3a38f757 100644 --- a/pycardano/witness.py +++ b/pycardano/witness.py @@ -7,7 +7,13 @@ from pycardano.key import ExtendedVerificationKey, VerificationKey from pycardano.nativescript import NativeScript -from pycardano.plutus import PlutusV1Script, PlutusV2Script, RawPlutusData, Redeemer +from pycardano.plutus import ( + PlutusV1Script, + PlutusV2Script, + PlutusV3Script, + RawPlutusData, + Redeemer, +) from pycardano.serialization import ( ArrayCBORSerializable, MapCBORSerializable, @@ -65,10 +71,6 @@ class TransactionWitnessSet(MapCBORSerializable): default=None, metadata={"optional": True, "key": 3} ) - plutus_v2_script: Optional[List[PlutusV2Script]] = field( - default=None, metadata={"optional": True, "key": 6} - ) - plutus_data: Optional[List[Any]] = field( default=None, metadata={"optional": True, "key": 4, "object_hook": list_hook(RawPlutusData)}, @@ -79,6 +81,14 @@ class TransactionWitnessSet(MapCBORSerializable): metadata={"optional": True, "key": 5, "object_hook": list_hook(Redeemer)}, ) + plutus_v2_script: Optional[List[PlutusV2Script]] = field( + default=None, metadata={"optional": True, "key": 6} + ) + + plutus_v3_script: Optional[List[PlutusV3Script]] = field( + default=None, metadata={"optional": True, "key": 7} + ) + @classmethod @limit_primitive_type(dict, list) def from_primitive( diff --git a/pyproject.toml b/pyproject.toml index 69ae861c..be4a1500 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,7 +64,8 @@ addopts = "--doctest-modules --ignore=examples --ignore=integration-test --ignor minversion = "6.0" markers = [ "post_alonzo", - "single" + "single", + "CardanoCLI", ] diff --git a/test/pycardano/test_metadata.py b/test/pycardano/test_metadata.py index 8a7379d3..f8d43af4 100644 --- a/test/pycardano/test_metadata.py +++ b/test/pycardano/test_metadata.py @@ -17,6 +17,7 @@ ScriptAll, ScriptPubkey, ) +from pycardano.plutus import PlutusV1Script M_PRIMITIVE = {123: {"test": b"123", 2: 3, 3: [1, 2, {(1, 2, 3): "token"}]}} @@ -56,9 +57,9 @@ def test_shelley_marry_metadata(): def test_alonzo_metadata(): script = generate_script() m = Metadata(M_PRIMITIVE) - plutus_scripts = [b"fake_script"] + plutus_scripts = [PlutusV1Script(b"fake_script")] - alonzo_m = AlonzoMetadata(m, [script], plutus_scripts) + alonzo_m = AlonzoMetadata(m, [script], plutus_v1_scripts=plutus_scripts) check_two_way_cbor(alonzo_m) @@ -73,11 +74,11 @@ def test_alonzo_metadata(): def test_auxiliary_data(): script = generate_script() - plutus_scripts = [b"fake_script"] + plutus_scripts = [PlutusV1Script(b"fake_script")] m = Metadata(M_PRIMITIVE) shelley_marry_m = ShelleyMarryMetadata(m, [script]) - alonzo_m = AlonzoMetadata(m, [script], plutus_scripts) + alonzo_m = AlonzoMetadata(m, [script], plutus_v1_scripts=plutus_scripts) check_two_way_cbor(AuxiliaryData(m)) check_two_way_cbor(AuxiliaryData(shelley_marry_m)) diff --git a/test/pycardano/util.py b/test/pycardano/util.py index 892b16eb..5f965ac3 100644 --- a/test/pycardano/util.py +++ b/test/pycardano/util.py @@ -46,6 +46,8 @@ class FixedChainContext(ChainContext): coins_per_utxo_word=34482, coins_per_utxo_byte=4310, cost_models={}, + min_fee_reference_scripts={"base": 25600, "range": 44, "multiplier": 1.2}, + maximum_reference_scripts_size={"bytes": 200_000}, ) _genesis_param = GenesisParameters(