diff --git a/concept-amendments.html b/concept-amendments.html index 0fd24c21fc..0da5d0985b 100644 --- a/concept-amendments.html +++ b/concept-amendments.html @@ -374,8 +374,8 @@ TrustSetAuth -

Adds sanity checks to transaction processing to ensure that certain conditions are always met. This provides an extra layer of protection against bugs in transaction processing that could otherwise cause exploits and vulnerabilities in the Ripple Consensus Ledger. Ripple expects to add more invariant checks in future versions of rippled without additional amendments.

-

Introduces two new transaction error codes, tecINVARIANT_FAILED and tefINVARIANT_FAILED. Changes transaction processing to add the new checks. Adds a configuration option to disable invariant-checking.

+

Adds sanity checks to transaction processing to ensure that certain conditions are always met. This provides an extra, independent layer of protection against bugs in transaction processing that could otherwise cause exploits and vulnerabilities in the Ripple Consensus Ledger. Ripple expects to add more invariant checks in future versions of rippled without additional amendments.

+

Introduces two new transaction error codes, tecINVARIANT_FAILED and tefINVARIANT_FAILED. Changes transaction processing to add the new checks.

Examples of invariant checks:

Any other use of account, currency, and issuer fields in a path step is invalid.

The type field, used for the binary serialization of a path set, is actually constructed through bitwise operations on a single integer. The bits are defined as follows:

