Skip to content

Commit

Permalink
Merge pull request #138 from SurfingNerd/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
SurfingNerd authored Nov 22, 2024
2 parents 186458a + a112e6a commit 3c82185
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- ubuntu-latest
# - macos-latest
toolchain:
- 1.72
- 1.75
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout sources
Expand All @@ -32,7 +32,8 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: test
args: --locked --all --release --features "json-tests" --verbose --no-run
#args: deactivated JSON Tests, so we do not run out of quota on CI tests for merge intesive time. --locked --all --release --features "json-tests" --verbose --no-run
args: --locked --all --release --verbose --no-run
- name: Run tests for ${{ matrix.platform }}
uses: actions-rs/cargo@v1
with:
Expand Down
17 changes: 10 additions & 7 deletions crates/ethcore/src/engines/hbbft/hbbft_peers_management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ use ethereum_types::Address;
#[derive(Clone, Debug)]
struct ValidatorConnectionData {
// mining_address: Address,
staking_address: Address,
socket_addr: SocketAddr,
public_key: NodeId,
// staking_address: Address,
// socket_addr: SocketAddr,
// public_key: NodeId,
peer_string: String,
mining_address: Address,
}
Expand All @@ -40,7 +40,9 @@ impl HbbftPeersManagement {
}
}

/// connections are not always required
/// connections are not always required.
/// - during syncing
/// - if not validator address specified.
fn should_not_connect(&self, client: &dyn BlockChainClient) -> bool {
// don't do any connections while the network is syncing.
// the connection is not required yet, and might be outdated.
Expand Down Expand Up @@ -542,14 +544,15 @@ fn connect_to_validator_core(
info!(target: "engine", "adding reserved peer: {}", peer_string);
if let Err(err) = peers_management.add_reserved_peer(&peer_string) {
warn!(target: "engine", "failed to adding reserved: {} : {}", peer_string, err);
return None;
}

return Some(ValidatorConnectionData {
staking_address: staking_address,
//staking_address: staking_address,
//mining_address: *address,
socket_addr: socket_addr,
//socket_addr: socket_addr,
peer_string,
public_key: node_id.clone(),
//public_key: node_id.clone(),
mining_address: Address::zero(), // all caller of this function will set this value.
});
} else {
Expand Down

0 comments on commit 3c82185

Please sign in to comment.