Skip to content

Commit

Permalink
update TurboSTM starcoin-framework
Browse files Browse the repository at this point in the history
  • Loading branch information
nkysg committed Oct 3, 2023
1 parent f9575e6 commit 969612c
Show file tree
Hide file tree
Showing 184 changed files with 146 additions and 163 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ starcoin-crypto = { git = "https://github.com/starcoinorg/starcoin-crypto", rev
starcoin-decrypt = { path = "commons/decrypt" }
starcoin-dev = { path = "vm/dev" }
starcoin-executor = { path = "executor" }
starcoin-framework = { git = "https://github.com/starcoinorg/starcoin-framework", rev = "0d3921265ed6a519bd09b1111949db2593a6f9c1" }
starcoin-framework = { git = "https://github.com/starcoinorg/starcoin-framework", rev = "797ae8d4c5a60916708ac1ef22827e401ae2a191" }
starcoin-genesis = { path = "genesis" }
starcoin-logger = { path = "commons/logger" }
starcoin-metrics = { path = "commons/metrics" }
Expand Down
Binary file modified genesis/generated/halley/genesis
Binary file not shown.
1 change: 0 additions & 1 deletion vm/mvhashmap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use std::{
atomic::{AtomicUsize, Ordering},
Arc,
},
thread,
};

#[cfg(test)]
Expand Down
4 changes: 1 addition & 3 deletions vm/parallel-executor/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ use num_cpus;
use once_cell::sync::Lazy;
use starcoin_infallible::Mutex;
use starcoin_mvhashmap::MVHashMap;
use std::{
collections::HashSet, hash::Hash, marker::PhantomData, sync::Arc, thread, thread::spawn,
};
use std::{collections::HashSet, hash::Hash, marker::PhantomData, sync::Arc, thread::spawn};

