Skip to content

Commit 2b839c2

Browse files
authored
feat(providers): enabling Allnodes provider and tuning Ethereum Mainnet RPC traffic (#946)
1 parent 99dd3ae commit 2b839c2

File tree

8 files changed

+22
-14
lines changed

8 files changed

+22
-14
lines changed

src/env/allnodes.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
use {super::ProviderConfig, crate::providers::Weight, std::collections::HashMap};
1+
use {
2+
super::ProviderConfig,
3+
crate::providers::{Priority, Weight},
4+
std::collections::HashMap,
5+
};
26

37
#[derive(Debug)]
48
pub struct AllnodesConfig {
@@ -33,11 +37,10 @@ fn default_supported_chains() -> HashMap<String, (String, Weight)> {
3337
// Keep in-sync with SUPPORTED_CHAINS.md
3438

3539
HashMap::from([
36-
// Disabling Allnodes until the plan upgrade is complete
3740
// Ethereum Mainnet
38-
// (
39-
// "eip155:1".into(),
40-
// ("eth30082".into(), Weight::new(Priority::Max).unwrap()),
41-
// ),
41+
(
42+
"eip155:1".into(),
43+
("eth57873".into(), Weight::new(Priority::Max).unwrap()),
44+
),
4245
])
4346
}

src/env/drpc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn default_supported_chains() -> HashMap<String, (String, Weight)> {
4040
"eip155:1".into(),
4141
(
4242
"https://eth.drpc.org/".into(),
43-
Weight::new(Priority::Low).unwrap(),
43+
Weight::new(Priority::Minimal).unwrap(),
4444
),
4545
),
4646
// Ethereum Sepolia

src/env/getblock.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ fn extract_supported_chains(access_tokens_json: String) -> HashMap<String, (Stri
4646

4747
// Keep in-sync with SUPPORTED_CHAINS.md
4848
let supported_chain_ids = HashMap::from([
49-
("eip155:1", Priority::Low),
50-
("eip155:56", Priority::Low),
49+
("eip155:1", Priority::Minimal),
50+
("eip155:56", Priority::Minimal),
5151
("eip155:137", Priority::Normal),
5252
("eip155:324", Priority::Normal),
5353
("eip155:17000", Priority::Normal),

src/env/infura.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ fn default_supported_chains() -> HashMap<String, (String, Weight)> {
4444
// Ethereum
4545
(
4646
"eip155:1".into(),
47-
("mainnet".into(), Weight::new(Priority::Custom(1)).unwrap()),
47+
("mainnet".into(), Weight::new(Priority::Minimal).unwrap()),
4848
),
4949
(
5050
"eip155:11155111".into(),
51-
("sepolia".into(), Weight::new(Priority::Custom(1)).unwrap()),
51+
("sepolia".into(), Weight::new(Priority::Minimal).unwrap()),
5252
),
5353
// Optimism
5454
(

src/env/lava.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn default_supported_chains() -> HashMap<String, (String, Weight)> {
4040
// Ethereum Mainnet
4141
(
4242
"eip155:1".into(),
43-
("eth".into(), Weight::new(Priority::Low).unwrap()),
43+
("eth".into(), Weight::new(Priority::Minimal).unwrap()),
4444
),
4545
// Ethereum Sepolia
4646
(

src/env/pokt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fn default_supported_chains() -> HashMap<String, (String, Weight)> {
7979
// Ethereum mainnet
8080
(
8181
"eip155:1".into(),
82-
("eth".into(), Weight::new(Priority::Normal).unwrap()),
82+
("eth".into(), Weight::new(Priority::Minimal).unwrap()),
8383
),
8484
// Ethereum holesky
8585
(

src/env/publicnode.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ fn default_supported_chains() -> HashMap<String, (String, Weight)> {
3838
// Ethereum mainnet
3939
(
4040
"eip155:1".into(),
41-
("ethereum-rpc".into(), Weight::new(Priority::Low).unwrap()),
41+
(
42+
"ethereum-rpc".into(),
43+
Weight::new(Priority::Minimal).unwrap(),
44+
),
4245
),
4346
// Ethereum Sepolia
4447
(

src/providers/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,7 @@ pub enum Priority {
756756
High,
757757
Normal,
758758
Low,
759+
Minimal,
759760
Disabled,
760761
Custom(u64),
761762
}
@@ -769,6 +770,7 @@ impl TryInto<PriorityValue> for Priority {
769770
Self::High => PriorityValue::new(MAX_PRIORITY / 4 + MAX_PRIORITY / 2),
770771
Self::Normal => PriorityValue::new(MAX_PRIORITY / 2),
771772
Self::Low => PriorityValue::new(MAX_PRIORITY / 4),
773+
Self::Minimal => PriorityValue::new(1),
772774
Self::Disabled => PriorityValue::new(0),
773775
Self::Custom(value) => PriorityValue::new(value),
774776
}

0 commit comments

Comments
 (0)