-
Notifications
You must be signed in to change notification settings - Fork 1.7k
EIP-86 #4697
Conversation
ethcore/src/engines/instant_seal.rs
Outdated
fn schedule(&self, _env_info: &EnvInfo) -> Schedule { | ||
Schedule::new_post_eip150(usize::max_value(), true, true, true) | ||
fn schedule(&self, block_number: BlockNumber) -> Schedule { | ||
let eip86 = block_number >= self.params.eip98_transition; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo 86 != 98
ethcore/src/spec/spec.rs
Outdated
@@ -68,6 +70,7 @@ impl From<ethjson::spec::Params> for CommonParams { | |||
min_gas_limit: p.min_gas_limit.into(), | |||
fork_block: if let (Some(n), Some(h)) = (p.fork_block, p.fork_hash) { Some((n.into(), h.into())) } else { None }, | |||
eip98_transition: p.eip98_transition.map_or(0, Into::into), | |||
eip86_transition: p.eip86_transition.map_or(0, Into::into), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it should be u64::max_value()
instead of 0
until we release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to enable this when other metropolis changes are ready.
fn schedule(&self, _env_info: &EnvInfo) -> Schedule { | ||
Schedule::new_post_eip150(usize::max_value(), true, true, true) | ||
fn schedule(&self, block_number: BlockNumber) -> Schedule { | ||
let eip86 = block_number >= self.params.eip98_transition; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also a typo
ethcore/src/ethereum/ethash.rs
Outdated
block_number >= self.ethash_params.eip160_transition, | ||
block_number >= self.ethash_params.eip161abc_transition, | ||
block_number >= self.ethash_params.eip161d_transition, | ||
block_number >= self.params.eip98_transition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here
fn schedule(&self, _env_info: &EnvInfo) -> Schedule { | ||
Schedule::new_post_eip150(usize::max_value(), true, true, true) | ||
fn schedule(&self, block_number: BlockNumber) -> Schedule { | ||
let eip86 = block_number >= self.params.eip98_transition; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh, I'm going to replace it with Schedule::from_params
for DRY after #4757 is merged. https://github.com/ethcore/parity/pull/4757/files#diff-ef2687136b4e032043a492e9e53dcb7cR177
what's the rationale behind |
There's a number of places now where |
Updated with recent EIP changes. |
195dbeb
to
ea479a0
Compare
@@ -241,8 +240,9 @@ impl Engine for AuthorityRound { | |||
] | |||
} | |||
|
|||
fn schedule(&self, _env_info: &EnvInfo) -> Schedule { | |||
Schedule::new_post_eip150(usize::max_value(), true, true, true) | |||
fn schedule(&self, block_number: BlockNumber) -> Schedule { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why &EnvInfo
-> BlockNumber
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a number of places where Schedule is created from the block number number. This PR introduces quite a few more. Creating a fake EnvInfo
struct seems wasteful. And furthermore since all of the data except for the block number is unreliable it may introduce subtle bugs if any future implementation will have to rely on any other field.
ethcore/src/executive.rs
Outdated
From::from(stream.as_raw().sha3()) | ||
}, | ||
CreateContractAddress::FromCodeHash => { | ||
let mut buffer = [0xffu8; 20 + 32]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YP & EIP state that this should be the null sender (i.e. zero address). am i missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ethcore/src/executive.rs
Outdated
) -> evm::Result<U256> where T: Tracer, V: VMTracer { | ||
|
||
// TODO: enable this check once consensus tests are fixed. | ||
//if !overwrite_existing && self.state.exists(¶ms.address) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be enabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enabled now
ethcore/src/executive.rs
Outdated
@@ -365,16 +383,23 @@ impl<'a, B: 'a + StateBackend> Executive<'a, B> { | |||
params: ActionParams, | |||
substate: &mut Substate, | |||
tracer: &mut T, | |||
vm_tracer: &mut V | |||
vm_tracer: &mut V, | |||
_overwrite_existing: bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overwrite existing what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed that param since it is already in the schedule.
rpc/src/v1/impls/light/parity.rs
Outdated
@@ -234,7 +234,7 @@ impl Parity for ParityClient { | |||
Ok( | |||
txq.ready_transactions(chain_info.best_block_number, chain_info.best_block_timestamp) | |||
.into_iter() | |||
.map(Into::into) | |||
.map(|tx| Transaction::from_pending(tx, chain_info.best_block_number, u64::max_value())) //TODO: enable EIP-86 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODOs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
rpc/src/v1/impls/light/parity.rs
Outdated
@@ -245,7 +245,7 @@ impl Parity for ParityClient { | |||
Ok( | |||
txq.future_transactions(chain_info.best_block_number, chain_info.best_block_timestamp) | |||
.into_iter() | |||
.map(Into::into) | |||
.map(|tx| Transaction::from_pending(tx, chain_info.best_block_number, u64::max_value())) //TODO: enable EIP-86 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODOs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
one probable correction needed and a few clarifications. |
needs resolving. |
Implements ethereum/EIPs#208