Skip to content

Commit 4c651f0

Browse files
authored
Merge pull request #413 from lazyledger/ismail/dont_cancel_putblock
Small workaround to enable using the DAS light client again
2 parents 09d3c3b + 5a0fcd4 commit 4c651f0

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

consensus/state.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,8 +1122,24 @@ func (cs *State) defaultDecideProposal(height int64, round int32) {
11221122
}
11231123

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

0 commit comments

Comments
 (0)