Skip to content

Commit 776d0ff

Browse files
committed
fix: formatting for guide 2
1 parent 7879792 commit 776d0ff

File tree

2 files changed

+87
-93
lines changed

2 files changed

+87
-93
lines changed

develop/interoperability/versions/v5/asset-claimer.md

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -30,64 +30,59 @@ XcmV5Instruction.SetHints({
3030

3131
## How it Improves the Situation
3232

33-
### Before XCM V5
34-
35-
```typescript
36-
// If this XCM fails, assets become trapped
37-
const riskyXcm = [
38-
XcmInstruction.WithdrawAsset([assets]),
39-
XcmInstruction.BuyExecution({ fees, weight_limit }),
40-
XcmInstruction.Transact({ /* risky call */ }),
41-
XcmInstruction.DepositAsset({ assets, beneficiary })
42-
]
43-
44-
// Recovery required governance intervention
45-
```
46-
47-
### With XCM V5
48-
49-
```typescript
50-
// Proactive asset claimer setup
51-
const saferXcm = [
52-
// Anyone can now claim if execution fails
53-
XcmV5Instruction.SetHints({
54-
hints: [Enum('AssetClaimer', claimerLocation)]
55-
}),
56-
XcmV5Instruction.WithdrawAsset([assets]),
57-
XcmV5Instruction.PayFees({ asset }),
58-
XcmV5Instruction.Transact({ /* risky call */ }),
59-
XcmV5Instruction.DepositAsset({ assets, beneficiary })
60-
]
61-
62-
// Recovery can be done immediately by the claimer
63-
```
33+
The `AssetClaimer` hint transforms the recovery process by allowing proactive designation of claimers, eliminating the need for governance intervention in most cases.
34+
35+
- **Before XCM V5:**
36+
37+
```typescript
38+
// If this XCM fails, assets become trapped
39+
const riskyXcm = [
40+
XcmInstruction.WithdrawAsset([assets]),
41+
XcmInstruction.BuyExecution({ fees, weight_limit }),
42+
XcmInstruction.Transact({ /* risky call */ }),
43+
XcmInstruction.DepositAsset({ assets, beneficiary })
44+
]
45+
46+
// Recovery required governance intervention
47+
```
48+
49+
- **With XCM V5:**
50+
51+
```typescript
52+
// Proactive asset claimer setup
53+
const saferXcm = [
54+
// Anyone can now claim if execution fails
55+
XcmV5Instruction.SetHints({
56+
hints: [Enum('AssetClaimer', claimerLocation)]
57+
}),
58+
XcmV5Instruction.WithdrawAsset([assets]),
59+
XcmV5Instruction.PayFees({ asset }),
60+
XcmV5Instruction.Transact({ /* risky call */ }),
61+
XcmV5Instruction.DepositAsset({ assets, beneficiary })
62+
]
63+
64+
// Recovery can be done immediately by the claimer
65+
```
6466

6567
## Key Improvements
6668

67-
### Immediate Recovery
68-
69-
- **Before**: Wait for governance process (weeks/months).
70-
- **After**: Designated claimer can act immediately.
71-
72-
### Reduced Governance Burden
73-
74-
- **Before**: Every trapped asset required a governance proposal.
75-
- **After**: Only complex cases need governance intervention.
76-
77-
### Predictable Recovery
69+
The `AssetClaimer` hint addresses several critical pain points in trapped asset recovery, transforming the process from governance-dependent to user-controlled.
7870

79-
- **Before**: Uncertain if governance would approve recovery
80-
- **After**: Predetermined claimer provides certainty
81-
82-
### Lower Barriers
83-
84-
- **Before**: Small amounts often not worth governance overhead.
85-
- **After**: Any amount can be efficiently recovered.
71+
| Feature | Before XCM V5 | After XCM V5 |
72+
| :-----: | :-----------: | :----------: |
73+
| **Recovery Speed** | Wait for governance process (weeks/months) | Designated claimer can act immediately |
74+
| **Governance Burden** | Every trapped asset required a governance proposal | Only complex cases need governance intervention |
75+
| **Recovery Predictability** | Uncertain if governance would approve recovery | Predetermined claimer provides certainty |
76+
| **Accessibility** | Small amounts often not worth governance overhead | Any amount can be efficiently recovered |
8677

8778
## Best Practices
8879

80+
Following these best practices ensures effective use of the `AssetClaimer` hint and maximizes the benefits of automated asset recovery.
81+
8982
### Set Hint Early
9083

84+
Always set the asset claimer hint before any operations that might fail, ensuring trapped assets can be recovered immediately without governance intervention.
85+
9186
```typescript
9287
// Set claimer hint before any risky operations
9388
XcmV5Instruction.SetHints({ hints: [Enum('AssetClaimer', claimerLocation)] }),
@@ -117,6 +112,8 @@ When origin preservation is available, trapped assets are automatically associat
117112

118113
## Migration Impact
119114

115+
The introduction of the `AssetClaimer` hint represents a significant improvement in XCM's fault tolerance and user experience, making cross-chain operations safer and more predictable.
116+
120117
This change makes XCM programs more resilient and user-friendly:
121118

122119
- **Reduced risk**: Assets are less likely to be permanently lost.

llms.txt

Lines changed: 41 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,64 +1820,59 @@ XcmV5Instruction.SetHints({
18201820

18211821
## How it Improves the Situation
18221822

1823-
### Before XCM V5
1823+
The `AssetClaimer` hint transforms the recovery process by allowing proactive designation of claimers, eliminating the need for governance intervention in most cases.
18241824

1825-
```typescript
1826-
// If this XCM fails, assets become trapped
1827-
const riskyXcm = [
1828-
XcmInstruction.WithdrawAsset([assets]),
1829-
XcmInstruction.BuyExecution({ fees, weight_limit }),
1830-
XcmInstruction.Transact({ /* risky call */ }),
1831-
XcmInstruction.DepositAsset({ assets, beneficiary })
1832-
]
1833-
1834-
// Recovery required governance intervention
1835-
```
1825+
- **Before XCM V5:**
18361826

1837-
### With XCM V5
1838-
1839-
```typescript
1840-
// Proactive asset claimer setup
1841-
const saferXcm = [
1842-
// Anyone can now claim if execution fails
1843-
XcmV5Instruction.SetHints({
1844-
hints: [Enum('AssetClaimer', claimerLocation)]
1845-
}),
1846-
XcmV5Instruction.WithdrawAsset([assets]),
1847-
XcmV5Instruction.PayFees({ asset }),
1848-
XcmV5Instruction.Transact({ /* risky call */ }),
1849-
XcmV5Instruction.DepositAsset({ assets, beneficiary })
1850-
]
1851-
1852-
// Recovery can be done immediately by the claimer
1853-
```
1854-
1855-
## Key Improvements
1856-
1857-
### Immediate Recovery
1827+
```typescript
1828+
// If this XCM fails, assets become trapped
1829+
const riskyXcm = [
1830+
XcmInstruction.WithdrawAsset([assets]),
1831+
XcmInstruction.BuyExecution({ fees, weight_limit }),
1832+
XcmInstruction.Transact({ /* risky call */ }),
1833+
XcmInstruction.DepositAsset({ assets, beneficiary })
1834+
]
18581835

1859-
- **Before**: Wait for governance process (weeks/months).
1860-
- **After**: Designated claimer can act immediately.
1836+
// Recovery required governance intervention
1837+
```
18611838

1862-
### Reduced Governance Burden
1839+
- **With XCM V5:**
18631840

1864-
- **Before**: Every trapped asset required a governance proposal.
1865-
- **After**: Only complex cases need governance intervention.
1841+
```typescript
1842+
// Proactive asset claimer setup
1843+
const saferXcm = [
1844+
// Anyone can now claim if execution fails
1845+
XcmV5Instruction.SetHints({
1846+
hints: [Enum('AssetClaimer', claimerLocation)]
1847+
}),
1848+
XcmV5Instruction.WithdrawAsset([assets]),
1849+
XcmV5Instruction.PayFees({ asset }),
1850+
XcmV5Instruction.Transact({ /* risky call */ }),
1851+
XcmV5Instruction.DepositAsset({ assets, beneficiary })
1852+
]
18661853

1867-
### Predictable Recovery
1854+
// Recovery can be done immediately by the claimer
1855+
```
18681856

1869-
- **Before**: Uncertain if governance would approve recovery
1870-
- **After**: Predetermined claimer provides certainty
1857+
## Key Improvements
18711858

1872-
### Lower Barriers
1859+
The `AssetClaimer` hint addresses several critical pain points in trapped asset recovery, transforming the process from governance-dependent to user-controlled.
18731860

1874-
- **Before**: Small amounts often not worth governance overhead.
1875-
- **After**: Any amount can be efficiently recovered.
1861+
| Feature | Before XCM V5 | After XCM V5 |
1862+
| :-----: | :-----------: | :----------: |
1863+
| **Recovery Speed** | Wait for governance process (weeks/months) | Designated claimer can act immediately |
1864+
| **Governance Burden** | Every trapped asset required a governance proposal | Only complex cases need governance intervention |
1865+
| **Recovery Predictability** | Uncertain if governance would approve recovery | Predetermined claimer provides certainty |
1866+
| **Accessibility** | Small amounts often not worth governance overhead | Any amount can be efficiently recovered |
18761867

18771868
## Best Practices
18781869

1870+
Following these best practices ensures effective use of the `AssetClaimer` hint and maximizes the benefits of automated asset recovery.
1871+
18791872
### Set Hint Early
18801873

1874+
Always set the asset claimer hint before any operations that might fail, ensuring trapped assets can be recovered immediately without governance intervention.
1875+
18811876
```typescript
18821877
// Set claimer hint before any risky operations
18831878
XcmV5Instruction.SetHints({ hints: [Enum('AssetClaimer', claimerLocation)] }),
@@ -1907,6 +1902,8 @@ When origin preservation is available, trapped assets are automatically associat
19071902

19081903
## Migration Impact
19091904

1905+
The introduction of the `AssetClaimer` hint represents a significant improvement in XCM's fault tolerance and user experience, making cross-chain operations safer and more predictable.
1906+
19101907
This change makes XCM programs more resilient and user-friendly:
19111908

19121909
- **Reduced risk**: Assets are less likely to be permanently lost.

0 commit comments

Comments
 (0)