Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork Names Standard EIP #1848

Closed
wants to merge 5 commits into from
Closed
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
67 changes: 67 additions & 0 deletions EIPS/eip-1845.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
eip: <to be assigned>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use 1848.

title: Fork Name Standards
author: DimitryKh <dimitry@ethereum.org>
discussions-to: https://github.com/ethereum/retesteth/issues/23
status: Draft
category: Informational
created: 2019-03-18
---

## Simple Summary
Name forks like `ETH-001-00, ETH-002-00, ETH-003-00` and so on.

## Abstract
Each client parses `ETH-001-00` kind of indexes into ethereum fork rules, the major number increasing for roadmap forks and the minor for other forks. `ETH-001-00` stands for Frontier rules.
Therefore if in any config file instead of `Frontier`, an `ETH-001-00` name provided. The client must parse it as a `Frontier` rule.
Parsing previous naming convention (`Frontier, Homestead, EIP150`) becomes optional. `ETH-xxx-yy` naming convention is mandatory for all clients to implement.

## Motivation
**Clients:**
Different clients use different fork names even for the main network on their genesis config. If we want a generic genesis format, we have to use a standard for the fork names.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correctly identifies an issue, but do not explain why you need to create new standard instead of using the existing "standard" of "Hardfork Meta" EIPs: https://eips.ethereum.org/meta.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name your pets, number your herd. This article is about servers but the intent is the same: https://www.engineyard.com/blog/pets-vs-cattle If we are going to go to 2-4 upgrades a year we don't need to spend time bikeshedding fork block names and waiting on someone to make it "official."


**Development:**
After `ConstantinopleFix` release, devs wanted to rename it into `Petersburg`. That require code changes which is development time and money.
And code changes to the client might result in errors and bugs if not tested and reviewed properly.
During hardfork development the name is not fixed, thus closer to the release date, need to change the fork name again in the code and in the test files.
The contents of a fork may also change as Testnet deployments demonstrate issues. There may also be emergency forks between planned major forks
Following standard for the fork names will allow to hardcode fork names without issues.

## Specification
In genesis config the following fields must be understood by all clients:

```
"ETH-001-00-FB": "5000",
"ETH-002-00-FB": "15000",
...
"ETH-xxx-yy-FB": "25000"
```

Where `ETH-001-00-FB` stands for `Frontier` fork block number.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the ETH- stands for? Why is it needed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain what the -FB stands for.


The counting pattern will follow an `ETH-xxx-yy` 'planned'/'unplanned' pattern, where the first `xxx` number increments for each planned fork, and each unplanned fork after the planned fork increments the `yy` number. Unplanned forks may be for emergency forks, such as Spurious Dragon, or for late revisions to fork definitions that was deployed onto long lived testnets, such as ConstantinopleFix/Petersburg.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is x.y not enough and we are inventing yet another versioning schema with some weird leading zeros and artificially limited number of digits?


## Rationale
Rationale is to get a fork name standard for generic genesis format so that RPC test tools provide clients with a uniform genesis configuration.
It is easy to add +1 to the next fork name number rather then discuss `ConstantinopleFix` vs `Petersburg` and change the constant string everywhere: both in code and tests when we want to rename.

## Backwards Compatibility
Clients could support `Frontier, Homestead` and any other naming convention.

## Test Cases
Retesteth will generate `genesis.json` and run all tests with this specification.

## Implementation
**Aleth:**
Aleth replace hardcoded variable names with an array that resolve
```
chainParams().forkblocks["ETH-002-00-FB"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like quite inefficient where a struct field read is replaced with a map lookup by a string key.
I'd like to see full implementation. I believe these checks are done in almost every contract execution because EXP was used as a way to implement shifts and EXP cost depended on the fork being in.

```
into `DAO fork` block number, rather then using:

```
u256 const& daoHardfork = chainParams().daoHardforkBlock;
```

## Copyright
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).