Skip to content

Commit 8797cf4

Browse files
committed
Merge branch 'server_defs' of https://github.com/ckeshava/XRPL-Standards into server_defs
2 parents fde5dc3 + f3e0f47 commit 8797cf4

File tree

13 files changed

+3766
-25
lines changed

13 files changed

+3766
-25
lines changed

.github/scripts/assign_xls_number.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,15 @@ def find_draft_xls_files(changed_files: list[str]) -> list[str]:
7676

7777
def main():
7878
"""Main entry point for the script."""
79-
# Get repository root (parent of .github directory)
80-
script_dir = Path(__file__).resolve().parent
81-
repo_root = script_dir.parent.parent
79+
# Get repository root from environment variable (set by GitHub Actions)
80+
# or fall back to calculating from script location
81+
repo_root_env = os.environ.get("REPO_ROOT")
82+
if repo_root_env:
83+
repo_root = Path(repo_root_env)
84+
else:
85+
# Fallback: parent of .github directory
86+
script_dir = Path(__file__).resolve().parent
87+
repo_root = script_dir.parent.parent
8288

8389
# Get changed files from command line arguments or environment variable
8490
if len(sys.argv) > 1:

.github/scripts/filter-discussions-to-close.jq

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# 1. It has a warning comment containing the unique marker
44
# 2. That warning comment was posted by the bot
55
# 3. That warning comment is older than WARNING_DAYS
6-
# 4. The discussion hasn't been updated since the warning (or updates are also old)
6+
# 4. There are no comments from non-bot users after the warning
77
#
88
# Input: GraphQL response with discussions data
99
# Arguments:
@@ -39,8 +39,20 @@
3939
# Only proceed if the warning comment is old enough
4040
| select($warningComment.createdAt <= $warningCutoff)
4141

