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
Fee size is based on operation size, which may change when the fee is set (depending on how the fee is serialized, in particular, whether either the share_type or asset_id_type is serialized as a variable length integer).
In other words, after set_fee assigns the fee to the fee field, the result is (in some sense) a different operation which might have a different fee (i.e., calling calculate_fee() on the newly produced operation may have a different result from calling calculate_fee() on the original, zero-fee operation).
Currently this is completely ignored, resulting in the possibility that some transactions might have set_fee calculate a slightly incorrect fee -- resulting in breaking its contract of computing the minimal fee that the chain will accept. If the fee is too high it is not bad, but in the main real-world case, the fee will be being set from zero, which is much more likely to result in an expansion of the operation's serialized form than a contraction. Net result: an operation that will not validate due to insufficient fees even after setting the fee to the result of calculate_fee(), calling set_fee() on your operation, or using the get_required_fees() API call.
The text was updated successfully, but these errors were encountered:
Fee size is based on operation size, which may change when the fee is set (depending on how the fee is serialized, in particular, whether either the
share_type
orasset_id_type
is serialized as a variable length integer).In other words, after
set_fee
assigns the fee to thefee
field, the result is (in some sense) a different operation which might have a different fee (i.e., callingcalculate_fee()
on the newly produced operation may have a different result from callingcalculate_fee()
on the original, zero-fee operation).Currently this is completely ignored, resulting in the possibility that some transactions might have
set_fee
calculate a slightly incorrect fee -- resulting in breaking its contract of computing the minimal fee that the chain will accept. If the fee is too high it is not bad, but in the main real-world case, the fee will be being set from zero, which is much more likely to result in an expansion of the operation's serialized form than a contraction. Net result: an operation that will not validate due to insufficient fees even after setting the fee to the result ofcalculate_fee()
, callingset_fee()
on your operation, or using theget_required_fees()
API call.The text was updated successfully, but these errors were encountered: