0

Is it possible to get the node ChainConfig (with hardforks blocks numbers activation like Constantinople: blocknumber ...) from the geth console?

Is geth using only ChainConfig from genesis.json or is it a way to update ChainConfig and add new hardforks block numbers when it's necessary?

Thank you very much!

1 Answer 1

1

No, it is not possible to get ChainConfig struct from console because there is no client implementation for that. This is because these values are fixed (constants) and only change by network, so nobody would ask for them on regular basis (using console or RPC).

If you need to get these constants for any network you can get it from sources:

MainnetChainConfig = &ChainConfig{
    ChainID:                       big.NewInt(1),
    HomesteadBlock:                big.NewInt(1_150_000),
    DAOForkBlock:                  big.NewInt(1_920_000),
    DAOForkSupport:                true,
    EIP150Block:                   big.NewInt(2_463_000),
    EIP150Hash:                    common.HexToHash("0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0"),
    EIP155Block:                   big.NewInt(2_675_000),
    EIP158Block:                   big.NewInt(2_675_000),
    ByzantiumBlock:                big.NewInt(4_370_000),
    ConstantinopleBlock:           big.NewInt(7_280_000),
    PetersburgBlock:               big.NewInt(7_280_000),
    IstanbulBlock:                 big.NewInt(9_069_000),
    MuirGlacierBlock:              big.NewInt(9_200_000),
    BerlinBlock:                   big.NewInt(12_244_000),
    LondonBlock:                   big.NewInt(12_965_000),
    ArrowGlacierBlock:             big.NewInt(13_773_000),
    GrayGlacierBlock:              big.NewInt(15_050_000),
    TerminalTotalDifficulty:       MainnetTerminalTotalDifficulty, // 58_750_000_000_000_000_000_000
    TerminalTotalDifficultyPassed: true,
    Ethash:                        new(EthashConfig),
}

This is the file where they are published:

https://github.com/ethereum/go-ethereum/blob/master/params/config.go

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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