static RAYON_EXEC_POOL: Lazy<rayon::ThreadPool> = Lazy::new(|| {
rayon::ThreadPoolBuilder::new()
Expand Down
1 change: 0 additions & 1 deletion vm/parallel-executor/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use std::{
atomic::{AtomicBool, AtomicUsize, Ordering},
Arc, Condvar,
},
thread,
};

// Type aliases.
Expand Down
Binary file modified vm/stdlib/compiled/12/11-12/stdlib.blob
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/037_Account.mv
Binary file not shown.
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/055_GasSchedule.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/11-12/stdlib/056_EasyGas.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/11-12/stdlib/057_EasyGasScript.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/057_Oracle.mv
Binary file not shown.
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/061_NFT.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/063_MerkleProof.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/064_MerkleNFTDistributor.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/067_StdlibUpgradeScripts.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/068_Genesis.mv
Binary file not shown.
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/11-12/stdlib/071_Genesis.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/073_NFTGallery.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/076_PriceOracleAggregator.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/078_Secp256k1.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/081_SimpleMap.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/083_StarcoinVerifier.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/084_String.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/087_TransactionManager.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/088_TransferScripts.mv
Binary file not shown.
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/090_TypeInfo.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/11-12/stdlib/091_U256.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/037_Account.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/052_TypeInfo.mv
Binary file not shown.
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/054_Oracle.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/055_GasSchedule.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/055_PriceOracle.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/056_EasyGas.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/057_EasyGasScript.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/057_Oracle.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/058_Epoch.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/059_EventUtil.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/060_FixedPoint32.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/061_NFT.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/062_STCUSDOracle.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/063_MerkleProof.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/063_Offer.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/064_MerkleNFTDistributor.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/064_NFT.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/065_LanguageVersion.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/066_MerkleProof.mv
Binary file not shown.
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/067_StdlibUpgradeScripts.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/068_Genesis.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/068_IdentifierNFT.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/069_GenesisNFT.mv
Binary file not shown.
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/071_Genesis.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/072_GenesisNFTScripts.mv
Binary file not shown.
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/073_NFTGallery.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/074_MintDaoProposal.mv
Binary file not shown.
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/076_NFTGallery.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/076_PriceOracleAggregator.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/077_NFTGalleryScripts.mv
Binary file not shown.
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/078_Secp256k1.mv
Binary file not shown.
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/080_PriceOracleScripts.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/081_Secp256k1.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/081_SimpleMap.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/082_Signature.mv
Binary file not shown.
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/083_StarcoinVerifier.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/084_SimpleMap.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/084_String.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/085_StructuredHash.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/086_StarcoinVerifier.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/087_String.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/087_TransactionManager.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/088_Table.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/088_TransferScripts.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/089_TransactionTimeout.mv
Binary file not shown.
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/090_TypeInfo.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/091_TransferScripts.mv
Binary file not shown.
Binary file modified vm/stdlib/compiled/12/stdlib/091_U256.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/092_TreasuryScripts.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/093_U256.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/094_YieldFarming.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/12/stdlib/095_YieldFarmingV2.mv
Binary file not shown.
Binary file not shown.
Binary file modified vm/stdlib/compiled/latest/stdlib/037_Account.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/052_TypeInfo.mv
Binary file not shown.
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/054_Oracle.mv
Binary file not shown.
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/055_PriceOracle.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/056_EasyGas.mv
Binary file not shown.
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/057_EasyGasScript.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/058_Epoch.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/059_EventUtil.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/060_FixedPoint32.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/061_GasSchedule.mv
Binary file not shown.
File renamed without changes.
Binary file removed vm/stdlib/compiled/latest/stdlib/062_STCUSDOracle.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/063_Offer.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/064_NFT.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/065_LanguageVersion.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/066_MerkleProof.mv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added vm/stdlib/compiled/latest/stdlib/068_Genesis.mv
Binary file not shown.
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/069_GenesisNFT.mv
Binary file not shown.
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/071_Genesis.mv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/074_MintDaoProposal.mv
Binary file not shown.
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/076_NFTGallery.mv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/081_Secp256k1.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/082_Signature.mv
Binary file not shown.
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/084_SimpleMap.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/085_StructuredHash.mv
Binary file not shown.
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/087_String.mv
Binary file not shown.
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/088_Table.mv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/091_TransferScripts.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/092_TreasuryScripts.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/093_U256.mv
Binary file not shown.
Binary file removed vm/stdlib/compiled/latest/stdlib/094_YieldFarming.mv
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion vm/transaction-benchmarks/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn main() {
default_num_transactions,
);

let acts = [10000,];
let acts = [10000];
let txns = [500000];
let num_warmups = 2;
let num_runs = 10;
Expand Down
2 changes: 1 addition & 1 deletion vm/transaction-benchmarks/src/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ fn universe_strategy(
num_transactions: usize,
) -> impl Strategy<Value = AccountUniverseGen> {
// Multiply by 5 past the number of to provide
let max_balance = 5_000_000_000;//TXN_RESERVED * num_transactions as u64 * 10_000;
let max_balance = 5_000_000_000; //TXN_RESERVED * num_transactions as u64 * 10_000;
let balance_strategy = log_balance_strategy(max_balance);
AccountUniverseGen::strategy(num_accounts, balance_strategy)
}
Expand Down
295 changes: 141 additions & 154 deletions vm/transaction-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,7 @@ pub fn create_signed_txn_with_association_account(
pub fn build_stdlib_package(net: &ChainNetwork, stdlib_option: StdLibOptions) -> Result<Package> {
let init_script = match net.genesis_config().stdlib_version {
StdlibVersion::Version(1) => build_init_script_v1(net),
StdlibVersion::Version(12) | StdlibVersion::Latest => {
build_init_script_with_function(net, "initialize_v3")
}
_ => build_init_script_with_function(net, "initialize_v2"),
_ => build_init_script_v2(net),
};
stdlib_package(stdlib_option, Some(init_script))
}
Expand All @@ -365,10 +362,7 @@ pub fn build_stdlib_package_with_modules(
) -> Result<Package> {
let init_script = match net.genesis_config().stdlib_version {
StdlibVersion::Version(1) => build_init_script_v1(net),
StdlibVersion::Version(12) | StdlibVersion::Latest => {
build_init_script_with_function(net, "initialize_v3")
}
_ => build_init_script_with_function(net, "initialize_v2"),
_ => build_init_script_v2(net),
};
module_to_package(modules, Some(init_script))
}
Expand Down Expand Up @@ -536,7 +530,7 @@ pub fn build_init_script_v1(net: &ChainNetwork) -> ScriptFunction {
)
}

pub fn build_init_script_with_function(net: &ChainNetwork, function: &str) -> ScriptFunction {
pub fn build_init_script_v2(net: &ChainNetwork) -> ScriptFunction {
let genesis_config = net.genesis_config();
let chain_id = net.chain_id().id();
let genesis_timestamp = net.genesis_block_parameter().timestamp;
Expand All @@ -557,154 +551,147 @@ pub fn build_init_script_with_function(net: &ChainNetwork, function: &str) -> Sc
let native_schedule = bcs_ext::to_bytes(&genesis_config.vm_config.gas_schedule.native_table)
.expect("Cannot serialize gas schedule");

let mut args = vec![
bcs_ext::to_bytes(&net.genesis_config().stdlib_version.version()).unwrap(),
bcs_ext::to_bytes(&genesis_config.reward_delay).unwrap(),
bcs_ext::to_bytes(&G_TOTAL_STC_AMOUNT.scaling()).unwrap(),
bcs_ext::to_bytes(&genesis_config.pre_mine_amount).unwrap(),
bcs_ext::to_bytes(&genesis_config.time_mint_amount).unwrap(),
bcs_ext::to_bytes(&genesis_config.time_mint_period).unwrap(),
bcs_ext::to_bytes(&genesis_parent_hash.to_vec()).unwrap(),
bcs_ext::to_bytes(&association_auth_key).unwrap(),
bcs_ext::to_bytes(&genesis_auth_key).unwrap(),
bcs_ext::to_bytes(&chain_id).unwrap(),
bcs_ext::to_bytes(&genesis_timestamp).unwrap(),
//consensus config
bcs_ext::to_bytes(&genesis_config.consensus_config.uncle_rate_target).unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.epoch_block_count).unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.base_block_time_target).unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.base_block_difficulty_window).unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.base_reward_per_block).unwrap(),
bcs_ext::to_bytes(
&genesis_config
.consensus_config
.base_reward_per_uncle_percent,
)
.unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.min_block_time_target).unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.max_block_time_target).unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.base_max_uncles_per_block).unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.base_block_gas_limit).unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.strategy).unwrap(),
//vm config
bcs_ext::to_bytes(&genesis_config.publishing_option.is_script_allowed()).unwrap(),
bcs_ext::to_bytes(
&genesis_config
.publishing_option
.is_module_publishing_allowed(),
)
.unwrap(),
bcs_ext::to_bytes(&instruction_schedule).unwrap(),
bcs_ext::to_bytes(&native_schedule).unwrap(),
//gas constants
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.global_memory_per_byte_cost,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.global_memory_per_byte_write_cost,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.min_transaction_gas_units,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.large_transaction_cutoff,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.intrinsic_gas_per_byte,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.maximum_number_of_gas_units,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.min_price_per_gas_unit,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.max_price_per_gas_unit,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.max_transaction_size_in_bytes,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.gas_unit_scaling_factor,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.default_account_size,
)
.unwrap(),
// dao config params
bcs_ext::to_bytes(&genesis_config.dao_config.voting_delay).unwrap(),
bcs_ext::to_bytes(&genesis_config.dao_config.voting_period).unwrap(),
bcs_ext::to_bytes(&genesis_config.dao_config.voting_quorum_rate).unwrap(),
bcs_ext::to_bytes(&genesis_config.dao_config.min_action_delay).unwrap(),
//transaction timeout config
bcs_ext::to_bytes(&genesis_config.transaction_timeout).unwrap(),
];

