Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 47 additions & 1 deletion docs/modules/ROOT/pages/stellar.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,53 @@ For more configuration examples, visit the link:https://github.com/OpenZeppelin/

=== Relayer Policies

Stellar relayers support standard relayer configuration options. Check all options in xref:index.adoc#3_relayers[User Documentation - Relayers].
Stellar relayers support standard relayer configuration options along with Stellar-specific policies:

[cols="1,1,1,2"]
|===
|Policy |Type |Default |Description

|`min_balance`
|integer
|None
|Minimum balance in stroops (1 XLM = 10,000,000 stroops) required for the relayer account

|`max_fee`
|integer
|None
|Maximum transaction fee in stroops the relayer is willing to pay

|`timeout_seconds`
|integer
|None
|Transaction timeout in seconds

|`concurrent_transactions`
|boolean
|false
|Enable concurrent transaction processing. When enabled, bypasses the lane gating mechanism that normally ensures sequential processing for each relayer. Only enable this when your relayer manages transactions from multiple accounts with independent sequence number pools.
|===

Example configuration with policies:
[source,json]
----
{
"id": "stellar-example",
"name": "Stellar Example",
"network": "testnet",
"paused": false,
"network_type": "stellar",
"signer_id": "local-signer",
"policies": {
"min_balance": 10000000,
"max_fee": 1000000,
"timeout_seconds": 30,
"concurrent_transactions": false
}
}
----

For general relayer configuration options, check xref:index.adoc#3_relayers[User Documentation - Relayers].

== API Reference

