1

In a Parity chain spec file, how can I include EIP100?

I do not see it in the default file here to copy: https://github.com/paritytech/parity/blob/master/ethcore/res/ethereum/foundation.json

I think I simply add:

"eip100Transition":

Or is it eip100dTransition? with a "d"?

Can someone confirm?

2

Seems to be eip100bTransition in Parity. See here for where the calculation is implemented in the code.

parity/ethcore/src/ethereum/ethash.rs line 369:

let (increment_divisor, threshold) = if header.number() < self.ethash_params.eip100b_transition {
    (self.ethash_params.difficulty_increment_divisor, 1)
} else if parent_has_uncles {
    (self.ethash_params.metropolis_difficulty_increment_divisor, 2)
} else {
    (self.ethash_params.metropolis_difficulty_increment_divisor, 1)
};
  • Thank you. Now I also know a way of searching a Github codebase (without downloading and grep-ing) so thank you again. – stone.212 Nov 1 '17 at 12:05
1

For public networks, the eipxxx declarations are of the form (for example):

"eip140Transition": 4370000,
"eip211Transition": 4370000,
"eip214Transition": 4370000,
"eip658Transition": 4370000,

That is, you declare the transition and the block at which the transition occurred. (Block 4370000 equates to the Byzantium hard fork.)

In the code you can then use eipxxx in conditionals to execute code-paths that will change after the transitions (by comparing with the current block number).


Back to eip100Transition. Firstly, it's not clear to me that the code for EIP-100 has actually been completed/committed. eip100Transition isn't used anywhere in either the Parity or Geth codebase.

Secondly, in a private network, which won't have the hard forks that the public network did, there's no need to include the EIP transitions. You can just define the code the behave how you want it to behave. Also, I believe setting the eipxxx entries to 0 will cause your chain to work as if the transition has already happened. (i.e. The transition "occurred" at block 0, so all subsequent blocks are considered after the transition.)

  • Seems to be eip100bTransition in Parity. See here for where it is used. – benjaminion Oct 31 '17 at 18:41
  • @benjaminion I agree and I saw it in the Parity code. I guess your second opinion counts as confirmation. If you make it an answer, I will mark it correct. – stone.212 Nov 1 '17 at 1:07
  • @Richard Horrocks Thank you for replying. That was educational and weeks ago I would not have known most of what you wrote. But your answer doesn't speak to my question which was "is it eip100dTransition? with a "d"?" However, user benjaminion did answer so all is well. – stone.212 Nov 1 '17 at 1:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.