if function == "initialize_v3" {
args.push(
bcs_ext::to_bytes(&GasSchedule::from(&genesis_config.vm_config.gas_schedule)).unwrap(),
);
}

ScriptFunction::new(
ModuleId::new(core_code_address(), Identifier::new("Genesis").unwrap()),
Identifier::new(function).unwrap(),
Identifier::new("initialize_v2").unwrap(),
vec![],
args,
vec![
bcs_ext::to_bytes(&net.genesis_config().stdlib_version.version()).unwrap(),
bcs_ext::to_bytes(&genesis_config.reward_delay).unwrap(),
bcs_ext::to_bytes(&G_TOTAL_STC_AMOUNT.scaling()).unwrap(),
bcs_ext::to_bytes(&genesis_config.pre_mine_amount).unwrap(),
bcs_ext::to_bytes(&genesis_config.time_mint_amount).unwrap(),
bcs_ext::to_bytes(&genesis_config.time_mint_period).unwrap(),
bcs_ext::to_bytes(&genesis_parent_hash.to_vec()).unwrap(),
bcs_ext::to_bytes(&association_auth_key).unwrap(),
bcs_ext::to_bytes(&genesis_auth_key).unwrap(),
bcs_ext::to_bytes(&chain_id).unwrap(),
bcs_ext::to_bytes(&genesis_timestamp).unwrap(),
//consensus config
bcs_ext::to_bytes(&genesis_config.consensus_config.uncle_rate_target).unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.epoch_block_count).unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.base_block_time_target).unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.base_block_difficulty_window)
.unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.base_reward_per_block).unwrap(),
bcs_ext::to_bytes(
&genesis_config
.consensus_config
.base_reward_per_uncle_percent,
)
.unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.min_block_time_target).unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.max_block_time_target).unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.base_max_uncles_per_block).unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.base_block_gas_limit).unwrap(),
bcs_ext::to_bytes(&genesis_config.consensus_config.strategy).unwrap(),
//vm config
bcs_ext::to_bytes(&genesis_config.publishing_option.is_script_allowed()).unwrap(),
bcs_ext::to_bytes(
&genesis_config
.publishing_option
.is_module_publishing_allowed(),
)
.unwrap(),
bcs_ext::to_bytes(&instruction_schedule).unwrap(),
bcs_ext::to_bytes(&native_schedule).unwrap(),
//gas constants
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.global_memory_per_byte_cost,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.global_memory_per_byte_write_cost,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.min_transaction_gas_units,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.large_transaction_cutoff,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.intrinsic_gas_per_byte,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.maximum_number_of_gas_units,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.min_price_per_gas_unit,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.max_price_per_gas_unit,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.max_transaction_size_in_bytes,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.gas_unit_scaling_factor,
)
.unwrap(),
bcs_ext::to_bytes(
&genesis_config
.vm_config
.gas_schedule
.gas_constants
.default_account_size,
)
.unwrap(),
// dao config params
bcs_ext::to_bytes(&genesis_config.dao_config.voting_delay).unwrap(),
bcs_ext::to_bytes(&genesis_config.dao_config.voting_period).unwrap(),
bcs_ext::to_bytes(&genesis_config.dao_config.voting_quorum_rate).unwrap(),
bcs_ext::to_bytes(&genesis_config.dao_config.min_action_delay).unwrap(),
//transaction timeout config
bcs_ext::to_bytes(&genesis_config.transaction_timeout).unwrap(),
],
)
}

Expand Down

0 comments on commit 969612c

Please sign in to comment.