Skip to content

Commit

Permalink
NDEV-3101. Add execution map into EmulationRequest (#545)
Browse files Browse the repository at this point in the history
  • Loading branch information
ancientmage authored Oct 9, 2024
1 parent 89d532a commit 37b0bf3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
8 changes: 5 additions & 3 deletions evm_loader/lib/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ use evm_loader::types::{StorageKey, Transaction};
use evm_loader::{
account_storage::AccountStorage,
types::{
vector::VectorVecExt, vector::VectorVecSlowExt, AccessListTx, DynamicFeeTx, LegacyTx,
TransactionPayload,
vector::VectorVecExt, vector::VectorVecSlowExt, AccessListTx, DynamicFeeTx, ExecutionMap,
LegacyTx, TransactionPayload,
},
};
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -268,6 +268,7 @@ pub struct EmulateRequest {
#[serde_as(as = "Option<HashMap<DisplayFromStr,_>>")]
pub solana_overrides: Option<HashMap<Pubkey, Option<SerializedAccount>>>,
pub provide_account_info: Option<AccountInfoLevel>,
pub execution_map: Option<ExecutionMap>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down Expand Up @@ -481,7 +482,8 @@ mod tests {
"data": "0102030405"
}
},
"provide_account_info": null
"provide_account_info": null,
"execution_map": null
}
"#;

Expand Down
16 changes: 16 additions & 0 deletions evm_loader/program/src/types/execution_map.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use serde::{Deserialize, Serialize};

#[allow(dead_code)]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ExecutionStep {
pub block: u64,
pub index: Option<u64>,
pub is_reset: bool,
pub is_return: bool,
pub steps: u32,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ExecutionMap {
pub steps: Vec<ExecutionStep>,
}
2 changes: 2 additions & 0 deletions evm_loader/program/src/types/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub use address::Address;
pub use execution_map::{ExecutionMap, ExecutionStep};
pub use transaction::AccessListTx;
pub use transaction::DynamicFeeTx;
pub use transaction::LegacyTx;
Expand All @@ -14,4 +15,5 @@ pub mod tree_map;
#[macro_use]
pub mod vector;
pub mod boxx;
pub mod execution_map;
pub mod read_raw_utils;

0 comments on commit 37b0bf3

Please sign in to comment.