Test Details Overview

Apply config overrides as edits to the parsed document (#5195)

* Apply config overrides as edits to the parsed document

Overrides were rendered as TOML text and merged with the file by the
parser, which treated a repeated key differently depending on whether
the file existed: with a file present the first value was kept and the
rest silently ignored, without one the whole load failed with "Key
<name> already present at line N", naming a line in a document the
operator never wrote.

Each override is now parsed by itself and merged into the tree,
descending into tables and replacing values. Overrides take precedence
over the file, a key given more than once takes the value of the last
one, as is conventional for command line options, and a malformed
override is reported with its own text.

* Report a missing config file from the open attempt itself

The loader checked std::filesystem::exists before reading, a separate
step from the open that cannot tell a file that is absent from one
the node is not allowed to read.

nano::open_file opens a path for reading as nano::result<std::ifstream>
and carries the OS reason of a failed open as a std::error_code. The
loader treats std::errc::no_such_file_or_directory as "use the
defaults" and returns every other failure, so an unreadable config file
is an error instead of being silently ignored. tomlconfig::read (path)
is gone; the class parses streams only.

* Start from an empty document when the config file is missing

Reading a file replaces the document, but the missing-file path only
merged the overrides into whatever the passed document already held,
so a reused document kept keys from a previous read. Reset it first,
so the result holds only the overrides in both cases, as documented.

__________

Type: commit

Hash: 66adc77e7842ab6ca4cafb0b274fb4109acc37a3

Created: today

__________

gr0v1ty/nano-node:66adc77e7842ab6ca4cafb0b274fb4109acc37a3

Test Results

Test Case Status Duration Median Deviation Log Graph
5n4pr_conf_10k_bintree PASS 113 s -0.5 s - Show
5n4pr_conf_10k_change PASS 140 s -4.5 s - Show
5n4pr_conf_change_dependant PASS 122 s 8.0 s - -
5n4pr_conf_change_independant PASS 127 s 9.5 s - -
5n4pr_conf_send_dependant PASS 128 s 11.5 s - -
5n4pr_conf_send_independant PASS 109 s -6.0 s - -
5n4pr_rocks_10k_bintree FAIL 3 s -114.5 s Show -
5n4pr_rocks_10k_change PASS 238 s 72.0 s - -