-
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(AMM): prevent orphaned objects, inconsistent ledger state: (updates XLS-30) #4626
Closed
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
da44bc8
Cleanup AMM account owner directory on AMM account deletion
gregtatcam 5cead5b
Disallow check create to AMM
gregtatcam eaef4b6
Fix unconstrained entries in AuthAccount
gregtatcam b28101f
Allow SetTrust on AMM only for LP tokens and other changes
gregtatcam cbd7144
Add AMMDelete to handle amortized deletion and other changes to addre…
gregtatcam 40317c5
Fix missing AMMDelete transactor files
gregtatcam 9cf3fd7
Merge remote-tracking branch 'origin/develop' into amm-fixes
gregtatcam 75af923
Update api changelog for AMM feature
gregtatcam cd88481
Maintain AMM trustlines count in AMM root account and other changes a…
gregtatcam 9ddff74
Check no directory left after AMM trustlines are deleted and other mi…
gregtatcam 2b1c8c6
Disallow clawback out of AMM account
gregtatcam c5e3c89
Disallow AMM create if issuer has clawback enabled and other changes
gregtatcam b63e696
Remove lsfAMM flag and use sfAMMID instead, plus minor refactoring
gregtatcam 2efa0f8
Rall-back lsfAllowTrustLineClawback flag and other changes
gregtatcam fa0d9c4
Address auditor's feedback
gregtatcam 7e2c454
Update tecAMM_ACCOUNT error message
gregtatcam c07bb67
Merge branch 'develop' into amm-fixes
manojsdoshi 484e01f
Add unit-tests to verify CLOB/AMM offer and strand selection logic
gregtatcam cfa3201
Address reviewer's feedback
gregtatcam a34d29b
Add comments to stress that the selection tests would have to be upda…
gregtatcam 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
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
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
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
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
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
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
Oops, something went wrong.
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.
If the account root somehow doesn't exist, this is a log-worthy event but should the transaction be rolled back? If the account is missing we can still delete the AMM object... in fact we definitely should? The delete transactor should double as a "fix up" transactor. If an AMM ever gets into a bad state, somehow, then deleting it should repair the situation as much as possible.
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.
Counterpoint: If the account root doesn't exist, something has gone very, very wrong. Continuing with the deletion process may make things worse. Arguably, the ledger and transaction history should be examined manually to determine what happened and what's going on. The solution may require a fix amendment not just to clean up the ledger, but to prevent the issue from happening again.
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.
This would be an ungraceful failure mode. Half an AMM, if it happened, would probably crash the ledger or block an orderbook. You can't clean it up because of this pedantic check, even after restarting the whole network. Now you need to wait for an amendment and code update. You should seek to build graceful failure modes into production systems.
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.
If the ledger is corrupt, we're already in a failure mode. Better to stop than to continue in an state that may not be correct.
https://xrpl.org/intro-to-consensus.html#consensus-protocol-properties
If correctness is lost, then we do not want to make forward progress. This is not just me being stubborn, this is baked into the design of the ledger from the beginning.