EIPs 155, 160, 161 (#2976)

* The front-end for each hard-fork, also EIP-160.

* Address EIP161 a/c

* Include EIP-161b

* EIP-161 part d.

* Fix test build.

* Fix one test, add another.

* Fix use of bloom & renaming.

* Initial groundwork for EIP-155

* Fix minor bug.

* Fix all tests finally.

* Rest of EIP-155.

* Add tests for EIP-155 algorithm.

Update transaction tests validation.

* Minor reformat.

* Address grumbles.

* Remove unused code.

* Fix SUICIDE gas mechanism and add consensus tests.

* Remove commented code.

* Set Frontier hardfork block number

* Fix warning.

* Transaction tests,
This commit is contained in:
Gav Wood
2016-11-03 22:22:25 +01:00
committed by GitHub
parent 7e592e5389
commit d3de475205
65 changed files with 652 additions and 232 deletions

View File

@@ -25,7 +25,7 @@ port = 30303
min_peers = 25
max_peers = 50
nat = "any"
id = "0x1"
id = 1
bootnodes = []
discovery = true
warp = true

View File

@@ -46,7 +46,7 @@ usage! {
flag_testnet: bool,
flag_import_geth_keys: bool,
flag_datadir: Option<String>,
flag_networkid: Option<String>,
flag_networkid: Option<usize>,
flag_peers: Option<u16>,
flag_nodekey: Option<String>,
flag_nodiscover: bool,
@@ -122,7 +122,7 @@ usage! {
or |c: &Config| otry!(c.network).nat.clone(),
flag_allow_ips: String = "all",
or |c: &Config| otry!(c.network).allow_ips.clone(),
flag_network_id: Option<String> = None,
flag_network_id: Option<usize> = None,
or |c: &Config| otry!(c.network).id.clone().map(Some),
flag_bootnodes: Option<String> = None,
or |c: &Config| otry!(c.network).bootnodes.clone().map(|vec| Some(vec.join(","))),
@@ -323,7 +323,7 @@ struct Network {
max_pending_peers: Option<u16>,
nat: Option<String>,
allow_ips: Option<String>,
id: Option<String>,
id: Option<usize>,
bootnodes: Option<Vec<String>>,
discovery: Option<bool>,
node_key: Option<String>,
@@ -530,7 +530,7 @@ mod tests {
flag_snapshot_peers: 0u16,
flag_allow_ips: "all".into(),
flag_nat: "any".into(),
flag_network_id: Some("0x1".into()),
flag_network_id: Some(1),
flag_bootnodes: Some("".into()),
flag_no_discovery: false,
flag_node_key: None,

View File

@@ -5,5 +5,6 @@ License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
By Wood/Paronyan/Kotewicz/Drwięga/Volf.
By Wood/Paronyan/Kotewicz/Drwięga/Volf
Habermeier/Czaban/Greeff/Gotchac/Redmann

View File

@@ -86,7 +86,7 @@ impl Configuration {
let http_conf = try!(self.http_config());
let ipc_conf = try!(self.ipc_config());
let net_conf = try!(self.net_config());
let network_id = try!(self.network_id());
let network_id = self.network_id();
let cache_config = self.cache_config();
let spec = try!(self.chain().parse());
let tracing = try!(self.args.flag_tracing.parse());
@@ -517,12 +517,8 @@ impl Configuration {
Ok(ret)
}
fn network_id(&self) -> Result<Option<U256>, String> {
let net_id = self.args.flag_network_id.as_ref().or(self.args.flag_networkid.as_ref());
match net_id {
Some(id) => Ok(Some(try!(to_u256(id)))),
None => Ok(None),
}
fn network_id(&self) -> Option<usize> {
self.args.flag_network_id.or(self.args.flag_networkid)
}
fn rpc_apis(&self) -> String {

View File

@@ -20,7 +20,7 @@ use ctrlc::CtrlC;
use fdlimit::raise_fd_limit;
use ethcore_rpc::{NetworkSettings, is_major_importing};
use ethsync::NetworkConfiguration;
use util::{Colour, version, U256, RotatingLogger};
use util::{Colour, version, RotatingLogger};
use io::{MayPanic, ForwardPanic, PanicHandler};
use ethcore_logger::{Config as LogConfig};
use ethcore::client::{Mode, DatabaseCompactionProfile, VMType, ChainNotify, BlockChainClient};
@@ -70,7 +70,7 @@ pub struct RunCmd {
pub http_conf: HttpConfiguration,
pub ipc_conf: IpcConfiguration,
pub net_conf: NetworkConfiguration,
pub network_id: Option<U256>,
pub network_id: Option<usize>,
pub warp_sync: bool,
pub acc_conf: AccountsConfig,
pub gas_pricer: GasPricerConfig,