Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - CLI: genesis create-staked no longer creates stake delegator keys #5286

Closed
johnalotoski opened this issue May 30, 2023 · 2 comments
Closed

Comments

@johnalotoski
Copy link
Contributor

johnalotoski commented May 30, 2023

Internal/External
Internal

Area
Other

Summary

  • cardano-cli 8.0.0 genesis create-staked no longer creates stake delegator keys

Steps to reproduce

  • Execute the same command with 1.35.7 and 8.0.0 and see that files are missing
nix shell "github:input-output-hk/cardano-node?ref=tags/$NODE_VERSION#cardano-cli"
IOHK_NIX=$(nix eval --raw --impure --expr '(builtins.getFlake github:input-output-hk/iohk-nix).outPath')

NODE_VERSION="<NODE_VERSION>"
export TEMPLATE_DIR="$IOHK_NIX/cardano-lib/testnet-template"
export GENESIS_DIR="$(pwd)/keys-staked-$NODE_VERSION"

mkdir -p "$GENESIS_DIR"
cp "$TEMPLATE_DIR/alonzo.json" "$GENESIS_DIR/genesis.alonzo.spec.json"
cp "$TEMPLATE_DIR/conway.json" "$GENESIS_DIR/genesis.conway.spec.json"
cp scripts/genesis.spec.json "$GENESIS_DIR/"

cardano-cli genesis create-staked \
  --genesis-dir "$GENESIS_DIR" \
  --gen-genesis-keys 1 \
  --supply 29730000000000000 \
  --supply-delegated 270000000000000 \
  --gen-pools 3 \
  --gen-stake-delegs 3 \
  --gen-utxo-keys 1 \
  --testnet-magic 42 \
  2>&1 \
  | sed 's/,/,\n/g' \
  > create-staked-$NODE_VERSION.out

# Compare the output from running the commands on both 1.35.7 and 8.0.0.
# Delegation relationships and addresses appear to be missing from the output in 8.0.0:

❯ diff -W 90 -y create-staked-1.35.7.out create-staked-8.0.0.out
generated genesis with: 1 genesis keys,         generated genesis with: 1 genesis keys,
 1 non-delegating UTxO keys,                     1 non-delegating UTxO keys,
 3 stake pools,                                  3 stake pools,
 3 delegating UTxO keys,                         3 delegating UTxO keys,
 3 delegation relationships,                <
 3 delegation map entries,                       3 delegation map entries,
 3 delegating addresses                     |

# Compare the file tree generated by running the commands on both 1.35.7 and 8.0.0.
# Stake-delegator-keys are seen to be missing in 8.0.0.
❯ diff -rq keys-staked-1.35.7 keys-staked-8.0.0 | grep Only
Only in keys-staked-8.0.0: genesis.conway.json
Only in keys-staked-1.35.7/stake-delegator-keys: payment1.skey
Only in keys-staked-1.35.7/stake-delegator-keys: payment1.vkey
Only in keys-staked-1.35.7/stake-delegator-keys: payment2.skey
Only in keys-staked-1.35.7/stake-delegator-keys: payment2.vkey
Only in keys-staked-1.35.7/stake-delegator-keys: payment3.skey
Only in keys-staked-1.35.7/stake-delegator-keys: payment3.vkey
Only in keys-staked-1.35.7/stake-delegator-keys: staking1.skey
Only in keys-staked-1.35.7/stake-delegator-keys: staking1.vkey
Only in keys-staked-1.35.7/stake-delegator-keys: staking2.skey
Only in keys-staked-1.35.7/stake-delegator-keys: staking2.vkey
Only in keys-staked-1.35.7/stake-delegator-keys: staking3.skey
Only in keys-staked-1.35.7/stake-delegator-keys: staking3.vkey

Expected behavior

  • Same behavior unless there is a breaking change notice I missed.

System info (please complete the following information):

  • OS Name: NixOS
  • OS Version: 22.11
  • CLI version (output of cardano-cli --version)
  • 1.35.7:
cardano-cli 1.35.7 - linux-x86_64 - ghc-8.10
git rev f0b4ac897dcbefba9fa0d247b204a24543cf55f6
  • 8.0.0:
cardano-cli 8.0.0 - linux-x86_64 - ghc-8.10
git rev 69a117b7be3db0f4ce6d9fc5cd4c16a2a409dcb8
@johnalotoski johnalotoski added the type: bug Something is not working label May 30, 2023
@johnalotoski johnalotoski changed the title CLI: genesis create-staked no longer creates stake delegator keys [BUG] - CLI: genesis create-staked no longer creates stake delegator keys May 30, 2023
@CarlosLopezDeLara
Copy link
Contributor

Bug confirmed

cardano-cli 8.0.0 - linux-x86_64 - ghc-8.10 git rev 69a117b7be3db0f4ce6d9fc5cd4c16a2a409dcb8 fails to create as many payment key pair and stake key pair specified under --gen-stake-delegs

cardano-cli 1.35.7 - linux-x86_64 - ghc-8.10
git rev f0b4ac8
works correctly.

@CarlosLopezDeLara CarlosLopezDeLara removed the type: bug Something is not working label Jun 1, 2023
@CarlosLopezDeLara
Copy link
Contributor

Ok, it is not a bug. create-staked is heavily used by Benchmarking team. They create a millions keys during benchmark runs; writing that many keys down to disk was costly.

Please see: #3938 and #4021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants