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

Make trinity conform to standard genesis.json standard from EIP-1085 #722

Closed
pipermerriam opened this issue May 18, 2018 · 1 comment · Fixed by #1299
Closed

Make trinity conform to standard genesis.json standard from EIP-1085 #722

pipermerriam opened this issue May 18, 2018 · 1 comment · Fixed by #1299

Comments

@pipermerriam
Copy link
Member

What is wrong?

ethereum/EIPs#1085

How can it be fixed

Implement the spec

@pipermerriam
Copy link
Member Author

Things that need to be done for this:

New CLI option

First, new CLI option --genesis which expects to be passed the filesystem path to a valid genesis JSON file. When --genesis has been provided we will require that --data-dir is also specified to avoid accidental collision with the mainnet and ropsten directories until we sort this API out a bit.

Validation of genesis data

Next we need validation for the genesis JSON. A simple function which takes the parsed JSON and raises an eth_utils.ValidationError if it is not valid.

Update the ChainConfig class

Next the trinity.config.ChainConfig class needs to be updated to include this genesis data. This includes:

  • New attribute chain_id that needs to be set on the ChainConfig class and probably stored on whatever Node class is used.

Setting genesis header

Next, in trinity.chains.get_chaindb_manager and trinity.chains.initialize_database we need to setup the database. We'll need the chain_class to do this. When --genesis has been specified, we need to use chain_class.from_genesis(...) to initialize the data dir. Ideally, we should be able to convert how the mainnet and ropsten chains are initialized to use the same mechanism, maintaining a local copy of the mainnet and ropsten genesis JSON (and probably validating them against the genesis header values from the py-evm package).

Part of this is going to be dynamically configuring the vm_configuration for the chain class from the provided genesis data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant