Skip to content

Commit

Permalink
Merge branch 'master' into vm/verkle-testing-troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrocheleau authored Jan 28, 2025
2 parents 534f121 + 2eb4c44 commit 64dc70d
Show file tree
Hide file tree
Showing 39 changed files with 1,463 additions and 569 deletions.
449 changes: 92 additions & 357 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion packages/block/examples/clique.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { createBlock } from '@ethereumjs/block'
import { Common, Goerli, Hardfork } from '@ethereumjs/common'
import { Common, Hardfork } from '@ethereumjs/common'

import { Goerli } from '../test/testdata/goerliCommon.js'

const common = new Common({ chain: Goerli, hardfork: Hardfork.Chainstart })

Expand Down
5 changes: 3 additions & 2 deletions packages/block/test/block.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Common, Goerli, Hardfork, Mainnet, createCustomCommon } from '@ethereumjs/common'
import { Common, Hardfork, Mainnet, createCustomCommon } from '@ethereumjs/common'
import { RLP } from '@ethereumjs/rlp'
import { createLegacyTx } from '@ethereumjs/tx'
import { KECCAK256_RLP_ARRAY, bytesToHex, equalsBytes, hexToBytes, toBytes } from '@ethereumjs/util'
Expand All @@ -17,6 +17,7 @@ import {
} from '../src/index.js'

import { genesisHashesTestData } from './testdata/genesisHashesTest.js'
import { Goerli } from './testdata/goerliCommon.js'
import { testdataFromRPCGoerliData } from './testdata/testdata-from-rpc-goerli.js'
import { testdataPreLondon2Data } from './testdata/testdata_pre-london-2.js'
import { testdataPreLondonData } from './testdata/testdata_pre-london.js'
Expand Down Expand Up @@ -126,7 +127,7 @@ describe('[Block]: block functions', () => {
})

