-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Docs #2610
Conversation
WalkthroughThe updates primarily focus on restructuring and enhancing documentation for the Synapse Bridge, including new API endpoints and observability features. Changes in file paths and configurations reflect a shift towards a more organized and accessible documentation system, with emphasis on cross-chain transactions and API usability. Changes
--> Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2610 +/- ##
===================================================
- Coverage 39.59307% 39.58477% -0.00830%
===================================================
Files 179 179
Lines 14548 14546 -2
Branches 80 80
===================================================
- Hits 5760 5758 -2
Misses 8033 8033
Partials 755 755
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 22
Out of diff range and nitpick comments (1)
docs/bridge/docs/rfq/RFQ.md (1)
Line range hint
25-25
: Remove extra blank line to maintain clean and consistent formatting.-
Review Details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (9)
docs/bridge/static/img/docusaurus-social-card.jpg
is excluded by!**/*.jpg
docs/bridge/static/img/docusaurus.png
is excluded by!**/*.png
docs/bridge/static/img/favicon.ico
is excluded by!**/*.ico
docs/bridge/static/img/logo.svg
is excluded by!**/*.svg
docs/bridge/static/img/undraw_docusaurus_mountain.svg
is excluded by!**/*.svg
docs/bridge/static/img/undraw_docusaurus_react.svg
is excluded by!**/*.svg
docs/bridge/static/img/undraw_docusaurus_tree.svg
is excluded by!**/*.svg
docs/bridge/yarn.lock
is excluded by!**/*.lock
yarn.lock
is excluded by!**/*.lock
Files selected for processing (32)
- .github/workflows/ui-preview.yaml (2 hunks)
- docs/bridge/README.md (2 hunks)
- docs/bridge/docs/CCTP/Contracts.md (1 hunks)
- docs/bridge/docs/CCTP/Overview.md (1 hunks)
- docs/bridge/docs/CCTP/Relayer.md (1 hunks)
- docs/bridge/docs/CCTP/category.json (1 hunks)
- docs/bridge/docs/Observability.md (1 hunks)
- docs/bridge/docs/Services/Omnirpc.md (1 hunks)
- docs/bridge/docs/rfq/API/API.md (1 hunks)
- docs/bridge/docs/rfq/API/get-quotes.api.mdx (1 hunks)
- docs/bridge/docs/rfq/API/sidebar.ts (1 hunks)
- docs/bridge/docs/rfq/API/upsert-quote.api.mdx (1 hunks)
- docs/bridge/docs/rfq/Contracts.md (1 hunks)
- docs/bridge/docs/rfq/RFQ.md (1 hunks)
- docs/bridge/docs/rfq/Relayer/Relayer.md (1 hunks)
- docs/bridge/docs/rfq/category.json (1 hunks)
- docs/bridge/docusaurus.config.ts (1 hunks)
- docs/bridge/package.json (1 hunks)
- docs/bridge/sidebars.ts (1 hunks)
- docs/bridge/src/components/HomepageFeatures/index.tsx (1 hunks)
- docs/bridge/src/components/HomepageFeatures/styles.module.css (1 hunks)
- docs/bridge/src/pages/index.tsx (1 hunks)
- docs/bridge/src/pages/markdown-page.md (1 hunks)
- docs/bridge/tsconfig.json (1 hunks)
- lerna.json (1 hunks)
- package.json (1 hunks)
- services/rfq/api/README.md (1 hunks)
- services/rfq/api/client/client.go (2 hunks)
- services/rfq/api/docs/docs.go (2 hunks)
- services/rfq/api/docs/swagger.json (2 hunks)
- services/rfq/api/docs/swagger.yaml (3 hunks)
- services/rfq/api/rest/handler.go (2 hunks)
Files skipped from review due to trivial changes (12)
- docs/bridge/docs/CCTP/category.json
- docs/bridge/docs/rfq/API/sidebar.ts
- docs/bridge/docs/rfq/category.json
- docs/bridge/docusaurus.config.ts
- docs/bridge/package.json
- docs/bridge/sidebars.ts
- docs/bridge/src/components/HomepageFeatures/styles.module.css
- docs/bridge/tsconfig.json
- lerna.json
- package.json
- services/rfq/api/client/client.go
- services/rfq/api/docs/swagger.yaml
Additional comments not posted (18)
docs/bridge/src/pages/markdown-page.md (1)
1-7
: LGTM! The Markdown structure is correctly formatted.docs/bridge/src/pages/index.tsx (1)
1-45
: LGTM! The React component structure is well-organized and follows best practices.docs/bridge/docs/CCTP/Overview.md (1)
1-8
: LGTM! The overview is informative and well-structured, providing clear insights into the CCTP components.docs/bridge/src/components/HomepageFeatures/index.tsx (1)
1-70
: LGTM! The React component and TypeScript usage are correctly implemented and follow best practices..github/workflows/ui-preview.yaml (1)
31-31
: Ensure the path filter matches the new documentation structure.The path filter change from
'packages/docs/**'
to'docs/bridge/**'
is correctly implemented.services/rfq/api/docs/swagger.json (5)
25-25
: Ensure the parameter location is correctly set to 'query' if it's not meant to be part of the URL path.
31-31
: Verify the parameter location for 'originTokenAddr' to ensure it aligns with API design.Verification successful
The parameter
originTokenAddr
is located in the "path" of the API as specified in theswagger.json
file. This confirms that the parameter is indeed part of the URL path for API calls, aligning with the typical RESTful API design where path parameters are used to identify a specific resource or resources.
- Location of
originTokenAddr
confirmed inswagger.json
underservices/rfq/api/docs/swagger.json
.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the parameter location for 'originTokenAddr'. # Test: Search for the parameter usage in API calls. Expect: Correct location usage. rg --type json $'originTokenAddr'Length of output: 118
Script:
#!/bin/bash # Description: Extract the 'in' field for 'originTokenAddr' from swagger.json to verify its location in the API. # Extract the relevant block from swagger.json and find the 'in' field for 'originTokenAddr' rg --type json -A 5 '"name": "originTokenAddr"' services/rfq/api/docs/swagger.json | rg '"in":'Length of output: 134
37-37
: Check if 'destChainID' should be a path or query parameter based on its usage in the API.Verification successful
The verification process has confirmed that the
destChainID
parameter is indeed used as a path parameter in the API, as specified in theswagger.json
file. The context around the parameter in the API documentation clearly indicates its placement in the path, which aligns with the initial configuration in the swagger file.Final Conclusion:
- The
destChainID
is correctly designated as a path parameter in the API documentation.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the parameter location for 'destChainID'. # Test: Search for the parameter usage in API calls. Expect: Correct location usage. rg --type json $'destChainID'Length of output: 110
Script:
#!/bin/bash # Description: Search for the API endpoint definitions using 'destChainID' in swagger.json to determine its usage as a path or query parameter. # Test: Extract relevant parts of the API definitions from swagger.json. rg --type json -C 10 'destChainID' services/rfq/api/docs/swagger.jsonLength of output: 925
43-43
: Confirm the correct parameter location for 'destTokenAddr' in API requests.Verification successful
The verification process has confirmed that the parameter
destTokenAddr
is indeed located in the "path" of the API request as specified in theswagger.json
file. This aligns with the information provided in the review comment, which sought confirmation of the parameter's location.
- The parameter
destTokenAddr
is correctly placed in the "path" as per the API documentation inswagger.json
.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the parameter location for 'destTokenAddr'. # Test: Search for the parameter usage in API calls. Expect: Correct location usage. rg --type json $'destTokenAddr'Length of output: 114
Script:
#!/bin/bash # Description: Extract more context around 'destTokenAddr' usage in swagger.json to determine its location. # Extract lines around the 'destTokenAddr' declaration to see its location context. rg --type json -C 5 'destTokenAddr' services/rfq/api/docs/swagger.jsonLength of output: 533
49-49
: Ensure 'relayerAddr' is correctly placed as a path or query parameter as per API design.Verification successful
The placement of 'relayerAddr' as a path parameter in the API design is confirmed and aligns with the expectations. It is correctly set in the swagger documentation.
- Location:
services/rfq/api/docs/swagger.json
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the parameter location for 'relayerAddr'. # Test: Search for the parameter usage in API calls. Expect: Correct location usage. rg --type json $'relayerAddr'Length of output: 110
Script:
#!/bin/bash # Description: Extract more context around 'relayerAddr' in swagger.json to determine its parameter type. # Extract 10 lines before and after the occurrence of 'relayerAddr' to get a better understanding of its context. rg --type json --context 10 'relayerAddr' services/rfq/api/docs/swagger.jsonLength of output: 931
services/rfq/api/docs/docs.go (1)
60-60
: Ensure 'relayerAddr' is correctly placed as a path or query parameter as per API design.docs/bridge/docs/rfq/API/get-quotes.api.mdx (4)
1-11
: Ensure the frontmatter and metadata are correctly formatted and complete.
13-25
: Verify that all imported components are used appropriately within the document.Verification successful
The verification process has confirmed that all imported components in the
get-quotes.api.mdx
file are indeed utilized within the document. Each component listed in the import statements has corresponding usage instances in the MDX content, ensuring that there are no redundant imports.This verification addresses the concern raised in the review comment effectively, confirming that the imports are appropriate and utilized as expected in the document.
- File:
docs/bridge/docs/rfq/API/get-quotes.api.mdx
- All components imported at the top of the file are used within the document.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of imported components in the MDX file. # Test: Search for the component usage in the document. Expect: Correct usage of components. rg --type mdx $'ApiTabs|DiscriminatorTabs|MethodEndpoint|SecuritySchemes|MimeTabs|ParamsItem|ResponseSamples|SchemaItem|SchemaTabs|Markdown|Heading|OperationTabs|TabItem'Length of output: 199
Script:
#!/bin/bash # Description: Verify the usage of imported components in the MDX file. # Test: Search for the component usage in the document. Expect: Correct usage of components. rg $'ApiTabs|DiscriminatorTabs|MethodEndpoint|SecuritySchemes|MimeTabs|ParamsItem|ResponseSamples|SchemaItem|SchemaTabs|Markdown|Heading|OperationTabs|TabItem' -g '*.mdx'Length of output: 7032
27-39
: Check the rendering of theMethodEndpoint
component to ensure it displays the API method and path correctly.
41-282
: Review the detailed API documentation content for accuracy and completeness.docs/bridge/docs/rfq/Relayer/Relayer.md (3)
1-4
: Ensure the frontmatter and metadata are correctly formatted and complete.
6-12
: Review the high-level description of the relayer's responsibilities for clarity and accuracy.
13-48
: Examine the detailed architecture and operational descriptions to ensure they are clear and accurate.
|
||
RFQ is a bridge module supported by the Synapse Router that allows different market makers to post quotes on different bridge routes. Users can take these quotes by submitting an on-chain bridge request. In the event these requests are not fulfilled, users can request a refund after a set period of time. | ||
|
||
### Actors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjust heading level to maintain proper semantic structure.
- ### Actors
+ ## Actors
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
### Actors | |
## Actors |
services/rfq/api/README.md
Outdated
@@ -0,0 +1,3 @@ | |||
# RFQ API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the Markdown heading syntax.
- # RFQ API
+ # RFQ API
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
# RFQ API | |
# RFQ API |
docs/bridge/docs/Services/Omnirpc.md
Outdated
"jsonrpc":"2.0", | ||
"method":"eth_getTransactionCount", | ||
"params":[ | ||
"0x230a1ac45690b9ae1176389434610b9526d2f21b", | ||
"0xec1d40" | ||
], | ||
"id":1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace hard tabs with spaces to maintain consistency in code formatting.
- "jsonrpc":"2.0",
- "method":"eth_getTransactionCount",
- "params":[
- "0x230a1ac45690b9ae1176389434610b9526d2f21b",
- "0xec1d40"
- ],
- "id":1
+ "jsonrpc":"2.0",
+ "method":"eth_getTransactionCount",
+ "params":[
+ "0x230a1ac45690b9ae1176389434610b9526d2f21b",
+ "0xec1d40"
+ ],
+ "id":1
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
"jsonrpc":"2.0", | |
"method":"eth_getTransactionCount", | |
"params":[ | |
"0x230a1ac45690b9ae1176389434610b9526d2f21b", | |
"0xec1d40" | |
], | |
"id":1 | |
"jsonrpc":"2.0", | |
"method":"eth_getTransactionCount", | |
"params":[ | |
"0x230a1ac45690b9ae1176389434610b9526d2f21b", | |
"0xec1d40" | |
], | |
"id":1 |
docs/bridge/docs/rfq/API/API.md
Outdated
|
||
The implementation of the rfq api can be found [here](https://github.com/synapsecns/sanguine/tree/master/services/rfq/api). Please note that end-users and solvers will not need to run their own version of the API. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove extra blank lines to maintain clean and consistent formatting.
-
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
docs/bridge/docs/rfq/API/API.md
Outdated
|
||
Only Solvers should be writing to the API, end-users need only read from the `/quotes` endpoint. | ||
|
||
**Authentication** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a heading instead of emphasis for section titles to improve document structure.
- **Authentication**
+ ## Authentication
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
**Authentication** | |
## Authentication |
services/rfq/api/docs/docs.go
Outdated
}, | ||
{ | ||
"type": "string", | ||
"description": "origin chain id to filter quotes by", | ||
"name": "originTokenAddr", | ||
"in": "path", | ||
"required": true | ||
"in": "path" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
The review comment concerning the parameter location for 'originTokenAddr' has highlighted a significant inconsistency. The parameter is documented as a path parameter in the API, but it is actually used as a query parameter throughout the codebase. This discrepancy could lead to confusion and should be addressed to align with the intended API design.
services/rfq/api/rest/handler.go
: Documented as a path parameter but used as a query parameter.services/rfq/api/rest/server_test.go
: Used as a query parameter in test URL.
Analysis chain
Verify the parameter location for 'originTokenAddr' to ensure it aligns with API design.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the parameter location for 'originTokenAddr' in the Go code.
# Test: Search for the parameter usage in API calls. Expect: Correct location usage.
rg --type go $'originTokenAddr'
Length of output: 1878
services/rfq/api/docs/docs.go
Outdated
}, | ||
{ | ||
"type": "integer", | ||
"description": "destination chain id to filter quotes by", | ||
"name": "destChainID", | ||
"in": "path", | ||
"required": true | ||
"in": "path" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
The review comment raised a valid concern regarding the parameter location of 'destChainID' in the API. The investigation into the codebase reveals a discrepancy:
- The comment in
services/rfq/api/rest/handler.go
suggests that 'destChainID' should be a path parameter. - However, the actual implementation in the same file retrieves 'destChainID' as a query parameter (
destChainIDStr := c.Query("destChainId")
).
This inconsistency needs to be resolved to ensure clarity and correct API documentation. It is recommended to update either the code or the comment to match the intended usage.
- File to update:
services/rfq/api/rest/handler.go
- Align the comment with the actual implementation or vice versa, depending on the intended API design.
Analysis chain
Check if 'destChainID' should be a path or query parameter based on its usage in the API.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the parameter location for 'destChainID' in the Go code.
# Test: Search for the parameter usage in API calls. Expect: Correct location usage.
rg --type go $'destChainID'
Length of output: 3347
services/rfq/api/docs/docs.go
Outdated
}, | ||
{ | ||
"type": "string", | ||
"description": "destination token address to filter quotes by", | ||
"name": "destTokenAddr", | ||
"in": "path", | ||
"required": true | ||
"in": "path" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
The review comment concerning the parameter location for 'destTokenAddr' in API requests has been investigated. The findings are as follows:
- The parameter 'destTokenAddr' is used as a query parameter in the API, as evidenced by its retrieval method in
handler.go
usingc.Query("destTokenAddr")
. - However, there is a discrepancy in the documentation and code comments which incorrectly label 'destTokenAddr' as a path parameter.
This inconsistency should be addressed to ensure clarity and correctness in the API documentation and code comments. Here are the specific locations that need attention:
services/rfq/api/rest/handler.go
: Update the comment to reflect the correct usage as a query parameter.services/rfq/api/docs/docs.go
: Correct the documentation to indicate 'destTokenAddr' as a query parameter.
Analysis chain
Confirm the correct parameter location for 'destTokenAddr' in API requests.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the parameter location for 'destTokenAddr' in the Go code.
# Test: Search for the parameter usage in API calls. Expect: Correct location usage.
rg --type go $'destTokenAddr'
Length of output: 2142
services/rfq/api/docs/docs.go
Outdated
@@ -88,7 +83,7 @@ | |||
"tags": [ | |||
"quotes" | |||
], | |||
"summary": "get quotes from all relayers.", | |||
"summary": "Upsert quote", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the summary to accurately reflect the API's functionality.
- "summary": "upsert a quote from relayer."
+ "summary": "Upsert quote"
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
"summary": "Upsert quote", | |
"summary": "Upsert quote", |
price_usd: 2600 | ||
10: | ||
rfq_address: "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E" | ||
synapse_cctp_address: "0x12715a66773BD9C54534a01aBF01d05F6B4Bd35E" | ||
token_messenger_address: "0x2B4069517957735bE00ceE0fadAE88a26365528f" | ||
cctp_start_block: 116855000 | ||
l1_fee_chain_id: 1 | ||
# Prove + Claim L1 gas estimate | ||
l1_fee_origin_gas_estimate: 20 | ||
# Relay L1 gas estimate | ||
l1_fee_dest_gas_estimate: 10 | ||
tokens: | ||
USDC: | ||
address: "0x0b2c639c533813f4aa9d7837caf62653d097ff85" | ||
decimals: 6 | ||
price_usd: 1.0 | ||
min_quote_amount: 10000 | ||
rebalance_method: "circlecctp" | ||
maintenance_balance_pct: 20 | ||
initial_balance_pct: 34 | ||
max_rebalance_amount: 500000 | ||
ETH: | ||
address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" | ||
decimals: 18 | ||
price_usd: 2600 | ||
|
||
quotable_tokens: | ||
10-0x0b2c639c533813f4aa9d7837caf62653d097ff85: | ||
- "1-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" | ||
1-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48: | ||
- "10-0x0b2c639c533813f4aa9d7837caf62653d097ff85" | ||
1-0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE: | ||
- "10-0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" | ||
10-0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE: | ||
- "1-0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" | ||
|
||
fee_pricer: | ||
gas_price_cache_ttl: 60 | ||
token_price_cache_ttl: 60 | ||
|
||
cctp_relayer_config: | ||
cctp_type: "circle" | ||
circle_api_url: "https://iris-api.circle.com/v1/attestations" | ||
chains: | ||
- chain_id: 1 | ||
synapse_cctp_address: "0x12715a66773BD9C54534a01aBF01d05F6B4Bd35E" | ||
token_messenger_address: "0xbd3fa81b58ba92a82136038b25adec7066af3155" | ||
- chain_id: 10 | ||
synapse_cctp_address: "0x12715a66773BD9C54534a01aBF01d05F6B4Bd35E" | ||
token_messenger_address: "0x2B4069517957735bE00ceE0fadAE88a26365528f" | ||
base_omnirpc_url: "http://omnirpc" | ||
unbonded_signer: | ||
type: GCP | ||
file: /config/signer.txt | ||
http_backoff_initial_interval_ms: 1000 | ||
http_backoff_max_elapsed_time_ms: 300000 | ||
``` | ||
</details> | ||
|
||
<!-- TODO: this should work the same way as the openapi doc gen where its autogenerated from code and amix-in --> | ||
|
||
- `submitter_config` - This is covered [here](../../Services/Submitter). At a high level this controls gas parameters used for on-chain transactions. | ||
- `database` - The database settings for the API backend. A database is required to store quotes and other information. Using SQLite with a dsn set to a `/tmp/` directory is recommended for development. | ||
- `type` - the database driver to use, can be `mysql` or `sqlite`. | ||
- `dsn` - the dsn of your database. If using sqlite, this can be a path, if using mysql please see [here](https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-configuration.html) for more information. | ||
- `screener_api_url` (optional) - Please see [here](https://github.com/synapsecns/sanguine/tree/master/contrib/screener-api#screening-api) for an api spec, this is used descision on wether to bridge to given addresses. | ||
- `rfq_url` - URL of the rfq api, please see the [API](../../API#API Urls) page for details and the mainnet/testnet urls. | ||
- `omnirpc_url` - URL of omnirpc to use, Please see [here](../../Services/Omnirpc) for details on running an omnirpc instance. | ||
- `rebalance_interval` - How often to rebalance, formatted as (s = seconds, m = minutes, h = hours) | ||
- `relayer_api_port` - the relayer api is used to control the relayer. <!--TODO: more info here--> This api should be secured/not public. | ||
- `base_chain_config`: Base chain config is the default config applied for each chain if the other chains do not override it. This is covered in the chains section. | ||
- `chains` - each chain has a different config that overrides base_chain_config. Here are the parameters for each chain | ||
- `rfq_address` - the address of the rfq contract on this chain. These addresses are available [here](../Contracts.md). | ||
|
||
- `synapse_cctp_address` (optional) - this is only applicable if **rebalance_method** is set to synapse. This is the address of the CCTP contract available [here](../../../../CCTP/Contracts). | ||
- `token_messenger_address` (optional) - this is only applicable if **rebalance_method** is set to cctp. Tells the relayer to use the token messenger instead of synapse. | ||
<aside> | ||
💡 The choice of wether to use synapse cctp or the circle token messenger is up to the user. Synapse will take a fee but unlike the token messenger, will not spend any of the users gas. | ||
</aside> | ||
- `confirmations` - how many confirmations to wait before acting on an event. This will vary per-chain. | ||
- `tokens` - this is a map of token symbol→token info for this chain. For example, token may be USDC, ETH, etc | ||
- `address` - address of the token on this chain id | ||
- `decimals` - number of decimals this token uses. Please verify this against the token contract itself. | ||
- `min_quote_amount` - smallest amount to quote for a given chain. This should be balanced against expected gas spend for a relayer to be profitable. `min_quote_amount` is to be given in decimal units (so 1000.00 is 1000) | ||
- `rebalance_method` - rebalance method for this particular kind of token. Some tokens may not have a rebalance method. This is either cctp or token messenger. | ||
- `maintenance_balance_pct` - percent of liquidity that should be maintained on the given chain for this token. If the balance is under this amount a rebalance is triggered. | ||
- `initial_balance_pct` - percent of liquidity to maintain after a rebalance. | ||
- `min_rebalance_amount` - amount of this token to try to rebalance | ||
- `max_rebalance_amount` - maximum amount of this token to try to rebalance at once | ||
- `quotable_tokens`: | ||
- `quotable_tokens`: - list of [chain-id]_[token_address]: [chain-id]_[token_address]. For example 1-0x00…. could be paired with 10-0x01 | ||
```yaml | ||
"1-0x00": | ||
- "1-0x01" | ||
``` | ||
- `cctp_relayer_config`: See the [CCTP page](../../CCTP/Relayer) | ||
|
||
### Observability | ||
|
||
The RFQ relayer implements open telemetry for both tracing and metrics. Please see the [Observability](../../Observability) page for more info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
The results from the executed scripts provide us with the following insights:
-
URL Checks:
- Most URLs are functional with HTTP status 200, indicating they are accessible.
- The URL for the Golang installation guide (
https://golang.org/doc/install
) redirects (HTTP status 301), which is generally acceptable as it still leads to the correct resource. - The URL
https://iris-api.circle.com/v1/attestations
returned a 404 status, indicating that the resource is not found. This needs attention as it suggests that the provided link in the documentation is incorrect or the resource is no longer available at that location.
-
YAML Syntax Validation:
- The script intended to validate the YAML syntax did not execute as expected because the
yq
command was not found on the system where the script ran. This means we do not have validation results for the YAML configuration examples provided in the documentation.
- The script intended to validate the YAML syntax did not execute as expected because the
Given these findings, the next steps are:
- The incorrect URL (
https://iris-api.circle.com/v1/attestations
) should be corrected or updated in the documentation. - Since the YAML syntax validation could not be completed due to a technical limitation (missing
yq
command), it would be prudent to either retry this validation with a different approach or request a manual verification for the YAML configurations.
Here is the final response based on the verification results:
Attention Required: Issues Found in Documentation
- Non-functional URL: The link to the Circle API for attestations (
https://iris-api.circle.com/v1/attestations
) is not functional (HTTP status 404). Please update or correct this URL in the documentation. - YAML Syntax Validation: The YAML syntax validation could not be completed due to a missing command (
yq
) in the environment. It is recommended to manually verify the correctness of the YAML configuration examples provided in the documentation or attempt another automated validation method.
Analysis chain
Check the detailed instructions for building, running, and configuring the relayer. Ensure all links are functional and the configuration examples are correct.
The output from the executed script indicates that a manual inspection is required for the links and configuration examples in the Markdown file. However, as an AI, I can't perform manual checks directly. Instead, I can generate scripts to verify the functionality of the links and the correctness of the configuration examples programmatically.
To proceed, I will:
- Check the functionality of the links by attempting to resolve them.
- Validate the syntax of the YAML configuration examples provided in the document.
Let's start with these tasks.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the functionality of links and correctness of configuration examples in the Markdown file.
# Test: Check links and configuration syntax. Expect: All links functional and configurations correct.
echo "Manual inspection required for links and configuration examples."
Length of output: 138
Script:
#!/bin/bash
# Check if the URLs are reachable
# List of URLs to check
urls=(
"https://golang.org/doc/install"
"https://github.com/synapsecns/sanguine"
"https://github.com/synapsecns/sanguine/pkgs/container/sanguine%2Frfq-relayer"
"https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-configuration.html"
"https://github.com/synapsecns/sanguine/tree/master/contrib/screener-api#screening-api"
"https://iris-api.circle.com/v1/attestations"
)
# Loop through each URL and check HTTP status code
for url in "${urls[@]}"; do
echo "Checking URL: $url"
http_status=$(curl -o /dev/null -s -w "%{http_code}\n" --head "$url")
echo "HTTP Status: $http_status"
done
# Validate YAML syntax using yq
echo "Validating YAML syntax:"
echo 'submitter_config:
chains:
1:
supports_eip_1559: true
gas_estimate: 1000000
database:
type: sqlite
dsn: /tmp/db
signer:
type: GCP
file: /config/signer.txt
screener_api_url: "http://screener-url"
rfq_url: "http://rfq-api"
omnirpc_url: "http://omnirpc"
rebalance_interval: 2m
relayer_api_port: "8081"
base_chain_config:
confirmations: 0
origin_gas_estimate: 130_000
dest_gas_estimate: 110_000
quote_offset_bps: 2
native_token: ETH
quote_pct: 90
min_gas_token: 1000000000000000000
fixed_fee_multiplier: 1.25
chains:
1:
rfq_address: "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E"
synapse_cctp_address: "0x12715a66773BD9C54534a01aBF01d05F6B4Bd35E"
token_messenger_address: "0xbd3fa81b58ba92a82136038b25adec7066af3155"
cctp_start_block: 19341000
confirmations: 2
tokens:
USDC:
address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
decimals: 6
price_usd: 1.0
min_quote_amount: 10000
rebalance_method: "circlecctp"
maintenance_balance_pct: 20
initial_balance_pct: 34
max_rebalance_amount: 500000
ETH:
address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
decimals: 18
price_usd: 2600
quotable_tokens:
10-0x0b2c639c533813f4aa9d7837caf62653d097ff85:
- "1-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
1-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48:
- "10-0x0b2c639c533813f4aa9d7837caf62653d097ff85"
1-0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE:
- "10-0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
10-0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE:
- "1-0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
fee_pricer:
gas_price_cache_ttl: 60
token_price_cache_ttl: 60
cctp_relayer_config:
cctp_type: "circle"
circle_api_url: "https://iris-api.circle.com/v1/attestations"
chains:
- chain_id: 1
synapse_cctp_address: "0x12715a66773BD9C54534a01aBF01d05F6B4Bd35E"
token_messenger_address: "0xbd3fa81b58ba92a82136038b25adec7066af3155"
- chain_id: 10
synapse_cctp_address: "0x12715a66773BD9C54534a01aBF01d05F6B4Bd35E"
token_messenger_address: "0x2B4069517957735bE00ceE0fadAE88a26365528f"
base_omnirpc_url: "http://omnirpc"
unbonded_signer:
type: GCP
file: /config/signer.txt
http_backoff_initial_interval_ms: 1000
http_backoff_max_elapsed_time_ms: 300000' | yq eval
Length of output: 5000
Description
Supersedes #2603 as that issue got completely polluted debugging PaloAltoNetworks/docusaurus-openapi-docs#580 (comment)
adds new docs
Summary by CodeRabbit
New Features
Documentation
Bug Fixes
Refactor