cita-cloud / consensus_raft

The raft consensus component for CITA Cloud.
Apache License 2.0
3 stars 0 forks source link

Redundant block height updates #43

Closed whfuyn closed 2 years ago

whfuyn commented 2 years ago

https://github.com/cita-cloud/consensus_raft/blob/55971e8d7569b287f96e3dd569117ccc626c3f09/src/peer.rs#L210-L211

https://github.com/cita-cloud/consensus_raft/blob/55971e8d7569b287f96e3dd569117ccc626c3f09/src/peer.rs#L346-L347

update_block_height after update_consensus_config is not needed. The former is only an optimization for the frequently updated block height data which is a part of the consensus config.

I should have added a comment about this.

https://github.com/cita-cloud/consensus_raft/blob/55971e8d7569b287f96e3dd569117ccc626c3f09/src/storage.rs#L598-L600

https://github.com/cita-cloud/consensus_raft/blob/55971e8d7569b287f96e3dd569117ccc626c3f09/src/storage.rs#L585-L587