mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 11:45:50 +00:00
address reviewer comments and update known amendments
This commit is contained in:
@@ -8,9 +8,10 @@ labels:
|
||||
# LedgerStateFix
|
||||
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/xrpld/app/tx/detail/LedgerStateFix.cpp "Source")
|
||||
|
||||
`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.
|
||||
|
||||
_(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.
|
||||
|
||||
## Example {% $frontmatter.seo.title %} JSON
|
||||
|
||||
@@ -27,15 +28,15 @@ _(Added by the [fixNFTokenPageLinks amendment][])_
|
||||
|
||||
{% raw-partial file="/docs/_snippets/tx-fields-intro.md" /%}
|
||||
|
||||
| Field | Data Type | Required? | Description |
|
||||
|:------|:-----------|:----------|:------------|
|
||||
| `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. |
|
||||
| Field | JSON Type | [Internal Type][] | Required? | Description |
|
||||
|:----------------|:---------------------|:------------------|:----------|:------------|
|
||||
| `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. |
|
||||
| `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. |
|
||||
|
||||
|
||||
## 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:
|
||||
`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.
|
||||
|
||||
### Type 1
|
||||
|
||||
@@ -48,21 +49,24 @@ Corrupt NFT directories resulting from these conditions:
|
||||
|
||||
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.
|
||||
The [fixNFTokenPageLinks amendment][] prevents new instances of this type of ledger corruption from happening.
|
||||
|
||||
|
||||
## 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.
|
||||
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 %}).
|
||||
|
||||
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.
|
||||
|
||||
|
||||
## Error Cases
|
||||
|
||||
Potential errors are those that can occur for all transactions.
|
||||
Besides errors that can occur for all transactions, {% $frontmatter.seo.title %} transactions can result in the following [transaction result codes](../transaction-results/index.md):
|
||||
|
||||
| Error Code | Description |
|
||||
|:-----------------------------|:------------|
|
||||
| `tecFAILED_PROCESSING` | The transaction failed to apply the fix. For example, the transaction attempted to repair an NFT directory that was not broken. |
|
||||
| `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. |
|
||||
| `tefINVALID_LEDGER_FIX_TYPE` | The [`LedgerFixType`](#ledgerfixtype) value specified in the transaction is not valid. Currently, the only valid type is `1`. |
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
Reference in New Issue
Block a user