Unify configuration Units#714
Conversation
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR standardizes user-facing configuration units by switching several CLI/env inputs from Gwei/Wei integers to ETH/GNO decimal amounts, while still storing/using Gwei/Wei internally where required.
Changes:
- Introduces a Click
ParamTypeto accept decimal ETH/GNO amounts and convert them toGweifor internal use. - Updates multiple commands/options to use
--min-deposit-amount,--vault-min-balance, and--max-validator-balance(ETH/GNO-facing) instead of*-gweioptions. - Changes
FEE_SPLITTER_MIN_ASSETSto be configured as an ETH/GNO decimal string (converted to Wei in settings) and updates.env.exampleaccordingly.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/config/settings.py |
Adds ETH-denominated defaults and changes FEE_SPLITTER_MIN_ASSETS parsing to interpret env input as ETH/GNO. |
src/config/networks.py |
Adds an ETH/GNO-denominated MAX_VALIDATOR_BALANCE convenience property. |
src/common/validators.py |
Adds EthAmountParamType and updates validators for renamed ETH-facing CLI options. |
src/commands/start/remote_signer.py |
Renames parameters to accept Gwei produced from ETH/GNO inputs and passes through to settings. |
src/commands/start/relayer.py |
Same as above for relayer mode. |
src/commands/start/local.py |
Same as above for local mode. |
src/commands/start/hashi_vault.py |
Same as above for Hashi Vault mode. |
src/commands/start/common_option.py |
Updates shared Click options to accept ETH/GNO amounts via ETH_AMOUNT_TYPE and renames flags/env vars. |
src/commands/process_meta_vaults.py |
Updates meta-vault processing command to accept ETH-denominated min deposit amount and pass Gwei internally. |
src/commands/node_manager_start.py |
Updates node-manager command to accept ETH-denominated max validator balance. |
src/commands/consolidate.py |
Updates consolidate command to accept ETH-denominated max validator balance. |
pyproject.toml |
Updates ignore list to accommodate Click ParamType.convert naming. |
.env.example |
Updates examples/comments for new ETH/GNO-facing env values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Minimum amount of rewards (in ETH/GNO) required to process the reward splitter. | ||
| FEE_SPLITTER_MIN_ASSETS: Wei = Web3.to_wei( | ||
| decouple_config('FEE_SPLITTER_MIN_ASSETS', default='0.001'), | ||
| 'ether', | ||
| ) |
There was a problem hiding this comment.
FEE_SPLITTER_MIN_ASSETS keeps the same env var name as before, but the expected unit has changed from wei (int) to ETH/GNO (decimal string). Existing deployments that still set FEE_SPLITTER_MIN_ASSETS to a wei value (per the previous .env.example) will now be interpreted as ETH, effectively disabling fee splitter processing. Consider either (a) renaming the env var to make the unit explicit, or (b) supporting both formats (e.g., detect large integers and treat them as wei) with a clear deprecation path.
Signed-off-by: cyc60 <avsysoev60@gmail.com>
Signed-off-by: cyc60 <avsysoev60@gmail.com>
No description provided.