Skip to content

Commit

Permalink
Merge branch 'master' into bko-unused-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
bkontur authored Jan 24, 2025
2 parents 443c455 + a31d26d commit 7f8a971
Show file tree
Hide file tree
Showing 23 changed files with 270 additions and 153 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build-misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,34 @@ jobs:
app-id: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_ID }}
app-key: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_KEY }}

# As part of our test fixtures we build the revive-uapi crate always with the `unstable-hostfn` feature.
# To make sure that it won't break for users downstream which are not setting this feature
# It doesn't need to produce working code so we just use a similar enough RISC-V target
check-revive-stable-uapi-polkavm:
timeout-minutes: 30
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check Rust
run: |
rustup show
rustup +nightly show
- name: Build
id: required
run: forklift cargo +nightly check -p pallet-revive-uapi --no-default-features --target riscv64imac-unknown-none-elf -Zbuild-std=core
- name: Stop all workflows if failed
if: ${{ failure() && steps.required.conclusion == 'failure' && !github.event.pull_request.head.repo.fork }}
uses: ./.github/actions/workflow-stopper
with:
app-id: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_ID }}
app-key: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_KEY }}

build-subkey:
timeout-minutes: 20
needs: [preflight]
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/misc-sync-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ on:
description: Enable runner debug logging
required: false
default: false
patch:
description: 'Patch number of the stable release we want to sync with'
required: false
default: ""

