Skip to content

I229 reserved peers deadlock#232

Merged
SurfingNerd merged 11 commits intoDMDcoin:0.11from
SurfingNerd:i229-reserved-peers-deadlock
Jun 13, 2025
Merged

I229 reserved peers deadlock#232
SurfingNerd merged 11 commits intoDMDcoin:0.11from
SurfingNerd:i229-reserved-peers-deadlock

Conversation

@SurfingNerd
Copy link
Collaborator

@SurfingNerd SurfingNerd commented Jun 13, 2025

#229 - reserved peers management during key gen phase can lead to deadlocks

  • refactored peers management and peer transaction to be executed on an additional IOChannel with 1 worker thread.
    Therefore FIFO guarantees are still met.
  • removed client lock in the HBBFT Core

Updates to transact_silently:

  • Updated the transact_silently method in BlockChainClient and its implementations to return the transaction hash (H256) instead of () upon success. This improves the visibility of transaction outcomes. (crates/ethcore/src/client/traits.rs, crates/ethcore/src/client/client.rs, crates/ethcore/src/client/test_client.rs) [1] [2] [3]

IoService initialization improvements:

  • Added a thread pool size parameter to IoService::start calls in ClientService, AuthorityRound, and HoneyBadgerBFT to improve configurability and performance. (crates/ethcore/service/src/service.rs, crates/ethcore/src/engines/authority_round/mod.rs, crates/ethcore/src/engines/hbbft/hbbft_engine.rs) [1] [2] [3]

Honey Badger BFT (HBBFT) engine refactoring:

  • Introduced a new IoService for managing peer connections (hbbft_peers_service) and registered a corresponding handler (HbbftPeersHandler). (crates/ethcore/src/engines/hbbft/hbbft_engine.rs) [1] [2]
  • Removed unused fields and methods, such as has_sent_availability_tx, peers_management, and related logic for handling availability announcements and internet address announcements. This simplifies the engine's responsibilities. (crates/ethcore/src/engines/hbbft/hbbft_engine.rs) [1] [2] [3]
  • Refactored the do_validator_engine_actions method to return a more specific Error type instead of a generic String. (crates/ethcore/src/engines/hbbft/hbbft_engine.rs)

Logging and minor adjustments:

  • Improved log messages in the set_validator_internet_address and send_tx_announce_availability functions for better clarity and debugging. (crates/ethcore/src/engines/hbbft/contracts/validator_set.rs) [1] [2]
  • Removed redundant code for nonce handling in send_tx_announce_availability. (crates/ethcore/src/engines/hbbft/contracts/validator_set.rs)

These changes collectively aim to enhance the maintainability, performance, and clarity of the codebase.

@SurfingNerd SurfingNerd merged commit 08884b9 into DMDcoin:0.11 Jun 13, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant