Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ members = [
"substrate/frame/revive/fixtures",
"substrate/frame/revive/proc-macro",
"substrate/frame/revive/rpc",
"substrate/frame/revive/types",
"substrate/frame/revive/uapi",
"substrate/frame/revive/ui-tests",
"substrate/frame/root-offences",
Expand Down Expand Up @@ -1053,6 +1054,7 @@ pallet-referenda = { path = "substrate/frame/referenda", default-features = fals
pallet-revive = { path = "substrate/frame/revive", default-features = false }
pallet-revive-fixtures = { path = "substrate/frame/revive/fixtures", default-features = false }
pallet-revive-proc-macro = { path = "substrate/frame/revive/proc-macro", default-features = false }
pallet-revive-types = { path = "substrate/frame/revive/types", default-features = false }
pallet-revive-uapi = { path = "substrate/frame/revive/uapi", default-features = false }
pallet-root-offences = { default-features = false, path = "substrate/frame/root-offences" }
pallet-root-testing = { path = "substrate/frame/root-testing", default-features = false }
Expand Down Expand Up @@ -1203,6 +1205,7 @@ remote-externalities = { path = "substrate/utils/frame/remote-externalities", de
revive-dev-node = { path = "substrate/frame/revive/dev-node/node" }
revive-dev-runtime = { path = "substrate/frame/revive/dev-node/runtime" }
revm = { version = "27.0.2", default-features = false }
revm-bytecode = { version = "6.2.2", default-features = false }
ripemd = { version = "0.1.3", default-features = false }
rlp = { version = "0.6.1", default-features = false }
rococo-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/relays/rococo" }
Expand Down
3 changes: 3 additions & 0 deletions substrate/frame/revive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ frame-support = { workspace = true }
frame-system = { workspace = true }
pallet-revive-fixtures = { workspace = true, optional = true }
pallet-revive-proc-macro = { workspace = true }
pallet-revive-types = { workspace = true }
pallet-revive-uapi = { workspace = true, features = ["precompiles-sol-interfaces", "scale"] }
pallet-transaction-payment = { workspace = true }
ripemd = { workspace = true }
Expand All @@ -74,6 +75,7 @@ itertools = { workspace = true }
pretty_assertions = { workspace = true }
secp256k1 = { workspace = true, features = ["recovery"] }
serde_json = { workspace = true }
strum = { workspace = true, features = ["derive"] }
test-case = { workspace = true }

# Polkadot SDK Dependencies
Expand Down Expand Up @@ -111,6 +113,7 @@ std = [
"num-traits/std",
"pallet-proxy/std",
"pallet-revive-fixtures?/std",
"pallet-revive-types/std",
"pallet-timestamp/std",
"pallet-transaction-payment/std",
"pallet-utility/std",
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/revive/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jsonrpsee = { workspace = true, features = ["full"] }
libsqlite3-sys = { workspace = true }
log = { workspace = true }
pallet-revive = { workspace = true, default-features = true }
pallet-revive-types = { workspace = true, features = ["std"] }
prometheus-endpoint = { workspace = true, default-features = true }
rlp = { workspace = true }
sc-cli = { workspace = true, default-features = true }
Expand Down
8 changes: 4 additions & 4 deletions substrate/frame/revive/rpc/src/apis/debug_apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub trait DebugRpc {
&self,
transaction_hash: H256,
tracer_config: Option<TracerConfig>,
) -> RpcResult<Trace>;
) -> RpcResult<TraceV1>;

/// Dry run a call and returns the transaction's traces.
///
Expand All @@ -58,7 +58,7 @@ pub trait DebugRpc {
transaction: GenericTransaction,
block: BlockNumberOrTagOrHash,
trace_call_config: Option<TraceCallConfig>,
) -> RpcResult<Trace>;
) -> RpcResult<TraceV1>;

#[method(name = "debug_getAutomine")]
async fn get_automine(&self) -> RpcResult<bool>;
Expand Down Expand Up @@ -107,7 +107,7 @@ impl DebugRpcServer for DebugRpcServerImpl {
&self,
transaction_hash: H256,
tracer_config: Option<TracerConfig>,
) -> RpcResult<Trace> {
) -> RpcResult<TraceV1> {
let TracerConfig { config, timeout } = tracer_config.unwrap_or_default();
with_timeout(timeout, self.client.trace_transaction(transaction_hash, config)).await
}
Expand All @@ -117,7 +117,7 @@ impl DebugRpcServer for DebugRpcServerImpl {
transaction: GenericTransaction,
block: BlockNumberOrTagOrHash,
trace_call_config: Option<TraceCallConfig>,
) -> RpcResult<Trace> {
) -> RpcResult<TraceV1> {
let TraceCallConfig { tracer_config, state_overrides } =
trace_call_config.unwrap_or_default();
let TracerConfig { config, timeout } = tracer_config;
Expand Down
15 changes: 8 additions & 7 deletions substrate/frame/revive/rpc/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub(crate) mod storage_api;

use crate::{
BlockInfoProvider, BlockTag, FeeHistoryProvider, ReceiptProvider, SubxtBlockInfoProvider,
SyncLabel, TracerType, TransactionInfo,
SyncLabel, TransactionInfo,
block_sync::SyncCheckpoint,
subxt_client::{self, SrcChainConfig, revive::calls::types::EthTransact},
};
Expand All @@ -33,10 +33,11 @@ use pallet_revive::{
evm::{
Block, BlockNumberOrTag, BlockNumberOrTagOrHash, FeeHistoryResult, Filter,
GenericTransaction, H256, HashesOrTransactionInfos, Log, ReceiptInfo, StateOverrideSet,
SyncingProgress, SyncingStatus, Trace, TransactionSigned, TransactionTrace, U256,
SyncingProgress, SyncingStatus, TransactionSigned, TransactionTrace, U256,
decode_revert_reason,
},
};
use pallet_revive_types::runtime_api::*;
use runtime_api::RuntimeApi;
use sp_runtime::traits::Block as BlockT;
use sp_weights::Weight;
Expand Down Expand Up @@ -987,7 +988,7 @@ impl Client {
pub async fn trace_block_by_number(
&self,
at: BlockNumberOrTag,
config: TracerType,
config: TracerTypeV1,
) -> Result<Vec<TransactionTrace>, ClientError> {
if self.receipt_provider.is_before_earliest_block(&at) {
return Ok(vec![]);
Expand Down Expand Up @@ -1020,8 +1021,8 @@ impl Client {
pub async fn trace_transaction(
&self,
transaction_hash: H256,
config: TracerType,
) -> Result<Trace, ClientError> {
config: TracerTypeV1,
) -> Result<TraceV1, ClientError> {
let (block_hash, transaction_index) = self
.receipt_provider
.find_transaction(&transaction_hash)
Expand All @@ -1040,9 +1041,9 @@ impl Client {
&self,
transaction: GenericTransaction,
block: BlockNumberOrTagOrHash,
config: TracerType,
config: TracerTypeV1,
state_overrides: Option<StateOverrideSet>,
) -> Result<Trace, ClientError> {
) -> Result<TraceV1, ClientError> {
let block_hash = self.block_hash_for_tag(block).await?;
let runtime_api = self.runtime_api(block_hash);
runtime_api.trace_call(transaction, config, state_overrides).await
Expand Down
15 changes: 8 additions & 7 deletions substrate/frame/revive/rpc/src/client/runtime_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ use pallet_revive::{
DryRunConfig, EthTransactInfo, TracingConfig,
evm::{
Block as EthBlock, BlockNumberOrTagOrHash, BlockTag, GenericTransaction, H160,
ReceiptGasInfo, StateOverrideSet, Trace, U256,
ReceiptGasInfo, StateOverrideSet, U256,
},
};
use pallet_revive_types::runtime_api::*;
use sp_core::H256;
use sp_timestamp::Timestamp;
use subxt::{Error::Metadata, OnlineClient, error::MetadataError, ext::subxt_rpcs::UserError};
Expand Down Expand Up @@ -235,8 +236,8 @@ impl RuntimeApi {
sp_runtime::OpaqueExtrinsic,
>,
transaction_index: u32,
tracer_type: crate::TracerType,
) -> Result<Trace, ClientError> {
tracer_type: TracerTypeV1,
) -> Result<TraceV1, ClientError> {
let payload = subxt_client::apis()
.revive_api()
.trace_tx(block.into(), transaction_index, tracer_type.into())
Expand All @@ -253,8 +254,8 @@ impl RuntimeApi {
sp_runtime::generic::Header<u32, sp_runtime::traits::BlakeTwo256>,
sp_runtime::OpaqueExtrinsic,
>,
tracer_type: crate::TracerType,
) -> Result<Vec<(u32, Trace)>, ClientError> {
tracer_type: TracerTypeV1,
) -> Result<Vec<(u32, TraceV1)>, ClientError> {
let payload = subxt_client::apis()
.revive_api()
.trace_block(block.into(), tracer_type.into())
Expand All @@ -272,9 +273,9 @@ impl RuntimeApi {
pub async fn trace_call(
&self,
transaction: GenericTransaction,
tracer_type: crate::TracerType,
tracer_type: TracerTypeV1,
state_overrides: Option<StateOverrideSet>,
) -> Result<Trace, ClientError> {
) -> Result<TraceV1, ClientError> {
let result = if let Some(overrides) = state_overrides {
let config = TracingConfig::new().with_state_overrides(overrides);
let payload = subxt_client::apis()
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/revive/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use jsonrpsee::{
types::{ErrorCode, ErrorObjectOwned},
};
use pallet_revive::evm::*;
use pallet_revive_types::runtime_api::*;
use sp_core::{H160, H256, U256};
use sp_crypto_hashing::keccak_256;
use subxt::backend::legacy::rpc_methods::TransactionStatus;
Expand Down
99 changes: 91 additions & 8 deletions substrate/frame/revive/rpc/src/subxt_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ pub use subxt::config::PolkadotConfig as SrcChainConfig;
::sp_runtime::OpaqueExtrinsic
>>"
),
substitute_type(
path = "pallet_revive::evm::api::debug_rpc_types::Trace",
with = "::subxt::utils::Static<::pallet_revive::evm::Trace>"
),
substitute_type(
path = "pallet_revive::evm::api::debug_rpc_types::TracerType",
with = "::subxt::utils::Static<::pallet_revive::evm::TracerType>"
),

substitute_type(
path = "pallet_revive::evm::api::rpc_types_gen::GenericTransaction",
Expand Down Expand Up @@ -79,6 +71,97 @@ pub use subxt::config::PolkadotConfig as SrcChainConfig;
path = "pallet_revive::evm::block_hash::ReceiptGasInfo",
with = "::subxt::utils::Static<::pallet_revive::evm::ReceiptGasInfo>"
),

// Versioning replacements
substitute_type(
path = "pallet_revive_types::runtime_api::types::tracer::TracerTypeV1",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::TracerTypeV1>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::types::tracer::CallTracerConfigV1",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::CallTracerConfigV1>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::types::tracer::PrestateTracerConfigV1",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::PrestateTracerConfigV1>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::types::tracer::ExecutionTracerConfigV1",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::ExecutionTracerConfigV1>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::types::traces::TraceV1",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::TraceV1>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::types::traces::TraceV2",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::TraceV2>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::types::traces::CallTraceV1",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::CallTraceV1>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::types::traces::CallTraceV2",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::CallTraceV2>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::types::traces::PrestateTraceV1",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::PrestateTraceV1>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::types::traces::ExecutionTraceV1",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::ExecutionTraceV1>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::types::traces::CallLogV1",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::CallLogV1>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::types::traces::CallLogV2",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::CallLogV2>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::types::traces::CallTypeV1",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::CallTypeV1>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::types::traces::PrestateTraceInfoV1",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::PrestateTraceInfoV1>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::types::traces::ExecutionStepV1",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::ExecutionStepV1>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::types::traces::ExecutionStepKindV1",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::ExecutionStepKindV1>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::payloads::trace_block::TraceBlockInputPayloadV1<Block>",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::TraceBlockInputPayloadV1<Block>>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::payloads::trace_block::TraceBlockInputPayloadV2<Block>",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::TraceBlockInputPayloadV2<Block>>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::payloads::trace_block::TraceBlockVersionedInputPayload<Block>",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::TraceBlockVersionedInputPayload<Block>>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::payloads::trace_block::TraceBlockOutputPayloadV1",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::TraceBlockOutputPayloadV1>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::payloads::trace_block::TraceBlockOutputPayloadV2",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::TraceBlockOutputPayloadV2>"
),
substitute_type(
path = "pallet_revive_types::runtime_api::payloads::trace_block::TraceBlockVersionedOutputPayload",
with = "::subxt::utils::Static<::pallet_revive_types::runtime_api::TraceBlockVersionedOutputPayload>"
),

derive_for_all_types = "codec::Encode, codec::Decode"
)]
mod src_chain {}
Expand Down
Loading
Loading