enable heartbeatTime and leaderLeaseTimeout configurations not to be calculated through electTimeout, but to support independent configuration
optimize preLogTerm compare, by comparing the preLogIndex of the requesting voting node with its own preLogIndex to obtain preLogTerm, instead of using state. preLogTerm fixed, we can improves the speed of voting
optimize the voting decision for candidates. candidates within the same term are first voted for by oneself. When receiving voting requests from other nodes within the same term, if one is still in a candidate state and their data is outdated, their votes will be transferred to other nodes improves the speed of voting
optimize installsnapshot so that it can only be successfully issued once during concurrent execution of installsnapshot, and under the control of installSnapshotMutex, other queued requests entering the installsnapshot method are automatically canceled to determine if their request is outdated
add responseHeartbeat for follower when it receive heartbeat from leader
add a leader lease mechanism, where the leader determines whether more than half of the nodes are unresponsive by judging whether they have received a follower response, thereby actively transitioning to a follower state, avoiding the problem of dual leaders in network partitioning