42-
# Only proceed if the discussion hasn't been updated since the warning
43-
| select($discussion.updatedAt < $warningComment.createdAt)
42+
# Check if there are any comments from non-bot users after the warning
43+
# Note: We can't rely on updatedAt because the bot's warning comment itself
44+
# updates the discussion's updatedAt timestamp
45+
| (
46+
(.comments.nodes // [])
47+
| map(
48+
select(.createdAt > $warningComment.createdAt)
49+
| select(.author.login != $botLogin)
50+
)
51+
| length
52+
) as $nonBotCommentsAfterWarning
53+
54+
# Only proceed if there are no comments from non-bot users after the warning
55+
| select($nonBotCommentsAfterWarning == 0)
4456

4557
# Output as JSON
4658
| @json

.github/scripts/process-stale-discussions.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,11 @@ echo ""
131131
echo "Bot login: $BOT_LOGIN"
132132

133133
# Verify bot login is accessible
134-
if ! BOT_INFO=$(gh api /users/$BOT_LOGIN 2>&1); then
135-
echo "Warning: Could not verify bot user '$BOT_LOGIN'" >&2
134+
# Note: The REST API uses the [bot] suffix for GitHub App bots, while the GraphQL API
135+
# returns author.login without the suffix. We verify using the [bot] suffix.
136+
BOT_LOGIN_FOR_REST="${BOT_LOGIN}[bot]"
137+
if ! BOT_INFO=$(gh api "/users/$BOT_LOGIN_FOR_REST" 2>&1); then
138+
echo "Warning: Could not verify bot user '$BOT_LOGIN_FOR_REST'" >&2
136139
echo "The script will continue, but make sure BOT_LOGIN is correct." >&2
137140
echo "API Response: $BOT_INFO" >&2
138141
else

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ jobs:
6262
- name: Assign XLS number
6363
if: steps.check-drafts.outputs.has_drafts == 'true'
6464
id: assign-number
65+
env:
66+
REPO_ROOT: ${{ github.workspace }}
6567
run: |
6668
echo ${{ steps.check-drafts.outputs.draft_files }}
6769
python base-repo/.github/scripts/assign_xls_number.py ${{ steps.check-drafts.outputs.draft_files }}

.github/workflows/discussions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- name: Fetch and process stale discussions
4343
env:
4444
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
45-
BOT_LOGIN: ${{ steps.generate_token.outputs.app-slug }}[bot]
45+
BOT_LOGIN: ${{ steps.generate_token.outputs.app-slug }}
4646
STALE_DAYS: ${{ env.STALE_DAYS }}
4747
WARNING_DAYS: ${{ env.WARNING_DAYS }}
4848
WARNING_MESSAGE: ${{ env.WARNING_MESSAGE }}

XLS-0056-batch/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,39 @@ Namely:
565565
- Inner transactions may not be broadcast (and won't be accepted if they happen to be broadcast, e.g. from a malicious node). They must be generated from the `Batch` outer transaction instead.
566566
- Inner transactions may not be directly submitted via the `submit` RPC.
567567

568+
## 6. Integration Considerations
569+
570+
- An outer `Batch` transaction will return `tesSUCCESS` if the outer transaction succeeds, even if the inner transactions fail. The inner transaction metadata and result codes must be used to determine the actual outcome of each inner transaction.
571+
- The inner transactions, if validated, **will** be in the same ledger. If it is not in the same ledger, then it is likely a fraud attempt.
572+
- An inner `Batch` transaction will not be validated on its own.
573+
- Systems that don't specifically handle `Batch` transactions should be able to support them without any changes, since each inner transaction will be a valid transaction on its own.
574+
- All inner transactions that have a `tes` (success) or `tec` result code will be accessible via standard transaction-fetching mechanisms (such as `tx` and `account_tx`).
575+
- Since only the inner transactions and batch mode flags are signed in a multi-account `Batch` transaction, the relayer (submitter of the outer transaction) can adjust the sequence number and fee of the outer transaction as needed, without needing to coordinate with the other parties.
576+
577+
### 6.1. Client Libraries
578+
579+
- `Batch` transactions have a special fee calculation that includes the sum of the inner transaction fees. Client libraries should provide a helper method to calculate the fee for a `Batch` transaction.
580+
- Multi-account `Batch` transactions require a special signing flow where one party signs the outer transaction and the other parties sign the inner transactions. Client libraries should provide a helper method to construct a multi-account `Batch` transaction.
581+
- When auto-filling a `Batch` transaction, the inner transactions must have their `Fee` set to 0 and the `SigningPubKey` and `TxnSignature` fields must be empty. Client libraries should provide a helper method to auto-fill a `Batch` transaction.
582+
583+
### 6.2. Wallets
584+
585+
Wallets should:
586+
587+
- Clearly display all inner transactions to users before requesting a signature, so users understand the full scope of what they are approving.
588+
- For multi-account `Batch` transactions, provide a workflow for users to review and sign their portion of the batch, then export it for other parties to sign.
589+
- Warn users if they are signing a `Batch` transaction that includes inner transactions from other accounts, as they are approving the entire batch.
590+
- Display the batch mode (`ALLORNOTHING`, `ONLYONE`, `UNTILFAILURE`, `INDEPENDENT`) and explain its implications.
591+
- Not auto-increment sequence numbers after successes/failures, since it depends on what/how many transactions are validated.
592+
593+
### 6.3. Explorers and Indexers
594+
595+
Explorers and indexers should:
596+
597+
- Display the relationship between outer `Batch` transactions and their inner transactions using the `ParentBatchID` field.
598+
- Show inner transactions in context with their parent `Batch` transaction, rather than as standalone transactions.
599+
- Consider grouping inner transactions with their outer transaction in transaction lists for clarity.
600+
568601
# Appendix
569602

570603
## Appendix A: FAQ

XLS-0065-single-asset-vault/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
## _Abstract_
1717

18-
A Single Asset Vault is a new on-chain primitive for aggregating assets from one or more depositors, and making the assets available for other on-chain protocols. The Single Asset Vault uses [Multi-Purpose-Token](https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0033-multi-purpose-tokens) to represent ownership shares of the Vault. The Vault serves diverse purposes, such as lending markets, aggregators, yield-bearing tokens, asset management, etc. The Single Asset Vault decouples the liquidity provision functionality from the specific protocol logic.
18+
A Single Asset Vault is a new on-chain primitive for aggregating assets from one or more depositors, and making the assets available for other on-chain protocols. The Single Asset Vault uses [Multi-Purpose-Token](../XLS-0033-multi-purpose-tokens/README.md) to represent ownership shares of the Vault. The Vault serves diverse purposes, such as lending markets, aggregators, yield-bearing tokens, asset management, etc. The Single Asset Vault decouples the liquidity provision functionality from the specific protocol logic.
1919

2020
## Index
2121

@@ -50,7 +50,7 @@ A Single Asset Vault is a new on-chain primitive for aggregating assets from one
5050

5151
### 1.1 Overview
5252

53-
The **Single Asset Vault** is an on-chain object that aggregates assets from one or more depositors and represents ownership through shares. Other protocols, such as the [Lending Protocol](https://github.com/XRPLF/XRPL-Standards/discussions/190), can access these assets via the vault, whether or not they generate yield. Currently, other protocols must be created by the same Account that created the Vault. However, this may change in the future.
53+
The **Single Asset Vault** is an on-chain object that aggregates assets from one or more depositors and represents ownership through shares. Other protocols, such as the [Lending Protocol](../XLS-0066-lending-protocol/README.md), can access these assets via the vault, whether or not they generate yield. Currently, other protocols must be created by the same Account that created the Vault. However, this may change in the future.
5454

5555
The specification introduces a new `Vault` ledger entry, which contains key details such as available assets, shares, total value, and other relevant information.
5656

@@ -77,17 +77,17 @@ A Single Asset Vault is owned and managed by an account called the **Vault Owner
7777

7878
#### 1.1.2 Access Control
7979

80-
A Single Asset Vault can be either public or private. Any depositor can deposit and redeem liquidity from a public vault, provided they own sufficient shares. In contrast, access to private shares is controlled via [Permissioned Domains](../XLS-0080-permissioned-domains/README.md), which use on-chain [Credentials](https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0070-credentials) to manage access to the vault. Only depositors with the necessary credentials can deposit assets to a private vault. To prevent Vault Owner from locking away depositor funds, any shareholder can withdraw funds. Furthermore, the Vault Owner has an implicit permission to deposit and withdraw assets to and from the Vault. I.e. they do not have to have credentials in the Permissioned Domain.
80+
A Single Asset Vault can be either public or private. Any depositor can deposit and redeem liquidity from a public vault, provided they own sufficient shares. In contrast, access to private shares is controlled via [Permissioned Domains](../XLS-0080-permissioned-domains/README.md), which use on-chain [Credentials](../XLS-0070-credentials/README.md) to manage access to the vault. Only depositors with the necessary credentials can deposit assets to a private vault. To prevent Vault Owner from locking away depositor funds, any shareholder can withdraw funds. Furthermore, the Vault Owner has an implicit permission to deposit and withdraw assets to and from the Vault. I.e. they do not have to have credentials in the Permissioned Domain.
8181

8282
#### 1.1.3 Yield Bearing Shares
8383

84-
Shares represent the ownership of a portion of the vault's assets. On-chain shares are represented by a [Multi-Purpose Token](https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0033-multi-purpose-tokens). When creating the vault, the Vault Owner can configure the shares to be non-transferable. Non-transferable shares cannot be transferred to any other account -- they can only be redeemed. If the vault is private, shares can be transferred and used in other DeFi protocols as long as the receiving account is authorized to hold the shares. The vault's shares may be yield-bearing, depending on the protocol connected to the vault, meaning that a holder may be able to withdraw more (or less) liquidity than they initially deposited.
84+
Shares represent the ownership of a portion of the vault's assets. On-chain shares are represented by a [Multi-Purpose Token](../XLS-0033-multi-purpose-tokens/README.md). When creating the vault, the Vault Owner can configure the shares to be non-transferable. Non-transferable shares cannot be transferred to any other account -- they can only be redeemed. If the vault is private, shares can be transferred and used in other DeFi protocols as long as the receiving account is authorized to hold the shares. The vault's shares may be yield-bearing, depending on the protocol connected to the vault, meaning that a holder may be able to withdraw more (or less) liquidity than they initially deposited.
8585

8686
### 1.2 Terminology
8787

8888
- **Vault**: A ledger entry for aggregating liquidity and providing this liquidity to one or more accessors.
89-
- **Asset**: The currency of a vault. It is either XRP, a [Fungible Token](https://xrpl.org/docs/concepts/tokens/fungible-tokens/) or a [Multi-Purpose Token](https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0033-multi-purpose-tokens).
90-
- **Share**: Shares represent the depositors' portion of the vault's assets. Shares are a [Multi-Purpose Token](https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0033-multi-purpose-tokens) created by the _pseudo-account_ of the vault.
89+
- **Asset**: The currency of a vault. It is either XRP, a [Fungible Token](https://xrpl.org/docs/concepts/tokens/fungible-tokens/) or a [Multi-Purpose Token](../XLS-0033-multi-purpose-tokens/README.md).
90+
- **Share**: Shares represent the depositors' portion of the vault's assets. Shares are a [Multi-Purpose Token](../XLS-0033-multi-purpose-tokens/README.md) created by the _pseudo-account_ of the vault.
9191

9292
### 1.3 Actors
9393

@@ -96,7 +96,7 @@ Shares represent the ownership of a portion of the vault's assets. On-chain shar
9696

9797
### 1.4 Connecting to the Vault
9898

99-
A protocol connecting to a Vault must track its debt. Furthermore, the updates to the Vault state when funds are removed or added back must be handled in the transactors of the protocol. For an example, please refer to the [Lending Protocol](https://github.com/XRPLF/XRPL-Standards/discussions/190) specification.
99+
A protocol connecting to a Vault must track its debt. Furthermore, the updates to the Vault state when funds are removed or added back must be handled in the transactors of the protocol. For an example, please refer to the [Lending Protocol](../XLS-0066-lending-protocol/README.md) specification.
100100

101101
[**Return to Index**](#index)
102102

@@ -164,7 +164,7 @@ The `Vault` object costs one reserve fee per object created:
164164

165165
#### 2.1.6 Vault Shares
166166

167-
Shares represent the portion of the Vault assets a depositor owns. Vault Owners set the currency code of the share and whether the token is transferable during the vault's creation. These two values are immutable. The share is represented by a [Multi-Purpose Token](https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0033-multi-purpose-tokens). The MPT is issued by the vault's pseudo-account.
167+
Shares represent the portion of the Vault assets a depositor owns. Vault Owners set the currency code of the share and whether the token is transferable during the vault's creation. These two values are immutable. The share is represented by a [Multi-Purpose Token](../XLS-0033-multi-purpose-tokens/README.md). The MPT is issued by the vault's pseudo-account.
168168

169169
##### 2.1.6.1 `Scale`
170170

@@ -215,7 +215,7 @@ The `MPToken` object represents the amount of shares held by a depositor. It is
215215

216216
###### 2.1.6.3.1 `MPToken` Values
217217

218-
The `MPToken` values should be set as per the `MPT` [specification](https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0033-multi-purpose-tokens#2112-fields).
218+
The `MPToken` values should be set as per the `MPT` [specification](../XLS-0033-multi-purpose-tokens/README.md#2112-fields).
219219

220220
| **Condition** | **Transferable** | **Non-Transferable** |
221221
| ----------------- | ------------------ | -------------------- |
@@ -344,7 +344,7 @@ The First Come, First Serve strategy treats all requests equally, allowing a dep
344344

345345
#### 2.1.8 Frozen Assets
346346

347-
The issuer of the Vaults asset may enact a freeze either through a [Global Freeze](https://xrpl.org/docs/concepts/tokens/fungible-tokens/freezes/#global-freeze) for IOUs or [locking MPT](https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0033-multi-purpose-tokens#21122-flags). When the vaults asset is frozen, it can only be withdrawn by specifying the `Destination` account as the `Issuer` of the asset. Similarly, a frozen asset _may not_ be deposited into a vault. Furthermore, when the asset of a vault is frozen, the shares corresponding to the asset may not be transferred.
347+
The issuer of the Vaults asset may enact a freeze either through a [Global Freeze](https://xrpl.org/docs/concepts/tokens/fungible-tokens/freezes/#global-freeze) for IOUs or [locking MPT](../XLS-0033-multi-purpose-tokens/README.md#21122-flags). When the vaults asset is frozen, it can only be withdrawn by specifying the `Destination` account as the `Issuer` of the asset. Similarly, a frozen asset _may not_ be deposited into a vault. Furthermore, when the asset of a vault is frozen, the shares corresponding to the asset may not be transferred.
348348

349349
#### 2.1.9 Transfer Fees
350350

0 commit comments

Comments
 (0)