Skip to content

Commit

Permalink
Use a fake version value for the deposit data file to work around a L…
Browse files Browse the repository at this point in the history
…aunchpad issue (#217)
  • Loading branch information
remyroy authored Nov 2, 2024
1 parent 762ed7a commit 58f2424
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/src/deposit_data_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Each deposit from the list will contain this structure:
- **deposit_data_root**: The deposit data root value to be passed to the deposit function call.
- **fork_version**: The fork version of the network that this deposit file was created for.
- **network_name**: The network name of the network that this deposit file was created for.
- **deposit_cli_version**: The tool version used to create this file.
- **deposit_cli_version**: The tool version used to create this file. We are currently faking this value to work around [an issue](https://github.com/eth-educators/ethstaker-deposit-cli/issues/216) with the Launchpad.

## Example
```JSON
Expand Down
4 changes: 2 additions & 2 deletions ethstaker_deposit/cli/partial_deposit.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from ethstaker_deposit.key_handling.keystore import Keystore
from ethstaker_deposit.settings import (
DEPOSIT_CLI_VERSION,
fake_cli_version,
MAINNET,
ALL_CHAIN_KEYS,
get_chain_setting,
Expand Down Expand Up @@ -177,7 +177,7 @@ def partial_deposit(
deposit_data.update({'deposit_data_root': signed_deposit.hash_tree_root})
deposit_data.update({'fork_version': chain_setting.GENESIS_FORK_VERSION})
deposit_data.update({'network_name': chain_setting.NETWORK_NAME})
deposit_data.update({'deposit_cli_version': DEPOSIT_CLI_VERSION})
deposit_data.update({'deposit_cli_version': fake_cli_version})
saved_folder = export_deposit_data_json(folder, time.time(), [deposit_data])

click.echo(load_text(['msg_verify_partial_deposit']))
Expand Down
8 changes: 6 additions & 2 deletions ethstaker_deposit/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
Pbkdf2Keystore,
ScryptKeystore,
)
from ethstaker_deposit.settings import DEPOSIT_CLI_VERSION, BaseChainSetting
from ethstaker_deposit.settings import (
fake_cli_version,
DEPOSIT_CLI_VERSION,
BaseChainSetting,
)
from ethstaker_deposit.utils.constants import (
BLS_WITHDRAWAL_PREFIX,
EXECUTION_ADDRESS_WITHDRAWAL_PREFIX,
Expand Down Expand Up @@ -152,7 +156,7 @@ def deposit_datum_dict(self) -> Dict[str, bytes]:
datum_dict.update({'deposit_data_root': signed_deposit_datum.hash_tree_root})
datum_dict.update({'fork_version': self.chain_setting.GENESIS_FORK_VERSION})
datum_dict.update({'network_name': self.chain_setting.NETWORK_NAME})
datum_dict.update({'deposit_cli_version': DEPOSIT_CLI_VERSION})
datum_dict.update({'deposit_cli_version': fake_cli_version})
return datum_dict

def signing_keystore(self, password: str) -> Keystore:
Expand Down
6 changes: 6 additions & 0 deletions ethstaker_deposit/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@

DEPOSIT_CLI_VERSION = __version__

# We are faking the deposit_cli_version to pass the current Launchpad version test
# See https://github.com/eth-educators/ethstaker-deposit-cli/issues/216
version_elements = DEPOSIT_CLI_VERSION.split('.')
version_elements[0] = str(int(version_elements[0]) + 10)
fake_cli_version = '.'.join(version_elements)


class BaseChainSetting(NamedTuple):
NETWORK_NAME: str
Expand Down

0 comments on commit 58f2424

Please sign in to comment.