Giter Site home page Giter Site logo

Comments (3)

holgerd77 avatar holgerd77 commented on May 25, 2024

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.

vpulim avatar vpulim commented on May 25, 2024

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.

holgerd77 avatar holgerd77 commented on May 25, 2024

Addressed with #24, will close.

from ethereumjs-common.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.