feat(configs): add serde for Alonzo genesis file (#436)
This commit is contained in:
parent
a0c409b65e
commit
7ff70f4020
7 changed files with 607 additions and 34 deletions
|
|
@ -15,9 +15,11 @@ hex = "0.4.3"
|
|||
pallas-addresses = { version = "=0.25.0", path = "../pallas-addresses" }
|
||||
pallas-crypto = { version = "=0.25.0", path = "../pallas-crypto" }
|
||||
pallas-codec = { version = "=0.25.0", path = "../pallas-codec" }
|
||||
pallas-primitives = { version = "=0.25.0", path = "../pallas-primitives" }
|
||||
serde = { version = "1.0.136", optional = true, features = ["derive"] }
|
||||
serde_json = { version = "1.0.79", optional = true }
|
||||
base64 = "0.22.0"
|
||||
serde_with = "3.7.0"
|
||||
|
||||
[features]
|
||||
json = ["serde", "serde_json"]
|
||||
|
|
|
|||
132
pallas-configs/src/alonzo.rs
Normal file
132
pallas-configs/src/alonzo.rs
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
use serde::Deserialize;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Deserialize, Clone)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ExecutionPrices {
|
||||
pub pr_steps: Fraction,
|
||||
pub pr_mem: Fraction,
|
||||
}
|
||||
|
||||
impl From<ExecutionPrices> for pallas_primitives::alonzo::ExUnitPrices {
|
||||
fn from(value: ExecutionPrices) -> Self {
|
||||
Self {
|
||||
mem_price: value.pr_mem.into(),
|
||||
step_price: value.pr_steps.into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Clone)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ExUnits {
|
||||
pub ex_units_mem: u32,
|
||||
pub ex_units_steps: u64,
|
||||
}
|
||||
|
||||
impl From<ExUnits> for pallas_primitives::alonzo::ExUnits {
|
||||
fn from(value: ExUnits) -> Self {
|
||||
Self {
|
||||
mem: value.ex_units_mem,
|
||||
steps: value.ex_units_steps,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Clone)]
|
||||
pub struct Fraction {
|
||||
pub numerator: u64,
|
||||
pub denominator: u64,
|
||||
}
|
||||
|
||||
impl From<Fraction> for pallas_primitives::alonzo::RationalNumber {
|
||||
fn from(value: Fraction) -> Self {
|
||||
Self {
|
||||
numerator: value.numerator,
|
||||
denominator: value.denominator,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, PartialEq, Eq, Hash, Clone)]
|
||||
pub enum Language {
|
||||
PlutusV1,
|
||||
}
|
||||
|
||||
impl From<Language> for pallas_primitives::alonzo::Language {
|
||||
fn from(value: Language) -> Self {
|
||||
match value {
|
||||
Language::PlutusV1 => Self::PlutusV1,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Clone)]
|
||||
pub struct CostModel(HashMap<String, i64>);
|
||||
|
||||
impl From<CostModel> for pallas_primitives::alonzo::CostModel {
|
||||
fn from(value: CostModel) -> Self {
|
||||
value.0.into_values().collect()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Clone)]
|
||||
pub struct CostModelPerLanguage(HashMap<Language, CostModel>);
|
||||
|
||||
impl From<CostModelPerLanguage> for pallas_primitives::alonzo::CostMdls {
|
||||
fn from(value: CostModelPerLanguage) -> Self {
|
||||
let inner = value
|
||||
.0
|
||||
.into_iter()
|
||||
.map(|(k, v)| (k.into(), v.into()))
|
||||
.collect();
|
||||
|
||||
Self::Def(inner)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct GenesisFile {
|
||||
#[serde(rename = "lovelacePerUTxOWord")]
|
||||
pub lovelace_per_utxo_word: u64,
|
||||
pub execution_prices: ExecutionPrices,
|
||||
pub max_tx_ex_units: ExUnits,
|
||||
pub max_block_ex_units: ExUnits,
|
||||
pub max_value_size: u32,
|
||||
pub collateral_percentage: u32,
|
||||
pub max_collateral_inputs: u32,
|
||||
pub cost_models: CostModelPerLanguage,
|
||||
}
|
||||
|
||||
pub fn from_file(path: &std::path::Path) -> Result<GenesisFile, std::io::Error> {
|
||||
let file = std::fs::File::open(path)?;
|
||||
let reader = std::io::BufReader::new(file);
|
||||
let parsed: GenesisFile = serde_json::from_reader(reader)?;
|
||||
|
||||
Ok(parsed)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
fn load_test_data_config(network: &str) -> GenesisFile {
|
||||
let path = std::path::PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap())
|
||||
.join("..")
|
||||
.join("test_data")
|
||||
.join(format!("{network}-alonzo-genesis.json"));
|
||||
|
||||
from_file(&path).unwrap()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_preview_json_loads() {
|
||||
load_test_data_config("preview");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_mainnet_json_loads() {
|
||||
load_test_data_config("mainnet");
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,8 @@
|
|||
use pallas_addresses::ByronAddress;
|
||||
use pallas_crypto::hash::Hash;
|
||||
use serde::Deserialize;
|
||||
use serde_with::serde_as;
|
||||
use serde_with::DisplayFromStr;
|
||||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
|
|
@ -19,23 +21,47 @@ pub struct GenesisFile {
|
|||
pub vss_certs: Option<HashMap<String, VssCert>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[serde_as]
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BlockVersionData {
|
||||
pub heavy_del_thd: String,
|
||||
pub max_block_size: String,
|
||||
pub max_header_size: String,
|
||||
pub max_proposal_size: String,
|
||||
pub max_tx_size: String,
|
||||
pub mpc_thd: String,
|
||||
pub script_version: u32,
|
||||
pub slot_duration: String,
|
||||
pub script_version: u16,
|
||||
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub heavy_del_thd: u64,
|
||||
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub max_block_size: u64,
|
||||
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub max_header_size: u64,
|
||||
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub max_proposal_size: u64,
|
||||
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub max_tx_size: u64,
|
||||
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub mpc_thd: u64,
|
||||
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub slot_duration: u64,
|
||||
|
||||
pub softfork_rule: SoftForkRule,
|
||||
pub tx_fee_policy: TxFeePolicy,
|
||||
pub unlock_stake_epoch: String,
|
||||
pub update_implicit: String,
|
||||
pub update_proposal_thd: String,
|
||||
pub update_vote_thd: String,
|
||||
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub unlock_stake_epoch: u64,
|
||||
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub update_implicit: u64,
|
||||
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub update_proposal_thd: u64,
|
||||
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub update_vote_thd: u64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
|
|
@ -69,18 +95,34 @@ pub struct VssCert {
|
|||
pub signing_key: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[serde_as]
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SoftForkRule {
|
||||
pub init_thd: String,
|
||||
pub min_thd: String,
|
||||
pub thd_decrement: String,
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub init_thd: u64,
|
||||
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub min_thd: u64,
|
||||
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub thd_decrement: u64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
impl From<SoftForkRule> for (u64, u64, u64) {
|
||||
fn from(value: SoftForkRule) -> Self {
|
||||
(value.init_thd, value.min_thd, value.thd_decrement)
|
||||
}
|
||||
}
|
||||
|
||||
#[serde_as]
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
pub struct TxFeePolicy {
|
||||
pub multiplier: String,
|
||||
pub summand: String,
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub multiplier: u64,
|
||||
|
||||
#[serde_as(as = "DisplayFromStr")]
|
||||
pub summand: u64,
|
||||
}
|
||||
|
||||
pub fn from_file(path: &std::path::Path) -> Result<GenesisFile, std::io::Error> {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
//! Genesis data structs and utilities
|
||||
|
||||
pub mod alonzo;
|
||||
pub mod byron;
|
||||
pub mod shelley;
|
||||
|
|
|
|||
|
|
@ -8,11 +8,17 @@ pub struct GenDelegs {
|
|||
pub vrf: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ProtocolVersion {
|
||||
pub minor: Option<u32>,
|
||||
pub major: Option<u32>,
|
||||
pub minor: u64,
|
||||
pub major: u64,
|
||||
}
|
||||
|
||||
impl From<ProtocolVersion> for pallas_primitives::alonzo::ProtocolVersion {
|
||||
fn from(value: ProtocolVersion) -> Self {
|
||||
(value.major, value.minor)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
|
|
@ -24,20 +30,22 @@ pub struct ExtraEntropy {
|
|||
#[derive(Debug, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ProtocolParams {
|
||||
pub protocol_version: Option<ProtocolVersion>,
|
||||
pub protocol_version: ProtocolVersion,
|
||||
pub max_tx_size: u32,
|
||||
pub max_block_body_size: u32,
|
||||
pub max_block_header_size: u32,
|
||||
pub key_deposit: u64,
|
||||
#[serde(rename = "minUTxOValue")]
|
||||
pub min_utxo_value: u64,
|
||||
pub min_fee_a: u32,
|
||||
pub min_fee_b: u32,
|
||||
pub pool_deposit: u64,
|
||||
pub n_opt: u32,
|
||||
pub min_pool_cost: u64,
|
||||
|
||||
pub decentralisation_param: Option<u32>,
|
||||
pub e_max: Option<u32>,
|
||||
pub extra_entropy: Option<ExtraEntropy>,
|
||||
pub max_tx_size: u64,
|
||||
pub max_block_body_size: Option<u32>,
|
||||
pub max_block_header_size: Option<u32>,
|
||||
pub min_fee_a: u64,
|
||||
pub min_fee_b: u64,
|
||||
pub min_u_tx_o_value: u64,
|
||||
pub pool_deposit: Option<u64>,
|
||||
pub min_pool_cost: Option<u64>,
|
||||
pub key_deposit: Option<u32>,
|
||||
pub n_opt: Option<u32>,
|
||||
pub rho: Option<f32>,
|
||||
pub tau: Option<f32>,
|
||||
pub a0: Option<f32>,
|
||||
|
|
|
|||
194
test_data/mainnet-alonzo-genesis.json
Normal file
194
test_data/mainnet-alonzo-genesis.json
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
{
|
||||
"lovelacePerUTxOWord": 34482,
|
||||
"executionPrices": {
|
||||
"prSteps": {
|
||||
"numerator": 721,
|
||||
"denominator": 10000000
|
||||
},
|
||||
"prMem": {
|
||||
"numerator": 577,
|
||||
"denominator": 10000
|
||||
}
|
||||
},
|
||||
"maxTxExUnits": {
|
||||
"exUnitsMem": 10000000,
|
||||
"exUnitsSteps": 10000000000
|
||||
},
|
||||
"maxBlockExUnits": {
|
||||
"exUnitsMem": 50000000,
|
||||
"exUnitsSteps": 40000000000
|
||||
},
|
||||
"maxValueSize": 5000,
|
||||
"collateralPercentage": 150,
|
||||
"maxCollateralInputs": 3,
|
||||
"costModels": {
|
||||
"PlutusV1": {
|
||||
"sha2_256-memory-arguments": 4,
|
||||
"equalsString-cpu-arguments-constant": 1000,
|
||||
"cekDelayCost-exBudgetMemory": 100,
|
||||
"lessThanEqualsByteString-cpu-arguments-intercept": 103599,
|
||||
"divideInteger-memory-arguments-minimum": 1,
|
||||
"appendByteString-cpu-arguments-slope": 621,
|
||||
"blake2b-cpu-arguments-slope": 29175,
|
||||
"iData-cpu-arguments": 150000,
|
||||
"encodeUtf8-cpu-arguments-slope": 1000,
|
||||
"unBData-cpu-arguments": 150000,
|
||||
"multiplyInteger-cpu-arguments-intercept": 61516,
|
||||
"cekConstCost-exBudgetMemory": 100,
|
||||
"nullList-cpu-arguments": 150000,
|
||||
"equalsString-cpu-arguments-intercept": 150000,
|
||||
"trace-cpu-arguments": 150000,
|
||||
"mkNilData-memory-arguments": 32,
|
||||
"lengthOfByteString-cpu-arguments": 150000,
|
||||
"cekBuiltinCost-exBudgetCPU": 29773,
|
||||
"bData-cpu-arguments": 150000,
|
||||
"subtractInteger-cpu-arguments-slope": 0,
|
||||
"unIData-cpu-arguments": 150000,
|
||||
"consByteString-memory-arguments-intercept": 0,
|
||||
"divideInteger-memory-arguments-slope": 1,
|
||||
"divideInteger-cpu-arguments-model-arguments-slope": 118,
|
||||
"listData-cpu-arguments": 150000,
|
||||
"headList-cpu-arguments": 150000,
|
||||
"chooseData-memory-arguments": 32,
|
||||
"equalsInteger-cpu-arguments-intercept": 136542,
|
||||
"sha3_256-cpu-arguments-slope": 82363,
|
||||
"sliceByteString-cpu-arguments-slope": 5000,
|
||||
"unMapData-cpu-arguments": 150000,
|
||||
"lessThanInteger-cpu-arguments-intercept": 179690,
|
||||
"mkCons-cpu-arguments": 150000,
|
||||
"appendString-memory-arguments-intercept": 0,
|
||||
"modInteger-cpu-arguments-model-arguments-slope": 118,
|
||||
"ifThenElse-cpu-arguments": 1,
|
||||
"mkNilPairData-cpu-arguments": 150000,
|
||||
"lessThanEqualsInteger-cpu-arguments-intercept": 145276,
|
||||
"addInteger-memory-arguments-slope": 1,
|
||||
"chooseList-memory-arguments": 32,
|
||||
"constrData-memory-arguments": 32,
|
||||
"decodeUtf8-cpu-arguments-intercept": 150000,
|
||||
"equalsData-memory-arguments": 1,
|
||||
"subtractInteger-memory-arguments-slope": 1,
|
||||
"appendByteString-memory-arguments-intercept": 0,
|
||||
"lengthOfByteString-memory-arguments": 4,
|
||||
"headList-memory-arguments": 32,
|
||||
"listData-memory-arguments": 32,
|
||||
"consByteString-cpu-arguments-intercept": 150000,
|
||||
"unIData-memory-arguments": 32,
|
||||
"remainderInteger-memory-arguments-minimum": 1,
|
||||
"bData-memory-arguments": 32,
|
||||
"lessThanByteString-cpu-arguments-slope": 248,
|
||||
"encodeUtf8-memory-arguments-intercept": 0,
|
||||
"cekStartupCost-exBudgetCPU": 100,
|
||||
"multiplyInteger-memory-arguments-intercept": 0,
|
||||
"unListData-memory-arguments": 32,
|
||||
"remainderInteger-cpu-arguments-model-arguments-slope": 118,
|
||||
"cekVarCost-exBudgetCPU": 29773,
|
||||
"remainderInteger-memory-arguments-slope": 1,
|
||||
"cekForceCost-exBudgetCPU": 29773,
|
||||
"sha2_256-cpu-arguments-slope": 29175,
|
||||
"equalsInteger-memory-arguments": 1,
|
||||
"indexByteString-memory-arguments": 1,
|
||||
"addInteger-memory-arguments-intercept": 1,
|
||||
"chooseUnit-cpu-arguments": 150000,
|
||||
"sndPair-cpu-arguments": 150000,
|
||||
"cekLamCost-exBudgetCPU": 29773,
|
||||
"fstPair-cpu-arguments": 150000,
|
||||
"quotientInteger-memory-arguments-minimum": 1,
|
||||
"decodeUtf8-cpu-arguments-slope": 1000,
|
||||
"lessThanInteger-memory-arguments": 1,
|
||||
"lessThanEqualsInteger-cpu-arguments-slope": 1366,
|
||||
"fstPair-memory-arguments": 32,
|
||||
"modInteger-memory-arguments-intercept": 0,
|
||||
"unConstrData-cpu-arguments": 150000,
|
||||
"lessThanEqualsInteger-memory-arguments": 1,
|
||||
"chooseUnit-memory-arguments": 32,
|
||||
"sndPair-memory-arguments": 32,
|
||||
"addInteger-cpu-arguments-intercept": 197209,
|
||||
"decodeUtf8-memory-arguments-slope": 8,
|
||||
"equalsData-cpu-arguments-intercept": 150000,
|
||||
"mapData-cpu-arguments": 150000,
|
||||
"mkPairData-cpu-arguments": 150000,
|
||||
"quotientInteger-cpu-arguments-constant": 148000,
|
||||
"consByteString-memory-arguments-slope": 1,
|
||||
"cekVarCost-exBudgetMemory": 100,
|
||||
"indexByteString-cpu-arguments": 150000,
|
||||
"unListData-cpu-arguments": 150000,
|
||||
"equalsInteger-cpu-arguments-slope": 1326,
|
||||
"cekStartupCost-exBudgetMemory": 100,
|
||||
"subtractInteger-cpu-arguments-intercept": 197209,
|
||||
"divideInteger-cpu-arguments-model-arguments-intercept": 425507,
|
||||
"divideInteger-memory-arguments-intercept": 0,
|
||||
"cekForceCost-exBudgetMemory": 100,
|
||||
"blake2b-cpu-arguments-intercept": 2477736,
|
||||
"remainderInteger-cpu-arguments-constant": 148000,
|
||||
"tailList-cpu-arguments": 150000,
|
||||
"encodeUtf8-cpu-arguments-intercept": 150000,
|
||||
"equalsString-cpu-arguments-slope": 1000,
|
||||
"lessThanByteString-memory-arguments": 1,
|
||||
"multiplyInteger-cpu-arguments-slope": 11218,
|
||||
"appendByteString-cpu-arguments-intercept": 396231,
|
||||
"lessThanEqualsByteString-cpu-arguments-slope": 248,
|
||||
"modInteger-memory-arguments-slope": 1,
|
||||
"addInteger-cpu-arguments-slope": 0,
|
||||
"equalsData-cpu-arguments-slope": 10000,
|
||||
"decodeUtf8-memory-arguments-intercept": 0,
|
||||
"chooseList-cpu-arguments": 150000,
|
||||
"constrData-cpu-arguments": 150000,
|
||||
"equalsByteString-memory-arguments": 1,
|
||||
"cekApplyCost-exBudgetCPU": 29773,
|
||||
"quotientInteger-memory-arguments-slope": 1,
|
||||
"verifySignature-cpu-arguments-intercept": 3345831,
|
||||
"unMapData-memory-arguments": 32,
|
||||
"mkCons-memory-arguments": 32,
|
||||
"sliceByteString-memory-arguments-slope": 1,
|
||||
"sha3_256-memory-arguments": 4,
|
||||
"ifThenElse-memory-arguments": 1,
|
||||
"mkNilPairData-memory-arguments": 32,
|
||||
"equalsByteString-cpu-arguments-slope": 247,
|
||||
"appendString-cpu-arguments-intercept": 150000,
|
||||
"quotientInteger-cpu-arguments-model-arguments-slope": 118,
|
||||
"cekApplyCost-exBudgetMemory": 100,
|
||||
"equalsString-memory-arguments": 1,
|
||||
"multiplyInteger-memory-arguments-slope": 1,
|
||||
"cekBuiltinCost-exBudgetMemory": 100,
|
||||
"remainderInteger-memory-arguments-intercept": 0,
|
||||
"sha2_256-cpu-arguments-intercept": 2477736,
|
||||
"remainderInteger-cpu-arguments-model-arguments-intercept": 425507,
|
||||
"lessThanEqualsByteString-memory-arguments": 1,
|
||||
"tailList-memory-arguments": 32,
|
||||
"mkNilData-cpu-arguments": 150000,
|
||||
"chooseData-cpu-arguments": 150000,
|
||||
"unBData-memory-arguments": 32,
|
||||
"blake2b-memory-arguments": 4,
|
||||
"iData-memory-arguments": 32,
|
||||
"nullList-memory-arguments": 32,
|
||||
"cekDelayCost-exBudgetCPU": 29773,
|
||||
"subtractInteger-memory-arguments-intercept": 1,
|
||||
"lessThanByteString-cpu-arguments-intercept": 103599,
|
||||
"consByteString-cpu-arguments-slope": 1000,
|
||||
"appendByteString-memory-arguments-slope": 1,
|
||||
"trace-memory-arguments": 32,
|
||||
"divideInteger-cpu-arguments-constant": 148000,
|
||||
"cekConstCost-exBudgetCPU": 29773,
|
||||
"encodeUtf8-memory-arguments-slope": 8,
|
||||
"quotientInteger-cpu-arguments-model-arguments-intercept": 425507,
|
||||
"mapData-memory-arguments": 32,
|
||||
"appendString-cpu-arguments-slope": 1000,
|
||||
"modInteger-cpu-arguments-constant": 148000,
|
||||
"verifySignature-cpu-arguments-slope": 1,
|
||||
"unConstrData-memory-arguments": 32,
|
||||
"quotientInteger-memory-arguments-intercept": 0,
|
||||
"equalsByteString-cpu-arguments-constant": 150000,
|
||||
"sliceByteString-memory-arguments-intercept": 0,
|
||||
"mkPairData-memory-arguments": 32,
|
||||
"equalsByteString-cpu-arguments-intercept": 112536,
|
||||
"appendString-memory-arguments-slope": 1,
|
||||
"lessThanInteger-cpu-arguments-slope": 497,
|
||||
"modInteger-cpu-arguments-model-arguments-intercept": 425507,
|
||||
"modInteger-memory-arguments-minimum": 1,
|
||||
"sha3_256-cpu-arguments-intercept": 0,
|
||||
"verifySignature-memory-arguments": 1,
|
||||
"cekLamCost-exBudgetMemory": 100,
|
||||
"sliceByteString-cpu-arguments-intercept": 150000
|
||||
}
|
||||
}
|
||||
}
|
||||
194
test_data/preview-alonzo-genesis.json
Normal file
194
test_data/preview-alonzo-genesis.json
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
{
|
||||
"lovelacePerUTxOWord": 34482,
|
||||
"executionPrices": {
|
||||
"prSteps": {
|
||||
"numerator": 721,
|
||||
"denominator": 10000000
|
||||
},
|
||||
"prMem": {
|
||||
"numerator": 577,
|
||||
"denominator": 10000
|
||||
}
|
||||
},
|
||||
"maxTxExUnits": {
|
||||
"exUnitsMem": 10000000,
|
||||
"exUnitsSteps": 10000000000
|
||||
},
|
||||
"maxBlockExUnits": {
|
||||
"exUnitsMem": 50000000,
|
||||
"exUnitsSteps": 40000000000
|
||||
},
|
||||
"maxValueSize": 5000,
|
||||
"collateralPercentage": 150,
|
||||
"maxCollateralInputs": 3,
|
||||
"costModels": {
|
||||
"PlutusV1": {
|
||||
"sha2_256-memory-arguments": 4,
|
||||
"equalsString-cpu-arguments-constant": 1000,
|
||||
"cekDelayCost-exBudgetMemory": 100,
|
||||
"lessThanEqualsByteString-cpu-arguments-intercept": 103599,
|
||||
"divideInteger-memory-arguments-minimum": 1,
|
||||
"appendByteString-cpu-arguments-slope": 621,
|
||||
"blake2b-cpu-arguments-slope": 29175,
|
||||
"iData-cpu-arguments": 150000,
|
||||
"encodeUtf8-cpu-arguments-slope": 1000,
|
||||
"unBData-cpu-arguments": 150000,
|
||||
"multiplyInteger-cpu-arguments-intercept": 61516,
|
||||
"cekConstCost-exBudgetMemory": 100,
|
||||
"nullList-cpu-arguments": 150000,
|
||||
"equalsString-cpu-arguments-intercept": 150000,
|
||||
"trace-cpu-arguments": 150000,
|
||||
"mkNilData-memory-arguments": 32,
|
||||
"lengthOfByteString-cpu-arguments": 150000,
|
||||
"cekBuiltinCost-exBudgetCPU": 29773,
|
||||
"bData-cpu-arguments": 150000,
|
||||
"subtractInteger-cpu-arguments-slope": 0,
|
||||
"unIData-cpu-arguments": 150000,
|
||||
"consByteString-memory-arguments-intercept": 0,
|
||||
"divideInteger-memory-arguments-slope": 1,
|
||||
"divideInteger-cpu-arguments-model-arguments-slope": 118,
|
||||
"listData-cpu-arguments": 150000,
|
||||
"headList-cpu-arguments": 150000,
|
||||
"chooseData-memory-arguments": 32,
|
||||
"equalsInteger-cpu-arguments-intercept": 136542,
|
||||
"sha3_256-cpu-arguments-slope": 82363,
|
||||
"sliceByteString-cpu-arguments-slope": 5000,
|
||||
"unMapData-cpu-arguments": 150000,
|
||||
"lessThanInteger-cpu-arguments-intercept": 179690,
|
||||
"mkCons-cpu-arguments": 150000,
|
||||
"appendString-memory-arguments-intercept": 0,
|
||||
"modInteger-cpu-arguments-model-arguments-slope": 118,
|
||||
"ifThenElse-cpu-arguments": 1,
|
||||
"mkNilPairData-cpu-arguments": 150000,
|
||||
"lessThanEqualsInteger-cpu-arguments-intercept": 145276,
|
||||
"addInteger-memory-arguments-slope": 1,
|
||||
"chooseList-memory-arguments": 32,
|
||||
"constrData-memory-arguments": 32,
|
||||
"decodeUtf8-cpu-arguments-intercept": 150000,
|
||||
"equalsData-memory-arguments": 1,
|
||||
"subtractInteger-memory-arguments-slope": 1,
|
||||
"appendByteString-memory-arguments-intercept": 0,
|
||||
"lengthOfByteString-memory-arguments": 4,
|
||||
"headList-memory-arguments": 32,
|
||||
"listData-memory-arguments": 32,
|
||||
"consByteString-cpu-arguments-intercept": 150000,
|
||||
"unIData-memory-arguments": 32,
|
||||
"remainderInteger-memory-arguments-minimum": 1,
|
||||
"bData-memory-arguments": 32,
|
||||
"lessThanByteString-cpu-arguments-slope": 248,
|
||||
"encodeUtf8-memory-arguments-intercept": 0,
|
||||
"cekStartupCost-exBudgetCPU": 100,
|
||||
"multiplyInteger-memory-arguments-intercept": 0,
|
||||
"unListData-memory-arguments": 32,
|
||||
"remainderInteger-cpu-arguments-model-arguments-slope": 118,
|
||||
"cekVarCost-exBudgetCPU": 29773,
|
||||
"remainderInteger-memory-arguments-slope": 1,
|
||||
"cekForceCost-exBudgetCPU": 29773,
|
||||
"sha2_256-cpu-arguments-slope": 29175,
|
||||
"equalsInteger-memory-arguments": 1,
|
||||
"indexByteString-memory-arguments": 1,
|
||||
"addInteger-memory-arguments-intercept": 1,
|
||||
"chooseUnit-cpu-arguments": 150000,
|
||||
"sndPair-cpu-arguments": 150000,
|
||||
"cekLamCost-exBudgetCPU": 29773,
|
||||
"fstPair-cpu-arguments": 150000,
|
||||
"quotientInteger-memory-arguments-minimum": 1,
|
||||
"decodeUtf8-cpu-arguments-slope": 1000,
|
||||
"lessThanInteger-memory-arguments": 1,
|
||||
"lessThanEqualsInteger-cpu-arguments-slope": 1366,
|
||||
"fstPair-memory-arguments": 32,
|
||||
"modInteger-memory-arguments-intercept": 0,
|
||||
"unConstrData-cpu-arguments": 150000,
|
||||
"lessThanEqualsInteger-memory-arguments": 1,
|
||||
"chooseUnit-memory-arguments": 32,
|
||||
"sndPair-memory-arguments": 32,
|
||||
"addInteger-cpu-arguments-intercept": 197209,
|
||||
"decodeUtf8-memory-arguments-slope": 8,
|
||||
"equalsData-cpu-arguments-intercept": 150000,
|
||||
"mapData-cpu-arguments": 150000,
|
||||
"mkPairData-cpu-arguments": 150000,
|
||||
"quotientInteger-cpu-arguments-constant": 148000,
|
||||
"consByteString-memory-arguments-slope": 1,
|
||||
"cekVarCost-exBudgetMemory": 100,
|
||||
"indexByteString-cpu-arguments": 150000,
|
||||
"unListData-cpu-arguments": 150000,
|
||||
"equalsInteger-cpu-arguments-slope": 1326,
|
||||
"cekStartupCost-exBudgetMemory": 100,
|
||||
"subtractInteger-cpu-arguments-intercept": 197209,
|
||||
"divideInteger-cpu-arguments-model-arguments-intercept": 425507,
|
||||
"divideInteger-memory-arguments-intercept": 0,
|
||||
"cekForceCost-exBudgetMemory": 100,
|
||||
"blake2b-cpu-arguments-intercept": 2477736,
|
||||
"remainderInteger-cpu-arguments-constant": 148000,
|
||||
"tailList-cpu-arguments": 150000,
|
||||
"encodeUtf8-cpu-arguments-intercept": 150000,
|
||||
"equalsString-cpu-arguments-slope": 1000,
|
||||
"lessThanByteString-memory-arguments": 1,
|
||||
"multiplyInteger-cpu-arguments-slope": 11218,
|
||||
"appendByteString-cpu-arguments-intercept": 396231,
|
||||
"lessThanEqualsByteString-cpu-arguments-slope": 248,
|
||||
"modInteger-memory-arguments-slope": 1,
|
||||
"addInteger-cpu-arguments-slope": 0,
|
||||
"equalsData-cpu-arguments-slope": 10000,
|
||||
"decodeUtf8-memory-arguments-intercept": 0,
|
||||
"chooseList-cpu-arguments": 150000,
|
||||
"constrData-cpu-arguments": 150000,
|
||||
"equalsByteString-memory-arguments": 1,
|
||||
"cekApplyCost-exBudgetCPU": 29773,
|
||||
"quotientInteger-memory-arguments-slope": 1,
|
||||
"verifySignature-cpu-arguments-intercept": 3345831,
|
||||
"unMapData-memory-arguments": 32,
|
||||
"mkCons-memory-arguments": 32,
|
||||
"sliceByteString-memory-arguments-slope": 1,
|
||||
"sha3_256-memory-arguments": 4,
|
||||
"ifThenElse-memory-arguments": 1,
|
||||
"mkNilPairData-memory-arguments": 32,
|
||||
"equalsByteString-cpu-arguments-slope": 247,
|
||||
"appendString-cpu-arguments-intercept": 150000,
|
||||
"quotientInteger-cpu-arguments-model-arguments-slope": 118,
|
||||
"cekApplyCost-exBudgetMemory": 100,
|
||||
"equalsString-memory-arguments": 1,
|
||||
"multiplyInteger-memory-arguments-slope": 1,
|
||||
"cekBuiltinCost-exBudgetMemory": 100,
|
||||
"remainderInteger-memory-arguments-intercept": 0,
|
||||
"sha2_256-cpu-arguments-intercept": 2477736,
|
||||
"remainderInteger-cpu-arguments-model-arguments-intercept": 425507,
|
||||
"lessThanEqualsByteString-memory-arguments": 1,
|
||||
"tailList-memory-arguments": 32,
|
||||
"mkNilData-cpu-arguments": 150000,
|
||||
"chooseData-cpu-arguments": 150000,
|
||||
"unBData-memory-arguments": 32,
|
||||
"blake2b-memory-arguments": 4,
|
||||
"iData-memory-arguments": 32,
|
||||
"nullList-memory-arguments": 32,
|
||||
"cekDelayCost-exBudgetCPU": 29773,
|
||||
"subtractInteger-memory-arguments-intercept": 1,
|
||||
"lessThanByteString-cpu-arguments-intercept": 103599,
|
||||
"consByteString-cpu-arguments-slope": 1000,
|
||||
"appendByteString-memory-arguments-slope": 1,
|
||||
"trace-memory-arguments": 32,
|
||||
"divideInteger-cpu-arguments-constant": 148000,
|
||||
"cekConstCost-exBudgetCPU": 29773,
|
||||
"encodeUtf8-memory-arguments-slope": 8,
|
||||
"quotientInteger-cpu-arguments-model-arguments-intercept": 425507,
|
||||
"mapData-memory-arguments": 32,
|
||||
"appendString-cpu-arguments-slope": 1000,
|
||||
"modInteger-cpu-arguments-constant": 148000,
|
||||
"verifySignature-cpu-arguments-slope": 1,
|
||||
"unConstrData-memory-arguments": 32,
|
||||
"quotientInteger-memory-arguments-intercept": 0,
|
||||
"equalsByteString-cpu-arguments-constant": 150000,
|
||||
"sliceByteString-memory-arguments-intercept": 0,
|
||||
"mkPairData-memory-arguments": 32,
|
||||
"equalsByteString-cpu-arguments-intercept": 112536,
|
||||
"appendString-memory-arguments-slope": 1,
|
||||
"lessThanInteger-cpu-arguments-slope": 497,
|
||||
"modInteger-cpu-arguments-model-arguments-intercept": 425507,
|
||||
"modInteger-memory-arguments-minimum": 1,
|
||||
"sha3_256-cpu-arguments-intercept": 0,
|
||||
"verifySignature-memory-arguments": 1,
|
||||
"cekLamCost-exBudgetMemory": 100,
|
||||
"sliceByteString-cpu-arguments-intercept": 150000
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue