Skip to content

Implement Gas Relay endpoint#129

Merged
PeterOche merged 3 commits intodegenspot:mainfrom
gabito1451:#118
Mar 25, 2026
Merged

Implement Gas Relay endpoint#129
PeterOche merged 3 commits intodegenspot:mainfrom
gabito1451:#118

Conversation

@gabito1451
Copy link
Copy Markdown
Contributor

I have implemented the Gas Relay endpoint as requested. The implementation ensures that the backend co-signs and sponsors transactions (covering gas fees) only for the specific CallRegistry contract.

Key Changes:
Refined

RelayService
:

Robust Validation: Added a strict check in

validateTransaction
to ensure that all operations in the transaction are invokeHostFunction calls specifically targeting the CallRegistry contract (retrieved via

ConfigService
).
Fee-Bump Implementation: Correctly implements Stellar Fee-Bump transactions. It wraps the user's transaction in a fee-bump envelope where the relayer's hot wallet is the fee source.
Security Checks:
Ensures the inner transaction has at least one signature (user's signature).
Verifies transaction expiration (timeBounds) to prevent the relayer from paying for stale transactions.
Added a small fee margin (500 stroops) to Ensure the fee-bump is accepted by the network even during slight fee fluctuations.
Proper Submission: Uses SorobanRpc.Server.sendTransaction and handles the response correctly, including logging the errorResultXdr if submission fails.
Controller Verification:

Confirmed the POST /relay/tx endpoint in

RelayController
correctly handles the XDR input and communicates with the

RelayService
.
Environment Integration:

The relayer uses RELAY_HOT_WALLET_SECRET for signing, which follows the project's established structure.

closes #118

@PeterOche PeterOche merged commit df70e91 into degenspot:main Mar 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gas Sponsorship Relay Endpoint

2 participants