diff --git a/cosmwasm/enclaves/shared/contract-engine/src/contract_operations.rs b/cosmwasm/enclaves/shared/contract-engine/src/contract_operations.rs index d22534743..6ad72b25b 100644 --- a/cosmwasm/enclaves/shared/contract-engine/src/contract_operations.rs +++ b/cosmwasm/enclaves/shared/contract-engine/src/contract_operations.rs @@ -88,7 +88,7 @@ pub fn init( let validated_msg = validate_msg(&decrypted_msg, contract_code.hash())?; - trace!( + info!( "Init input after decryption: {:?}", String::from_utf8_lossy(&validated_msg) ); diff --git a/cosmwasm/enclaves/shared/contract-engine/src/contract_validation.rs b/cosmwasm/enclaves/shared/contract-engine/src/contract_validation.rs index 6267a68d9..321c2919d 100644 --- a/cosmwasm/enclaves/shared/contract-engine/src/contract_validation.rs +++ b/cosmwasm/enclaves/shared/contract-engine/src/contract_validation.rs @@ -115,7 +115,7 @@ pub fn validate_contract_key( let enclave_key = KEY_MANAGER .get_consensus_state_ikm() .map_err(|_err| { - warn!("Error extracting consensus_state_key"); + error!("Error extracting consensus_state_key"); false }) .unwrap(); @@ -160,7 +160,7 @@ pub fn verify_params( env: &Env, msg: &SecretMessage, ) -> Result<(), EnclaveError> { - info!("Verifying message signatures for: {:?}", sig_info); + debug!("Verifying message signatures for: {:?}", sig_info); // If there's no callback signature - it's not a callback and there has to be a tx signer + signature if let Some(callback_sig) = &sig_info.callback_sig { @@ -284,7 +284,7 @@ fn verify_callback_sig( msg, sent_funds, ) { - info!("Message verified! msg.sender is the calling contract"); + debug!("Message verified! msg.sender is the calling contract"); return Ok(()); } @@ -337,7 +337,7 @@ fn verify_contract(msg: &CosmWasmMsg, env: &Env) -> bool { // Contract address is relevant only to execute, since during sending an instantiate message the contract address is not yet known match msg { CosmWasmMsg::Execute { contract, .. } => { - info!("Verifying contract address.."); + debug!("Verifying contract address.."); let is_verified = env.contract.address == *contract; if !is_verified { trace!( @@ -371,7 +371,7 @@ fn verify_message_params( signer_public_key: &CosmosPubKey, sent_msg: &SecretMessage, ) -> bool { - info!("Verifying sender.."); + debug!("Verifying sender.."); let msg_sender = match CanonicalAddr::from_human(&env.message.sender) { Ok(msg_sender) => msg_sender, @@ -394,7 +394,7 @@ fn verify_message_params( // since it didn't find a matching signed message let msg = get_verified_msg(messages, &msg_sender, sent_msg); if msg.is_none() { - warn!("Message verification failed!"); + debug!("Message verification failed!"); trace!( "Message sent to contract {:?} by {:?} does not match any signed messages {:?}", sent_msg.to_vec(), diff --git a/cosmwasm/enclaves/shared/contract-engine/src/db.rs b/cosmwasm/enclaves/shared/contract-engine/src/db.rs index fad8a47b6..dbe4f3832 100644 --- a/cosmwasm/enclaves/shared/contract-engine/src/db.rs +++ b/cosmwasm/enclaves/shared/contract-engine/src/db.rs @@ -22,7 +22,7 @@ pub fn write_encrypted_key( let scrambled_field_name = field_name_digest(key, contract_key); - info!( + debug!( "Writing to scrambled field name: {:?}", scrambled_field_name ); diff --git a/cosmwasm/enclaves/shared/contract-engine/src/io.rs b/cosmwasm/enclaves/shared/contract-engine/src/io.rs index d7da023fe..c50b5c361 100644 --- a/cosmwasm/enclaves/shared/contract-engine/src/io.rs +++ b/cosmwasm/enclaves/shared/contract-engine/src/io.rs @@ -76,7 +76,7 @@ pub fn encrypt_output( ) -> Result, EnclaveError> { let key = calc_encryption_key(&nonce, &user_public_key); - trace!( + info!( "Output before encryption: {:?}", String::from_utf8_lossy(&output) ); diff --git a/cosmwasm/enclaves/shared/contract-engine/src/module_cache.rs b/cosmwasm/enclaves/shared/contract-engine/src/module_cache.rs index 60f0bc806..332c4dfbd 100644 --- a/cosmwasm/enclaves/shared/contract-engine/src/module_cache.rs +++ b/cosmwasm/enclaves/shared/contract-engine/src/module_cache.rs @@ -92,20 +92,20 @@ fn compile_module( code: &[u8], operation: ContractOperation, ) -> Result { - info!("Deserializing Wasm contract"); + debug!("Deserializing Wasm contract"); // Create a parity-wasm module first, so we can inject gas metering to it // (you need a parity-wasm module to use the pwasm-utils crate) let mut p_modlue: Module = elements::deserialize_buffer(code).map_err(|_| EnclaveError::InvalidWasm)?; - info!("Deserialized Wasm contract"); + debug!("Deserialized Wasm contract"); - info!("Validating WASM memory demands"); + debug!("Validating WASM memory demands"); validate_memory(&mut p_modlue)?; - info!("Validated WASM memory demands"); + debug!("Validated WASM memory demands"); // Set the gas costs for wasm op-codes (there is an inline stack_height limit in WasmCosts) let wasm_costs = WasmCosts::default(); @@ -114,13 +114,13 @@ fn compile_module( let contract_module = pwasm_utils::inject_gas_counter(p_modlue, &gas_rules(&wasm_costs)) .map_err(|_| EnclaveError::FailedGasMeteringInjection)?; - info!("Trying to create Wasmi module from parity..."); + debug!("Trying to create Wasmi module from parity..."); // Create a wasmi module from the parity module let module = wasmi::Module::from_parity_wasm_module(contract_module) .map_err(|_err| EnclaveError::InvalidWasm)?; - info!("Created Wasmi module from parity. Now checking for floating points..."); + debug!("Created Wasmi module from parity. Now checking for floating points..."); // Skip the floating point check in queries and handles. // We know that the contract must be valid at this point, diff --git a/cosmwasm/enclaves/shared/contract-engine/src/wasm/contract.rs b/cosmwasm/enclaves/shared/contract-engine/src/wasm/contract.rs index c127e2710..502fbc435 100644 --- a/cosmwasm/enclaves/shared/contract-engine/src/wasm/contract.rs +++ b/cosmwasm/enclaves/shared/contract-engine/src/wasm/contract.rs @@ -616,8 +616,8 @@ impl WasmiApi for ContractInstance { self.gas_left(), )?; - trace!( - "query_chain() got answer from outside with gas {} and result {:?}", + info!( + "query_chain() got answer from chain. Gas used: {}. Result: {:?}", gas_used, String::from_utf8_lossy(&answer) ); diff --git a/cosmwasm/enclaves/shared/contract-engine/src/wasm/engine.rs b/cosmwasm/enclaves/shared/contract-engine/src/wasm/engine.rs index 11272362e..29b1d2579 100644 --- a/cosmwasm/enclaves/shared/contract-engine/src/wasm/engine.rs +++ b/cosmwasm/enclaves/shared/contract-engine/src/wasm/engine.rs @@ -33,7 +33,7 @@ impl Engine { } pub fn init(&mut self, env_ptr: u32, msg_ptr: u32) -> Result { - info!("Invoking init() in wasm"); + info!("Invoking contract init"); match self .module @@ -73,7 +73,7 @@ impl Engine { } pub fn handle(&mut self, env_ptr: u32, msg_ptr: u32) -> Result { - info!("Invoking handle() in wasm"); + info!("Invoking contract handle"); // Itzik: leaving this here as an example in case we will want to do something like this in the future @@ -122,7 +122,7 @@ impl Engine { } pub fn query(&mut self, msg_ptr: u32) -> Result { - info!("Invoking query() in wasm"); + info!("Invoking contract query"); match self .module diff --git a/deployment/docker/devimage/bootstrap_init_no_stop.sh b/deployment/docker/devimage/bootstrap_init_no_stop.sh index 677174c59..d7e7bc2ff 100755 --- a/deployment/docker/devimage/bootstrap_init_no_stop.sh +++ b/deployment/docker/devimage/bootstrap_init_no_stop.sh @@ -26,6 +26,7 @@ then cp ~/node_key.json ~/.secretd/config/node_key.json perl -i -pe 's/"stake"/"uscrt"/g' ~/.secretd/config/genesis.json perl -i -pe 's/"172800s"/"90s"/g' ~/.secretd/config/genesis.json # voting period 2 days -> 90 seconds + perl -i -pe 's/"1814400s"/"80s"/g' ~/.secretd/config/genesis.json # voting period 2 days -> 90 seconds perl -i -pe 's/enable-unsafe-cors = false/enable-unsafe-cors = true/g' ~/.secretd/config/app.toml # enable cors @@ -70,5 +71,5 @@ setsid node faucet_server.js & # Setup secretcli cp $(which secretd) $(dirname $(which secretd))/secretcli -source /opt/sgxsdk/environment && RUST_BACKTRACE=1 secretd start --rpc.laddr tcp://0.0.0.0:26657 --bootstrap +source /opt/sgxsdk/environment && RUST_BACKTRACE=1 LOG_LEVEL=INFO secretd start --rpc.laddr tcp://0.0.0.0:26657 --bootstrap diff --git a/deployment/docker/local/bootstrap_init.sh b/deployment/docker/local/bootstrap_init.sh index f15472524..ccc9dcbe6 100644 --- a/deployment/docker/local/bootstrap_init.sh +++ b/deployment/docker/local/bootstrap_init.sh @@ -19,6 +19,9 @@ then cp ~/node_key.json ~/.secretd/config/node_key.json perl -i -pe 's/"stake"/"uscrt"/g' ~/.secretd/config/genesis.json + + perl -i -pe 's/"1814400s"/"80s"/g' ~/.secretd/config/genesis.json + secretcli keys add a secretcli keys add b secretcli keys add c