From 9713ed6794956af84127afeedeb209a5f85ff11c Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 3 Dec 2024 15:12:04 +0300 Subject: [PATCH 1/2] Add Cronos zkEVM --- emerald-grpc | 2 +- foundation/src/main/resources/public | 2 +- .../upstream/calls/DefaultEthereumMethods.kt | 24 +++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/emerald-grpc b/emerald-grpc index e9fc0cf6..da07414e 160000 --- a/emerald-grpc +++ b/emerald-grpc @@ -1 +1 @@ -Subproject commit e9fc0cf67e1d69cc8cd475ee32d9229e2494a1f9 +Subproject commit da07414e48f039952c6b94803fd05fe04941bd49 diff --git a/foundation/src/main/resources/public b/foundation/src/main/resources/public index 7f8d6b1c..aa19876b 160000 --- a/foundation/src/main/resources/public +++ b/foundation/src/main/resources/public @@ -1 +1 @@ -Subproject commit 7f8d6b1c12401ede7823259b8ba96e8a48eea39d +Subproject commit aa19876b57ccbda87f0cd3ff340250f514a4dfcc 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 24ed666c..84f5671f 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt @@ -722,6 +722,30 @@ class DefaultEthereumMethods( Chain.SEI__MAINNET, Chain.SEI__TESTNET, Chain.SEI__DEVNET -> seiMethods + Chain.CRONOS_ZKEVM__MAINNET, Chain.CRONOS_ZKEVM__TESTNET -> listOf( + "zk_estimateFee", + "zks_estimateGasL1ToL2", + "zks_getBridgehubContract", + "zks_getMainContract", + "zks_getTestnetPaymaster", + "zks_getBridgeContracts", + "zks_L1ChainId", + "zks_getBaseTokenL1Address", + "zks_getConfirmedTokens", + "zks_getAllAccountBalances", + "zks_getL2ToL1MsgProof", + "zks_getL2ToL1LogProof", + "zks_L1BatchNumber", + "zks_getBlockDetails", + "zks_getTransactionDetails", + "zks_getRawBlockTransactions", + "zks_getL1BatchDetails", + "zks_getL1BatchBlockRange", + "zks_getL1GasPrice", + "zks_getFeeParams", + "zks_getProtocolVersion", + ) + else -> emptyList() } } From 9e497c070a0cb024effd2424f7c3e1bba13c7fe4 Mon Sep 17 00:00:00 2001 From: Anton Date: Wed, 4 Dec 2024 11:29:28 +0300 Subject: [PATCH 2/2] rm duplicate methods --- .../upstream/calls/DefaultEthereumMethods.kt | 66 +++++++------------ 1 file changed, 23 insertions(+), 43 deletions(-) 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 84f5671f..f5ae063d 100644 --- a/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt +++ b/src/main/kotlin/io/emeraldpay/dshackle/upstream/calls/DefaultEthereumMethods.kt @@ -583,6 +583,27 @@ class DefaultEthereumMethods( "hmyv2_getValidators", ) + private val zxkSyncMethods = listOf( + "zks_estimateFee", + "zks_estimateGasL1ToL2", + "zks_getAllAccountBalances", + "zks_getBlockDetails", + "zks_getBridgeContracts", + "zks_getBytecodeByHash", + "zks_getConfirmedTokens", + "zks_getL1BatchBlockRange", + "zks_getL1BatchDetails", + "zks_getL2ToL1LogProof", + "zks_getL2ToL1MsgProof", + "zks_getMainContract", + "zks_getRawBlockTransactions", + "zks_getTestnetPaymaster", + "zks_getTokenPrice", + "zks_getTransactionDetails", + "zks_L1BatchNumber", + "zks_L1ChainId", + ) + private val allowedMethods: List init { @@ -667,26 +688,7 @@ class DefaultEthereumMethods( "zkevm_getBroadcastURI", ) - Chain.ZKSYNC__MAINNET, Chain.ZKSYNC__SEPOLIA -> listOf( - "zks_estimateFee", - "zks_estimateGasL1ToL2", - "zks_getAllAccountBalances", - "zks_getBlockDetails", - "zks_getBridgeContracts", - "zks_getBytecodeByHash", - "zks_getConfirmedTokens", - "zks_getL1BatchBlockRange", - "zks_getL1BatchDetails", - "zks_getL2ToL1LogProof", - "zks_getL2ToL1MsgProof", - "zks_getMainContract", - "zks_getRawBlockTransactions", - "zks_getTestnetPaymaster", - "zks_getTokenPrice", - "zks_getTransactionDetails", - "zks_L1BatchNumber", - "zks_L1ChainId", - ) + Chain.ZKSYNC__MAINNET, Chain.ZKSYNC__SEPOLIA -> zxkSyncMethods Chain.HARMONY__MAINNET_SHARD_0 -> harmonyMethods @@ -722,29 +724,7 @@ class DefaultEthereumMethods( Chain.SEI__MAINNET, Chain.SEI__TESTNET, Chain.SEI__DEVNET -> seiMethods - Chain.CRONOS_ZKEVM__MAINNET, Chain.CRONOS_ZKEVM__TESTNET -> listOf( - "zk_estimateFee", - "zks_estimateGasL1ToL2", - "zks_getBridgehubContract", - "zks_getMainContract", - "zks_getTestnetPaymaster", - "zks_getBridgeContracts", - "zks_L1ChainId", - "zks_getBaseTokenL1Address", - "zks_getConfirmedTokens", - "zks_getAllAccountBalances", - "zks_getL2ToL1MsgProof", - "zks_getL2ToL1LogProof", - "zks_L1BatchNumber", - "zks_getBlockDetails", - "zks_getTransactionDetails", - "zks_getRawBlockTransactions", - "zks_getL1BatchDetails", - "zks_getL1BatchBlockRange", - "zks_getL1GasPrice", - "zks_getFeeParams", - "zks_getProtocolVersion", - ) + Chain.CRONOS_ZKEVM__MAINNET, Chain.CRONOS_ZKEVM__TESTNET -> zxkSyncMethods + "zk_estimateFee" else -> emptyList() }