Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
68ef608
fixes
pgherveou Sep 29, 2025
1f92c06
taplo fmt
pgherveou Sep 29, 2025
fbdd975
Merge branch 'master' into pg/md-check
pgherveou Sep 29, 2025
075af8f
rm
pgherveou Sep 29, 2025
113cc8d
fix
pgherveou Sep 29, 2025
b2c9f2d
nit
pgherveou Sep 29, 2025
dbcde82
refactor
pgherveou Sep 29, 2025
c1a4cf5
fix
pgherveou Sep 29, 2025
be73d20
fix use runtime-path
pgherveou Sep 30, 2025
20c244d
fix
pgherveou Sep 30, 2025
703f7b5
nicer
pgherveou Sep 30, 2025
46484d5
nit
pgherveou Sep 30, 2025
be2ed67
Merge branch 'master' into pg/md-check
pgherveou Sep 30, 2025
71dac4a
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] Sep 30, 2025
15420a8
lock
pgherveou Sep 30, 2025
de55abe
let's see if CI likes this
pgherveou Sep 30, 2025
b8bb389
Merge branch 'master' into pg/md-check
pgherveou Oct 1, 2025
998a6a4
fix Docker
pgherveou Oct 1, 2025
96c5b66
wip
pgherveou Oct 1, 2025
c17c60f
use dev-node runtime
pgherveou Oct 1, 2025
364c891
rm
pgherveou Oct 1, 2025
c61fc91
fix
pgherveou Oct 1, 2025
bdda2d9
fix
pgherveou Oct 1, 2025
f316ecf
fix
pgherveou Oct 1, 2025
8dcf887
Merge branch 'master' into pg/md-check
pgherveou Oct 1, 2025
1d83c5c
rollback to using metadata
pgherveou Oct 1, 2025
695b40d
rollback
pgherveou Oct 1, 2025
c06f14a
fix
pgherveou Oct 1, 2025
a06bbc4
fix taplo
pgherveou Oct 1, 2025
c13797e
Merge branch 'master' into pg/md-check
pgherveou Oct 2, 2025
69a5d96
publish=true
pgherveou Oct 2, 2025
02b9d43
fix
pgherveou Oct 2, 2025
839e9b3
fix cargo.lock
pgherveou Oct 2, 2025
5f7a94f
force CI
pgherveou Oct 3, 2025
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
5 changes: 3 additions & 2 deletions Cargo.lock

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

9 changes: 9 additions & 0 deletions prdoc/pr_9865.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
title: '[pallet-revive] rm checked-in metadata'
doc:
- audience: Runtime Dev
description: |-
Removed eth-rpc generated metadata.
The metadata file will now be generated from the build.rs using the AH-westend runtime
crates:
- name: pallet-revive-eth-rpc
bump: patch
Binary file removed revive_chain.metadata
Binary file not shown.
4 changes: 2 additions & 2 deletions substrate/frame/revive/dev-node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "revive-dev-runtime"
description = "A solochain dev runtime for revive."
version = "0.0.0"
version = "0.1.0"
license = "Apache-2.0"
authors.workspace = true
homepage.workspace = true
repository.workspace = true
edition.workspace = true
publish = false

[dependencies]
array-bytes = { workspace = true }
Expand Down
6 changes: 6 additions & 0 deletions substrate/frame/revive/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ default-run = "eth-rpc"
[lints]
workspace = true

[package.metadata.polkadot-sdk]
exclude-from-umbrella = true

[[bin]]
name = "eth-rpc"
path = "src/main.rs"
Expand Down Expand Up @@ -53,3 +56,6 @@ substrate-cli-test-utils = { workspace = true }

[build-dependencies]
git2 = { workspace = true }
revive-dev-runtime = { workspace = true, default-features = true }
sp-io = { workspace = true, default-features = true }
sp-runtime = { workspace = true, default-features = true }
17 changes: 15 additions & 2 deletions substrate/frame/revive/rpc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use std::process::Command;
use std::{fs, process::Command};

/// Get the current branch and commit hash.
fn main() {
generate_git_revision();
generate_metadata_file();
}

fn generate_git_revision() {
let output = Command::new("rustc")
.arg("--version")
.output()
Expand Down Expand Up @@ -47,3 +51,12 @@ fn main() {
println!("cargo:rustc-env=TARGET={target}");
println!("cargo:rustc-env=GIT_REVISION={branch}-{id}");
}

fn generate_metadata_file() {
let mut ext = sp_io::TestExternalities::new(Default::default());
ext.execute_with(|| {
let metadata = revive_dev_runtime::Runtime::metadata_at_version(16).unwrap();
let bytes: &[u8] = &metadata;
fs::write("revive_chain.scale", bytes).unwrap();
});
}
14 changes: 4 additions & 10 deletions substrate/frame/revive/rpc/dockerfiles/eth-rpc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
FROM rust AS builder

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
protobuf-compiler \
clang libclang-dev
FROM docker.io/paritytech/ci-unified:latest AS builder

WORKDIR /polkadot
COPY . /polkadot
RUN rustup component add rust-src
RUN cargo build --locked --profile production -p pallet-revive-eth-rpc --bin eth-rpc

RUN cargo fetch
RUN cargo build --workspace --locked --profile production -p pallet-revive-eth-rpc --bin eth-rpc

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

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

USER polkadot
Expand Down
Binary file removed substrate/frame/revive/rpc/revive_chain.metadata
Binary file not shown.
2 changes: 1 addition & 1 deletion substrate/frame/revive/rpc/src/subxt_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
pub use subxt::config::PolkadotConfig as SrcChainConfig;

#[subxt::subxt(
runtime_metadata_path = "revive_chain.metadata",
runtime_metadata_path = "revive_chain.scale",
// TODO remove once subxt use the same U256 type
substitute_type(
path = "primitive_types::U256",
Expand Down
6 changes: 0 additions & 6 deletions umbrella/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,6 @@ node = [
"mmr-gadget",
"mmr-rpc",
"pallet-contracts-mock-network",
"pallet-revive-eth-rpc",
"pallet-transaction-payment-rpc",
"parachains-runtimes-test-utils",
"polkadot-approval-distribution",
Expand Down Expand Up @@ -2313,11 +2312,6 @@ default-features = false
optional = true
path = "../substrate/frame/contracts/mock-network"

[dependencies.pallet-revive-eth-rpc]
default-features = false
optional = true
path = "../substrate/frame/revive/rpc"

[dependencies.pallet-transaction-payment-rpc]
default-features = false
optional = true
Expand Down
4 changes: 0 additions & 4 deletions umbrella/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,10 +636,6 @@ pub use pallet_remark;
#[cfg(feature = "pallet-revive")]
pub use pallet_revive;

/// An Ethereum JSON-RPC server for pallet-revive.
#[cfg(feature = "pallet-revive-eth-rpc")]
pub use pallet_revive_eth_rpc;

/// Procedural macros used in pallet_revive.
#[cfg(feature = "pallet-revive-proc-macro")]
pub use pallet_revive_proc_macro;
Expand Down
Loading