From 8d3ef0d5dcfa1b7057634fd2a1608ce3a2c39aa8 Mon Sep 17 00:00:00 2001 From: scx1332 Date: Fri, 17 Nov 2023 17:52:11 +0100 Subject: [PATCH] f --- crates/erc20_rpc_pool/src/rpc_pool/pool.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/erc20_rpc_pool/src/rpc_pool/pool.rs b/crates/erc20_rpc_pool/src/rpc_pool/pool.rs index b7a8db42..99f03b5d 100644 --- a/crates/erc20_rpc_pool/src/rpc_pool/pool.rs +++ b/crates/erc20_rpc_pool/src/rpc_pool/pool.rs @@ -27,7 +27,7 @@ impl Web3RpcEndpoint { + self.web3_rpc_info.penalty_from_head_behind as f64 + self.web3_rpc_info.penalty_from_errors as f64; - let negative_score_exp = (-negative_score / 500.0).exp(); + let negative_score_exp = (-negative_score / 2000.0).exp(); //negative_score_exp should be in 0 to 1 range negative_score_exp * 75.0 + self.web3_rpc_info.bonus_from_last_chosen as f64 } @@ -37,7 +37,7 @@ impl Web3RpcEndpoint { } let negative_score = self.web3_rpc_info.penalty_from_ms as f64 + self.web3_rpc_info.penalty_from_head_behind as f64; - let negative_score_exp = (-negative_score / 500.0).exp(); + let negative_score_exp = (-negative_score / 2000.0).exp(); negative_score_exp * 100.0 }