it('should initialize with null parameters without throwing', () => {
const common = new Common({ chain: Goerli })
const common = new Common({ chain: Mainnet })
const opts = { common }
assert.doesNotThrow(function () {
createBlock({}, opts)
Expand Down
4 changes: 3 additions & 1 deletion packages/block/test/clique.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Common, Goerli, Hardfork } from '@ethereumjs/common'
import { Common, Hardfork } from '@ethereumjs/common'
import { Address, createZeroAddress, hexToBytes } from '@ethereumjs/util'
import { assert, describe, it } from 'vitest'

Expand All @@ -13,6 +13,8 @@ import {
createSealedCliqueBlockHeader,
} from '../src/index.js'

import { Goerli } from './testdata/goerliCommon.js'

describe('[Header]: Clique PoA Functionality', () => {
const common = new Common({ chain: Goerli, hardfork: Hardfork.Chainstart })

Expand Down
3 changes: 2 additions & 1 deletion packages/block/test/from-rpc.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Common, Goerli, Hardfork, Mainnet } from '@ethereumjs/common'
import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
import { bytesToHex, equalsBytes, hexToBytes, randomBytes } from '@ethereumjs/util'
import { assert, describe, it } from 'vitest'

Expand All @@ -9,6 +9,7 @@ import {
} from '../src/index.js'

import { alchemy14151203Data } from './testdata/alchemy14151203.js'
import { Goerli } from './testdata/goerliCommon.js'
import { infuraGoerliBlock10536893Data } from './testdata/infura-goerli-block-10536893.js'
import { infura15571241Data } from './testdata/infura15571241.js'
import { infura15571241withTransactionsData } from './testdata/infura15571241withTransactions.js'
Expand Down
3 changes: 2 additions & 1 deletion packages/block/test/header.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Common, Goerli, Hardfork, Mainnet } from '@ethereumjs/common'
import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
import { RLP } from '@ethereumjs/rlp'
import {
KECCAK256_RLP,
Expand All @@ -23,6 +23,7 @@ import {
import { bcBlockGasLimitTestData } from './testdata/bcBlockGasLimitTest.js'
import { blocksGoerliData } from './testdata/blocks_goerli.js'
import { blocksMainnetData } from './testdata/blocks_mainnet.js'
import { Goerli } from './testdata/goerliCommon.js'

import type { BlockHeader } from '../src/index.js'
import type { CliqueConfig } from '@ethereumjs/common'
Expand Down
162 changes: 162 additions & 0 deletions packages/block/test/testdata/goerliCommon.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
import type { ChainConfig } from '@ethereumjs/common'

export const Goerli: ChainConfig = {
name: 'goerli',
chainId: 5,
defaultHardfork: 'cancun',
consensus: {
type: 'poa',
algorithm: 'clique',
clique: {
period: 15,
epoch: 30000,
},
},
comment: 'Cross-client PoA test network',
url: 'https://github.com/goerli/testnet',
genesis: {
timestamp: '0x5c51a607',
gasLimit: 10485760,
difficulty: 1,
nonce: '0x0000000000000000',
extraData:
'0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
},
hardforks: [
{
name: 'chainstart',
block: 0,
forkHash: '0xa3f5ab08',
},
{
name: 'homestead',
block: 0,
forkHash: '0xa3f5ab08',
},
{
name: 'tangerineWhistle',
block: 0,
forkHash: '0xa3f5ab08',
},
{
name: 'spuriousDragon',
block: 0,
forkHash: '0xa3f5ab08',
},
{
name: 'byzantium',
block: 0,
forkHash: '0xa3f5ab08',
},
{
name: 'constantinople',
block: 0,
forkHash: '0xa3f5ab08',
},
{
name: 'petersburg',
block: 0,
forkHash: '0xa3f5ab08',
},
{
name: 'istanbul',
block: 1561651,
forkHash: '0xc25efa5c',
},
{
name: 'berlin',
block: 4460644,
forkHash: '0x757a1c47',
},
{
name: 'london',
block: 5062605,
forkHash: '0xb8c6299d',
},
{
// The forkHash will remain same as mergeForkIdTransition is post merge,
// terminal block: https://goerli.etherscan.io/block/7382818
name: 'paris',
block: 7382819,
forkHash: '0xb8c6299d',
},
{
name: 'mergeForkIdTransition',
block: null,
forkHash: null,
},
{
name: 'shanghai',
block: null,
timestamp: '1678832736',
forkHash: '0xf9843abf',
},
{
name: 'cancun',
block: null,
timestamp: '1705473120',
forkHash: '0x70cc14e2',
},
],
bootstrapNodes: [
{
ip: '51.141.78.53',
port: 30303,
id: '011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a',
location: '',
comment: 'Upstream bootnode 1',
},
{
ip: '13.93.54.137',
port: 30303,
id: '176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b',
location: '',
comment: 'Upstream bootnode 2',
},
{
ip: '94.237.54.114',
port: 30313,
id: '46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291',
location: '',
comment: 'Upstream bootnode 3',
},
{
ip: '18.218.250.66',
port: 30313,
id: 'b5948a2d3e9d486c4d75bf32713221c2bd6cf86463302339299bd227dc2e276cd5a1c7ca4f43a0e9122fe9af884efed563bd2a1fd28661f3b5f5ad7bf1de5949',
location: '',
comment: 'Upstream bootnode 4',
},
{
ip: '3.11.147.67',
port: 30303,
id: 'a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91',
location: '',
comment: 'Ethereum Foundation bootnode',
},
{
ip: '51.15.116.226',
port: 30303,
id: 'a869b02cec167211fb4815a82941db2e7ed2936fd90e78619c53eb17753fcf0207463e3419c264e2a1dd8786de0df7e68cf99571ab8aeb7c4e51367ef186b1dd',
location: '',
comment: 'Goerli Initiative bootnode',
},
{
ip: '51.15.119.157',
port: 30303,
id: '807b37ee4816ecf407e9112224494b74dd5933625f655962d892f2f0f02d7fbbb3e2a94cf87a96609526f30c998fd71e93e2f53015c558ffc8b03eceaf30ee33',
location: '',
comment: 'Goerli Initiative bootnode',
},
{
ip: '51.15.119.157',
port: 40303,
id: 'a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd',
location: '',
comment: 'Goerli Initiative bootnode',
},
],
dnsNetworks: [
'enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net',
],
}
4 changes: 3 additions & 1 deletion packages/blockchain/examples/clique.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { CliqueConsensus, createBlockchain } from '@ethereumjs/blockchain'
import { Common, ConsensusAlgorithm, Goerli, Hardfork } from '@ethereumjs/common'
import { Common, ConsensusAlgorithm, Hardfork } from '@ethereumjs/common'

import { Goerli } from '../test/testdata/goerliCommon.js'

import type { ConsensusDict } from '@ethereumjs/blockchain'

Expand Down
3 changes: 2 additions & 1 deletion packages/blockchain/test/clique.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
Common,
ConsensusAlgorithm,
ConsensusType,
Goerli,
Hardfork,
createCustomCommon,
} from '@ethereumjs/common'
Expand All @@ -23,6 +22,8 @@ import { assert, describe, it } from 'vitest'
import { CLIQUE_NONCE_AUTH, CLIQUE_NONCE_DROP, CliqueConsensus } from '../src/consensus/clique.js'
import { createBlockchain } from '../src/index.js'

import { Goerli } from './testdata/goerliCommon.js'

import type { Blockchain, ConsensusDict } from '../src/index.js'
import type { Block } from '@ethereumjs/block'
import type { CliqueConfig } from '@ethereumjs/common'
Expand Down
3 changes: 2 additions & 1 deletion packages/blockchain/test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import {
createBlockHeader,
createBlockHeaderFromBytesArray,
} from '@ethereumjs/block'
import { Common, Goerli, Hardfork, Holesky, Mainnet, Sepolia } from '@ethereumjs/common'
import { Common, Hardfork, Holesky, Mainnet, Sepolia } from '@ethereumjs/common'
import { MapDB, bytesToHex, equalsBytes, hexToBytes, utf8ToBytes } from '@ethereumjs/util'
import { assert, describe, it } from 'vitest'

import { Blockchain, createBlockchain, createBlockchainFromBlocksData } from '../src/index.js'

import { blocksMainnetData } from './testdata/blocks_mainnet.js'
import { Goerli } from './testdata/goerliCommon.js'
import { preLondonData } from './testdata/testdata_pre-london.js'
import { createTestDB, generateBlockchain, generateBlocks, isConsecutive } from './util.js'

Expand Down
3 changes: 2 additions & 1 deletion packages/blockchain/test/reorg.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { cliqueSigner, createBlock } from '@ethereumjs/block'
import { Common, ConsensusAlgorithm, Goerli, Hardfork, Mainnet } from '@ethereumjs/common'
import { Common, ConsensusAlgorithm, Hardfork, Mainnet } from '@ethereumjs/common'
import { Address, equalsBytes, hexToBytes } from '@ethereumjs/util'
import { assert, describe, it } from 'vitest'

import { CLIQUE_NONCE_AUTH, CliqueConsensus } from '../src/consensus/clique.js'
import { createBlockchain } from '../src/index.js'

import { Goerli } from './testdata/goerliCommon.js'
import { generateConsecutiveBlock } from './util.js'

import type { ConsensusDict } from '../src/index.js'
Expand Down
Loading

0 comments on commit 64dc70d

Please sign in to comment.