Skip to content

Commit

Permalink
Merge branch 'master' into feat/relayer-arb-call
Browse files Browse the repository at this point in the history
  • Loading branch information
dwasse committed Oct 15, 2024
2 parents 94ee810 + 47ceb85 commit 337782c
Show file tree
Hide file tree
Showing 116 changed files with 4,240 additions and 580 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/solidity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
cancel_others: 'true'
slither:
name: Slither
if: ${{ needs.changes.outputs.package_count > 0 }}
if: ${{ needs.changes.outputs.package_count > 0 && needs.changes.outputs.packages != '["solidity-devops"]' }}
# see https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository
runs-on: ubuntu-latest
needs: changes
Expand Down Expand Up @@ -239,7 +239,7 @@ jobs:
gas-diff:
runs-on: ubuntu-latest
name: Foundry Gas Diff
if: ${{ needs.changes.outputs.package_count > 0 }}
if: ${{ needs.changes.outputs.package_count > 0 && needs.changes.outputs.packages != '["solidity-devops"]' }}
needs: changes
strategy:
fail-fast: false
Expand Down Expand Up @@ -267,7 +267,9 @@ jobs:
- name: Run tests and generate gas report
working-directory: './packages/${{matrix.package}}'
# Run separate set of tests (no fuzzing) to get accurate average gas cost estimates
run: forge test --mc GasBenchmark --gas-report > "../../gas-report-${{ matrix.package }}.ansi"
# Note: we use `npm run` with `--if-present` flag, allows not to define a gas:bench script in every package
# This is not natively supported by yarn yet, see: https://github.com/yarnpkg/yarn/pull/7159
run: npm run gas:bench --if-present > "../../gas-report-${{ matrix.package }}.ansi"

