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

Layered config support with config-rs #704

Open
mempirate opened this issue Jan 17, 2025 · 3 comments
Open

Layered config support with config-rs #704

mempirate opened this issue Jan 17, 2025 · 3 comments
Labels
C: bolt-sidecar Component: bolt-sidecar D-good-first-issue Difficulty: a great choice to get started! T: discussion Type: Discussion

Comments

@mempirate
Copy link
Contributor

https://github.com/rust-cli/config-rs

@mempirate mempirate added C: bolt-sidecar Component: bolt-sidecar D-good-first-issue Difficulty: a great choice to get started! T: discussion Type: Discussion labels Jan 17, 2025
@merklefruit
Copy link
Collaborator

I want to flag that we've had issues with config layers previously (see #308 and #316) because they added complexity when keeping configs up to date, especially when we have config files all over the place. Example:

  • bolt-sidecar/.env.example
  • testnets/holesky/.env.example
  • testnets/holesky/commit-boost/.env.example
  • testnets/holesky/presets/sidecar-delegations-preset.env.example

Touching a single variable requires updates in all these files + all the .gitignored ones we use in dev boxes or elsewhere.
Plus all external users of the sidecar for every release, paired with an upgrade guide explaining what we touched.

For the recent deployment, I spent a lot of time removing all minor inconsistencies between these files and thankfully I didn't have to adjust json, yaml or toml files as well just for the sidecar. This is why I don't think it's a good idea to introduce them now

Keen on hearing others' opinion!

@0ex-d
Copy link
Contributor

0ex-d commented Jan 21, 2025

A few suggestions:

  • I believe centralizing the config variables in the workspace root would be a good approach (a single config.toml and .env for redundancy).
  • For the testnets/holesky/* directory a symlink could resolve into other scopes (e.g bolt-sidecar) but it could add complexity across various systems (although we could fix this fs::canonicalize(config_path)? to nomalize).
    This would make it easier to manage configs and reduce duplication.

@merklefruit
Copy link
Collaborator

The problem with consolidating all these files is that there are small differences in the values provided in each, that's the reason they exist, for instance sidecar-delegations-preset contains the signing options to use a delegations.json file while others don't have them...

Very nice idea about the symlinks, I didn't think of that. For now I'd hold off on too many config changes though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: bolt-sidecar Component: bolt-sidecar D-good-first-issue Difficulty: a great choice to get started! T: discussion Type: Discussion
Projects
None yet
Development

No branches or pull requests

3 participants