Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
bbb49c7
refactor(revive): use uint64 in Counter.sol fixture
pgherveou Feb 12, 2026
baf2ce0
refactor(revive): replace k256 with sp_core::ecdsa in benchmarks
pgherveou Feb 12, 2026
24b89ef
refactor(revive): add debug log for eth_transact substrate tx hash
pgherveou Feb 12, 2026
30876c2
fix(revive): minor formatting fixes
pgherveou Feb 12, 2026
825d3b6
fix(revive): fix Transaction7702Signed RLP decoding field order
pgherveou Feb 12, 2026
490aa77
refactor(revive): upgrade to Rust 2024 edition
pgherveou Feb 12, 2026
bc56bb5
refactor(revive): use if-let chains from Rust 2024 edition
pgherveou Feb 13, 2026
6a6d944
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] Feb 13, 2026
63a7418
PR review
pgherveou Feb 13, 2026
4e98087
fixes
pgherveou Feb 13, 2026
211d333
Apply suggestion from @pgherveou
pgherveou Feb 13, 2026
cc9b2f9
fix(ci): revert accidental cargo update and bump parity-publish to 0.…
pgherveou Feb 13, 2026
2c79f83
Merge branch 'master' into pg/revive-cleanup
pgherveou Feb 13, 2026
b060e30
restore lock
pgherveou Feb 13, 2026
a35e2cc
fix(ci): downgrade parity-publish to 0.10.6 for Rust 1.88 compatibility
pgherveou Feb 13, 2026
309d83a
fix: add cargo-features for edition2024 in revive crates
pgherveou Feb 13, 2026
89b2ddc
fix(prdoc): add validate: false for Transaction7702 API change
pgherveou Feb 13, 2026
244be53
fix: remove unnecessary cargo-features for edition2024
pgherveou Feb 13, 2026
d2c0d41
Revert "fix: remove unnecessary cargo-features for edition2024"
pgherveou Feb 13, 2026
7c69b01
Merge branch 'master' into pg/revive-cleanup
pgherveou Feb 13, 2026
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
6,208 changes: 3,304 additions & 2,904 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions substrate/frame/revive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "pallet-revive"
version = "0.1.0"
authors.workspace = true
edition.workspace = true
edition = "2024"
license = "Apache-2.0"
homepage.workspace = true
repository.workspace = true
Expand All @@ -28,7 +28,6 @@ ethereum-types = { workspace = true, features = ["codec", "rlp", "serialize"] }
hex-literal = { workspace = true }
humantime-serde = { optional = true, workspace = true }
impl-trait-for-tuples = { workspace = true }
k256 = { features = ["alloc", "ecdsa"], workspace = true, optional = true }
log = { workspace = true }
num-bigint = { workspace = true }
num-integer = { workspace = true }
Expand Down Expand Up @@ -100,7 +99,6 @@ std = [
"frame-support/std",
"frame-system/std",
"humantime-serde",
"k256?/std",
"log/std",
"num-bigint/std",
"num-integer/std",
Expand Down Expand Up @@ -137,7 +135,6 @@ runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"k256",
"pallet-balances/runtime-benchmarks",
"pallet-proxy/runtime-benchmarks",
"pallet-revive-fixtures",
Expand Down
10 changes: 5 additions & 5 deletions substrate/frame/revive/fixtures/contracts/Counter.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
contract Counter {
uint256 public number;
uint64 public number;

constructor() {
number = 3;
}

function setNumber(uint256 newNumber) public returns (uint256) {
function setNumber(uint64 newNumber) public returns (uint64) {
number = newNumber;
}

Expand All @@ -18,7 +18,7 @@ contract Counter {

contract NestedCounter {
Counter public counter;
uint256 public number;
uint64 public number;


constructor() {
Expand All @@ -27,8 +27,8 @@ contract NestedCounter {
number = 7;
}

function nestedNumber() public returns (uint256) {
uint256 currentNumber = counter.setNumber(number);
function nestedNumber() public returns (uint64) {
uint64 currentNumber = counter.setNumber(number);
number++;
return currentNumber;
}
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/revive/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "pallet-revive-eth-rpc"
version = "0.1.0"
authors.workspace = true
edition.workspace = true
edition = "2024"
license = "Apache-2.0"
homepage.workspace = true
repository.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/revive/rpc/examples/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use pallet_revive::{
create1,
evm::{Account, BlockTag, ReceiptInfo, U256},
};
use pallet_revive_eth_rpc::{example::TransactionBuilder, EthRpcClient};
use pallet_revive_eth_rpc::{EthRpcClient, example::TransactionBuilder};
use std::sync::Arc;

#[tokio::main]
Expand Down
4 changes: 2 additions & 2 deletions substrate/frame/revive/rpc/examples/eth-rpc-tester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
use clap::Parser;
use jsonrpsee::http_client::HttpClientBuilder;
use pallet_revive::evm::{Account, BlockTag, ReceiptInfo};
use pallet_revive_eth_rpc::{example::TransactionBuilder, EthRpcClient};
use pallet_revive_eth_rpc::{EthRpcClient, example::TransactionBuilder};
use std::sync::Arc;
use tokio::{
io::{AsyncBufReadExt, BufReader},
process::{Child, ChildStderr, Command},
signal::unix::{signal, SignalKind},
signal::unix::{SignalKind, signal},
};

const DOCKER_CONTAINER_NAME: &str = "eth-rpc-test";
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/revive/rpc/examples/extrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use pallet_revive_eth_rpc::subxt_client::{
self, revive::calls::types::InstantiateWithCode, SrcChainConfig,
self, SrcChainConfig, revive::calls::types::InstantiateWithCode,
};
use sp_weights::Weight;
use subxt::OnlineClient;
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/revive/rpc/examples/remark-extrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// 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 pallet_revive_eth_rpc::subxt_client::{self, system::calls::types::Remark, SrcChainConfig};
use pallet_revive_eth_rpc::subxt_client::{self, SrcChainConfig, system::calls::types::Remark};
use subxt::OnlineClient;
use subxt_signer::sr25519::dev;

Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/revive/rpc/examples/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// limitations under the License.
use jsonrpsee::http_client::HttpClientBuilder;
use pallet_revive::evm::{Account, BlockTag, ReceiptInfo};
use pallet_revive_eth_rpc::{example::TransactionBuilder, EthRpcClient};
use pallet_revive_eth_rpc::{EthRpcClient, example::TransactionBuilder};
use std::sync::Arc;

#[tokio::main]
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/revive/rpc/src/apis/execution_apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub trait EthRpc {
/// Returns the balance of the account of given address.
#[method(name = "eth_getBalance")]
async fn get_balance(&self, address: Address, block: BlockNumberOrTagOrHash)
-> RpcResult<U256>;
-> RpcResult<U256>;

/// Returns information about a block by hash.
#[method(name = "eth_getBlockByHash")]
Expand Down
4 changes: 2 additions & 2 deletions substrate/frame/revive/rpc/src/block_info_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
// limitations under the License.

use crate::{
ClientError,
client::{SubscriptionType, SubstrateBlock, SubstrateBlockNumber},
subxt_client::SrcChainConfig,
ClientError,
};
use jsonrpsee::core::async_trait;
use sp_core::H256;
use std::sync::Arc;
use subxt::{backend::legacy::LegacyRpcMethods, OnlineClient};
use subxt::{OnlineClient, backend::legacy::LegacyRpcMethods};
use tokio::sync::RwLock;

/// BlockInfoProvider cache and retrieves information about blocks.
Expand Down
13 changes: 7 additions & 6 deletions substrate/frame/revive/rpc/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@
// limitations under the License.
//! The Ethereum JSON-RPC server.
use crate::{
client::{connect, Client, SubscriptionType, SubstrateBlockNumber},
DebugRpcServer, DebugRpcServerImpl, EthRpcServer, EthRpcServerImpl, PolkadotRpcServer,
PolkadotRpcServerImpl, ReceiptExtractor, ReceiptProvider, SubxtBlockInfoProvider,
SystemHealthRpcServer, SystemHealthRpcServerImpl, LOG_TARGET,
DebugRpcServer, DebugRpcServerImpl, EthRpcServer, EthRpcServerImpl, LOG_TARGET,
PolkadotRpcServer, PolkadotRpcServerImpl, ReceiptExtractor, ReceiptProvider,
SubxtBlockInfoProvider, SystemHealthRpcServer, SystemHealthRpcServerImpl,
client::{Client, SubscriptionType, SubstrateBlockNumber, connect},
};
use clap::Parser;
use futures::{future::BoxFuture, pin_mut, FutureExt};
use futures::{FutureExt, future::BoxFuture, pin_mut};
use jsonrpsee::server::RpcModule;
use sc_cli::{PrometheusParams, RpcParams, SharedParams, Signals};
use sc_service::{
TaskManager,
config::{PrometheusConfig, RpcConfiguration},
start_rpc_servers, TaskManager,
start_rpc_servers,
};
use sqlx::sqlite::SqlitePoolOptions;

Expand Down
18 changes: 9 additions & 9 deletions substrate/frame/revive/rpc/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,35 @@ pub(crate) mod runtime_api;
pub(crate) mod storage_api;

use crate::{
subxt_client::{self, revive::calls::types::EthTransact, SrcChainConfig},
BlockInfoProvider, BlockTag, FeeHistoryProvider, ReceiptProvider, SubxtBlockInfoProvider,
TracerType, TransactionInfo,
subxt_client::{self, SrcChainConfig, revive::calls::types::EthTransact},
};
use jsonrpsee::types::{error::CALL_EXECUTION_FAILED_CODE, ErrorObjectOwned};
use jsonrpsee::types::{ErrorObjectOwned, error::CALL_EXECUTION_FAILED_CODE};
use pallet_revive::{
EthTransactError,
evm::{
decode_revert_reason, Block, BlockNumberOrTag, BlockNumberOrTagOrHash, FeeHistoryResult,
Filter, GenericTransaction, HashesOrTransactionInfos, Log, ReceiptInfo, SyncingProgress,
SyncingStatus, Trace, TransactionSigned, TransactionTrace, H256,
Block, BlockNumberOrTag, BlockNumberOrTagOrHash, FeeHistoryResult, Filter,
GenericTransaction, H256, HashesOrTransactionInfos, Log, ReceiptInfo, SyncingProgress,
SyncingStatus, Trace, TransactionSigned, TransactionTrace, decode_revert_reason,
},
EthTransactError,
};
use runtime_api::RuntimeApi;
use sp_runtime::traits::Block as BlockT;
use sp_weights::Weight;
use std::{ops::Range, sync::Arc, time::Duration};
use storage_api::StorageApi;
use subxt::{
Config, OnlineClient,
backend::{
legacy::{rpc_methods::SystemHealth, LegacyRpcMethods},
legacy::{LegacyRpcMethods, rpc_methods::SystemHealth},
rpc::{
reconnecting_rpc_client::{ExponentialBackoff, RpcClient as ReconnectingRpcClient},
RpcClient,
reconnecting_rpc_client::{ExponentialBackoff, RpcClient as ReconnectingRpcClient},
},
},
config::{HashFor, Header},
ext::subxt_rpcs::rpc_params,
Config, OnlineClient,
};
use thiserror::Error;
use tokio::sync::Mutex;
Expand Down
10 changes: 5 additions & 5 deletions substrate/frame/revive/rpc/src/client/runtime_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
// limitations under the License.

use crate::{
ClientError,
client::Balance,
subxt_client::{self, SrcChainConfig},
ClientError,
};
use futures::TryFutureExt;
use pallet_revive::{
DryRunConfig, EthTransactInfo,
evm::{
Block as EthBlock, BlockNumberOrTagOrHash, BlockTag, GenericTransaction, ReceiptGasInfo,
Trace, H160, U256,
Block as EthBlock, BlockNumberOrTagOrHash, BlockTag, GenericTransaction, H160,
ReceiptGasInfo, Trace, U256,
},
DryRunConfig, EthTransactInfo,
};
use sp_core::H256;
use sp_timestamp::Timestamp;
use subxt::{error::MetadataError, ext::subxt_rpcs::UserError, Error::Metadata, OnlineClient};
use subxt::{Error::Metadata, OnlineClient, error::MetadataError, ext::subxt_rpcs::UserError};

const LOG_TARGET: &str = "eth-rpc::runtime_api";

Expand Down
7 changes: 3 additions & 4 deletions substrate/frame/revive/rpc/src/client/storage_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
// limitations under the License.

use crate::{
ClientError, H160,
subxt_client::{
self,
self, SrcChainConfig,
runtime_types::pallet_revive::storage::{AccountType, ContractInfo},
SrcChainConfig,
},
ClientError, H160,
};
use subxt::{storage::Storage, OnlineClient};
use subxt::{OnlineClient, storage::Storage};

/// A wrapper around the Substrate Storage API.
#[derive(Clone)]
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/revive/rpc/src/fee_history_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// 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 crate::{client::SubstrateBlockNumber, ClientError};
use crate::{ClientError, client::SubstrateBlockNumber};
use pallet_revive::evm::{Block, FeeHistoryResult, ReceiptInfo};
use sp_core::U256;
use std::{collections::BTreeMap, sync::Arc};
Expand Down
4 changes: 2 additions & 2 deletions substrate/frame/revive/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

use client::ClientError;
use jsonrpsee::{
core::{async_trait, RpcResult},
core::{RpcResult, async_trait},
types::{ErrorCode, ErrorObjectOwned},
};
use pallet_revive::evm::*;
use sp_core::{keccak_256, H160, H256, U256};
use sp_core::{H160, H256, U256, keccak_256};
use thiserror::Error;
use tokio::time::Duration;

Expand Down
12 changes: 6 additions & 6 deletions substrate/frame/revive/rpc/src/receipt_extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use crate::{
client::{runtime_api::RuntimeApi, SubstrateBlock, SubstrateBlockNumber},
ClientError, H160, LOG_TARGET,
client::{SubstrateBlock, SubstrateBlockNumber, runtime_api::RuntimeApi},
subxt_client::{
SrcChainConfig,
revive::{
calls::types::EthTransact,
events::{ContractEmitted, EthExtrinsicRevert},
},
SrcChainConfig,
},
ClientError, H160, LOG_TARGET,
};

use futures::{stream, StreamExt};
use futures::{StreamExt, stream};
use pallet_revive::{
create1,
evm::{GenericTransaction, Log, ReceiptGasInfo, ReceiptInfo, TransactionSigned, H256, U256},
evm::{GenericTransaction, H256, Log, ReceiptGasInfo, ReceiptInfo, TransactionSigned, U256},
};
use sp_core::keccak_256;
use std::{future::Future, pin::Pin, sync::Arc};
use subxt::{blocks::ExtrinsicDetails, OnlineClient};
use subxt::{OnlineClient, blocks::ExtrinsicDetails};

type FetchReceiptDataFn = Arc<
dyn Fn(H256) -> Pin<Box<dyn Future<Output = Option<Vec<ReceiptGasInfo>>> + Send>> + Send + Sync,
Expand Down
4 changes: 2 additions & 2 deletions substrate/frame/revive/rpc/src/receipt_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use crate::{
client::{SubstrateBlock, SubstrateBlockNumber},
Address, AddressOrAddresses, BlockInfoProvider, BlockNumberOrTag, BlockTag, Bytes, ClientError,
FilterTopic, ReceiptExtractor, SubxtBlockInfoProvider,
client::{SubstrateBlock, SubstrateBlockNumber},
};
use pallet_revive::evm::{Filter, Log, ReceiptInfo, TransactionSigned};
use sp_core::{H256, U256};
use sqlx::{query, QueryBuilder, Row, Sqlite, SqlitePool};
use sqlx::{QueryBuilder, Row, Sqlite, SqlitePool, query};
use std::{
collections::{BTreeMap, HashMap},
sync::Arc,
Expand Down
16 changes: 10 additions & 6 deletions substrate/frame/revive/rpc/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,29 @@
//! [evm-test-suite](https://github.com/paritytech/evm-test-suite) repository.

use crate::{
EthRpcClient,
cli::{self, CliCommand},
example::TransactionBuilder,
subxt_client::{
self, src_chain::runtime_types::pallet_revive::primitives::Code, SrcChainConfig,
self, SrcChainConfig, src_chain::runtime_types::pallet_revive::primitives::Code,
},
EthRpcClient,
};
use anyhow::anyhow;
use clap::Parser;
use jsonrpsee::ws_client::{WsClient, WsClientBuilder};
use pallet_revive::{
create1,
evm::{
Account, Block, BlockNumberOrTag, BlockNumberOrTagOrHash, BlockTag,
HashesOrTransactionInfos, TransactionInfo, TransactionUnsigned, H256, U256,
Account, Block, BlockNumberOrTag, BlockNumberOrTagOrHash, BlockTag, H256,
HashesOrTransactionInfos, TransactionInfo, TransactionUnsigned, U256,
},
};
use std::{sync::Arc, thread};
use subxt::{
OnlineClient,
backend::rpc::RpcClient,
ext::subxt_rpcs::rpc_params,
tx::{SubmittableTransaction, TxStatus},
OnlineClient,
};

const LOG_TARGET: &str = "eth-rpc-tests";
Expand Down Expand Up @@ -422,7 +422,11 @@ async fn test_deploy_and_call() -> anyhow::Result<()> {
);

let balance = client.get_balance(contract_address, BlockTag::Latest.into()).await?;
assert_eq!(Some(value), balance.checked_sub(initial_balance), "Contract {contract_address:?} Balance {balance} should have increased from {initial_balance} by {value}.");
assert_eq!(
Some(value),
balance.checked_sub(initial_balance),
"Contract {contract_address:?} Balance {balance} should have increased from {initial_balance} by {value}."
);

// Balance transfer to contract
let initial_balance = client.get_balance(contract_address, BlockTag::Latest.into()).await?;
Expand Down
Loading
Loading