Skip to content

Commit

Permalink
change scoring
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Nov 14, 2023
1 parent d8af16e commit 4959aa2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/erc20_rpc_pool/src/rpc_pool/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ pub struct Web3RpcEndpoint {

impl Web3RpcEndpoint {
pub fn get_score(&self) -> i64 {
self.web3_rpc_info.penalty_from_last_critical_error
+ self.web3_rpc_info.penalty_from_ms
+ self.web3_rpc_info.penalty_from_head_behind
100 - self.web3_rpc_info.penalty_from_last_critical_error
- self.web3_rpc_info.penalty_from_ms
- self.web3_rpc_info.penalty_from_head_behind
+ self.web3_rpc_info.bonus_from_last_chosen
+ self.web3_rpc_info.penalty_from_errors
- self.web3_rpc_info.penalty_from_errors
}
pub fn get_validation_score(&self) -> i64 {
self.web3_rpc_info.penalty_from_ms + self.web3_rpc_info.penalty_from_head_behind
100 - self.web3_rpc_info.penalty_from_ms - self.web3_rpc_info.penalty_from_head_behind
}
}

Expand Down

0 comments on commit 4959aa2

Please sign in to comment.