Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix evm tracing for older runtimes #1307

Merged
merged 1 commit into from
Jul 25, 2024
Merged
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
7 changes: 4 additions & 3 deletions vendor/rpc/debug/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ where
} else {
// Old "trace_block" api did not initialize block before applying transactions,
// so we need to do it here before calling "trace_block".
api.initialize_block(parent_block_hash, &header)
#[allow(deprecated)]
api.initialize_block_before_version_5(parent_block_hash, &header)
.map_err(|e| internal_err(format!("Runtime api access error: {:?}", e)))?;

#[allow(deprecated)]
Expand Down Expand Up @@ -529,13 +530,13 @@ where
} else {
// Old "trace_transaction" api did not initialize block before applying transactions,
// so we need to do it here before calling "trace_transaction".
api.initialize_block(parent_block_hash, &header)
#[allow(deprecated)]
api.initialize_block_before_version_5(parent_block_hash, &header)
.map_err(|e| {
internal_err(format!("Runtime api access error: {:?}", e))
})?;

if trace_api_version == 4 {
// Pre pallet-message-queue
#[allow(deprecated)]
api.trace_transaction_before_version_5(
parent_block_hash,
Expand Down
5 changes: 3 additions & 2 deletions vendor/rpc/trace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ where
// Trace the block.
let f = || -> Result<_, String> {
let result = if trace_api_version >= 5 {
// The block is initialized inside "trace_transaction"
// The block is initialized inside "trace_block"
api.trace_block(
substrate_parent_hash,
extrinsics,
Expand All @@ -869,7 +869,8 @@ where
} else {
// Old "trace_block" api did not initialize block before applying transactions,
// so we need to do it here before calling "trace_block".
api.initialize_block(substrate_parent_hash, &block_header)
#[allow(deprecated)]
api.initialize_block_before_version_5(substrate_parent_hash, &block_header)
.map_err(|e| format!("Runtime api access error: {:?}", e))?;

#[allow(deprecated)]
Expand Down
Loading