Skip to content

Commit f720978

Browse files
authored
Merge branch 'master' into xls-56-cleanup
2 parents 4da9185 + f66701b commit f720978

File tree

4 files changed

+46
-15
lines changed

4 files changed

+46
-15
lines changed

.github/scripts/assign_xls_number.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def find_draft_xls_files(changed_files: list[str]) -> list[str]:
6363
Returns:
6464
List of draft XLS directory names (e.g., ["XLS-draft-my-feature"])
6565
"""
66-
draft_pattern = re.compile(r"^(XLS-draft-[^/]+)/README\.md$")
66+
draft_pattern = re.compile(r"^((XLS|xls)-draft[^/]+)/README\.md$")
6767
drafts = []
6868

6969
for file_path in changed_files:

.github/workflows/assign-xls-number.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,49 @@
11
name: Assign XLS Number
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize, reopened]
4+
pull_request_target:
5+
types: [opened, synchronize, reopened, ready_for_review]
66

77
jobs:
88
assign-xls-number:
99
runs-on: ubuntu-latest
1010
name: Assign XLS Number to Draft
1111
permissions:
1212
pull-requests: write
13+
issues: write
1314
contents: read
1415

1516
steps:
1617
- name: Checkout repository
1718
uses: actions/checkout@v6
1819
with:
1920
fetch-depth: 0
21+
ref: ${{ github.event.pull_request.head.sha }}
22+
23+
- name: Checkout script from base branch
24+
uses: actions/checkout@v6
25+
with:
26+
ref: ${{ github.event.pull_request.base.ref }}
27+
sparse-checkout: |
28+
.github/scripts/assign_xls_number.py
29+
sparse-checkout-cone-mode: false
30+
path: base-repo
2031

2132
- name: Get added files
2233
id: added-files
2334
uses: tj-actions/changed-files@v47
2435
with:
2536
files: |
26-
XLS-draft-*/README.md
37+
XLS-draft*/README.md
38+
xls-draft*/README.md
2739
# Only look at added files, not modified ones
2840
include_all_old_new_renamed_files: false
2941

3042
- name: Check for draft XLS files
3143
id: check-drafts
3244
run: |
3345
ADDED_FILES="${{ steps.added-files.outputs.added_files }}"
46+
echo $ADDED_FILES
3447
if [ -z "$ADDED_FILES" ]; then
3548
echo "No XLS draft files added in this PR"
3649
echo "has_drafts=false" >> $GITHUB_OUTPUT
@@ -50,7 +63,8 @@ jobs:
5063
if: steps.check-drafts.outputs.has_drafts == 'true'
5164
id: assign-number
5265
run: |
53-
python .github/scripts/assign_xls_number.py ${{ steps.check-drafts.outputs.draft_files }}
66+
echo ${{ steps.check-drafts.outputs.draft_files }}
67+
python base-repo/.github/scripts/assign_xls_number.py ${{ steps.check-drafts.outputs.draft_files }}
5468
5569
- name: Check for existing assignment comment
5670
if: steps.check-drafts.outputs.has_drafts == 'true'

XLS-0001-xls-process/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,17 +305,20 @@ Submitting a transaction typically requires paying a transaction fee. A typical
305305

306306
###### 4.4.3.3.4. Failure Conditions
307307

308-
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.
308+
This section describes all conditions under which the transaction will fail. Each condition must map to a specific error code. The list must be exhaustive, descriptive, and indexed for easy reference.
309309

310-
When using the same transaction to create and update an object, the expected behavior is identified by the presence or absence of the object identifier (e.g., `tx.ExampleID`).
310+
Failure conditions are grouped into two categories:
311+
312+
- Data validation failures: Return a `tem` code
313+
- Protocol-level failures: Return `tec` codes. With rare exceptions they may return a `ter`, `tef`, or `tel` code. If another error code must be returned, justification must be provided.
311314

312315
In case of a transaction failure, an XRP Ledger server returns an error code indicating the outcome. These codes are crucial for clients to understand why a transaction was not successful. Please refer to the [documentation](https://xrpl.org/docs/references/protocol/transactions/transaction-results) for existing error codes. When defining failure conditions for a new transaction type in an XLS, reuse existing codes whenever an existing code accurately describes the failure condition. This helps maintain consistency and avoids unnecessary proliferation of codes.
313316

314317
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.
315318

316319
###### 4.4.3.3.5. State Changes
317320

318-
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.
321+
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). The list must be exhaustive, descriptive, and indexed for easy reference. When using the same transaction to create and update an object, the expected behavior is identified by the presence or absence of the object identifier (e.g., `tx.ExampleID`). A successfully applied transaction must return a `tesSUCCESS` code.
319322

320323
###### 4.4.3.3.6. Metadata Fields
321324

templates/AMENDMENT_TEMPLATE.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,23 @@ _[If Custom]: This transaction requires `[X]` drops because `[reason]`._
222222

223223
### 3.4. Failure Conditions
224224

225-
_[List all conditions that cause the transaction to fail, with corresponding error codes]_
225+
_[An indexed list of all conditions that cause the transaction to fail, with corresponding error codes. Group failure conditions into two categories: data verification, invalid field values, protocol-level logic.]_
226226

227-
- `[Description of failure condition]` (`[ERROR_CODE]`)
228-
- `[Description of failure condition]` (`[ERROR_CODE]`)
229-
- `[Description of failure condition]` (`[ERROR_CODE]`)
227+
#### 3.4.1. Data Verification
228+
229+
[All Data Verification failures return a `tem` level error.]
230+
231+
1. `[Description of failure condition]` (`[ERROR_CODE]`)
232+
2. `[Description of failure condition]` (`[ERROR_CODE]`)
233+
3. `[Description of failure condition]` (`[ERROR_CODE]`)
234+
235+
#### 3.4.2. Protocol-Level Failures
236+
237+
_[Protocol-level failures return `tec` codes. With rare exceptions they may return a `ter`, `tef`, or `tel` code.]_
238+
239+
1. `[Description of failure condition]` (`[ERROR_CODE]`)
240+
2. `[Description of failure condition]` (`[ERROR_CODE]`)
241+
3. `[Description of failure condition]` (`[ERROR_CODE]`)
230242

231243
_[For new error codes, provide justification for why existing codes are insufficient]_
232244

@@ -297,9 +309,11 @@ _[If your specification introduces new APIs or modifies existing ones, document
297309

298310
### 5.3. Failure Conditions
299311

300-
- `[Description of failure condition]` (`[ERROR_CODE]`)
301-
- `[Description of failure condition]` (`[ERROR_CODE]`)
302-
- `[Description of failure condition]` (`[ERROR_CODE]`)
312+
_[An indexed list of RPC error codes.]_
313+
314+
1. `[Description of failure condition]` (`[ERROR_CODE]`)
315+
2. `[Description of failure condition]` (`[ERROR_CODE]`)
316+
3. `[Description of failure condition]` (`[ERROR_CODE]`)
303317

304318
### 5.4. Example Request
305319

0 commit comments

Comments
 (0)