Skip to content

Commit

Permalink
refactor(consensus)!: replace Validator address bytes with pubkey byt…
Browse files Browse the repository at this point in the history
…es (nervosnetwork#354) (#2)

* change(consensus): replace Validator address bytes with pubkey bytes

BREAKING CHANGE:
- replace Validator address bytes with pubkey bytes

* change(consensus): log validator address instead of its public key

Block proposer is address instead public key

* fix: compilation failed
  • Loading branch information
zeroqn committed Jul 24, 2020
1 parent 2eac67d commit acbe774
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ util = { path = "built-in-services/util"}
rand = "0.7"
core-network = { path = "./core/network", features = ["diagnostic"] }
tokio = { version = "0.2", features = ["full"] }
bs58 = "0.3"

[workspace]
members = [
Expand Down
2 changes: 2 additions & 0 deletions core/consensus/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,8 @@ impl<Adapter: ConsensusAdapter + 'static> Engine<FixedPill> for ConsensusEngine<
pub_key: Bytes,
msg: OverlordMsg<FixedPill>,
) -> Result<(), Box<dyn Error + Send>> {
let address = Address::from_pubkey_bytes(pub_key)?;

match msg {
OverlordMsg::SignedVote(sv) => {
let msg = sv.rlp_bytes();
Expand Down
1 change: 1 addition & 0 deletions protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ cita_trie = "2.0"
json = "0.12"
byteorder = "1.3"
muta-codec-derive = "0.2"
bs58 = "0.3"

[dev-dependencies]
rayon = "1.3"
Expand Down

0 comments on commit acbe774

Please sign in to comment.