Skip to content

backport #4268: feat(node): add /config/node API for merged runtime config#4316

Open
sveitser wants to merge 2 commits into
release-mainnet-1.1.0-rcfrom
backport-4268-to-release-mainnet-1.1.0-rc
Open

backport #4268: feat(node): add /config/node API for merged runtime config#4316
sveitser wants to merge 2 commits into
release-mainnet-1.1.0-rcfrom
backport-4268-to-release-mainnet-1.1.0-rc

Conversation

@sveitser
Copy link
Copy Markdown
Collaborator

Backport of #4268, automated backport failed.

* 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)
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

@github-actions
Copy link
Copy Markdown
Contributor

Unable to build without Cargo.lock file.

This means that after this change 3rd party projects may have
difficulties using crates in this repo as a dependency. If this
isn't easy to fix please open an issue so we can fix it later.

For the first failing build see: https://github.com/EspressoSystems/espresso-network/actions/runs/26030174730

To reproduce locally run

cargo generate-lockfile
cargo check --all-targets

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant