Skip to content

Commit

Permalink
update struct comment and remove debug points
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhavyas committed Jan 14, 2025
1 parent cc6f251 commit ae83448
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
2 changes: 1 addition & 1 deletion domains/client/block-builder/src/custom_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct MappedStorageChanges<H: Hasher> {
pub offchain_storage_changes: HashMap<(Vec<u8>, Vec<u8>), OffchainOverlayedChange>,
/// A transaction for the backend that contains all changes from
/// [`main_storage_changes`](StorageChanges::main_storage_changes) and from
/// [`child_storage_changes`](StorageChanges::child_storage_changes).
/// [`child_storage_changes`](StorageChanges::child_storage_changes) but excluding
/// [`offchain_storage_changes`](StorageChanges::offchain_storage_changes).
pub transaction: BackendTransaction<H>,
/// The storage root after applying the transaction.
Expand Down
18 changes: 0 additions & 18 deletions domains/client/block-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ use sp_runtime::Digest;
use sp_state_machine::OverlayedChanges;
use std::collections::VecDeque;
use std::sync::Arc;
use std::time::Instant;

/// A block that was build by [`BlockBuilder`] plus some additional data.
///
Expand Down Expand Up @@ -127,7 +126,6 @@ where
/// Execute the block's list of extrinsics.
fn execute_extrinsics(&mut self) -> Result<(), Error> {
for (index, xt) in self.extrinsics.iter().enumerate() {
let start = Instant::now();
let res = self.api.execute_in_transaction(
|api: &TrieBackendApi<Client, Block, Backend, Exec>,
backend: &TrieDeltaBackendFor<Backend::State, Block>,
Expand All @@ -145,11 +143,6 @@ where
if let Err(e) = res {
tracing::debug!("Apply extrinsic at index {index} failed: {e}");
}
tracing::warn!(
"Extrinsic {:?} execution took: {:?} nanos",
index,
start.elapsed().as_nanos()
);
}

Ok(())
Expand Down Expand Up @@ -209,14 +202,7 @@ where
/// supplied by `self.api`, combined as [`BuiltBlock`].
/// The storage proof will be `Some(_)` when proof recording was enabled.
pub fn build(mut self) -> Result<BuiltBlock<Block>, Error> {
let start = Instant::now();
self.execute_extrinsics()?;
tracing::warn!(
"Extrinsics execution took: {:?} ms",
start.elapsed().as_millis()
);
let start = Instant::now();

let header = self.api.execute_in_transaction(
|api: &TrieBackendApi<Client, Block, Backend, Exec>,
backend: &TrieDeltaBackendFor<Backend::State, Block>,
Expand All @@ -240,10 +226,6 @@ where
.collect_storage_changes()
.expect("must always have the storage changes due to execution above");

tracing::warn!(
"Winding up storage changes took: {:?} ms",
start.elapsed().as_millis()
);
Ok(BuiltBlock {
block: Block::new(header, self.extrinsics.into()),
storage_changes,
Expand Down

0 comments on commit ae83448

Please sign in to comment.