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

Bump to v0.9.38 #775

Merged
merged 33 commits into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
de8206a
Bump to v0.9.38
yrong Feb 16, 2023
9febf3d
Remove ethereum-light-client from workspace
yrong Feb 16, 2023
d35682c
Merge branch 'main' into ron/polkadot-v0.9.38
yrong Feb 17, 2023
bff60de
Fix ci breaking
yrong Feb 17, 2023
6992e15
Merge branch 'main' into ron/polkadot-v0.9.38
yrong Feb 17, 2023
7c99eaa
Remove snowbridge-xcm-support from runtime
yrong Feb 17, 2023
a0beb42
Fix ci
yrong Feb 17, 2023
b86673f
Move initialize script to hook
yrong Feb 17, 2023
249fae3
Fix ci test
yrong Feb 17, 2023
98eb8a6
Refactor: move to initialize hook & some cleanup
yrong Feb 17, 2023
103b84c
For ci
yrong Feb 17, 2023
a7af5f9
Fix husky
yrong Feb 17, 2023
62f7623
Fix: speed test
yrong Feb 17, 2023
5f4a7dc
Update foundry libs with submodule
yrong Feb 18, 2023
efff171
Upgrade go-substrate-rpc-client & stop-gap of relaychain
yrong Feb 20, 2023
ceee06b
For #12345 and #12530
yrong Feb 18, 2023
cc0f9b7
env for goerli
yrong Feb 21, 2023
8d09c51
Fix for production deployment
yrong Feb 21, 2023
1872f16
Sync dependencies from release
yrong Feb 21, 2023
01d5dab
Remove test parachain node
yrong Feb 24, 2023
6e8069a
More cleanup
yrong Feb 24, 2023
4a6b4e0
Merge branch 'main' into ron/polkadot-v0.9.38
yrong Feb 24, 2023
9a92e23
Use host runner
yrong Feb 24, 2023
ba05c70
Merge branch 'main' into ron/polkadot-v0.9.38
yrong Feb 24, 2023
083b904
Fix wrong commit
yrong Feb 24, 2023
3207d7d
Sync dev setup
yrong Feb 26, 2023
f5bbe8f
Sync pnpm-lock file & Remove fmt in CI
yrong Feb 26, 2023
0bacc10
Fix format[skip ci]
yrong Feb 26, 2023
7906e3d
Sync toolchain[skip ci]
yrong Feb 26, 2023
1d2b6c7
Fix for geth 1.11
yrong Feb 28, 2023
a4ded38
Suppress warning in building parachain
yrong Mar 2, 2023
b38ed13
Merge branch 'main' into ron/polkadot-v0.9.38
yrong Mar 2, 2023
4fe758d
Ron/polkadot v0.9.38 12857 (#780)
yrong Mar 3, 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
14 changes: 8 additions & 6 deletions .github/workflows/ethereum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ name: ethereum
on:
push:
paths:
- 'core/**'
- '!core/**/README.md'
- "core/**"
- "!core/**/README.md"
branches:
- main
pull_request:
paths:
- 'core/**'
- '!core/**/README.md'
- "core/**"
- "!core/**/README.md"

jobs:
build:
runs-on: ubuntu-22.04
runs-on: snowbridge-runner
timeout-minutes: 15
steps:
- uses: actions/checkout@v1
Expand All @@ -27,11 +27,13 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18.12.1
cache: 'pnpm'
cache: "pnpm"
cache-dependency-path: core/pnpm-lock.yaml
- name: Install dependencies
working-directory: core
run: pnpm install --frozen-lockfile
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Build
working-directory: core
run: pnpm build
Expand Down
62 changes: 17 additions & 45 deletions .github/workflows/parachain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,20 @@ name: parachain
on:
push:
paths:
- 'parachain/**'
- '!parachain/README.md'
- '!parachain/LICENSE'
- "parachain/**"
- "!parachain/README.md"
- "!parachain/LICENSE"
branches:
- main
pull_request:
paths:
- 'parachain/**'
- '!parachain/README.md'
- '!parachain/LICENSE'
- "parachain/**"
- "!parachain/README.md"
- "!parachain/LICENSE"
workflow_dispatch:

jobs:
fmt:
runs-on: ubuntu-20.04
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
RUSTFLAGS: -C debuginfo=1
SKIP_WASM_BUILD: 1
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('parachain/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: wasm32-unknown-unknown
components: rustfmt
- name: cargo fmt
run: cd parachain && cargo +nightly fmt -- --check --config-path rustfmt.toml && cd -

check:
runs-on: ubuntu-20.04
runs-on: snowbridge-runner
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
Expand All @@ -66,22 +39,21 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.62.1
toolchain: nightly-2022-11-15
target: wasm32-unknown-unknown
- name: cargo check
uses: actions-rs/cargo@v1
with:
command: check
toolchain: 1.62.1
toolchain: nightly-2022-11-15
args: >-
--manifest-path parachain/Cargo.toml
--workspace
--exclude snowbridge
--features runtime-benchmarks

test:
needs: check
runs-on: ubuntu-20.04
runs-on: snowbridge-runner
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
Expand All @@ -99,10 +71,11 @@ jobs:
key: ${{ runner.os }}-cargo-${{ hashFiles('parachain/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- uses: arduino/setup-protoc@v1
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.62.1
toolchain: nightly-2022-11-15
target: wasm32-unknown-unknown
- name: test beacon client with minimal feature
uses: actions-rs/cargo@v1
Expand All @@ -114,7 +87,7 @@ jobs:
--package snowbridge-ethereum-beacon-client
--features runtime-benchmarks
--features minimal
toolchain: 1.62.1
toolchain: nightly-2022-11-15
- uses: actions-rs/[email protected]
with:
crate: cargo-tarpaulin
Expand All @@ -127,12 +100,11 @@ jobs:
args: >-
--manifest-path parachain/Cargo.toml
--verbose --workspace
--exclude snowbridge
--exclude snowbridge-runtime
--exclude snowblink-runtime
--exclude snowbridge
--exclude snowbridge-runtime
--exclude snowblink-runtime
--exclude snowbase-runtime
--exclude-files '*/mock.rs,*/tests.rs'
--features runtime-benchmarks
--avoid-cfg-tarpaulin
--coveralls ${{ secrets.COVERALLS_REPO_TOKEN }}
toolchain: 1.62.1
toolchain: nightly-2022-11-15
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
release:
runs-on: ubuntu-20.04
runs-on: snowbridge-runner
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: 1
Expand All @@ -25,14 +25,14 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable-2022-01-20
toolchain: nightly-2022-11-15
target: wasm32-unknown-unknown
- name: build
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path parachain/Cargo.toml --release
args: --manifest-path parachain/Cargo.toml --workspace --release
- uses: actions/upload-artifact@v1
with:
name: artemis-node
path: parachain/target/release/artemis-node
name: snowbridge-node
path: parachain/target/release/snowbridge
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ node_modules/
# asdf plugin versions
.tool-versions

relaychain/
/relaychain/
.vscode

.rustup
Expand Down
7 changes: 5 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ echo 'Running pre-commit hook...'
chronic typos .

# lint and format for core contracts and typescript codes
cd core && chronic pnpm lint && chronic pnpm format && cd ..
(cd core && chronic pnpm lint && chronic pnpm format)

# lint and format for relayer codes
cd relayer && chronic mage lint && chronic go fmt ./...
(cd relayer && chronic mage lint && chronic go fmt ./...)

# cargo fmt
(cd parachain && SKIP_WASM_BUILD= cargo fmt --all)

echo 'Pre-commit hook successful!'
1 change: 1 addition & 0 deletions core/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.turbo
.deps
6 changes: 4 additions & 2 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
"lint": "turbo run lint",
"format": "turbo run format",
"size": "turbo run size",
"coverage": "turbo run coverage"
"coverage": "turbo run coverage",
"remixd": "./node_modules/.bin/remixd"
},
"devDependencies": {
"husky": "^8.0.1",
"turbo": "^1.6.3",
"pnpm-deduplicate": "^0.4.1"
"pnpm-deduplicate": "^0.4.1",
"@remix-project/remixd": "^0.6.1"
}
}
1 change: 1 addition & 0 deletions core/packages/contracts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ cache/
broadcast/
test/ffiWrapper.js
tsconfig.tsbuildinfo
test/**/data/*.json.keep
6 changes: 3 additions & 3 deletions core/packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "hardhat compile && pnpm build:ffi",
"build": "pnpm build:sol && pnpm build:ffi",
"build:sol": "forge build",
"build:ffi": "esbuild ./test/ffiWrapper.ts --bundle --platform=node --outfile=./test/ffiWrapper.js",
"lint": "pnpm lint:solhint && pnpm lint:eslint",
Expand All @@ -20,8 +20,8 @@
"format": "prettier --write 'contracts/**/*.sol' 'test/**/*.ts'",
"size": "hardhat size-contracts",
"coverage": "hardhat coverage --testfiles 'test/*.ts'",
"test": "hardhat test",
"test:foundry": "pnpm build:ffi && forge test -vvv",
"test": "pnpm test:foundry",
"test:foundry": "pnpm build && forge test -vvv",
"deploy:foundry": "forge script --rpc-url http://127.0.0.1:8545/ contracts/deploy/foundry/Deploy.sol:DeployScript --broadcast -vvvv"
},
"devDependencies": {
Expand Down
28 changes: 15 additions & 13 deletions core/packages/contracts/scripts/generateContractInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@ const run = async () => {
for (let transaction of deploymentInfo.transactions) {
if (transaction.transactionType === "CREATE") {
let contractName = transaction.contractName;
let contractInfo = { address: transaction.contractAddress };
let contractBuildingInfo = JSON.parse(
fs.readFileSync(
path.join(
BuildInfoDir,
contractName + ".sol",
contractName + ".json"
),
"utf8"
)
);
contractInfo.abi = contractBuildingInfo.abi;
contracts[contractName] = contractInfo;
if (contractName) {
let contractInfo = { address: transaction.contractAddress };
let contractBuildingInfo = JSON.parse(
fs.readFileSync(
path.join(
BuildInfoDir,
contractName + ".sol",
contractName + ".json"
),
"utf8"
)
);
contractInfo.abi = contractBuildingInfo.abi;
contracts[contractName] = contractInfo;
}
}
}
fs.writeFileSync(DestFile, JSON.stringify({ contracts }, null, 2), "utf8");
Expand Down
1 change: 1 addition & 0 deletions core/packages/test/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dist/
genesis.ssz

*.log
*.log.keep
rococo-local-raw.json
rococo-local.json

Expand Down
36 changes: 0 additions & 36 deletions core/packages/test/config/launch-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,39 +65,3 @@ id = 1000
name = "snowbrige-bob"
validator = true
args = ["--enable-offchain-indexing=true","--pruning=archive"]

# Test Parachain
[[parachains]]
add_to_genesis = true
chain_spec_path = "{{output_dir}}/test_spec.json"
cumulus_based = true
id = 1001

[[parachains.collators]]
command = "{{output_bin_dir}}/snowbridge-test-node"
name = "test-parachain-alice"
rpc_port = 8083
validator = true
ws_port = 13144

[[parachains.collators.env]]
name = "RUST_LOG"
value = "runtime=debug,parachain=trace,cumulus-collator=trace,aura=trace,xcm=trace"

[[parachains.collators]]
command = "{{output_bin_dir}}/snowbridge-test-node"
name = "test-parachain-bob"
validator = true

# XCM Channels
[[hrmp_channels]]
max_capacity = 8
max_message_size = 512
recipient = 1000
sender = 1001

[[hrmp_channels]]
max_capacity = 8
max_message_size = 512
recipient = 1001
sender = 1000
20 changes: 13 additions & 7 deletions core/packages/test/scripts/build-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ rebuild_relaychain(){
popd
}

# Only for debug purpose when relaychain branch not released
build_relaychain_from_source(){
if [ ! -d "$relaychain_dir" ] ; then
echo "clone polkadot project to $relaychain_dir"
git clone https://github.com/paritytech/polkadot.git $relaychain_dir
fi
pushd $relaychain_dir
git fetch origin && git checkout release-$relaychain_version
cargo build --release
cp "$relaychain_dir/target/release/polkadot" "$output_bin_dir"
popd
}

build_parachain()
{
echo "Runtime is $parachain_runtime"
Expand All @@ -44,13 +57,6 @@ build_parachain()
--bin snowbridge-query-events
cp "$parachain_dir/target/release/snowbridge-query-events" "$output_bin_dir"

echo "Building test parachain"
cargo build \
--manifest-path utils/test-parachain/Cargo.toml \
--release \
--bin snowbridge-test-node
cp "$test_collator_bin" "$output_bin_dir"

cd -
}

Expand Down
2 changes: 1 addition & 1 deletion core/packages/test/scripts/deploy-ethereum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ start_geth() {
geth --vmdebug --datadir "$ethereum_data_dir" --networkid 15 \
--http --http.api debug,personal,eth,net,web3,txpool,engine,miner --ws --ws.api debug,eth,net,web3 \
--rpc.allow-unprotected-txs --mine --miner.threads=1 \
--miner.etherbase=0x0000000000000000000000000000000000000000 \
--miner.etherbase=0xBe68fC2d8249eb60bfCf0e71D5A0d2F2e292c4eD \
--authrpc.addr="127.0.0.1" \
--http.addr="127.0.0.1" \
--allow-insecure-unlock \
Expand Down
Loading