Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/p-1283-migrate-rpc-method-and-in…
Browse files Browse the repository at this point in the history
…frastructure-to-request-and-verify' into p-1282-migrate-rpc-method-and-infrastructure-to-request-and-verify
  • Loading branch information
silva-fj committed Jan 27, 2025
2 parents 76884a4 + d3c4833 commit e493426
Show file tree
Hide file tree
Showing 53 changed files with 482 additions and 237 deletions.
51 changes: 45 additions & 6 deletions .github/workflows/check-runtime-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,49 @@ jobs:
with:
fetch-depth: 0

- name: Run ${{ matrix.runtime.name }} try-runtime check
uses: BillyWooo/[email protected]
- name: Download try-runtime-cli
run: |
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.8.0/try-runtime-x86_64-unknown-linux-musl -o try-runtime
chmod +x ./try-runtime
mv try-runtime parachain
shell: bash

- name: Install Protoc
uses: arduino/[email protected]
with:
runtime-package: ${{ matrix.runtime.package }}
node-uri: ${{ matrix.runtime.uri }}
checks: "all"
extra-args: ""
version: "3.6.1"

- name: Add wasm32-unknown-unknown target
run: rustup target add wasm32-unknown-unknown
shell: bash

- name: Add rust-src component
run: rustup component add rust-src
shell: bash

- name: Build ${{ matrix.runtime.name }}
run: |
cd parachain
cargo build --profile production -p ${{ matrix.runtime.package }} --features try-runtime -q --locked
shell: bash

- name: Check migrations
run: |
cd parachain
PACKAGE_NAME=${{ matrix.runtime.package }}
RUNTIME_BLOB_NAME=$(echo $PACKAGE_NAME | sed 's/-/_/g').compact.compressed.wasm
RUNTIME_BLOB_PATH=./target/production/wbuild/$PACKAGE_NAME/$RUNTIME_BLOB_NAME
export RUST_LOG=remote-ext=debug,runtime=debug
# Store the command in a variable so we can log it
COMMAND="./try-runtime \
--runtime $RUNTIME_BLOB_PATH \
on-runtime-upgrade --disable-mbm-checks --blocktime 12000000 \
live --uri ${{ matrix.runtime.uri }}"
# Echo the command before running it, for debugging purposes
echo "Running command:"
echo "$COMMAND"
eval "$COMMAND"
shell: bash
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ test-cargo-all-benchmarks:

.PHONY: test-ts-litentry ## Run litentry ts tests without clean-up
test-ts-litentry: launch-network-litentry
@cd parachain && ./scripts/run-ts-test.sh litentry
@trap "./scripts/clean-network.sh" EXIT; cd parachain && ./scripts/run-ts-test.sh litentry

.PHONY: test-ts-paseo ## Run paseo ts tests without clean-up
test-ts-paseo: launch-network-paseo
@cd parachain && ./scripts/run-ts-test.sh paseo
@trap "./scripts/clean-network.sh" EXIT; cd parachain && ./scripts/run-ts-test.sh paseo

# clean up
.PHONY: clean-network ## Clean up the network launched by 'launch-network'
Expand All @@ -105,11 +105,13 @@ fmt-cargo:
@cd parachain && cargo fmt --all
@cd tee-worker && cargo fmt --all
@cd tee-worker/identity/enclave-runtime && cargo fmt --all
@cd tee-worker/omni-executor && cargo fmt --all

.PHONY: fmt-taplo ## taplo fmt
fmt-taplo:
@cd parachain && RUST_LOG=error taplo fmt
@cd tee-worker && RUST_LOG=error taplo fmt
@cd tee-worker/omni-executor && RUST_LOG=error taplo fmt

.PHONY: fmt-ts ## ts fmt
fmt-ts:
Expand Down Expand Up @@ -141,5 +143,5 @@ clean-all-build:
@echo "Clean tee-worker/identity..."
@cd tee-worker/identity && make clean

