Skip to content
Merged
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
46 changes: 32 additions & 14 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "Diamond Node"
name = "diamond-node"
# NOTE Make sure to update util/version/Cargo.toml as well
version = "4.0.2"
version = "4.0.3-rc1"
license = "GPL-3.0"
authors = [
"bit.diamonds developers",
Expand Down
2 changes: 1 addition & 1 deletion bin/oe/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ impl Configuration {

if let Some(dec) = self.args.arg_min_gas_price {
return Ok(GasPricerConfig::Fixed(U256::from(dec)));
} else if self.chain()? != SpecType::Foundation {
} else if self.chain()? != SpecType::Ethereum {
return Ok(GasPricerConfig::Fixed(U256::zero()));
}

Expand Down
16 changes: 12 additions & 4 deletions bin/oe/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ use crate::configuration;
#[derive(Debug, PartialEq, Default)]
pub enum SpecType {
#[default]
Foundation,
Diamond,
DiamondTestnet,
Ethereum,
Poanet,
Xdai,
Volta,
Expand All @@ -64,7 +66,9 @@ impl str::FromStr for SpecType {

fn from_str(s: &str) -> Result<Self, Self::Err> {
let spec = match s {
"eth" | "ethereum" | "foundation" | "mainnet" => SpecType::Foundation,
"diamond" | "dmd" => SpecType::Diamond,
"diamond-testnet" | "dmd-testnet" => SpecType::DiamondTestnet,
"eth" | "ethereum" | "foundation" | "mainnet" => SpecType::Ethereum,
"poanet" | "poacore" => SpecType::Poanet,
"xdai" => SpecType::Xdai,
"volta" => SpecType::Volta,
Expand All @@ -90,7 +94,9 @@ impl str::FromStr for SpecType {
impl fmt::Display for SpecType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(match *self {
SpecType::Foundation => "foundation",
SpecType::Diamond => "diamond",
SpecType::DiamondTestnet => "diamond-testnet",
SpecType::Ethereum => "ethereum",
SpecType::Poanet => "poanet",
SpecType::Xdai => "xdai",
SpecType::Volta => "volta",
Expand All @@ -116,7 +122,9 @@ impl SpecType {
pub fn spec<'a, T: Into<SpecParams<'a>>>(&self, params: T) -> Result<Spec, String> {
let params = params.into();
match *self {
SpecType::Foundation => Ok(ethereum::new_foundation(params)),
SpecType::Ethereum => Ok(ethereum::new_ethereum(params)),
SpecType::Diamond => Ok(ethereum::new_diamond(params)),
SpecType::DiamondTestnet => Ok(ethereum::new_diamond_testnet(params)),
SpecType::Poanet => Ok(ethereum::new_poanet(params)),
SpecType::Xdai => Ok(ethereum::new_xdai(params)),
SpecType::Volta => Ok(ethereum::new_volta(params)),
Expand Down
291 changes: 291 additions & 0 deletions crates/ethcore/res/chainspec/diamond-testnet.json

Large diffs are not rendered by default.

304 changes: 304 additions & 0 deletions crates/ethcore/res/chainspec/diamond.json

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions crates/ethcore/src/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,14 @@ impl Importer {

// Check the block isn't so old we won't be able to enact it.
// t_nb 7.1 check if block is older then last pruned block
let best_block_number = client.chain.read().best_block_number();
let (best_block_number, best_block_hash) = {
let chain = client.chain.read();

(chain.best_block_number(), chain.best_block_hash())
};

if client.pruning_info().earliest_state > header.number() {
warn!(target: "client", "Block import failed for #{} ({})\nBlock is ancient (current best block: #{}).", header.number(), header.hash(), best_block_number);
warn!(target: "client", "Block import failed for #{} ({})\nBlock is ancient (current best block: #{} {}).", header.number(), header.hash(), best_block_number, best_block_hash);
bail!("Block is ancient");
}

Expand Down
20 changes: 18 additions & 2 deletions crates/ethcore/src/ethereum/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,26 @@ fn load_machine(b: &[u8]) -> EthereumMachine {
}

/// Create a new Foundation mainnet chain spec.
pub fn new_foundation<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
pub fn new_ethereum<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
load(
params.into(),
include_bytes!("../../res/chainspec/foundation.json"),
include_bytes!("../../res/chainspec/ethereum.json"),
)
}

/// Create a new Foundation mainnet chain spec.
pub fn new_diamond<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
load(
params.into(),
include_bytes!("../../res/chainspec/diamond.json"),
)
}

/// Create a new Foundation mainnet chain spec.
pub fn new_diamond_testnet<'a, T: Into<SpecParams<'a>>>(params: T) -> Spec {
load(
params.into(),
include_bytes!("../../res/chainspec/diamond-testnet.json"),
)
}

Expand Down
2 changes: 1 addition & 1 deletion crates/ethcore/sync/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ impl SyncProtocolHandler {
match send_consensus_result {
Ok(_) => {}
Err(e) => {
info!(target: "consensus", "Error sending cached consensus message to peer (re-adding) {:?}: {:?}", node_id, e);
debug!(target: "consensus", "Error sending cached consensus message to peer (re-adding) {:?}: {:?}", node_id, e);
failed_messages.push(ChainMessageType::Consensus(block, message));
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/vm/builtin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

[dependencies]
bn = { git = "https://github.com/paritytech/bn", default-features = false }
bn = { package = "substrate-bn", git = "https://github.com/dmdcoin/bn", default-features = false }
byteorder = "1.3.2"
eip-152 = { path = "../../util/EIP-152" }
ethereum-types = "0.9.2"
Expand Down
Loading