Remove default value from the optional new_fee_rate
member in samet_fund_update_operation
#2523
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If the type of a member variable is Optional, setting a non-standard default value will cause serialization / deserialization problems.
Follow-up of #2469.
To reproduce:
Or (broadcast a signed transaction without explicit
"new_fee_rate":null
in the JSON)Actually, if broadcast the transaction to an API node with explicit
"new_fee_rate":null
in the JSON, the API node will accept the transaction, but the transaction will get rejected when being propagated to other nodes. If the API node is a block producer and the transaction is included in a block, the block will be rejected by other nodes because it can not pass Merkle tree validation.The underlying issue is in FC. When unpacking (deserializing) an optional object, if the target variable is valid already, it will not get emptied / reset / overwritten. Related code: https://github.com/bitshares/bitshares-fc/blob/c72d5d31cc239a1a381cb3543402c9e2f4cc3f7f/include/fc/io/raw.hpp#L266-L273
Not sure if it's worth fixing. Usually we don't pass in a valid optional object when unpacking, although this time we did it.