Skip to content

Commit 9b52a74

Browse files
authored
Merge branch 'master' into 5-update-flyover-rskj-config-doc
2 parents 7ff4c07 + 8edaea4 commit 9b52a74

File tree

8 files changed

+109
-69
lines changed

8 files changed

+109
-69
lines changed

.github/copilot-instructions.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
When performing a code review, apply the checks in the prompts/review-code.prompt.md file.
2+
3+
When performing a code review, focus on readability and avoid nested ternary operators.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
agent: 'agent'
3+
description: 'Perform a comprehensive code review'
4+
---
5+
6+
## Role
7+
8+
You're a senior software engineer conducting a thorough code review. Provide constructive, actionable feedback.
9+
10+
## Review Areas
11+
12+
Analyze the selected code for:
13+
14+
1. **Security Issues**
15+
- Input validation and sanitization
16+
- Data exposure risks
17+
- Injection vulnerabilities
18+
- OWASP Top 10 risks
19+
20+
2. **Performance & Efficiency**
21+
- Algorithm complexity
22+
- Memory usage patterns
23+
- Database query optimization
24+
- Unnecessary computations
25+
26+
3. **Code Quality**
27+
- Readability and maintainability
28+
- Proper naming conventions
29+
- Function/class size and responsibility
30+
- Code duplication
31+
32+
4. **Architecture & Design**
33+
- Design pattern usage
34+
- Separation of concerns
35+
- Dependency management
36+
- Error handling strategy
37+
38+
5. **Testing & Documentation**
39+
- Test coverage and quality
40+
- Documentation completeness
41+
- Comment clarity and necessity
42+
43+
## Output Format
44+
45+
Provide feedback as:
46+
47+
**🔴 Critical Issues** - Must fix before merge
48+
**🟡 Suggestions** - Improvements to consider
49+
**✅ Good Practices** - What's done well
50+
51+
For each issue:
52+
- Specific line references
53+
- Clear explanation of the problem
54+
- Suggested solution with code example
55+
- Rationale for the change
56+
57+
Focus on: ${input:focus:Any specific areas to emphasize in the review?}
58+
59+
Be constructive and educational in your feedback.

.github/workflows/devPortal-update.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,29 @@ jobs:
1616
- name: Checkout Code
1717
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1818

