-
Notifications
You must be signed in to change notification settings - Fork 394
Fee MoneyRange checks only apply to policyAsset #1476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fee MoneyRange checks only apply to policyAsset #1476
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this probably needs to be tested in a functional test
if(fee < 0) { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this to check for overflow?
if(fee < 0) { | |
return false; | |
} | |
if (fee < 0) { | |
return false; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
HasValidFee
and feeMoneyRange
checks 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 inCheckInputs
checks 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