Skip to content
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

Devnet #1274

Closed
wants to merge 67 commits into from
Closed

Devnet #1274

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
3ba5121
docker first pass
trajan0x Aug 22, 2023
810cc76
fix omnirpc port default behavior
trajan0x Aug 22, 2023
5d8803e
Merge branch 'fix/omnirpc-default-value' into feat/devnet-up
trajan0x Aug 22, 2023
055c992
Docker-compose updates
trajan0x Aug 22, 2023
3ff2c54
add guide for adding new go modules
trajan0x Aug 23, 2023
d28bd00
typo fix
trajan0x Aug 23, 2023
3103cfb
indentation fix
trajan0x Aug 23, 2023
1b7b662
kink fix
trajan0x Aug 23, 2023
65f18a4
remove vanity
trajan0x Aug 23, 2023
adc5182
devnet fix
trajan0x Aug 23, 2023
4debd76
Merge branch 'master' into feat/devnet-up
trajan0x Aug 23, 2023
788352d
backup for max attempt change
trajan0x Aug 23, 2023
60dd2b7
hi
trajan0x Aug 23, 2023
dcb10a6
make retry defaults more sensible
trajan0x Aug 23, 2023
fa75718
lint fix
trajan0x Aug 23, 2023
8103585
Revert "hi"
trajan0x Aug 23, 2023
38207af
Merge branch 'feat/retry-sane-defaults' into feat/devnet-up #1275
trajan0x Aug 23, 2023
869947a
test
trajan0x Aug 23, 2023
fab4a04
omnirpc chains endpoint
trajan0x Aug 23, 2023
259f352
close response handle
trajan0x Aug 23, 2023
a314e12
actually close response
trajan0x Aug 23, 2023
6d72362
Merge branch 'feat/omnirpc-chains-endpoint' into feat/devnet-up
trajan0x Aug 23, 2023
ee81b8c
more fixes
trajan0x Aug 24, 2023
9ffa4ce
Merge branch 'master' into feat/devnet-up
trajan0x Aug 24, 2023
e86bdf6
wip
trajan0x Aug 30, 2023
f704454
forge install: solmate
trajan0x Aug 30, 2023
a0db120
newmates
trajan0x Aug 30, 2023
e2fb52e
Merge branch 'master' into feat/devnet-up
trajan0x Aug 30, 2023
5ec4f60
create3
trajan0x Aug 30, 2023
9cc6493
create3factory
trajan0x Aug 31, 2023
47ee5f9
custom config path
trajan0x Sep 2, 2023
396c6e7
Revert "custom config path"
trajan0x Sep 2, 2023
969a6cd
deploy config defaults
trajan0x Sep 2, 2023
f778d25
Revert "deploy config defaults"
trajan0x Sep 2, 2023
e27e95b
devnet check
trajan0x Sep 2, 2023
982bbd6
basic updates
trajan0x Sep 2, 2023
3d2367e
factory fixes
trajan0x Sep 2, 2023
c4f7ba0
cleanup
trajan0x Sep 2, 2023
d9e229a
devnet up/down
trajan0x Sep 2, 2023
6973c88
first pass
trajan0x Sep 3, 2023
76418d5
Merge branch 'master' into feat/devnet-up
trajan0x Sep 3, 2023
ee6d9bd
guard it up
trajan0x Sep 3, 2023
5f97a51
guard
trajan0x Sep 3, 2023
ee7588f
1 notary
trajan0x Sep 3, 2023
e71379c
fix merge conflicts
trajan0x Sep 9, 2023
3866cd9
Merge branch 'master' into feat/devnet-up
trajan0x Sep 14, 2023
133cad4
Merge branch 'master' into feat/devnet-up
trajan0x Sep 14, 2023
7b9c09e
Merge branch 'master' into feat/devnet-up
trajan0x Sep 14, 2023
3f4da19
more updates
trajan0x Sep 14, 2023
d7f56e8
fix wrong domain in deploy script
trajan0x Sep 14, 2023
eae76f2
Merge branch 'domain-fix' into feat/devnet-up (#1376, fixes issue int…
trajan0x Sep 14, 2023
cf17957
diff fix
trajan0x Sep 14, 2023
8b8f252
comment fix
trajan0x Sep 14, 2023
380e962
Merge branch 'domain-fix' into feat/devnet-up
trajan0x Sep 14, 2023
8102b92
agent proof updates
trajan0x Sep 14, 2023
0f395bc
synapse domain fix
trajan0x Sep 14, 2023
5298a14
Merge branch 'domain-fix' into feat/devnet-up
trajan0x Sep 14, 2023
b54c0e2
generic linter fix
trajan0x Sep 14, 2023
1df2f9e
get guard to boot [goreleaser]
trajan0x Sep 14, 2023
ccbfe34
merge #1248
trajan0x Sep 15, 2023
f7c6787
more yaml lint
trajan0x Sep 15, 2023
a603db3
some nice debugging tools
trajan0x Sep 15, 2023
8d42d1b
generic linter fix
trajan0x Sep 15, 2023
44700a6
finish devnet
trajan0x Sep 15, 2023
eaca30b
fix lint commandS
trajan0x Sep 15, 2023
7992a2d
d
trajan0x Sep 15, 2023
03a8b00
wrap up rudimentary devneT
trajan0x Sep 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ coverage:

# from go.work file
flags:
# note: go.work flags should be in order of the directory structure
# also, if you're using multiple module names, you're doing something wrong
agents:
paths:
- agents/
Expand Down
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.github
.vscode

node_modules
**/node_modules
1 change: 1 addition & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -591,3 +591,4 @@ jobs:
remove-labels: 'needs-go-generate-${{matrix.package}}'
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ needs.issue_number.outputs.issue_number }}