19-
# Step 1: Clone the Devportal Repository
19+
# Step 1: Generate GitHub App Token
20+
- name: Generate GitHub App Token
21+
id: generate_token
22+
uses: actions/create-github-app-token@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 # v1.10.3
23+
with:
24+
app-id: ${{ secrets.GH_APP_ID }}
25+
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
26+
owner: rsksmart
27+
repositories: devportal
28+
29+
# Step 2: Clone the Devportal Repository
2030
- name: Clone Devportal Repository
21-
env:
22-
GITHUB_TOKEN: ${{ secrets.DEVPORTAL_DOCS_UPDATE_TOKEN }}
2331
run: |
2432
TIMESTAMP=$(date +'%Y%m%d-%H%M%S')
2533
BRANCH_NAME="update-from-lps-${TIMESTAMP}"
2634
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
2735
28-
git clone https://github.com/rsksmart/devportal.git
36+
git clone https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/rsksmart/devportal.git
2937
cd devportal
3038
git checkout -b ${BRANCH_NAME} || git checkout ${BRANCH_NAME}
3139
cd ..
3240
33-
# Step 2: Transform Each File and Copy to Devportal Repository
41+
# Step 3: Transform Each File and Copy to Devportal Repository
3442
- name: Transform Files for Devportal
3543
run: |
3644
set -e
@@ -232,27 +240,23 @@ jobs:
232240
rm ${TEMP_FILE}
233241
cp ${TRANSFORMED_FILE} ${BASE_DST}/trusted-accounts.md
234242
235-
# Step 3: Commit and Push Changes to Devportal Repository
243+
# Step 4: Commit and Push Changes to Devportal Repository
236244
- name: Commit and Push Changes
237-
env:
238-
GITHUB_TOKEN: ${{ secrets.DEVPORTAL_DOCS_UPDATE_TOKEN }}
239245
run: |
240246
cd devportal
241247
git config user.name "github-actions[bot]"
242248
git config user.email "github-actions[bot]@users.noreply.github.com"
243249
git add docs/02-developers/06-integrate/02-flyover/
244250
git commit -m "Automated update from Liquidity Provider Server repository"
245-
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/rsksmart/devportal.git
251+
git remote set-url origin https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/rsksmart/devportal.git
246252
git push -f origin ${BRANCH_NAME}
247253
248-
# Step 4: Create a Pull Request in the Devportal Repository
254+
# Step 5: Create a Pull Request in the Devportal Repository
249255
- name: Create Pull Request
250-
env:
251-
GITHUB_TOKEN: ${{ secrets.DEVPORTAL_DOCS_UPDATE_TOKEN }}
252256
run: |
253257
cd devportal
254258
curl -L -X POST -H "Accept: application/vnd.github+json" \
255-
-H "Authorization: Bearer ${{ secrets.DEVPORTAL_DOCS_UPDATE_TOKEN }}" \
259+
-H "Authorization: Bearer ${{ steps.generate_token.outputs.token }}" \
256260
-H "X-GitHub-Api-Version: 2022-11-28" \
257261
https://api.github.com/repos/rsksmart/devportal/pulls \
258262
-d "{\"title\":\"Liquidity-provider-server automated update of documentation ${BRANCH_NAME}\",\"body\":\"This PR updates the Devportal documentation with the latest changes from the Liquidity Provider Server repository.\",\"head\":\"${BRANCH_NAME}\",\"base\":\"main\"}"

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ The service is configured in `docker-compose/monitoring/src/config.ts` and suppo
191191

192192
The service can be configured to monitor other addresses by modifying the `MONITORED_ADDRESSES` array in `docker-compose/monitoring/src/config.ts`.
193193

194+
## Additional clarifications
195+
- The liquidity provider server is designed to run with an exclusive wallet. Horizontal scaling requires a separate wallet per instance. This codebase assumes a non-shared wallet.
196+
194197
## More Information
195198

196199
If you're looking forward to integrate with Flyover Protocol then you can check the [Flyover SDK repository](https://github.com/rsksmart/flyover-sdk/blob/main/README.md).

SECURITY.md

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,25 @@
1-
# Liquidity Provider Server Security Process
1+
# RootstockLabs's Security Process
22

33
We are committed to conduct our security process in a professional and civil manner. Public shaming, under-reporting or misrepresentation of vulnerabilities will not be tolerated.
44

55
## Responsible Disclosure
66

