Skip to content

Commit e2a0146

Browse files
authored
Merge pull request #2971 from XRPLF/ledgerstatefix-docs
Add ledgerstatefix txn doc
2 parents ed62831 + 1836859 commit e2a0146

File tree

5 files changed

+87
-14
lines changed

5 files changed

+87
-14
lines changed

docs/_snippets/common-links.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@
403403
[fixFillOrKill amendment]: /resources/known-amendments.md#fixfillorkill
404404
[fixMasterKeyAsRegularKey amendment]: /resources/known-amendments.md#fixmasterkeyasregularkey
405405
[fixNFTokenDirV1 amendment]: /resources/known-amendments.md#fixnftokendirv1
406+
[fixNFTokenPageLinks amendment]: /resources/known-amendments.md#fixnftokenpagelinks
406407
[fixNFTokenRemint amendment]: /resources/known-amendments.md#fixnftokenremint
407408
[fixPayChanRecipientOwnerDir amendment]: /resources/known-amendments.md#fixpaychanrecipientownerdir
408409
[fixPreviousTxnID amendment]: /resources/known-amendments.md#fixprevioustxnid

docs/references/protocol/transactions/types/ammclawback.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# AMMClawback
22

3-
<!--> Add link to github source after feature is merged into devnet. <-->
43
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/xrpld/app/tx/detail/AMMClawback.cpp "Source")
54

6-
_(Added by the [AMM amendment][])_
5+
_(Added by the [AMMClawback amendment][])_
76