diff --git a/content/concept-amendments.md b/content/concept-amendments.md index 42c44cb159..ca90cb8f62 100644 --- a/content/concept-amendments.md +++ b/content/concept-amendments.md @@ -148,9 +148,9 @@ Although this amendment is enabled, it has no effect unless the [SusPay](#suspay |:-----------------------------------------------------------------|:--------| | DC9CA96AEA1DCF83E527D1AFC916EFAF5D27388ECA4060A88817C1238CAEE0BF | In voting; expected 2017-06-29 | -Adds sanity checks to transaction processing to ensure that certain conditions are always met. This provides an extra layer of protection against bugs in transaction processing that could otherwise cause exploits and vulnerabilities in the Ripple Consensus Ledger. Ripple expects to add more invariant checks in future versions of `rippled` without additional amendments. +Adds sanity checks to transaction processing to ensure that certain conditions are always met. This provides an extra, independent layer of protection against bugs in transaction processing that could otherwise cause exploits and vulnerabilities in the Ripple Consensus Ledger. Ripple expects to add more invariant checks in future versions of `rippled` without additional amendments. -Introduces two new transaction error codes, `tecINVARIANT_FAILED` and `tefINVARIANT_FAILED`. Changes transaction processing to add the new checks. Adds a configuration option to disable invariant-checking. +Introduces two new transaction error codes, `tecINVARIANT_FAILED` and `tefINVARIANT_FAILED`. Changes transaction processing to add the new checks. Examples of invariant checks: diff --git a/content/concept-paths.md b/content/concept-paths.md index 0480382bc5..f839144fdd 100644 --- a/content/concept-paths.md +++ b/content/concept-paths.md @@ -72,7 +72,7 @@ A path set is an array. Each member of the path set is another array that repres |:-----------|:-----------------------|:---------------------------------------| | `account` | String - Address | _(Optional)_ If present, this path step represents rippling through the specified address. MUST NOT be provided if this step specifies the `currency` or `issuer` fields. | | `currency` | String - Currency Code | _(Optional)_ If present, this path step represents changing currencies through an order book. The currency specified indicates the new currency. MUST NOT be provided if this step specifies the `account` field. | -| `issuer` | String - Address | _(Optional)_ If the path step represents changing currencies through an order book, this field indicates the issuer of the new currency. If omitted in a step with a non-XRP `currency`, the previous step of the path defines the issuer. MUST be omitted if the `currency` is XRP. MUST NOT be provided if this step specifies the `account` field. | +| `issuer` | String - Address | _(Optional)_ If present, this path step represents changing currencies and this address defines the issuer of the new currency. If omitted in a step with a non-XRP `currency`, a previous step of the path defines the issuer. If present when `currency` is omitted, indicates a path step that uses an order book between same-named currencies with different issuers. MUST be omitted if the `currency` is XRP. MUST NOT be provided if this step specifies the `account` field. | | `type` | Integer | **DEPRECATED** _(Optional)_ An indicator of which other fields are present. | | `type_hex` | String | **DEPRECATED**: _(Optional)_ A hexadecimal representation of the `type` field. | @@ -81,11 +81,10 @@ In summary, the following combination of fields are valid, optionally with `type - `account` by itself - `currency` by itself - `currency` and `issuer` as long as the `currency` is not XRP +- `issuer` by itself Any other use of `account`, `currency`, and `issuer` fields in a path step is invalid. - - The `type` field, used for the binary serialization of a path set, is actually constructed through bitwise operations on a single integer. The bits are defined as follows: | Value (Hex) | Value (Decimal) | Description | diff --git a/content/reference-rippled.md b/content/reference-rippled.md index c292813b1b..c33864d9f9 100755 --- a/content/reference-rippled.md +++ b/content/reference-rippled.md @@ -3497,7 +3497,7 @@ Each member of the `queue_data` array represents one transaction in the queue. S | `max_spend_drops` | String | _(May be omitted)_ The maximum amount of XRP, [in drops](#specifying-currency-amounts), this transaction could send or destroy. | | `seq` | Integer | _(May be omitted)_ The [Sequence Number][] of this transaction. | -If the request specified `"owner_funds": true` and expanded transactions, the response has a field `owner_funds` in the `metaData` object of each [OfferCreate-type transaction](reference-transaction-format.html#offercreate). The purpose of this field is to make it easier to track the [funding status of offers](reference-transaction-format.html#lifecycle-of-an-offer) with each new validated ledger. This field is defined slightly different than the version of this field in [Order Book subscription streams](#order-book-streams): +If the request specified `"owner_funds": true` and expanded transactions, the response has a field `owner_funds` in the `metaData` object of each [OfferCreate-type transaction](reference-transaction-format.html#offercreate). The purpose of this field is to make it easier to track the [funding status of offers](reference-transaction-format.html#lifecycle-of-an-offer) with each new validated ledger. This field is defined slightly differently than the version of this field in [Order Book subscription streams](#order-book-streams): | `Field` | Value | Description | |:--------------|:-------|:----------------------------------------------------| diff --git a/content/reference-transaction-format.md b/content/reference-transaction-format.md index fa788fd23a..576893781f 100644 --- a/content/reference-transaction-format.md +++ b/content/reference-transaction-format.md @@ -1374,6 +1374,7 @@ These codes indicate that the transaction failed and was not included in a ledge | `tefEXCEPTION` | While processing the transaction, the server entered an unexpected state. This may be caused by unexpected inputs, for example if the binary data for the transaction is grossly malformed. If you can reproduce this error, please [report an issue](https://github.com/ripple/rippled/issues) to get it fixed. | | `tefFAILURE` | Unspecified failure in applying the transaction. | | `tefINTERNAL` | When trying to apply the transaction, the server entered an unexpected state. If you can reproduce this error, please [report an issue](https://github.com/ripple/rippled/issues) to get it fixed. | +| `tefINVARIANT_FAILED` | An invariant check failed when trying to claim the [transaction cost](concept-transaction-cost.html). Requires the [EnforceInvariants amendment](concept-amendments.html#enforceinvariants). If you can reproduce this error, please [report an issue](https://github.com/ripple/rippled/issues). | | `tefMASTER_DISABLED` | The transaction was signed with the account's master key, but the account has the `lsfDisableMaster` field set. | | `tefMAX_LEDGER` | The transaction included a [`LastLedgerSequence`](#lastledgersequence) parameter, but the current ledger's sequence number is already higher than the specified value. | | `tefNO_AUTH_REQUIRED` | The [TrustSet transaction][] tried to mark a trustline as authorized, but the `lsfRequireAuth` flag is not enabled for the corresponding account, so authorization is not necessary. | @@ -1414,6 +1415,7 @@ These codes indicate that the transaction failed, but it was applied to a ledger | Code | Value | Explanation | |:---------------------------|:------|:----------------------------------------| | `tecCLAIM` | 100 | Unspecified failure, with transaction cost destroyed. | +| `tecCRYPTOCONDITION_ERROR` | 146 | This [EscrowCreate][] or [EscrowFinish][] transaction contained a malformed or mismatched crypto-condition. | | `tecDIR_FULL` | 121 | The address sending the transaction cannot own any more objects in the ledger. | | `tecDST_TAG_NEEDED` | 143 | The [Payment](#payment) transaction omitted a destination tag, but the destination account has the `lsfRequireDestTag` flag enabled. [New in: rippled 0.28.0][] | | `tecFAILED_PROCESSING` | 105 | An unspecified error occurred when processing the transaction. | @@ -1421,7 +1423,8 @@ These codes indicate that the transaction failed, but it was applied to a ledger | `tecINSUF_RESERVE_LINE` | 122 | The transaction failed because the sending account does not have enough XRP to create a new trust line. (See: [Reserves](concept-reserves.html)) This error occurs when the counterparty already has a trust line in a non-default state to the sending account for the same currency. (See `tecNO_LINE_INSUF_RESERVE` for the other case.) | | `tecINSUF_RESERVE_OFFER` | 123 | The transaction failed because the sending account does not have enough XRP to create a new Offer. (See: [Reserves](concept-reserves.html)) | | `tecINSUFFICIENT_RESERVE` | 141 | The transaction would increase the [reserve requirement](concept-reserves.html) higher than the sending account's balance. [SignerListSet][], [PaymentChannelCreate][], [PaymentChannelFund][], and [EscrowCreate][] can return this error code. See [SignerLists and Reserves](reference-ledger-format.html#signerlists-and-reserves) for more information. | -| `tecINTERNAL` | 144 | Unspecified internal error, with transaction cost applied. This error code should not normally be returned. | +| `tecINTERNAL` | 144 | Unspecified internal error, with transaction cost applied. This error code should not normally be returned. If you can reproduce this error, please [report an issue](https://github.com/ripple/rippled/issues). | +| `tecINVARIANT_FAILED` | An invariant check failed when trying to execute this transaction. Requires the [EnforceInvariants amendment](concept-amendments.html#enforceinvariants). If you can reproduce this error, please [report an issue](https://github.com/ripple/rippled/issues). | | `tecNEED_MASTER_KEY` | 142 | This transaction tried to cause changes that require the master key, such as [disabling the master key or giving up the ability to freeze balances](#accountset-flags). [New in: rippled 0.28.0][] | | `tecNO_ALTERNATIVE_KEY` | 130 | The transaction tried to remove the only available method of [authorizing transactions](#authorizing-transactions). This could be a [SetRegularKey transaction][] to remove the regular key, a [SignerListSet transaction][] to delete a SignerList, or an [AccountSet transaction][] to disable the master key. (Prior to `rippled` 0.30.0, this was called `tecMASTER_DISABLED`.) | | `tecNO_AUTH` | 134 | The transaction failed because it needs to add a balance on a trust line to an account with the `lsfRequireAuth` flag enabled, and that trust line has not been authorized. If the trust line does not exist at all, `tecNO_LINE` occurs instead. | diff --git a/reference-rippled.html b/reference-rippled.html index 00651bfa9c..04fb9e9819 100644 --- a/reference-rippled.html +++ b/reference-rippled.html @@ -4463,7 +4463,7 @@ rippled ledger current -

If the request specified "owner_funds": true and expanded transactions, the response has a field owner_funds in the metaData object of each OfferCreate-type transaction. The purpose of this field is to make it easier to track the funding status of offers with each new validated ledger. This field is defined slightly different than the version of this field in Order Book subscription streams:

+

If the request specified "owner_funds": true and expanded transactions, the response has a field owner_funds in the metaData object of each OfferCreate-type transaction. The purpose of this field is to make it easier to track the funding status of offers with each new validated ledger. This field is defined slightly differently than the version of this field in Order Book subscription streams:

diff --git a/reference-transaction-format.html b/reference-transaction-format.html index 90cec060e6..8ebb78e606 100644 --- a/reference-transaction-format.html +++ b/reference-transaction-format.html @@ -2372,6 +2372,10 @@ + + + + @@ -2486,6 +2490,11 @@ + + + + + @@ -2523,7 +2532,12 @@ - + + + + + + diff --git a/tutorial-listing-xrp.html b/tutorial-listing-xrp.html index cd362f22c1..dec702b323 100644 --- a/tutorial-listing-xrp.html +++ b/tutorial-listing-xrp.html @@ -519,12 +519,12 @@ XRP Balances +
50,000
+
50,000
@@ -553,7 +553,7 @@ XRP Balances +
50,000
@@ -599,7 +599,7 @@ Off-Ledger Balances +
80,000
@@ -624,7 +624,7 @@ Off-Ledger Balances +
100,000
@@ -690,7 +690,7 @@ Off-Ledger Balances +
55,000
@@ -717,12 +717,12 @@ Off-Ledger Balances +
75,000
+
25,000
When trying to apply the transaction, the server entered an unexpected state. If you can reproduce this error, please report an issue to get it fixed.
tefINVARIANT_FAILEDAn invariant check failed when trying to claim the transaction cost. Requires the EnforceInvariants amendment. If you can reproduce this error, please report an issue.
tefMASTER_DISABLED The transaction was signed with the account's master key, but the account has the lsfDisableMaster field set.
Unspecified failure, with transaction cost destroyed.
tecCRYPTOCONDITION_ERROR146This EscrowCreate or EscrowFinish transaction contained a malformed or mismatched crypto-condition.
tecDIR_FULL 121 The address sending the transaction cannot own any more objects in the ledger.
tecINTERNAL 144Unspecified internal error, with transaction cost applied. This error code should not normally be returned.Unspecified internal error, with transaction cost applied. This error code should not normally be returned. If you can reproduce this error, please report an issue.
tecINVARIANT_FAILEDAn invariant check failed when trying to execute this transaction. Requires the EnforceInvariants amendment. If you can reproduce this error, please report an issue.
tecNEED_MASTER_KEY
Charlie 100,000 -
50,000
789 Charlie 0 -
50,000
Alpha Cold 0 -
50,000
Hot 0 -
80,000
456 Cold 180,000 -
100,000
Hot 80,000 -
55,000
Edward
Charlie RCL 50,000 -
75,000
789 Charlie 50,000 -
25,000
Cold 100,000