Skip to content

[suggestion] Separate "user" config from "resolved" config #3500

@0x009922

Description

@0x009922

Feature request

It is already done with Configuration (i.e. resolved) and ConfigurationProxy (i.e. user) structs. The problem is that they are coupled to each other too tight, and there is not much semantic separation. Meanwhile, Iroha does have a semantic of parsing "raw" configuration and validating it.

Resolved config should have different fields. For example, user config might have public_key and private_key fields, while the resolved configuration will only have a single key_pair. It might be worth to define two separate structures (user and resolved configs) if there is a large difference between fields.

I propose to change naming as well, to reflect the purpose clearer: UserConfig instead of ConfigurationProxy, and ResolvedConfig instead of Configuration. Or something like that.

Additionally, it will be helpful to print the resolved configuration (with sensitive data being sanitised) to DEBUG/TRACE level.

Motivation

The transformation from "user" to "resolved" is the great place for validation, deprecation warnings, default fallbacks, and any other custom logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or requestconfig-changesChanges in configuration and start up of the Irohairoha2-devThe re-implementation of a BFT hyperledger in RUST

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions