Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions ethcore/res/ethereum/callisto.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"name": "Callisto",
"dataDir": "callisto",
"engine": {
"Ethash": {
"params": {
"minimumDifficulty": "0x020000",
"difficultyBoundDivisor": "0x0800",
"durationLimit": "0x0d",
"blockReward": "0x16c4abbebea0100000",
"homesteadTransition": 0,
"callistoTransition": 0,
"callistoTreasuryAddress": "0x74682Fc32007aF0b6118F259cBe7bCCC21641600",
"callistoTreasuryReward": "0x68155a43676e00000",
"callistoStakeAddress": "0x3c06f218Ce6dD8E2c535a8925A2eDF81674984D9",
"callistoStakeReward": "0x340aad21b3b700000",
"eip649Reward": "0x16c4abbebea0100000",
"eip100bTransition": 20,
"eip649Transition": 20
}
}
},
"params": {
"gasLimitBoundDivisor": "0x0400",
"registrar": "0x0000000000000000000000000000000000000000",
"accountStartNonce": "0x00",
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID": "0x1",
"chainID": "0x0334",
"maxCodeSize": 24576,
"maxCodeSizeTransition": 10,
"eip150Transition": 0,
"eip160Transition": 10,
"eip161abcTransition": 10,
"eip161dTransition": 10,
"eip155Transition": 10,
"eip98Transition": "0xffffffffffffffff",
"eip140Transition": 20,
"eip211Transition": 20,
"eip214Transition": 20,
"eip658Transition": 20
},
"genesis": {
"seal": {
"ethereum": {
"nonce": "0x0000000000000000",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"difficulty": "0x080000",
"author": "0xc3F70b10CE5EC4aA47ce44Eb0B7900A883cd45Dd",
"timestamp": "0x5a939845",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x0000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x09eb100",
"stateRoot": "0x2255c10db0a0f392ca63b1a3ca149e226f6bbf195c04a6ce4a077f9f02ffbace"
},
"nodes": [
"enode://ab0d9fe81f23653c3217303d3a4bc035be908b05f8b12d6f155ab4598d7760cfea1e009e414771279c9ffc3499950283afaabe099a5329c5a6013f57d77de0a6@104.236.96.118:30303",
"enode://9e2d9dc2639e02893aa17c80e6ba8e8803fd3166083b622a841fc852161112720281514436f7605c89041d5efa1738215185c4c4024ff812b0f500c403cc0ab1@206.189.47.198:30303",
"enode://149ba679e8851c3e0d030e0dc0336984b97c83ef649e68ec113dcf266449364cc1ec8ee27950f71b00c2182ef504894fa7bff19f6741978ced67e9e4b6536d2a@206.189.45.31:30303",
"enode://2038f895f0870f76456a879b97a276135418295ff9f6e24b6de11225360adc87d3aa6d90302aafb36a4cd9542eaf0f160ae48439da938d7e3031d838ef11b8e8@13.125.216.165:30303",
"enode://b292d40b86dc73b42b0da20b146957e5a06a4f09b2d77b26d07ca34a0e7b5f06972e1b589722b1b3591c8126b61d40d88a1ee32990451e2baa9df563d34668e4@13.125.242.67:30303",
"enode://ae7b2bfa18c137b8f4e4a3f1485d734b40198531916bcf59637bc09ad6b4e310d1077d9bd8f5aa7d8271b97673e28595e73d81b7b8c9a862c78f11fb8aa4f6a0@13.125.194.99:30303",
"enode://09fdeea69fce23dd021d9db2930e508c1a0741c56a0ae7efceb0203a562838412dd389ff94bc3b5b888eec7a16bd1960734efc551ffbb95ad72b698a9105e5d4@13.209.49.184:30303",
"enode://8285433aecaf42dc9372bff4d44f119cc58db93b5caa169f8763db777112cd55a2d6a18370560cfad8b78196fe8c9f39ec7e30bdba274bc74c11f152028e6980@52.78.148.64:30303"
],
"accounts": {
"0000000000000000000000000000000000000001": { "balance": "1", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } },
"0000000000000000000000000000000000000002": { "balance": "1", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } },
"0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
"0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
"0000000000000000000000000000000000000005": { "balance": "1", "builtin": { "name": "modexp", "activate_at": 20, "pricing": { "modexp": { "divisor": 20 } } } },
"0000000000000000000000000000000000000006": { "balance": "1", "builtin": { "name": "alt_bn128_add", "activate_at": 20, "pricing": { "linear": { "base": 500, "word": 0 } } } },
"0000000000000000000000000000000000000007": { "balance": "1", "builtin": { "name": "alt_bn128_mul", "activate_at": 20, "pricing": { "linear": { "base": 40000, "word": 0 } } } },
"0000000000000000000000000000000000000008": { "balance": "1", "builtin": { "name": "alt_bn128_pairing", "activate_at": 20, "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } },
"183394f52b2c8c034835edba3bcececa6f60b5a8": {
"balance": "100491852286952719463755404"
}
}
}
30 changes: 30 additions & 0 deletions ethcore/src/ethereum/ethash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,16 @@ 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 @@ -158,6 +168,11 @@ impl From<ethjson::spec::EthashParams> for EthashParams {
eip649_reward: p.eip649_reward.map(Into::into),
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 @@ -287,6 +302,16 @@ impl Engine<EthereumMachine> for Arc<Ethash> {
rewards.push((ubi_contract, RewardKind::External, ubi_reward));
rewards.push((dev_contract, RewardKind::External, dev_reward));

} else if number >= self.ethash_params.callisto_transition {
let treasury_address = self.ethash_params.callisto_treasury_address;
let treasury_reward = self.ethash_params.callisto_treasury_reward;
let stake_address = self.ethash_params.callisto_stake_address;
let stake_reward = self.ethash_params.callisto_stake_reward;

rewards.push((author, RewardKind::Author, result_block_reward));
rewards.push((treasury_address, RewardKind::External, treasury_reward));
rewards.push((stake_address, RewardKind::External, stake_reward));

} else {
rewards.push((author, RewardKind::Author, result_block_reward));
}
Expand Down Expand Up @@ -537,6 +562,11 @@ mod tests {
mcip3_ubi_contract: "0000000000000000000000000000000000000001".into(),
mcip3_dev_reward: 0.into(),
mcip3_dev_contract: "0000000000000000000000000000000000000001".into(),
callisto_transition: u64::max_value(),
callisto_treasury_address: "0000000000000000000000000000000000000001".into(),
callisto_treasury_reward: 0.into(),
callisto_stake_address: "0000000000000000000000000000000000000001".into(),
callisto_stake_reward: 0.into(),
eip649_transition: u64::max_value(),
eip649_delay: 3_000_000,
eip649_reward: None,
Expand Down
5 changes: 5 additions & 0 deletions ethcore/src/ethereum/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ pub fn new_sokol<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
load(params.into(), include_bytes!("../../res/ethereum/poasokol.json"))
}

/// Create a new Callisto chaun spec
pub fn new_callisto<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
load(params.into(), include_bytes!("../../res/ethereum/callisto.json"))
}

// For tests

/// Create a new Foundation Frontier-era chain spec as though it never changes to Homestead.
Expand Down
30 changes: 30 additions & 0 deletions json/src/spec/ethash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,26 @@ 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 @@ -247,6 +267,11 @@ mod tests {
eip649_reward: None,
expip2_transition: None,
expip2_duration_limit: None,
callisto_transition: None,
callisto_treasury_address: None,
callisto_treasury_reward: None,
callisto_stake_address: None,
callisto_stake_reward: None,
}
});
}
Expand Down Expand Up @@ -294,6 +319,11 @@ mod tests {
eip649_reward: None,
expip2_transition: None,
expip2_duration_limit: None,
callisto_transition: None,
callisto_treasury_address: None,
callisto_treasury_reward: None,
callisto_stake_address: None,
callisto_stake_reward: None,
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion parity/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ usage! {

ARG arg_chain: (String) = "foundation", or |c: &Config| c.parity.as_ref()?.chain.clone(),
"--chain=[CHAIN]",
"Specify the blockchain type. CHAIN may be either a JSON chain specification file or ethereum, classic, poacore, tobalaba, expanse, musicoin, ellaism, easthub, social, olympic, morden, ropsten, kovan, poasokol, testnet, or dev.",
"Specify the blockchain type. CHAIN may be either a JSON chain specification file or ethereum, classic, poacore, tobalaba, expanse, musicoin, ellaism, easthub, social, callisto, olympic, morden, ropsten, kovan, poasokol, testnet, or dev.",

ARG arg_keys_path: (String) = "$BASE/keys", or |c: &Config| c.parity.as_ref()?.keys_path.clone(),
"--keys-path=[PATH]",
Expand Down
6 changes: 6 additions & 0 deletions parity/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub enum SpecType {
Ellaism,
Easthub,
Social,
Callisto,
Olympic,
Morden,
Ropsten,
Expand Down Expand Up @@ -69,6 +70,7 @@ impl str::FromStr for SpecType {
"ellaism" => SpecType::Ellaism,
"easthub" => SpecType::Easthub,
"social" => SpecType::Social,
"callisto" => SpecType::Callisto,
"olympic" => SpecType::Olympic,
"morden" | "classic-testnet" => SpecType::Morden,
"ropsten" => SpecType::Ropsten,
Expand All @@ -93,6 +95,7 @@ impl fmt::Display for SpecType {
SpecType::Ellaism => "ellaism",
SpecType::Easthub => "easthub",
SpecType::Social => "social",
SpecType::Callisto => "callisto",
SpecType::Olympic => "olympic",
SpecType::Morden => "morden",
SpecType::Ropsten => "ropsten",
Expand All @@ -117,6 +120,7 @@ impl SpecType {
SpecType::Ellaism => Ok(ethereum::new_ellaism(params)),
SpecType::Easthub => Ok(ethereum::new_easthub(params)),
SpecType::Social => Ok(ethereum::new_social(params)),
SpecType::Callisto => Ok(ethereum::new_callisto(params)),
SpecType::Olympic => Ok(ethereum::new_olympic(params)),
SpecType::Morden => Ok(ethereum::new_morden(params)),
SpecType::Ropsten => Ok(ethereum::new_ropsten(params)),
Expand Down Expand Up @@ -370,6 +374,7 @@ mod tests {
assert_eq!(SpecType::Ellaism, "ellaism".parse().unwrap());
assert_eq!(SpecType::Easthub, "easthub".parse().unwrap());
assert_eq!(SpecType::Social, "social".parse().unwrap());
assert_eq!(SpecType::Callisto, "callisto".parse().unwrap());
assert_eq!(SpecType::Olympic, "olympic".parse().unwrap());
assert_eq!(SpecType::Morden, "morden".parse().unwrap());
assert_eq!(SpecType::Morden, "classic-testnet".parse().unwrap());
Expand All @@ -396,6 +401,7 @@ mod tests {
assert_eq!(format!("{}", SpecType::Ellaism), "ellaism");
assert_eq!(format!("{}", SpecType::Easthub), "easthub");
assert_eq!(format!("{}", SpecType::Social), "social");
assert_eq!(format!("{}", SpecType::Callisto), "callisto");
assert_eq!(format!("{}", SpecType::Olympic), "olympic");
assert_eq!(format!("{}", SpecType::Morden), "morden");
assert_eq!(format!("{}", SpecType::Ropsten), "ropsten");
Expand Down