Skip to content

Commit

Permalink
Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
mpapierski committed Jul 23, 2024
1 parent 78756d0 commit 8921363
Show file tree
Hide file tree
Showing 19 changed files with 99 additions and 594 deletions.
6 changes: 1 addition & 5 deletions binary_port/src/binary_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use casper_types::{
bytesrepr::{self, FromBytes, ToBytes},
ProtocolVersion, Transaction,
};
use tracing::debug;

use crate::get_request::GetRequest;

Expand Down Expand Up @@ -187,8 +186,6 @@ impl TryFrom<(BinaryRequestTag, &[u8])> for BinaryRequest {
type Error = bytesrepr::Error;

fn try_from((tag, bytes): (BinaryRequestTag, &[u8])) -> Result<Self, Self::Error> {
debug!(?tag, ?bytes, "BinaryRequest::try_from");

let (req, remainder) = match tag {
BinaryRequestTag::Get => {
let (get_request, remainder) = FromBytes::from_bytes(bytes)?;
Expand All @@ -206,7 +203,6 @@ impl TryFrom<(BinaryRequestTag, &[u8])> for BinaryRequest {
(BinaryRequest::TrySpeculativeExec { transaction }, remainder)
}
};
debug!(?req, ?remainder, "BinaryRequest::try_from succeed");
if !remainder.is_empty() {
return Err(bytesrepr::Error::LeftOverBytes);
}
Expand All @@ -215,7 +211,7 @@ impl TryFrom<(BinaryRequestTag, &[u8])> for BinaryRequest {
}

/// The type tag of a binary request.
#[derive(Debug, PartialEq, Copy, Clone)]
#[derive(Debug, PartialEq)]
#[repr(u8)]
pub enum BinaryRequestTag {
/// Request to get data from the node
Expand Down
2 changes: 0 additions & 2 deletions cargo-casper/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ fn main() -> anyhow::Result<()> {
};
serde_json::to_writer_pretty(std::io::stdout(), &schema)?;

// dbg!(&defs);

//
// Stage 2: Construct a schema object from the extracted information
//
Expand Down
7 changes: 2 additions & 5 deletions execution_engine/src/engine_state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use casper_storage::{
tracking_copy::{TrackingCopyEntityExt, TrackingCopyError, TrackingCopyExt},
};
use casper_types::U512;
use tracing::debug;

use crate::{execution::Executor, runtime::RuntimeStack};
pub use deploy_item::DeployItem;
Expand Down Expand Up @@ -125,7 +124,7 @@ impl ExecutionEngineV1 {
Err(ese) => return WasmV1Result::precondition_failure(gas_limit, ese),
};
let access_rights = entity.extract_access_rights(entity_hash, &named_keys);
let result = Executor::new(self.config().clone()).exec(
Executor::new(self.config().clone()).exec(
execution_kind,
args,
entity_hash,
Expand All @@ -144,8 +143,6 @@ impl ExecutionEngineV1 {
account_hash,
self.config.max_runtime_call_stack_height() as usize,
),
);
debug!(?result, "wasm execution result");
result
)
}
}
2 changes: 1 addition & 1 deletion execution_engine/src/runtime/mint_internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ where
self.context.phase()
}

fn get_key(&mut self, name: &str) -> Option<Key> {
fn get_key(&self, name: &str) -> Option<Key> {
self.context.named_keys_get(name).cloned()
}

Expand Down
97 changes: 0 additions & 97 deletions executor/wasm-common/src/leb128.rs

This file was deleted.

2 changes: 0 additions & 2 deletions executor/wasm-common/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
//! A crate that shares common types and utilities between the Wasm executor and the Wasm interface.
pub mod flags;
pub mod keyspace;
pub mod leb128;
pub mod manifest;
pub mod selector;
150 changes: 0 additions & 150 deletions executor/wasm-common/src/manifest.rs

This file was deleted.

6 changes: 0 additions & 6 deletions executor/wasm-interface/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,6 @@ pub enum ExecuteError {
/// Trait bounds also implying that the executor has to support interior mutability, as it may need
/// to update its internal state during execution of a single or a chain of multiple contracts.
pub trait Executor: Clone + Send {
// fn instantiate_contract<R: GlobalStateReader + 'static>(
// &self,
// tracking_copy: TrackingCopy<R>,
// store_request: InstantiateContractRequest,
// ) -> Result<StoreContractResult, StoreContractError>;

fn execute<R: GlobalStateReader + 'static>(
&self,
tracking_copy: TrackingCopy<R>,
Expand Down
14 changes: 0 additions & 14 deletions executor/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,6 @@ use parking_lot::RwLock;
use system::{MintArgs, MintTransferArgs};
use tracing::{error, warn};

// use super::{
// ExecuteError, ExecuteRequest, ExecuteRequestBuilder, ExecuteResult, ExecutionKind, Executor,
// InstantiateContractRequest, InstallContractError, StoreContractResult,
// };
// use crate::{
// chain_utils,
// storage::{
// runtime::{self, MintArgs, MintTransferArgs},
// Address, GlobalStateReader, TrackingCopy,
// },
// wasm_backend::{Context, GasUsage, WasmInstance},
// ConfigBuilder, HostError, TrapCode, VMError, WasmEngine,
// };

const DEFAULT_WASM_ENTRY_POINT: &str = "call";

const DEFAULT_MINT_TRANSFER_GAS_COST: u64 = 1; // NOTE: Require gas while executing and set this to at least 100_000_000 (or use chainspec)
Expand Down
Loading

0 comments on commit 8921363

Please sign in to comment.