@echo "Clean tee-worker/omni-worker..."
@cd tee-worker/omni-worker && make distclean
@echo "Clean tee-worker/omni-executor..."
@cd tee-worker/omni-executor && make distclean
26 changes: 13 additions & 13 deletions parachain/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 7 additions & 19 deletions parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ cumulus-relay-chain-interface = { git = "https://github.com/paritytech/polkadot-
cumulus-test-relay-sproof-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407", default-features = false }

# evm-tracing, use the astar version to use "standard" substrate frame to avoid any conflicts
moonbeam-primitives-ext = { git = "https://github.com/AstarNetwork/Astar", tag = "v5.45.0", default-features = false }
moonbeam-rpc-debug = { git = "https://github.com/AstarNetwork/Astar", tag = "v5.45.0" }
moonbeam-rpc-primitives-debug = { git = "https://github.com/AstarNetwork/Astar", tag = "v5.45.0", default-features = false }
moonbeam-rpc-primitives-txpool = { git = "https://github.com/AstarNetwork/Astar", tag = "v5.45.0", default-features = false }
moonbeam-rpc-trace = { git = "https://github.com/AstarNetwork/Astar", tag = "v5.45.0", default-features = false }
moonbeam-rpc-txpool = { git = "https://github.com/AstarNetwork/Astar", tag = "v5.45.0", default-features = false }
moonbeam-evm-tracer = { git = "https://github.com/AstarNetwork/Astar", tag = "v5.45.0", default-features = false }
moonbeam-primitives-ext = { git = "https://github.com/litentry/moonbeam-vendor-rpc", default-features = false }
moonbeam-rpc-debug = { git = "https://github.com/litentry/moonbeam-vendor-rpc" }
moonbeam-rpc-primitives-debug = { git = "https://github.com/litentry/moonbeam-vendor-rpc", default-features = false }
moonbeam-rpc-primitives-txpool = { git = "https://github.com/litentry/moonbeam-vendor-rpc", default-features = false }
moonbeam-rpc-trace = { git = "https://github.com/litentry/moonbeam-vendor-rpc", default-features = false }
moonbeam-rpc-txpool = { git = "https://github.com/litentry/moonbeam-vendor-rpc", default-features = false }
moonbeam-evm-tracer = { git = "https://github.com/litentry/moonbeam-vendor-rpc", default-features = false }

# polkadot client
polkadot-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2407" }
Expand Down Expand Up @@ -314,15 +314,3 @@ pallet-investing-pool = { path = "pallets/collab-ai/investing-pool", default-fea

[patch.crates-io]
ring = { git = "https://github.com/betrusted-io/ring-xous", branch = "0.16.20-cleanup" }

# TODO: investigate further if the overwriting is still valid
[patch."https://github.com/AstarNetwork/frontier"]
fc-api = { git = "https://github.com/paritytech/frontier", branch = "stable2407" }
fc-consensus = { git = "https://github.com/paritytech/frontier", branch = "stable2407" }
fc-db = { git = "https://github.com/paritytech/frontier", branch = "stable2407" }
fc-rpc = { git = "https://github.com/paritytech/frontier", branch = "stable2407" }
fc-rpc-core = { git = "https://github.com/paritytech/frontier", branch = "stable2407" }
fc-storage = { git = "https://github.com/paritytech/frontier", branch = "stable2407" }
fp-evm = { git = "https://github.com/paritytech/frontier", branch = "stable2407" }
fp-rpc = { git = "https://github.com/paritytech/frontier", branch = "stable2407" }
pallet-evm = { git = "https://github.com/paritytech/frontier", branch = "stable2407" }
4 changes: 2 additions & 2 deletions parachain/scripts/clean-network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ esac
ZOMBIENET_BIN=zombienet-${os}-${arch}
ZOMBIENET_PID=$(pidof $ZOMBIENET_BIN)

if [ -z $ZOMBIENET_PID ]; then
if [ -z "$ZOMBIENET_PID" ]; then
# the network might not be started with zombienet
killall polkadot || true
killall litentry-collator || true
else
kill -2 $ZOMBIENET_PID
fi

docker ps -q -f name=geth | xargs -r docker stop
docker ps -q -f name=geth | xargs -r docker stop

rm -rf "$LITENTRY_PARACHAIN_DIR"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@ where
additional_extrinsic_params,
);
let xt = compose_extrinsic_offline!(&self.signer, call, extrinsic_params).encode();
log::info!("extrinsic created: {}", hex::encode(&xt));
log::info!("extrinsic nonce: {}", nonce_value);
log::info!("extrinsic hash: {}", hex::encode(blake2_256(&xt)));
log::info!(
"extrinsic created with nonce: {}, hash: {}",
nonce_value,
hex::encode(blake2_256(&xt))
);
nonce_value += 1;
xt
})
Expand Down
11 changes: 1 addition & 10 deletions tee-worker/identity/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,7 @@ log*
**/*.rs.bk

# binaries
bin/*.so
bin/litentry-*
bin/*.wasm

# sealed data
bin/*.bin

# public RSA key
bin/rsa_pubkey.txt
bin/ecc_pubkey.txt
bin/*

# VS Code settings
.vscode
Expand Down
Empty file.
1 change: 0 additions & 1 deletion tee-worker/identity/bin/README.md

This file was deleted.

2 changes: 2 additions & 0 deletions tee-worker/omni-executor/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ target/
.idea/
**/*.bin

storage_db

cache
omni-executor.manifest
omni-executor.manifest.sgx
Expand Down
15 changes: 15 additions & 0 deletions tee-worker/omni-executor/.taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
include = ["Cargo.toml", "**/Cargo.toml"]

[formatting]
array_auto_expand = false
array_auto_collapse = false
indent_string = " "
inline_table_expand = false

[[rule]]
include = ["Cargo.toml", "**/Cargo.toml"]
keys = ["dependencies", "target", "patch", "workspace", "workspace.dependencies", "workspace.package", "features"]

[rule.formatting]
reorder_keys = true
array_auto_expand = true
Loading

0 comments on commit e493426

Please sign in to comment.