Skip to content

Commit 0a9e70c

Browse files
authored
add a Flags section (#424)
1 parent eefdafa commit 0a9e70c

File tree

2 files changed

+62
-26
lines changed

2 files changed

+62
-26
lines changed

AMENDMENT_TEMPLATE.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,23 @@ _[Add more rows as needed for your specific fields. Remove example custom fields
6969

7070
_[Detailed explanation of field behavior, validation rules, etc.]_
7171

72-
### 2.3. Ownership
72+
### 2.3. Flags
73+
74+
\_[Describe any ledger entry-specific flags. The values must be powers of 2. If there are none, you can omit this section.]
75+
76+
| Flag Name | Flag Value | Description |
77+
| ---------------- | ------------ | ---------------- |
78+
| `[lsfFlagName1]` | `0x[Value1]` | `[Description1]` |
79+
80+
### 2.4. Ownership
7381

7482
_[Specify which AccountRoot object owns this ledger entry and how the ownership relationship is established.]_
7583

7684
**Owner:** `[Account field name or "No owner" if this is a global object like FeeSettings]`
7785

7886
**Directory Registration:** `[Describe how this object is registered in the owner's directory, or specify if it's a special case]`
7987

80-
### 2.4. Reserves
88+
### 2.5. Reserves
8189

8290
**Reserve Requirement:** `[Standard/Custom/None]`
8391

@@ -87,7 +95,7 @@ _[If Custom]: This ledger entry requires `[X]` reserve units because `[reason]`.
8795

8896
_[If None]: This ledger entry does not require additional reserves because `[reason]`._
8997

90-
### 2.5. Deletion
98+
### 2.6. Deletion
9199

92100
**Deletion Transactions:** `[List transaction types that can delete this object]`
93101

@@ -101,7 +109,7 @@ _[If None]: This ledger entry does not require additional reserves because `[rea
101109
_[If Yes]: This object must be deleted before its owner account can be deleted._
102110
_[If No]: This object does not prevent its owner account from being deleted._
103111

104-
### 2.6. Pseudo-Account _(Optional)_
112+
### 2.7. Pseudo-Account _(Optional)_
105113

106114
_[Only include this section if your ledger entry uses a pseudo-account. Otherwise, delete this subsection.]_
107115

@@ -113,7 +121,7 @@ _[If Yes]:_
113121
- **AccountID Derivation:** `[Describe the algorithm for deriving the pseudo-account's AccountID]`
114122
- **Capabilities:** `[List what the pseudo-account can/cannot do]`
115123

116-
### 2.7. Freeze/Lock _(Optional)_
124+
### 2.8. Freeze/Lock _(Optional)_
117125

118126
_[Only include this section if your ledger entry holds assets that can be frozen/locked. Otherwise, delete this subsection.]_
119127

@@ -122,21 +130,21 @@ _[Only include this section if your ledger entry holds assets that can be frozen
122130

123131
_[If applicable, describe how freeze/lock functionality is implemented for assets held by this object]_
124132

125-
### 2.8. Invariants
133+
### 2.9. Invariants
126134

127135
_[List logical statements that must always be true for this ledger entry. Use `<object>` for before-state and `<object>'` for after-state.]_
128136

129137
- `[Invariant 1, e.g., "<object>.Balance >= 0 AND <object>'.Balance >= 0"]`
130138
- `[Invariant 2, e.g., "IF <object>.Status == 'Active' THEN <object>.Account != NULL"]`
131139
- `[Additional invariants as needed]`
132140

133-
### 2.9. RPC Name
141+
### 2.10. RPC Name
134142

135143
**RPC Type Name:** `[snake_case_name]`
136144

137145
_[This is the name used in `account_objects` and `ledger_data` RPC calls to filter for this object type]_
138146

139-
### 2.10. Example JSON
147+
### 2.11. Example JSON
140148

141149
```json
142150
{
@@ -178,15 +186,23 @@ _[Add more rows as needed for your specific fields. Remove example custom fields
178186

179187
_[Detailed explanation of field behavior, validation rules, etc.]_
180188

181-
### 3.2. Transaction Fee
189+
### 3.2. Flags
190+
191+
\_[Describe any transaction-specific flags. The values must be powers of 2. If there are none, you can omit this section.]
192+
193+
| Flag Name | Flag Value | Description |
194+
| --------------- | ------------ | ---------------- |
195+
| `[tfFlagName1]` | `0x[Value1]` | `[Description1]` |
196+
197+
### 3.3. Transaction Fee
182198

183199
**Fee Structure:** `[Standard/Custom]`
184200

185201
_[If Standard]: This transaction uses the standard transaction fee (currently 10 drops, subject to Fee Voting changes)._
186202

187203
_[If Custom]: This transaction requires `[X]` drops because `[reason]`._
188204

189-
### 3.3. Failure Conditions
205+
### 3.4. Failure Conditions
190206

191207
_[List all conditions that cause the transaction to fail, with corresponding error codes]_
192208

@@ -196,7 +212,7 @@ _[List all conditions that cause the transaction to fail, with corresponding err
196212

197213
_[For new error codes, provide justification for why existing codes are insufficient]_
198214

199-
### 3.4. State Changes
215+
### 3.5. State Changes
200216

201217
_[Describe the ledger state changes when the transaction executes successfully. Omit standard changes like fee processing and sequence increment.]_
202218

@@ -206,15 +222,15 @@ _[Describe the ledger state changes when the transaction executes successfully.
206222
- `[State change 2, e.g., "Update Account's OwnerCount"]`
207223
- `[Additional changes as needed]`
208224

209-
### 3.5. Metadata Fields _(Optional)_
225+
### 3.6. Metadata Fields _(Optional)_
210226

211227
_[Only include this section if the transaction adds or modifies metadata fields. Otherwise, delete this subsection.]_
212228

213229
| Field Name | Validated | Always Present? | Type | Description |
214230
| -------------- | ---------- | ---------------------- | ------------------------------ | --------------- |
215231
| `[field_name]` | `[Yes/No]` | `[Yes/No/Conditional]` | `[string/number/object/array]` | `[Description]` |
216232

217-
### 3.6. Example JSON
233+
### 3.7. Example JSON
218234

219235
```json
220236
{

XLS-0001-xls-process/README.md

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -211,41 +211,51 @@ These columns must all be included in the table:
211211

212212
The table may be followed by subsections for fields requiring further details that are too long for the Description column.
213213

214-
##### 4.4.3.2.3. Ownership
214+
##### 4.4.3.2.3. Flags
215+
216+
This subsection describes all the ledger entry `lsf` flags in a tabular format.
217+
218+
These columns must all be included in the table:
219+
220+
- **Flag Name**: The column indicates the flag's name. Flags follow the `lsfPascalCase` naming convention.
221+
- **Flag Value**: The column indicates the flag's value. Flag values are powers of 2 expressed as 32-bit integers, written in hexadecimal with a `0x` prefix (e.g., `0x00010000`).
222+
- **Description**: A brief description of the flag. Further details can be written in a subsection of **Flags**.
223+
224+
##### 4.4.3.2.4. Ownership
215225

216226
All XRP Ledger objects must have an owner. The owner is an `AccountRoot` object, and the ownership relationship is typically established by adding the object's ID to an `OwnerDirectory` ledger entry associated with the owner's account. This subsection captures which `AccountRoot` object's `OwnerDirectory` the ledger entry is registered. A single ledger entry may be linked from one or more unique `DirectoryNode` pages, usually under one `OwnerDirectory`.
217227

218228
_Note: there are a handful of object types (such as `FeeSettings`) that don’t have an owner. If an amendment is of that ilk, that should be specified in this section._
219229

220-
##### 4.4.3.2.4. Reserves
230+
##### 4.4.3.2.5. Reserves
221231

222232
Creating ledger entries typically requires an increase in the owner's XRP reserve to discourage ledger bloat and account for the cost of storage. Each new ledger entry directly owned by an account typically increments the owner reserve by one unit (currently 0.2 XRP, as of last check, but subject to change by [Fee Voting](https://xrpl.org/docs/concepts/consensus-protocol/fee-voting)). This section should confirm whether this standard behavior applies or specify any deviations.
223233

224-
##### 4.4.3.2.5. Deletion
234+
##### 4.4.3.2.6. Deletion
225235

226236
This subsection captures the conditions under which the ledger entry can be deleted from the ledger. It should specify:
227237

228238
- What transaction(s) can delete the object.
229239
- Any prerequisite conditions for deletion (e.g., object state, zero balances, no linked objects).
230240
- Is the ledger entry a "blocker" for deleting its owner `AccountRoot` (i.e., whether it must be deleted before the account can be deleted).
231241

232-
##### 4.4.3.2.6. Pseudo-Account
242+
##### 4.4.3.2.7. Pseudo-Account
233243

234244
This section is optional. A "pseudo-account" might be associated if the newly introduced ledger entry needs to hold assets (XRP, IOUs or MPTs) or issue tokens (e.g., MPTs). A pseudo-account is a programmatically derived `Account` that cannot submit transactions, send or receive funds directly via standard payments, or have a key pair. For further details about pseudo-accounts, refer to [XLS-64](https://github.com/XRPLF/XRPL-Standards/pull/274) (or the relevant accepted standard). This section should specify if a pseudo-account is used, how its `AccountID` is derived, and its purpose.
235245

236-
##### 4.4.3.2.7. Freeze/Lock
246+
##### 4.4.3.2.8. Freeze/Lock
237247

238248
This section is optional. If the protocol holds assets on behalf of other users, it must comply with the existing compliance features `Freeze`, `Deep Freeze` for IOUs and `Locking` for MPTs. This section describes how said freezing is handled.
239249

240-
##### 4.4.3.2.8. Invariants
250+
##### 4.4.3.2.9. Invariants
241251

242252
Invariants are logical statements that MUST be true of a ledger entry's state before and after the execution of any transaction (whether successful or not). They help ensure that no transaction leads to an invalid or inconsistent ledger state. Use `<object>` for the state before and `<object>'` (see the added grave) for the state after.
243253

244-
##### 4.4.3.2.9. RPC Name
254+
##### 4.4.3.2.10. RPC Name
245255

246256
In RPCs like `account_objects` and `ledger_data`, a short, `snake_case` form of the name of a ledger entry is accepted in the `type` parameter, to filter the ledger entries returned by type. This section should specify that version of the entry's name.
247257

248-
##### 4.4.3.2.10. Example JSON
258+
##### 4.4.3.2.11. Example JSON
249259

250260
Provide JSON examples for what the ledger object will look like.
251261

@@ -278,11 +288,21 @@ The following columns should be included:
278288
- **Default Value**: If any. `N/A` if none or always required.
279289
- **Description**: Succinct description of the field.
280290

281-
##### 4.4.3.3.2. Transaction Fee
291+
##### 4.4.3.3.2. Flags
292+
293+
This subsection describes all the ledger entry `tf` flags in a tabular format.
294+
295+
These columns must all be included in the table:
296+
297+
- **Flag Name**: The column indicates the flag's name. Flags follow the `tfPascalCase` naming convention.
298+
- **Flag Value**: The column indicates the flag's value. Flag values are powers of 2 expressed as 32-bit integers, written in hexadecimal with a `0x` prefix (e.g., `0x00010000`).
299+
- **Description**: A brief description of the flag. Further details can be written in a subsection of **Flags**.
300+
301+
##### 4.4.3.3.3. Transaction Fee
282302

283303
Submitting a transaction typically requires paying a transaction fee. A typical transaction costs 10 drops as of last check (subject to change by [Fee Voting](https://xrpl.org/docs/concepts/consensus-protocol/fee-voting)). This section should confirm whether this standard behavior applies or specify any deviations.
284304

285-
##### 4.4.3.3.3. Failure Conditions
305+
##### 4.4.3.3.4. Failure Conditions
286306

287307
This section describes the conditions under which the transaction will fail. This must be an exhaustive, descriptive list. Each condition should ideally map to a specific error code. The list should be indexed for easy reference.
288308

@@ -292,11 +312,11 @@ In case of a transaction failure, an XRP Ledger server returns an error code ind
292312

293313
If the new transaction logic introduces novel failure reasons not adequately covered by existing generic codes, a new error code (usually a `tec` code) should be proposed. This new code must be clearly defined and justified and would eventually be added to [rippled](https://github.com/XRPLF/rippled/blob/develop/include/xrpl/protocol/TER.h) if the XLS is adopted. XLS authors will primarily define error codes for their specific transaction logic failures.
294314

295-
##### 4.4.3.3.4. State Changes
315+
##### 4.4.3.3.5. State Changes
296316

297317
This section describes the changes made to the ledger state if the transaction executes successfully. It should omit default state changes common to all transactions (e.g., fee processing, sequence number increment, setting `PreviousTxnID`/`PreviousTxnLgrSeq` on modified objects). Indexed for clarity. A successfully applied transaction must return a `tesSUCCESS` code.
298318

299-
##### 4.4.3.3.5. Metadata Fields
319+
##### 4.4.3.3.6. Metadata Fields
300320

301321
This section describes any additions or modifications (synthetic or otherwise) to the transaction metadata. This section must not be included if the transaction does not make any such additions or modifications.
302322

@@ -311,7 +331,7 @@ The following columns should be included in the table:
311331
- **Type**: If the field is synthetic, this should specify the The JSON type of the field (e.g., `string`, `number`, `object`, `array`).
312332
- **Description**: Succinct description of the field.
313333

314-
##### 4.4.3.3.6. Example JSON
334+
##### 4.4.3.3.7. Example JSON
315335

316336
Provide JSON examples for transaction submission.
317337

0 commit comments

Comments
 (0)