backport #4268: feat(node): add /config/node API for merged runtime config#4316
backport #4268: feat(node): add /config/node API for merged runtime config#4316sveitser wants to merge 2 commits into
Conversation
* feat(node): add /config/node API for merged runtime config - New GET /config/node endpoint returns curated PublicNodeConfig (CLI flags + env vars + defaults) - Allowlist design: explicit fields, not Serialize on Options, so future fields cannot auto-leak - Exposes networking, peers, advertise addresses, libp2p/L1 tuning, identity, catchup, proposal fetcher, storage backend (fs/sql) with pruning + DB pool config, enabled API modules and HTTP ports - Excludes secrets: no private keys, no L1 RPC URLs (only counts), no DB connection string; tests assert no leaks - Snapshot test (insta) documents the JSON shape end-to-end without spinning up the sequencer * fix(node): populate fs storage defaults and fix dev-node call site - StorageConfig::FsDefault now exposes default fs values when env vars allow construction (try_parse_from), giving operators visibility into the path/retention used at runtime - Gate PublicNodeConfig::for_test behind cfg(test, feature="testing") so dev-node binary can construct one - Fix dev-node main.rs call to .config(...) for the new signature * refactor(node): rename /config/node to /config/runtime and split builder - Rename route to /config/runtime; reads better than /config/node - Split api::Options::config(opt, node_config) back into two builders: config(opt) and public_node_config(c). Tests and dev binaries no longer need to plumb a placeholder PublicNodeConfig through every call site; the /config/runtime route returns 404 if unset - Remove now-unused PublicNodeConfig::for_test helper * cargo fmt * fix(node): make /config/runtime tests pass under embedded-db - Gate config_node_response_snapshot and public_node_config_includes_pruning to postgres only; under embedded-db, storage-sql requires --path which isn't relevant to what these tests assert - Rename existing snapshot to config_node_response_postgres - Add new bootstrap_epoch_catchup_timeout field to PublicNodeConfig (introduced upstream during merge) - Adjust libp2p_advertise_address to Option<String> to match upstream * fix(node): box PublicNodeConfig in api::Options Stack overflow in api::test::test_state_reconstruction::case_2: the api::Options struct grew large enough that nested chained builders exceeded the default 2MB test stack. Wrapping public_node_config in a Box keeps the Options size bounded. * chore: add config module bool (cherry picked from commit 3be89c6)
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
|
Unable to build without Cargo.lock file. This means that after this change 3rd party projects may have For the first failing build see: https://github.com/EspressoSystems/espresso-network/actions/runs/26030174730 To reproduce locally run This PR can still be merged. |
- Remove cliquenet_advertise_address and bootstrap_epoch_catchup_timeout from PublicNodeConfig (fields not present on this release branch) - Remove axum_port, tonic_port from HttpConfig - Remove light_client, light_client_db from QueryConfig - Update tests and snapshot to match
Backport of #4268, automated backport failed.