3 changes: 3 additions & 0 deletions .github/workflows/goreleaser-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ jobs:
push: true
file: ./docker/goreleaser/Dockerfile
# TODO this needs to be versioned
# Note: this automatically pushes the latest tag for sanguine-goreleaser even on branched workflows. While unlikely,
# this could break local devnets that rely on working versions of this image and as such the latest tag should only be pushed on master
# additionally, tags representing a specific version rather than the hash of the file should be considered for future use.
tags: ghcr.io/synapsecns/sanguine-goreleaser:latest,${{ steps.name-export.outputs.TAG_NAME }}
cache-from: type=registry,ref=ghcr.io/synapsecns/sanguine-goreleaser:buildcache
cache-to: type=registry,ref=ghcr.io/synapsecns/sanguine-goreleaser:buildcache,mode=max
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ codecov/
# fasthttp
fastcache.tmp*

#vercel

# ignore all go built files in local dirs
main
**/.vercel
.devnet/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
[submodule "services/cctp-relayer/external/synapse-contracts"]
path = services/cctp-relayer/external/synapse-contracts
url = https://github.com/synapsecns/synapse-contracts
[submodule "packages/contracts-core/lib/solmate"]
path = packages/contracts-core/lib/solmate
url = https://github.com/transmissions11/solmate
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,10 @@ Use the above commands to recompile the packages.
## Dealing with submodules

This repo make use of [multiple](.gitattributes) [submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules). To avoid issues when checking out different branches, you can use `git submodule update --init --recursive` after switching to a branch or `git checkout feat/branch-name --recurse-submodules` when switching branches.

# Building Agents Locally

<!-- TODO: we need to move this thing into an ops docs package. Given that the docs are still a work in progress, I'm leaving this here for now. -->
<!-- Actually, it's unclear if this belongs in a contributing.md file, the docs or both. Maybe a symlink? -->

In order to minimize risks coming from extraneous dependencies or supply chain attacks in a production like enviornment, all distributed images are built as [scratch](https://hub.docker.com/_/scratch) or [distroless](https://github.com/GoogleContainerTools/distroless#distroless-container-images) images. Builder containers are also not used to restrict the build enviornment to the [goreleaser container](https://github.com/synapsecns/sanguine/pkgs/container/sanguine-goreleaser). All production images are kept in the `docker/` file as `[dir].Dockerfile`. Local
21 changes: 21 additions & 0 deletions docker/devnet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Local contains dockerfiles for local development. These files should be able to be built from the root of the repo without any external dependencies.

These don't need to be made for every package, just those involved in devnet.

# Let's keep track of commands here we'll need in our devnet script

1. cd `docker/devnet`
2. `docker compose build --progress=plain`

## Default Port Map:

| Container | Port |
|------------------------|------|
| omnirpc | 9001 |
| chain_a (chain_id: 42) | 8042 |
| chain_b (chain_id: 43) | 8043 |
| chain_c (chain_id: 44) | 8044 |
| scribe | 9002 |



25 changes: 25 additions & 0 deletions docker/devnet/agents.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ghcr.io/synapsecns/sanguine-goreleaser:latest as builder

ARG VERSION=v0.0.0

COPY ./services /app/services
COPY ./agents /app/agents
COPY ./core /app/core
COPY ./ethergo /app/ethergo
COPY ./tools /app/tools
COPY ./contrib /app/contrib
COPY ./go.work /app/go.work
COPY ./go.work.sum /app/go.work.sum
COPY ./.git /app/.git

WORKDIR /app/agents

RUN --mount=type=cache,target=/root/go/pkg/mod GOPROXY=https://proxy.golang.org go mod download -x
RUN --mount=type=cache,target=/root/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build CC=gcc CXX=g++ go build -tags=netgo,osusergo -ldflags="-s -w -extldflags '-static'" -o /app/bin/agents main.go

FROM ubuntu:latest

RUN apt update && apt install -y bash sqlite3 htop
COPY --from=builder /app/bin/agents /usr/local/bin

CMD ["agents"]
53 changes: 53 additions & 0 deletions docker/devnet/config/executor-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# The `db_config` field specifies the database type and the source (either a path or a connection string).
db_config:
# Must be mysql or sqlite.
type: sqlite
# Source is either a path (for sqlite) or a connection string (for mysql).
source: '/config/synapse.db'

# The base omnirpc url which each chain's collection of RPC's will be proxied through.
base_omnirpc_url: http://omnirpc:9001
execute_interval: 5
summit_chain_id: 42
summit_address: 0x1EC96ab1Fdb92565A0839b12d42c13c8135f6c11
inbox_address: 0x2eB68A0C21413aA78055F6F7F262De56979aFBEa

# For each chain (including the Summit chain), specify the origin and destination addresses.
# For remote chains, also specify the light inbox address.
chains:
- chain_id: 42
origin_address: 0xD755a6D98C4557c66ebbD9D76f1BEbC48e84afa0
destination_address: 0x7219284B26F44B2A584827034422a33450635f7A
- chain_id: 43
origin_address: 0xD755a6D98C4557c66ebbD9D76f1BEbC48e84afa0
destination_address: 0x7219284B26F44B2A584827034422a33450635f7A
light_inbox_address: 0xa6A694d8D2430964DcD11f2E649649Fc9557a56b
- chain_id: 44
origin_address: 0xD755a6D98C4557c66ebbD9D76f1BEbC48e84afa0
destination_address: 0x7219284B26F44B2A584827034422a33450635f7A
light_inbox_address: 0xa6A694d8D2430964DcD11f2E649649Fc9557a56b

# The `unbonded_signer` field specifies the path to the file containing the private key of the signer
unbonded_signer:
type: 'File'
file: '/config/executor-signer.txt'

submitter_config:
chains:
42:
supports_eip_1559: true
gas_estimate: 7500000
43:
gas_bump_percentage: 40
is_l2: true
gas_estimate: 7500000
44:
gas_bump_percentage: 40
is_l2: true
gas_estimate: 7500000

scribe_config:
type: 'remote'
port: 9002
url: 'scribe'

1 change: 1 addition & 0 deletions docker/devnet/config/executor-signer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
103a9ef39d4ced2988f1d5084460ebf8ea3baea2b2ca78265b637e48d99dce82
1 change: 1 addition & 0 deletions docker/devnet/config/guard-bonded-signer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b31048b0aa87649bdb9016c0ee28c788ddfc45e52cd71cc0da08c47cb4390ae7
66 changes: 66 additions & 0 deletions docker/devnet/config/guard-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# The `db_config` field specifies the database type and the source (either a path or a connection string).
db_config:
# Must be mysql or sqlite.
type: sqlite
# Source is either a path (for sqlite) or a connection string (for mysql).
source: '/data/synapse.db'

# The base omnirpc url which each chain's collection of RPC's will be proxied through.
base_omnirpc_url: http://omnirpc:9001
refresh_interval_seconds: 5

# For each chain (domain), specify the necessary contracts. ***** TODO: Update this *****
domains:
domain_client1:
domain_id: 43
type: EVM
required_confirmations: 0
origin_address: 0xD755a6D98C4557c66ebbD9D76f1BEbC48e84afa0
domain_client2:
domain_id: 42
type: EVM
required_confirmations: 0
origin_address: 0xD755a6D98C4557c66ebbD9D76f1BEbC48e84afa0
summit_address: 0x1EC96ab1Fdb92565A0839b12d42c13c8135f6c11
inbox_address: 0x2eB68A0C21413aA78055F6F7F262De56979aFBEa
domain_client3:
domain_id: 44
type: EVM
required_confirmations: 0
origin_address: 0xD755a6D98C4557c66ebbD9D76f1BEbC48e84afa0

# Specify the summit domain id
summit_domain_id: 42
# Guards have a `domain_id` of 0.
domain_id: 0

# The `unbonded_signer` field specifies the path to the file containing the private key of the signer
unbonded_signer:
type: 'File'
file: '/config/guard-bonded-signer.txt'

# The `bonded_signer` is the account that will post a bond to the Summit contract. Specify its path to
# the file containing the private key of the signer
bonded_signer:
type: 'File'
file: '/config/guard-bonded-signer.txt'

# The `submitter_config` field specifies how the submitter should submit messages to the chains.
submitter_config:
chains:
42:
supports_eip_1559: true
gas_estimate: 7500000
43:
gas_bump_percentage: 40
is_l2: true
gas_estimate: 7500000
44:
gas_bump_percentage: 40
is_l2: true
gas_estimate: 7500000

scribe_config:
type: 'remote'
port: 9002
url: 'scribe'
1 change: 1 addition & 0 deletions docker/devnet/config/notary43-bonded-signer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d5c561f92921a5d7eb8a91cc81cb392d1877dcc6b856260c1676cb28ef7203b0
73 changes: 73 additions & 0 deletions docker/devnet/config/notary43-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# The `db_config` field specifies the database type and the source (either a path or a connection string).
db_config:
# Must be mysql or sqlite.
type: sqlite
# Source is either a path (for sqlite) or a connection string (for mysql).
source: '/config/synapse.db'

# The base omnirpc url which each chain's collection of RPC's will be proxied through.
base_omnirpc_url: http://omnirpc:9001
refresh_interval_seconds: 5

# For each chain (domain), specify the necessary contracts.
# Remotes need: origin_address, destination_address, light_inbox_address, light_manager_address
# Summit needs: origin_address, destination_address, summit_address, inbox_address, bonding_manager_address
domains:
domain_client43:
domain_id: 43
type: EVM
required_confirmations: 0
origin_address: 0xD755a6D98C4557c66ebbD9D76f1BEbC48e84afa0
destination_address: 0x7219284B26F44B2A584827034422a33450635f7A
light_inbox_address: 0xa6A694d8D2430964DcD11f2E649649Fc9557a56b
light_manager_address: 0x807A8d4469DD803B9b2c9e3568D5E83784bec25D
domain_client44:
domain_id: 44
type: EVM
required_confirmations: 0
origin_address: 0xD755a6D98C4557c66ebbD9D76f1BEbC48e84afa0
destination_address: 0x7219284B26F44B2A584827034422a33450635f7A
light_inbox_address: 0xa6A694d8D2430964DcD11f2E649649Fc9557a56b
light_manager_address: 0x807A8d4469DD803B9b2c9e3568D5E83784bec25D
domain_client42:
domain_id: 42
type: EVM
required_confirmations: 0
# for some reason, origin and summit addresses are switched on synchain
origin_address: 0xD755a6D98C4557c66ebbD9D76f1BEbC48e84afa0
summit_address: 0x1EC96ab1Fdb92565A0839b12d42c13c8135f6c11
inbox_address: 0x2eB68A0C21413aA78055F6F7F262De56979aFBEa
destination_address: 0x7219284B26F44B2A584827034422a33450635f7A
bonding_manager_address: 0x27006519C5786863fAE35612Da9E0f0622ff8c58


# Specify the summit domain id
summit_domain_id: 42
# A Notary's `domain_id` is the domain id of the chain it has posted a bond for.
domain_id: 43

# The `unbonded_signer` field specifies the path to the file containing the private key of the signer
unbonded_signer:
type: 'File'
file: '/config/notary-bonded-signer.txt'

# The `bonded_signer` is the account that will post a bond to the Summit contract. Specify its path to
# the file containing the private key of the signer
bonded_signer:
type: 'File'
file: '/config/notary-bonded-signer.txt'

# The `submitter_config` field specifies how the submitter should submit messages to the chains.
submitter_config:
chains:
42:
supports_eip_1559: true
gas_estimate: 7500000
43:
gas_bump_percentage: 40
is_l2: true
gas_estimate: 7500000
44:
gas_bump_percentage: 40
is_l2: true
gas_estimate: 7500000
1 change: 1 addition & 0 deletions docker/devnet/config/notary44-bonded-signer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f466f6f4d2d61a11eddd10eb80aae500c7601539d08d1d55f9e5efe25ecf95bc
73 changes: 73 additions & 0 deletions docker/devnet/config/notary44-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# The `db_config` field specifies the database type and the source (either a path or a connection string).
db_config:
# Must be mysql or sqlite.
type: sqlite
# Source is either a path (for sqlite) or a connection string (for mysql).
source: '/config/synapse.db'

# The base omnirpc url which each chain's collection of RPC's will be proxied through.
base_omnirpc_url: http://omnirpc:9001
refresh_interval_seconds: 5

# For each chain (domain), specify the necessary contracts.
# Remotes need: origin_address, destination_address, light_inbox_address, light_manager_address
# Summit needs: origin_address, destination_address, summit_address, inbox_address, bonding_manager_address
domains:
domain_client43:
domain_id: 43
type: EVM
required_confirmations: 0
origin_address: 0xD755a6D98C4557c66ebbD9D76f1BEbC48e84afa0
destination_address: 0x7219284B26F44B2A584827034422a33450635f7A
light_inbox_address: 0xa6A694d8D2430964DcD11f2E649649Fc9557a56b
light_manager_address: 0x807A8d4469DD803B9b2c9e3568D5E83784bec25D
domain_client44:
domain_id: 44
type: EVM
required_confirmations: 0
origin_address: 0xD755a6D98C4557c66ebbD9D76f1BEbC48e84afa0
destination_address: 0x7219284B26F44B2A584827034422a33450635f7A
light_inbox_address: 0xa6A694d8D2430964DcD11f2E649649Fc9557a56b
light_manager_address: 0x807A8d4469DD803B9b2c9e3568D5E83784bec25D
domain_client42:
domain_id: 42
type: EVM
required_confirmations: 0
# for some reason, origin and summit addresses are switched on synchain
origin_address: 0xD755a6D98C4557c66ebbD9D76f1BEbC48e84afa0
summit_address: 0x1EC96ab1Fdb92565A0839b12d42c13c8135f6c11
inbox_address: 0x2eB68A0C21413aA78055F6F7F262De56979aFBEa
destination_address: 0x7219284B26F44B2A584827034422a33450635f7A
bonding_manager_address: 0x27006519C5786863fAE35612Da9E0f0622ff8c58


# Specify the summit domain id
summit_domain_id: 42
# A Notary's `domain_id` is the domain id of the chain it has posted a bond for.
domain_id: 44

# The `unbonded_signer` field specifies the path to the file containing the private key of the signer
unbonded_signer:
type: 'File'
file: '/config/notary-bonded-signer.txt'

# The `bonded_signer` is the account that will post a bond to the Summit contract. Specify its path to
# the file containing the private key of the signer
bonded_signer:
type: 'File'
file: '/config/notary-bonded-signer.txt'

# The `submitter_config` field specifies how the submitter should submit messages to the chains.
submitter_config:
chains:
42:
supports_eip_1559: true
gas_estimate: 7500000
43:
gas_bump_percentage: 40
is_l2: true
gas_estimate: 7500000
44:
gas_bump_percentage: 40
is_l2: true
gas_estimate: 7500000
Loading
Loading