Skip to content

Commit

Permalink
Merge branch 'master' into feat/init-interchain-contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
trajan0x committed Mar 10, 2024
2 parents 1af7853 + 5a44d2c commit 9e80bed
Show file tree
Hide file tree
Showing 556 changed files with 16,725 additions and 41,497 deletions.
10 changes: 10 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@ plugins:
enabled: true
stylelint:
enabled: true

exclude_patterns:
- '.*\\.abigen\\.go$'
- '.*\\.metadata\\.go$'
- '.*\\.pb\\.go$'
- '.*_gen.go$'
- '.*_generated.go$'
- '**/grpc/client/rest/*'
- '**/bundle/*'
- '**/generated/*'
4 changes: 0 additions & 4 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ flags:
paths:
- services/scribe/
carryforward: true
sinner:
paths:
- services/sinner/
carryforward: true
stiprelayer:
paths:
- services/stiprelayer/
Expand Down
3 changes: 3 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ reviews:
- 'WIP'
- 'DO NOT MERGE'
drafts: true

chat:
auto_reply: true
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ jobs:
run: tar cvzf ./logs.tgz /tmp/logs
- name: Upload logs to GitHub
if: failure()
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v4
with:
name: ${{matrix.package}}-logs.tgz
path: ./logs.tgz
Expand Down Expand Up @@ -346,7 +346,7 @@ jobs:
with:
working-directory: ${{matrix.package}}/
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.55.2
version: v1.56.2
# see: https://github.com/golangci/golangci-lint/issues/2654
args: --timeout=60m
env:
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/goreleaser-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed if using new-from-rev (see: https://golangci-lint.run/usage/configuration/#issues-configuration)
submodules: true


- name: Cache Docker images.
Expand Down Expand Up @@ -169,11 +168,6 @@ jobs:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x

-
name: Login to GitHub Container Registry
uses: docker/login-action@v1
Expand Down Expand Up @@ -259,7 +253,7 @@ jobs:
- name: Push Artifacts (Snapshot)
if: steps.branch-name.outputs.is_default != 'true' && steps.image_check.outputs.has_images == 'true'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{steps.project_id.outputs.project_name}}.zip
path: ${{steps.project_id.outputs.project_name}}.zip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
id: yaml-lint
with:
config_file: .yamllint.yml
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: steps.yaml-lint.outcome == 'success'
with:
name: yamllint-logfile
Expand Down
30 changes: 28 additions & 2 deletions .github/workflows/solidity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ on:
- 'packages/contracts-interchain/**'
- 'packages/contracts-rfq/**'
- '.github/workflows/solidity.yml'
- 'packages/solidity-devops/**'
push:
paths:
- 'packages/contracts-core/**'
- 'packages/contracts-interchain/**'
- 'packages/contracts-rfq/**'
- 'packages/solidity-devops/**'
- '.github/workflows/solidity.yml'

jobs:
Expand All @@ -37,6 +39,7 @@ jobs:
contracts-core: 'packages/contracts-core/**'
contracts-interchain: 'packages/contracts-interchain/**'
contracts-rfq: 'packages/contracts-rfq/**'
solidity-devops: 'packages/solidity-devops/**'
- id: length
run: |
export FILTER_LENGTH=$(echo $FILTERED_PATHS | jq '. | length')
Expand Down Expand Up @@ -79,7 +82,8 @@ jobs:
PROJECT_IDS=$(cat <<END
{
"contracts-core": "${{ secrets.VERCEL_CONTRACT_DOCS_PROJECT_ID}}",
"contracts-rfq": "${{ secrets.VERCEL_CONTRACT_RFQ_DOCS_PROJECT_ID }}"
"contracts-rfq": "${{ secrets.VERCEL_CONTRACT_RFQ_DOCS_PROJECT_ID }}",
"solidity-devops": "${{ secrets.VERCEL_DEVOPS_DOCS_PROJECT_ID }}"
}
END
)
Expand All @@ -92,6 +96,7 @@ jobs:
run: |
forge doc
cp vercel.package.json docs/package.json
- name: Deploy (Prod)
if: ${{ format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }}
run: |
Expand Down Expand Up @@ -136,31 +141,37 @@ jobs:
contents: read
steps:
- name: Checkout repository
if: ${{ matrix.package != 'solidity-devops' }}
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: 'recursive'

