From 2dde31b4b3a7b6063709ed16d2697b169b63589d Mon Sep 17 00:00:00 2001 From: Herr Seppia Date: Thu, 8 Aug 2024 09:33:10 +0200 Subject: [PATCH] rusk: remove orphan file --- rusk/src/lib/chain.rs | 96 ------------------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 rusk/src/lib/chain.rs diff --git a/rusk/src/lib/chain.rs b/rusk/src/lib/chain.rs deleted file mode 100644 index cf58aa484d..0000000000 --- a/rusk/src/lib/chain.rs +++ /dev/null @@ -1,96 +0,0 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// -// Copyright (c) DUSK NETWORK. All rights reserved. - -mod rusk; -mod vm; - -use std::path::PathBuf; -use std::sync::Arc; -use std::time::Duration; - -use parking_lot::RwLock; -use tokio::sync::broadcast; - -use execution_core::{dusk, Dusk}; -use node::database::rocksdb::Backend; -use node::network::Kadcast; -use rusk_abi::VM; - -use crate::http::RuesEvent; - -#[derive(Debug, Clone, Copy)] -pub struct RuskTip { - pub current: [u8; 32], - pub base: [u8; 32], -} - -#[derive(Clone)] -pub struct Rusk { - pub(crate) tip: Arc>, - pub(crate) vm: Arc, - dir: PathBuf, - pub(crate) generation_timeout: Option, - pub(crate) gas_per_deploy_byte: Option, - pub(crate) feeder_gas_limit: u64, - pub(crate) event_sender: broadcast::Sender, -} - -#[derive(Clone)] -pub struct RuskNode(pub node::Node, Backend, Rusk>); - -impl RuskNode { - pub fn db(&self) -> Arc> { - self.0.database() as Arc> - } - - pub fn network(&self) -> Arc>> { - self.0.network() as Arc>> - } -} - -/// Calculates the value that the coinbase notes should contain. -/// -/// 10% of the reward value goes to the Dusk address (rounded down). -/// 70% of the reward value is considered fixed reward for Block Generator. -/// 10% of the reward value is considered extra reward for Block Generator. -/// 10% of the reward value goes to the all validators/voters of previous block -/// (rounded down). -const fn coinbase_value( - block_height: u64, - dusk_spent: u64, -) -> (Dusk, Dusk, Dusk, Dusk) { - let reward_value = emission_amount(block_height) + dusk_spent; - let one_tenth_reward = reward_value / 10; - - let dusk_value = one_tenth_reward; - let voters_value = one_tenth_reward; - let generator_extra_value = one_tenth_reward; - - let generator_fixed_value = - reward_value - dusk_value - voters_value - generator_extra_value; - - ( - dusk_value, - generator_fixed_value, - generator_extra_value, - voters_value, - ) -} - -/// This implements the emission schedule described in the economic paper. -pub const fn emission_amount(block_height: u64) -> Dusk { - match block_height { - 1..=12_500_000 => dusk(16.0), - 12_500_001..=18_750_000 => dusk(12.8), - 18_750_001..=25_000_000 => dusk(9.6), - 25_000_001..=31_250_000 => dusk(8.0), - 31_250_001..=37_500_000 => dusk(6.4), - 37_500_001..=43_750_000 => dusk(4.8), - 43_750_001..=50_000_000 => dusk(3.2), - 50_000_001..=62_500_000 => dusk(1.6), - _ => dusk(0.0), - } -}