From bff32810f76d599a10a76815ed126e615934ce5b Mon Sep 17 00:00:00 2001 From: Jan Hoffmann Date: Thu, 28 Mar 2024 16:55:00 +0100 Subject: [PATCH 1/8] burn implemented Co-authored-by: igor-casper --- Cargo.lock | 8 + execution_engine/src/runtime/mint_internal.rs | 4 + execution_engine/src/runtime/mod.rs | 8 + execution_engine/src/runtime_context/mod.rs | 4 +- .../tests/src/test/system_contracts/mint.rs | 216 ++++++++++++++++++ .../tests/src/test/system_contracts/mod.rs | 1 + resources/local/chainspec.toml.in | 3 +- resources/production/chainspec.toml | 3 +- .../contracts/client/burn/Cargo.toml | 16 ++ .../contracts/client/burn/src/main.rs | 89 ++++++++ storage/src/system/mint.rs | 52 +++-- storage/src/system/mint/detail.rs | 39 ++++ storage/src/system/mint/mint_native.rs | 4 + storage/src/system/mint/runtime_provider.rs | 3 + types/src/chainspec/vm_config/mint_costs.rs | 14 ++ types/src/system/mint/constants.rs | 2 + types/src/system/mint/entry_points.rs | 17 +- 17 files changed, 455 insertions(+), 28 deletions(-) create mode 100644 execution_engine_testing/tests/src/test/system_contracts/mint.rs create mode 100644 smart_contracts/contracts/client/burn/Cargo.toml create mode 100644 smart_contracts/contracts/client/burn/src/main.rs create mode 100644 storage/src/system/mint/detail.rs diff --git a/Cargo.lock b/Cargo.lock index 5207b77f53..6bfd0c03d2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -427,6 +427,14 @@ version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +[[package]] +name = "burn" +version = "0.1.0" +dependencies = [ + "casper-contract", + "casper-types", +] + [[package]] name = "bytemuck" version = "1.14.0" diff --git a/execution_engine/src/runtime/mint_internal.rs b/execution_engine/src/runtime/mint_internal.rs index 8607a6eed4..c1c7e4c659 100644 --- a/execution_engine/src/runtime/mint_internal.rs +++ b/execution_engine/src/runtime/mint_internal.rs @@ -97,6 +97,10 @@ where ProviderError::AddressableEntityByAccountHash(account_hash) }) } + + fn is_valid_uref(&self, uref: &URef) -> bool { + self.context.access_rights().has_access_rights_to_uref(uref) + } } // TODO: update Mint + StorageProvider to better handle errors diff --git a/execution_engine/src/runtime/mod.rs b/execution_engine/src/runtime/mod.rs index 7a2899f18f..34ff95494e 100644 --- a/execution_engine/src/runtime/mod.rs +++ b/execution_engine/src/runtime/mod.rs @@ -609,6 +609,14 @@ where let result: Result<(), mint::Error> = mint_runtime.reduce_total_supply(amount); CLValue::from_t(result).map_err(Self::reverter) })(), + mint::METHOD_BURN => (|| { + mint_runtime.charge_system_contract_call(mint_costs.burn)?; + + let purse: URef = Self::get_named_argument(runtime_args, mint::ARG_PURSE)?; + let amount: U512 = Self::get_named_argument(runtime_args, mint::ARG_AMOUNT)?; + let result: Result<(), mint::Error> = mint_runtime.burn(purse, amount); + CLValue::from_t(result).map_err(Self::reverter) + })(), // Type: `fn create() -> URef` mint::METHOD_CREATE => (|| { mint_runtime.charge_system_contract_call(mint_costs.create)?; diff --git a/execution_engine/src/runtime_context/mod.rs b/execution_engine/src/runtime_context/mod.rs index d3b88098f5..0ac96eaa5a 100644 --- a/execution_engine/src/runtime_context/mod.rs +++ b/execution_engine/src/runtime_context/mod.rs @@ -669,7 +669,7 @@ where } /// Validates whether keys used in the `value` are not forged. - fn validate_value(&self, value: &StoredValue) -> Result<(), ExecError> { + pub(crate) fn validate_value(&self, value: &StoredValue) -> Result<(), ExecError> { match value { StoredValue::CLValue(cl_value) => self.validate_cl_value(cl_value), StoredValue::Account(_) => Ok(()), @@ -743,7 +743,7 @@ where } /// Validates if a [`Key`] refers to a [`URef`] and has a write bit set. - fn validate_writeable(&self, key: &Key) -> Result<(), ExecError> { + pub(crate) fn validate_writeable(&self, key: &Key) -> Result<(), ExecError> { if self.is_writeable(key) { Ok(()) } else { diff --git a/execution_engine_testing/tests/src/test/system_contracts/mint.rs b/execution_engine_testing/tests/src/test/system_contracts/mint.rs new file mode 100644 index 0000000000..521d90f0ed --- /dev/null +++ b/execution_engine_testing/tests/src/test/system_contracts/mint.rs @@ -0,0 +1,216 @@ +use casper_engine_test_support::{ + auction, ExecuteRequestBuilder, LmdbWasmTestBuilder, DEFAULT_ACCOUNT_ADDR, +}; +use casper_types::{runtime_args, ProtocolVersion, URef, U512}; + +use tempfile::TempDir; + +const TEST_DELEGATOR_INITIAL_ACCOUNT_BALANCE: u64 = 1_000_000 * 1_000_000_000; + +const CONTRACT_BURN: &str = "burn.wasm"; +const CONTRACT_TRANSFER_TO_NAMED_PURSE: &str = "transfer_to_named_purse.wasm"; + +const ARG_AMOUNT: &str = "amount"; + +const ARG_PURSE_NAME: &str = "purse_name"; + +#[ignore] +#[test] +fn should_empty_purse_when_burning_above_balance() { + let data_dir = TempDir::new().expect("should create temp dir"); + let mut builder = LmdbWasmTestBuilder::new(data_dir.as_ref()); + let source = *DEFAULT_ACCOUNT_ADDR; + + let delegator_keys = auction::generate_public_keys(1); + let validator_keys = auction::generate_public_keys(1); + + auction::run_genesis_and_create_initial_accounts( + &mut builder, + &validator_keys, + delegator_keys + .iter() + .map(|public_key| public_key.to_account_hash()) + .collect::>(), + U512::from(TEST_DELEGATOR_INITIAL_ACCOUNT_BALANCE), + ); + + let initial_supply = builder.total_supply(None); + let purse_name = "purse"; + let purse_amount = U512::from(10_000_000_000u64); + + // Create purse and transfer tokens to it + let exec_request = ExecuteRequestBuilder::standard( + source, + CONTRACT_TRANSFER_TO_NAMED_PURSE, + runtime_args! { + ARG_PURSE_NAME => purse_name, + ARG_AMOUNT => purse_amount, + }, + ) + .build(); + + builder.exec(exec_request).expect_success().commit(); + + let account = builder + .get_entity_with_named_keys_by_account_hash(source) + .expect("should have account"); + + let purse_uref: URef = account + .named_keys() + .get(purse_name) + .unwrap() + .into_uref() + .expect("should be uref"); + + assert_eq!( + builder + .get_purse_balance_result(ProtocolVersion::V2_0_0, purse_uref) + .motes() + .cloned() + .unwrap(), + purse_amount + ); + + // Burn part of tokens in a purse + let num_of_tokens_to_burn = U512::from(2_000_000_000u64); + let num_of_tokens_after_burn = U512::from(8_000_000_000u64); + + let exec_request = ExecuteRequestBuilder::standard( + source, + CONTRACT_BURN, + runtime_args! { + ARG_PURSE_NAME => purse_name, + ARG_AMOUNT => num_of_tokens_to_burn, + }, + ) + .build(); + + builder.exec(exec_request).expect_success().commit(); + + assert_eq!( + builder + .get_purse_balance_result(ProtocolVersion::V2_0_0, purse_uref) + .motes() + .cloned() + .unwrap(), + num_of_tokens_after_burn + ); + + // Burn rest of tokens in a purse + let num_of_tokens_to_burn = U512::from(8_000_000_000u64); + let num_of_tokens_after_burn = U512::zero(); + + let exec_request = ExecuteRequestBuilder::standard( + source, + CONTRACT_BURN, + runtime_args! { + ARG_PURSE_NAME => purse_name, + ARG_AMOUNT => num_of_tokens_to_burn, + }, + ) + .build(); + + builder.exec(exec_request).expect_success().commit(); + + assert_eq!( + builder + .get_purse_balance_result(ProtocolVersion::V2_0_0, purse_uref) + .motes() + .cloned() + .unwrap(), + num_of_tokens_after_burn + ); + + let supply_after_burns = builder.total_supply(None); + let expected_supply_after_burns = initial_supply - U512::from(10_000_000_000u64); + + assert_eq!(supply_after_burns, expected_supply_after_burns); +} + +#[ignore] +#[test] +fn should_not_burn_excess_tokens() { + let data_dir = TempDir::new().expect("should create temp dir"); + let mut builder = LmdbWasmTestBuilder::new(data_dir.as_ref()); + let source = *DEFAULT_ACCOUNT_ADDR; + + let delegator_keys = auction::generate_public_keys(1); + let validator_keys = auction::generate_public_keys(1); + + auction::run_genesis_and_create_initial_accounts( + &mut builder, + &validator_keys, + delegator_keys + .iter() + .map(|public_key| public_key.to_account_hash()) + .collect::>(), + U512::from(TEST_DELEGATOR_INITIAL_ACCOUNT_BALANCE), + ); + + let initial_supply = builder.total_supply(None); + let purse_name = "purse"; + let purse_amount = U512::from(10_000_000_000u64); + + // Create purse and transfer tokens to it + let exec_request = ExecuteRequestBuilder::standard( + source, + CONTRACT_TRANSFER_TO_NAMED_PURSE, + runtime_args! { + ARG_PURSE_NAME => purse_name, + ARG_AMOUNT => purse_amount, + }, + ) + .build(); + + builder.exec(exec_request).expect_success().commit(); + + let account = builder + .get_entity_with_named_keys_by_account_hash(source) + .expect("should have account"); + + let purse_uref: URef = account + .named_keys() + .get(purse_name) + .unwrap() + .into_uref() + .expect("should be uref"); + + assert_eq!( + builder + .get_purse_balance_result(ProtocolVersion::V2_0_0, purse_uref) + .motes() + .cloned() + .unwrap(), + purse_amount + ); + + // Try to burn more then in a purse + let num_of_tokens_to_burn = U512::MAX; + let num_of_tokens_after_burn = U512::zero(); + + let exec_request = ExecuteRequestBuilder::standard( + source, + CONTRACT_BURN, + runtime_args! { + ARG_PURSE_NAME => purse_name, + ARG_AMOUNT => num_of_tokens_to_burn, + }, + ) + .build(); + + builder.exec(exec_request).expect_success().commit(); + + assert_eq!( + builder + .get_purse_balance_result(ProtocolVersion::V2_0_0, purse_uref) + .motes() + .cloned() + .unwrap(), + num_of_tokens_after_burn, + ); + + let supply_after_burns = builder.total_supply(None); + let expected_supply_after_burns = initial_supply - U512::from(10_000_000_000u64); + + assert_eq!(supply_after_burns, expected_supply_after_burns); +} diff --git a/execution_engine_testing/tests/src/test/system_contracts/mod.rs b/execution_engine_testing/tests/src/test/system_contracts/mod.rs index 9a75a324de..a2fe0ef6ef 100644 --- a/execution_engine_testing/tests/src/test/system_contracts/mod.rs +++ b/execution_engine_testing/tests/src/test/system_contracts/mod.rs @@ -2,5 +2,6 @@ mod auction; mod auction_bidding; mod genesis; mod handle_payment; +mod mint; mod standard_payment; mod upgrade; diff --git a/resources/local/chainspec.toml.in b/resources/local/chainspec.toml.in index 3de356c90e..22039595e0 100644 --- a/resources/local/chainspec.toml.in +++ b/resources/local/chainspec.toml.in @@ -295,6 +295,7 @@ mint = 2_500_000_000 reduce_total_supply = 10_000 create = 2_500_000_000 balance = 10_000 +burn = 10_000 transfer = 10_000 read_base_round_reward = 10_000 mint_into_existing_purse = 2_500_000_000 @@ -313,4 +314,4 @@ pay = 10_000 upper_threshold = 90 lower_threshold = 50 max_gas_price = 3 -min_gas_price = 1 \ No newline at end of file +min_gas_price = 1 diff --git a/resources/production/chainspec.toml b/resources/production/chainspec.toml index d7dfe953ca..f20590c526 100644 --- a/resources/production/chainspec.toml +++ b/resources/production/chainspec.toml @@ -306,6 +306,7 @@ mint = 2_500_000_000 reduce_total_supply = 10_000 create = 2_500_000_000 balance = 10_000 +burn = 10_000 transfer = 10_000 read_base_round_reward = 10_000 mint_into_existing_purse = 2_500_000_000 @@ -324,4 +325,4 @@ pay = 10_000 upper_threshold = 90 lower_threshold = 50 max_gas_price = 3 -min_gas_price = 1 \ No newline at end of file +min_gas_price = 1 diff --git a/smart_contracts/contracts/client/burn/Cargo.toml b/smart_contracts/contracts/client/burn/Cargo.toml new file mode 100644 index 0000000000..f9949db688 --- /dev/null +++ b/smart_contracts/contracts/client/burn/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "burn" +version = "0.1.0" +authors = ["Igor Bunar ", "Jan Hoffmann "] +edition = "2021" + +[[bin]] +name = "burn" +path = "src/main.rs" +bench = false +doctest = false +test = false + +[dependencies] +casper-contract = { path = "../../../contract" } +casper-types = { path = "../../../../types" } diff --git a/smart_contracts/contracts/client/burn/src/main.rs b/smart_contracts/contracts/client/burn/src/main.rs new file mode 100644 index 0000000000..545fedafd3 --- /dev/null +++ b/smart_contracts/contracts/client/burn/src/main.rs @@ -0,0 +1,89 @@ +#![no_std] +#![no_main] + +extern crate alloc; +use alloc::{string::String, vec::Vec}; + +use casper_contract::{ + contract_api::{account, alloc_bytes, runtime, system}, + ext_ffi, + unwrap_or_revert::UnwrapOrRevert, +}; +use casper_types::{api_error, bytesrepr, runtime_args, system::mint, ApiError, Key, URef, U512}; + +const ARG_PURSE_NAME: &str = "purse_name"; + +fn burn(uref: URef, amount: U512) -> Result<(), mint::Error> { + let contract_hash = system::get_mint(); + let args = runtime_args! { + mint::ARG_PURSE => uref, + mint::ARG_AMOUNT => amount, + }; + runtime::call_contract(contract_hash, mint::METHOD_BURN, args) +} + +#[no_mangle] +pub extern "C" fn call() { + let purse_uref = match get_named_arg_option::(ARG_PURSE_NAME) { + Some(name) => { + // if a key was provided and there is no value under it we revert + // to prevent user from accidentaly burning tokens from the main purse + // eg. if they make a typo + let Some(Key::URef(purse_uref)) = runtime::get_key(&name) else { + runtime::revert(ApiError::InvalidPurseName) + }; + purse_uref + } + None => account::get_main_purse(), + }; + let amount: U512 = runtime::get_named_arg(mint::ARG_AMOUNT); + + burn(purse_uref, amount).unwrap_or_revert(); +} + +fn get_named_arg_size(name: &str) -> Option { + let mut arg_size: usize = 0; + let ret = unsafe { + ext_ffi::casper_get_named_arg_size( + name.as_bytes().as_ptr(), + name.len(), + &mut arg_size as *mut usize, + ) + }; + match api_error::result_from(ret) { + Ok(_) => Some(arg_size), + Err(ApiError::MissingArgument) => None, + Err(e) => runtime::revert(e), + } +} + +fn get_named_arg_option(name: &str) -> Option { + let arg_size = get_named_arg_size(name).unwrap_or_revert_with(ApiError::MissingArgument); + let arg_bytes = if arg_size > 0 { + let res = { + let data_non_null_ptr = alloc_bytes(arg_size); + let ret = unsafe { + ext_ffi::casper_get_named_arg( + name.as_bytes().as_ptr(), + name.len(), + data_non_null_ptr.as_ptr(), + arg_size, + ) + }; + let data = + unsafe { Vec::from_raw_parts(data_non_null_ptr.as_ptr(), arg_size, arg_size) }; + if ret != 0 { + return None; + } + data + }; + res + } else { + // Avoids allocation with 0 bytes and a call to get_named_arg + Vec::new() + }; + + let deserialized_data = + bytesrepr::deserialize(arg_bytes).unwrap_or_revert_with(ApiError::InvalidArgument); + Some(deserialized_data) +} diff --git a/storage/src/system/mint.rs b/storage/src/system/mint.rs index 71c7ff331f..e97ea36eaf 100644 --- a/storage/src/system/mint.rs +++ b/storage/src/system/mint.rs @@ -1,3 +1,4 @@ +pub(crate) mod detail; mod mint_native; pub mod runtime_provider; pub mod storage_provider; @@ -51,6 +52,33 @@ pub trait Mint: RuntimeProvider + StorageProvider + SystemProvider { Ok(purse_uref) } + /// Burns native tokens. + fn burn(&mut self, purse: URef, amount: U512) -> Result<(), Error> { + if !purse.is_writeable() { + return Err(Error::ForgedReference); + } + if !self.is_valid_uref(&purse) { + return Err(Error::ForgedReference); + } + + let source_balance: U512 = match self.read_balance(purse)? { + Some(source_balance) => source_balance, + None => return Err(Error::PurseNotFound), + }; + + let new_balance = match source_balance.checked_sub(amount) { + Some(value) => value, + None => U512::zero(), + }; + + // source_balance is >= than new_balance + // this should block user from reducing totaly supply beyond what they own + let burned_amount = source_balance - new_balance; + + self.write_balance(purse, new_balance)?; + detail::reduce_total_supply_unsafe(self, burned_amount) + } + /// Reduce total supply by `amount`. Returns unit on success, otherwise /// an error. fn reduce_total_supply(&mut self, amount: U512) -> Result<(), Error> { @@ -60,29 +88,7 @@ pub trait Mint: RuntimeProvider + StorageProvider + SystemProvider { return Err(Error::InvalidTotalSupplyReductionAttempt); } - if amount.is_zero() { - return Ok(()); // no change to supply - } - - // get total supply or error - let total_supply_uref = match self.get_key(TOTAL_SUPPLY_KEY) { - Some(Key::URef(uref)) => uref, - Some(_) => return Err(Error::MissingKey), // TODO - None => return Err(Error::MissingKey), - }; - let total_supply: U512 = self - .read(total_supply_uref)? - .ok_or(Error::TotalSupplyNotFound)?; - - // decrease total supply - let reduced_total_supply = total_supply - .checked_sub(amount) - .ok_or(Error::ArithmeticOverflow)?; - - // update total supply - self.write_amount(total_supply_uref, reduced_total_supply)?; - - Ok(()) + detail::reduce_total_supply_unsafe(self, amount) } /// Read balance of given `purse`. diff --git a/storage/src/system/mint/detail.rs b/storage/src/system/mint/detail.rs new file mode 100644 index 0000000000..cc102629e2 --- /dev/null +++ b/storage/src/system/mint/detail.rs @@ -0,0 +1,39 @@ +use casper_types::{ + system::{ + mint, + mint::{Error, TOTAL_SUPPLY_KEY}, + }, + Key, U512, +}; + +use crate::system::mint::Mint; + +// Please do not expose this to the user! +pub(crate) fn reduce_total_supply_unsafe

(mint: &mut P, amount: U512) -> Result<(), mint::Error> +where + P: Mint + ?Sized, +{ + if amount.is_zero() { + return Ok(()); // no change to supply + } + + // get total supply or error + let total_supply_uref = match mint.get_key(TOTAL_SUPPLY_KEY) { + Some(Key::URef(uref)) => uref, + Some(_) => return Err(Error::MissingKey), // TODO + None => return Err(Error::MissingKey), + }; + let total_supply: U512 = mint + .read(total_supply_uref)? + .ok_or(Error::TotalSupplyNotFound)?; + + // decrease total supply + let reduced_total_supply = total_supply + .checked_sub(amount) + .ok_or(Error::ArithmeticOverflow)?; + + // update total supply + mint.write_amount(total_supply_uref, reduced_total_supply)?; + + Ok(()) +} diff --git a/storage/src/system/mint/mint_native.rs b/storage/src/system/mint/mint_native.rs index 85b648b3c3..5d1dab3bb8 100644 --- a/storage/src/system/mint/mint_native.rs +++ b/storage/src/system/mint/mint_native.rs @@ -102,6 +102,10 @@ where fn allow_unrestricted_transfers(&self) -> bool { self.transfer_config().allow_unrestricted_transfers() } + + fn is_valid_uref(&self, uref: &URef) -> bool { + self.access_rights().has_access_rights_to_uref(uref) + } } impl StorageProvider for RuntimeNative diff --git a/storage/src/system/mint/runtime_provider.rs b/storage/src/system/mint/runtime_provider.rs index 8ade0171ec..57b45b6d51 100644 --- a/storage/src/system/mint/runtime_provider.rs +++ b/storage/src/system/mint/runtime_provider.rs @@ -43,4 +43,7 @@ pub trait RuntimeProvider { /// Checks if users can perform unrestricted transfers. This option is valid only for private /// chains. fn allow_unrestricted_transfers(&self) -> bool; + + /// Validate URef against context access rights. + fn is_valid_uref(&self, uref: &URef) -> bool; } diff --git a/types/src/chainspec/vm_config/mint_costs.rs b/types/src/chainspec/vm_config/mint_costs.rs index 4997468b5f..6039813268 100644 --- a/types/src/chainspec/vm_config/mint_costs.rs +++ b/types/src/chainspec/vm_config/mint_costs.rs @@ -14,6 +14,8 @@ use crate::bytesrepr::{self, FromBytes, ToBytes}; pub const DEFAULT_MINT_COST: u32 = 2_500_000_000; /// Default cost of the `reduce_total_supply` mint entry point. pub const DEFAULT_REDUCE_TOTAL_SUPPLY_COST: u32 = 10_000; +/// Default cost of the `burn` mint entry point. +pub const DEFAULT_BURN_COST: u32 = 10_000; /// Default cost of the `create` mint entry point. pub const DEFAULT_CREATE_COST: u32 = 2_500_000_000; /// Default cost of the `balance` mint entry point. @@ -35,6 +37,8 @@ pub struct MintCosts { pub mint: u32, /// Cost of calling the `reduce_total_supply` entry point. pub reduce_total_supply: u32, + /// Cost of calling the `burn` entry point. + pub burn: u32, /// Cost of calling the `create` entry point. pub create: u32, /// Cost of calling the `balance` entry point. @@ -52,6 +56,7 @@ impl Default for MintCosts { Self { mint: DEFAULT_MINT_COST, reduce_total_supply: DEFAULT_REDUCE_TOTAL_SUPPLY_COST, + burn: DEFAULT_BURN_COST, create: DEFAULT_CREATE_COST, balance: DEFAULT_BALANCE_COST, transfer: DEFAULT_TRANSFER_COST, @@ -68,6 +73,7 @@ impl ToBytes for MintCosts { let Self { mint, reduce_total_supply, + burn, create, balance, transfer, @@ -82,6 +88,7 @@ impl ToBytes for MintCosts { ret.append(&mut transfer.to_bytes()?); ret.append(&mut read_base_round_reward.to_bytes()?); ret.append(&mut mint_into_existing_purse.to_bytes()?); + ret.append(&mut burn.to_bytes()?); Ok(ret) } @@ -90,6 +97,7 @@ impl ToBytes for MintCosts { let Self { mint, reduce_total_supply, + burn, create, balance, transfer, @@ -99,6 +107,7 @@ impl ToBytes for MintCosts { mint.serialized_length() + reduce_total_supply.serialized_length() + + burn.serialized_length() + create.serialized_length() + balance.serialized_length() + transfer.serialized_length() @@ -116,11 +125,13 @@ impl FromBytes for MintCosts { let (transfer, rem) = FromBytes::from_bytes(rem)?; let (read_base_round_reward, rem) = FromBytes::from_bytes(rem)?; let (mint_into_existing_purse, rem) = FromBytes::from_bytes(rem)?; + let (burn, rem) = FromBytes::from_bytes(rem)?; Ok(( Self { mint, reduce_total_supply, + burn, create, balance, transfer, @@ -137,6 +148,7 @@ impl Distribution for Standard { fn sample(&self, rng: &mut R) -> MintCosts { MintCosts { mint: rng.gen(), + burn: rng.gen(), reduce_total_supply: rng.gen(), create: rng.gen(), balance: rng.gen(), @@ -158,6 +170,7 @@ pub mod gens { pub fn mint_costs_arb()( mint in num::u32::ANY, reduce_total_supply in num::u32::ANY, + burn in num::u32::ANY, create in num::u32::ANY, balance in num::u32::ANY, transfer in num::u32::ANY, @@ -167,6 +180,7 @@ pub mod gens { MintCosts { mint, reduce_total_supply, + burn, create, balance, transfer, diff --git a/types/src/system/mint/constants.rs b/types/src/system/mint/constants.rs index cffada448e..b49ab5c94f 100644 --- a/types/src/system/mint/constants.rs +++ b/types/src/system/mint/constants.rs @@ -17,6 +17,8 @@ pub const ARG_ROUND_SEIGNIORAGE_RATE: &str = "round_seigniorage_rate"; pub const METHOD_MINT: &str = "mint"; /// Named constant for method `reduce_total_supply`. pub const METHOD_REDUCE_TOTAL_SUPPLY: &str = "reduce_total_supply"; +/// Named constant for method `burn`. +pub const METHOD_BURN: &str = "burn"; /// Named constant for (synthetic) method `create` pub const METHOD_CREATE: &str = "create"; /// Named constant for method `balance`. diff --git a/types/src/system/mint/entry_points.rs b/types/src/system/mint/entry_points.rs index 6002b3383b..b5a5b6508d 100644 --- a/types/src/system/mint/entry_points.rs +++ b/types/src/system/mint/entry_points.rs @@ -3,7 +3,7 @@ use alloc::boxed::Box; use crate::{ addressable_entity::Parameters, system::mint::{ - ARG_AMOUNT, ARG_ID, ARG_PURSE, ARG_SOURCE, ARG_TARGET, ARG_TO, METHOD_BALANCE, + ARG_AMOUNT, ARG_ID, ARG_PURSE, ARG_SOURCE, ARG_TARGET, ARG_TO, METHOD_BALANCE, METHOD_BURN, METHOD_CREATE, METHOD_MINT, METHOD_MINT_INTO_EXISTING_PURSE, METHOD_READ_BASE_ROUND_REWARD, METHOD_REDUCE_TOTAL_SUPPLY, METHOD_TRANSFER, }, @@ -38,6 +38,21 @@ pub fn mint_entry_points() -> EntryPoints { ); entry_points.add_entry_point(entry_point); + let entry_point = EntryPoint::new( + METHOD_BURN, + vec![ + Parameter::new(ARG_PURSE, CLType::URef), + Parameter::new(ARG_AMOUNT, CLType::U512), + ], + CLType::Result { + ok: Box::new(CLType::Unit), + err: Box::new(CLType::U8), + }, + EntryPointAccess::Public, + EntryPointType::AddressableEntity, + ); + entry_points.add_entry_point(entry_point); + let entry_point = EntryPoint::new( METHOD_CREATE, Parameters::new(), From 26178e6913234c08d0a97b1c7638ba5e6975822e Mon Sep 17 00:00:00 2001 From: Jan Hoffmann Date: Wed, 24 Apr 2024 14:13:51 +0200 Subject: [PATCH 2/8] removed output.txt temp file --- output.txt | 1520 ---------------------------------------------------- 1 file changed, 1520 deletions(-) delete mode 100644 output.txt diff --git a/output.txt b/output.txt deleted file mode 100644 index 7722d4c55b..0000000000 --- a/output.txt +++ /dev/null @@ -1,1520 +0,0 @@ -casper-engine-test-support v6.0.0 (/Users/janhoffmann/Work/ca/casper-node/execution_engine_testing/test_support) -├── casper-execution-engine v6.0.0 (/Users/janhoffmann/Work/ca/casper-node/execution_engine) -│ ├── anyhow v1.0.73 -│ ├── base16 v0.2.1 -│ ├── bincode v1.3.3 -│ │ └── serde v1.0.183 -│ │ └── serde_derive v1.0.183 (proc-macro) -│ │ ├── proc-macro2 v1.0.66 -│ │ │ └── unicode-ident v1.0.11 -│ │ ├── quote v1.0.32 -│ │ │ └── proc-macro2 v1.0.66 (*) -│ │ └── syn v2.0.28 -│ │ ├── proc-macro2 v1.0.66 (*) -│ │ ├── quote v1.0.32 (*) -│ │ └── unicode-ident v1.0.11 -│ ├── casper-storage v1.4.3 (/Users/janhoffmann/Work/ca/casper-node/storage) -│ │ ├── bincode v1.3.3 (*) -│ │ ├── casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) -│ │ │ ├── base16 v0.2.1 -│ │ │ ├── base64 v0.13.1 -│ │ │ ├── bincode v1.3.3 (*) -│ │ │ ├── bitflags v1.3.2 -│ │ │ ├── blake2 v0.9.2 -│ │ │ │ ├── crypto-mac v0.8.0 -│ │ │ │ │ ├── generic-array v0.14.7 -│ │ │ │ │ │ ├── typenum v1.16.0 -│ │ │ │ │ │ └── zeroize v1.6.0 -│ │ │ │ │ │ [build-dependencies] -│ │ │ │ │ │ └── version_check v0.9.4 -│ │ │ │ │ └── subtle v2.4.1 -│ │ │ │ ├── digest v0.9.0 -│ │ │ │ │ └── generic-array v0.14.7 (*) -│ │ │ │ └── opaque-debug v0.3.0 -│ │ │ ├── datasize v0.2.15 -│ │ │ │ ├── datasize_derive v0.2.15 (proc-macro) -│ │ │ │ │ ├── proc-macro2 v1.0.66 (*) -│ │ │ │ │ ├── quote v1.0.32 (*) -│ │ │ │ │ └── syn v1.0.109 -│ │ │ │ │ ├── proc-macro2 v1.0.66 (*) -│ │ │ │ │ ├── quote v1.0.32 (*) -│ │ │ │ │ └── unicode-ident v1.0.11 -│ │ │ │ ├── fake_instant v0.4.0 -│ │ │ │ ├── futures v0.3.28 -│ │ │ │ │ ├── futures-channel v0.3.28 -│ │ │ │ │ │ ├── futures-core v0.3.28 -│ │ │ │ │ │ └── futures-sink v0.3.28 -│ │ │ │ │ ├── futures-core v0.3.28 -│ │ │ │ │ ├── futures-executor v0.3.28 -│ │ │ │ │ │ ├── futures-core v0.3.28 -│ │ │ │ │ │ ├── futures-task v0.3.28 -│ │ │ │ │ │ └── futures-util v0.3.28 -│ │ │ │ │ │ ├── futures-channel v0.3.28 (*) -│ │ │ │ │ │ ├── futures-core v0.3.28 -│ │ │ │ │ │ ├── futures-io v0.3.28 -│ │ │ │ │ │ ├── futures-macro v0.3.28 (proc-macro) -│ │ │ │ │ │ │ ├── proc-macro2 v1.0.66 (*) -│ │ │ │ │ │ │ ├── quote v1.0.32 (*) -│ │ │ │ │ │ │ └── syn v2.0.28 (*) -│ │ │ │ │ │ ├── futures-sink v0.3.28 -│ │ │ │ │ │ ├── futures-task v0.3.28 -│ │ │ │ │ │ ├── memchr v2.5.0 -│ │ │ │ │ │ ├── pin-project-lite v0.2.12 -│ │ │ │ │ │ ├── pin-utils v0.1.0 -│ │ │ │ │ │ └── slab v0.4.8 -│ │ │ │ │ │ [build-dependencies] -│ │ │ │ │ │ └── autocfg v1.1.0 -│ │ │ │ │ ├── futures-io v0.3.28 -│ │ │ │ │ ├── futures-sink v0.3.28 -│ │ │ │ │ ├── futures-task v0.3.28 -│ │ │ │ │ └── futures-util v0.3.28 (*) -│ │ │ │ ├── serde v1.0.183 (*) -│ │ │ │ └── smallvec v1.11.0 -│ │ │ │ └── serde v1.0.183 (*) -│ │ │ ├── derive_more v0.99.17 (proc-macro) -│ │ │ │ ├── convert_case v0.4.0 -│ │ │ │ ├── proc-macro2 v1.0.66 (*) -│ │ │ │ ├── quote v1.0.32 (*) -│ │ │ │ └── syn v1.0.109 (*) -│ │ │ │ [build-dependencies] -│ │ │ │ └── rustc_version v0.4.0 -│ │ │ │ └── semver v1.0.18 -│ │ │ ├── derp v0.0.14 -│ │ │ │ └── untrusted v0.7.1 -│ │ │ ├── ed25519-dalek v2.0.0 -│ │ │ │ ├── curve25519-dalek v4.0.0 -│ │ │ │ │ ├── cfg-if v1.0.0 -│ │ │ │ │ ├── digest v0.10.7 -│ │ │ │ │ │ ├── block-buffer v0.10.4 -│ │ │ │ │ │ │ └── generic-array v0.14.7 (*) -│ │ │ │ │ │ ├── const-oid v0.9.4 -│ │ │ │ │ │ ├── crypto-common v0.1.6 -│ │ │ │ │ │ │ ├── generic-array v0.14.7 (*) -│ │ │ │ │ │ │ └── typenum v1.16.0 -│ │ │ │ │ │ └── subtle v2.4.1 -│ │ │ │ │ ├── subtle v2.4.1 -│ │ │ │ │ └── zeroize v1.6.0 -│ │ │ │ │ [build-dependencies] -│ │ │ │ │ ├── platforms v3.0.2 -│ │ │ │ │ └── rustc_version v0.4.0 (*) -│ │ │ │ ├── ed25519 v2.2.2 -│ │ │ │ │ └── signature v2.1.0 -│ │ │ │ │ ├── digest v0.10.7 (*) -│ │ │ │ │ └── rand_core v0.6.4 -│ │ │ │ │ └── getrandom v0.2.10 -│ │ │ │ │ ├── cfg-if v1.0.0 -│ │ │ │ │ └── libc v0.2.153 -│ │ │ │ ├── sha2 v0.10.6 -│ │ │ │ │ ├── cfg-if v1.0.0 -│ │ │ │ │ ├── cpufeatures v0.2.9 -│ │ │ │ │ │ └── libc v0.2.153 -│ │ │ │ │ └── digest v0.10.7 (*) -│ │ │ │ └── zeroize v1.6.0 -│ │ │ ├── getrandom v0.2.10 (*) -│ │ │ ├── hex v0.4.3 -│ │ │ │ └── serde v1.0.183 (*) -│ │ │ ├── hex_fmt v0.3.0 -│ │ │ ├── humantime v2.1.0 -│ │ │ ├── itertools v0.10.5 -│ │ │ │ └── either v1.9.0 -│ │ │ │ └── serde v1.0.183 (*) -│ │ │ ├── k256 v0.13.1 -│ │ │ │ ├── cfg-if v1.0.0 -│ │ │ │ ├── ecdsa v0.16.7 -│ │ │ │ │ ├── der v0.7.7 -│ │ │ │ │ │ ├── const-oid v0.9.4 -│ │ │ │ │ │ └── zeroize v1.6.0 -│ │ │ │ │ ├── digest v0.10.7 (*) -│ │ │ │ │ ├── elliptic-curve v0.13.5 -│ │ │ │ │ │ ├── base16ct v0.2.0 -│ │ │ │ │ │ ├── crypto-bigint v0.5.2 -│ │ │ │ │ │ │ ├── generic-array v0.14.7 (*) -│ │ │ │ │ │ │ ├── rand_core v0.6.4 (*) -│ │ │ │ │ │ │ ├── subtle v2.4.1 -│ │ │ │ │ │ │ └── zeroize v1.6.0 -│ │ │ │ │ │ ├── digest v0.10.7 (*) -│ │ │ │ │ │ ├── ff v0.13.0 -│ │ │ │ │ │ │ ├── rand_core v0.6.4 (*) -│ │ │ │ │ │ │ └── subtle v2.4.1 -│ │ │ │ │ │ ├── generic-array v0.14.7 (*) -│ │ │ │ │ │ ├── group v0.13.0 -│ │ │ │ │ │ │ ├── ff v0.13.0 (*) -│ │ │ │ │ │ │ ├── rand_core v0.6.4 (*) -│ │ │ │ │ │ │ └── subtle v2.4.1 -│ │ │ │ │ │ ├── rand_core v0.6.4 (*) -│ │ │ │ │ │ ├── sec1 v0.7.3 -│ │ │ │ │ │ │ ├── base16ct v0.2.0 -│ │ │ │ │ │ │ ├── der v0.7.7 (*) -│ │ │ │ │ │ │ ├── generic-array v0.14.7 (*) -│ │ │ │ │ │ │ ├── subtle v2.4.1 -│ │ │ │ │ │ │ └── zeroize v1.6.0 -│ │ │ │ │ │ ├── subtle v2.4.1 -│ │ │ │ │ │ └── zeroize v1.6.0 -│ │ │ │ │ ├── rfc6979 v0.4.0 -│ │ │ │ │ │ ├── hmac v0.12.1 -│ │ │ │ │ │ │ └── digest v0.10.7 (*) -│ │ │ │ │ │ └── subtle v2.4.1 -│ │ │ │ │ └── signature v2.1.0 (*) -│ │ │ │ ├── elliptic-curve v0.13.5 (*) -│ │ │ │ └── sha2 v0.10.6 (*) -│ │ │ ├── libc v0.2.153 -│ │ │ ├── num v0.4.1 -│ │ │ │ ├── num-bigint v0.4.3 -│ │ │ │ │ ├── num-integer v0.1.45 -│ │ │ │ │ │ └── num-traits v0.2.16 -│ │ │ │ │ │ └── libm v0.2.7 -│ │ │ │ │ │ [build-dependencies] -│ │ │ │ │ │ └── autocfg v1.1.0 -│ │ │ │ │ │ [build-dependencies] -│ │ │ │ │ │ └── autocfg v1.1.0 -│ │ │ │ │ └── num-traits v0.2.16 (*) -│ │ │ │ │ [build-dependencies] -│ │ │ │ │ └── autocfg v1.1.0 -│ │ │ │ ├── num-complex v0.4.4 -│ │ │ │ │ └── num-traits v0.2.16 (*) -│ │ │ │ ├── num-integer v0.1.45 (*) -│ │ │ │ ├── num-iter v0.1.43 -│ │ │ │ │ ├── num-integer v0.1.45 (*) -│ │ │ │ │ └── num-traits v0.2.16 (*) -│ │ │ │ │ [build-dependencies] -│ │ │ │ │ └── autocfg v1.1.0 -│ │ │ │ ├── num-rational v0.4.1 -│ │ │ │ │ ├── num-bigint v0.4.3 (*) -│ │ │ │ │ ├── num-integer v0.1.45 (*) -│ │ │ │ │ ├── num-traits v0.2.16 (*) -│ │ │ │ │ └── serde v1.0.183 (*) -│ │ │ │ │ [build-dependencies] -│ │ │ │ │ └── autocfg v1.1.0 -│ │ │ │ └── num-traits v0.2.16 (*) -│ │ │ ├── num-derive v0.3.3 (proc-macro) -│ │ │ │ ├── proc-macro2 v1.0.66 (*) -│ │ │ │ ├── quote v1.0.32 (*) -│ │ │ │ └── syn v1.0.109 (*) -│ │ │ ├── num-integer v0.1.45 (*) -│ │ │ ├── num-rational v0.4.1 (*) -│ │ │ ├── num-traits v0.2.16 (*) -│ │ │ ├── once_cell v1.18.0 -│ │ │ ├── pem v0.8.3 -│ │ │ │ ├── base64 v0.13.1 -│ │ │ │ ├── once_cell v1.18.0 -│ │ │ │ └── regex v1.9.3 -│ │ │ │ ├── aho-corasick v1.0.4 -│ │ │ │ │ └── memchr v2.5.0 -│ │ │ │ ├── memchr v2.5.0 -│ │ │ │ ├── regex-automata v0.3.6 -│ │ │ │ │ ├── aho-corasick v1.0.4 (*) -│ │ │ │ │ ├── memchr v2.5.0 -│ │ │ │ │ └── regex-syntax v0.7.4 -│ │ │ │ └── regex-syntax v0.7.4 -│ │ │ ├── proptest v1.2.0 -│ │ │ │ ├── bit-set v0.5.3 -│ │ │ │ │ └── bit-vec v0.6.3 -│ │ │ │ ├── bitflags v1.3.2 -│ │ │ │ ├── byteorder v1.4.3 -│ │ │ │ ├── lazy_static v1.4.0 -│ │ │ │ ├── num-traits v0.2.16 (*) -│ │ │ │ ├── rand v0.8.5 -│ │ │ │ │ ├── libc v0.2.153 -│ │ │ │ │ ├── rand_chacha v0.3.1 -│ │ │ │ │ │ ├── ppv-lite86 v0.2.17 -│ │ │ │ │ │ └── rand_core v0.6.4 (*) -│ │ │ │ │ └── rand_core v0.6.4 (*) -│ │ │ │ ├── rand_chacha v0.3.1 (*) -│ │ │ │ ├── rand_xorshift v0.3.0 -│ │ │ │ │ └── rand_core v0.6.4 (*) -│ │ │ │ ├── regex-syntax v0.6.29 -│ │ │ │ ├── rusty-fork v0.3.0 -│ │ │ │ │ ├── fnv v1.0.7 -│ │ │ │ │ ├── quick-error v1.2.3 -│ │ │ │ │ ├── tempfile v3.7.1 -│ │ │ │ │ │ ├── cfg-if v1.0.0 -│ │ │ │ │ │ ├── fastrand v2.0.0 -│ │ │ │ │ │ └── rustix v0.38.8 -│ │ │ │ │ │ ├── bitflags v2.4.0 -│ │ │ │ │ │ ├── errno v0.3.2 -│ │ │ │ │ │ │ └── libc v0.2.153 -│ │ │ │ │ │ └── libc v0.2.153 -│ │ │ │ │ └── wait-timeout v0.2.0 -│ │ │ │ │ └── libc v0.2.153 -│ │ │ │ ├── tempfile v3.7.1 (*) -│ │ │ │ └── unarray v0.1.4 -│ │ │ ├── proptest-derive v0.3.0 (proc-macro) -│ │ │ │ ├── proc-macro2 v0.4.30 -│ │ │ │ │ └── unicode-xid v0.1.0 -│ │ │ │ ├── quote v0.6.13 -│ │ │ │ │ └── proc-macro2 v0.4.30 (*) -│ │ │ │ └── syn v0.15.44 -│ │ │ │ ├── proc-macro2 v0.4.30 (*) -│ │ │ │ ├── quote v0.6.13 (*) -│ │ │ │ └── unicode-xid v0.1.0 -│ │ │ ├── rand v0.8.5 (*) -│ │ │ ├── rand_pcg v0.3.1 -│ │ │ │ └── rand_core v0.6.4 (*) -│ │ │ ├── schemars v0.8.16 -│ │ │ │ ├── dyn-clone v1.0.12 -│ │ │ │ ├── indexmap v1.9.3 -│ │ │ │ │ ├── hashbrown v0.12.3 -│ │ │ │ │ └── serde v1.0.183 (*) -│ │ │ │ │ [build-dependencies] -│ │ │ │ │ └── autocfg v1.1.0 -│ │ │ │ ├── schemars_derive v0.8.16 (proc-macro) -│ │ │ │ │ ├── proc-macro2 v1.0.66 (*) -│ │ │ │ │ ├── quote v1.0.32 (*) -│ │ │ │ │ ├── serde_derive_internals v0.26.0 -│ │ │ │ │ │ ├── proc-macro2 v1.0.66 (*) -│ │ │ │ │ │ ├── quote v1.0.32 (*) -│ │ │ │ │ │ └── syn v1.0.109 (*) -│ │ │ │ │ └── syn v1.0.109 (*) -│ │ │ │ ├── serde v1.0.183 (*) -│ │ │ │ └── serde_json v1.0.104 -│ │ │ │ ├── indexmap v2.0.0 -│ │ │ │ │ ├── equivalent v1.0.1 -│ │ │ │ │ └── hashbrown v0.14.0 -│ │ │ │ ├── itoa v1.0.9 -│ │ │ │ ├── ryu v1.0.15 -│ │ │ │ └── serde v1.0.183 (*) -│ │ │ ├── serde v1.0.183 (*) -│ │ │ ├── serde-map-to-array v1.1.1 -│ │ │ │ ├── schemars v0.8.16 (*) -│ │ │ │ └── serde v1.0.183 (*) -│ │ │ ├── serde_bytes v0.11.12 -│ │ │ │ └── serde v1.0.183 (*) -│ │ │ ├── serde_json v1.0.104 (*) -│ │ │ ├── strum v0.24.1 -│ │ │ │ └── strum_macros v0.24.3 (proc-macro) -│ │ │ │ ├── heck v0.4.1 -│ │ │ │ ├── proc-macro2 v1.0.66 (*) -│ │ │ │ ├── quote v1.0.32 (*) -│ │ │ │ ├── rustversion v1.0.14 (proc-macro) -│ │ │ │ └── syn v1.0.109 (*) -│ │ │ ├── thiserror v1.0.45 -│ │ │ │ └── thiserror-impl v1.0.45 (proc-macro) -│ │ │ │ ├── proc-macro2 v1.0.66 (*) -│ │ │ │ ├── quote v1.0.32 (*) -│ │ │ │ └── syn v2.0.28 (*) -│ │ │ ├── tracing v0.1.37 -│ │ │ │ ├── cfg-if v1.0.0 -│ │ │ │ ├── log v0.4.20 -│ │ │ │ │ ├── serde v1.0.183 (*) -│ │ │ │ │ └── value-bag v1.4.1 -│ │ │ │ ├── pin-project-lite v0.2.12 -│ │ │ │ ├── tracing-attributes v0.1.26 (proc-macro) -│ │ │ │ │ ├── proc-macro2 v1.0.66 (*) -│ │ │ │ │ ├── quote v1.0.32 (*) -│ │ │ │ │ └── syn v2.0.28 (*) -│ │ │ │ └── tracing-core v0.1.31 -│ │ │ │ └── once_cell v1.18.0 -│ │ │ ├── uint v0.9.5 -│ │ │ │ ├── byteorder v1.4.3 -│ │ │ │ ├── crunchy v0.2.2 -│ │ │ │ ├── hex v0.4.3 (*) -│ │ │ │ └── static_assertions v1.1.0 -│ │ │ └── untrusted v0.7.1 -│ │ │ [dev-dependencies] -│ │ │ ├── base16 v0.2.1 -│ │ │ ├── bincode v1.3.3 (*) -│ │ │ ├── criterion v0.3.6 -│ │ │ │ ├── atty v0.2.14 -│ │ │ │ │ └── libc v0.2.153 -│ │ │ │ ├── cast v0.3.0 -│ │ │ │ ├── clap v2.34.0 -│ │ │ │ │ ├── ansi_term v0.12.1 -│ │ │ │ │ ├── atty v0.2.14 (*) -│ │ │ │ │ ├── bitflags v1.3.2 -│ │ │ │ │ ├── strsim v0.8.0 -│ │ │ │ │ ├── textwrap v0.11.0 -│ │ │ │ │ │ └── unicode-width v0.1.10 -│ │ │ │ │ ├── unicode-width v0.1.10 -│ │ │ │ │ └── vec_map v0.8.2 -│ │ │ │ ├── criterion-plot v0.4.5 -│ │ │ │ │ ├── cast v0.3.0 -│ │ │ │ │ └── itertools v0.10.5 (*) -│ │ │ │ ├── csv v1.2.2 -│ │ │ │ │ ├── csv-core v0.1.10 -│ │ │ │ │ │ └── memchr v2.5.0 -│ │ │ │ │ ├── itoa v1.0.9 -│ │ │ │ │ ├── ryu v1.0.15 -│ │ │ │ │ └── serde v1.0.183 (*) -│ │ │ │ ├── itertools v0.10.5 (*) -│ │ │ │ ├── lazy_static v1.4.0 -│ │ │ │ ├── num-traits v0.2.16 (*) -│ │ │ │ ├── oorandom v11.1.3 -│ │ │ │ ├── plotters v0.3.5 -│ │ │ │ │ ├── num-traits v0.2.16 (*) -│ │ │ │ │ ├── plotters-backend v0.3.5 -│ │ │ │ │ └── plotters-svg v0.3.5 -│ │ │ │ │ └── plotters-backend v0.3.5 -│ │ │ │ ├── rayon v1.7.0 -│ │ │ │ │ ├── either v1.9.0 (*) -│ │ │ │ │ └── rayon-core v1.11.0 -│ │ │ │ │ ├── crossbeam-channel v0.5.8 -│ │ │ │ │ │ ├── cfg-if v1.0.0 -│ │ │ │ │ │ └── crossbeam-utils v0.8.16 -│ │ │ │ │ │ └── cfg-if v1.0.0 -│ │ │ │ │ ├── crossbeam-deque v0.8.3 -│ │ │ │ │ │ ├── cfg-if v1.0.0 -│ │ │ │ │ │ ├── crossbeam-epoch v0.9.15 -│ │ │ │ │ │ │ ├── cfg-if v1.0.0 -│ │ │ │ │ │ │ ├── crossbeam-utils v0.8.16 (*) -│ │ │ │ │ │ │ ├── memoffset v0.9.0 -│ │ │ │ │ │ │ │ [build-dependencies] -│ │ │ │ │ │ │ │ └── autocfg v1.1.0 -│ │ │ │ │ │ │ └── scopeguard v1.2.0 -│ │ │ │ │ │ │ [build-dependencies] -│ │ │ │ │ │ │ └── autocfg v1.1.0 -│ │ │ │ │ │ └── crossbeam-utils v0.8.16 (*) -│ │ │ │ │ ├── crossbeam-utils v0.8.16 (*) -│ │ │ │ │ └── num_cpus v1.16.0 -│ │ │ │ │ └── libc v0.2.153 -│ │ │ │ ├── regex v1.9.3 (*) -│ │ │ │ ├── serde v1.0.183 (*) -│ │ │ │ ├── serde_cbor v0.11.2 -│ │ │ │ │ ├── half v1.8.2 -│ │ │ │ │ └── serde v1.0.183 (*) -│ │ │ │ ├── serde_derive v1.0.183 (proc-macro) (*) -│ │ │ │ ├── serde_json v1.0.104 (*) -│ │ │ │ ├── tinytemplate v1.2.1 -│ │ │ │ │ ├── serde v1.0.183 (*) -│ │ │ │ │ └── serde_json v1.0.104 (*) -│ │ │ │ └── walkdir v2.3.3 -│ │ │ │ └── same-file v1.0.6 -│ │ │ ├── derp v0.0.14 (*) -│ │ │ ├── getrandom v0.2.10 (*) -│ │ │ ├── humantime v2.1.0 -│ │ │ ├── once_cell v1.18.0 -│ │ │ ├── openssl v0.10.56 -│ │ │ │ ├── bitflags v1.3.2 -│ │ │ │ ├── cfg-if v1.0.0 -│ │ │ │ ├── foreign-types v0.3.2 -│ │ │ │ │ └── foreign-types-shared v0.1.1 -│ │ │ │ ├── libc v0.2.153 -│ │ │ │ ├── once_cell v1.18.0 -│ │ │ │ ├── openssl-macros v0.1.1 (proc-macro) -│ │ │ │ │ ├── proc-macro2 v1.0.66 (*) -│ │ │ │ │ ├── quote v1.0.32 (*) -│ │ │ │ │ └── syn v2.0.28 (*) -│ │ │ │ └── openssl-sys v0.9.91 -│ │ │ │ └── libc v0.2.153 -│ │ │ │ [build-dependencies] -│ │ │ │ ├── cc v1.0.82 -│ │ │ │ │ └── libc v0.2.153 -│ │ │ │ ├── pkg-config v0.3.27 -│ │ │ │ └── vcpkg v0.2.15 -│ │ │ ├── pem v0.8.3 (*) -│ │ │ ├── proptest v1.2.0 (*) -│ │ │ ├── proptest-attr-macro v1.0.0 (proc-macro) -│ │ │ │ ├── proc-macro2 v1.0.66 (*) -│ │ │ │ ├── quote v1.0.32 (*) -│ │ │ │ └── syn v1.0.109 (*) -│ │ │ ├── proptest-derive v0.3.0 (proc-macro) (*) -│ │ │ ├── rand v0.8.5 (*) -│ │ │ ├── rand_pcg v0.3.1 (*) -│ │ │ ├── serde_json v1.0.104 (*) -│ │ │ ├── serde_test v1.0.176 -│ │ │ │ └── serde v1.0.183 (*) -│ │ │ ├── strum v0.24.1 (*) -│ │ │ ├── tempfile v3.7.1 (*) -│ │ │ ├── thiserror v1.0.45 (*) -│ │ │ └── untrusted v0.7.1 -│ │ ├── datasize v0.2.15 (*) -│ │ ├── either v1.9.0 (*) -│ │ ├── itertools v0.10.5 (*) -│ │ ├── linked-hash-map v0.5.6 -│ │ ├── lmdb-rkv v0.14.0 -│ │ │ ├── bitflags v1.3.2 -│ │ │ ├── byteorder v1.4.3 -│ │ │ ├── libc v0.2.153 -│ │ │ └── lmdb-rkv-sys v0.11.2 -│ │ │ └── libc v0.2.153 -│ │ │ [build-dependencies] -│ │ │ ├── cc v1.0.82 (*) -│ │ │ └── pkg-config v0.3.27 -│ │ ├── num v0.4.1 (*) -│ │ ├── num-derive v0.3.3 (proc-macro) (*) -│ │ ├── num-rational v0.4.1 (*) -│ │ ├── num-traits v0.2.16 (*) -│ │ ├── once_cell v1.18.0 -│ │ ├── rand v0.8.5 (*) -│ │ ├── rand_chacha v0.3.1 (*) -│ │ ├── serde v1.0.183 (*) -│ │ ├── tempfile v3.7.1 (*) -│ │ ├── thiserror v1.0.45 (*) -│ │ ├── tracing v0.1.37 (*) -│ │ └── uuid v0.8.2 -│ │ ├── getrandom v0.2.10 (*) -│ │ └── serde v1.0.183 (*) -│ │ [dev-dependencies] -│ │ ├── anyhow v1.0.73 -│ │ ├── assert_matches v1.5.0 -│ │ ├── base16 v0.2.1 -│ │ ├── casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) (*) -│ │ ├── proptest v1.2.0 (*) -│ │ ├── rand v0.8.5 (*) -│ │ └── serde_json v1.0.104 (*) -│ ├── casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) (*) -│ ├── casper-wasm v0.46.0 -│ ├── casper-wasm-utils v3.0.0 -│ │ ├── byteorder v1.4.3 -│ │ ├── casper-wasm v0.46.0 -│ │ └── log v0.4.20 (*) -│ ├── casper-wasmi v0.13.2 -│ │ ├── casper-wasm v0.46.0 -│ │ ├── casper-wasmi-core v0.2.1 -│ │ │ ├── downcast-rs v1.2.0 -│ │ │ ├── libm v0.2.7 -│ │ │ ├── memory_units v0.4.0 -│ │ │ ├── num-rational v0.4.1 (*) -│ │ │ └── num-traits v0.2.16 (*) -│ │ └── casper-wasmi-validation v0.5.0 -│ │ └── casper-wasm v0.46.0 -│ ├── datasize v0.2.15 (*) -│ ├── either v1.9.0 (*) -│ ├── hex-buffer-serde v0.2.2 -│ │ ├── hex v0.4.3 (*) -│ │ └── serde v1.0.183 (*) -│ ├── hex_fmt v0.3.0 -│ ├── hostname v0.3.1 -│ │ ├── libc v0.2.153 -│ │ └── match_cfg v0.1.0 -│ ├── humantime v2.1.0 -│ ├── itertools v0.10.5 (*) -│ ├── linked-hash-map v0.5.6 -│ ├── log v0.4.20 (*) -│ ├── num v0.4.1 (*) -│ ├── num-derive v0.3.3 (proc-macro) (*) -│ ├── num-rational v0.4.1 (*) -│ ├── num-traits v0.2.16 (*) -│ ├── num_cpus v1.16.0 (*) -│ ├── once_cell v1.18.0 -│ ├── proptest v1.2.0 (*) -│ ├── rand v0.8.5 (*) -│ ├── rand_chacha v0.3.1 (*) -│ ├── schemars v0.8.16 (*) -│ ├── serde v1.0.183 (*) -│ ├── serde_bytes v0.11.12 (*) -│ ├── serde_json v1.0.104 (*) -│ ├── strum v0.24.1 (*) -│ ├── thiserror v1.0.45 (*) -│ ├── tracing v0.1.37 (*) -│ └── uint v0.9.5 (*) -│ [dev-dependencies] -│ ├── assert_matches v1.5.0 -│ ├── casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) (*) -│ ├── criterion v0.3.6 (*) -│ ├── proptest v1.2.0 (*) -│ ├── tempfile v3.7.1 (*) -│ └── walrus v0.19.0 -│ ├── anyhow v1.0.73 -│ ├── id-arena v2.2.1 -│ ├── leb128 v0.2.5 -│ ├── log v0.4.20 (*) -│ ├── walrus-macro v0.19.0 (proc-macro) -│ │ ├── heck v0.3.3 -│ │ │ └── unicode-segmentation v1.10.1 -│ │ ├── proc-macro2 v1.0.66 (*) -│ │ ├── quote v1.0.32 (*) -│ │ └── syn v1.0.109 (*) -│ └── wasmparser v0.77.1 -├── casper-storage v1.4.3 (/Users/janhoffmann/Work/ca/casper-node/storage) (*) -├── casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) (*) -├── env_logger v0.10.0 -│ ├── humantime v2.1.0 -│ ├── is-terminal v0.4.9 -│ │ └── rustix v0.38.8 (*) -│ ├── log v0.4.20 (*) -│ ├── regex v1.9.3 (*) -│ └── termcolor v1.2.0 -├── filesize v0.2.0 -├── humantime v2.1.0 -├── lmdb-rkv v0.14.0 (*) -├── log v0.4.20 (*) -├── num-rational v0.4.1 (*) -├── num-traits v0.2.16 (*) -├── once_cell v1.18.0 -├── rand v0.8.5 (*) -├── serde v1.0.183 (*) -├── tempfile v3.7.1 (*) -└── toml v0.5.11 - └── serde v1.0.183 (*) -[dev-dependencies] -├── casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) (*) -└── version-sync v0.9.4 - ├── proc-macro2 v1.0.66 (*) - ├── pulldown-cmark v0.8.0 - │ ├── bitflags v1.3.2 - │ ├── memchr v2.5.0 - │ └── unicase v2.6.0 - │ [build-dependencies] - │ └── version_check v0.9.4 - ├── regex v1.9.3 (*) - ├── semver v1.0.18 - ├── syn v1.0.109 (*) - ├── toml v0.5.11 (*) - └── url v2.4.0 - ├── form_urlencoded v1.2.0 - │ └── percent-encoding v2.3.0 - ├── idna v0.4.0 - │ ├── unicode-bidi v0.3.13 - │ └── unicode-normalization v0.1.22 - │ └── tinyvec v1.6.0 - │ └── tinyvec_macros v0.1.1 - └── percent-encoding v2.3.0 - -casper-engine-tests v0.1.0 (/Users/janhoffmann/Work/ca/casper-node/execution_engine_testing/tests) -├── base16 v0.2.1 -├── casper-engine-test-support v6.0.0 (/Users/janhoffmann/Work/ca/casper-node/execution_engine_testing/test_support) (*) -├── casper-execution-engine v6.0.0 (/Users/janhoffmann/Work/ca/casper-node/execution_engine) (*) -├── casper-storage v1.4.3 (/Users/janhoffmann/Work/ca/casper-node/storage) (*) -├── casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) (*) -├── casper-wasm v0.46.0 -├── clap v2.34.0 (*) -├── fs_extra v1.3.0 -├── log v0.4.20 (*) -├── rand v0.8.5 (*) -├── serde v1.0.183 (*) -├── serde_json v1.0.104 (*) -├── tempfile v3.7.1 (*) -├── wabt v0.10.0 -│ ├── serde v1.0.183 (*) -│ ├── serde_derive v1.0.183 (proc-macro) (*) -│ ├── serde_json v1.0.104 (*) -│ └── wabt-sys v0.8.0 -│ [build-dependencies] -│ ├── cc v1.0.82 (*) -│ └── cmake v0.1.50 -│ └── cc v1.0.82 (*) -└── walrus v0.19.0 (*) -[dev-dependencies] -├── assert_matches v1.5.0 -├── criterion v0.3.6 (*) -├── dictionary v0.1.0 (/Users/janhoffmann/Work/ca/casper-node/smart_contracts/contracts/test/dictionary) -│ ├── casper-contract v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/smart_contracts/contract) -│ │ ├── casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) (*) -│ │ └── hex_fmt v0.3.0 -│ └── casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) (*) -├── dictionary-call v0.1.0 (/Users/janhoffmann/Work/ca/casper-node/smart_contracts/contracts/test/dictionary-call) -│ ├── casper-contract v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/smart_contracts/contract) (*) -│ ├── casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) (*) -│ └── dictionary v0.1.0 (/Users/janhoffmann/Work/ca/casper-node/smart_contracts/contracts/test/dictionary) (*) -├── get-call-stack-recursive-subcall v0.1.0 (/Users/janhoffmann/Work/ca/casper-node/smart_contracts/contracts/test/get-call-stack-recursive-subcall) -│ ├── casper-contract v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/smart_contracts/contract) (*) -│ └── casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) (*) -├── gh-1470-regression v0.1.0 (/Users/janhoffmann/Work/ca/casper-node/smart_contracts/contracts/test/gh-1470-regression) -│ ├── casper-contract v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/smart_contracts/contract) (*) -│ └── casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) (*) -├── gh-1470-regression-call v0.1.0 (/Users/janhoffmann/Work/ca/casper-node/smart_contracts/contracts/test/gh-1470-regression-call) -│ ├── casper-contract v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/smart_contracts/contract) (*) -│ ├── casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) (*) -│ └── gh-1470-regression v0.1.0 (/Users/janhoffmann/Work/ca/casper-node/smart_contracts/contracts/test/gh-1470-regression) (*) -├── lmdb-rkv v0.14.0 (*) -├── num-rational v0.4.1 (*) -├── num-traits v0.2.16 (*) -├── once_cell v1.18.0 -├── regex v1.9.3 (*) -└── wat v1.0.69 - └── wast v62.0.1 - ├── leb128 v0.2.5 - ├── memchr v2.5.0 - ├── unicode-width v0.1.10 - └── wasm-encoder v0.31.1 - └── leb128 v0.2.5 - -casper-execution-engine v6.0.0 (/Users/janhoffmann/Work/ca/casper-node/execution_engine) (*) - -casper-json-rpc v1.1.0 (/Users/janhoffmann/Work/ca/casper-node/json_rpc) -├── bytes v1.4.0 -├── futures v0.3.28 (*) -├── http v0.2.9 -│ ├── bytes v1.4.0 -│ ├── fnv v1.0.7 -│ └── itoa v1.0.9 -├── itertools v0.10.5 (*) -├── serde v1.0.183 (*) -├── serde_json v1.0.104 (*) -├── tracing v0.1.37 (*) -└── warp v0.3.6 - ├── async-compression v0.3.15 - │ ├── brotli v3.3.4 - │ │ ├── alloc-no-stdlib v2.0.4 - │ │ ├── alloc-stdlib v0.2.2 - │ │ │ └── alloc-no-stdlib v2.0.4 - │ │ └── brotli-decompressor v2.3.4 - │ │ ├── alloc-no-stdlib v2.0.4 - │ │ └── alloc-stdlib v0.2.2 (*) - │ ├── flate2 v1.0.27 - │ │ ├── crc32fast v1.3.2 - │ │ │ └── cfg-if v1.0.0 - │ │ └── miniz_oxide v0.7.1 - │ │ └── adler v1.0.2 - │ ├── futures-core v0.3.28 - │ ├── memchr v2.5.0 - │ ├── pin-project-lite v0.2.12 - │ └── tokio v1.31.0 - │ ├── bytes v1.4.0 - │ ├── libc v0.2.153 - │ ├── mio v0.8.11 - │ │ ├── libc v0.2.153 - │ │ └── log v0.4.20 (*) - │ ├── num_cpus v1.16.0 (*) - │ ├── pin-project-lite v0.2.12 - │ ├── socket2 v0.5.3 - │ │ └── libc v0.2.153 - │ └── tokio-macros v2.1.0 (proc-macro) - │ ├── proc-macro2 v1.0.66 (*) - │ ├── quote v1.0.32 (*) - │ └── syn v2.0.28 (*) - ├── bytes v1.4.0 - ├── futures-channel v0.3.28 (*) - ├── futures-util v0.3.28 (*) - ├── headers v0.3.8 - │ ├── base64 v0.13.1 - │ ├── bitflags v1.3.2 - │ ├── bytes v1.4.0 - │ ├── headers-core v0.2.0 - │ │ └── http v0.2.9 (*) - │ ├── http v0.2.9 (*) - │ ├── httpdate v1.0.3 - │ ├── mime v0.3.17 - │ └── sha1 v0.10.5 - │ ├── cfg-if v1.0.0 - │ ├── cpufeatures v0.2.9 (*) - │ └── digest v0.10.7 (*) - ├── http v0.2.9 (*) - ├── hyper v0.14.27 - │ ├── bytes v1.4.0 - │ ├── futures-channel v0.3.28 (*) - │ ├── futures-core v0.3.28 - │ ├── futures-util v0.3.28 (*) - │ ├── h2 v0.3.24 - │ │ ├── bytes v1.4.0 - │ │ ├── fnv v1.0.7 - │ │ ├── futures-core v0.3.28 - │ │ ├── futures-sink v0.3.28 - │ │ ├── futures-util v0.3.28 (*) - │ │ ├── http v0.2.9 (*) - │ │ ├── indexmap v2.0.0 (*) - │ │ ├── slab v0.4.8 (*) - │ │ ├── tokio v1.31.0 (*) - │ │ ├── tokio-util v0.7.8 - │ │ │ ├── bytes v1.4.0 - │ │ │ ├── futures-core v0.3.28 - │ │ │ ├── futures-sink v0.3.28 - │ │ │ ├── pin-project-lite v0.2.12 - │ │ │ ├── tokio v1.31.0 (*) - │ │ │ └── tracing v0.1.37 (*) - │ │ └── tracing v0.1.37 (*) - │ ├── http v0.2.9 (*) - │ ├── http-body v0.4.5 - │ │ ├── bytes v1.4.0 - │ │ ├── http v0.2.9 (*) - │ │ └── pin-project-lite v0.2.12 - │ ├── httparse v1.8.0 - │ ├── httpdate v1.0.3 - │ ├── itoa v1.0.9 - │ ├── pin-project-lite v0.2.12 - │ ├── socket2 v0.4.9 - │ │ └── libc v0.2.153 - │ ├── tokio v1.31.0 (*) - │ ├── tower-service v0.3.2 - │ ├── tracing v0.1.37 (*) - │ └── want v0.3.1 - │ └── try-lock v0.2.4 - ├── log v0.4.20 (*) - ├── mime v0.3.17 - ├── mime_guess v2.0.4 - │ ├── mime v0.3.17 - │ └── unicase v2.6.0 (*) - │ [build-dependencies] - │ └── unicase v2.6.0 (*) - ├── multer v2.1.0 - │ ├── bytes v1.4.0 - │ ├── encoding_rs v0.8.32 - │ │ └── cfg-if v1.0.0 - │ ├── futures-util v0.3.28 (*) - │ ├── http v0.2.9 (*) - │ ├── httparse v1.8.0 - │ ├── log v0.4.20 (*) - │ ├── memchr v2.5.0 - │ ├── mime v0.3.17 - │ └── spin v0.9.8 - │ [build-dependencies] - │ └── version_check v0.9.4 - ├── percent-encoding v2.3.0 - ├── pin-project v1.1.3 - │ └── pin-project-internal v1.1.3 (proc-macro) - │ ├── proc-macro2 v1.0.66 (*) - │ ├── quote v1.0.32 (*) - │ └── syn v2.0.28 (*) - ├── rustls-pemfile v1.0.3 - │ └── base64 v0.21.2 - ├── scoped-tls v1.0.1 - ├── serde v1.0.183 (*) - ├── serde_json v1.0.104 (*) - ├── serde_urlencoded v0.7.1 - │ ├── form_urlencoded v1.2.0 (*) - │ ├── itoa v1.0.9 - │ ├── ryu v1.0.15 - │ └── serde v1.0.183 (*) - ├── tokio v1.31.0 (*) - ├── tokio-stream v0.1.14 - │ ├── futures-core v0.3.28 - │ ├── pin-project-lite v0.2.12 - │ ├── tokio v1.31.0 (*) - │ └── tokio-util v0.7.8 (*) - ├── tokio-tungstenite v0.20.1 - │ ├── futures-util v0.3.28 (*) - │ ├── log v0.4.20 (*) - │ ├── tokio v1.31.0 (*) - │ └── tungstenite v0.20.1 - │ ├── byteorder v1.4.3 - │ ├── bytes v1.4.0 - │ ├── data-encoding v2.5.0 - │ ├── http v0.2.9 (*) - │ ├── httparse v1.8.0 - │ ├── log v0.4.20 (*) - │ ├── rand v0.8.5 (*) - │ ├── sha1 v0.10.5 (*) - │ ├── thiserror v1.0.45 (*) - │ ├── url v2.4.0 (*) - │ └── utf-8 v0.7.6 - ├── tokio-util v0.7.8 (*) - ├── tower-service v0.3.2 - └── tracing v0.1.37 (*) -[dev-dependencies] -├── env_logger v0.9.3 -│ ├── atty v0.2.14 (*) -│ ├── humantime v2.1.0 -│ ├── log v0.4.20 (*) -│ ├── regex v1.9.3 (*) -│ └── termcolor v1.2.0 -├── hyper v0.14.27 (*) -└── tokio v1.31.0 (*) - -casper-node v1.5.3 (/Users/janhoffmann/Work/ca/casper-node/node) -├── ansi_term v0.12.1 -├── anyhow v1.0.73 -├── aquamarine v0.1.12 (proc-macro) -│ ├── itertools v0.9.0 -│ │ └── either v1.9.0 (*) -│ ├── proc-macro-error v1.0.4 -│ │ ├── proc-macro-error-attr v1.0.4 (proc-macro) -│ │ │ ├── proc-macro2 v1.0.66 (*) -│ │ │ └── quote v1.0.32 (*) -│ │ │ [build-dependencies] -│ │ │ └── version_check v0.9.4 -│ │ ├── proc-macro2 v1.0.66 (*) -│ │ ├── quote v1.0.32 (*) -│ │ └── syn v1.0.109 (*) -│ │ [build-dependencies] -│ │ └── version_check v0.9.4 -│ ├── proc-macro2 v1.0.66 (*) -│ ├── quote v1.0.32 (*) -│ └── syn v1.0.109 (*) -├── async-trait v0.1.73 (proc-macro) -│ ├── proc-macro2 v1.0.66 (*) -│ ├── quote v1.0.32 (*) -│ └── syn v2.0.28 (*) -├── backtrace v0.3.68 -│ ├── addr2line v0.20.0 -│ │ └── gimli v0.27.3 -│ ├── cfg-if v1.0.0 -│ ├── libc v0.2.153 -│ ├── miniz_oxide v0.7.1 (*) -│ ├── object v0.31.1 -│ │ └── memchr v2.5.0 -│ └── rustc-demangle v0.1.23 -│ [build-dependencies] -│ └── cc v1.0.82 (*) -├── base16 v0.2.1 -├── base64 v0.13.1 -├── bincode v1.3.3 (*) -├── bytes v1.4.0 -├── casper-execution-engine v6.0.0 (/Users/janhoffmann/Work/ca/casper-node/execution_engine) (*) -├── casper-json-rpc v1.1.0 (/Users/janhoffmann/Work/ca/casper-node/json_rpc) (*) -├── casper-storage v1.4.3 (/Users/janhoffmann/Work/ca/casper-node/storage) (*) -├── casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) (*) -├── datasize v0.2.15 (*) -├── derive_more v0.99.17 (proc-macro) (*) -├── either v1.9.0 (*) -├── enum-iterator v0.6.0 -│ └── enum-iterator-derive v0.6.0 (proc-macro) -│ ├── proc-macro2 v1.0.66 (*) -│ ├── quote v1.0.32 (*) -│ └── syn v1.0.109 (*) -├── erased-serde v0.3.28 -│ └── serde v1.0.183 (*) -├── fs2 v0.4.3 -│ └── libc v0.2.153 -├── futures v0.3.28 (*) -├── futures-io v0.3.28 -├── hex-buffer-serde v0.3.0 -│ ├── hex v0.4.3 (*) -│ └── serde v1.0.183 (*) -├── hex_fmt v0.3.0 -├── hostname v0.3.1 (*) -├── http v0.2.9 (*) -├── humantime v2.1.0 -├── hyper v0.14.27 (*) -├── itertools v0.10.5 (*) -├── juliet v0.2.0 -│ ├── array-init v2.1.0 -│ ├── bimap v0.6.3 -│ ├── bytemuck v1.14.0 -│ │ └── bytemuck_derive v1.5.0 (proc-macro) -│ │ ├── proc-macro2 v1.0.66 (*) -│ │ ├── quote v1.0.32 (*) -│ │ └── syn v2.0.28 (*) -│ ├── bytes v1.4.0 -│ ├── futures v0.3.28 (*) -│ ├── once_cell v1.18.0 -│ ├── strum v0.25.0 -│ │ └── strum_macros v0.25.3 (proc-macro) -│ │ ├── heck v0.4.1 -│ │ ├── proc-macro2 v1.0.66 (*) -│ │ ├── quote v1.0.32 (*) -│ │ ├── rustversion v1.0.14 (proc-macro) -│ │ └── syn v2.0.28 (*) -│ ├── thiserror v1.0.45 (*) -│ └── tokio v1.31.0 (*) -├── libc v0.2.153 -├── linked-hash-map v0.5.6 -├── lmdb-rkv v0.14.0 (*) -├── log v0.4.20 (*) -├── mio v0.8.11 (*) -├── num v0.4.1 (*) -├── num-derive v0.3.3 (proc-macro) (*) -├── num-rational v0.4.1 (*) -├── num-traits v0.2.16 (*) -├── num_cpus v1.16.0 (*) -├── once_cell v1.18.0 -├── openssl v0.10.56 (*) -├── pin-project v1.1.3 (*) -├── prometheus v0.12.0 -│ ├── cfg-if v1.0.0 -│ ├── fnv v1.0.7 -│ ├── lazy_static v1.4.0 -│ ├── memchr v2.5.0 -│ ├── parking_lot v0.11.2 -│ │ ├── instant v0.1.12 -│ │ │ └── cfg-if v1.0.0 -│ │ ├── lock_api v0.4.10 -│ │ │ └── scopeguard v1.2.0 -│ │ │ [build-dependencies] -│ │ │ └── autocfg v1.1.0 -│ │ └── parking_lot_core v0.8.6 -│ │ ├── cfg-if v1.0.0 -│ │ ├── instant v0.1.12 (*) -│ │ ├── libc v0.2.153 -│ │ └── smallvec v1.11.0 (*) -│ ├── protobuf v2.28.0 -│ └── thiserror v1.0.45 (*) -├── quanta v0.7.2 -│ ├── atomic-shim v0.1.0 -│ ├── mach v0.3.2 -│ │ └── libc v0.2.153 -│ └── once_cell v1.18.0 -├── rand v0.8.5 (*) -├── rand_chacha v0.3.1 (*) -├── regex v1.9.3 (*) -├── rmp-serde v0.14.4 -│ ├── byteorder v1.4.3 -│ ├── rmp v0.8.12 -│ │ ├── byteorder v1.4.3 -│ │ ├── num-traits v0.2.16 (*) -│ │ └── paste v1.0.14 (proc-macro) -│ └── serde v1.0.183 (*) -├── schemars v0.8.16 (*) -├── serde v1.0.183 (*) -├── serde-big-array v0.3.3 -│ └── serde v1.0.183 (*) -├── serde-map-to-array v1.1.1 (*) -├── serde_bytes v0.11.12 (*) -├── serde_json v1.0.104 (*) -├── serde_repr v0.1.16 (proc-macro) -│ ├── proc-macro2 v1.0.66 (*) -│ ├── quote v1.0.32 (*) -│ └── syn v2.0.28 (*) -├── shlex v1.3.0 -├── signal-hook v0.3.17 -│ ├── libc v0.2.153 -│ └── signal-hook-registry v1.4.1 -│ └── libc v0.2.153 -├── signature v1.2.2 -├── smallvec v1.11.0 (*) -├── static_assertions v1.1.0 -├── stats_alloc v0.1.10 -├── structopt v0.3.26 -│ ├── clap v2.34.0 (*) -│ ├── lazy_static v1.4.0 -│ └── structopt-derive v0.4.18 (proc-macro) -│ ├── heck v0.3.3 (*) -│ ├── proc-macro-error v1.0.4 (*) -│ ├── proc-macro2 v1.0.66 (*) -│ ├── quote v1.0.32 (*) -│ └── syn v1.0.109 (*) -├── strum v0.24.1 (*) -├── sys-info v0.8.0 -│ └── libc v0.2.153 -│ [build-dependencies] -│ └── cc v1.0.82 (*) -├── tempfile v3.7.1 (*) -├── thiserror v1.0.45 (*) -├── tokio v1.31.0 (*) -├── tokio-openssl v0.6.3 -│ ├── futures-util v0.3.28 (*) -│ ├── openssl v0.10.56 (*) -│ ├── openssl-sys v0.9.91 (*) -│ └── tokio v1.31.0 (*) -├── tokio-serde v0.8.0 -│ ├── bincode v1.3.3 (*) -│ ├── bytes v1.4.0 -│ ├── educe v0.4.22 (proc-macro) -│ │ ├── enum-ordinalize v3.1.13 (proc-macro) -│ │ │ ├── num-bigint v0.4.3 (*) -│ │ │ ├── num-traits v0.2.16 (*) -│ │ │ ├── proc-macro2 v1.0.66 (*) -│ │ │ ├── quote v1.0.32 (*) -│ │ │ └── syn v2.0.28 (*) -│ │ ├── proc-macro2 v1.0.66 (*) -│ │ ├── quote v1.0.32 (*) -│ │ └── syn v1.0.109 (*) -│ ├── futures-core v0.3.28 -│ ├── futures-sink v0.3.28 -│ ├── pin-project v1.1.3 (*) -│ └── serde v1.0.183 (*) -├── tokio-stream v0.1.14 (*) -├── tokio-util v0.6.10 -│ ├── bytes v1.4.0 -│ ├── futures-core v0.3.28 -│ ├── futures-sink v0.3.28 -│ ├── log v0.4.20 (*) -│ ├── pin-project-lite v0.2.12 -│ └── tokio v1.31.0 (*) -├── toml v0.5.11 (*) -├── tower v0.4.13 -│ ├── futures-core v0.3.28 -│ ├── pin-project-lite v0.2.12 -│ ├── tokio v1.31.0 (*) -│ ├── tokio-util v0.7.8 (*) -│ ├── tower-layer v0.3.2 -│ ├── tower-service v0.3.2 -│ └── tracing v0.1.37 (*) -├── tracing v0.1.37 (*) -├── tracing-futures v0.2.5 -│ ├── pin-project v1.1.3 (*) -│ └── tracing v0.1.37 (*) -├── tracing-subscriber v0.3.17 -│ ├── matchers v0.1.0 -│ │ └── regex-automata v0.1.10 -│ │ └── regex-syntax v0.6.29 -│ ├── nu-ansi-term v0.46.0 -│ │ └── overload v0.1.1 -│ ├── once_cell v1.18.0 -│ ├── regex v1.9.3 (*) -│ ├── serde v1.0.183 (*) -│ ├── serde_json v1.0.104 (*) -│ ├── sharded-slab v0.1.4 -│ │ └── lazy_static v1.4.0 -│ ├── smallvec v1.11.0 (*) -│ ├── thread_local v1.1.7 -│ │ ├── cfg-if v1.0.0 -│ │ └── once_cell v1.18.0 -│ ├── tracing v0.1.37 (*) -│ ├── tracing-core v0.1.31 (*) -│ ├── tracing-log v0.1.3 -│ │ ├── lazy_static v1.4.0 -│ │ ├── log v0.4.20 (*) -│ │ └── tracing-core v0.1.31 (*) -│ └── tracing-serde v0.1.3 -│ ├── serde v1.0.183 (*) -│ └── tracing-core v0.1.31 (*) -├── uint v0.9.5 (*) -├── uuid v0.8.2 (*) -├── warp v0.3.6 (*) -└── wheelbuf v0.2.0 -[build-dependencies] -└── vergen v8.2.4 - ├── anyhow v1.0.73 - ├── gix v0.48.0 - │ ├── gix-actor v0.23.0 - │ │ ├── bstr v1.6.0 - │ │ │ ├── memchr v2.5.0 - │ │ │ └── regex-automata v0.3.6 (*) - │ │ ├── btoi v0.4.3 - │ │ │ └── num-traits v0.2.16 (*) - │ │ ├── gix-date v0.7.2 - │ │ │ ├── bstr v1.6.0 (*) - │ │ │ ├── itoa v1.0.9 - │ │ │ ├── thiserror v1.0.45 (*) - │ │ │ └── time v0.3.25 - │ │ │ ├── deranged v0.3.8 - │ │ │ ├── itoa v1.0.9 - │ │ │ ├── libc v0.2.153 - │ │ │ ├── num_threads v0.1.6 - │ │ │ │ └── libc v0.2.153 - │ │ │ ├── time-core v0.1.1 - │ │ │ └── time-macros v0.2.11 (proc-macro) - │ │ │ └── time-core v0.1.1 - │ │ ├── itoa v1.0.9 - │ │ ├── nom v7.1.3 - │ │ │ ├── memchr v2.5.0 - │ │ │ └── minimal-lexical v0.2.1 - │ │ └── thiserror v1.0.45 (*) - │ ├── gix-attributes v0.14.1 - │ │ ├── bstr v1.6.0 (*) - │ │ ├── gix-glob v0.9.1 - │ │ │ ├── bitflags v2.4.0 - │ │ │ ├── bstr v1.6.0 (*) - │ │ │ ├── gix-features v0.31.1 - │ │ │ │ ├── crc32fast v1.3.2 (*) - │ │ │ │ ├── flate2 v1.0.27 (*) - │ │ │ │ ├── gix-hash v0.11.4 - │ │ │ │ │ ├── hex v0.4.3 (*) - │ │ │ │ │ └── thiserror v1.0.45 (*) - │ │ │ │ ├── gix-trace v0.1.3 - │ │ │ │ ├── libc v0.2.153 - │ │ │ │ ├── once_cell v1.18.0 - │ │ │ │ ├── prodash v25.0.1 - │ │ │ │ ├── sha1_smol v1.0.0 - │ │ │ │ ├── thiserror v1.0.45 (*) - │ │ │ │ └── walkdir v2.3.3 (*) - │ │ │ └── gix-path v0.8.4 - │ │ │ ├── bstr v1.6.0 (*) - │ │ │ ├── gix-trace v0.1.3 - │ │ │ ├── home v0.5.5 - │ │ │ ├── once_cell v1.18.0 - │ │ │ └── thiserror v1.0.45 (*) - │ │ ├── gix-path v0.8.4 (*) - │ │ ├── gix-quote v0.4.6 - │ │ │ ├── bstr v1.6.0 (*) - │ │ │ ├── btoi v0.4.3 (*) - │ │ │ └── thiserror v1.0.45 (*) - │ │ ├── kstring v2.0.0 - │ │ │ └── static_assertions v1.1.0 - │ │ ├── log v0.4.20 (*) - │ │ ├── smallvec v1.11.0 (*) - │ │ ├── thiserror v1.0.45 (*) - │ │ └── unicode-bom v2.0.2 - │ ├── gix-commitgraph v0.17.1 - │ │ ├── bstr v1.6.0 (*) - │ │ ├── gix-chunk v0.4.4 - │ │ │ └── thiserror v1.0.45 (*) - │ │ ├── gix-features v0.31.1 (*) - │ │ ├── gix-hash v0.11.4 (*) - │ │ ├── memmap2 v0.7.1 - │ │ │ └── libc v0.2.153 - │ │ └── thiserror v1.0.45 (*) - │ ├── gix-config v0.25.1 - │ │ ├── bstr v1.6.0 (*) - │ │ ├── gix-config-value v0.12.5 - │ │ │ ├── bitflags v2.4.0 - │ │ │ ├── bstr v1.6.0 (*) - │ │ │ ├── gix-path v0.8.4 (*) - │ │ │ ├── libc v0.2.153 - │ │ │ └── thiserror v1.0.45 (*) - │ │ ├── gix-features v0.31.1 (*) - │ │ ├── gix-glob v0.9.1 (*) - │ │ ├── gix-path v0.8.4 (*) - │ │ ├── gix-ref v0.32.1 - │ │ │ ├── gix-actor v0.23.0 (*) - │ │ │ ├── gix-date v0.7.2 (*) - │ │ │ ├── gix-features v0.31.1 (*) - │ │ │ ├── gix-fs v0.3.0 - │ │ │ │ └── gix-features v0.31.1 (*) - │ │ │ ├── gix-hash v0.11.4 (*) - │ │ │ ├── gix-lock v7.0.2 - │ │ │ │ ├── gix-tempfile v7.0.2 - │ │ │ │ │ ├── gix-fs v0.4.1 - │ │ │ │ │ │ └── gix-features v0.32.1 - │ │ │ │ │ │ ├── gix-hash v0.11.4 (*) - │ │ │ │ │ │ ├── gix-trace v0.1.3 - │ │ │ │ │ │ └── libc v0.2.153 - │ │ │ │ │ ├── libc v0.2.153 - │ │ │ │ │ ├── once_cell v1.18.0 - │ │ │ │ │ ├── parking_lot v0.12.1 - │ │ │ │ │ │ ├── lock_api v0.4.10 (*) - │ │ │ │ │ │ └── parking_lot_core v0.9.8 - │ │ │ │ │ │ ├── cfg-if v1.0.0 - │ │ │ │ │ │ ├── libc v0.2.153 - │ │ │ │ │ │ └── smallvec v1.11.0 (*) - │ │ │ │ │ ├── signal-hook v0.3.17 (*) - │ │ │ │ │ ├── signal-hook-registry v1.4.1 (*) - │ │ │ │ │ └── tempfile v3.7.1 (*) - │ │ │ │ ├── gix-utils v0.1.5 - │ │ │ │ │ └── fastrand v2.0.0 - │ │ │ │ └── thiserror v1.0.45 (*) - │ │ │ ├── gix-object v0.32.0 - │ │ │ │ ├── bstr v1.6.0 (*) - │ │ │ │ ├── btoi v0.4.3 (*) - │ │ │ │ ├── gix-actor v0.23.0 (*) - │ │ │ │ ├── gix-date v0.7.2 (*) - │ │ │ │ ├── gix-features v0.31.1 (*) - │ │ │ │ ├── gix-hash v0.11.4 (*) - │ │ │ │ ├── gix-validate v0.7.7 - │ │ │ │ │ ├── bstr v1.6.0 (*) - │ │ │ │ │ └── thiserror v1.0.45 (*) - │ │ │ │ ├── hex v0.4.3 (*) - │ │ │ │ ├── itoa v1.0.9 - │ │ │ │ ├── nom v7.1.3 (*) - │ │ │ │ ├── smallvec v1.11.0 (*) - │ │ │ │ └── thiserror v1.0.45 (*) - │ │ │ ├── gix-path v0.8.4 (*) - │ │ │ ├── gix-tempfile v7.0.2 (*) - │ │ │ ├── gix-validate v0.7.7 (*) - │ │ │ ├── memmap2 v0.7.1 (*) - │ │ │ ├── nom v7.1.3 (*) - │ │ │ └── thiserror v1.0.45 (*) - │ │ ├── gix-sec v0.8.4 - │ │ │ ├── bitflags v2.4.0 - │ │ │ └── libc v0.2.153 - │ │ ├── log v0.4.20 (*) - │ │ ├── memchr v2.5.0 - │ │ ├── nom v7.1.3 (*) - │ │ ├── once_cell v1.18.0 - │ │ ├── smallvec v1.11.0 (*) - │ │ ├── thiserror v1.0.45 (*) - │ │ └── unicode-bom v2.0.2 - │ ├── gix-credentials v0.16.1 - │ │ ├── bstr v1.6.0 (*) - │ │ ├── gix-command v0.2.8 - │ │ │ └── bstr v1.6.0 (*) - │ │ ├── gix-config-value v0.12.5 (*) - │ │ ├── gix-path v0.8.4 (*) - │ │ ├── gix-prompt v0.5.5 - │ │ │ ├── gix-command v0.2.8 (*) - │ │ │ ├── gix-config-value v0.12.5 (*) - │ │ │ ├── parking_lot v0.12.1 (*) - │ │ │ ├── rustix v0.38.8 (*) - │ │ │ └── thiserror v1.0.45 (*) - │ │ ├── gix-sec v0.8.4 (*) - │ │ ├── gix-url v0.20.1 - │ │ │ ├── bstr v1.6.0 (*) - │ │ │ ├── gix-features v0.31.1 (*) - │ │ │ ├── gix-path v0.8.4 (*) - │ │ │ ├── home v0.5.5 - │ │ │ ├── thiserror v1.0.45 (*) - │ │ │ └── url v2.4.0 (*) - │ │ └── thiserror v1.0.45 (*) - │ ├── gix-date v0.7.2 (*) - │ ├── gix-diff v0.32.0 - │ │ ├── gix-hash v0.11.4 (*) - │ │ ├── gix-object v0.32.0 (*) - │ │ ├── imara-diff v0.1.5 - │ │ │ ├── ahash v0.8.3 - │ │ │ │ ├── cfg-if v1.0.0 - │ │ │ │ ├── getrandom v0.2.10 (*) - │ │ │ │ └── once_cell v1.18.0 - │ │ │ │ [build-dependencies] - │ │ │ │ └── version_check v0.9.4 - │ │ │ └── hashbrown v0.12.3 - │ │ └── thiserror v1.0.45 (*) - │ ├── gix-discover v0.21.1 - │ │ ├── bstr v1.6.0 (*) - │ │ ├── gix-hash v0.11.4 (*) - │ │ ├── gix-path v0.8.4 (*) - │ │ ├── gix-ref v0.32.1 (*) - │ │ ├── gix-sec v0.8.4 (*) - │ │ └── thiserror v1.0.45 (*) - │ ├── gix-features v0.31.1 (*) - │ ├── gix-fs v0.3.0 (*) - │ ├── gix-glob v0.9.1 (*) - │ ├── gix-hash v0.11.4 (*) - │ ├── gix-hashtable v0.2.4 - │ │ ├── gix-hash v0.11.4 (*) - │ │ ├── hashbrown v0.14.0 - │ │ └── parking_lot v0.12.1 (*) - │ ├── gix-ignore v0.4.1 - │ │ ├── bstr v1.6.0 (*) - │ │ ├── gix-glob v0.9.1 (*) - │ │ ├── gix-path v0.8.4 (*) - │ │ └── unicode-bom v2.0.2 - │ ├── gix-index v0.20.0 - │ │ ├── bitflags v2.4.0 - │ │ ├── bstr v1.6.0 (*) - │ │ ├── btoi v0.4.3 (*) - │ │ ├── filetime v0.2.22 - │ │ │ ├── cfg-if v1.0.0 - │ │ │ └── libc v0.2.153 - │ │ ├── gix-bitmap v0.2.6 - │ │ │ └── thiserror v1.0.45 (*) - │ │ ├── gix-features v0.31.1 (*) - │ │ ├── gix-hash v0.11.4 (*) - │ │ ├── gix-lock v7.0.2 (*) - │ │ ├── gix-object v0.32.0 (*) - │ │ ├── gix-traverse v0.29.0 - │ │ │ ├── gix-commitgraph v0.17.1 (*) - │ │ │ ├── gix-date v0.7.2 (*) - │ │ │ ├── gix-hash v0.11.4 (*) - │ │ │ ├── gix-hashtable v0.2.4 (*) - │ │ │ ├── gix-object v0.32.0 (*) - │ │ │ ├── gix-revwalk v0.3.0 - │ │ │ │ ├── gix-commitgraph v0.17.1 (*) - │ │ │ │ ├── gix-date v0.7.2 (*) - │ │ │ │ ├── gix-hash v0.11.4 (*) - │ │ │ │ ├── gix-hashtable v0.2.4 (*) - │ │ │ │ ├── gix-object v0.32.0 (*) - │ │ │ │ ├── smallvec v1.11.0 (*) - │ │ │ │ └── thiserror v1.0.45 (*) - │ │ │ ├── smallvec v1.11.0 (*) - │ │ │ └── thiserror v1.0.45 (*) - │ │ ├── itoa v1.0.9 - │ │ ├── memmap2 v0.7.1 (*) - │ │ ├── smallvec v1.11.0 (*) - │ │ └── thiserror v1.0.45 (*) - │ ├── gix-lock v7.0.2 (*) - │ ├── gix-mailmap v0.15.0 - │ │ ├── bstr v1.6.0 (*) - │ │ ├── gix-actor v0.23.0 (*) - │ │ ├── gix-date v0.7.2 (*) - │ │ └── thiserror v1.0.45 (*) - │ ├── gix-negotiate v0.4.0 - │ │ ├── bitflags v2.4.0 - │ │ ├── gix-commitgraph v0.17.1 (*) - │ │ ├── gix-date v0.7.2 (*) - │ │ ├── gix-hash v0.11.4 (*) - │ │ ├── gix-object v0.32.0 (*) - │ │ ├── gix-revwalk v0.3.0 (*) - │ │ ├── smallvec v1.11.0 (*) - │ │ └── thiserror v1.0.45 (*) - │ ├── gix-object v0.32.0 (*) - │ ├── gix-odb v0.49.1 - │ │ ├── arc-swap v1.6.0 - │ │ ├── gix-date v0.7.2 (*) - │ │ ├── gix-features v0.31.1 (*) - │ │ ├── gix-hash v0.11.4 (*) - │ │ ├── gix-object v0.32.0 (*) - │ │ ├── gix-pack v0.39.1 - │ │ │ ├── clru v0.6.1 - │ │ │ ├── gix-chunk v0.4.4 (*) - │ │ │ ├── gix-diff v0.32.0 (*) - │ │ │ ├── gix-features v0.31.1 (*) - │ │ │ ├── gix-hash v0.11.4 (*) - │ │ │ ├── gix-hashtable v0.2.4 (*) - │ │ │ ├── gix-object v0.32.0 (*) - │ │ │ ├── gix-path v0.8.4 (*) - │ │ │ ├── gix-tempfile v7.0.2 (*) - │ │ │ ├── gix-traverse v0.29.0 (*) - │ │ │ ├── memmap2 v0.7.1 (*) - │ │ │ ├── parking_lot v0.12.1 (*) - │ │ │ ├── smallvec v1.11.0 (*) - │ │ │ └── thiserror v1.0.45 (*) - │ │ ├── gix-path v0.8.4 (*) - │ │ ├── gix-quote v0.4.6 (*) - │ │ ├── parking_lot v0.12.1 (*) - │ │ ├── tempfile v3.7.1 (*) - │ │ └── thiserror v1.0.45 (*) - │ ├── gix-pack v0.39.1 (*) - │ ├── gix-path v0.8.4 (*) - │ ├── gix-prompt v0.5.5 (*) - │ ├── gix-ref v0.32.1 (*) - │ ├── gix-refspec v0.13.0 - │ │ ├── bstr v1.6.0 (*) - │ │ ├── gix-hash v0.11.4 (*) - │ │ ├── gix-revision v0.17.0 - │ │ │ ├── bstr v1.6.0 (*) - │ │ │ ├── gix-date v0.7.2 (*) - │ │ │ ├── gix-hash v0.11.4 (*) - │ │ │ ├── gix-hashtable v0.2.4 (*) - │ │ │ ├── gix-object v0.32.0 (*) - │ │ │ ├── gix-revwalk v0.3.0 (*) - │ │ │ └── thiserror v1.0.45 (*) - │ │ ├── gix-validate v0.7.7 (*) - │ │ ├── smallvec v1.11.0 (*) - │ │ └── thiserror v1.0.45 (*) - │ ├── gix-revision v0.17.0 (*) - │ ├── gix-sec v0.8.4 (*) - │ ├── gix-tempfile v7.0.2 (*) - │ ├── gix-trace v0.1.3 - │ ├── gix-traverse v0.29.0 (*) - │ ├── gix-url v0.20.1 (*) - │ ├── gix-utils v0.1.5 (*) - │ ├── gix-validate v0.7.7 (*) - │ ├── gix-worktree v0.21.1 - │ │ ├── bstr v1.6.0 (*) - │ │ ├── filetime v0.2.22 (*) - │ │ ├── gix-attributes v0.14.1 (*) - │ │ ├── gix-features v0.31.1 (*) - │ │ ├── gix-fs v0.3.0 (*) - │ │ ├── gix-glob v0.9.1 (*) - │ │ ├── gix-hash v0.11.4 (*) - │ │ ├── gix-ignore v0.4.1 (*) - │ │ ├── gix-index v0.20.0 (*) - │ │ ├── gix-object v0.32.0 (*) - │ │ ├── gix-path v0.8.4 (*) - │ │ ├── io-close v0.3.7 - │ │ │ └── libc v0.2.153 - │ │ └── thiserror v1.0.45 (*) - │ ├── log v0.4.20 (*) - │ ├── once_cell v1.18.0 - │ ├── signal-hook v0.3.17 (*) - │ ├── smallvec v1.11.0 (*) - │ ├── thiserror v1.0.45 (*) - │ └── unicode-normalization v0.1.22 (*) - └── time v0.3.25 (*) - [build-dependencies] - └── rustversion v1.0.14 (proc-macro) -[dev-dependencies] -├── assert-json-diff v2.0.2 -│ ├── serde v1.0.183 (*) -│ └── serde_json v1.0.104 (*) -├── assert_matches v1.5.0 -├── casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) (*) -├── fake_instant v0.4.0 -├── pnet v0.28.0 -│ ├── ipnetwork v0.18.0 -│ │ └── serde v1.0.183 (*) -│ ├── pnet_base v0.28.0 -│ ├── pnet_datalink v0.28.0 -│ │ ├── ipnetwork v0.18.0 (*) -│ │ ├── libc v0.2.153 -│ │ ├── pnet_base v0.28.0 -│ │ └── pnet_sys v0.28.0 -│ │ └── libc v0.2.153 -│ ├── pnet_packet v0.28.0 -│ │ ├── pnet_base v0.28.0 -│ │ ├── pnet_macros v0.28.0 (proc-macro) -│ │ │ ├── proc-macro2 v1.0.66 (*) -│ │ │ ├── quote v1.0.32 (*) -│ │ │ ├── regex v1.9.3 (*) -│ │ │ └── syn v1.0.109 (*) -│ │ └── pnet_macros_support v0.28.0 -│ │ └── pnet_base v0.28.0 -│ │ [build-dependencies] -│ │ └── glob v0.3.1 -│ ├── pnet_sys v0.28.0 (*) -│ └── pnet_transport v0.28.0 -│ ├── libc v0.2.153 -│ ├── pnet_base v0.28.0 -│ ├── pnet_packet v0.28.0 (*) -│ └── pnet_sys v0.28.0 (*) -├── pretty_assertions v0.7.2 -│ ├── ansi_term v0.12.1 -│ └── diff v0.1.13 -├── proptest v1.2.0 (*) -├── proptest-derive v0.3.0 (proc-macro) (*) -├── rand_core v0.6.4 (*) -├── reqwest v0.11.24 -│ ├── base64 v0.21.2 -│ ├── bytes v1.4.0 -│ ├── encoding_rs v0.8.32 (*) -│ ├── futures-core v0.3.28 -│ ├── futures-util v0.3.28 (*) -│ ├── h2 v0.3.24 (*) -│ ├── http v0.2.9 (*) -│ ├── http-body v0.4.5 (*) -│ ├── hyper v0.14.27 (*) -│ ├── hyper-tls v0.5.0 -│ │ ├── bytes v1.4.0 -│ │ ├── hyper v0.14.27 (*) -│ │ ├── native-tls v0.2.11 -│ │ │ ├── lazy_static v1.4.0 -│ │ │ ├── libc v0.2.153 -│ │ │ ├── security-framework v2.9.2 -│ │ │ │ ├── bitflags v1.3.2 -│ │ │ │ ├── core-foundation v0.9.3 -│ │ │ │ │ ├── core-foundation-sys v0.8.4 -│ │ │ │ │ └── libc v0.2.153 -│ │ │ │ ├── core-foundation-sys v0.8.4 -│ │ │ │ ├── libc v0.2.153 -│ │ │ │ └── security-framework-sys v2.9.1 -│ │ │ │ ├── core-foundation-sys v0.8.4 -│ │ │ │ └── libc v0.2.153 -│ │ │ ├── security-framework-sys v2.9.1 (*) -│ │ │ └── tempfile v3.7.1 (*) -│ │ ├── tokio v1.31.0 (*) -│ │ └── tokio-native-tls v0.3.1 -│ │ ├── native-tls v0.2.11 (*) -│ │ └── tokio v1.31.0 (*) -│ ├── ipnet v2.8.0 -│ ├── log v0.4.20 (*) -│ ├── mime v0.3.17 -│ ├── native-tls v0.2.11 (*) -│ ├── once_cell v1.18.0 -│ ├── percent-encoding v2.3.0 -│ ├── pin-project-lite v0.2.12 -│ ├── rustls-pemfile v1.0.3 (*) -│ ├── serde v1.0.183 (*) -│ ├── serde_urlencoded v0.7.1 (*) -│ ├── sync_wrapper v0.1.2 -│ ├── system-configuration v0.5.1 -│ │ ├── bitflags v1.3.2 -│ │ ├── core-foundation v0.9.3 (*) -│ │ └── system-configuration-sys v0.5.0 -│ │ ├── core-foundation-sys v0.8.4 -│ │ └── libc v0.2.153 -│ ├── tokio v1.31.0 (*) -│ ├── tokio-native-tls v0.3.1 (*) -│ ├── tokio-util v0.7.8 (*) -│ ├── tower-service v0.3.2 -│ └── url v2.4.0 (*) -└── tokio v1.31.0 (*) - -casper-storage v1.4.3 (/Users/janhoffmann/Work/ca/casper-node/storage) (*) - -casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) (*) - -casper-updater v0.3.0 (/Users/janhoffmann/Work/ca/casper-node/ci/casper_updater) -├── clap v4.3.21 -│ └── clap_builder v4.3.21 -│ ├── anstream v0.3.2 -│ │ ├── anstyle v1.0.1 -│ │ ├── anstyle-parse v0.2.1 -│ │ │ └── utf8parse v0.2.1 -│ │ ├── anstyle-query v1.0.0 -│ │ ├── colorchoice v1.0.0 -│ │ ├── is-terminal v0.4.9 (*) -│ │ └── utf8parse v0.2.1 -│ ├── anstyle v1.0.1 -│ ├── clap_lex v0.5.0 -│ ├── once_cell v1.18.0 -│ ├── strsim v0.10.0 -│ └── terminal_size v0.2.6 -│ └── rustix v0.37.23 -│ ├── bitflags v1.3.2 -│ ├── errno v0.3.2 (*) -│ ├── io-lifetimes v1.0.11 -│ │ └── libc v0.2.153 -│ └── libc v0.2.153 -├── once_cell v1.18.0 -├── regex v1.9.3 (*) -└── semver v1.0.18 - -casper-validation v0.1.0 (/Users/janhoffmann/Work/ca/casper-node/utils/validation) -├── anyhow v1.0.73 -├── base16 v0.2.1 -├── casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) (*) -├── clap v3.2.25 -│ ├── atty v0.2.14 (*) -│ ├── bitflags v1.3.2 -│ ├── clap_derive v3.2.25 (proc-macro) -│ │ ├── heck v0.4.1 -│ │ ├── proc-macro-error v1.0.4 (*) -│ │ ├── proc-macro2 v1.0.66 (*) -│ │ ├── quote v1.0.32 (*) -│ │ └── syn v1.0.109 (*) -│ ├── clap_lex v0.2.4 -│ │ └── os_str_bytes v6.5.1 -│ ├── indexmap v1.9.3 (*) -│ ├── once_cell v1.18.0 -│ ├── strsim v0.10.0 -│ ├── termcolor v1.2.0 -│ └── textwrap v0.16.0 -├── derive_more v0.99.17 (proc-macro) (*) -├── hex v0.4.3 (*) -├── serde v1.0.183 (*) -├── serde_json v1.0.104 (*) -└── thiserror v1.0.45 (*) - -global-state-update-gen v0.3.0 (/Users/janhoffmann/Work/ca/casper-node/utils/global-state-update-gen) -├── base16 v0.2.1 -├── base64 v0.13.1 -├── casper-engine-test-support v6.0.0 (/Users/janhoffmann/Work/ca/casper-node/execution_engine_testing/test_support) (*) -├── casper-execution-engine v6.0.0 (/Users/janhoffmann/Work/ca/casper-node/execution_engine) (*) -├── casper-storage v1.4.3 (/Users/janhoffmann/Work/ca/casper-node/storage) (*) -├── casper-types v3.0.0 (/Users/janhoffmann/Work/ca/casper-node/types) (*) -├── clap v2.34.0 (*) -├── itertools v0.10.5 (*) -├── lmdb-rkv v0.14.0 (*) -├── rand v0.8.5 (*) -├── serde v1.0.183 (*) -└── toml v0.5.11 (*) From 2bb1c5632c9bfbf8c1da74931a578da39a61af4c Mon Sep 17 00:00:00 2001 From: Jan Hoffmann Date: Wed, 24 Apr 2024 14:25:11 +0200 Subject: [PATCH 3/8] burn: changed EntryPointType to Called --- types/src/system/mint/entry_points.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/src/system/mint/entry_points.rs b/types/src/system/mint/entry_points.rs index edc9973865..d6ffd1bca4 100644 --- a/types/src/system/mint/entry_points.rs +++ b/types/src/system/mint/entry_points.rs @@ -49,7 +49,7 @@ pub fn mint_entry_points() -> EntryPoints { err: Box::new(CLType::U8), }, EntryPointAccess::Public, - EntryPointType::AddressableEntity, + EntryPointType::Called, ); entry_points.add_entry_point(entry_point); From 998ab20e7df25c8511373c10f04b559ba44e9bb3 Mon Sep 17 00:00:00 2001 From: Jan Hoffmann Date: Fri, 3 May 2024 15:19:19 +0200 Subject: [PATCH 4/8] fixed burn impl --- storage/src/system/mint.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/src/system/mint.rs b/storage/src/system/mint.rs index 741b4fc29f..ce2dffd095 100644 --- a/storage/src/system/mint.rs +++ b/storage/src/system/mint.rs @@ -61,7 +61,7 @@ pub trait Mint: RuntimeProvider + StorageProvider + SystemProvider { return Err(Error::ForgedReference); } - let source_balance: U512 = match self.read_balance(purse)? { + let source_balance: U512 = match self.balance(purse, HoldsEpoch::NOT_APPLICABLE)? { Some(source_balance) => source_balance, None => return Err(Error::PurseNotFound), }; From fd8a1c1946c8525b2542123cc82f4d75cb38e91b Mon Sep 17 00:00:00 2001 From: Jan Hoffmann Date: Fri, 3 May 2024 17:10:05 +0200 Subject: [PATCH 5/8] fix in format --- execution_engine/src/runtime/mint_internal.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/execution_engine/src/runtime/mint_internal.rs b/execution_engine/src/runtime/mint_internal.rs index edae05b2ec..ed98c899e0 100644 --- a/execution_engine/src/runtime/mint_internal.rs +++ b/execution_engine/src/runtime/mint_internal.rs @@ -97,6 +97,7 @@ where fn allow_unrestricted_transfers(&self) -> bool { self.context.engine_config().allow_unrestricted_transfers() } +} // TODO: update Mint + StorageProvider to better handle errors impl<'a, R> StorageProvider for Runtime<'a, R> From 71439604b36c42ee3b29f36a542d1f12cf2a398d Mon Sep 17 00:00:00 2001 From: Jan Hoffmann Date: Fri, 3 May 2024 17:16:32 +0200 Subject: [PATCH 6/8] fix in balance --- storage/src/system/mint.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/src/system/mint.rs b/storage/src/system/mint.rs index a9005b39c3..0e0b908453 100644 --- a/storage/src/system/mint.rs +++ b/storage/src/system/mint.rs @@ -61,7 +61,7 @@ pub trait Mint: RuntimeProvider + StorageProvider + SystemProvider { return Err(Error::ForgedReference); } - let source_balance: U512 = match self.balance(purse, HoldsEpoch::NOT_APPLICABLE)? { + let source_balance: U512 = match self.balance(purse)? { Some(source_balance) => source_balance, None => return Err(Error::PurseNotFound), }; From a6f12ce1ff4eaefe6b8ddb9fcd89b52e03ffc361 Mon Sep 17 00:00:00 2001 From: Ed Hastings Date: Fri, 3 May 2024 12:05:00 -0700 Subject: [PATCH 7/8] merge conflicts --- execution_engine/src/runtime/mint_internal.rs | 5 + .../test_support/src/wasm_test_builder.rs | 4 +- .../private_chain/burn_fees_and_refund.rs | 8 +- .../test/private_chain/restricted_auction.rs | 4 +- .../system_contracts/auction/distribute.rs | 48 ++++----- .../src/test/system_contracts/genesis.rs | 2 +- .../tests/src/test/system_contracts/mint.rs | 101 +++++++++++------- storage/src/global_state/state/mod.rs | 4 +- storage/src/system/handle_payment.rs | 27 ++++- storage/src/system/handle_payment/internal.rs | 15 +-- storage/src/system/mint.rs | 14 ++- storage/src/system/runtime_native.rs | 2 +- types/src/system/handle_payment/error.rs | 13 +-- utils/global-state-update-gen/src/admins.rs | 2 +- 14 files changed, 142 insertions(+), 107 deletions(-) diff --git a/execution_engine/src/runtime/mint_internal.rs b/execution_engine/src/runtime/mint_internal.rs index ed98c899e0..ae77487561 100644 --- a/execution_engine/src/runtime/mint_internal.rs +++ b/execution_engine/src/runtime/mint_internal.rs @@ -97,6 +97,11 @@ where fn allow_unrestricted_transfers(&self) -> bool { self.context.engine_config().allow_unrestricted_transfers() } + + /// Validate URef against context access rights. + fn is_valid_uref(&self, uref: &URef) -> bool { + self.context.access_rights().has_access_rights_to_uref(uref) + } } // TODO: update Mint + StorageProvider to better handle errors diff --git a/execution_engine_testing/test_support/src/wasm_test_builder.rs b/execution_engine_testing/test_support/src/wasm_test_builder.rs index fafd7115df..13e2ea6e21 100644 --- a/execution_engine_testing/test_support/src/wasm_test_builder.rs +++ b/execution_engine_testing/test_support/src/wasm_test_builder.rs @@ -705,8 +705,8 @@ where /// Panics if the total supply can't be found. pub fn total_supply( &self, - maybe_post_state: Option, protocol_version: ProtocolVersion, + maybe_post_state: Option, ) -> U512 { let post_state = maybe_post_state .or(self.post_state_hash) @@ -759,7 +759,7 @@ where let post_state = maybe_post_state .or(self.post_state_hash) .expect("builder must have a post-state hash"); - let total_supply = self.total_supply(Some(post_state), protocol_version); + let total_supply = self.total_supply(protocol_version, Some(post_state)); let rate = self.round_seigniorage_rate(Some(post_state), protocol_version); rate.checked_mul(&Ratio::from(total_supply)) .map(|ratio| ratio.to_integer()) diff --git a/execution_engine_testing/tests/src/test/private_chain/burn_fees_and_refund.rs b/execution_engine_testing/tests/src/test/private_chain/burn_fees_and_refund.rs index 95cb758ab4..b5907c8a36 100644 --- a/execution_engine_testing/tests/src/test/private_chain/burn_fees_and_refund.rs +++ b/execution_engine_testing/tests/src/test/private_chain/burn_fees_and_refund.rs @@ -121,7 +121,7 @@ fn test_burning_fees( .expect("should have rewards purse"); let rewards_purse_uref = rewards_purse_key.into_uref().expect("should be uref"); assert_eq!(builder.get_purse_balance(rewards_purse_uref), U512::zero()); - let total_supply_before = builder.total_supply(None, protocol_version); + let total_supply_before = builder.total_supply(protocol_version, None); // TODO: reevaluate this test, considering fee / refund / pricing modes // let exec_request_1 = ExecuteRequestBuilder::module_bytes( // *DEFAULT_ADMIN_ACCOUNT_ADDR, @@ -139,7 +139,7 @@ fn test_burning_fees( // U512::zero(), // "proposer should not receive anything", // ); - let total_supply_after = builder.total_supply(None, protocol_version); + let total_supply_after = builder.total_supply(protocol_version, None); assert_eq!( total_supply_before - total_supply_after, expected_burn_amount, @@ -149,11 +149,11 @@ fn test_burning_fees( TransferRequestBuilder::new(MINIMUM_ACCOUNT_CREATION_BALANCE, *ACCOUNT_1_ADDR) .with_initiator(*DEFAULT_ADMIN_ACCOUNT_ADDR) .build(); - let total_supply_before = builder.total_supply(None, protocol_version); + let total_supply_before = builder.total_supply(protocol_version, None); builder .transfer_and_commit(transfer_request) .expect_success(); - let total_supply_after = builder.total_supply(None, protocol_version); + let total_supply_after = builder.total_supply(protocol_version, None); match fee_handling { FeeHandling::PayToProposer | FeeHandling::Accumulate | FeeHandling::NoFee => { diff --git a/execution_engine_testing/tests/src/test/private_chain/restricted_auction.rs b/execution_engine_testing/tests/src/test/private_chain/restricted_auction.rs index 7173cf6eb5..b2eee1ecc0 100644 --- a/execution_engine_testing/tests/src/test/private_chain/restricted_auction.rs +++ b/execution_engine_testing/tests/src/test/private_chain/restricted_auction.rs @@ -19,7 +19,7 @@ fn should_not_distribute_rewards_but_compute_next_set() { let protocol_version = DEFAULT_PROTOCOL_VERSION; // initial token supply - let initial_supply = builder.total_supply(None, protocol_version); + let initial_supply = builder.total_supply(protocol_version, None); for _ in 0..3 { builder.distribute( @@ -101,7 +101,7 @@ fn should_not_distribute_rewards_but_compute_next_set() { era_info ); - let total_supply_after_distribution = builder.total_supply(None, protocol_version); + let total_supply_after_distribution = builder.total_supply(protocol_version, None); assert_eq!( initial_supply, total_supply_after_distribution, "total supply of tokens should not increase after an auction is ran" diff --git a/execution_engine_testing/tests/src/test/system_contracts/auction/distribute.rs b/execution_engine_testing/tests/src/test/system_contracts/auction/distribute.rs index ebf3ce49ee..3144f4900b 100644 --- a/execution_engine_testing/tests/src/test/system_contracts/auction/distribute.rs +++ b/execution_engine_testing/tests/src/test/system_contracts/auction/distribute.rs @@ -96,8 +96,8 @@ fn withdraw_bid( ) { let auction = builder.get_auction_contract_hash(); let withdraw_bid_args = runtime_args! { - auction::ARG_PUBLIC_KEY => validator, - auction::ARG_AMOUNT => amount, + ARG_PUBLIC_KEY => validator, + ARG_AMOUNT => amount, }; let withdraw_bid_request = ExecuteRequestBuilder::contract_call_by_hash( sender, @@ -118,9 +118,9 @@ fn undelegate( ) { let auction = builder.get_auction_contract_hash(); let undelegate_args = runtime_args! { - auction::ARG_DELEGATOR => delegator, - auction::ARG_VALIDATOR => validator, - auction::ARG_AMOUNT => amount, + ARG_DELEGATOR => delegator, + ARG_VALIDATOR => validator, + ARG_AMOUNT => amount, }; let undelegate_request = ExecuteRequestBuilder::contract_call_by_hash( sender, @@ -256,7 +256,7 @@ fn should_distribute_delegation_rate_zero() { let protocol_version = DEFAULT_PROTOCOL_VERSION; // initial token supply - let initial_supply = builder.total_supply(None, protocol_version); + let initial_supply = builder.total_supply(protocol_version, None); let total_payout = builder.base_round_reward(None, protocol_version); let expected_total_reward = *GENESIS_ROUND_SEIGNIORAGE_RATE * initial_supply; let expected_total_reward_integer = expected_total_reward.to_integer(); @@ -524,7 +524,7 @@ fn should_withdraw_bids_after_distribute() { let total_payout = builder.base_round_reward(None, protocol_version); // initial token supply - let initial_supply = builder.total_supply(None, protocol_version); + let initial_supply = builder.total_supply(protocol_version, None); let rate = builder.round_seigniorage_rate(None, protocol_version); let expected_total_reward = rate * initial_supply; @@ -830,7 +830,7 @@ fn should_distribute_rewards_after_restaking_delegated_funds() { let protocol_version = DEFAULT_PROTOCOL_VERSION; // initial token supply - let initial_supply = builder.total_supply(None, protocol_version); + let initial_supply = builder.total_supply(protocol_version, None); let initial_rate = builder.round_seigniorage_rate(None, protocol_version); let initial_round_reward = builder.base_round_reward(None, protocol_version); @@ -978,7 +978,7 @@ fn should_distribute_rewards_after_restaking_delegated_funds() { )); // Next round of rewards - let updated_supply = builder.total_supply(None, protocol_version); + let updated_supply = builder.total_supply(protocol_version, None); assert!(updated_supply > total_supply); total_supply = updated_supply; @@ -1151,7 +1151,7 @@ fn should_distribute_delegation_rate_half() { let protocol_version = DEFAULT_PROTOCOL_VERSION; // initial token supply - let initial_supply = builder.total_supply(None, protocol_version); + let initial_supply = builder.total_supply(protocol_version, None); let total_payout = builder.base_round_reward(None, protocol_version); let expected_total_reward = *GENESIS_ROUND_SEIGNIORAGE_RATE * initial_supply; let expected_total_reward_integer = expected_total_reward.to_integer(); @@ -1383,7 +1383,7 @@ fn should_distribute_delegation_rate_full() { let protocol_version = DEFAULT_PROTOCOL_VERSION; // initial token supply - let initial_supply = builder.total_supply(None, protocol_version); + let initial_supply = builder.total_supply(protocol_version, None); let expected_total_reward = *GENESIS_ROUND_SEIGNIORAGE_RATE * initial_supply; let expected_total_reward_integer = expected_total_reward.to_integer(); @@ -1565,7 +1565,7 @@ fn should_distribute_uneven_delegation_rate_zero() { let protocol_version = DEFAULT_PROTOCOL_VERSION; // initial token supply - let initial_supply = builder.total_supply(None, protocol_version); + let initial_supply = builder.total_supply(protocol_version, None); let total_payout = builder.base_round_reward(None, protocol_version); let expected_total_reward = *GENESIS_ROUND_SEIGNIORAGE_RATE * initial_supply; let expected_total_reward_integer = expected_total_reward.to_integer(); @@ -1868,7 +1868,7 @@ fn should_distribute_with_multiple_validators_and_delegators() { let protocol_version = DEFAULT_PROTOCOL_VERSION; // initial token supply - let initial_supply = builder.total_supply(None, protocol_version); + let initial_supply = builder.total_supply(protocol_version, None); let total_payout = builder.base_round_reward(None, protocol_version); let expected_total_reward = *GENESIS_ROUND_SEIGNIORAGE_RATE * initial_supply; let expected_total_reward_integer = expected_total_reward.to_integer(); @@ -2200,7 +2200,7 @@ fn should_distribute_with_multiple_validators_and_shared_delegator() { let protocol_version = DEFAULT_PROTOCOL_VERSION; // initial token supply - let initial_supply = builder.total_supply(None, protocol_version); + let initial_supply = builder.total_supply(protocol_version, None); let total_payout = builder.base_round_reward(None, protocol_version); let expected_total_reward = *GENESIS_ROUND_SEIGNIORAGE_RATE * initial_supply; let expected_total_reward_integer = expected_total_reward.to_integer(); @@ -2557,13 +2557,13 @@ fn should_increase_total_supply_after_distribute() { let protocol_version = DEFAULT_PROTOCOL_VERSION; // initial token supply - let initial_supply = builder.total_supply(None, protocol_version); + let initial_supply = builder.total_supply(protocol_version, None); for request in post_genesis_requests { builder.exec(request).commit().expect_success(); } - let post_genesis_supply = builder.total_supply(None, protocol_version); + let post_genesis_supply = builder.total_supply(protocol_version, None); assert_eq!( initial_supply, post_genesis_supply, @@ -2576,7 +2576,7 @@ fn should_increase_total_supply_after_distribute() { timestamp_millis += TIMESTAMP_MILLIS_INCREMENT; } - let post_auction_supply = builder.total_supply(None, protocol_version); + let post_auction_supply = builder.total_supply(protocol_version, None); assert_eq!( initial_supply, post_auction_supply, "total supply should remain unchanged regardless of auction" @@ -2603,7 +2603,7 @@ fn should_increase_total_supply_after_distribute() { builder.exec(distribute_request).expect_success().commit(); - let post_distribute_supply = builder.total_supply(None, protocol_version); + let post_distribute_supply = builder.total_supply(protocol_version, None); assert!( initial_supply < post_distribute_supply, "total supply should increase after distribute ({} >= {})", @@ -2737,13 +2737,13 @@ fn should_not_create_purses_during_distribute() { let protocol_version = DEFAULT_PROTOCOL_VERSION; // initial token supply - let initial_supply = builder.total_supply(None, protocol_version); + let initial_supply = builder.total_supply(protocol_version, None); for request in post_genesis_requests { builder.exec(request).commit().expect_success(); } - let post_genesis_supply = builder.total_supply(None, protocol_version); + let post_genesis_supply = builder.total_supply(protocol_version, None); assert_eq!( initial_supply, post_genesis_supply, @@ -2756,7 +2756,7 @@ fn should_not_create_purses_during_distribute() { timestamp_millis += TIMESTAMP_MILLIS_INCREMENT; } - let post_auction_supply = builder.total_supply(None, protocol_version); + let post_auction_supply = builder.total_supply(protocol_version, None); assert_eq!( initial_supply, post_auction_supply, "total supply should remain unchanged regardless of auction" @@ -2789,7 +2789,7 @@ fn should_not_create_purses_during_distribute() { number_of_purses_before_distribute ); - let post_distribute_supply = builder.total_supply(None, protocol_version); + let post_distribute_supply = builder.total_supply(protocol_version, None); assert!( initial_supply < post_distribute_supply, "total supply should increase after distribute ({} >= {})", @@ -2899,7 +2899,7 @@ fn should_distribute_delegation_rate_full_after_upgrading() { let protocol_version = DEFAULT_PROTOCOL_VERSION; // initial token supply - let initial_supply = builder.total_supply(None, protocol_version); + let initial_supply = builder.total_supply(protocol_version, None); let expected_total_reward_before = *GENESIS_ROUND_SEIGNIORAGE_RATE * initial_supply; let expected_total_reward_integer = expected_total_reward_before.to_integer(); @@ -2985,7 +2985,7 @@ fn should_distribute_delegation_rate_full_after_upgrading() { builder.upgrade(&mut upgrade_request); - let initial_supply = builder.total_supply(None, protocol_version); + let initial_supply = builder.total_supply(protocol_version, None); for _ in 0..5 { builder.advance_era(); diff --git a/execution_engine_testing/tests/src/test/system_contracts/genesis.rs b/execution_engine_testing/tests/src/test/system_contracts/genesis.rs index f0b5bebb7f..32e16308dc 100644 --- a/execution_engine_testing/tests/src/test/system_contracts/genesis.rs +++ b/execution_engine_testing/tests/src/test/system_contracts/genesis.rs @@ -151,7 +151,7 @@ fn should_track_total_token_supply_in_mint() { builder.run_genesis(genesis_request); - let total_supply = builder.total_supply(None, protocol_version); + let total_supply = builder.total_supply(protocol_version, None); let expected_balance: U512 = accounts.iter().map(|item| item.balance().value()).sum(); let expected_staked_amount: U512 = accounts diff --git a/execution_engine_testing/tests/src/test/system_contracts/mint.rs b/execution_engine_testing/tests/src/test/system_contracts/mint.rs index 521d90f0ed..98489d8b74 100644 --- a/execution_engine_testing/tests/src/test/system_contracts/mint.rs +++ b/execution_engine_testing/tests/src/test/system_contracts/mint.rs @@ -1,11 +1,12 @@ use casper_engine_test_support::{ - auction, ExecuteRequestBuilder, LmdbWasmTestBuilder, DEFAULT_ACCOUNT_ADDR, + ExecuteRequestBuilder, LmdbWasmTestBuilder, DEFAULT_ACCOUNT_ADDR, LOCAL_GENESIS_REQUEST, }; use casper_types::{runtime_args, ProtocolVersion, URef, U512}; +use casper_storage::data_access_layer::BalanceIdentifier; use tempfile::TempDir; -const TEST_DELEGATOR_INITIAL_ACCOUNT_BALANCE: u64 = 1_000_000 * 1_000_000_000; +// const TEST_DELEGATOR_INITIAL_ACCOUNT_BALANCE: u64 = 1_000_000 * 1_000_000_000; const CONTRACT_BURN: &str = "burn.wasm"; const CONTRACT_TRANSFER_TO_NAMED_PURSE: &str = "transfer_to_named_purse.wasm"; @@ -21,20 +22,22 @@ fn should_empty_purse_when_burning_above_balance() { let mut builder = LmdbWasmTestBuilder::new(data_dir.as_ref()); let source = *DEFAULT_ACCOUNT_ADDR; - let delegator_keys = auction::generate_public_keys(1); - let validator_keys = auction::generate_public_keys(1); - - auction::run_genesis_and_create_initial_accounts( - &mut builder, - &validator_keys, - delegator_keys - .iter() - .map(|public_key| public_key.to_account_hash()) - .collect::>(), - U512::from(TEST_DELEGATOR_INITIAL_ACCOUNT_BALANCE), - ); + builder.run_genesis(LOCAL_GENESIS_REQUEST.clone()); + + // let delegator_keys = auction::generate_public_keys(1); + // let validator_keys = auction::generate_public_keys(1); + + // run_genesis_and_create_initial_accounts( + // &mut builder, + // &validator_keys, + // delegator_keys + // .iter() + // .map(|public_key| public_key.to_account_hash()) + // .collect::>(), + // U512::from(TEST_DELEGATOR_INITIAL_ACCOUNT_BALANCE), + // ); - let initial_supply = builder.total_supply(None); + let initial_supply = builder.total_supply(ProtocolVersion::V2_0_0, None); let purse_name = "purse"; let purse_amount = U512::from(10_000_000_000u64); @@ -64,8 +67,11 @@ fn should_empty_purse_when_burning_above_balance() { assert_eq!( builder - .get_purse_balance_result(ProtocolVersion::V2_0_0, purse_uref) - .motes() + .get_purse_balance_result_with_proofs( + ProtocolVersion::V2_0_0, + BalanceIdentifier::Purse(purse_uref) + ) + .total_balance() .cloned() .unwrap(), purse_amount @@ -89,8 +95,11 @@ fn should_empty_purse_when_burning_above_balance() { assert_eq!( builder - .get_purse_balance_result(ProtocolVersion::V2_0_0, purse_uref) - .motes() + .get_purse_balance_result_with_proofs( + ProtocolVersion::V2_0_0, + BalanceIdentifier::Purse(purse_uref) + ) + .total_balance() .cloned() .unwrap(), num_of_tokens_after_burn @@ -114,14 +123,17 @@ fn should_empty_purse_when_burning_above_balance() { assert_eq!( builder - .get_purse_balance_result(ProtocolVersion::V2_0_0, purse_uref) - .motes() + .get_purse_balance_result_with_proofs( + ProtocolVersion::V2_0_0, + BalanceIdentifier::Purse(purse_uref) + ) + .total_balance() .cloned() .unwrap(), num_of_tokens_after_burn ); - let supply_after_burns = builder.total_supply(None); + let supply_after_burns = builder.total_supply(ProtocolVersion::V2_0_0, None); let expected_supply_after_burns = initial_supply - U512::from(10_000_000_000u64); assert_eq!(supply_after_burns, expected_supply_after_burns); @@ -134,20 +146,21 @@ fn should_not_burn_excess_tokens() { let mut builder = LmdbWasmTestBuilder::new(data_dir.as_ref()); let source = *DEFAULT_ACCOUNT_ADDR; - let delegator_keys = auction::generate_public_keys(1); - let validator_keys = auction::generate_public_keys(1); - - auction::run_genesis_and_create_initial_accounts( - &mut builder, - &validator_keys, - delegator_keys - .iter() - .map(|public_key| public_key.to_account_hash()) - .collect::>(), - U512::from(TEST_DELEGATOR_INITIAL_ACCOUNT_BALANCE), - ); - - let initial_supply = builder.total_supply(None); + builder.run_genesis(LOCAL_GENESIS_REQUEST.clone()); + // let delegator_keys = auction::generate_public_keys(1); + // let validator_keys = auction::generate_public_keys(1); + // + // run_genesis_and_create_initial_accounts( + // &mut builder, + // &validator_keys, + // delegator_keys + // .iter() + // .map(|public_key| public_key.to_account_hash()) + // .collect::>(), + // U512::from(TEST_DELEGATOR_INITIAL_ACCOUNT_BALANCE), + // ); + + let initial_supply = builder.total_supply(ProtocolVersion::V2_0_0, None); let purse_name = "purse"; let purse_amount = U512::from(10_000_000_000u64); @@ -177,8 +190,11 @@ fn should_not_burn_excess_tokens() { assert_eq!( builder - .get_purse_balance_result(ProtocolVersion::V2_0_0, purse_uref) - .motes() + .get_purse_balance_result_with_proofs( + ProtocolVersion::V2_0_0, + BalanceIdentifier::Purse(purse_uref) + ) + .total_balance() .cloned() .unwrap(), purse_amount @@ -202,14 +218,17 @@ fn should_not_burn_excess_tokens() { assert_eq!( builder - .get_purse_balance_result(ProtocolVersion::V2_0_0, purse_uref) - .motes() + .get_purse_balance_result_with_proofs( + ProtocolVersion::V2_0_0, + BalanceIdentifier::Purse(purse_uref) + ) + .total_balance() .cloned() .unwrap(), num_of_tokens_after_burn, ); - let supply_after_burns = builder.total_supply(None); + let supply_after_burns = builder.total_supply(ProtocolVersion::V2_0_0, None); let expected_supply_after_burns = initial_supply - U512::from(10_000_000_000u64); assert_eq!(supply_after_burns, expected_supply_after_burns); diff --git a/storage/src/global_state/state/mod.rs b/storage/src/global_state/state/mod.rs index 7f44420fae..823ea8df89 100644 --- a/storage/src/global_state/state/mod.rs +++ b/storage/src/global_state/state/mod.rs @@ -1332,7 +1332,7 @@ pub trait StateProvider { )); } }; - match runtime.burn(source_purse, burn_amount) { + match runtime.payment_burn(source_purse, burn_amount) { Ok(_) => Ok(burn_amount), Err(err) => Err(err), } @@ -1424,7 +1424,7 @@ pub trait StateProvider { Ok(value) => value, Err(tce) => return HandleFeeResult::Failure(tce), }; - runtime.burn(source_purse, amount) + runtime.payment_burn(source_purse, amount) } }; diff --git a/storage/src/system/handle_payment.rs b/storage/src/system/handle_payment.rs index c952d8fcfe..b9854da1ed 100644 --- a/storage/src/system/handle_payment.rs +++ b/storage/src/system/handle_payment.rs @@ -6,9 +6,10 @@ pub mod storage_provider; use casper_types::{ system::handle_payment::{Error, REFUND_PURSE_KEY}, - AccessRights, URef, U512, + AccessRights, PublicKey, URef, U512, }; use num_rational::Ratio; +use tracing::error; use crate::system::handle_payment::{ mint_provider::MintProvider, runtime_provider::RuntimeProvider, @@ -43,6 +44,11 @@ pub trait HandlePayment: MintProvider + RuntimeProvider + StorageProvider + Size /// Clear refund purse. fn clear_refund_purse(&mut self) -> Result<(), Error> { + if self.get_caller() != PublicKey::System.to_account_hash() { + error!("invalid caller to clear refund purse"); + return Err(Error::InvalidCaller); + } + self.remove_key(REFUND_PURSE_KEY) } @@ -57,6 +63,11 @@ pub trait HandlePayment: MintProvider + RuntimeProvider + StorageProvider + Size source_purse: URef, refund_ratio: Ratio, ) -> Result<(U512, U512), Error> { + if self.get_caller() != PublicKey::System.to_account_hash() { + error!("invalid caller to calculate overpayment and fee"); + return Err(Error::InvalidCaller); + } + let available_balance = match self.available_balance(source_purse)? { Some(balance) => balance, None => return Err(Error::PaymentPurseBalanceNotFound), @@ -77,11 +88,21 @@ pub trait HandlePayment: MintProvider + RuntimeProvider + StorageProvider + Size source_uref: URef, amount: Option, ) -> Result<(), Error> { + if self.get_caller() != PublicKey::System.to_account_hash() { + error!("invalid caller to distribute accumulated fee"); + return Err(Error::InvalidCaller); + } + internal::distribute_accumulated_fees(self, source_uref, amount) } /// Burns the imputed amount from the imputed purse. - fn burn(&mut self, source_uref: URef, amount: Option) -> Result<(), Error> { - internal::burn(self, source_uref, amount) + fn payment_burn(&mut self, source_uref: URef, amount: Option) -> Result<(), Error> { + if self.get_caller() != PublicKey::System.to_account_hash() { + error!("invalid caller to payment burn"); + return Err(Error::InvalidCaller); + } + + internal::payment_burn(self, source_uref, amount) } } diff --git a/storage/src/system/handle_payment/internal.rs b/storage/src/system/handle_payment/internal.rs index ef6313e159..b6dbf33dba 100644 --- a/storage/src/system/handle_payment/internal.rs +++ b/storage/src/system/handle_payment/internal.rs @@ -4,7 +4,7 @@ use super::{ }; use casper_types::{ system::handle_payment::{Error, PAYMENT_PURSE_KEY, REFUND_PURSE_KEY}, - Key, Phase, PublicKey, URef, U512, + Key, Phase, URef, U512, }; use num::CheckedMul; use num_rational::Ratio; @@ -112,23 +112,22 @@ pub fn calculate_overpayment_and_fee( Ok((adjusted_refund, fee)) } -pub fn burn( +pub fn payment_burn( provider: &mut P, purse: URef, amount: Option, ) -> Result<(), Error> { - // get the purse total balance (without holds) - let total_balance = match provider.available_balance(purse)? { + let available_balance = match provider.available_balance(purse)? { Some(balance) => balance, None => return Err(Error::PaymentPurseBalanceNotFound), }; - let burn_amount = amount.unwrap_or(total_balance); + let burn_amount = amount.unwrap_or(available_balance); if burn_amount.is_zero() { // nothing to burn == noop return Ok(()); } // Reduce the source purse and total supply by the refund amount - let adjusted_balance = total_balance + let adjusted_balance = available_balance .checked_sub(burn_amount) .ok_or(Error::ArithmeticOverflow)?; provider.write_balance(purse, adjusted_balance)?; @@ -152,10 +151,6 @@ where return Err(Error::IncompatiblePaymentSettings); } - if provider.get_caller() != PublicKey::System.to_account_hash() { - return Err(Error::SystemFunctionCalledByUserAccount); - } - let administrative_accounts = provider.administrative_accounts(); let reward_recipients = U512::from(administrative_accounts.len()); diff --git a/storage/src/system/mint.rs b/storage/src/system/mint.rs index 0e0b908453..a9c4387a72 100644 --- a/storage/src/system/mint.rs +++ b/storage/src/system/mint.rs @@ -55,27 +55,25 @@ pub trait Mint: RuntimeProvider + StorageProvider + SystemProvider { /// Burns native tokens. fn burn(&mut self, purse: URef, amount: U512) -> Result<(), Error> { if !purse.is_writeable() { - return Err(Error::ForgedReference); + return Err(Error::InvalidAccessRights); } if !self.is_valid_uref(&purse) { return Err(Error::ForgedReference); } - let source_balance: U512 = match self.balance(purse)? { + let source_available_balance: U512 = match self.balance(purse)? { Some(source_balance) => source_balance, None => return Err(Error::PurseNotFound), }; - let new_balance = match source_balance.checked_sub(amount) { + let new_balance = match source_available_balance.checked_sub(amount) { Some(value) => value, None => U512::zero(), }; - - // source_balance is >= than new_balance - // this should block user from reducing totaly supply beyond what they own - let burned_amount = source_balance - new_balance; - + // change balance self.write_balance(purse, new_balance)?; + // reduce total supply AFTER changing balance in case changing balance errors + let burned_amount = source_available_balance.saturating_sub(new_balance); detail::reduce_total_supply_unsafe(self, burned_amount) } diff --git a/storage/src/system/runtime_native.rs b/storage/src/system/runtime_native.rs index a29f320f43..36a96b1443 100644 --- a/storage/src/system/runtime_native.rs +++ b/storage/src/system/runtime_native.rs @@ -409,7 +409,7 @@ where &mut self.named_keys } - pub fn access_rights(&mut self) -> &ContextAccessRights { + pub fn access_rights(&self) -> &ContextAccessRights { &self.access_rights } diff --git a/types/src/system/handle_payment/error.rs b/types/src/system/handle_payment/error.rs index 7eb8ea5910..b31e509c05 100644 --- a/types/src/system/handle_payment/error.rs +++ b/types/src/system/handle_payment/error.rs @@ -156,13 +156,12 @@ pub enum Error { /// assert_eq!(21, Error::StakesDeserializationFailed as u8); /// ``` StakesDeserializationFailed = 21, - /// The invoked Handle Payment function can only be called by system contracts, but was called - /// by a user contract. + /// Raised when caller is not the system account. /// ``` /// # use casper_types::system::handle_payment::Error; - /// assert_eq!(22, Error::SystemFunctionCalledByUserAccount as u8); + /// assert_eq!(22, Error::InvalidCaller as u8); /// ``` - SystemFunctionCalledByUserAccount = 22, + InvalidCaller = 22, /// Internal error: while finalizing payment, the amount spent exceeded the amount available. /// ``` /// # use casper_types::system::handle_payment::Error; @@ -308,7 +307,7 @@ impl Display for Error { Error::StakesDeserializationFailed => { formatter.write_str("Failed to deserialize stake's balance") } - Error::SystemFunctionCalledByUserAccount => { + Error::InvalidCaller => { formatter.write_str("System function was called by user account") } Error::InsufficientPaymentForAmountSpent => { @@ -387,9 +386,7 @@ impl TryFrom for Error { v if v == Error::StakesDeserializationFailed as u8 => { Error::StakesDeserializationFailed } - v if v == Error::SystemFunctionCalledByUserAccount as u8 => { - Error::SystemFunctionCalledByUserAccount - } + v if v == Error::InvalidCaller as u8 => Error::InvalidCaller, v if v == Error::InsufficientPaymentForAmountSpent as u8 => { Error::InsufficientPaymentForAmountSpent } diff --git a/utils/global-state-update-gen/src/admins.rs b/utils/global-state-update-gen/src/admins.rs index 4a6e08f802..c6833f5be9 100644 --- a/utils/global-state-update-gen/src/admins.rs +++ b/utils/global-state-update-gen/src/admins.rs @@ -35,7 +35,7 @@ pub(crate) fn generate_admins(matches: &ArgMatches<'_>) { let admin_values = matches.values_of("admin").expect("at least one argument"); let protocol_version = DEFAULT_PROTOCOL_VERSION; - let mut total_supply = test_builder.total_supply(Some(post_state_hash), protocol_version); + let mut total_supply = test_builder.total_supply(protocol_version, Some(post_state_hash)); let total_supply_before = total_supply; for value in admin_values { From 6053825d87efc993600273549ed2b6217594e9a1 Mon Sep 17 00:00:00 2001 From: Ed Hastings Date: Mon, 6 May 2024 14:09:06 -0700 Subject: [PATCH 8/8] merge conflicts --- types/src/system/mint/entry_points.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/types/src/system/mint/entry_points.rs b/types/src/system/mint/entry_points.rs index a39f7edefe..74ce2a695a 100644 --- a/types/src/system/mint/entry_points.rs +++ b/types/src/system/mint/entry_points.rs @@ -53,6 +53,7 @@ pub fn mint_entry_points() -> EntryPoints { }, EntryPointAccess::Public, EntryPointType::Called, + EntryPointPayment::Caller, ); entry_points.add_entry_point(entry_point);