mev-boost-relay
mev-boost-relay copied to clipboard
feat: have all config/consts together, and print on startup
- all config/consts should be together
- in particular which can be set through env vars
- the config should be printed on startup
I've been working on a prototype to address the requirements describe above. I tried to keep it as simple as possible with the premise of not introducing any backward incompatibility.
The implementation uses Viper to configure the app either by environment variables or command flags.
What is missing?
- Define the output format of the config to be printed during startup. Right now is something like this:
INFO[2022-10-18T14:24:14-03:00] Config: map[ACTIVE_VALIDATOR_HOURS:3 ALLOW_SYNCING_BEACON_NODE: BEACON_URIS: BLOCKSIM_MAX_CONCURRENT:4 BLOCKSIM_URI:http://localhost:8545 DB_DONT_APPLY_SCHEMA: DB_TABLE_PREFIX:dev DEBUG_API:false DISABLE_BID_MEMORY_CACHE:false DISABLE_BLOCK_PUBLISHING:false DISABLE_LOWPRIO_BUILDERS:false ENABLE_INTERNAL_API:false FORCE_GET_HEADER_204:false GETPAYLOAD_RETRY_TIMEOUT_MS:100 LINK_BEACONCHAIN:https://beaconcha.in LINK_ETHERSCAN:https://etherscan.io LISTEN_ADDR:localhost:9060 LOG_JSON:false LOG_LEVEL:info LOG_TAG: LOG_VERSION:false NETWORK:goerli NUM_ACTIVE_VALIDATOR_PROCESSORS:10 NUM_VALIDATOR_REG_PROCESSORS:10 POSTGRES_DSN: PPROF:false PRINT_SCHEMA:false PUBKEY_OVERRIDE: REDIS_URI:localhost:6379 RELAY_URL: SECRET_KEY: SHOW_CONFIG_DETAILS:false] service=relay/api
- Write tests to validate the behavior
- Website & API share the same
LISTEN_ADDRenvironment variable - Sensitive data should be masked or skipped when printing the configuration
Other than the missing points, the code is working and can be found at https://github.com/flashbots/mev-boost-relay/compare/main...franciscodiazydiaz:mev-boost-relay:env-config?expand=1
Wow, very cool! Please open a PR 🙏