mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-06-18 03:38:57 +08:00
DRY up HELIUM_BLOCK_LIMIT
This commit is contained in:
@@ -59,6 +59,7 @@ use chainstate::stacks::boot::{STACKS_BOOT_CODE_MAINNET, STACKS_BOOT_CODE_TESTNE
|
||||
use util::boot::{boot_code_addr, boot_code_id};
|
||||
|
||||
use core::BLOCK_LIMIT_MAINNET;
|
||||
use core::HELIUM_BLOCK_LIMIT;
|
||||
|
||||
use serde::Serialize;
|
||||
use serde_json::json;
|
||||
@@ -89,15 +90,6 @@ macro_rules! panic_test {
|
||||
};
|
||||
}
|
||||
|
||||
const HELIUM_BLOCK_LIMIT: ExecutionCost = ExecutionCost {
|
||||
write_length: 15_0_000_000,
|
||||
write_count: 5_0_000,
|
||||
read_length: 1_000_000_000,
|
||||
read_count: 5_0_000,
|
||||
// allow much more runtime in helium blocks than mainnet
|
||||
runtime: 100_000_000_000,
|
||||
};
|
||||
|
||||
#[cfg_attr(tarpaulin, skip)]
|
||||
fn print_usage(invoked_by: &str) {
|
||||
eprintln!(
|
||||
|
||||
@@ -121,6 +121,15 @@ pub const BLOCK_LIMIT_MAINNET: ExecutionCost = ExecutionCost {
|
||||
runtime: 5_000_000_000,
|
||||
};
|
||||
|
||||
pub const HELIUM_BLOCK_LIMIT: ExecutionCost = ExecutionCost {
|
||||
write_length: 15_0_000_000,
|
||||
write_count: 5_0_000,
|
||||
read_length: 1_000_000_000,
|
||||
read_count: 5_0_000,
|
||||
// allow much more runtime in helium blocks than mainnet
|
||||
runtime: 100_000_000_000,
|
||||
};
|
||||
|
||||
pub const FAULT_DISABLE_MICROBLOCKS_COST_CHECK: &str = "MICROBLOCKS_DISABLE_COST_CHECK";
|
||||
pub const FAULT_DISABLE_MICROBLOCKS_BYTES_CHECK: &str = "MICROBLOCKS_DISABLE_BYTES_CHECK";
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ use rand::RngCore;
|
||||
use stacks::burnchains::bitcoin::BitcoinNetworkType;
|
||||
use stacks::burnchains::{MagicBytes, BLOCKSTACK_MAGIC_MAINNET};
|
||||
use stacks::core::{
|
||||
BLOCK_LIMIT_MAINNET, CHAIN_ID_MAINNET, CHAIN_ID_TESTNET, PEER_VERSION_MAINNET,
|
||||
PEER_VERSION_TESTNET,
|
||||
BLOCK_LIMIT_MAINNET, CHAIN_ID_MAINNET, CHAIN_ID_TESTNET, HELIUM_BLOCK_LIMIT,
|
||||
PEER_VERSION_MAINNET, PEER_VERSION_TESTNET,
|
||||
};
|
||||
use stacks::net::connection::ConnectionOptions;
|
||||
use stacks::net::{Neighbor, NeighborKey, PeerAddress};
|
||||
@@ -408,15 +408,6 @@ lazy_static! {
|
||||
};
|
||||
}
|
||||
|
||||
pub const HELIUM_BLOCK_LIMIT: ExecutionCost = ExecutionCost {
|
||||
write_length: 15_0_000_000,
|
||||
write_count: 5_0_000,
|
||||
read_length: 1_000_000_000,
|
||||
read_count: 5_0_000,
|
||||
// allow much more runtime in helium blocks than mainnet
|
||||
runtime: 100_000_000_000,
|
||||
};
|
||||
|
||||
impl Config {
|
||||
pub fn from_config_file(config_file: ConfigFile) -> Config {
|
||||
let default_node_config = NodeConfig::default();
|
||||
|
||||
@@ -132,7 +132,7 @@ fn set_processed_counter(blocks_processed: &BlocksProcessedCounter, value: u64)
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
fn set_processed_counter(_blocks_processed: &BlocksProcessedCounter, value: u64) {}
|
||||
fn set_processed_counter(_blocks_processed: &BlocksProcessedCounter, _value: u64) {}
|
||||
|
||||
/// Process artifacts from the tenure.
|
||||
/// At this point, we're modifying the chainstate, and merging the artifacts from the previous tenure.
|
||||
|
||||
Reference in New Issue
Block a user