Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d2b9407
Repo structure refactor
Jan 2, 2023
69a6e93
cosmwasm: fix contract after faulty merge
Jan 2, 2023
9ccc5ea
.github: remove unused dependabot config
Jan 2, 2023
e5dbb52
Fix path references in .github and .pre-commit-config.yml
Jan 2, 2023
5cc6134
.github: Rename attester references to pyth-wormhole-attester
Jan 2, 2023
aa6657c
.pre-commit-config.yaml: fix paths and run all commit hooks
Jan 2, 2023
a393d33
p2w-relay: Fix faulty merge resolution in favor of origin/main
Jan 2, 2023
3a1354b
Dockerfile.pyth_relay: Fix Ethereum path reference
Jan 2, 2023
020b6c4
Dockerfile.solana: Trip early cache with arbitrary change
Jan 2, 2023
3883381
Dockerfile.pyth_relay: typo
Jan 2, 2023
33e332c
p2w-relay: fix evm build in npm script
Jan 2, 2023
b0ba87e
Dockerfile.solana: Retry invalidating cache again
Jan 2, 2023
20c8766
near -> target-chains/near
Jan 3, 2023
ff0a8b3
wormhole-attester: bump on/off-chain major versions due to rename
Jan 3, 2023
b404597
Dockerfile.solana: Improve decoy-crate to have a real lib target
Jan 3, 2023
0239c1a
.github/[...]/pyth-cosmwasm-contract.yml: typo
Jan 3, 2023
fe69009
rust-toolchain: Bump rust to stable 1.63
Jan 3, 2023
5130db4
rust-toolchain: use christmas nightly
Jan 3, 2023
ef6be58
empty commit to trigger build
Jan 4, 2023
6ead9b2
Merge remote-tracking branch 'origin/main' into drozdziak1/repo-struc…
Jan 4, 2023
e923bba
attester-image-push.yaml: keep xc-attest image name intact
Jan 4, 2023
8447868
multisig-wh-message-builder: remove accidental revert
Jan 4, 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
28 changes: 0 additions & 28 deletions .github/dependabot.yml

This file was deleted.

