Skip to content

Commit

Permalink
Merge pull request #5788 from IntersectMBO/andrea/genesis-create-test…
Browse files Browse the repository at this point in the history
…net-data

[workbench] add support for delegate representatives
  • Loading branch information
mgmeier committed May 7, 2024
2 parents ee89cd8 + b823154 commit 569c903
Show file tree
Hide file tree
Showing 9 changed files with 485 additions and 275 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ PROFILES_BASE := default default-p2p plutus plutus-secp-ecdsa plutus
PROFILES_FAST := fast fast-p2p fast-plutus fast-notracer fast-oldtracing faststartup-24M
PROFILES_CI_TEST := ci-test ci-test-p2p ci-test-plutus ci-test-notracer ci-test-rtview ci-test-dense10
PROFILES_CI_BENCH := ci-bench ci-bench-p2p ci-bench-plutus ci-bench-plutus-secp-ecdsa ci-bench-plutus-secp-schnorr ci-bench-notracer ci-bench-rtview ci-bench-lmdb
PROFILES_CI_BENCH_DREP := ci-bench-drep
PROFILES_TRACE_BENCH := trace-bench trace-bench-notracer trace-bench-oldtracing trace-bench-rtview
PROFILES_TRACE_FULL := trace-full trace-full-rtview
PROFILES_EPOCHTRANS := epoch-transition
Expand Down Expand Up @@ -108,6 +109,7 @@ LOCAL_PROFILES += $(PROFILES_BASE)
LOCAL_PROFILES += $(PROFILES_FAST)
LOCAL_PROFILES += $(PROFILES_CI_TEST)
LOCAL_PROFILES += $(PROFILES_CI_BENCH)
LOCAL_PROFILES += $(PROFILES_CI_BENCH_DREP)
LOCAL_PROFILES += $(PROFILES_TRACE_BENCH)
LOCAL_PROFILES += $(PROFILES_TRACE_FULL)
LOCAL_PROFILES += $(PROFILES_EPOCHTRANS)
Expand Down
23 changes: 19 additions & 4 deletions nix/workbench/genesis/genesis.jq
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,31 @@ def fmt_decimal_10_5($x):
def profile_cli_args($p):
{ common:
{ createStakedArgs:
([ "--supply", fmt_decimal_10_5($p.genesis.funds_balance)
([ "--testnet-magic", $p.genesis.network_magic
, "--supply", fmt_decimal_10_5($p.genesis.funds_balance)
, "--gen-utxo-keys", 1
, "--gen-genesis-keys", $p.composition.n_bft_hosts
, "--supply-delegated", fmt_decimal_10_5($p.derived.supply_delegated)
, "--gen-pools", $p.composition.n_pools
, "--gen-stake-delegs", $p.derived.delegators_effective
, "--num-stuffed-utxo", fmt_decimal_10_5($p.derived.utxo_stuffed)
, "--testnet-magic", $p.genesis.network_magic
] +
if $p.composition.dense_pool_density != 1
then
[ "--bulk-pool-cred-files", $p.composition.n_dense_hosts
, "--bulk-pools-per-file", $p.composition.dense_pool_density ]
else [] end)
, createTestnetDataArgs:
([ "--testnet-magic", $p.genesis.network_magic
, "--total-supply", fmt_decimal_10_5($p.genesis.funds_balance + $p.derived.supply_delegated)
, "--utxo-keys", 1
, "--genesis-keys", $p.composition.n_bft_hosts
, "--delegated-supply", fmt_decimal_10_5($p.derived.supply_delegated)
, "--pools", $p.composition.n_pools
, "--stake-delegators", $p.derived.delegators_effective
, "--drep-keys", $p.genesis.dreps
, "--stuffed-utxo", fmt_decimal_10_5($p.derived.utxo_stuffed)
])
, pools:
[ "--argjson"
, "initialPoolCoin", fmt_decimal_10_5($p.genesis.pool_coin)
Expand Down Expand Up @@ -54,6 +65,7 @@ def profile_genesis_cache_key($p; $profile_file):

, delegators
, utxo_stuffed
, dreps

} as $genesis_crypto_affecting_data

Expand All @@ -74,8 +86,11 @@ then [ "k\(.composition.n_pools)" ]
else
[ "d\(.composition.dense_pool_density)" ] end
+
[ "\(.genesis.delegators / 1000)kD"
, "\(.derived.utxo_stuffed / 1000)kU"
[ "\(.genesis.delegators / 1000)kD" ]
+
if .genesis.dreps != 0 then ["\(.genesis.dreps)Dr"] else [] end
+
[ "\(.derived.utxo_stuffed / 1000)kU"
, "\($params_hash)" ]
else [ "preset"
, $profile[0].preset ]
Expand Down

0 comments on commit 569c903

Please sign in to comment.