-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
XRPFees
: Fee setting and handling improvements
#4247
Merged
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1365039
Convert fee voting and protocol messages to use XRPAmounts
ximinez 7ff7706
Improve handling of 0 drop reference fee with TxQ
ximinez 8d15137
[FOLD] Review feedback from Nik:
ximinez ebe3a1c
[FOLD, maybe] Rename the new SFields from *XRP to *Drops
ximinez fdff84d
[FOLD] Reserve SField IDs for Hooks, renumber fee fields
ximinez d35906c
Merge remote-tracking branch 'upstream/develop' into feesettings
ximinez 8178341
Merge remote-tracking branch 'upstream/develop' into feesettings
ximinez cbfce9a
Merge remote-tracking branch 'upstream/develop' into feesettings
ximinez b2ab073
Review feedback from @drlongle:
ximinez c76b700
Review feedback from @thejohnfreeman:
ximinez e7a9e66
fixup! Review feedback from @thejohnfreeman:
ximinez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,12 +93,16 @@ Change::preclaim(PreclaimContext const& ctx) | |
case ttFEE: | ||
if (ctx.view.rules().enabled(featureXRPFees)) | ||
{ | ||
// The ttFEE transaction format defines these fields as | ||
// optional, but once the XRPFees feature is enabled, they are | ||
// forbidden. | ||
if (!ctx.tx.isFieldPresent(sfBaseFeeDrops) || | ||
!ctx.tx.isFieldPresent(sfReserveBaseDrops) || | ||
!ctx.tx.isFieldPresent(sfReserveIncrementDrops)) | ||
return temMALFORMED; | ||
// The transaction should only have one set of fields or the | ||
// other. | ||
// The ttFEE transaction format defines these fields as | ||
// optional, but once the XRPFees feature is enabled, they are | ||
// required. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, these are the forbidden ones. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, woops. Got those backwards. |
||
if (ctx.tx.isFieldPresent(sfBaseFee) || | ||
ctx.tx.isFieldPresent(sfReferenceFeeUnits) || | ||
ctx.tx.isFieldPresent(sfReserveBase) || | ||
|
@@ -107,18 +111,18 @@ Change::preclaim(PreclaimContext const& ctx) | |
} | ||
else | ||
{ | ||
// The transaction format formerly enforced these fields as | ||
// required. With featureXRPFees, those fields were made | ||
// optional with the expectation that they won't be used once | ||
// the feature is enabled. Since the feature hasn't yet | ||
// been enabled, they should all still be here. | ||
// The ttFEE transaction format formerly defined these fields | ||
// as required. When the XRPFees feature was implemented, they | ||
// were changed to be optional. Until the feature has been | ||
// enabled, they are required. | ||
if (!ctx.tx.isFieldPresent(sfBaseFee) || | ||
!ctx.tx.isFieldPresent(sfReferenceFeeUnits) || | ||
!ctx.tx.isFieldPresent(sfReserveBase) || | ||
!ctx.tx.isFieldPresent(sfReserveIncrement)) | ||
return temMALFORMED; | ||
// The transaction should only have one or the other. If the new | ||
// fields are present without the amendment, that's bad, too. | ||
// The ttFEE transaction format defines these fields as | ||
// optional, but without the XRPFees feature, they are | ||
// forbidden. | ||
if (ctx.tx.isFieldPresent(sfBaseFeeDrops) || | ||
ctx.tx.isFieldPresent(sfReserveBaseDrops) || | ||
ctx.tx.isFieldPresent(sfReserveIncrementDrops)) | ||
|
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.
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.
These are the required ones, right? Not forbidden? The code returns malformed if they are missing.
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.
Yeah, woops. Got those backwards.