Fixed kovan chain validation (#6758)
* Fixed kovan chain validation * Fork detection * Fixed typo
This commit is contained in:
parent
190c1dcede
commit
b0c15497e1
@ -33,8 +33,11 @@
|
|||||||
"maximumExtraDataSize": "0x20",
|
"maximumExtraDataSize": "0x20",
|
||||||
"minGasLimit": "0x1388",
|
"minGasLimit": "0x1388",
|
||||||
"networkID" : "0x2A",
|
"networkID" : "0x2A",
|
||||||
|
"forkBlock": 4297256,
|
||||||
|
"forkCanonHash": "0x0a66d93c2f727dca618fabaf70c39b37018c73d78b939d8b11efbbd09034778f",
|
||||||
"validateReceiptsTransition" : 1000000,
|
"validateReceiptsTransition" : 1000000,
|
||||||
"eip155Transition": 1000000
|
"eip155Transition": 1000000,
|
||||||
|
"validateChainIdTransition": 1000000
|
||||||
},
|
},
|
||||||
"genesis": {
|
"genesis": {
|
||||||
"seal": {
|
"seal": {
|
||||||
|
@ -351,7 +351,9 @@ impl EthereumMachine {
|
|||||||
None => true,
|
None => true,
|
||||||
};
|
};
|
||||||
|
|
||||||
let chain_id = if header.number() >= self.params().eip155_transition {
|
let chain_id = if header.number() < self.params().validate_chain_id_transition {
|
||||||
|
t.chain_id()
|
||||||
|
} else if header.number() >= self.params().eip155_transition {
|
||||||
Some(self.params().chain_id)
|
Some(self.params().chain_id)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
@ -85,6 +85,8 @@ pub struct CommonParams {
|
|||||||
pub eip155_transition: BlockNumber,
|
pub eip155_transition: BlockNumber,
|
||||||
/// Validate block receipts root.
|
/// Validate block receipts root.
|
||||||
pub validate_receipts_transition: BlockNumber,
|
pub validate_receipts_transition: BlockNumber,
|
||||||
|
/// Validate transaction chain id.
|
||||||
|
pub validate_chain_id_transition: BlockNumber,
|
||||||
/// Number of first block where EIP-86 (Metropolis) rules begin.
|
/// Number of first block where EIP-86 (Metropolis) rules begin.
|
||||||
pub eip86_transition: BlockNumber,
|
pub eip86_transition: BlockNumber,
|
||||||
/// Number of first block where EIP-140 (Metropolis: REVERT opcode) rules begin.
|
/// Number of first block where EIP-140 (Metropolis: REVERT opcode) rules begin.
|
||||||
@ -153,7 +155,7 @@ impl CommonParams {
|
|||||||
self.validate_receipts_transition != 0 && self.eip86_transition != 0 &&
|
self.validate_receipts_transition != 0 && self.eip86_transition != 0 &&
|
||||||
self.eip140_transition != 0 && self.eip210_transition != 0 &&
|
self.eip140_transition != 0 && self.eip210_transition != 0 &&
|
||||||
self.eip211_transition != 0 && self.eip214_transition != 0 &&
|
self.eip211_transition != 0 && self.eip214_transition != 0 &&
|
||||||
self.dust_protection_transition != 0
|
self.validate_chain_id_transition != 0 && self.dust_protection_transition != 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,6 +180,7 @@ impl From<ethjson::spec::Params> for CommonParams {
|
|||||||
eip98_transition: p.eip98_transition.map_or(0, Into::into),
|
eip98_transition: p.eip98_transition.map_or(0, Into::into),
|
||||||
eip155_transition: p.eip155_transition.map_or(0, Into::into),
|
eip155_transition: p.eip155_transition.map_or(0, Into::into),
|
||||||
validate_receipts_transition: p.validate_receipts_transition.map_or(0, Into::into),
|
validate_receipts_transition: p.validate_receipts_transition.map_or(0, Into::into),
|
||||||
|
validate_chain_id_transition: p.validate_chain_id_transition.map_or(0, Into::into),
|
||||||
eip86_transition: p.eip86_transition.map_or(
|
eip86_transition: p.eip86_transition.map_or(
|
||||||
BlockNumber::max_value(),
|
BlockNumber::max_value(),
|
||||||
Into::into,
|
Into::into,
|
||||||
|
@ -58,6 +58,9 @@ pub struct Params {
|
|||||||
#[serde(rename="eip155Transition")]
|
#[serde(rename="eip155Transition")]
|
||||||
pub eip155_transition: Option<Uint>,
|
pub eip155_transition: Option<Uint>,
|
||||||
/// See `CommonParams` docs.
|
/// See `CommonParams` docs.
|
||||||
|
#[serde(rename="validateChainIdTransition")]
|
||||||
|
pub validate_chain_id_transition: Option<Uint>,
|
||||||
|
/// See `CommonParams` docs.
|
||||||
#[serde(rename="validateReceiptsTransition")]
|
#[serde(rename="validateReceiptsTransition")]
|
||||||
pub validate_receipts_transition: Option<Uint>,
|
pub validate_receipts_transition: Option<Uint>,
|
||||||
/// See `CommonParams` docs.
|
/// See `CommonParams` docs.
|
||||||
|
Loading…
Reference in New Issue
Block a user