Fixed code review.

pull/4377/head
frozen 2 years ago committed by Casey Gardiner
parent 3ba619bcd3
commit ca20ab73ec
  1. 3
      consensus/consensus_v2.go
  2. 2
      hmy/hmy.go
  3. 9
      internal/params/config.go
  4. 6
      node/api.go

@ -137,7 +137,6 @@ func (consensus *Consensus) HandleMessageUpdate(ctx context.Context, msg *msg_pb
}
func (consensus *Consensus) finalCommit() {
// THIS IS NOT GOOD PLACE FOR LEADER SWITCHING
numCommits := consensus.Decider.SignersCount(quorum.Commit)
consensus.getLogger().Info().
@ -714,7 +713,7 @@ func (consensus *Consensus) rotateLeader(epoch *big.Int) {
if header == nil {
return
}
// Previous epoch, we should not change leader.
// Previous block was epoch block, we should not change leader.
if header.Epoch().Uint64() != epoch.Uint64() {
return
}

@ -18,7 +18,6 @@ import (
"github.com/harmony-one/harmony/core/types"
"github.com/harmony-one/harmony/core/vm"
nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
"github.com/harmony-one/harmony/multibls"
commonRPC "github.com/harmony-one/harmony/rpc/common"
"github.com/harmony-one/harmony/shard"
staking "github.com/harmony-one/harmony/staking/types"
@ -97,7 +96,6 @@ type NodeAPI interface {
GetStakingTransactionsCount(address, txType string) (uint64, error)
GetTraceResultByHash(hash common.Hash) (json.RawMessage, error)
IsCurrentlyLeader() bool
GetPublicKeys() multibls.PublicKeys
IsOutOfSync(shardID uint32) bool
SyncStatus(shardID uint32) (bool, uint64, uint64)
SyncPeers() map[string]int

@ -274,7 +274,7 @@ var (
LeaderRotationEpoch: big.NewInt(4),
LeaderRotationBlocksCount: 5,
FeeCollectEpoch: big.NewInt(5),
LeaderRotationEpoch: big.NewInt(4),
LeaderRotationEpoch: EpochTBD,
LeaderRotationBlocksCount: 5,
}
@ -357,10 +357,9 @@ var (
big.NewInt(0), // SlotsLimitedEpoch
big.NewInt(1), // CrossShardXferPrecompileEpoch
big.NewInt(0), // AllowlistEpoch
big.NewInt(1), // LeaderRotationEpoch
64, // LeaderRotationBlocksCount
big.NewInt(0), // FeeCollectEpoch
big.NewInt(1), // LeaderRotationEpoch
64, // LeaderRotationBlocksCount
big.NewInt(0), // FeeCollectEpoch
}
// TestRules ...

@ -6,7 +6,6 @@ import (
"github.com/harmony-one/harmony/eth/rpc"
"github.com/harmony-one/harmony/hmy"
"github.com/harmony-one/harmony/internal/tikv"
"github.com/harmony-one/harmony/multibls"
"github.com/harmony-one/harmony/rosetta"
hmy_rpc "github.com/harmony-one/harmony/rpc"
rpc_common "github.com/harmony-one/harmony/rpc/common"
@ -19,11 +18,6 @@ func (node *Node) IsCurrentlyLeader() bool {
return node.Consensus.IsLeader()
}
// GetPublicKeys exposes if node is currently the leader node
func (node *Node) GetPublicKeys() multibls.PublicKeys {
return node.Consensus.GetPrivateKeys().GetPublicKeys()
}
// PeerConnectivity ..
func (node *Node) PeerConnectivity() (int, int, int) {
return node.host.PeerConnectivity()

Loading…
Cancel
Save