- name: Setup NodeJS
if: ${{ matrix.package != 'solidity-devops' }}
uses: ./.github/actions/setup-nodejs

- name: Install Foundry
if: ${{ matrix.package != 'solidity-devops' }}
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

# TODO: find a flag for this
- name: Delete Untested Files
if: ${{ matrix.package != 'solidity-devops' }}
working-directory: './packages/${{matrix.package}}'
run: |
rm -rf test/ || true
rm -rf script/ || true
- name: Build Contracts
if: ${{ matrix.package != 'solidity-devops' }}
run: |
npx lerna exec npm run build:slither
- name: Run Slither
if: ${{ matrix.package != 'solidity-devops' }}
uses: crytic/[email protected]
continue-on-error: true
id: slither
Expand All @@ -172,7 +183,7 @@ jobs:
solc-version: 0.8.17

- name: Upload SARIF file
if: ${{!github.event.repository.private}}
if: ${{!github.event.repository.private && matrix.package != 'solidity-devops'}}
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ./results.sarif
Expand All @@ -188,25 +199,31 @@ jobs:
package: ${{ fromJson(needs.changes.outputs.packages) }}
steps:
- uses: actions/checkout@v4
if: ${{ matrix.package != 'solidity-devops' }}
with:
submodules: recursive

- name: Setup Node JS
if: ${{ matrix.package != 'solidity-devops' }}
uses: ./.github/actions/setup-nodejs

- name: Installing dependencies
if: ${{ matrix.package != 'solidity-devops' }}
run: yarn install --immutable

- name: Install Foundry
if: ${{ matrix.package != 'solidity-devops' }}
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Run Foundry Tests
if: ${{ matrix.package != 'solidity-devops' }}
working-directory: './packages/${{matrix.package}}'
run: forge coverage -vvv --report lcov --report summary >> $GITHUB_STEP_SUMMARY

- name: Send Coverage (Codecov)
if: ${{ matrix.package != 'solidity-devops' }}
uses: Wandalen/[email protected]
with:
action: codecov/codecov-action@v3
Expand All @@ -231,20 +248,25 @@ jobs:
package: ${{ fromJson(needs.changes.outputs.packages) }}
steps:
- uses: actions/checkout@v4
if: ${{ matrix.package != 'solidity-devops' }}
with:
submodules: recursive

- name: Setup Node JS
if: ${{ matrix.package != 'solidity-devops' }}
uses: ./.github/actions/setup-nodejs

- name: Installing dependencies
if: ${{ matrix.package != 'solidity-devops' }}
run: yarn install --immutable

- name: Install Foundry
if: ${{ matrix.package != 'solidity-devops' }}
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Run snapshot
if: ${{ matrix.package != 'solidity-devops' }}
working-directory: './packages/${{matrix.package}}'
run: forge snapshot >> $GITHUB_STEP_SUMMARY
size-check:
Expand All @@ -258,19 +280,23 @@ jobs:
package: ${{ fromJson(needs.changes.outputs.packages) }}
steps:
- uses: actions/checkout@v4
if: ${{ matrix.package != 'solidity-devops' }}
with:
submodules: recursive

- name: Setup Node JS
if: ${{ matrix.package != 'solidity-devops' }}
uses: ./.github/actions/setup-nodejs

- name: Install Foundry
if: ${{ matrix.package != 'solidity-devops' }}
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

# This will run https://book.getfoundry.sh/reference/forge/forge-build#build-options
- name: Run forge build --sizes
if: ${{ matrix.package != 'solidity-devops' }}
run: |
forge build --sizes
working-directory: './packages/${{matrix.package}}'
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
[submodule "ethergo/internal/test-data"]
path = ethergo/internal/test-data
url = https://github.com/synapsecns/synapse-contracts
[submodule "services/explorer/external/synapse-contracts"]
path = services/explorer/external/synapse-contracts
url = https://github.com/synapsecns/synapse-contracts.git
[submodule "services/cctp-relayer/external/synapse-contracts"]
path = services/cctp-relayer/external/synapse-contracts
url = https://github.com/synapsecns/synapse-contracts
Expand Down
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ linters:
- contextcheck
- nosnakecase
- depguard
# we use core/testsuite.Err() etc that don't get caught by this linter and result in false positives.
- testifylint
# we use metrics.EndSpan and metrics.EndSpanWithErr so this gets triggered falsely
- spancheck
# simply annoying
- perfsprint
fast: false

