malachite-integrate initial commit#15
Merged
qj0r9j0vc2 merged 8 commits intomainfrom Jan 17, 2026
Merged
Conversation
qj0r9j0vc2
approved these changes
Jan 10, 2026
qj0r9j0vc2
requested changes
Jan 11, 2026
Member
There was a problem hiding this comment.
Thanks for the solid foundation on Malachite integration. The feature-gated architecture and adapter pattern look great, and the README does a nice job explaining how everything fits together.
Before merging, please address the following:
Required Changes
1. Handle empty validator set gracefully
context.rs:103 - The select_proposer will panic on empty validator sets:
validator_set.get(idx).expect("validator_set must not be empty")Please add validation at CipherBftContext::new() to return an error if the validator set is empty.
2. Fix CutProposalPart equality check
proposal.rs:94-98 - Current impl ignores first/last flags:
fn eq(&self, other: &Self) -> bool {
self.cut.hash() == other.cut.hash()
&& self.first == other.first
&& self.last == other.last
}Suggestions (non-blocking)
- Add
is_empty()toConsensusValidatorSet(clippy will warn) - Wire
ConsensusConfigtimeouts intoEngineConsensusConfig - Add unit tests for validator set sorting and encode functions
Let me know when these are addressed and I'll re-review. Great progress overall!
fix: address consensus review feedback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Malachite Consensus Implementation Review
This document summarizes the Malachite consensus layer components that have been implemented so far.
Implemented Components
1. Context Creation Helper
create_context()-crates/consensus/src/engine.rsConvenience function to create a CipherBFT context.
2. ConsensusParams Creation Helper
default_consensus_params()-crates/consensus/src/engine.rsCreates Malachite's
ConsensusParamsfrom a CipherBFT context. Setsvalue_payloadtoProposalOnly(for single-part Cut support).3. EngineConfig Creation Helper
default_engine_config_single_part()-crates/consensus/src/engine.rsCreates a Malachite engine configuration for single-part proposals.
4. SigningProvider Implementation
ConsensusSigningProvider-crates/consensus/src/signing.rsBridges CipherBFT's Ed25519 keys with Malachite's
SigningProvidertrait. Implements signing and verification methods for Vote, Proposal, and ProposalPart.Architecture Overview
Component Status for MalachiteEngineBuilder
CipherBftContextcreate_context()ConsensusParamsdefault_consensus_params()EngineConsensusConfigdefault_engine_config_single_part()SigningProviderConsensusSigningProvider::new()NetworkRefHostRefWalRefUsage Flow
Next Steps
AppMsgevents (Cut fetch, execute, etc.)