Comments (3)
I've some reservations towards the chain spec format, that's why I somewhat put that aside.
These are mainly:
- Integrating the accounts makes the file very large especially for mainnet, which puts an unnecessary burden on loading for many use cases not needing the accounts
- Including the hardforks like in the genesis file definitions makes things unnecessarily static, e.g. if there is another HF on the horizon and one would want to add some draft params, then one would have to wait for the official genesis files to update. This also doesn't fit (at all) to our current file structure with the parameter override mechanism on new HFs
- I also don't think that the ever-changing bootstrap nodes belong into the chain spec and is better kept separate. This also prevents (somewhat theoretical atm) to provide a hash to prove the integrity of the static genesis parameters
So: there would be definitely some more discussion necessary if we want to move in this direction. Atm I actually wouldn't want to set a priority here. Maybe some middle ground would be to adopt naming and un-problematic structure as much as possible but e.g. leave accounts and bootstrap nodes separate (people could just copy-and-paste to separate files, which should be acceptable).
There is actually some ongoing discussion atm on Gitter about crossclient standards on genesis definition, but I somewhat dropped here since I wasn't so satisfied with the running discussion.
from ethereumjs-common.
Yes, no urgency to adopt the full chain spec format. However, I do need to be able to load custom genesis settings into a Common
instance in order to connect to a private test net I've set up for ethereumjs client debugging/testing. A simple short-term solution could be to modify Common.setChain()
to also accept an external chain params object. This way, the genesis.json
parsing can be done in the client and the resulting params object can be passed on to setChain()
. Something like this:
const common = new Common()
const params = parseGenesis('genesis.json')
common.setChain(params)
with these changes to Common.setChain()
:
setChain (chain) {
if (typeof (chain) === 'number') {
...
} else if (typeof (chain) === 'string') {
...
} else if (typeof (chain) === 'object' && chain.genesis) {
this._chainParams = chain
} else {
throw new Error('Wrong input format')
}
}
If this makes sense, I can create a PR
from ethereumjs-common.
Addressed with #24, will close.
from ethereumjs-common.
Related Issues (13)
- Remove Gas postfix in chainstart.js
- Support for new Goerli testnet HOT 4
- Account addresses in genesisStates should be prefixed with '0x' HOT 6
- Consistent/unified value format on genesis file accounts
- Remove hybridCasper hardfork draft
- Updated pre-/post reentrency Constantinople support HOT 5
- This library is too restrictive for testing networks HOT 11
- Add Kovan hardfork blocks HOT 2
- forCustomChain is not a function HOT 1
- [Istanbul] EIP-1884: Trie-size-dependent Opcode Repricing > Price Parameters
- [Istanbul] EIP-2200: Rebalance net-metered SSTORE gas cost with consideration of SLOAD gas cost change HOT 1
- TypeError: Common is not a constructor HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ethereumjs-common.