87
Claw back tokens from a holder who has deposited your issued tokens into an AMM pool.
98

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
seo:
3+
description: Repair corruptions to the XRP ledger.
4+
labels:
5+
- Utilities
6+
- Troubleshooting
7+
---
8+
# LedgerStateFix
9+
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/xrpld/app/tx/detail/LedgerStateFix.cpp "Source")
10+
11+
`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.
12+
13+
_(Added by the [fixNFTokenPageLinks amendment][])_
14+
15+
16+
## Example {% $frontmatter.seo.title %} JSON
17+
18+
```json
19+
{
20+
"Account" : "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
21+
"Fee" : "2000000",
22+
"LedgerFixType" : 1,
23+
"Owner" : "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
24+
"Sequence" : 2,
25+
"TransactionType" : "LedgerStateFix"
26+
}
27+
```
28+
29+
{% raw-partial file="/docs/_snippets/tx-fields-intro.md" /%}
30+
31+
| Field | JSON Type | [Internal Type][] | Required? | Description |
32+
|:----------------|:---------------------|:------------------|:----------|:------------|
33+
| `LedgerFixType` | Number | UInt16 | Yes | The type of fix to apply. See [LedgerFixType](#ledgerfixtype) for possible values. Currently the only type is `1`, which fixes the NFToken directory for a single account. |
34+
| `Owner` | String - [Address][] | Account | No | _(Required if `LedgerFixType` is `1`.)_ The account that owns the NFToken directory to fix. Does not need any relationship to the sender of the transaction. |
35+
36+
37+
## LedgerFixType
38+
39+
`LedgerStateFix` transactions are targeted solutions for rare and specific issues. They can only be used to fix a specific type of ledger corruption, described below.
40+
41+
### Type 1
42+
43+
Corrupt NFT directories resulting from these conditions:
44+
45+
- At least two NFToken pages were in the directory.
46+
- The next-to-last page was completely full, holding 32 NFTokens.
47+
- The last page of the directory contained only one NFToken.
48+
- A transaction removed the last remaining token from the last page, causing the directory to delete the page.
49+
50+
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.
51+
52+
The [fixNFTokenPageLinks amendment][] prevents new instances of this type of ledger corruption from happening.
53+
54+
55+
## Special Transaction Cost
56+
57+
The `LedgerStateFix` transaction is rare and potentially compute intensive, so the transaction must pay a special [transaction cost][] equal to at least the [owner reserve](../../../../concepts/accounts/reserves.md) for one item (currently {% $env.PUBLIC_OWNER_RESERVE %}).
58+
59+
The transaction cost always applies when a transaction is included in a validated ledger, even if the transaction fails. (See [Error Cases](#error-cases).) To greatly reduce the chances of paying the high transaction cost if the transaction fails, [submit the transaction](../../../http-websocket-apis/public-api-methods/transaction-methods/submit.md) with `fail_hard` enabled.
60+
61+
62+
## Error Cases
63+
64+
Besides errors that can occur for all transactions, {% $frontmatter.seo.title %} transactions can result in the following [transaction result codes](../transaction-results/index.md):
65+
66+
| Error Code | Description |
67+
|:-----------------------------|:------------|
68+
| `tecFAILED_PROCESSING` | The transaction failed to apply the fix. For example, the transaction attempted to repair an NFT directory that was not broken. |
69+
| `tecOBJECT_NOT_FOUND` | A ledger entry specified in the transaction does not exist. For example, the transaction tried to repair the NFT directory of an account that does not hold any NFTs. |
70+
| `tefINVALID_LEDGER_FIX_TYPE` | The [`LedgerFixType`](#ledgerfixtype) value specified in the transaction is not valid. Currently, the only valid type is `1`. |
71+
72+
{% raw-partial file="/docs/_snippets/common-links.md" /%}

resources/known-amendments.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ This list is updated manually. For a live view of amendment voting, see the Amen
1717

1818
| Name | Introduced | Status |
1919
|:----------------------------------|:-----------|:------------------------------|
20-
| [AMMClawback][] | v2.3.0 | {% badge href="https://xrpl.org/blog/2024/rippled-2.3.0" %}Open for Voting: 2024-11-26{% /badge %} |
20+
| [AMMClawback][] | v2.3.0 | {% badge href="https://livenet.xrpl.org/transactions/8672DFD11FCF79F8E8F92E300187E8E533899ED8C8CF5AFB1A9C518195C16261" %}Enabled: 2025-01-30{% /badge %} |
2121
| [Credentials][] | v2.3.0 | {% badge href="https://xrpl.org/blog/2024/rippled-2.3.0" %}Open for Voting: 2024-11-26{% /badge %} |
22-
| [fixAMMv1_2][] | v2.3.0 | {% badge href="https://xrpl.org/blog/2024/rippled-2.3.0" %}Open for Voting: 2024-11-26{% /badge %} |
23-
| [fixEnforceNFTokenTrustline][] | v2.3.0 | {% badge href="https://xrpl.org/blog/2024/rippled-2.3.0" %}Open for Voting: 2024-11-26{% /badge %} |
24-
| [fixInnerObjTemplate2][] | v2.3.0 | {% badge href="https://xrpl.org/blog/2024/rippled-2.3.0" %}Open for Voting: 2024-11-26{% /badge %} |
25-
| [fixNFTokenPageLinks][] | v2.3.0 | {% badge href="https://xrpl.org/blog/2024/rippled-2.3.0" %}Open for Voting: 2024-11-26{% /badge %} |
26-
| [fixReducedOffersV2][] | v2.3.0 | {% badge href="https://xrpl.org/blog/2024/rippled-2.3.0" %}Open for Voting: 2024-11-26{% /badge %} |
22+
| [fixAMMv1_2][] | v2.3.0 | {% badge href="https://livenet.xrpl.org/transactions/71D5031A5BD927BDFE424E51699E69F2784097D615D0852BF20C168BA9B5EA76" %}Enabled: 2025-01-30{% /badge %} |
23+
| [fixEnforceNFTokenTrustline][] | v2.3.0 | {% badge href="https://livenet.xrpl.org/transactions/606FA84C4BA30F67582C11A39BBFC11A9D994E114CD515E9F63FC7D8701A8ED9" %}Enabled: 2025-01-30{% /badge %} |
24+
| [fixInnerObjTemplate2][] | v2.3.0 | {% badge href="https://livenet.xrpl.org/transactions/426314C8BC64BA339E97E53B278602ADC44F115056274BF7971F694C9A8AF946" %}Enabled: 2025-01-30{% /badge %} |
25+
| [fixNFTokenPageLinks][] | v2.3.0 | {% badge href="https://livenet.xrpl.org/transactions/2D9A29768A7FA4BAC01DF1941380077E304785279E5E49267EC269F53ABADF5A" %}Enabled: 2025-01-30{% /badge %} |
26+
| [fixReducedOffersV2][] | v2.3.0 | {% badge href="https://livenet.xrpl.org/transactions/6D325D5EFF8230F1FECA3EE6418C9678637F3F56B0CA247013F70B3BDCFE75C8" %}Enabled: 2025-01-30{% /badge %} |
2727
| [MPTokensV1][] | v2.3.0 | {% badge href="https://xrpl.org/blog/2024/rippled-2.3.0" %}Open for Voting: 2024-11-26{% /badge %} |
2828
| [NFTokenMintOffer][] | v2.3.0 | {% badge href="https://xrpl.org/blog/2024/rippled-2.3.0" %}Open for Voting: 2024-11-26{% /badge %} |
2929
| [fixXChainRewardRounding][] | v2.2.0 | {% badge href="https://xrpl.org/blog/2024/rippled-2.2.0" %}Open for Voting: 2024-06-04{% /badge %} |
@@ -169,7 +169,7 @@ Adds several new transaction result codes.
169169
| Amendment | AMMClawback |
170170
|:-------------|:------------|
171171
| Amendment ID | 726F944886BCDF7433203787E93DD9AA87FAB74DFE3AF4785BA03BEFC97ADA1F |
172-
| Status | Open for Voting |
172+
| Status | Enabled |
173173
| Default Vote (Latest stable release) | No |
174174
| Pre-amendment functionality retired? | No |
175175

@@ -732,7 +732,7 @@ Fixes AMM offer rounding and low quality order book offers from blocking the AMM
732732
| Amendment | fixAMMv1_2 |
733733
|:-------------|:-----------|
734734
| Amendment ID | 1E7ED950F2F13C4F8E2A54103B74D57D5D298FFDBD005936164EE9E6484C438C |
735-
| Status | Open for Voting |
735+
| Status | Enabled |
736736
| Default Vote (Latest stable release) | No |
737737
| Pre-amendment functionality retired? | No |
738738

@@ -806,7 +806,7 @@ This amendment has no effect unless the [DID][] amendment is enabled.
806806
| Amendment | fixEnforceNFTokenTrustline |
807807
|:-------------|:---------------------------|
808808
| Amendment ID | 763C37B352BE8C7A04E810F8E462644C45AFEAD624BF3894A08E5C917CF9FF39 |
809-
| Status | Open for Voting |
809+
| Status | Enabled |
810810
| Default Vote (Latest stable release) | No |
811811
| Pre-amendment functionality retired? | No |
812812

@@ -854,7 +854,7 @@ Currently, the inner object template isn't set upon object creation. If the obje
854854
| Amendment | fixInnerObjTemplate2 |
855855
|:-------------|:---------------------|
856856
| Amendment ID | 9196110C23EA879B4229E51C286180C7D02166DA712559F634372F5264D0EC59 |
857-
| Status | Open for Voting |
857+
| Status | Enabled |
858858
| Default Vote (Latest stable release) | No |
859859
| Pre-amendment functionality retired? | No |
860860

@@ -926,7 +926,7 @@ This amendment has no effect unless the [NonFungibleTokensV1][] amendment is ena
926926
| Amendment | fixNFTokenPageLinks |
927927
|:-------------|:--------------------|
928928
| Amendment ID | C7981B764EC4439123A86CC7CCBA436E9B3FF73B3F10A0AE51882E404522FC41 |
929-
| Status | Open for Voting |
929+
| Status | Enabled |
930930
| Default Vote (Latest stable release) | No |
931931
| Pre-amendment functionality retired? | No |
932932

@@ -1088,7 +1088,7 @@ Without this amendment, an offer with very small amounts remaining can have a a
10881088
| Amendment | fixReducedOffersV2 |
10891089
|:-------------|:-------------------|
10901090
| Amendment ID | 31E0DA76FB8FB527CADCDF0E61CB9C94120966328EFA9DCA202135BAF319C0BA |
1091-
| Status | Open for Voting |
1091+
| Status | Enabled |
10921092
| Default Vote (Latest stable release) | No |
10931093
| Pre-amendment functionality retired? | No |
10941094

sidebars.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@
377377
- page: docs/references/protocol/transactions/types/escrowcancel.md
378378
- page: docs/references/protocol/transactions/types/escrowcreate.md
379379
- page: docs/references/protocol/transactions/types/escrowfinish.md
380+
- page: docs/references/protocol/transactions/types/ledgerstatefix.md
380381
- page: docs/references/protocol/transactions/types/mptokenauthorize.md
381382
- page: docs/references/protocol/transactions/types/mptokenissuancecreate.md
382383
- page: docs/references/protocol/transactions/types/mptokenissuancedestroy.md

0 commit comments

Comments
 (0)