ChorusOne / eth-staking-smith

Ethereum 2.0 deposit CLI / library
Apache License 2.0
21 stars 7 forks source link

Incorrect deposit_cli version generates invalid deposit data #42

Closed ank-everstake closed 2 months ago

ank-everstake commented 3 months ago

I generated deposit_data.json using eth-staking-smith from master branch with a newly generated mnemonic. The data was successfully created and displayed on the screen:

[
  {
    "amount": 32000000000,
    "deposit_cli_version": "2.3.0",
    "deposit_data_root": "2599953ec1fb9b9b1587960bc0100f1eddc648a07b459cb02b0c63bbd4518f24",
    "deposit_message_root": "e57d682ff895155f6e15b2475d971f10c3cbe073243628ef255b3d75571ddfb1",
    "fork_version": "01017000",
    "network_name": "holesky",
    "pubkey": "a33fe2120097d4e1cf461fed5953bd51c935b4f114c3f66a92743dd28ebab706d2c1d475c20b6dab62a399b0ca3b786b",
    "signature": "b5cdaba851355116e630ac2e71a4294d86ef6f864d93b2b4305d2348598a4f42343da506df784a62cc0119af6f4657680928efae9d7423424e2f12e3b3dfc1d41f9abb512a3c534b47a6e5ea9992207d7ff216617698a6c347f94f51048bed77",
    "withdrawal_credentials": "0100000000000000000000003a1933a872f82459eab4fd39fbc6605364104a4c"
  }
]

However, when I saved this data to a file and attempted to load it into the holesky launchpad, I encountered an error.

Upon further inspection, I found that the signature is valid only for deposit_cli version 2.7.X:

[
  {
    "amount": 32000000000,
    "deposit_cli_version": "2.7.0",
    "deposit_data_root": "2599953ec1fb9b9b1587960bc0100f1eddc648a07b459cb02b0c63bbd4518f24",
    "deposit_message_root": "e57d682ff895155f6e15b2475d971f10c3cbe073243628ef255b3d75571ddfb1",
    "fork_version": "01017000",
    "network_name": "holesky",
    "pubkey": "a33fe2120097d4e1cf461fed5953bd51c935b4f114c3f66a92743dd28ebab706d2c1d475c20b6dab62a399b0ca3b786b",
    "signature": "b5cdaba851355116e630ac2e71a4294d86ef6f864d93b2b4305d2348598a4f42343da506df784a62cc0119af6f4657680928efae9d7423424e2f12e3b3dfc1d41f9abb512a3c534b47a6e5ea9992207d7ff216617698a6c347f94f51048bed77",
    "withdrawal_credentials": "0100000000000000000000003a1933a872f82459eab4fd39fbc6605364104a4c"
  }
]

To resolve this issue, ensure that the deposit data includes proper deposit_cli version Also, I believe you need to update e2e tests - bump it to 2.7.0.

mksh commented 3 months ago

Thanks for the report, it should be easy doable via new CLI argument --deposit-cli-version

sryps commented 2 months ago

@mksh when will this --deposit-cli-version be implemented?

mksh commented 2 months ago

This was solved in PR https://github.com/ChorusOne/eth-staking-smith/pull/51 and available in release https://github.com/ChorusOne/eth-staking-smith/releases/tag/v20240808.0