Fee MoneyRange checks only apply to policyAsset#1476
Fee MoneyRange checks only apply to policyAsset#1476tomt1664 wants to merge 4 commits intoElementsProject:masterfrom
Conversation
|
I would just like to note here that a zero fee raw tx worked for me fine on the unofficial liquidtestnet4 already some time ago. Not tested with any other assets back then. See https://kitchen.anyone.eu.org/lt4/zero.txt - the tx is present in current lt4 blockchain. Confidential. No fee (Liquid "fee" structure empty). |
A transaction can have a zero fee if there is no fee output (e.g. this lt4 tx) - that is consensus valid. But it cannot include an explicit fee output that has zero value (gets checked here: elements/src/confidential_validation.cpp Line 33 in b379bb2 |
|
I've updated #1333 so the wallet does not add a fee output if the fee is zero - this is valid in current consensus rules. The PR - enabling any fee value - is relevant to using issued assets as fees. I'll leave it open in draft - it is unlikely to be useful before issuance beyond |
4c25924 to
15d09d0
Compare
delta1
left a comment
There was a problem hiding this comment.
I think this probably needs to be tested in a functional test
| if(fee < 0) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
Is this to check for overflow?
| if(fee < 0) { | |
| return false; | |
| } | |
| if (fee < 0) { | |
| return false; | |
| } |
There was a problem hiding this comment.
Actually was from a previous version. I have updated it now so that for policyAsset the check is MoneyRange, but if not policy asset check that fee < 0.
Apply
HasValidFeeand feeMoneyRangechecks only to thepolicyAsset. This will enable issued asset fee amounts (in individual outputs, total in transaction and total in a block) greater than MAX_MONEYThis is a consensus change and technically a hardfork, but can be added safely to a release and deployed as any issued asset fee paying transactions are currently prevented from being confirmed by policy rules.
Extension of #1333HasValidFee (called from CheckInputs) is a consensus check for each tx that1) any fee output does not exceed MAX_MONEY2) any fee output is not 0 value3) the total fees for a tx do not exceed MAX_MONEYAnother check inCheckInputschecks that the total fees for a block do not exceed MAX_MONEYTo enable both zero fee outputs and for total block and tx fee outputs (and total fee outputs) to exceed MAX_MONEY (fee outputs can be issued assets in addition to pegged asset, which total supply can exceed MAX_MONEY) and new chain config option is added:-con_allow_any_fee