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

Client: Merge Switch Hack for --dev Option #1510

Closed
wants to merge 1 commit into from

Conversation

holgerd77
Copy link
Member

This is a small hack on the --dev option to create a network setup where a Merge HF is triggered and can be tested.

This produces the following chain configuration:

{
  name: 'devnet',
  chainId: 123456,
  networkId: 123456,
  genesis: {
    hash: '0x4c748ec987a50eb6d205c656984d12f6bb2495f8b17182309a4f984f7c938ad3',
    timestamp: '0x614b3731',
    gasLimit: 4700000,
    difficulty: '0x1',
    nonce: '0x0000000000000000',
    extraData: '0x0000000000000000000000000000000000000000000000000000000000000000c9c6d3296fddb75bfbe9855049de64ea0b0c27870000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
    mixHash: '0x0000000000000000000000000000000000000000000000000000000000000000',
    coinbase: '0x0000000000000000000000000000000000000000',
    stateRoot: '0x6c7b25b2e99a76e72af08c72fa94366c676237010aa3c7ca0ad50baed78c1d90'
  },
  bootstrapNodes: [],
  consensus: {
    type: 'poa',
    algorithm: 'clique',
    clique: { period: 10, epoch: 30000 }
  },
  hardforks: [
    { name: 'chainstart', block: 0, td: null },
    { name: 'homestead', block: 0, td: null },
    { name: 'tangerineWhistle', block: 0, td: null },
    { name: 'spuriousDragon', block: 0, td: null },
    { name: 'byzantium', block: 0, td: null },
    { name: 'constantinople', block: 0, td: null },
    { name: 'petersburg', block: 0, td: null },
    { name: 'istanbul', block: 2, td: null },
    { name: 'berlin', block: 4, td: null },
    { name: 'london', block: 6, td: null },
    { name: 'merge', block: null, td: 16 }
  ]
}

Mining is executed up till block 7 and then stops.

grafik

For testing purposes, do not merge.

@codecov
Copy link

codecov bot commented Oct 1, 2021

Codecov Report

Merging #1510 (63c0873) into master (e897985) will decrease coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

Flag Coverage Δ
block 86.71% <ø> (+0.13%) ⬆️
blockchain 82.85% <ø> (+0.06%) ⬆️
client 83.02% <100.00%> (-0.20%) ⬇️
common 94.27% <ø> (ø)
devp2p 82.86% <ø> (-0.04%) ⬇️
ethash 90.76% <ø> (ø)
tx 87.34% <ø> (ø)
vm 79.38% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

istanbulBlock: 2,
berlinBlock: 4,
londonBlock: 6,
mergeBlock: 8,
Copy link
Contributor

Choose a reason for hiding this comment

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

by the way geth defines this as terminalTotalDifficulty not mergeBlock, I have implemented it here

Copy link
Contributor

Choose a reason for hiding this comment

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

i also implemented stopping the miner, although I did it on chainCommon not execCommon - I believe execCommon should already work but I haven't implemented updating the chainCommon yet (will be doing that soon in my next work)

@ryanio
Copy link
Contributor

ryanio commented Oct 6, 2021

this is outdated now, see the most recent merge PR for latest work

@ryanio ryanio closed this Oct 6, 2021
@ryanio ryanio deleted the client-merge-dev-hack branch November 19, 2021 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants