Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Raft stability #886

Merged
merged 2 commits into from
Nov 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions core/tx_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -1323,3 +1323,8 @@ func checkAccount(fromAcct common.Address, toAcct *common.Address) error {
}
return nil
}

// helper function to return chainHeadChannel size
func GetChainHeadChannleSize() int {
return chainHeadChanSize
}
2 changes: 1 addition & 1 deletion raft/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func NewProtocolManager(raftId uint16, raftPort uint16, blockchain *core.BlockCh
joinExisting: joinExisting,
blockchain: blockchain,
eventMux: mux,
blockProposalC: make(chan *types.Block),
blockProposalC: make(chan *types.Block, 10),
confChangeProposalC: make(chan raftpb.ConfChange),
httpstopc: make(chan struct{}),
httpdonec: make(chan struct{}),
Expand Down
4 changes: 2 additions & 2 deletions raft/minter.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func newMinter(config *params.ChainConfig, eth *RaftService, blockTime time.Dura
speculativeChain: newSpeculativeChain(),

invalidRaftOrderingChan: make(chan InvalidRaftOrdering, 1),
chainHeadChan: make(chan core.ChainHeadEvent, 1),
chainHeadChan: make(chan core.ChainHeadEvent, core.GetChainHeadChannleSize()),
txPreChan: make(chan core.NewTxsEvent, 4096),
}

Expand Down Expand Up @@ -213,7 +213,7 @@ func throttle(rate time.Duration, f func()) func() {

for range ticker.C {
<-request.Out()
go f()
f()
}
}()

Expand Down