address reviewer comments

This commit is contained in:
Oliver Eggert
2025-01-30 12:31:39 -08:00
parent 7cf28b30f3
commit d7c3df1d23
3 changed files with 33 additions and 34 deletions

View File

@@ -394,6 +394,7 @@
[fixFillOrKill amendment]: /resources/known-amendments.md#fixfillorkill
[fixMasterKeyAsRegularKey amendment]: /resources/known-amendments.md#fixmasterkeyasregularkey
[fixNFTokenDirV1 amendment]: /resources/known-amendments.md#fixnftokendirv1
[fixNFTokenPageLinks amendment]: /resources/known-amendments.md#fixnftokenpagelinks
[fixNFTokenRemint amendment]: /resources/known-amendments.md#fixnftokenremint
[fixPayChanRecipientOwnerDir amendment]: /resources/known-amendments.md#fixpaychanrecipientownerdir
[fixPreviousTxnID amendment]: /resources/known-amendments.md#fixprevioustxnid

View File

@@ -1,9 +1,8 @@
# AMMClawback
<!--> Add link to github source after feature is merged into devnet. <-->
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/xrpld/app/tx/detail/AMMClawback.cpp "Source")
_(Added by the [AMM amendment][])_
_(Added by the [AMMClawback amendment][])_
Claw back tokens from a holder who has deposited your issued tokens into an AMM pool.

View File

@@ -8,6 +8,7 @@ labels:
# LedgerStateFix
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/xrpld/app/tx/detail/LedgerStateFix.cpp "Source")
_(Added by the [fixNFTokenPageLinks amendment][])_
`LedgerStateFix` is a general purpose transaction used to fix specific issues affecting the XRP ledger. You submit the transaction with the `LedgerFixType` value set to indicate the particular error state to correct.
@@ -15,14 +16,12 @@ labels:
```json
{
"Account" : "<Signer and fee payer>",
"Account" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Fee" : "2000000",
"LedgerFixType" : 1,
"Owner" : "<Account with corrupted NFTokenPage directory",
"Sequence" : <n>,
"SigningPubKey" : "<Account's public key>",
"TransactionType" : "LedgerStateFix",
"TxnSignature" : "<Signature>",
"Owner" : "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
"Sequence" : 2,
"TransactionType" : "LedgerStateFix"
}
```
@@ -30,40 +29,40 @@ labels:
| Field | Data Type | Required? | Description |
|:------|:-----------|:----------|:------------|
| `TransactionType` | UInt16 | Required | Identifies this as a `LedgerStateFix` transaction. |
| `Account` | STAccount | Required | Identifies the account signing and submitting the transaction as well as paying the Fee. |
| `Fee` | STAmount | Required | This transaction is rare and potentially compute intensive. The minimum fee is the same as the fee for an AccountDelete transaction. If the transaction fails with a tec code, the fee is still charged. |
| `Flags` | uint32 | Optional | Not needed for `LedgerFixType` == _1_. Reserved for a future type of ledger fix. |
| `LedgerFixType` | uint16 | Required | Currently the only type is _1_, which fixes the NFToken directory for a single account. |
| `Owner` | STAccount | Optional | Required if `LedgerFixType` == _1_, the account ID that owns the NFToken directory that needs fixing. Need not have any relationship to Account. |
## LedgerFixType
`LedgerStateFix` transactions are targeted solutions for rare and specific issues. They can't be used to fix ledger issues outside of the described types below:
### Type 1
Corrupt NFT directories resulting from these conditions:
- At least two NFToken pages were in the directory.
- The next-to-last page was completely full, holding 32 NFTokens.
- The last page of the directory contained only one NFToken.
- A transaction removed the last remaining token from the last page, causing the directory to delete the page.
When these conditions were met, the NFToken directory didn't properly update page links, causing holes in the directory when new last pages were created for additional NFTokens.
The [`fixNFTokenPageLinks` amendment][] fixed new instances of this ledger issue by adding invariant checks.
## LedgerStateFix Flags
Transactions of the LedgerStateFix type can support additional values in the `Flags` field. Currently, there are no flags defined. A future `LedgerFixType` might require flag settings.
Transactions of the `LedgerStateFix` type can support additional values in the `Flags` field. Currently, there are no flags defined. A future `LedgerFixType` might require flag settings.
## Special Transaction Cost
The `LedgerStateFix` transaction is rare and potentially compute intensive. The minimum fee is the same as the fee for an [`AccountDelete`][] transaction. If the transaction fails with a tec code, the fee is still charged.
## Error Cases
Potential errors are those that can occur for all transactions.
## LedgerStateFix Types
`LedgerStateFix` might sound like a general panacea for all your ledger's ills, but in practice it is a targeted solution for very rare, known, and specific issues.
### Type 1
There are two different transactions that introduced corruptions to NFT directories. In both cases, the following conditions were met:
- There were at least two NFToken pages in the directory.
- The next-to-last page was completely full, holding 32 NFTokens.
- The very last page of the directory contained only one NFToken.
- The transaction removed the last remaining token from the last page.
When these conditions were met, the last NFToken page was removed and the next-to-last page was left as the final page in the directory.
That would be fine, except the NFToken directory has an expectation that the last page has a specific index. The page with that index was just deleted. When an NFToken is added to the directory, and that token has a high enough value that it doesn't belong on the current last page, then a new last page is created that has no links to the previous page, creating a hole in the middle of the list.
The `fixNFTokenPageLinks` amendment modifies the NFToken page, coalescing code to notice when the very last page of the directory would be removed. In that case, it moves all of the contents of the next lower page into the last page and deletes the next-to-last page. It then fixes up the links.
New invariant checks also validate aspects of the links on pages, so a similar corruption returns a tecINVARIANT_FAILED transaction result. That will prevent this specific type of corruption going forward.
{% raw-partial file="/docs/_snippets/common-links.md" /%}