Skip to content

Commit 225b046

Browse files
authored
chore(cketh/ckerc20): Replace rpc.sepolia.org by Ankr (dfinity#3523)
([XC-272](https://dfinity.atlassian.net/browse/XC-272)) Replace rpc.sepolia.org by Ankr Remove the rpc.sepolia.org RPC Sepolia provider, and replace it with Ankr. Ankr was originally removed due to a lack of IPv6 compatibility, but this seems to have been fixed in the meantime. [XC-272]: https://dfinity.atlassian.net/browse/XC-272?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 49e2de0 commit 225b046

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

rs/ethereum/cketh/minter/src/eth_rpc_client/mod.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,20 @@ impl EthRpcClient {
5353
}
5454

5555
pub fn from_state(state: &State) -> Self {
56-
use evm_rpc_client::RpcServices as EvmRpcServices;
56+
use evm_rpc_client::{EthSepoliaService, RpcServices as EvmRpcServices};
5757

5858
let mut client = Self::new(state.ethereum_network());
5959
if let Some(evm_rpc_id) = state.evm_rpc_id {
6060
const MIN_ATTACHED_CYCLES: u128 = 500_000_000_000;
6161

6262
let providers = match client.chain {
6363
EthereumNetwork::Mainnet => EvmRpcServices::EthMainnet(None),
64-
EthereumNetwork::Sepolia => EvmRpcServices::EthSepolia(None),
64+
EthereumNetwork::Sepolia => EvmRpcServices::EthSepolia(Some(vec![
65+
EthSepoliaService::BlockPi,
66+
EthSepoliaService::PublicNode,
67+
EthSepoliaService::Alchemy,
68+
EthSepoliaService::Ankr,
69+
])),
6570
};
6671
let min_threshold = match client.chain {
6772
EthereumNetwork::Mainnet => 3_u8,

rs/ethereum/cketh/minter/src/eth_rpc_client/providers.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub(crate) const SEPOLIA_PROVIDERS: [RpcNodeProvider; 4] = [
1111
RpcNodeProvider::Sepolia(SepoliaProvider::BlockPi),
1212
RpcNodeProvider::Sepolia(SepoliaProvider::PublicNode),
1313
RpcNodeProvider::Sepolia(SepoliaProvider::Alchemy),
14-
RpcNodeProvider::Sepolia(SepoliaProvider::RpcSepolia),
14+
RpcNodeProvider::Sepolia(SepoliaProvider::Ankr),
1515
];
1616

1717
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Debug)]
@@ -64,7 +64,7 @@ pub(crate) enum SepoliaProvider {
6464
PublicNode,
6565
// https://www.alchemy.com/chain-connect/endpoints/rpc-sepolia-sepolia
6666
Alchemy,
67-
RpcSepolia,
67+
Ankr,
6868
}
6969

7070
impl SepoliaProvider {
@@ -73,7 +73,7 @@ impl SepoliaProvider {
7373
SepoliaProvider::BlockPi => "https://ethereum-sepolia.blockpi.network/v1/rpc/public",
7474
SepoliaProvider::PublicNode => "https://ethereum-sepolia-rpc.publicnode.com",
7575
SepoliaProvider::Alchemy => "https://eth-sepolia.g.alchemy.com/v2/demo",
76-
SepoliaProvider::RpcSepolia => "https://rpc.sepolia.org",
76+
SepoliaProvider::Ankr => "https://rpc.ankr.com/eth_sepolia",
7777
}
7878
}
7979
}

rs/ethereum/cketh/minter/src/eth_rpc_client/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ mod eth_rpc_client {
2121
RpcNodeProvider::Sepolia(SepoliaProvider::BlockPi),
2222
RpcNodeProvider::Sepolia(SepoliaProvider::PublicNode),
2323
RpcNodeProvider::Sepolia(SepoliaProvider::Alchemy),
24-
RpcNodeProvider::Sepolia(SepoliaProvider::RpcSepolia)
24+
RpcNodeProvider::Sepolia(SepoliaProvider::Ankr)
2525
]
2626
);
2727
}

rs/ethereum/evm-rpc-client/src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ use serde::de::DeserializeOwned;
1010
use std::fmt::Debug;
1111

1212
pub use evm_rpc_types::{
13-
Block, BlockTag, ConsensusStrategy, EthMainnetService, FeeHistory, FeeHistoryArgs, GetLogsArgs,
14-
GetTransactionCountArgs, Hex, Hex20, Hex256, Hex32, HexByte, HttpOutcallError, JsonRpcError,
15-
LogEntry, MultiRpcResult, Nat256, ProviderError, RpcApi, RpcConfig, RpcError, RpcResult,
16-
RpcService, RpcServices, SendRawTransactionStatus, TransactionReceipt, ValidationError,
13+
Block, BlockTag, ConsensusStrategy, EthMainnetService, EthSepoliaService, FeeHistory,
14+
FeeHistoryArgs, GetLogsArgs, GetTransactionCountArgs, Hex, Hex20, Hex256, Hex32, HexByte,
15+
HttpOutcallError, JsonRpcError, LogEntry, MultiRpcResult, Nat256, ProviderError, RpcApi,
16+
RpcConfig, RpcError, RpcResult, RpcService, RpcServices, SendRawTransactionStatus,
17+
TransactionReceipt, ValidationError,
1718
};
1819

1920
#[async_trait]

0 commit comments

Comments
 (0)