-
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
Add an Invariant check that a deleted account has no traceable objects left on the ledger. #4638
Comments
After the proposed invariant check has been added, what would occur if a transaction attempts to violate the invariant? |
It would get a |
* Resolves XRPLF#4638
* Resolves XRPLF#4638
|
Note to self: rewrite the NFT page lookups to use |
* Resolves XRPLF#4638
* Resolves XRPLF#4638
* Resolves XRPLF#4638
* Resolves XRPLF#4638
* Resolves XRPLF#4638
* Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
* Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638
… the ledger. (XRPLF#4663) * Add feature / amendment "InvariantsV1_1" * Adds invariant AccountRootsDeletedClean: * Checks that a deleted account doesn't leave any directly accessible artifacts behind. * Always tests, but only changes the transaction result if featureInvariantsV1_1 is enabled. * Unit tests. * Resolves XRPLF#4638 * [FOLD] Review feedback from @gregtatcam: * Fix unused variable warning * Improve Invariant test const correctness * [FOLD] Review feedback from @mvadari: * Centralize the account keylet function list, and some optimization * [FOLD] Some structured binding doesn't work in clang * [FOLD] Review feedback 2 from @mvadari: * Clean up and clarify some comments. * [FOLD] Change InvariantsV1_1 to unsupported * Will allow multiple PRs to be merged over time using the same amendment. * fixup! [FOLD] Change InvariantsV1_1 to unsupported * [FOLD] Update and clarify some comments. No code changes. * Move CMake directory * Rearrange sources * Rewrite includes * Recompute loops * Fix merge issue and formatting --------- Co-authored-by: Pretty Printer <[email protected]>
Summary
Add a new class to InvariantCheck.h/cpp that finds any deleted
AccountRoots
(there should only be one, of course) and attempts to read the directory root, and any other objects that can be accessed directly (e.g. theSignerList
, NFT page... that might be all of them).Motivation
The first version of AMM (#4294) support merged to
develop
did not delete the AMMAccountRoot
correctly. Fortunately, this was discovered and reported, and a fix is in progress (#4626). During the review of the second PR, it occurred to me that this issue would have been avoided if there was an invariant to verify if a deleted account has no "artifacts" left on the ledger. (#4626 (comment))Solution
Create a new invariant class (possible name
CompletelyDeletedAccount
). Use thevisitEntry
function to build a vector of deletedAccountRoots
(There should only be one, but that's checked by the existingAccountRootsNotDeleted
class). Use thefinalize
function to attempt toread
any directly accessible objects from theview
. "Directly accessible" in this case means any object that can be addressed (via aKeylet
) using only thesfAccountID
. That includes, but is not necessarily limited to:Keylet ownerDir(AccountID const& id) noexcept;
Keylet signers(AccountID const& account) noexcept;
Keylet nftpage_min(AccountID const& owner);
Keylet nftpage_max(AccountID const& owner);
Edit: And don't forget to check the for an AMM object if
AMMID
is populated.The text was updated successfully, but these errors were encountered: