You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the Bug
A recent system upgrade encountered an issue where an emissions parameter was not set, leading to a halt of the binary. To prevent such occurrences, it is proposed that all parameters expected by the Chain should have default values unless explicitly set or overridden. This approach would ensure that the addition of new parameters does not cause a system panic due to missing state information, by instantiating a default value when the parameter is not present in the state. However, if the parameter is explicitly set, the system should utilize the specified value.
To Reproduce
Conduct a system upgrade without setting a new emissions parameter that is expected to have a value. Thus, when the binary starts and tries to load the parameter from state it errors on json parsing because it expected a json key to exist where it didn't.
Observe the resulting binary halt due to the absence of this parameter.
Expected Behavior
The system should automatically assign a default value to any new parameter that is not explicitly set in the state during an upgrade. This action would prevent the system from halting and ensure smooth operation, even when new parameters are introduced.
gzukel
changed the title
Fix: Defaults for onChain Parameters to prevent halt on not set.
Fix: Defaults for onChain Parameters to Prevent Halt on Not Set Values Expected to Exist
Mar 8, 2024
FYI We already defined default parameters. The issue is the param module that panic when reading a key for a value that has not been previously set. Preventing the panic prevents the chain halt: #1864
Describe the Bug
A recent system upgrade encountered an issue where an emissions parameter was not set, leading to a halt of the binary. To prevent such occurrences, it is proposed that all parameters expected by the Chain should have default values unless explicitly set or overridden. This approach would ensure that the addition of new parameters does not cause a system panic due to missing state information, by instantiating a default value when the parameter is not present in the state. However, if the parameter is explicitly set, the system should utilize the specified value.
To Reproduce
Expected Behavior
The system should automatically assign a default value to any new parameter that is not explicitly set in the state during an upgrade. This action would prevent the system from halting and ensure smooth operation, even when new parameters are introduced.
Screenshots/Logs
Environment (please complete the following information):
ALL
The text was updated successfully, but these errors were encountered: