cardano-node icon indicating copy to clipboard operation
cardano-node copied to clipboard

[BUG] - mkfiles in babbage creates empty stake-delegator-keys

Open jonathangenlambda opened this issue 1 year ago • 7 comments

Internal/External External

Summary When running scripts/babbage/mkfiles.sh from release/8.1.x branch using cardano-cli from cardano-node-8.1.2 it generates files we use successfully to bootstrap a conway-era testnet. However no payment keys are generated in stake-delegator-keys, which was the case with earlier versions of this script/cli. Without these keys it is unclear how to be able to spend the initial ADA.

Steps to reproduce Steps to reproduce the behavior:

  1. switch to release/8.1.x branch
  2. download cardano-node-8.1.2 and put cardano-cli on path
  3. run sh scripts/babbage/mkfiles.sh from cardano-node root folder
  4. stake-delegator-keys is empty

Expected behavior It is expected that stake-delegator-keys contains the payment keys that allow to spend the initial ADA.

System info (please complete the following information):

  • OS Name: Ubuntu
  • OS Version 22.04
  • Node version cardano-node 8.1.2 - linux-x86_64 - ghc-8.10
  • CLI version cardano-cli 8.1.2 - linux-x86_64 - ghc-8.10

jonathangenlambda avatar Dec 21 '23 08:12 jonathangenlambda

@jonathangenlambda> could you try updating to a newer version of cardano-node and cardano-cli? The mkfiles.sh script has been modified since version 8.1.2.

smelc avatar Jan 02 '24 10:01 smelc

@smelc thanks for your reply.

I tried it with a newer version of cardano-nodeand cardano-cli, but was not successful:

  1. Switched to release/8.7 branch in cardano-node repo.
  2. Downloaded binaries from https://github.com/IntersectMBO/cardano-node/releases/tag/8.7.1-pre and put them on PATH. Note that I picked 8.7.1 because 8.7.2 https://github.com/IntersectMBO/cardano-node/releases/tag/8.7.2 doesnt have the binaries built in the release bundle (assets).
  3. Ran the mkfiles.sh script by executing ./scripts/babbage/mkfiles.sh ./shared/sockets/node-spo1.sock
  4. Unfortunately the stake-delegator-keys folder is still empty.

Running the mkfiles.sh script as described in 4. seems to be successful, producing the following output on console:

generated genesis with: 3 genesis keys, 3 non-delegating UTxO keys, 3 stake pools, 3 delegating UTxO keys, 3 delegation map entries, 
example/node-spo1.sh
example/node-spo2.sh
example/node-spo3.sh
CARDANO_NODE_SOCKET_PATH=example/node-spo1/node.sock 

When running cardano-cli --version which I put on path (2.) I get the following output:

cardano-cli 8.16.0.1 - linux-x86_64 - ghc-8.10
git rev 7f7a93d248b380d3dbff8c003a3ad66b6d1c770f

jonathangenlambda avatar Jan 02 '24 11:01 jonathangenlambda

@jonathangenlambda> you are witnessing that generation of payment keys in the stake-delegator-keys directory was removed from the create-staked command in https://github.com/IntersectMBO/cardano-node/pull/4021. Back in the day, this feature was removed because the benchmarking team asked us to do so (as it was making some of their tests too slow). The create-staked command is what scripts/babbage/mkfiles.sh uses under the hood (at line 109).

Since then, we have introduced a modernized variant of create-staked: create-testnet-data, that brings back the old behavior (this PR).

So one way forward for you be to have mkfiles.sh use create-testnet-data. However, the structure of the files generated by create-testnet-data is a bit different from create-staked, so it wouldn't be a simple renaming. Some of the mv done by mkfiles.sh after line 109 would have to be adapted.

smelc avatar Jan 03 '24 13:01 smelc

@smelc

Thanks for your extensive reply. I assume this PR is not merged yet into any release? I guess I have to build it myself? How do I do that? Via the cardano-cli repo?

Are there no other options to generate these files/keys? Essentially this means that this functionality has been broken for months.

jonathangenlambda avatar Jan 03 '24 15:01 jonathangenlambda

I assume this PR is not merged yet into any release? I guess I have to build it myself? How do I do that? Via the cardano-cli repo

@jonathangenlambda> We are actually about to release the latest version of create-testnet-data, this is in the making via PR https://github.com/IntersectMBO/cardano-cli/pull/542. So I would recommend that you wait for the release if you want to go the create-testnet-data way (beware that you would need to rework the mkfiles.sh script yourself if you choose this route).

Are there no other options to generate these files/keys?

You can generate those keys using a combination of cardano-cli address key-gen and cardano-cli stake-address key-gen, but then you also need to put into place the delegation. I believe using create-testnet-data would be easier.

It's actually on our roadmap to change a number of users of create-staked to use create-testnet-data instead, but we are busy with other things right now so I can't give you any estimate :shrug:

smelc avatar Jan 03 '24 16:01 smelc

@smelc thanks - I guess I'll wait in this case.

Don't you guys also fix mkfiles.sh when you release the PR?

jonathangenlambda avatar Jan 04 '24 11:01 jonathangenlambda

Don't you guys also fix mkfiles.sh when you release the PR?

@jonathangenlambda> nope it's not planned, since it's not necessary for our short term roadmap.

smelc avatar Jan 05 '24 09:01 smelc