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

fix(configs): fill in missing values in ExperimentalConfig with defaults #10472

Merged
merged 3 commits into from
Jan 23, 2024

Commits on Jan 19, 2024

  1. fix(configs): fill in missing values in ExperimentalConfig with defaults

    the command `neard --home {home_dir} init --chain-id mainnet --download-config`
    downloads the config at
    https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/mainnet/config.json
    and then saves a config file built from that one to
    {home_dir}/config.json. This is expected to work even when particular
    fields are missing by filling them in with defaults, which is why many
    config fields are marked with some sort of #[serde(default)] or
    doesn't fill in these defaults. The existing #[serde(default)] over
    that field in `near_network::config_json::Config` will have us fill it
    in if it's totally missing, but we get an error if it's present with
    some fields missing, which is the case today:
    
    Error: Failed to initialize configs
    
    Caused by:
        config.json file issue: Failed to deserialize config from /tmp/n/config.json: Error("missing field `network_config_overrides`", line: 98, column: 5)
    
    Fix it by adding a #[serde(default)] to the ExperimentalConfig struct
    itself, which is how, for example, the fact that the `archive` field
    is missing in the above config url is not a problem, because
    `nearcore::config::Config` is marked with this attribute.
    marcelo-gonzalez committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    13ba877 View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2024

  1. Configuration menu
    Copy the full SHA
    9d6d34f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3edae63 View commit details
    Browse the repository at this point in the history