From 1b9616690314ea5050001bf11d987e7b0b9fab6f Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Mon, 7 Mar 2022 17:57:02 +0100 Subject: [PATCH 1/7] feat(params-estimator): Increase deployment cost Set the deplyoment cost per byte to the maximum that still allows deploying a 4MiB contract. This is to cover compilation costs. --- CHANGELOG.md | 1 + core/primitives/res/runtime_configs/52.json | 2 +- .../src/tests/runtime/deployment.rs | 69 +++++++++++++++++++ integration-tests/src/tests/runtime/mod.rs | 1 + runtime/near-test-contracts/src/lib.rs | 20 ++++++ 5 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 integration-tests/src/tests/runtime/deployment.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ce5b237479..4cbfbe67fc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [unreleased] * increasing max_gas_burnt from 200TGas to 300Tgas, allowing larger transactions. +* increasing `action_creation_config.deploy_contract_cost_per_byte.execution` ### Protocol Changes diff --git a/core/primitives/res/runtime_configs/52.json b/core/primitives/res/runtime_configs/52.json index 6b38be7f36d..00c0aa8282e 100644 --- a/core/primitives/res/runtime_configs/52.json +++ b/core/primitives/res/runtime_configs/52.json @@ -32,7 +32,7 @@ "deploy_contract_cost_per_byte": { "send_sir": 6812999, "send_not_sir": 6812999, - "execution": 6812999 + "execution": 64572944 }, "function_call_cost": { "send_sir": 2319861500000, diff --git a/integration-tests/src/tests/runtime/deployment.rs b/integration-tests/src/tests/runtime/deployment.rs new file mode 100644 index 00000000000..d1d8ee0f063 --- /dev/null +++ b/integration-tests/src/tests/runtime/deployment.rs @@ -0,0 +1,69 @@ +use crate::node::{Node, RuntimeNode}; +use near_chain_configs::Genesis; +use near_primitives::runtime::config_store::RuntimeConfigStore; +use near_primitives::transaction::{Action, DeployContractAction}; +use near_primitives::types::AccountId; +use near_primitives::version::PROTOCOL_VERSION; +use near_primitives::{ + serialize::to_base64, transaction::SignedTransaction, views::FinalExecutionStatus, +}; +use nearcore::config::GenesisExt; + +/// One NEAR, divisible by 10^24. +const NEAR_BASE: u128 = 1_000_000_000_000_000_000_000_000; + +#[test] +/// Tests if the maximum allowed contract can be deployed with current gas limits +fn test_deploy_max_size_contract() { + let account_id: AccountId = "alice.near".parse().unwrap(); + let test_contract_id: AccountId = "test_contract.alice.near".parse().unwrap(); + let runtime_config_store = RuntimeConfigStore::new(None); + let config = runtime_config_store.get_config(PROTOCOL_VERSION); + + let genesis = Genesis::test(vec![account_id.clone()], 1); + let node = + RuntimeNode::new_from_genesis_and_config(&account_id, genesis, config.as_ref().clone()); + let node_user = node.user(); + + // Compute size of a deployment transaction with an almost empty contract payload + let block_hash = node_user.get_best_block_hash().unwrap_or_default(); + let signed_transaction = SignedTransaction::from_actions( + node_user.get_access_key_nonce_for_signer(&account_id).unwrap_or_default() + 1, + test_contract_id.clone(), + test_contract_id.clone(), + &*node_user.signer(), + vec![Action::DeployContract(DeployContractAction { code: vec![0u8] })], + block_hash, + ); + let tx_overhead = signed_transaction.get_size(); + + // Testable max contract size is limited by both `max_contract_size` and by `max_transaction_size` + let max_contract_size = config.wasm_config.limit_config.max_contract_size; + let max_transaction_size = config.wasm_config.limit_config.max_transaction_size; + let contract_size = max_contract_size.min(max_transaction_size - tx_overhead); + // Enough token to store contract + 1 NEAR for account + let token_balance = config.storage_amount_per_byte * contract_size as u128 + NEAR_BASE; + + // Create test account + let transaction_result = node_user + .create_account( + account_id.clone(), + test_contract_id.clone(), + node.signer().public_key(), + token_balance, + ) + .unwrap(); + assert_eq!(transaction_result.status, FinalExecutionStatus::SuccessValue(to_base64(&[]))); + assert_eq!(transaction_result.receipts_outcome.len(), 2); + + // Deploy contract + let wasm_binary = near_test_contracts::sized_contract(contract_size as usize); + let transaction_result = + node_user.deploy_contract(test_contract_id, wasm_binary.to_vec()).unwrap(); + assert_eq!(transaction_result.status, FinalExecutionStatus::SuccessValue(to_base64(&[]))); + assert_eq!(transaction_result.receipts_outcome.len(), 1); + assert!( + transaction_result.receipts_outcome[0].outcome.gas_burnt + <= config.wasm_config.limit_config.max_gas_burnt, + ); +} diff --git a/integration-tests/src/tests/runtime/mod.rs b/integration-tests/src/tests/runtime/mod.rs index 122e294e8ba..9fcf2454bab 100644 --- a/integration-tests/src/tests/runtime/mod.rs +++ b/integration-tests/src/tests/runtime/mod.rs @@ -1,2 +1,3 @@ +mod deployment; mod state_viewer; mod test_evil_contracts; diff --git a/runtime/near-test-contracts/src/lib.rs b/runtime/near-test-contracts/src/lib.rs index 0fd0804ae84..934862cf626 100644 --- a/runtime/near-test-contracts/src/lib.rs +++ b/runtime/near-test-contracts/src/lib.rs @@ -12,6 +12,26 @@ pub fn trivial_contract() -> &'static [u8] { .as_slice() } +/// Contract with exact size in bytes. +pub fn sized_contract(size: usize) -> &'static [u8] { + static CONTRACT: OnceCell> = OnceCell::new(); + CONTRACT + .get_or_init(|| { + let payload = "x".repeat(size); + let base_size = + wat::parse_str(format!("(module (data \"{payload}\") (func (export \"main\")))")) + .unwrap() + .len(); + let adjusted_size = size as i64 - (base_size as i64 - size as i64); + let payload = "x".repeat(adjusted_size as usize); + let code = format!("(module (data \"{payload}\") (func (export \"main\")))"); + let contract = wat::parse_str(code).unwrap(); + assert_eq!(contract.len(), size); + contract + }) + .as_slice() +} + /// Standard test contract which can call various host functions. /// /// Note: the contract relies on the latest protocol version, and From ea25e84fc7a63f86cc26929f82374a61e0c4448b Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 8 Mar 2022 15:46:45 +0100 Subject: [PATCH 2/7] Consider TX conversion cost in gas limit --- integration-tests/src/tests/runtime/deployment.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/integration-tests/src/tests/runtime/deployment.rs b/integration-tests/src/tests/runtime/deployment.rs index d1d8ee0f063..346dffc792e 100644 --- a/integration-tests/src/tests/runtime/deployment.rs +++ b/integration-tests/src/tests/runtime/deployment.rs @@ -62,8 +62,10 @@ fn test_deploy_max_size_contract() { node_user.deploy_contract(test_contract_id, wasm_binary.to_vec()).unwrap(); assert_eq!(transaction_result.status, FinalExecutionStatus::SuccessValue(to_base64(&[]))); assert_eq!(transaction_result.receipts_outcome.len(), 1); - assert!( - transaction_result.receipts_outcome[0].outcome.gas_burnt - <= config.wasm_config.limit_config.max_gas_burnt, - ); + + // Check total TX gas is in limit + let tx_conversion_gas_burnt = transaction_result.transaction_outcome.outcome.gas_burnt; + let deployment_gas_burnt = transaction_result.receipts_outcome[0].outcome.gas_burnt; + let total_gas_burnt = tx_conversion_gas_burnt + deployment_gas_burnt; + assert!(total_gas_burnt <= config.wasm_config.limit_config.max_gas_burnt,); } From 5482cab53285d07c3ecfcf96c014a297f6de8cc1 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 8 Mar 2022 15:52:22 +0100 Subject: [PATCH 3/7] Move cost change to protocol version 53 --- core/primitives/res/runtime_configs/52.json | 2 +- core/primitives/res/runtime_configs/53.json | 193 ++++++++++++++++++++ core/primitives/src/version.rs | 2 +- 3 files changed, 195 insertions(+), 2 deletions(-) create mode 100644 core/primitives/res/runtime_configs/53.json diff --git a/core/primitives/res/runtime_configs/52.json b/core/primitives/res/runtime_configs/52.json index 00c0aa8282e..6b38be7f36d 100644 --- a/core/primitives/res/runtime_configs/52.json +++ b/core/primitives/res/runtime_configs/52.json @@ -32,7 +32,7 @@ "deploy_contract_cost_per_byte": { "send_sir": 6812999, "send_not_sir": 6812999, - "execution": 64572944 + "execution": 6812999 }, "function_call_cost": { "send_sir": 2319861500000, diff --git a/core/primitives/res/runtime_configs/53.json b/core/primitives/res/runtime_configs/53.json new file mode 100644 index 00000000000..00c0aa8282e --- /dev/null +++ b/core/primitives/res/runtime_configs/53.json @@ -0,0 +1,193 @@ +{ + "storage_amount_per_byte": "10000000000000000000", + "transaction_costs": { + "action_receipt_creation_config": { + "send_sir": 108059500000, + "send_not_sir": 108059500000, + "execution": 108059500000 + }, + "data_receipt_creation_config": { + "base_cost": { + "send_sir": 36486732312, + "send_not_sir": 36486732312, + "execution": 36486732312 + }, + "cost_per_byte": { + "send_sir": 17212011, + "send_not_sir": 17212011, + "execution": 17212011 + } + }, + "action_creation_config": { + "create_account_cost": { + "send_sir": 99607375000, + "send_not_sir": 99607375000, + "execution": 99607375000 + }, + "deploy_contract_cost": { + "send_sir": 184765750000, + "send_not_sir": 184765750000, + "execution": 184765750000 + }, + "deploy_contract_cost_per_byte": { + "send_sir": 6812999, + "send_not_sir": 6812999, + "execution": 64572944 + }, + "function_call_cost": { + "send_sir": 2319861500000, + "send_not_sir": 2319861500000, + "execution": 2319861500000 + }, + "function_call_cost_per_byte": { + "send_sir": 2235934, + "send_not_sir": 2235934, + "execution": 2235934 + }, + "transfer_cost": { + "send_sir": 115123062500, + "send_not_sir": 115123062500, + "execution": 115123062500 + }, + "stake_cost": { + "send_sir": 141715687500, + "send_not_sir": 141715687500, + "execution": 102217625000 + }, + "add_key_cost": { + "full_access_cost": { + "send_sir": 101765125000, + "send_not_sir": 101765125000, + "execution": 101765125000 + }, + "function_call_cost": { + "send_sir": 102217625000, + "send_not_sir": 102217625000, + "execution": 102217625000 + }, + "function_call_cost_per_byte": { + "send_sir": 1925331, + "send_not_sir": 1925331, + "execution": 1925331 + } + }, + "delete_key_cost": { + "send_sir": 94946625000, + "send_not_sir": 94946625000, + "execution": 94946625000 + }, + "delete_account_cost": { + "send_sir": 147489000000, + "send_not_sir": 147489000000, + "execution": 147489000000 + } + }, + "storage_usage_config": { + "num_bytes_account": 100, + "num_extra_bytes_record": 40 + }, + "burnt_gas_reward": [ + 3, + 10 + ], + "pessimistic_gas_price_inflation_ratio": [ + 103, + 100 + ] + }, + "wasm_config": { + "ext_costs": { + "base": 264768111, + "contract_compile_base": 35445963, + "contract_compile_bytes": 216750, + "read_memory_base": 2609863200, + "read_memory_byte": 3801333, + "write_memory_base": 2803794861, + "write_memory_byte": 2723772, + "read_register_base": 2517165186, + "read_register_byte": 98562, + "write_register_base": 2865522486, + "write_register_byte": 3801564, + "utf8_decoding_base": 3111779061, + "utf8_decoding_byte": 291580479, + "utf16_decoding_base": 3543313050, + "utf16_decoding_byte": 163577493, + "sha256_base": 4540970250, + "sha256_byte": 24117351, + "keccak256_base": 5879491275, + "keccak256_byte": 21471105, + "keccak512_base": 5811388236, + "keccak512_byte": 36649701, + "ripemd160_base": 853675086, + "ripemd160_block": 680107584, + "ecrecover_base": 278821988457, + "log_base": 3543313050, + "log_byte": 13198791, + "storage_write_base": 64196736000, + "storage_write_key_byte": 70482867, + "storage_write_value_byte": 31018539, + "storage_write_evicted_byte": 32117307, + "storage_read_base": 56356845750, + "storage_read_key_byte": 30952533, + "storage_read_value_byte": 5611005, + "storage_remove_base": 53473030500, + "storage_remove_key_byte": 38220384, + "storage_remove_ret_value_byte": 11531556, + "storage_has_key_base": 54039896625, + "storage_has_key_byte": 30790845, + "storage_iter_create_prefix_base": 0, + "storage_iter_create_prefix_byte": 0, + "storage_iter_create_range_base": 0, + "storage_iter_create_from_byte": 0, + "storage_iter_create_to_byte": 0, + "storage_iter_next_base": 0, + "storage_iter_next_key_byte": 0, + "storage_iter_next_value_byte": 0, + "touching_trie_node": 16101955926, + "promise_and_base": 1465013400, + "promise_and_per_promise": 5452176, + "promise_return": 560152386, + "validator_stake_base": 911834726400, + "validator_total_stake_base": 911834726400, + "alt_bn128_g1_multiexp_base": 713006929500, + "alt_bn128_g1_multiexp_byte": 3335092461, + "alt_bn128_g1_multiexp_sublinear": 4325094, + "alt_bn128_pairing_check_base": 9685508901000, + "alt_bn128_pairing_check_byte": 26575188546, + "alt_bn128_g1_sum_base": 3175314375, + "alt_bn128_g1_sum_byte": 76218543 + }, + "grow_mem_cost": 1, + "regular_op_cost": 822756, + "limit_config": { + "max_gas_burnt": 300000000000000, + "max_gas_burnt_view": 300000000000000, + "max_stack_height": 16384, + "stack_limiter_version": 1, + "initial_memory_pages": 1024, + "max_memory_pages": 2048, + "registers_memory_limit": 1073741824, + "max_register_size": 104857600, + "max_number_registers": 100, + "max_number_logs": 100, + "max_total_log_length": 16384, + "max_total_prepaid_gas": 300000000000000, + "max_actions_per_receipt": 100, + "max_number_bytes_method_names": 2000, + "max_length_method_name": 256, + "max_arguments_length": 4194304, + "max_length_returned_data": 4194304, + "max_contract_size": 4194304, + "max_transaction_size": 4194304, + "max_length_storage_key": 4194304, + "max_length_storage_value": 4194304, + "max_promises_per_function_call_action": 1024, + "max_number_input_data_dependencies": 128, + "max_functions_number_per_contract": 10000 + } + }, + "account_creation_config": { + "min_allowed_top_level_account_length": 32, + "registrar_account_id": "registrar" + } +} diff --git a/core/primitives/src/version.rs b/core/primitives/src/version.rs index b8eb4d71bba..afe2c379d8d 100644 --- a/core/primitives/src/version.rs +++ b/core/primitives/src/version.rs @@ -161,7 +161,7 @@ pub const PEER_MIN_ALLOWED_PROTOCOL_VERSION: ProtocolVersion = STABLE_PROTOCOL_V /// Current protocol version used on the mainnet. /// Some features (e. g. FixStorageUsage) require that there is at least one epoch with exactly /// the corresponding version -const STABLE_PROTOCOL_VERSION: ProtocolVersion = 52; +const STABLE_PROTOCOL_VERSION: ProtocolVersion = 53; /// Version used by this binary. #[cfg(not(feature = "nightly_protocol"))] From da8230b93d09de52c00267e90dd04d0911dd4181 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 8 Mar 2022 16:29:23 +0100 Subject: [PATCH 4/7] Address review findings --- integration-tests/src/tests/runtime/deployment.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/integration-tests/src/tests/runtime/deployment.rs b/integration-tests/src/tests/runtime/deployment.rs index 346dffc792e..3b553e2e270 100644 --- a/integration-tests/src/tests/runtime/deployment.rs +++ b/integration-tests/src/tests/runtime/deployment.rs @@ -9,11 +9,10 @@ use near_primitives::{ }; use nearcore::config::GenesisExt; -/// One NEAR, divisible by 10^24. -const NEAR_BASE: u128 = 1_000_000_000_000_000_000_000_000; +const ONE_NEAR: u128 = 10u128.pow(24); -#[test] /// Tests if the maximum allowed contract can be deployed with current gas limits +#[test] fn test_deploy_max_size_contract() { let account_id: AccountId = "alice.near".parse().unwrap(); let test_contract_id: AccountId = "test_contract.alice.near".parse().unwrap(); @@ -42,7 +41,7 @@ fn test_deploy_max_size_contract() { let max_transaction_size = config.wasm_config.limit_config.max_transaction_size; let contract_size = max_contract_size.min(max_transaction_size - tx_overhead); // Enough token to store contract + 1 NEAR for account - let token_balance = config.storage_amount_per_byte * contract_size as u128 + NEAR_BASE; + let token_balance = config.storage_amount_per_byte * contract_size as u128 + ONE_NEAR; // Create test account let transaction_result = node_user From af3132a1b117df7d4a3257dfd5d0d3ff6a82048e Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 8 Mar 2022 20:12:11 +0100 Subject: [PATCH 5/7] Address review findings (push missing `git add`) --- runtime/near-test-contracts/src/lib.rs | 29 +++++++++++--------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/runtime/near-test-contracts/src/lib.rs b/runtime/near-test-contracts/src/lib.rs index 934862cf626..3bc66375eaa 100644 --- a/runtime/near-test-contracts/src/lib.rs +++ b/runtime/near-test-contracts/src/lib.rs @@ -13,23 +13,18 @@ pub fn trivial_contract() -> &'static [u8] { } /// Contract with exact size in bytes. -pub fn sized_contract(size: usize) -> &'static [u8] { - static CONTRACT: OnceCell> = OnceCell::new(); - CONTRACT - .get_or_init(|| { - let payload = "x".repeat(size); - let base_size = - wat::parse_str(format!("(module (data \"{payload}\") (func (export \"main\")))")) - .unwrap() - .len(); - let adjusted_size = size as i64 - (base_size as i64 - size as i64); - let payload = "x".repeat(adjusted_size as usize); - let code = format!("(module (data \"{payload}\") (func (export \"main\")))"); - let contract = wat::parse_str(code).unwrap(); - assert_eq!(contract.len(), size); - contract - }) - .as_slice() +pub fn sized_contract(size: usize) -> Vec { + let payload = "x".repeat(size); + let base_size = + wat::parse_str(format!("(module (data \"{payload}\") (func (export \"main\")))")) + .unwrap() + .len(); + let adjusted_size = size as i64 - (base_size as i64 - size as i64); + let payload = "x".repeat(adjusted_size as usize); + let code = format!("(module (data \"{payload}\") (func (export \"main\")))"); + let contract = wat::parse_str(code).unwrap(); + assert_eq!(contract.len(), size); + contract } /// Standard test contract which can call various host functions. From 45d6c3c8774e2aabda95a0d48f9d222116c23129 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 18 Mar 2022 14:05:58 +0100 Subject: [PATCH 6/7] Update genesis config --- chain/chain/src/tests/simple_chain.rs | 12 ++++++------ nearcore/res/genesis_config.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/chain/chain/src/tests/simple_chain.rs b/chain/chain/src/tests/simple_chain.rs index f43efcb79e7..fa69126eac0 100644 --- a/chain/chain/src/tests/simple_chain.rs +++ b/chain/chain/src/tests/simple_chain.rs @@ -25,9 +25,9 @@ fn empty_chain() { let hash = chain.head().unwrap().last_block_hash; // The hashes here will have to be modified after each change to genesis file. #[cfg(feature = "nightly_protocol")] - assert_eq!(hash, CryptoHash::from_str("2VFkBfWwcTqyVJ83zy78n5WUNadwGuJbLc2KEp9SJ8dV").unwrap()); + assert_eq!(hash, CryptoHash::from_str("A66sjdBrMzMi96tuaQXTBDAaePUDxYCo2qSBGCzHTMgb").unwrap()); #[cfg(not(feature = "nightly_protocol"))] - assert_eq!(hash, CryptoHash::from_str("8UF2TCELQ2sSqorskN5myyC7h1XfgxYm68JHJMKo5n8X").unwrap()); + assert_eq!(hash, CryptoHash::from_str("8t6f63ezCoqS2nNxT7KivhvHH5tvNND4dj7RY3Hwhn64").unwrap()); assert_eq!(count_utc, 1); } @@ -54,12 +54,12 @@ fn build_chain() { #[cfg(feature = "nightly_protocol")] assert_eq!( prev_hash, - CryptoHash::from_str("299HrY4hpubeFXa3V9DNtR36dGEtiz4AVfMbfL6hT2sq").unwrap() + CryptoHash::from_str("4jTD7SXoyvFiLmKkVDuP6jEdDZhuWQAqjb2C1Ba4Uynu").unwrap() ); #[cfg(not(feature = "nightly_protocol"))] assert_eq!( prev_hash, - CryptoHash::from_str("BkRwcuuVjS86zNvP8DDC9FzsJfWQLV92YyX7NCAz3TNu").unwrap() + CryptoHash::from_str("DcfBcEHCh9Jd3gbgU8KNuP9kcN4WxyfonpMAq7jAmgaC").unwrap() ); for i in 0..4 { @@ -77,12 +77,12 @@ fn build_chain() { #[cfg(feature = "nightly_protocol")] assert_eq!( chain.head().unwrap().last_block_hash, - CryptoHash::from_str("A1ZqLuyanSg6YeD3HxGco2tJYEAsmHvAva5n4dsPTgij").unwrap() + CryptoHash::from_str("43BEyYbBJr9gG868PsGj7ikYdKGmX42jTSuZghpNUQ7L").unwrap() ); #[cfg(not(feature = "nightly_protocol"))] assert_eq!( chain.head().unwrap().last_block_hash, - CryptoHash::from_str("8FkFyWKsnAvAEVAwR41GFTY9i9eQnvGCm52FCYR7qEhy").unwrap() + CryptoHash::from_str("5DDPykKCvGKTpSi5YSgzw8UY5BB18JaxNs5218hWwfN7").unwrap() ); } diff --git a/nearcore/res/genesis_config.json b/nearcore/res/genesis_config.json index 6b7759b51ab..2380d208db4 100644 --- a/nearcore/res/genesis_config.json +++ b/nearcore/res/genesis_config.json @@ -1,5 +1,5 @@ { - "protocol_version": 52, + "protocol_version": 53, "genesis_time": "1970-01-01T00:00:00.000000000Z", "chain_id": "sample", "genesis_height": 0, From a041362710c5b4eea103c39e2c29b9621478f0db Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 18 Mar 2022 15:08:30 +0100 Subject: [PATCH 7/7] Update nightly_protocol hashes --- chain/chain/src/tests/simple_chain.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chain/chain/src/tests/simple_chain.rs b/chain/chain/src/tests/simple_chain.rs index fa69126eac0..cbb8dc5dfae 100644 --- a/chain/chain/src/tests/simple_chain.rs +++ b/chain/chain/src/tests/simple_chain.rs @@ -25,7 +25,7 @@ fn empty_chain() { let hash = chain.head().unwrap().last_block_hash; // The hashes here will have to be modified after each change to genesis file. #[cfg(feature = "nightly_protocol")] - assert_eq!(hash, CryptoHash::from_str("A66sjdBrMzMi96tuaQXTBDAaePUDxYCo2qSBGCzHTMgb").unwrap()); + assert_eq!(hash, CryptoHash::from_str("2VFkBfWwcTqyVJ83zy78n5WUNadwGuJbLc2KEp9SJ8dV").unwrap()); #[cfg(not(feature = "nightly_protocol"))] assert_eq!(hash, CryptoHash::from_str("8t6f63ezCoqS2nNxT7KivhvHH5tvNND4dj7RY3Hwhn64").unwrap()); assert_eq!(count_utc, 1); @@ -54,7 +54,7 @@ fn build_chain() { #[cfg(feature = "nightly_protocol")] assert_eq!( prev_hash, - CryptoHash::from_str("4jTD7SXoyvFiLmKkVDuP6jEdDZhuWQAqjb2C1Ba4Uynu").unwrap() + CryptoHash::from_str("299HrY4hpubeFXa3V9DNtR36dGEtiz4AVfMbfL6hT2sq").unwrap() ); #[cfg(not(feature = "nightly_protocol"))] assert_eq!( @@ -77,7 +77,7 @@ fn build_chain() { #[cfg(feature = "nightly_protocol")] assert_eq!( chain.head().unwrap().last_block_hash, - CryptoHash::from_str("43BEyYbBJr9gG868PsGj7ikYdKGmX42jTSuZghpNUQ7L").unwrap() + CryptoHash::from_str("A1ZqLuyanSg6YeD3HxGco2tJYEAsmHvAva5n4dsPTgij").unwrap() ); #[cfg(not(feature = "nightly_protocol"))] assert_eq!(