Skip to content

Commit a697dd0

Browse files
pgherveougithub-actions[bot]
authored andcommitted
[pallet-revive] rm checked-in metadata (#9865)
Removed eth-rpc generated metadata. The metadata file will now be generated from the build.rs using the AH-westend runtime --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 37da202 commit a697dd0

File tree

11 files changed

+40
-27
lines changed

11 files changed

+40
-27
lines changed

Cargo.lock

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

prdoc/pr_9865.prdoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
title: '[pallet-revive] rm checked-in metadata'
2+
doc:
3+
- audience: Runtime Dev
4+
description: |-
5+
Removed eth-rpc generated metadata.
6+
The metadata file will now be generated from the build.rs using the AH-westend runtime
7+
crates:
8+
- name: pallet-revive-eth-rpc
9+
bump: patch

revive_chain.metadata

-63.8 KB
Binary file not shown.

substrate/frame/revive/dev-node/runtime/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
22
name = "revive-dev-runtime"
33
description = "A solochain dev runtime for revive."
4-
version = "0.0.0"
4+
version = "0.1.0"
5+
license = "Apache-2.0"
56
authors.workspace = true
67
homepage.workspace = true
78
repository.workspace = true
89
edition.workspace = true
9-
publish = false
1010

1111
[dependencies]
1212
array-bytes = { workspace = true }

substrate/frame/revive/rpc/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ default-run = "eth-rpc"
1212
[lints]
1313
workspace = true
1414

15+
[package.metadata.polkadot-sdk]
16+
exclude-from-umbrella = true
17+
1518
[[bin]]
1619
name = "eth-rpc"
1720
path = "src/main.rs"
@@ -56,3 +59,6 @@ substrate-cli-test-utils = { workspace = true }
5659

5760
[build-dependencies]
5861
git2 = { workspace = true }
62+
revive-dev-runtime = { workspace = true, default-features = true }
63+
sp-io = { workspace = true, default-features = true }
64+
sp-runtime = { workspace = true, default-features = true }

substrate/frame/revive/rpc/build.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@
1414
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515
// See the License for the specific language governing permissions and
1616
// limitations under the License.
17-
use std::process::Command;
17+
use std::{fs, process::Command};
1818

19-
/// Get the current branch and commit hash.
2019
fn main() {
20+
generate_git_revision();
21+
generate_metadata_file();
22+
}
23+
24+
fn generate_git_revision() {
2125
let output = Command::new("rustc")
2226
.arg("--version")
2327
.output()
@@ -47,3 +51,12 @@ fn main() {
4751
println!("cargo:rustc-env=TARGET={target}");
4852
println!("cargo:rustc-env=GIT_REVISION={branch}-{id}");
4953
}
54+
55+
fn generate_metadata_file() {
56+
let mut ext = sp_io::TestExternalities::new(Default::default());
57+
ext.execute_with(|| {
58+
let metadata = revive_dev_runtime::Runtime::metadata_at_version(16).unwrap();
59+
let bytes: &[u8] = &metadata;
60+
fs::write("revive_chain.scale", bytes).unwrap();
61+
});
62+
}

substrate/frame/revive/rpc/dockerfiles/eth-rpc/Dockerfile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
1-
FROM rust AS builder
2-
3-
RUN apt-get update && \
4-
DEBIAN_FRONTEND=noninteractive apt-get install -y \
5-
protobuf-compiler \
6-
clang libclang-dev
1+
FROM docker.io/paritytech/ci-unified:latest AS builder
72

83
WORKDIR /polkadot
94
COPY . /polkadot
10-
RUN rustup component add rust-src
11-
RUN cargo build --locked --profile production -p pallet-revive-eth-rpc --bin eth-rpc
5+
6+
RUN cargo fetch
7+
RUN cargo build --workspace --locked --profile production -p pallet-revive-eth-rpc --bin eth-rpc
128

139
FROM docker.io/parity/base-bin:latest
1410
COPY --from=builder /polkadot/target/production/eth-rpc /usr/local/bin
1511

1612
USER root
1713
RUN useradd -m -u 1001 -U -s /bin/sh -d /polkadot polkadot && \
18-
# unclutter and minimize the attack surface
1914
rm -rf /usr/bin /usr/sbin && \
20-
# check if executable works in this container
2115
/usr/local/bin/eth-rpc --help
2216

2317
USER polkadot
-64.9 KB
Binary file not shown.

substrate/frame/revive/rpc/src/subxt_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
pub use subxt::config::PolkadotConfig as SrcChainConfig;
2121

2222
#[subxt::subxt(
23-
runtime_metadata_path = "revive_chain.metadata",
23+
runtime_metadata_path = "revive_chain.scale",
2424
// TODO remove once subxt use the same U256 type
2525
substitute_type(
2626
path = "primitive_types::U256",

umbrella/Cargo.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,6 @@ node = [
874874
"mmr-gadget",
875875
"mmr-rpc",
876876
"pallet-contracts-mock-network",
877-
"pallet-revive-eth-rpc",
878877
"pallet-transaction-payment-rpc",
879878
"parachains-runtimes-test-utils",
880879
"polkadot-approval-distribution",
@@ -2313,11 +2312,6 @@ default-features = false
23132312
optional = true
23142313
path = "../substrate/frame/contracts/mock-network"
23152314

2316-
[dependencies.pallet-revive-eth-rpc]
2317-
default-features = false
2318-
optional = true
2319-
path = "../substrate/frame/revive/rpc"
2320-
23212315
[dependencies.pallet-transaction-payment-rpc]
23222316
default-features = false
23232317
optional = true

0 commit comments

Comments
 (0)