Benchmark command fail due to json deserialize error #6306
Labels
I2-bug
The node fails to follow expected behavior.
I10-unconfirmed
Issue might be valid, but it's not yet known.
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Description of bug
The benchmark command now requires the
genesis-builder-preset
arg to get JSON-encodedRuntimeGenesisConfig
from the runtime but this value is not used directly, instead it is used to patch the default value ofRuntimeGenesisConfig
and the result is used:polkadot-sdk/substrate/client/chain-spec/src/genesis_config_builder.rs
Lines 153 to 155 in 01936b3
within
json_patch::merge
if the value isnull
the whole kv pair will be removed from the JSON:polkadot-sdk/substrate/client/chain-spec/src/json_patch.rs
Lines 36 to 38 in 01936b3
this causes issue for enum that contains
Option
value:Test::V(None)
will be serialized to{v: null}
, afterjson_patch::merge
it became{ }
and is impossible to deserialize back to the same valueSteps to reproduce
Add this unit test to
substrate/client/chain-spec/src/json_patch.rs
and it will fail due to deserializeThe text was updated successfully, but these errors were encountered: