Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
indexer-alt: detect and warn against unrecognised fields.
## Description Add an extra flattened generic, `toml::Table` to every file-based config struct to pick up any flags that were not recognised by the indexer. Extra fields will be logged as a warning and then ignored when processing flags, so that we are aware of potential typos, but will not cause an error to preserve some form of backwards compatibility (e.g. imagine a new pipeline is added to the indexer, and we update its TOML and try and run an old version of the indexer with the config that mentions the new pipeline). ## Test plan Try merging together some configs that contain typos in them: STDERR: ``` 2024-11-27T00:29:37.177152Z WARN sui_indexer_alt::config: Found unrecognized committer field which will be ignored by this indexer. This could be because of a typo, or because it was introduced in a newer version of the indexer: collect-interval-secs = 1000 2024-11-27T00:29:37.177242Z WARN sui_indexer_alt::config: Found unrecognized pipeline field which will be ignored by this indexer. This could be because of a typo, or because it was introduced in a newer version of the indexer: [tx-affected-objects] collect-interval-ms = 5000 2024-11-27T00:29:37.177328Z WARN sui_indexer_alt::config: Found unrecognized consistency field which will be ignored by this indexer. This could be because of a typo, or because it was introduced in a newer version of the indexer: consistency-range = 1000 ``` STDOUT: ``` [ingestion] [consistency] [committer] [pruner] [pipeline.sum_obj_types] [pipeline.kv_objects] [pipeline.kv_transactions] [pipeline.tx_calls] ```
- Loading branch information