7 changes: 3 additions & 4 deletions .github/workflows/attester-image-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and Push Attester Image
on:
push:
tags:
- pyth-attester-v*
- pyth-wormhole-attester-v*
workflow_dispatch:
inputs:
dispatch_description:
Expand All @@ -18,13 +18,13 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set image tag to version of the git tag
if: ${{ startsWith(github.ref, 'refs/tags/pyth-attester-v') }}
if: ${{ startsWith(github.ref, 'refs/tags/pyth-wormhole-attester-v') }}
run: |
PREFIX="refs/tags/pyth-attester-"
VERSION="${GITHUB_REF:${#PREFIX}}"
echo "IMAGE_TAG=${VERSION}" >> "${GITHUB_ENV}"
- name: Set image tag to the git commit hash
if: ${{ !startsWith(github.ref, 'refs/tags/pyth-attester-v') }}
if: ${{ !startsWith(github.ref, 'refs/tags/pyth-wormhole-attester-v') }}
run: |
echo "IMAGE_TAG=${{ github.sha }}" >> "${GITHUB_ENV}"
- uses: aws-actions/configure-aws-credentials@8a84b07f2009032ade05a88a28750d733cc30db1
Expand All @@ -37,7 +37,6 @@ jobs:
env:
AWS_REGION: us-east-1
- run: |
DOCKER_BUILDKIT=1 docker build -f Dockerfile.client -t bridge-client .
DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f third_party/pyth/Dockerfile.p2w-attest .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ethereum-contract.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
on:
pull_request:
paths:
- ethereum/**
- target-chains/ethereum/**
- third_party/pyth/xc-governance-sdk-js/**
push:
branches:
- main
paths:
- ethereum/**
- target-chains/ethereum/**
- third_party/pyth/xc-governance-sdk-js/**

name: Ethereum Contract
Expand All @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ethereum/
working-directory: target-chains/ethereum/
steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/price-service-image-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
env:
AWS_REGION: us-east-1
- run: |
DOCKER_BUILDKIT=1 docker build -f Dockerfile.wasm -o type=local,dest=. .
DOCKER_BUILDKIT=1 docker build -f tilt-devnet/docker-images/Dockerfile.wasm -o type=local,dest=. .
DOCKER_BUILDKIT=1 docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f third_party/pyth/price-service/Dockerfile.price_service .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pyth-cosmwasm-contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: Pyth CosmWasm Contract
on:
pull_request:
paths:
- cosmwasm/**
- target-chains/cosmwasm/**
- third_party/pyth/p2w-sdk/rust/**
push:
branches:
- main
paths:
- cosmwasm/**
- target-chains/cosmwasm/**
- third_party/pyth/p2w-sdk/rust/**

env:
Expand All @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cosmwasm/contracts/pyth
working-directory: target-chains/cosmwasm/contracts/pyth
steps:
- uses: actions/checkout@v2
- name: Build
Expand Down
24 changes: 12 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,51 +22,51 @@ repos:
language: "rust"
entry: cargo +nightly fmt --manifest-path ./pythnet/remote-executor/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: pythnet/remote-executor/
files: pythnet/remote-executor
- id: cargo-clippy-remote-executor
name: Cargo clippy for remote executor
language: "rust"
entry: cargo +nightly clippy --manifest-path ./pythnet/remote-executor/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: pythnet/remote-executor/
files: pythnet/remote-executor
# Hooks for the attester
- id: cargo-fmt-attester
name: Cargo format for attester
language: "rust"
entry: cargo +nightly fmt --manifest-path ./solana/pyth2wormhole/Cargo.toml --all -- --config-path rustfmt.toml
entry: cargo +nightly fmt --manifest-path ./wormhole-attester/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: solana/pyth2wormhole/
files: wormhole-attester
- id: cargo-clippy-attester
name: Cargo clippy for attester
language: "rust"
entry: |
bash -c 'EMITTER_ADDRESS=0 BRIDGE_ADDRESS=0 cargo +nightly clippy --manifest-path \
./solana/pyth2wormhole/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings'
./wormhole-attester/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings'
pass_filenames: false
files: solana/pyth2wormhole/
files: wormhole-attester
# Hooks for cosmwasm contract
- id: cargo-fmt-cosmwasm
name: Cargo format for cosmwasm contract
language: "rust"
entry: cargo +nightly fmt --manifest-path ./cosmwasm/Cargo.toml --all -- --config-path rustfmt.toml
entry: cargo +nightly fmt --manifest-path ./target-chains/cosmwasm/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: cosmwasm/
files: target-chains/cosmwasm
- id: cargo-clippy-cosmwasm
name: Cargo clippy for cosmwasm contract
language: "rust"
entry: cargo +nightly clippy --manifest-path ./cosmwasm/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
entry: cargo +nightly clippy --manifest-path ./target-chains/cosmwasm/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: cosmwasm/
files: target-chains/cosmwasm
# Hooks for p2w-sdk/rust
- id: cargo-fmt-p2w-sdk
name: Cargo format for p2w-sdk
language: "rust"
entry: cargo +nightly fmt --manifest-path ./third_party/pyth/p2w-sdk/rust/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: third_party/pyth/p2w-sdk/rust/
files: third_party/pyth/p2w-sdk/rust
- id: cargo-clippy-p2w-sdk
name: Cargo clippy for p2w-sdk
language: "rust"
entry: cargo +nightly clippy --manifest-path ./third_party/pyth/p2w-sdk/rust/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: third_party/pyth/p2w-sdk/rust/
files: third_party/pyth/p2w-sdk/rust
3 changes: 0 additions & 3 deletions Dockerfile.prometheus

This file was deleted.

56 changes: 24 additions & 32 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ def k8s_yaml_with_ns(objects):

local_resource(
name = "wasm-gen",
cmd = "tilt docker build -- -f Dockerfile.wasm -o type=local,dest=. .",
cmd = "tilt docker build -- -f tilt-devnet/docker-images/Dockerfile.wasm -o type=local,dest=. .",
env = {"DOCKER_BUILDKIT": "1"},
deps = "./wormhole-attester",
labels = ["wasm"],
allow_parallel=True,
trigger_mode = trigger_mode,
)


def build_node_yaml():
node_yaml = read_yaml_stream("devnet/node.yaml")
node_yaml = read_yaml_stream("tilt-devnet/k8s/node.yaml")

for obj in node_yaml:
if obj["kind"] == "StatefulSet" and obj["metadata"]["name"] == "guardian":
Expand Down Expand Up @@ -103,7 +103,7 @@ k8s_resource(
)

# spy
k8s_yaml_with_ns("devnet/spy.yaml")
k8s_yaml_with_ns("tilt-devnet/k8s/spy.yaml")

k8s_resource(
"spy",
Expand All @@ -121,23 +121,20 @@ k8s_resource(
docker_build(
ref = "bridge-client",
context = ".",
only = ["./solana"],
dockerfile = "Dockerfile.client",
# Ignore target folders from local (non-container) development.
ignore = ["./solana/*/target"],
dockerfile = "tilt-devnet/docker-images/Dockerfile.client",
)

