Skip to content

Commit

Permalink
Add igor faucet
Browse files Browse the repository at this point in the history
Updated the igor genesis block to contain a faucet
  • Loading branch information
hansieodendaal committed Mar 30, 2023
1 parent e334a40 commit 9aa8edb
Show file tree
Hide file tree
Showing 7 changed files with 10,469 additions and 83 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions base_layer/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ zeroize = "1"
[dev-dependencies]
tari_p2p = { path = "../../base_layer/p2p", features = ["test-mocks"] }
tari_test_utils = { path = "../../infrastructure/test_utils" }
curve25519-dalek = {git = "https://github.com/tari-project/curve25519-dalek", tag = "v4.0.1", default-features = false, features = ["serde", "alloc"] }

config = { version = "0.13.0" }
env_logger = "0.7.0"
Expand Down
10,267 changes: 10,267 additions & 0 deletions base_layer/core/src/blocks/faucets/igor_faucet.json

Large diffs are not rendered by default.

263 changes: 187 additions & 76 deletions base_layer/core/src/blocks/genesis_block.rs

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions base_layer/core/src/consensus/consensus_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,17 +428,18 @@ impl ConsensusConstants {
pub fn igor() -> Vec<Self> {
let mut algos = HashMap::new();
// sha3/monero to 40/60 split
const MONERO_TARGET_TIME: u64 = 10; // usually 200 for a 120 average block time
algos.insert(PowAlgorithm::Sha3, PowAlgorithmConstants {
max_target_time: 1800,
min_difficulty: 60_000_000.into(),
max_target_time: (MONERO_TARGET_TIME * 15 / 10) * 6, // (monero_target_time x 1.5) x 6
min_difficulty: ((MONERO_TARGET_TIME * 15 / 10) * 200_000).into(), // (monero_target_time x 1.5) x 200_000
max_difficulty: u64::MAX.into(),
target_time: 15,
target_time: MONERO_TARGET_TIME * 15 / 10, // (monero_target_time x 1.5)
});
algos.insert(PowAlgorithm::Monero, PowAlgorithmConstants {
max_target_time: 1200,
min_difficulty: 60_000.into(),
max_target_time: MONERO_TARGET_TIME * 6, // target_time x 6
min_difficulty: (MONERO_TARGET_TIME * 300).into(), // target_time x 300
max_difficulty: u64::MAX.into(),
target_time: 10,
target_time: MONERO_TARGET_TIME,
});
let (input_version_range, output_version_range, kernel_version_range) = version_zero();
vec![ConsensusConstants {
Expand All @@ -458,7 +459,7 @@ impl ConsensusConstants {
emission_tail: 100.into(),
max_randomx_seed_height: u64::MAX,
proof_of_work: algos,
faucet_value: 0.into(),
faucet_value: 3_173_904_756_640_034.into(),
transaction_weight: TransactionWeight::v1(),
max_script_byte_size: 2048,
input_version_range,
Expand Down
4 changes: 4 additions & 0 deletions base_layer/core/src/validation/chain_balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ impl<B: BlockchainBackend> FinalHorizonStateValidation<B> for ChainBalanceValida
total_utxo_sum,
total_burned_sum,
);
println!(
"Emission:{:?}. Offset:{:?}, total kernel: {:?}, height: {}, total_utxo: {:?}, total_burned: {:?}",
emission_h, total_offset, total_kernel_sum, height, total_utxo_sum, total_burned_sum,
);
let input = &(&emission_h + total_kernel_sum) + &total_offset;

if (total_utxo_sum + total_burned_sum) != input {
Expand Down
1 change: 1 addition & 0 deletions base_layer/core/tests/helpers/block_builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ fn print_new_genesis_block(network: Network, extra: &str) {
println!();
println!("{} genesis block", network);
println!();
println!("extra '{}'", extra);
println!(
"kernel excess_sig: public_nonce {} signature {}",
block.body.kernels()[0].excess_sig.get_public_nonce().to_hex(),
Expand Down

0 comments on commit 9aa8edb

Please sign in to comment.