- name: Compare gas reports
uses: Rubilmax/foundry-gas-diff@v3.18
Expand All @@ -290,7 +292,7 @@ jobs:
size-check:
name: Foundry Size Check
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.package_count > 0 }}
if: ${{ needs.changes.outputs.package_count > 0 && needs.changes.outputs.packages != '["solidity-devops"]' }}
needs: changes
strategy:
fail-fast: false
Expand Down
13 changes: 12 additions & 1 deletion contrib/promexporter/internal/gql/dfk/models.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions docs/bridge/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,76 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.4.4](https://github.com/synapsecns/sanguine/compare/@synapsecns/bridge-docs@0.4.3...@synapsecns/bridge-docs@0.4.4) (2024-10-15)

**Note:** Version bump only for package @synapsecns/bridge-docs





## [0.4.3](https://github.com/synapsecns/sanguine/compare/@synapsecns/bridge-docs@0.4.2...@synapsecns/bridge-docs@0.4.3) (2024-10-15)

**Note:** Version bump only for package @synapsecns/bridge-docs





## [0.4.2](https://github.com/synapsecns/sanguine/compare/@synapsecns/bridge-docs@0.4.1...@synapsecns/bridge-docs@0.4.2) (2024-10-12)


### Bug Fixes

* **docs:** Fixes gh link ([#3280](https://github.com/synapsecns/sanguine/issues/3280)) ([f1dfc82](https://github.com/synapsecns/sanguine/commit/f1dfc82bc26d60262a92feda671d44a6d54a3ce1))





## [0.4.1](https://github.com/synapsecns/sanguine/compare/@synapsecns/bridge-docs@0.4.0...@synapsecns/bridge-docs@0.4.1) (2024-10-12)

**Note:** Version bump only for package @synapsecns/bridge-docs





# [0.4.0](https://github.com/synapsecns/sanguine/compare/@synapsecns/bridge-docs@0.3.11...@synapsecns/bridge-docs@0.4.0) (2024-10-10)


### Features

* **synapse-constants:** adds preinstall step ([#3269](https://github.com/synapsecns/sanguine/issues/3269)) ([acd61de](https://github.com/synapsecns/sanguine/commit/acd61de4846d9b23d7aa834b8f2eefcaae486c7d))





## [0.3.11](https://github.com/synapsecns/sanguine/compare/@synapsecns/bridge-docs@0.3.10...@synapsecns/bridge-docs@0.3.11) (2024-10-10)

**Note:** Version bump only for package @synapsecns/bridge-docs





## [0.3.10](https://github.com/synapsecns/sanguine/compare/@synapsecns/bridge-docs@0.3.9...@synapsecns/bridge-docs@0.3.10) (2024-10-08)

**Note:** Version bump only for package @synapsecns/bridge-docs





## [0.3.9](https://github.com/synapsecns/sanguine/compare/@synapsecns/bridge-docs@0.3.8...@synapsecns/bridge-docs@0.3.9) (2024-10-08)

**Note:** Version bump only for package @synapsecns/bridge-docs





## [0.3.8](https://github.com/synapsecns/sanguine/compare/@synapsecns/bridge-docs@0.3.7...@synapsecns/bridge-docs@0.3.8) (2024-10-07)

**Note:** Version bump only for package @synapsecns/bridge-docs
Expand Down
15 changes: 12 additions & 3 deletions docs/bridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,35 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati
## Generating API Docs

<!--TODO: needs to be done from ci to ensure regenration is done.-->

`yarn docusaurus gen-api-docs all`.

### Installation

```
```bash
$ yarn
```

### Local Development

```
```bash
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
```bash
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Serve

This step is needed to create a searchable index.

```bash
$ yarn serve
```
60 changes: 60 additions & 0 deletions docs/bridge/blog-posts/2024-10-10-rest-api-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
slug: rest-api-now-live
title: Announcing the Synapse REST API
# authors: [synapse]
tags: [api, update]
---

import { APIFlow } from '@site/src/components/APIFlow'

We are excited to announce the launch of the **Synapse REST API**.

Last week, we launched the Synapse REST API: [api.synapseprotocol.com](https://api.synapseprotocol.com). The new update is key in making Synapse easier to integrate for applications.

<!--truncate-->

## Summary

The REST API is a restful interface for applications to query, construct, and initiate cross-chain transactions. The service comes with supporting modules for querying liquidity, transaction status, and more. The aim of the API is to enable applications to integrate cross-chain functionality through an API call.

<figure>
<APIFlow />
<figcaption>API flow: get Quote, get txData, sign transaction</figcaption>
</figure>

## Why it Matters

The REST API makes it significantly easier for aggregators to integrate with the Synapse Bridge, complete with supplementary modules for returning key information like transaction status to users , as well as standardizing and sanitizing inputs and outputs. Rather than interact with complex contracts, aggregators can interact with a simple /bridge endpoint.

The REST API is also built with third-party developers in mind. Many people run external services around the Synapse Bridge: from arbitrage bots, to on-chain AI agents. The REST API makes it much simpler to interact with the Synapse Bridge from any environment, with just an http request. Third party developers also don't have to sacrifice complexity.

## Challenges

When building the REST API we ran into a couple challenges that have created a more robust developer experience.

*Standardizing Constants:* We needed a set of constants to verify all inputs against, so that users did not attempt to bridge or swap with unsupported assets/chains. This launch gave us the chance to standardize the Synapse Constants library, and extend this library throughout other services.

*Liquidity Warnings:* When bridging programmatically, it's harder to identify abnormalities, thus we added different endpoints to help applications retrieve liquidity parameters before bridging. Responses also include detailed information about what the expected amount will be.

## Launch Details

Structurally, the REST API is a wrapper around the Synapse SDK – the primary abstraction of the Synapse Contracts. The modules allow users to swap, bridge, and a host of other supporting functions. This level of abstraction is key for applications that want to interact with the Synapse Contracts from any framework, in a standardized manner.

This update incorporated the addition of new methods to support aggregator integrations such as:

`/bridgeTxStatus`
Enables developers to retrieve the status of any bridge transaction. Helpful for debugging as well as providing transaction level information to the user.

`/destinationTokens`
Returns a list of tokens that can be bridged to (given an input token), giving developers clarity on where they can bridge to.

`/bridgeLimits`
Returns a max/min amount of tokens to be bridged, giving an accurate representation of liquidity for any possible bridge route.

Other main changes include:
- Standardized RESTful responses, eliminated mixed response types (Markup and JSON) to now consistently return JSON for all endpoints.
- Enhanced error handling using input validations with express-validator, middleware for error handling. Includes checks for unsupported chains, bridge modules, tokens and a friendly error message indicating specific error messages.
- Architectural improvements including a traditional MVC approach, separating routes and controllers, improved code readability and organization, so we can easily compose new routes
- Development workflow updates, like yarn dev which has hot reloading so we don't need to manually stop and restart the server during development

Swagger documentation was also included in the latest release to assist developer onboarding.
4 changes: 4 additions & 0 deletions docs/bridge/blog-posts/authors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
synapse:
name: Synapse Protocol Developers
title: Synapse Protocol Developers
url: https://synapseprotocol.com
Binary file added docs/bridge/blog-posts/rest-api-flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions docs/bridge/blog-posts/welcome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
slug: welcome
title: Welcome
# authors: [synapse]
tags: [synapse]
---


We are happy to announce the **Synapse Technical Blog**!

On this blog, we will share insights, updates, and deep dives into our latest launches and developments from a developer's perspective. Here, you'll find detailed information about our newest features, APIs, and technical improvements that power Synapse Protocol.


<!--truncate-->

## What to Expect

Our blog posts will cover a range of topics, including:

- New feature launches and updates
- Technical deep dives into our architecture
- API documentation and usage guides
- Performance improvements and optimizations
- Developer tools and resources

Whether you're an integrator, a third-party developer, or just curious about the technical aspects of Synapse, this blog is for you.

## Latest Articles

Here's a list of our most recent tech blog posts:

- [REST API Now Live](2024-10-10-rest-api-post.md) - October 10, 2024
Learn about our new REST API, its features, and how it simplifies integration for developers.



## Stay Connected

To stay up-to-date with our latest tech developments:

- Follow us on [Twitter](https://twitter.com/synapseprotocol)
- Join our [Discord](https://discord.gg/synapseprotocol)
- Check out our [GitHub](https://github.com/synapsecns)

We're excited to share our journey with you as we continue to innovate and improve the Synapse Protocol. Happy reading!
Loading

0 comments on commit 337782c

Please sign in to comment.