-
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
fix amendment: flag check for credentials #5250
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #5250 +/- ##
=======================================
Coverage 78.1% 78.2%
=======================================
Files 790 790
Lines 67622 67638 +16
Branches 8163 8163
=======================================
+ Hits 52844 52862 +18
+ Misses 14778 14776 -2
|
The flag check is also missing on other transactions. Should we add the flag check to other transactions as well? I believe the other one is SignerListSet. |
@dangell7 makes sense, but it should be a different amendment (we do not want this amendment to be rejected by operators, because of compatibility anxiety) |
Fair enough. I am not going to oppose strongly, just wary of scope creep. |
My concern is about amendment count creep - needing a separate amendment just to add one additional check feels kind of dumb. Agree that scope creep is a concern, but IMO this slight scope creep is fine (and I wouldn't want to expand it further). |
New name is good. I have not done a full review, so I'm not going to approve. Since my issue has been addressed, I'm just going to dismiss my review.
b882a6e
to
8c8a262
Compare
@@ -29,6 +29,8 @@ | |||
// If you add an amendment here, then do not forget to increment `numFeatures` | |||
// in include/xrpl/protocol/Feature.h. | |||
|
|||
// Check flags in Credential transactions | |||
XRPL_FIX (TransactionFlags, Supported::yes, VoteBehavior::DefaultNo) |
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.
XRPL_FIX (TransactionFlags, Supported::yes, VoteBehavior::DefaultNo) | |
XRPL_FIX (InvalidFlags, Supported::yes, VoteBehavior::DefaultNo) |
Something like this maybe? So it's clearer what's being fixed
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.
Not so clear - it feels like we testing flag values themselves if they are valid or not.
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.
Right, so you're now actually erroring for invalid flags.
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.
Not exact. One case - Transaction can fail with valid flag, which not processing by it, that's what we are testing.
And another case when someone can create flag value that is not acceptable as a single flag. For example binary value 011. Or value that is already occupied.
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'm thinking from the perspective of someone who sees fixTransactionFlags
by itself and doesn't look into the code (which will be the vast majority of people). That's confusing to me. vs fixInvalidFlags
is clearer to me about what it's fixing - flags that are invalid are being handled properly now.
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.
Exact the same reason, but opposite conclusion for me :-) fixInvalidFlags
is dedicated to flags type/values checks, and fixTransactionFlags
directly point that it has something to do with flags in transactions
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.
What if we combine them? fixInvalidTxFlags
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 "fix invalid" is a bit overkill phrase. Fixing something is implying that it is invalid/incorrect/wrong. So fixInvalidFlags
is equal to fixFlags
by its meaning. Which is less informative than fixTransactionFlags
.
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.
For the community I think I would err on the side of over kill and go with fixInvalidTxFlags
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.
ok
It is a pseudo-transaction, responsible for all of: using EnableAmendment = Change;
using SetFee = Change;
using UNLModify = Change; I agree we should enforce its flags, and since this PR has mutated to enforcing flags perhaps it is also the right place to add enforcement to this PR. There is a caveat: the enforcement of flags (as seen in this PR) is subject to amendment voting, and this |
It wouldn't hurt to add the check, as long as it's gated by the amendment. Technically, amendments are not active until the ledger after the However, it's probably not necessary, because there are only two ways a node is ever going to process a pseudo-transaction:
In other words, user input is never going to result in a valid pseudo-transaction, so they are much less likely to have invalid flags. Conclusion: It may not be necessary, but it wouldn't hurt. |
526b7f8
to
185a1d7
Compare
So better skip it to not to introduce some hidden bug |
0e2bbc5
to
6b325d9
Compare
ready to merge |
High Level Overview of Change
Add transaction flag checking functionality for Credentials
Context of Change
CredentialCreate / CredentialAccept / CredentialDelete transactions will check sfFlags field in preflight()
Type of Change