From 560eb6c215a3638a19a065bd9a2bb7b39c32c2f7 Mon Sep 17 00:00:00 2001 From: KirillPamPam Date: Wed, 21 Feb 2024 19:18:39 +0400 Subject: [PATCH] New networks (#425) --- emerald-grpc | 2 +- foundation/src/main/resources/chains.yaml | 93 ++++++++++++++++++- .../upstream/calls/DefaultEthereumMethods.kt | 14 +-- 3 files changed, 97 insertions(+), 12 deletions(-) diff --git a/emerald-grpc b/emerald-grpc index 9ae163d82..3dc49a698 160000 --- a/emerald-grpc +++ b/emerald-grpc @@ -1 +1 @@ -Subproject commit 9ae163d82b68e116fbac0651b8de011746e15807 +Subproject commit 3dc49a6986934ce16b4ca3f79e1bfdd5f0ffe70b diff --git a/foundation/src/main/resources/chains.yaml b/foundation/src/main/resources/chains.yaml index 349dcc3ff..0ce32f257 100644 --- a/foundation/src/main/resources/chains.yaml +++ b/foundation/src/main/resources/chains.yaml @@ -1177,4 +1177,95 @@ chain-settings: code: ZETA_CHAIN_MAINNET grpcId: 1045 short-names: [ zeta-chain ] - chain-id: 0x1b58 \ No newline at end of file + chain-id: 0x1b58 + - id: bittorrent + label: BitTorrent + type: eth + settings: + fork-choice: quorum + expected-block-time: 2s + lags: + syncing: 40 + lagging: 20 + chains: + - id: Mainnet + priority: 100 + code: BITTORRENT_MAINNET + grpcId: 1046 + short-names: [ bittorrent ] + chain-id: 0xc7 + - id: Testnet + priority: 1 + code: BITTORRENT_TESTNET + grpcId: 10060 + short-names: [ bittorrent-testnet ] + chain-id: 0x404 + - id: thundercore + label: Thundercore + type: eth + settings: + fork-choice: quorum + expected-block-time: 1s + lags: + syncing: 40 + lagging: 20 + chains: + - id: Mainnet + priority: 100 + code: THUNDERCORE_MAINNET + grpcId: 1047 + short-names: [ thundercore ] + chain-id: 0x6c + - id: Testnet + priority: 1 + code: THUNDERCORE_TESTNET + grpcId: 10061 + short-names: [ thundercore-testnet ] + chain-id: 0x12 + - id: core + label: Core + type: eth + settings: + fork-choice: quorum + expected-block-time: 3s + lags: + syncing: 40 + lagging: 20 + chains: + - id: Mainnet + priority: 100 + code: CORE_MAINNET + grpcId: 1048 + short-names: [ core ] + chain-id: 0x45c + - id: Testnet + priority: 1 + code: CORE_TESTNET + grpcId: 10062 + short-names: [ core-testnet ] + chain-id: 0x45b + - id: telos + label: Telos + type: eth + settings: + options: + validate-peers: false + validate-syncing: false + fork-choice: quorum + expected-block-time: 300ms + lags: + syncing: 40 + lagging: 20 + chains: + - id: Mainnet + priority: 100 + code: TELOS_MAINNET + grpcId: 1049 + short-names: [ telos ] + chain-id: 0x28 + - id: Testnet + priority: 1 + code: TELOS_TESTNET + grpcId: 10063 + short-names: [ telos-testnet ] + chain-id: 0x29 \ No newline at end of file diff --git a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt index 9e808de44..3372bc9f5 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt @@ -333,6 +333,10 @@ class DefaultEthereumMethods( Chain.OPTIMISM__MAINNET -> setOf("eth_getAccounts") Chain.ZKSYNC__MAINNET, Chain.ZKSYNC__TESTNET, Chain.POLYGON_ZKEVM__TESTNET, Chain.POLYGON_ZKEVM__MAINNET -> setOf("eth_maxPriorityFeePerGas") + Chain.TELOS__MAINNET, Chain.TELOS__TESTNET -> setOf( + "eth_syncing", + "net_peerCount", + ) else -> emptySet() } } @@ -405,14 +409,4 @@ class DefaultEthereumMethods( override fun getSupportedMethods(): Set { return allowedMethods.plus(hardcodedMethods).toSortedSet() } - - data class HardcodedData private constructor( - val netVersion: String, - val chainId: String, - ) { - companion object { - fun createHardcodedData(netVersion: String, chainId: String): HardcodedData = - HardcodedData(netVersion.lowercase(), chainId.lowercase()) - } - } }