# solana smart contract

docker_build(
ref = "solana-contract",
context = ".",
dockerfile = "Dockerfile.solana",
dockerfile = "tilt-devnet/docker-images/Dockerfile.solana",
)

# solana local devnet

k8s_yaml_with_ns("devnet/solana-devnet.yaml")
k8s_yaml_with_ns("tilt-devnet/k8s/solana-devnet.yaml")

k8s_resource(
"solana-devnet",
Expand All @@ -155,10 +152,7 @@ k8s_resource(
docker_build(
ref = "eth-node",
context = "./",
dockerfile = "./Dockerfile.ethereum",

# ignore local node_modules (in case they're present)
ignore = ["./ethereum/node_modules", "./third_party/pyth/xc-governance-sdk-js/node_modules"],
dockerfile = "tilt-devnet/docker-images/Dockerfile.ethereum",

# sync external scripts for incremental development
# (everything else needs to be restarted from scratch for determinism)
Expand All @@ -176,7 +170,7 @@ docker_build(
context = ".",
dockerfile = "third_party/pyth/Dockerfile.pyth",
)
k8s_yaml_with_ns("./devnet/pyth.yaml")
k8s_yaml_with_ns("./tilt-devnet/k8s/pyth.yaml")

k8s_resource(
"pyth",
Expand All @@ -189,12 +183,10 @@ k8s_resource(
docker_build(
ref = "p2w-attest",
context = ".",
only = ["./solana", "./third_party", "./pythnet"],
dockerfile = "./third_party/pyth/Dockerfile.p2w-attest",
ignore = ["./solana/*/target"],
)

k8s_yaml_with_ns("devnet/p2w-attest.yaml")
k8s_yaml_with_ns("tilt-devnet/k8s/p2w-attest.yaml")
k8s_resource(
"p2w-attest",
resource_deps = ["solana-devnet", "pyth", "guardian"],
Expand All @@ -211,7 +203,7 @@ docker_build(
dockerfile = "./third_party/pyth/Dockerfile.check-attestations",
)

k8s_yaml_with_ns("devnet/check-attestations.yaml")
k8s_yaml_with_ns("tilt-devnet/k8s/check-attestations.yaml")
k8s_resource(
"check-attestations",
resource_deps = ["pyth-price-service", "pyth", "p2w-attest"],
Expand All @@ -225,7 +217,7 @@ docker_build(
context = ".",
dockerfile = "third_party/pyth/p2w-relay/Dockerfile.pyth_relay",
)
k8s_yaml_with_ns("devnet/p2w-terra-relay.yaml")
k8s_yaml_with_ns("tilt-devnet/k8s/p2w-terra-relay.yaml")
k8s_resource(
"p2w-terra-relay",
resource_deps = ["pyth", "p2w-attest", "spy", "terra-terrad", "wasm-gen"],
Expand All @@ -235,7 +227,7 @@ k8s_resource(
labels = ["pyth"]
)

k8s_yaml_with_ns("devnet/p2w-evm-relay.yaml")
k8s_yaml_with_ns("tilt-devnet/k8s/p2w-evm-relay.yaml")
k8s_resource(
"p2w-evm-relay",
resource_deps = ["pyth", "p2w-attest", "spy", "eth-devnet", "wasm-gen"],
Expand All @@ -251,7 +243,7 @@ docker_build(
context = ".",
dockerfile = "third_party/pyth/price-service/Dockerfile.price_service",
)
k8s_yaml_with_ns("devnet/pyth-price-service.yaml")
k8s_yaml_with_ns("tilt-devnet/k8s/pyth-price-service.yaml")
k8s_resource(
"pyth-price-service",
resource_deps = ["pyth", "p2w-attest", "spy", "eth-devnet", "wasm-gen"],
Expand All @@ -268,15 +260,15 @@ docker_build(
context = "third_party/pyth/evm-watcher/",
dockerfile = "third_party/pyth/evm-watcher/Dockerfile",
)
k8s_yaml_with_ns("devnet/pyth-evm-watcher.yaml")
k8s_yaml_with_ns("tilt-devnet/k8s/pyth-evm-watcher.yaml")
k8s_resource(
"pyth-evm-watcher",
resource_deps = ["eth-devnet"],
labels = ["pyth"]
)


k8s_yaml_with_ns("devnet/eth-devnet.yaml")
k8s_yaml_with_ns("tilt-devnet/k8s/eth-devnet.yaml")

k8s_resource(
"eth-devnet",
Expand All @@ -301,17 +293,17 @@ k8s_resource(

docker_build(
ref = "terra-image",
context = "./cosmwasm/devnet",
dockerfile = "cosmwasm/devnet/Dockerfile",
context = "./target-chains/cosmwasm/devnet",
dockerfile = "./target-chains/cosmwasm/devnet/Dockerfile",
)

docker_build(
ref = "cosmwasm-contracts",
context = ".",
dockerfile = "Dockerfile.cosmwasm",
dockerfile = "tilt-devnet/docker-images/Dockerfile.cosmwasm",
)

k8s_yaml_with_ns("devnet/terra-devnet.yaml")
k8s_yaml_with_ns("tilt-devnet/k8s/terra-devnet.yaml")

k8s_resource(
"terra-terrad",
Expand Down Expand Up @@ -340,10 +332,10 @@ k8s_resource(
docker_build(
ref = "prometheus",
context = ".",
dockerfile = "Dockerfile.prometheus",
dockerfile = "tilt-devnet/docker-images/Dockerfile.prometheus",
)

k8s_yaml_with_ns("devnet/prometheus.yaml")
k8s_yaml_with_ns("tilt-devnet/k8s/prometheus.yaml")

k8s_resource(
"prometheus",
Expand All @@ -355,10 +347,10 @@ k8s_resource(
docker_build(
ref = "multisig",
context = ".",
dockerfile = "Dockerfile.multisig",
dockerfile = "tilt-devnet/docker-images/Dockerfile.multisig",
)

k8s_yaml_with_ns("devnet/multisig.yaml")
k8s_yaml_with_ns("tilt-devnet/k8s/multisig.yaml")

k8s_resource(
"multisig",
Expand Down
1 change: 0 additions & 1 deletion ethereum/devnet_mnemonic.txt

This file was deleted.

2 changes: 1 addition & 1 deletion solana/pyth2wormhole/rust-toolchain → rust-toolchain
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# ci/rust-version.sh in the branch of the solana repo that corresponds
# with the version we're using.
[toolchain]
channel = "nightly-2022-02-24"
channel = "nightly-2022-12-24"
profile = "minimal"
2 changes: 0 additions & 2 deletions solana/.dockerignore

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading