Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 1 addition & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Check jq
run: jq --version
Expand Down Expand Up @@ -45,32 +43,14 @@ jobs:
- name: Install sszgen
run: go install github.com/ferranbt/fastssz/sszgen@v0.1.4

- name: Check sszgen
run: sszgen --help

- name: Install Mage
run: go install github.com/magefile/mage@v1.15.0

- name: Check mage
run: mage --version

- name: Run Forge fmt
run: |
forge fmt overridden_contracts/ --check
id: fmt

- name: Build
run: mage build

- name: Check if go contract bindings are up-to-date
run: git diff --exit-code ./relays/contracts || (echo "The contract bindings are not up-to-date against contracts." && exit 1)

- name: Test Relayer
run: mage test

- name: Run Forge tests
run: |
cd snowbridge/contracts
forge test -vvv
id: test

run: mage test
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

76 changes: 4 additions & 72 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,75 +1,7 @@
# Getting started

## Override configuration

To make sure to use latest contracts, run the following:

```bash
./add_overridden_contracts.sh
```

## Deploy BeeyClient

Go to `snowbridge/contracts`, first rename `.env.example` to `.env` and add the following variables:

```bash
export RPC_URL=
export ETHERSCAN_API_KEY=
export PRIVATE_KEY=
```

To deploy the BeefyClient a `beefy-state.json` file is needed. Then copy it to `snowbridge/contracts` folder.

Load your .env:

```bash
source .env
```

Then run the following command:

```bash
forge script scripts/DeployBeefyLocal.sol --rpc-url ${RPC_URL} --private-key ${PRIVATE_KEY} --slow --skip-simulation --broadcast --verify --etherscan-api-key ${ETHERSCAN_API_KEY}
```

## Deploy Gateway

Go to `snowbridge/contracts`, fill in your `.env` file the following variable:

```bash
export BEEFY_CLIENT_CONTRACT_ADDRESS=
```

Load your .env:

```bash
source .env
```

Then run the following command:

```bash
forge script overridden_contracts/scripts/DeployLocalGateway.sol --rpc-url ${RPC_URL} --private-key ${PRIVATE_KEY} --slow --skip-simulation --verify --etherscan-api-key ${ETHERSCAN_API_KEY}
```

## Deploy Both Gateway and BeefyClient

Go to `snowbridge/contracts`, fill in your `.env` file the following variable:

```bash
export RPC_URL=
export ETHERSCAN_API_KEY=
export PRIVATE_KEY=
```

Load your .env:

```bash
source .env
```

Then run the following command:

```bash
forge script scripts/DeployLocal.sol --rpc-url ${RPC_URL} --private-key ${PRIVATE_KEY} --slow --skip-simulation --broadcast --verify --etherscan-api-key ${ETHERSCAN_API_KEY}
### How to update ref to the relayer:
```
go mod edit -replace "github.com/snowfork/snowbridge/relayer=github.com/moondance-labs/snowbridge/relayer@7e690e30ca32"
go mod tidy
```
23 changes: 0 additions & 23 deletions add_overridden_contracts.sh

This file was deleted.

3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ require (
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/gtank/merlin v0.1.1 // indirect
Expand Down Expand Up @@ -100,4 +99,4 @@ require (
rsc.io/tmplfunc v0.0.3 // indirect
)

replace github.com/snowfork/snowbridge/relayer => ./snowbridge/relayer
replace github.com/snowfork/snowbridge/relayer => github.com/moondance-labs/snowbridge/relayer v0.0.0-20250807101754-85ec68c7d7fc
19 changes: 11 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo=
github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk=
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
Expand Down Expand Up @@ -168,8 +170,7 @@ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI=
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg=
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM=
github.com/mimoo/StrobeGo v0.0.0-20220103164710-9a04d6ca976b h1:QrHweqAtyJ9EwCaGHBu1fghwxIPiopAHV06JlXrMHjk=
github.com/mimoo/StrobeGo v0.0.0-20220103164710-9a04d6ca976b/go.mod h1:xxLb2ip6sSUts3g1irPVHyk/DGslwQsNOo9I7smJfNU=
Expand All @@ -182,6 +183,8 @@ github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8oh
github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY=
github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU=
github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU=
github.com/moondance-labs/snowbridge/relayer v0.0.0-20250807101754-85ec68c7d7fc h1:ReCI/2bWvcqZ3F0cpaEol/kvP4g9NmeJvAiKBScBsU4=
github.com/moondance-labs/snowbridge/relayer v0.0.0-20250807101754-85ec68c7d7fc/go.mod h1:1itBTCu4rUIEjSU/cO+YD57lAs/Q5QcS/m0hpD+c1B4=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI=
Expand All @@ -205,12 +208,12 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM=
github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a h1:CmF68hwI0XsOQ5UwlBopMi2Ow4Pbg32akc4KIVCOm+Y=
github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4=
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
Expand Down
17 changes: 1 addition & 16 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,6 @@ func Build() {
}

func BuildMain() error {
err := sh.Run("sszgen", "--path", "snowbridge/relayer/relays/beacon/state", "--objs", "BlockRootsContainerMainnet,TransactionsRootContainer,WithdrawalsRootContainerMainnet,BeaconStateDenebMainnet,BeaconBlockDenebMainnet,SignedBeaconBlockDeneb,SignedBeaconBlockElectra,BeaconStateElectra,BeaconBlockElectra")
if err != nil {
return err
}

err = sh.Run("./add_overridden_contracts.sh")
if err != nil {
return err
}

err = sh.Run("./update_contract_interface.sh")
if err != nil {
return err
}

return sh.Run("go", "build", "-o", "build/tanssi-bridge-relayer", "main.go")
}

Expand All @@ -37,4 +22,4 @@ func Test() error {

func Lint() error {
return sh.Run("revive", "-config", "revive.toml", "./...")
}
}
2 changes: 1 addition & 1 deletion relays/beefy/ethereum-writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

"github.com/sirupsen/logrus"

"github.com/moondance-labs/tanssi-bridge-relayer/relays/contracts"
"github.com/snowfork/snowbridge/relayer/contracts"
"github.com/snowfork/snowbridge/relayer/chain/ethereum"
"github.com/snowfork/snowbridge/relayer/relays/beefy/bitfield"

Expand Down
2 changes: 1 addition & 1 deletion relays/beefy/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"math/big"

"github.com/holiman/uint256"
"github.com/moondance-labs/tanssi-bridge-relayer/relays/contracts"
"github.com/snowfork/snowbridge/relayer/contracts"
"github.com/sirupsen/logrus"
"github.com/snowfork/go-substrate-rpc-client/v4/types"
"github.com/snowfork/snowbridge/relayer/crypto/keccak"
Expand Down
Loading