7-
For all security related issues, Liquidity Provider Server has two main points of contact. Reach us at `security@rootstocklabs.com` or refer to our [Bug Bounty Program](https://www.rootstocklabs.com/bug-bounty-program). **Do not open up a GitHub issue if the bug is a security vulnerability**
7+
For all security related issues, RootstockLabs has two main points of contact. Reach us at <security@rootstocklabs.com> or refer to our [Bug Bounty Program](https://www.rootstocklabs.com/bug-bounty-program/). **Do not open up a GitHub issue if the bug is a security vulnerability**
88

99
**Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/rsksmart/liquidity-provider-server/issues).
1010

11-
## Vulnerability Handling
11+
## Disclosure Policy
1212

13-
### Response Time
13+
- Follow Immunefi's [disclosure guidelines](https://immunefi.com/responsible-publication/).
14+
- Public disclosure of a vulnerability makes it ineligible for a bounty.
1415

15-
RootstockLabs will make a best effort to meet the following response times for reported vulnerabilities:
16-
17-
* Time to first response (from report submit) - 5 business days
18-
* Time to triage (from report submit) - 7 business days
19-
* Time to bounty (from triage) - 15 business days
20-
21-
We'll try to keep you informed about our progress throughout the process.
22-
23-
### Disclouse Policy
24-
25-
* Follow HackerOne's [disclosure guidelines](https://www.hackerone.com/disclosure-guidelines).
26-
* Public disclosure of a vulnerability makes it ineligible for a bounty. If the user reports the vulnerability to other security teams (e.g. Ethereum or ETC) but reports to RootstockLabs with considerable delay, then RootstockLabs may reduce or cancel the bounty.
27-
28-
For more information check RootstockLabs bounty program policy at [HackerOne](https://hackerone.com/rootstocklabs)
16+
For more information, check RootstockLabs bounty program policy at [Immunefi](https://immunefi.com/bug-bounty/rootstocklabs/information)
2917

3018
## Public Keys
3119

3220
### Security
3321

34-
```
22+
```gpg
3523
-----BEGIN PGP PUBLIC KEY BLOCK-----
3624
Version: GnuPG v2
3725
@@ -140,4 +128,4 @@ v0FjOkVKB3PSHj1q4fogldX0Yb55tUa3rX0Rb8QEKInQj8FFPd44XHclv9PTv0OL
140128
IfHtYt8huvu34FA85HR8wAOPiqvyJ7Oj
141129
=r7Yf
142130
-----END PGP PUBLIC KEY BLOCK-----
143-
```
131+
```

docs/DESIGN.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
# Flyover Protocol Design
22

3-
The Flyover system allows a user to transfer BTC from Bitcoin to RSK and vice versa in a fast way, where a third party
4-
takes the risk to advance the payment for the user. Flyover also provides the new feature to transfer BTC from Bitcoin
5-
directly to a smart contract in RSK.
6-
7-
The outstanding feature of the Flyover system is that it accomplishes the above without giving any third party custody
8-
of the transferred funds. This is an outstanding security guarantee to the user. The system comprises one or more
9-
liquidity providers (LPs) that store their BTC in RSK and Bitcoin. The first version of the Flyover protocol supports only the
10-
peg-in process (BTC to RBTC). Later versions will also support the peg-out process (RBTC to BTC).
3+
The Flyover system allows a user to transfer BTC from Bitcoin to Rootstock and vice versa in a fast way, where a third party takes the risk to advance the payment for the user. Flyover also provides the new feature to transfer BTC from Bitcoin directly to a smart contract in Rootstock.
114

5+
The outstanding feature of the Flyover system is that it accomplishes the above without giving any third party custody of the transferred funds. This is an outstanding security guarantee to the user. The system comprises one or more liquidity providers (LPs) that store their BTC in Rootstock and Bitcoin. The first version of the Flyover protocol supports only the peg-in process (BTC to RBTC). Later versions will also support the peg-out process (RBTC to BTC).
126

137
## Workflow
148

@@ -18,21 +12,21 @@ to isOperational could be performed at a different time:
1812
![Flyover Sequence Diagram](https://raw.githubusercontent.com/rsksmart/liquidity-provider-server/refs/heads/master/docs/diagrams/flyover-sd.png)
1913

2014

21-
The following diagrams show the interactions between Liquidity Provider, Liquidity Bridge Contract and RSK Bridge Contract in three different scenarios:
15+
The following diagrams show the interactions between Liquidity Provider, Liquidity Bridge Contract and Rootstock Bridge Contract in three different scenarios:
2216
1. Basic fast bridge workflow (happy path)
2317
2. Unsuccessful call on behalf of a user
2418
3. Liquidity Provider fails to deliver funds to LBC
2519

2620
![Flyover Sequence Diagram](https://raw.githubusercontent.com/rsksmart/liquidity-provider-server/master/docs/diagrams/flyover-ad-basic.png)
2721

28-
_Figure 1 - Basic fast bridge workflow. Note that step (3) `registerPegin` can be called by the LP or any other entity._
22+
* Figure 1 - Basic fast bridge workflow. Note that step (3) `registerPegin` can be called by the LP or any other entity._
2923

3024

3125
![Flyover Sequence Diagram](https://raw.githubusercontent.com/rsksmart/liquidity-provider-server/master/docs/diagrams/flyover-ad-unsuccessful-call.png)
3226

33-
_Figure 2 - Fast bridge interactions when the call on behalf of the user is unsuccessful. The LP keeps the call fee and the rest is refunded to the refund RSK address._
27+
* Figure 2 - Fast bridge interactions when the call on behalf of the user is unsuccessful. The LP keeps the call fee and the rest is refunded to the refund RSK address._
3428

3529

3630
![Flyover Sequence Diagram](https://raw.githubusercontent.com/rsksmart/liquidity-provider-server/master/docs/diagrams/flyover-ad-no-call.png)
3731

38-
_Figure 3 - Fast bridge interactions when the LP fails to call the LBC on behalf of the user. The LBC slashes the LP's collateral and refunds the user on the refund RSK address._
32+
* Figure 3 - Fast bridge interactions when the LP fails to call the LBC on behalf of the user. The LBC slashes the LP's collateral and refunds the user on the refund RSK address._

docs/Operating-LP.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
A Liquidity Provider (LP) contributes funds in Rootstock (RBTC) and Bitcoin (BTC) to a liquidity pool. In exchange for providing this liquidity and facilitating trades between the two assets, LPs earn rewards (fees) generated from trading activity.
1+
A Liquidity Provider (LP) contributes funds in Rootstock (rBTC) and Bitcoin (BTC) to a liquidity pool. In exchange for providing this liquidity and facilitating trades between the two assets, LPs earn rewards (fees) generated from trading activity.
22

3-
> LPs can be individuals, institutions, exchanges, or aggregators. See [glossary](/developers/integrate/flyover/glossary/) section for explanation of terms.
3+
> LPs can be individuals, institutions, exchanges, or aggregators. See the [glossary](/developers/integrate/flyover/glossary/) for term definitions.
44
5-
This section outlines the key features and functionalities that Liquidity Providers (LPs) should be familiar with to effectively operate their Liquidity Provider Servers (LPS). The information provided encompasses both technical and operational aspects, making it a valuable resource for both LPs and those responsible for deploying the LPS environment.
5+
The Flyover protocol is trust-minimized, this means user funds go to the PowPeg federation (peg-in) or the Liquidity Bridge Contract (peg-out), never to the Liquidity Provider. LPs supply liquidity and are repaid by the protocol; they do not hold custody of user funds. This design matters for institutional LPs and their users.
6+
7+
This section outlines the key features and operations that Liquidity Providers (LPs) need to run their Liquidity Provider Servers (LPS) effectively. The information provided encompasses both technical and operational aspects, making it a valuable resource for both LPs and those responsible for deploying the LPS environment.
68

79
## Requirements
810
* See minimum security requirements
911
* Configure environments
1012
- LPS Wallet
1113
- LPS environment
1214
* Liquidity
13-
- The minimum required is the collateral amount (regardless of the amount of liquidity), which currently is 0.06 RBTC that needs to be paid during transaction registration. See [how to get RBTC](https://rootstock.io/rbtc/).
15+
- The minimum required is the collateral amount (regardless of the amount of liquidity), which currently is 0.06 rBTC that needs to be paid during transaction registration. See [how to get rBTC](https://rootstock.io/rbtc/).
1416

1517
### Main Dependencies
1618
The liquidity provider server has the following dependencies:
@@ -57,4 +59,4 @@ See the [minimum security requirements](https://github.com/rsksmart/liquidity-pr
5759
- [Liquidity Provider Server](https://github.com/rsksmart/liquidity-provider-server?tab=readme-ov-file)
5860
- [Liquidity Bridge Contract](https://github.com/rsksmart/liquidity-bridge-contract)
5961
- [Flyover LBC Mainnet Contract Address](https://explorer.rootstock.io/address/0xaa9caf1e3967600578727f975f283446a3da6612)
60-
- [Flyover LBC Testnet Contract Address](https://explorer.testnet.rootstock.io/address/0xc2a630c053d12d63d32b025082f6ba268db18300)
62+
- [Flyover LBC Testnet Contract Address](https://explorer.testnet.rootstock.io/address/0xc2a630c053d12d63d32b025082f6ba268db18300)

docs/Trusted-Accounts.md

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# Liquidity Provider Trusted Accounts
22

3-
## 🧠 Summary
3+
## Summary
44
The **Liquidity Provider Trusted Accounts** feature extends the existing **Liquidity Provider Server (LPS)** and **FlyoverSDK** to allow Liquidity Providers (LPs) to configure a set of trusted Rootstock accounts that can bypass certain validation checks — such as the **reCAPTCHA** verification — during **PegIn** or **PegOut** operations.
55

66
This functionality is part of the **Flyover Protocol**, aimed at enabling automated integrations for partners and liquidity providers who operate frequently.
77

8-
---
9-
10-
## 🏗 Architecture and Design
8+
## Architecture and Design
119

1210
### Components
1311
This feature adds functionality to two existing components:
@@ -18,9 +16,7 @@ This feature adds functionality to two existing components:
1816
- Backward compatible with existing FlyoverSDK versions `>= v1.7.0` and LPS versions `>= v2.3.0`.
1917
- The account paying for the operation doesn’t need to be the same as the whitelisted account, but a valid signature of the quote hash from the trusted account must be provided.
2018

21-
---
22-
23-
## ⚙️ Setup and Configuration
19+
## Setup and Configuration
2420

2521
### Environment Requirements
2622
- **FlyoverSDK:** `>= v1.70`
@@ -30,9 +26,7 @@ This feature adds functionality to two existing components:
3026
- The LP must configure authorized trusted accounts in their **LPS instance**.
3127
- No additional `.env` variables or feature flags are required.
3228

33-
---
34-
35-
## 🔌 API / Interface Details
29+
## API / Interface Details
3630

3731
### FlyoverSDK Methods
3832

@@ -53,9 +47,7 @@ Both error types are raised as **`FlyoverError`** instances:
5347
| Invalid Signature | The provided signature does not match a whitelisted account. |
5448
| Locking Cap Exceeded | The account exceeded its assigned BTC/RBTC locking cap. |
5549

56-
---
57-
58-
## 🧭 Integration Guide
50+
## Integration Guide
5951

6052
To integrate this feature:
6153

@@ -75,9 +67,7 @@ Trust is based solely on account whitelisting and signature verification.
7567
- Primary integration via **FlyoverSDK**
7668
- No direct API calls required
7769

78-
---
79-
80-
## 🧪 Testing
70+
## Testing
8171

8272
### Local Testing Setup
8373
- Deploy a **local LPS instance**.
@@ -91,15 +81,12 @@ Example tests and automation demos can be found in:
9181
### Notes
9282
Follow the documentation in the above repository for commands and setup steps.
9383

94-
---
95-
9684
## 🧾 Changelog
9785
| Component | Version | Release Link |
9886
|------------|----------|---------------|
9987
| FlyoverSDK | v1.7.0 | [GitHub Release](https://github.com/rsksmart/flyover-sdk/releases/tag/v1.7.0) |
10088
| LPS | v2.3.0 | [GitHub Release](https://github.com/rsksmart/liquidity-provider-server/releases/tag/v2.3.0) |
10189

102-
---
10390

10491
## 📦 Related Resources
10592
- **Flyover SDK (npm):** [@rsksmart/flyover-sdk](https://www.npmjs.com/package/@rsksmart/flyover-sdk)

0 commit comments

Comments
 (0)