Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup #138

Merged
merged 4 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
#[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 @@
}
}

/// 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 @@ -299,7 +301,7 @@
/// because those should be current validators by now.
/// Make sure to connect to the new current validators,
/// before disconnecting from the pending validators.
pub fn disconnect_pending_validators(

Check warning on line 304 in crates/ethcore/src/engines/hbbft/hbbft_peers_management.rs

View workflow job for this annotation

GitHub Actions / Check

method `disconnect_pending_validators` is never used

Check warning on line 304 in crates/ethcore/src/engines/hbbft/hbbft_peers_management.rs

View workflow job for this annotation

GitHub Actions / Check

method `disconnect_pending_validators` is never used

Check warning on line 304 in crates/ethcore/src/engines/hbbft/hbbft_peers_management.rs

View workflow job for this annotation

GitHub Actions / Check

method `disconnect_pending_validators` is never used

Check warning on line 304 in crates/ethcore/src/engines/hbbft/hbbft_peers_management.rs

View workflow job for this annotation

GitHub Actions / Test and Build (ubuntu-latest, 1.75)

method `disconnect_pending_validators` is never used

Check warning on line 304 in crates/ethcore/src/engines/hbbft/hbbft_peers_management.rs

View workflow job for this annotation

GitHub Actions / Test and Build (ubuntu-latest, 1.75)

method `disconnect_pending_validators` is never used
&mut self,
client: &dyn BlockChainClient,
) -> Result<usize, String> {
Expand Down Expand Up @@ -542,14 +544,15 @@
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
Loading