Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Remove ethash params
Browse files Browse the repository at this point in the history
  • Loading branch information
yograterol committed Oct 11, 2018
1 parent b4f011f commit 0bc511e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 50 deletions.
5 changes: 0 additions & 5 deletions ethcore/res/ethereum/callisto.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
"durationLimit": "0x0d",
"blockReward": "0x16c4abbebea0100000",
"homesteadTransition": 0,
"callistoTransition": 0,
"callistoTreasuryAddress": "0x74682Fc32007aF0b6118F259cBe7bCCC21641600",
"callistoTreasuryReward": "0x68155a43676e00000",
"callistoStakeAddress": "0x3c06f218Ce6dD8E2c535a8925A2eDF81674984D9",
"callistoStakeReward": "0x340aad21b3b700000",
"blockRewardContractCode": "0x6080604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663f91c28988114610045575b600080fd5b34801561005157600080fd5b50610071602460048035828101929082013591813591820191013561010a565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156100b557818101518382015260200161009d565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156100f45781810151838201526020016100dc565b5050505090500194505050505060405180910390f35b606080808060008080803373fffffffffffffffffffffffffffffffffffffffe1461013457600080fd5b8a891461014057600080fd5b604080516003808252608082019092529060208201606080388339505060408051600380825260808201909252929850905060208201606080388339019050509450733c06f218ce6dd8e2c535a8925a2edf81674984d98660018151811015156101a657fe5b73ffffffffffffffffffffffffffffffffffffffff9092166020928302909101909101528451680340aad21b3b70000090869060019081106101e457fe5b6020908102909101015285517374682fc32007af0b6118f259cbe7bccc21641600908790600290811061021357fe5b73ffffffffffffffffffffffffffffffffffffffff909216602092830290910190910152845168068155a43676e00000908690600290811061025157fe5b60209081029091010152600093505b8a8410156103ce5789898581811061027457fe5b9050602002013561ffff1661ffff16600014156103235767b6255df5f50080006000198c01026816c4abbebea01000000192508b8b858181106102b357fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168660008151811015156102df57fe5b73ffffffffffffffffffffffffffffffffffffffff909216602092830290910190910152845183908690600090811061031457fe5b602090810290910101526103c3565b60648a8a8681811061033157fe5b9050602002013561ffff1661ffff161015156103c35760648a8a8681811061035557fe5b9050602002013561ffff1603915060038260080361ffff166816c4abbebea0100000029060020a900490506103b4868d8d87818110151561039257fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff166103e0565b95506103c085826104b7565b94505b600190930192610260565b50939a92995091975050505050505050565b60608060008451600101604051908082528060200260200182016040528015610413578160200160208202803883390190505b509150600090505b845181101561047657848181518110151561043257fe5b90602001906020020151828281518110151561044a57fe5b73ffffffffffffffffffffffffffffffffffffffff90921660209283029091019091015260010161041b565b8382600184510381518110151561048957fe5b73ffffffffffffffffffffffffffffffffffffffff9290921660209283029190910190910152509392505050565b606080600084516001016040519080825280602002602001820160405280156104ea578160200160208202803883390190505b509150600090505b845181101561053357848181518110151561050957fe5b90602001906020020151828281518110151561052157fe5b602090810290910101526001016104f2565b8382600184510381518110151561054657fe5b60209081029190910101525093925050505600a165627a7a7230582056d78ee4f7397a0950a3692a9e267500e619b5d3eb5937b9142689bc9ee137f10029",
"eip100bTransition": 20,
"difficultyBombDelays": {
Expand Down
33 changes: 18 additions & 15 deletions ethcore/src/ethereum/ethash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,6 @@ pub struct EthashParams {
pub expip2_transition: u64,
/// EXPIP-2 duration limit
pub expip2_duration_limit: u64,
/// Callisto transition block
pub callisto_transition: u64,
/// Callisto Treasury Address
pub callisto_treasury_address: Address,
/// Callisto Treasury reward
pub callisto_treasury_reward: U256,
/// Callisto Stake Address
pub callisto_stake_address: Address,
/// Callisto Stake reward
pub callisto_stake_reward: U256,
/// Block reward contract transition block.
pub block_reward_contract_transition: u64,
/// Block reward contract.
Expand Down Expand Up @@ -160,11 +150,6 @@ impl From<ethjson::spec::EthashParams> for EthashParams {
}),
expip2_transition: p.expip2_transition.map_or(u64::max_value(), Into::into),
expip2_duration_limit: p.expip2_duration_limit.map_or(30, Into::into),
callisto_transition: p.callisto_transition.map_or(u64::max_value(), Into::into),
callisto_treasury_address: p.callisto_treasury_address.map_or_else(Address::new, Into::into),
callisto_treasury_reward: p.callisto_treasury_reward.map_or_else(Default::default, Into::into),
callisto_stake_address: p.callisto_stake_address.map_or_else(Address::new, Into::into),
callisto_stake_reward: p.callisto_stake_reward.map_or_else(Default::default, Into::into),
block_reward_contract_transition: p.block_reward_contract_transition.map_or(0, Into::into),
block_reward_contract: match (p.block_reward_contract_code, p.block_reward_contract_address) {
(Some(code), _) => Some(BlockRewardContract::new_from_code(Arc::new(code.into()))),
Expand Down Expand Up @@ -284,7 +269,25 @@ impl Engine<EthereumMachine> for Arc<Ethash> {
// Bestow block rewards.
let mut result_block_reward = reward + reward.shr(5) * U256::from(n_uncles);

<<<<<<< HEAD
rewards.push((author, RewardKind::Author, result_block_reward));
=======
if number >= self.ethash_params.mcip3_transition {
result_block_reward = self.ethash_params.mcip3_miner_reward;

let ubi_contract = self.ethash_params.mcip3_ubi_contract;
let ubi_reward = self.ethash_params.mcip3_ubi_reward;
let dev_contract = self.ethash_params.mcip3_dev_contract;
let dev_reward = self.ethash_params.mcip3_dev_reward;

rewards.push((author, RewardKind::Author, result_block_reward));
rewards.push((ubi_contract, RewardKind::External, ubi_reward));
rewards.push((dev_contract, RewardKind::External, dev_reward));

} else {
rewards.push((author, RewardKind::Author, result_block_reward));
}
>>>>>>> Remove ethash params

// Bestow uncle rewards.
for u in LiveBlock::uncles(&*block) {
Expand Down
30 changes: 0 additions & 30 deletions json/src/spec/ethash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,26 +115,6 @@ pub struct EthashParams {
/// EXPIP-2 duration limit
#[serde(rename="expip2DurationLimit")]
pub expip2_duration_limit: Option<Uint>,

/// Callisto transition block
#[serde(rename="callistoTransition")]
pub callisto_transition: Option<Uint>,

/// Callisto Treasury Address
#[serde(rename="callistoTreasuryAddress")]
pub callisto_treasury_address: Option<Address>,

/// Callisto Treasury reward
#[serde(rename="callistoTreasuryReward")]
pub callisto_treasury_reward: Option<Uint>,

/// Callisto Stake Address
#[serde(rename="callistoStakeAddress")]
pub callisto_stake_address: Option<Address>,

/// Callisto Stake reward
#[serde(rename="callistoStakeReward")]
pub callisto_stake_reward: Option<Uint>,
}

/// Ethash engine deserialization.
Expand Down Expand Up @@ -240,11 +220,6 @@ mod tests {
expip2_transition: None,
expip2_duration_limit: None,
difficulty_bomb_delays: None,
callisto_transition: None,
callisto_treasury_address: None,
callisto_treasury_reward: None,
callisto_stake_address: None,
callisto_stake_reward: None,
}
});
}
Expand Down Expand Up @@ -284,11 +259,6 @@ mod tests {
expip2_transition: None,
expip2_duration_limit: None,
difficulty_bomb_delays: None,
callisto_transition: None,
callisto_treasury_address: None,
callisto_treasury_reward: None,
callisto_stake_address: None,
callisto_stake_reward: None,
}
});
}
Expand Down

0 comments on commit 0bc511e

Please sign in to comment.