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: add YoloV3 network #1129

Merged
merged 10 commits into from
Mar 5, 2021
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "ethereum-tests"]
path = packages/ethereum-tests
url = https://github.com/qbzzt/tests.git
url = https://github.com/ethereum/tests.git
branch = develop
17,240 changes: 14,221 additions & 3,019 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@ethereumjs/common": "^2.1.0",
"merkle-patricia-tree": "^4.1.0",
"@ethereumjs/tx": "^3.0.2",
"ethereumjs-util": "^7.0.8"
"ethereumjs-util": "^7.0.9"
},
"devDependencies": {
"@ethereumjs/config-coverage": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/blockchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@ethereumjs/common": "^2.1.0",
"@ethereumjs/ethash": "^1.0.0",
"debug": "^2.2.0",
"ethereumjs-util": "^7.0.8",
"ethereumjs-util": "^7.0.9",
"level-mem": "^5.0.1",
"lru-cache": "^5.1.1",
"rlp": "^2.2.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/net/protocol/ethprotocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class EthProtocol extends Protocol {
*/
decodeStatus(status: any): any {
return {
networkId: bufferToInt(status.networkId),
networkId: new BN(status.networkId),
td: new BN(status.td),
bestHash: status.bestHash,
genesisHash: status.genesisHash,
Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/net/protocol/lesprotocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class LesProtocol extends Protocol {
}
}
return {
networkId: bufferToInt(status.networkId),
networkId: new BN(status.networkId),
headTd: new BN(status.headTd),
headHash: status.headHash,
headNum: new BN(status.headNum),
Expand Down
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"merkle-patricia-tree": "^4.1.0",
"@ethereumjs/vm": "^5.1.0",
"chalk": "^2.4.2",
"ethereumjs-util": "^7.0.8",
"ethereumjs-util": "^7.0.9",
"fs-extra": "^7.0.1",
"it-pipe": "^1.1.0",
"it-pushable": "^1.4.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/net/protocol/ethprotocol.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ tape('[EthProtocol]', (t) => {
genesisHash: '0xbb',
})
t.ok(
status.networkId === 1 &&
status.networkId.toNumber() === 1 &&
status.td.toNumber() === 100 &&
status.bestHash === '0xaa' &&
status.genesisHash === '0xbb',
Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/net/protocol/lesprotocol.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ tape('[LesProtocol]', (t) => {
status = { ...status, networkId: [0x01] }
status = p.decodeStatus(status)
t.ok(
status.networkId === 1 &&
status.networkId.toNumber() === 1 &&
status.headTd.toString('hex') === '64' &&
status.headHash === '0xaa' &&
status.headNum.toNumber() === 100 &&
Expand Down
3 changes: 3 additions & 0 deletions packages/common/src/chains/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ropsten from './ropsten.json'
import rinkeby from './rinkeby.json'
import kovan from './kovan.json'
import goerli from './goerli.json'
import yolov3 from './yolov3.json'

/**
* @hidden
Expand All @@ -15,13 +16,15 @@ export function _getInitializedChains(customChains?: Chain[]) {
'4': 'rinkeby',
'42': 'kovan',
'5': 'goerli',
'34180983699157880': 'yolov3',
holgerd77 marked this conversation as resolved.
Show resolved Hide resolved
}
const chains: any = {
mainnet,
ropsten,
rinkeby,
kovan,
goerli,
yolov3,
}
if (customChains) {
for (const chain of customChains) {
Expand Down
91 changes: 91 additions & 0 deletions packages/common/src/chains/yolov3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"name": "yolov3",
"chainId": 34180983699157880,
"networkId": 34180983699157880,
"defaultHardfork": "berlin",
"consensus": {
"type": "poa",
"algorithm": "clique",
"clique": {
"period": 15,
"epoch": 30000
}
},
"comment": "The YoloV3 chain",
"url": "https://yolov3.ethdevops.io",
"genesis": {
"hash": "0xf1f2876e8500c77afcc03228757b39477eceffccf645b734967fe3c7e16967b7",
"nonce": "0x0000000000000000",
"timestamp": "0x6027dd2e",
"extraData": "0x00000000000000000000000000000000000000000000000000000000000000001041afbcb359d5a8dc58c15b2ff51354ff8a217d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x47b760",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"stateRoot": "0x18fe5753b162ee86c08809d8cfde565e2ca40c869c5f34b19f9e4478759e35e3",
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
"hardforks": [
{
"name": "chainstart",
"block": 0,
"forkHash": "0xa308affe"
},
{
"name": "homestead",
"block": 0,
"forkHash": "0xa308affe"
},
{
"name": "tangerineWhistle",
"block": 0,
"forkHash": "0xa308affe"
},
{
"name": "spuriousDragon",
"block": 0,
"forkHash": "0xa308affe"
},
{
"name": "byzantium",
"block": 0,
"forkHash": "0xa308affe"
},
{
"name": "constantinople",
"block": 0,
"forkHash": "0xa308affe"
},
{
"name": "petersburg",
"block": 0,
"forkHash": "0xa308affe"
},
{
"name": "istanbul",
"block": 0,
"forkHash": "0xa308affe"
},
{
"name": "muirGlacier",
"block": 0,
"forkHash": "0xa308affe"
},
{
"name": "berlin",
"block": 0,
"forkHash": "0xa308affe"
}
],
"bootstrapNodes": [
{
"ip": "3.9.20.133",
"port": 30303,
"id": "9e1096aa59862a6f164994cb5cb16f5124d6c992cdbf4535ff7dea43ea1512afe5448dca9df1b7ab0726129603f1a3336b631e4d7a1a44c94daddd03241587f9",
"location": "unknown",
"comment": "yolov3 bootnode"
}
]
}
2 changes: 2 additions & 0 deletions packages/common/src/genesisStates/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ const genesisStates: genesisStatesType = {
'4': 'rinkeby',
'42': 'kovan',
'5': 'goerli',
'34180983699157880': 'yolov3',
holgerd77 marked this conversation as resolved.
Show resolved Hide resolved
},
mainnet: require('./mainnet.json'),
ropsten: require('./ropsten.json'),
rinkeby: require('./rinkeby.json'),
kovan: require('./kovan.json'),
goerli: require('./goerli.json'),
yolov3: require('./yolov3.json'),
}

/**
Expand Down
Loading