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

common: Schedule Shanghai on mainnet! #2591

Merged
merged 2 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/block/test/difficulty.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ tape('[Header]: difficulty tests', (t) => {
for (const testName in testData) {
const test = testData[testName]
const common = new Common({ chain: Chain.Mainnet, hardfork })
// Unschedule any timestamp since tests are not configured for timestamps
common
.hardforks()
.filter((hf) => hf.timestamp !== undefined)
.map((hf) => {
hf.timestamp = undefined
})
const blockOpts = { common }
const uncleHash = test.parentUncles === '0x00' ? undefined : test.parentUncles
const parentBlock = Block.fromBlockData(
Expand Down
3 changes: 2 additions & 1 deletion packages/common/src/chains/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
{
"name": "shanghai",
"block": null,
"forkHash": null
"timestamp": "1681338455",
"forkHash": "0xdce96c2d"
}
],
"bootstrapNodes": [
Expand Down
7 changes: 7 additions & 0 deletions packages/common/test/hardforks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,13 @@ tape('[Common]: Hardfork logic', function (t: tape.Test) {
st.equal(c.forkHash(Hardfork.SpuriousDragon, genesisHash), '0x3edd5b10', msg)

c = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Shanghai })
// unschedule shanghai on it to test
c.hardforks()
.filter((hf) => hf.name === Hardfork.Shanghai)
.map((hf) => {
hf.block = null
hf.timestamp = undefined
})
let f = () => {
c.forkHash(Hardfork.Shanghai)
}
Expand Down