issues:
Expand Down
35 changes: 19 additions & 16 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"editor.formatOnSave": true,
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
},
"eslint.workingDirectories": [
{"directory": "packages/contracts", "changeProcessCWD": true }
],
"eslint.nodePath": "./node_modules/eslint/bin/",
"eslint.format.enable": true,
"editorconfig.generateAuto": false,
"files.trimTrailingWhitespace": true,
"solidity.packageDefaultDependenciesContractsDirectory": "contracts",
"solidity.packageDefaultDependenciesDirectory": "lib",
"solidity.compileUsingRemoteVersion": "v0.8.17",
"solidity.formatter": "prettier"
}
"editor.formatOnSave": true,
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"eslint.workingDirectories": [
{ "directory": "packages/contracts", "changeProcessCWD": true }
],
"eslint.nodePath": "./node_modules/eslint/bin/",
"eslint.format.enable": true,
"editorconfig.generateAuto": false,
"files.trimTrailingWhitespace": true,
"solidity.packageDefaultDependenciesContractsDirectory": "contracts",
"solidity.packageDefaultDependenciesDirectory": "lib",
"solidity.compileUsingRemoteVersion": "v0.8.17",
"solidity.formatter": "prettier"
}
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,24 @@ root
│ ├── <a href="./packages/coverage-aggregator">coverage-aggregator</a>: Javascript coverage aggregator based on <a href="https://www.npmjs.com/package/nyc">nyc</a>
│ ├── <a href="./packages/docs">docs</a>: Docasaurus documentation. Note: this is not yet in use, and docs are still maintained on gitbook
│ ├── <a href="./packages/explorer-ui">explorer-ui</a>: Explorer UI
│ ├── <a href="./packages/rest-api">rest-api</a>: Rest API
│ ├── <a href="./packages/sdk-router">sdk-router</a>: SDK router
│ ├── <a href="./packages/solidity-devops">solidity-devops</a>: provides a set of tools and scripts to help with the development of Solidity smart contracts
│ ├── <a href="./packages/synapse-constants">synapse constants</a>: Constants used across synapse
│ ├── <a href="./packages/sdk-router">synapse-interface</a>: Synapse frontend code
│ ├── <a href="./packages/widget">widget</a>: Bridge Widget
├── <a href="./services">services</a>
│ ├── <a href="./services/cctp-relayer">CCTP Relayer</a>: CCTP message relayer
│ ├── <a href="./services/explorer">explorer</a>: Bridge/messaging explorer ba
│ ├── <a href="./services/stiprelayer">stiprelayer</a>: STIP relayer for rewards.
│ ├── <a href="./services/rfq">rfq</a>: RFQ contracts
│ ├── <a href="./services/scribe">scribe</a>: Generalized ethereum event logger
│ ├── <a href="./services/omnirpc">omnirpc</a>: Latency aware RPC Client used across multiple-chains at once
│ ├── <a href="./services/sinner">sinner</a>: [Synapse Interchain Network](https://interchain.synapseprotocol.com/) indexer & query interface
├── <a href="./tools">tools</a>
│ ├── <a href="./tools/abigen">abigen</a>: Used to generate abigen bindings for go
│ ├── <a href="./tools/bundle">bundle</a>: Modified version of <a href="https://pkg.go.dev/golang.org/x/[email protected]/cmd/bundle"> go bundler </a> with improved shadowing support
│ ├── <a href="./tools/modulecopier">module copier</a>: Used to copy internal modules and export methods for testing
│ ├── <a href="./tools/revertresolver">revertresolver</a>: Converts hexified solidity errors into their underlying errors.
</pre>

## Setup
Expand Down
18 changes: 9 additions & 9 deletions agents/contracts/bondingmanager/bondingmanager.abigen.go

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 9e80bed

Please sign in to comment.