diff --git a/docs/04-upstream-config.adoc b/docs/04-upstream-config.adoc index 782acfb8..b700a1f9 100644 --- a/docs/04-upstream-config.adoc +++ b/docs/04-upstream-config.adoc @@ -130,6 +130,7 @@ Currently, dshackle supports next chains (should be used as chain names in confi - ethereum (eth) - ethereum-classic (etc) - polygon (matic) +- polygon-mumbai - arbitrum (arb) - arbitrum-testnet - arbitrum-nova diff --git a/src/main/kotlin/io/emeraldpay/dshackle/BlockchainType.kt b/src/main/kotlin/io/emeraldpay/dshackle/BlockchainType.kt index 3c26c0ee..450c8ba9 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/BlockchainType.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/BlockchainType.kt @@ -20,7 +20,8 @@ enum class BlockchainType { chain == Chain.POLYGON_ZKEVM || chain == Chain.TESTNET_POLYGON_ZKEVM || chain == Chain.ZKSYNC || - chain == Chain.TESTNET_ZKSYNC + chain == Chain.TESTNET_ZKSYNC || + chain == Chain.TESTNET_POYGON_POS_MUMBAI ) { return EVM_POS } diff --git a/src/main/kotlin/io/emeraldpay/dshackle/Chain.kt b/src/main/kotlin/io/emeraldpay/dshackle/Chain.kt index ff05e555..b918fc3a 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/Chain.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/Chain.kt @@ -79,6 +79,11 @@ enum class Chain(val id: Int, val chainCode: String, val chainName: String) { 10012, "ZKS_TESTNET", "ZkSync Testnet" + ), + TESTNET_POYGON_POS_MUMBAI( + 10013, + "POLYGON_POS_MUMBAI", + "Polygon POS Mumbai Testnet" ); companion object { diff --git a/src/main/kotlin/io/emeraldpay/dshackle/Global.kt b/src/main/kotlin/io/emeraldpay/dshackle/Global.kt index 62981366..7ee41e9c 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/Global.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/Global.kt @@ -76,6 +76,7 @@ class Global { "polygon-zkevm-testnet" to Chain.TESTNET_POLYGON_ZKEVM, "zksync" to Chain.ZKSYNC, "zksync-testnet" to Chain.TESTNET_ZKSYNC, + "polygon-mumbai" to Chain.TESTNET_POYGON_POS_MUMBAI, ) fun chainById(id: String?): Chain { 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 e3b71edf..a3c7e38e 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt @@ -175,7 +175,7 @@ class DefaultEthereumMethods( Chain.OPTIMISM, Chain.TESTNET_OPTIMISM -> listOf( "rollup_gasPrices" ) - Chain.POLYGON -> listOf( + Chain.POLYGON, Chain.TESTNET_POYGON_POS_MUMBAI -> listOf( "bor_getAuthor", "bor_getCurrentValidators", "bor_getCurrentProposer", @@ -311,6 +311,10 @@ class DefaultEthereumMethods( "\"280\"" } + Chain.TESTNET_POYGON_POS_MUMBAI == chain -> { + "\"80001\"" + } + else -> throw RpcException(-32602, "Invalid chain") } } @@ -389,6 +393,10 @@ class DefaultEthereumMethods( "\"0x118\"" } + Chain.TESTNET_POYGON_POS_MUMBAI == chain -> { + "\"0x13881\"" + } + else -> throw RpcException(-32602, "Invalid chain") } } diff --git a/src/main/resources/chains.yaml b/src/main/resources/chains.yaml index 36a3400f..2789e275 100644 --- a/src/main/resources/chains.yaml +++ b/src/main/resources/chains.yaml @@ -14,6 +14,10 @@ chain-settings: lags: syncing: 20 lagging: 10 + - id: polygon-mumbai + lags: + syncing: 20 + lagging: 10 - id: arbitrum options: validate-peers: false