Skip to content

Commit

Permalink
Merge pull request #413 from lazyledger/ismail/dont_cancel_putblock
Browse files Browse the repository at this point in the history
Small workaround to enable using the DAS light client again
  • Loading branch information
liamsi authored Jun 13, 2021
2 parents 09d3c3b + 5a0fcd4 commit 4c651f0
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -1122,8 +1122,24 @@ func (cs *State) defaultDecideProposal(height int64, round int32) {
}

// cancel ctx for previous proposal block to ensure block putting/providing does not queues up
if cs.proposalCancel != nil {
cs.proposalCancel()
if cs.proposalCancel != nil { //nolint:staticcheck
// FIXME(ismail): below commented out cancel tries to prevent block putting
// and providing no to queue up endlessly.
// But in a real network proposers should have enough time in between.
// And even if not, queuing up to a problematic extent will take a lot of time:
// Even on the Cosmos Hub the largest validator only proposes every 15 blocks.
// With an average block time of roughly 7.5 seconds this means almost
// two minutes between two different proposals by the same validator.
// For other validators much more time passes in between.
// In our case block interval times will likely be larger.
// And independent of this DHT providing will be made faster:
// - https://github.com/lazyledger/lazyledger-core/issues/395
//
// Furthermore, and independent of all of the above,
// the provide timeout could still be larger than just the time between
// two consecutive proposals.
//
// cs.proposalCancel()
}
cs.proposalCtx, cs.proposalCancel = context.WithCancel(context.TODO())
go func(ctx context.Context) {
Expand Down

0 comments on commit 4c651f0

Please sign in to comment.