jobs:
sync-templates:
Expand Down Expand Up @@ -139,7 +143,14 @@ jobs:
rm -f "${{ env.template-path }}/src/lib.rs"
- name: Run psvm on monorepo workspace dependencies
run: psvm -o -v ${{ github.event.inputs.stable_release_branch }} -p ./Cargo.toml
run: |
patch_input="${{ github.event.inputs.patch }}"
if [[ -n "$patch_input" ]]; then
patch="-$patch_input"
else
patch=""
fi
psvm -o -v "${{ github.event.inputs.stable_release_branch }}$patch" -p ./Cargo.toml
working-directory: polkadot-sdk/
- name: Copy over required workspace dependencies
run: |
Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -644,9 +644,8 @@ macro_rules! test_dry_run_transfer_across_pk_bridge {
let transfer_amount = 10_000_000_000_000u128;
let initial_balance = transfer_amount * 10;

// Bridge setup.
// AssetHub setup.
$sender_asset_hub::force_xcm_version($destination, XCM_VERSION);
open_bridge_between_asset_hub_rococo_and_asset_hub_westend();

<$sender_asset_hub as TestExt>::execute_with(|| {
type Runtime = <$sender_asset_hub as Chain>::Runtime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ fn send_assets_over_bridge<F: FnOnce()>(send_fn: F) {
AssetHubRococo::force_xcm_version(asset_hub_westend_location(), XCM_VERSION);
BridgeHubRococo::force_xcm_version(bridge_hub_westend_location(), XCM_VERSION);

// open bridge
open_bridge_between_asset_hub_rococo_and_asset_hub_westend();

// send message over bridge
send_fn();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ pub(crate) fn bridged_roc_at_ah_westend() -> Location {
}

// WND and wWND
pub(crate) fn wnd_at_ah_westend() -> Location {
Parent.into()
}
pub(crate) fn bridged_wnd_at_ah_rococo() -> Location {
Location::new(2, [GlobalConsensus(ByGenesis(WESTEND_GENESIS_HASH))])
}
Expand Down Expand Up @@ -240,43 +237,3 @@ pub(crate) fn assert_bridge_hub_westend_message_received() {
);
})
}

pub(crate) fn open_bridge_between_asset_hub_rococo_and_asset_hub_westend() {
use testnet_parachains_constants::{
rococo::currency::UNITS as ROC, westend::currency::UNITS as WND,
};

// open AHR -> AHW
BridgeHubRococo::fund_para_sovereign(AssetHubRococo::para_id(), ROC * 5);
AssetHubRococo::open_bridge(
AssetHubRococo::sibling_location_of(BridgeHubRococo::para_id()),
[
GlobalConsensus(ByGenesis(WESTEND_GENESIS_HASH)),
Parachain(AssetHubWestend::para_id().into()),
]
.into(),
Some((
(roc_at_ah_rococo(), ROC * 1).into(),
BridgeHubRococo::sovereign_account_id_of(BridgeHubRococo::sibling_location_of(
AssetHubRococo::para_id(),
)),
)),
);

// open AHW -> AHR
BridgeHubWestend::fund_para_sovereign(AssetHubWestend::para_id(), WND * 5);
AssetHubWestend::open_bridge(
AssetHubWestend::sibling_location_of(BridgeHubWestend::para_id()),
[
GlobalConsensus(ByGenesis(ROCOCO_GENESIS_HASH)),
Parachain(AssetHubRococo::para_id().into()),
]
.into(),
Some((
(wnd_at_ah_westend(), WND * 1).into(),
BridgeHubWestend::sovereign_account_id_of(BridgeHubWestend::sibling_location_of(
AssetHubWestend::para_id(),
)),
)),
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ fn send_xcm_through_opened_lane_with_different_xcm_version_on_hops_works() {
// fund sender
AssetHubRococo::fund_accounts(vec![(AssetHubRococoSender::get().into(), amount * 10)]);

// open bridge
open_bridge_between_asset_hub_rococo_and_asset_hub_westend();

// Initially set only default version on all runtimes
let newer_xcm_version = xcm::prelude::XCM_VERSION;
let older_xcm_version = newer_xcm_version - 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ fn send_assets_over_bridge<F: FnOnce()>(send_fn: F) {
AssetHubWestend::force_xcm_version(asset_hub_rococo_location(), XCM_VERSION);
BridgeHubWestend::force_xcm_version(bridge_hub_rococo_location(), XCM_VERSION);

// open bridge
open_bridge_between_asset_hub_rococo_and_asset_hub_westend();

// send message over bridge
send_fn();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ pub(crate) fn bridged_wnd_at_ah_rococo() -> Location {
}

// ROC and wROC
pub(crate) fn roc_at_ah_rococo() -> Location {
Parent.into()
}
pub(crate) fn bridged_roc_at_ah_westend() -> Location {
Location::new(2, [GlobalConsensus(ByGenesis(ROCOCO_GENESIS_HASH))])
}
Expand Down Expand Up @@ -250,43 +247,3 @@ pub(crate) fn assert_bridge_hub_rococo_message_received() {
);
})
}

pub(crate) fn open_bridge_between_asset_hub_rococo_and_asset_hub_westend() {
use testnet_parachains_constants::{
rococo::currency::UNITS as ROC, westend::currency::UNITS as WND,
};

// open AHR -> AHW
BridgeHubRococo::fund_para_sovereign(AssetHubRococo::para_id(), ROC * 5);
AssetHubRococo::open_bridge(
AssetHubRococo::sibling_location_of(BridgeHubRococo::para_id()),
[
GlobalConsensus(ByGenesis(WESTEND_GENESIS_HASH)),
Parachain(AssetHubWestend::para_id().into()),
]
.into(),
Some((
(roc_at_ah_rococo(), ROC * 1).into(),
BridgeHubRococo::sovereign_account_id_of(BridgeHubRococo::sibling_location_of(
AssetHubRococo::para_id(),
)),
)),
);

// open AHW -> AHR
BridgeHubWestend::fund_para_sovereign(AssetHubWestend::para_id(), WND * 5);
AssetHubWestend::open_bridge(
AssetHubWestend::sibling_location_of(BridgeHubWestend::para_id()),
[
GlobalConsensus(ByGenesis(ROCOCO_GENESIS_HASH)),
Parachain(AssetHubRococo::para_id().into()),
]
.into(),
Some((
(wnd_at_ah_westend(), WND * 1).into(),
BridgeHubWestend::sovereign_account_id_of(BridgeHubWestend::sibling_location_of(
AssetHubWestend::para_id(),
)),
)),
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ fn send_xcm_through_opened_lane_with_different_xcm_version_on_hops_works() {
// fund sender
AssetHubWestend::fund_accounts(vec![(AssetHubWestendSender::get().into(), amount * 10)]);

// open bridge
open_bridge_between_asset_hub_rococo_and_asset_hub_westend();

// Initially set only default version on all runtimes
let newer_xcm_version = xcm::prelude::XCM_VERSION;
let older_xcm_version = newer_xcm_version - 1;
Expand Down
8 changes: 8 additions & 0 deletions prdoc/pr_7318.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: 'revive: Fix compilation of `uapi` crate when `unstable-hostfn` is not set'
doc:
- audience: Runtime Dev
description: This regression was introduced with some of the recent PRs. Regression
fixed and test added.
crates:
- name: pallet-revive-uapi
bump: minor
8 changes: 8 additions & 0 deletions prdoc/pr_7322.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
title: 'Bridges: emulated tests small nits/improvements'
doc:
- audience: Runtime Dev
description: |-
This PR removes the use of `open_bridge_between_asset_hub_rococo_and_asset_hub_westend`. This function was used in the generic `test_dry_run_transfer_across_pk_bridge` macro, which could cause compilation issues when used in other contexts (e.g. fellows repo).
crates:
- name: emulated-integration-tests-common
bump: patch
11 changes: 11 additions & 0 deletions prdoc/pr_7325.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
title: '[pallet-revive] eth-rpc minor fixes'
doc:
- audience: Runtime Dev
description: |-
- Add option to specify database_url from an environment variable
- Add a test-deployment.rs rust script that can be used to test deployment and call of a contract before releasing eth-rpc
- Make evm_block non fallible so that it can return an Ok response for older blocks when the runtime API is not available
- Update subxt version to integrate changes from https://github.com/paritytech/subxt/pull/1904
crates:
- name: pallet-revive-eth-rpc
bump: minor
28 changes: 11 additions & 17 deletions substrate/frame/revive/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,43 +17,43 @@ path = "src/main.rs"
name = "eth-indexer"
path = "src/eth-indexer.rs"

[[bin]]
name = "eth-rpc-tester"
path = "src/eth-rpc-tester.rs"

[[example]]
name = "deploy"
path = "examples/rust/deploy.rs"
required-features = ["example"]

[[example]]
name = "transfer"
path = "examples/rust/transfer.rs"
required-features = ["example"]

[[example]]
name = "rpc-playground"
path = "examples/rust/rpc-playground.rs"
required-features = ["example"]

[[example]]
name = "extrinsic"
path = "examples/rust/extrinsic.rs"
required-features = ["example"]

[[example]]
name = "remark-extrinsic"
path = "examples/rust/remark-extrinsic.rs"
required-features = ["example"]

[dependencies]
anyhow = { workspace = true }
clap = { workspace = true, features = ["derive"] }
clap = { workspace = true, features = ["derive", "env"] }
codec = { workspace = true, features = ["derive"] }
ethabi = { version = "18.0.0" }
futures = { workspace = true, features = ["thread-pool"] }
hex = { workspace = true }
jsonrpsee = { workspace = true, features = ["full"] }
log = { workspace = true }
pallet-revive = { workspace = true, default-features = true }
pallet-revive-fixtures = { workspace = true, default-features = true }
prometheus-endpoint = { workspace = true, default-features = true }
rlp = { workspace = true, optional = true }
rlp = { workspace = true }
sc-cli = { workspace = true, default-features = true }
sc-rpc = { workspace = true, default-features = true }
sc-rpc-api = { workspace = true, default-features = true }
Expand All @@ -62,24 +62,18 @@ sp-arithmetic = { workspace = true, default-features = true }
sp-core = { workspace = true, default-features = true }
sp-crypto-hashing = { workspace = true }
sp-weights = { workspace = true, default-features = true }
sqlx = { version = "0.8.2", features = [
"macros",
"runtime-tokio",
"sqlite",
sqlx = { version = "0.8.2", features = ["macros", "runtime-tokio", "sqlite"] }
subxt = { workspace = true, default-features = true, features = [
"reconnecting-rpc-client",
] }
subxt = { workspace = true, default-features = true, features = ["reconnecting-rpc-client"] }
subxt-signer = { workspace = true, optional = true, features = [
subxt-signer = { workspace = true, features = [
"unstable-eth",
] }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["full"] }

[features]
example = ["rlp", "subxt-signer"]

[dev-dependencies]
env_logger = { workspace = true }
pallet-revive-fixtures = { workspace = true, default-features = true }
static_init = { workspace = true }
substrate-cli-test-utils = { workspace = true }
subxt-signer = { workspace = true, features = ["unstable-eth"] }
2 changes: 1 addition & 1 deletion substrate/frame/revive/rpc/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ RUST_LOG="info,eth-rpc=debug" cargo run -p pallet-revive-eth-rpc -- --dev
Run one of the examples from the `examples` directory to send a transaction to the node:

```bash
RUST_LOG="info,eth-rpc=debug" cargo run -p pallet-revive-eth-rpc --features example --example deploy
RUST_LOG="info,eth-rpc=debug" cargo run -p pallet-revive-eth-rpc --example deploy
```

## JS examples
Expand Down
Loading

0 comments on commit 7f8a971

Please sign in to comment.