When an AMM account is deleted, the owner directory entries must be
deleted in order to ensure consistent ledger state.
* When deleting AMM account:
* Clean up AMM owner dir, linking AMM account and AMM object
* Delete trust lines to AMM
* Disallow `CheckCreate` to AMM accounts
* AMM cannot cash a check
* Constrain entries in AuthAccounts array to be accounts
* AuthAccounts is an array of objects for the AMMBid transaction
* SetTrust (TrustSet): Allow on AMM only for LP tokens
* If the destination is an AMM account and the trust line doesn't
exist, then:
* If the asset is not the AMM LP token, then fail the tx with
`tecNO_PERMISSION`
* If the AMM is in empty state, then fail the tx with `tecAMM_EMPTY`
* This disallows trustlines to AMM in empty state
* Add AMMID to AMM root account
* Remove lsfAMM flag and use sfAMMID instead
* Remove owner dir entry for ltAMM
* Add `AMMDelete` transaction type to handle amortized deletion
* Limit number of trust lines to delete on final withdraw + AMMDelete
* Put AMM in empty state when LPTokens is 0 upon final withdraw
* Add `tfTwoAssetIfEmpty` deposit option in AMM empty state
* Fail all AMM transactions in AMM empty state except special deposit
* Add `tecINCOMPLETE` to indicate that not all AMM trust lines are
deleted (i.e. partial deletion)
* This is handled in Transactor similar to deleted offers
* Fail AMMDelete with `tecINTERNAL` if AMM root account is nullptr
* Don't validate for invalid asset pair in AMMDelete
* AMMWithdraw deletes AMM trust lines and AMM account/object only if the
number of trust lines is less than max
* Current `maxDeletableAMMTrustLines` = 512
* Check no directory left after AMM trust lines are deleted
* Enable partial trustline deletion in AMMWithdraw
* Add `tecAMM_NOT_EMPTY` to fail any transaction that expects an AMM in
empty state
* Clawback considerations
* Disallow clawback out of AMM account
* Disallow AMM create if issuer can claw back
This patch applies to the AMM implementation in #4294.
Acknowledgements:
Richard Holland and Nik Bougalis for responsibly disclosing this issue.
Bug Bounties and Responsible Disclosures:
We welcome reviews of the project code and urge researchers to
responsibly disclose any issues they may find.
To report a bug, please send a detailed report to:
bugs@xrpl.org
Signed-off-by: Manoj Doshi <mdoshi@ripple.com>
9.0 KiB
API Changelog
This changelog is intended to list all updates to the API.
For info about how API versioning works, view the XLS-22d spec. For details about the implementation of API versioning, view the implementation PR.
The API version controls the API behavior you see. This includes what properties you see in responses, what parameters you're permitted to send in requests, and so on. You specify the API version in each of your requests. When a breaking change is introduced to the rippled API, a new version is released. To avoid breaking your code, you should set (or increase) your version when you're ready to upgrade.
For a log of breaking changes, see the API Version [number] headings. Breaking changes are associated with a particular API Version number. For non-breaking changes, scroll to the XRP Ledger version [x.y.z] headings. Non-breaking changes are associated with a particular XRP Ledger (rippled) release.
API Version 2
This version will be supported by rippled version 1.12.
V2 account_info response
signer_lists is returned in the root of the response, instead of being nested under account_data (as it was in API version 1). (#3770)
API Version 1
This version is supported by rippled version 1.11.
Idiosyncrasies
V1 account_info response
In the response to the account_info command, there is account_data - which is supposed to be an AccountRoot object - and signer_lists is in this object. However, the docs say that signer_lists should be at the root level of the reponse - and this makes sense, since signer lists are not part of the AccountRoot object. (First reported in xrpl-dev-portal#938.) Thanks to rippled#3770, this field will be moved in api_version: 2, to the root level of the response.
server_info - network_id
The network_id field was added in the server_info response in version 1.5.0 (2019), but it was not returned in reporting mode.
XRP Ledger version 1.12.0
Version 1.12.0 is in development.
Additions in 1.12
Additions are intended to be non-breaking (because they are purely additive).
server_info: Addedports, an array which advertises the RPC and WebSocket ports. This information is also included in the/crawlendpoint (which callsserver_infointernally).grpcandpeerports are also included. (https://github.com/XRPLF/rippled/pull/4427)portscontains objects, each containing aportfor the listening port (a number string), and aprotocolarray listing the supported protocols on that port.- This allows crawlers to build a more detailed topology without needing to port-scan nodes.
- (For peers and other non-admin clients, the info about admin ports is excluded.)
- Clawback: The following additions are gated by the Clawback amendment (
featureClawback). (https://github.com/XRPLF/rippled/pull/4553)- Adds an AccountRoot flag called
lsfAllowTrustLineClawback(https://github.com/XRPLF/rippled/pull/4617)- Adds the corresponding
asfAllowTrustLineClawbackAccountSet Flag as well. - Clawback is disabled by default, so if an issuer desires the ability to claw back funds, they must use an
AccountSettransaction to set the AllowTrustLineClawback flag. They must do this before creating any trust lines, offers, escrows, payment channels, or checks.
- Adds the corresponding
- Adds the Clawback transaction type, containing these fields:
Account: The issuer of the asset being clawed back. Must also be the sender of the transaction.Amount: The amount being clawed back, with theAmount.issuerbeing the token holder's address.
- Adds an AccountRoot flag called
- Adds AMM (#4294, #4626) feature:
- Adds
amm_infoAPI to retrieve AMM information for a given tokens pair. - Adds
AMMCreatetransaction type to createAMMinstance. - Adds
AMMDeposittransaction type to deposit funds intoAMMinstance. - Adds
AMMWithdrawtransaction type to withdraw funds fromAMMinstance. - Adds
AMMVotetransaction type to vote for the trading fee ofAMMinstance. - Adds
AMMBidtransaction type to bid for the Auction Slot ofAMMinstance. - Adds
AMMDeletetransaction type to deleteAMMinstance. - Adds
sfAMMIDtoAccountRootto indicate that the account isAMM's account.AMMIDis used to fetchltAMM. - Adds
lsfAMMNodeTrustLineflag to indicate that one side of theTrustLineisAMMaccount. - Adds
tfLPToken,tfSingleAsset,tfTwoAsset,tfOneAssetLPToken,tfLimitLPToken,tfTwoAssetIfEmpty,tfWithdrawAll,tfOneAssetWithdrawAllwhich allow a trader to specify different fields combination forAMMDepositandAMMWithdrawtransactions. - Adds new transaction result codes:
- tecUNFUNDED_AMM: insufficient balance to fund AMM. The account does not have funds for liquidity provision.
- tecAMM_BALANCE: AMM has invalid balance. Calculated balances greater than the current pool balances.
- tecAMM_FAILED: AMM transaction failed. Fails due to a processing failure.
- tecAMM_INVALID_TOKENS: AMM invalid LP tokens. Invalid input values, format, or calculated values.
- tecAMM_EMPTY: AMM is in empty state. Transaction expects AMM in non-empty state (LP tokens > 0).
- tecAMM_NOT_EMPTY: AMM is not in empty state. Transaction expects AMM in empty state (LP tokens == 0).
- tecAMM_ACCOUNT: AMM account. Clawback of AMM account.
- tecINCOMPLETE: Some work was completed, but more submissions required to finish. AMMDelete partially deletes the trustlines.
- Adds
XRP Ledger version 1.11.0
Version 1.11.0 was released on Jun 20, 2023.
Breaking changes in 1.11
- Added the ability to mark amendments as obsolete. For the
featureadmin API, there is a new possible value for thevetoedfield. (#4291) - The API now won't accept seeds or public keys in place of account addresses. (#4404)
- For the
ledger_datamethod, when all entries are filtered out, the API now returns an empty list (an empty array,[]). (Previously, it would returnnull.) While this is technically a breaking change, the new behavior is consistent with the documentation, so this is considered only a bug fix. (#4398) - If and when the
fixNFTokenRemintamendment activates, there will be a new AccountRoot field,FirstNFTSequence. This field is set to the current account sequence when the account issues their first NFT. If an account has not issued any NFTs, then the field is not set. (#4406)- There is a new account deletion restriction: an account can only be deleted if
FirstNFTSequence+MintedNFTokens+256is less than the current ledger sequence. - This is potentially a breaking change if clients have logic for determining whether an account can be deleted.
- There is a new account deletion restriction: an account can only be deleted if
- NetworkID
- For sidechains and networks with a network ID greater than 1024, there is a new transaction common field,
NetworkID. (https://github.com/XRPLF/rippled/pull/4370)- This field helps to prevent replay attacks and is now required for chains whose network ID is 1025 or higher.
- The field must be omitted for Mainnet, so there is no change for Mainnet users.
- There are three new local error codes:
telNETWORK_ID_MAKES_TX_NON_CANONICAL: aNetworkIDis present but the chain's network ID is less than 1025. Remove the field from the transaction, and try again.telREQUIRES_NETWORK_ID: aNetworkIDis required, but is not present. Add the field to the transaction, and try again.telWRONG_NETWORK: aNetworkIDis specified, but it is for a different network. Submit the transaction to a different server which is connected to the correct network.
- For sidechains and networks with a network ID greater than 1024, there is a new transaction common field,
Additions and bug fixes in 1.11
- Added
nftoken_id,nftoken_idsandoffer_idmeta fields into NFTtxandaccount_txresponses. (https://github.com/XRPLF/rippled/pull/4447) - Added an
account_flagsobject to theaccount_infomethod response. (https://github.com/XRPLF/rippled/pull/4459) - Added
NFTokenPagesto theaccount_objectsRPC. (https://github.com/XRPLF/rippled/pull/4352) - Fixed:
markerreturned from theaccount_linescommand would not work on subsequent commands. (https://github.com/XRPLF/rippled/pull/4361)