Expand Down
205 changes: 50 additions & 155 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3788,77 +3788,23 @@
"data": {
"oneOf": [
{
"allOf": [
{
"$ref": "#/components/schemas/SignTransactionResponseStellar"
},
{
"type": "object",
"required": [
"network"
],
"properties": {
"network": {
"type": "string",
"enum": [
"stellar"
]
}
}
}
]
"$ref": "#/components/schemas/SignTransactionResponseStellar"
},
{
"allOf": [
{
"type": "array",
"items": {
"type": "integer",
"format": "int32",
"minimum": 0
}
},
{
"type": "object",
"required": [
"network"
],
"properties": {
"network": {
"type": "string",
"enum": [
"evm"
]
}
}
}
]
"type": "array",
"items": {
"type": "integer",
"format": "int32",
"minimum": 0
}
},
{
"allOf": [
{
"type": "array",
"items": {
"type": "integer",
"format": "int32",
"minimum": 0
}
},
{
"type": "object",
"required": [
"network"
],
"properties": {
"network": {
"type": "string",
"enum": [
"solana"
]
}
}
}
]
"type": "array",
"items": {
"type": "integer",
"format": "int32",
"minimum": 0
}
}
]
},
Expand Down Expand Up @@ -6063,6 +6009,13 @@
"type": "object",
"description": "Stellar-specific relayer policy configuration",
"properties": {
"concurrent_transactions": {
"type": [
"boolean",
"null"
],
"description": "Allow concurrent transactions (essential for channel accounts using different accounts' sequence numbers)"
},
"max_fee": {
"type": [
"integer",
Expand Down Expand Up @@ -6125,9 +6078,13 @@
"type": "object",
"required": [
"transaction",
"signature"
"signature",
"id"
],
"properties": {
"id": {
"type": "string"
},
"signature": {
"type": "string"
},
Expand Down Expand Up @@ -6246,77 +6203,23 @@
"SignTransactionResponse": {
"oneOf": [
{
"allOf": [
{
"$ref": "#/components/schemas/SignTransactionResponseStellar"
},
{
"type": "object",
"required": [
"network"
],
"properties": {
"network": {
"type": "string",
"enum": [
"stellar"
]
}
}
}
]
"$ref": "#/components/schemas/SignTransactionResponseStellar"
},
{
"allOf": [
{
"type": "array",
"items": {
"type": "integer",
"format": "int32",
"minimum": 0
}
},
{
"type": "object",
"required": [
"network"
],
"properties": {
"network": {
"type": "string",
"enum": [
"evm"
]
}
}
}
]
"type": "array",
"items": {
"type": "integer",
"format": "int32",
"minimum": 0
}
},
{
"allOf": [
{
"type": "array",
"items": {
"type": "integer",
"format": "int32",
"minimum": 0
}
},
{
"type": "object",
"required": [
"network"
],
"properties": {
"network": {
"type": "string",
"enum": [
"solana"
]
}
}
}
]
"type": "array",
"items": {
"type": "integer",
"format": "int32",
"minimum": 0
}
}
]
},
Expand Down Expand Up @@ -6885,18 +6788,11 @@
"SolanaTransactionRequest": {
"type": "object",
"required": [
"fee_payer",
"instructions"
"transaction"
],
"properties": {
"fee_payer": {
"type": "string"
},
"instructions": {
"type": "array",
"items": {
"type": "string"
}
"transaction": {
"$ref": "#/components/schemas/EncodedSerializedTransaction"
}
}
},
Expand All @@ -6906,8 +6802,7 @@
"id",
"status",
"created_at",
"recent_blockhash",
"fee_payer"
"transaction"
],
"properties": {
"confirmed_at": {
Expand All @@ -6916,19 +6811,13 @@
"created_at": {
"type": "string"
},
"fee_payer": {
"type": "string"
},
"hash": {
"type": "string"
},
"id": {
"type": "string"
},
"recent_blockhash": {
"sent_at": {
"type": "string"
},
"sent_at": {
"signature": {
"type": "string"
},
"status": {
Expand All @@ -6939,6 +6828,9 @@
"string",
"null"
]
},
"transaction": {
"type": "string"
}
}
},
Expand All @@ -6955,6 +6847,9 @@
"type": "object",
"description": "Stellar policy response model for OpenAPI documentation",
"properties": {
"concurrent_transactions": {
"type": "boolean"
},
"max_fee": {
"type": "integer",
"format": "int32",
Expand Down
8 changes: 8 additions & 0 deletions examples/launchtube-plugin-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ The LaunchTube plugin and relayer configurations are already set up for testnet.
**`config/config.json`** (pre-configured):

- Three relayers defined: `launchtube-fund`, `launchtube-seq-001`, `launchtube-seq-002`
- The Fund relayer has `concurrent_transactions: true` enabled in policies to allow parallel processing
- Corresponding signers pointing to the key files you'll create
- Plugin registered as `launchtube-plugin`

Expand Down Expand Up @@ -284,6 +285,13 @@ const authXdrs = (op.auth ?? []).map(a => a.toXDR("base64"));
5. **Fee Bumping**: Fund account wraps transaction with fee bump
6. **Submission**: Sends to Stellar network

### Concurrent Transaction Processing

This example uses multiple Stellar accounts (fund account + sequence accounts) with `concurrent_transactions: true` enabled in the fund account relayer policy. This configuration:

- **Allows parallel processing**: Fund account leverages the sequence accounts sequence number, so transactions can be processed concurrently without blocking each other
- **Improves throughput**: Multiple transactions can be in-flight simultaneously

## Troubleshooting

### Common issues
Expand Down
5 changes: 4 additions & 1 deletion examples/launchtube-plugin-example/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"network": "testnet",
"paused": false,
"network_type": "stellar",
"signer_id": "launchtube-fund-signer"
"signer_id": "launchtube-fund-signer",
"policies": {
"concurrent_transactions": true
}
},
{
"id": "launchtube-seq-001",
Expand Down
1 change: 1 addition & 0 deletions src/api/controllers/relayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@ mod tests {
min_balance: Some(10000000),
max_fee: Some(100),
timeout_seconds: Some(30),
concurrent_transactions: None,
}));

let result = create_relayer(request, actix_web::web::ThinData(app_state)).await;
Expand Down
4 changes: 4 additions & 0 deletions src/constants/relayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ pub const DEFAULT_EVM_EIP1559_ENABLED: bool = true;
/// Default gas limit estimation enabled
pub const DEFAULT_EVM_GAS_LIMIT_ESTIMATION: bool = true;

// === Stellar Policy Defaults ===
/// Default concurrent transactions enabled setting for Stellar
pub const DEFAULT_STELLAR_CONCURRENT_TRANSACTIONS: bool = false;

// === Solana Policy Defaults ===
/// Default maximum transaction data size for Solana
pub const DEFAULT_SOLANA_MAX_TX_DATA_SIZE: u16 = 1232;
Expand Down
Loading
Loading