Skip to content

Commit 139bad2

Browse files
authored
chore: remove some dangling todos (#1790)
Resolves some unnecessary todos #### PR checklist - [ ] Tests written/updated - [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments
1 parent 3a18ba9 commit 139bad2

File tree

6 files changed

+3
-12
lines changed

6 files changed

+3
-12
lines changed

consensus/propagation/catchup.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ import (
1212
)
1313

1414
// retryWants ensure that all data for all unpruned compact blocks is requested.
15-
//
16-
// todo: add a request limit for each part to avoid downloading the block too
17-
// many times. atm, this code will request the same part from every peer.
1815
func (blockProp *Reactor) retryWants(currentHeight int64) {
1916
if !blockProp.started.Load() {
2017
return

consensus/propagation/commitment.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,10 @@ func extractProofs(blocks ...*types.PartSet) []*merkle.Proof {
107107

108108
func chunkToPartMetaData(chunk *bits.BitArray, partSet *proptypes.CombinedPartSet) []*propagation.PartMetaData {
109109
partMetaData := make([]*propagation.PartMetaData, 0)
110-
// TODO rename indice to a correct name
111-
for _, indice := range chunk.GetTrueIndices() {
112-
part, _ := partSet.GetPart(uint32(indice))
110+
for _, partIndex := range chunk.GetTrueIndices() {
111+
part, _ := partSet.GetPart(uint32(partIndex))
113112
partMetaData = append(partMetaData, &propagation.PartMetaData{
114-
Index: uint32(indice),
113+
Index: uint32(partIndex),
115114
Hash: part.Proof.LeafHash,
116115
})
117116
}

consensus/propagation/have_wants.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,6 @@ func (blockProp *Reactor) handleRecoveryPart(peer p2p.ID, part *proptypes.Recove
435435
proof = part.Proof
436436
}
437437

438-
// TODO: to verify, compare the hash with that of the have that was sent for
439-
// this part and verified.
440438
added, err := parts.AddPart(part, *proof)
441439
if err != nil {
442440
blockProp.Logger.Error("failed to add part to part set", "peer", peer, "height", part.Height, "round", part.Round, "part", part.Index, "error", err)

consensus/propagation/reactor.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ func (blockProp *Reactor) SetLogger(logger log.Logger) {
121121
}
122122

123123
func (blockProp *Reactor) OnStart() error {
124-
// TODO: implement
125124
return nil
126125
}
127126

consensus/propagation/reactor_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,6 @@ func TestChunkParts(t *testing.T) {
352352
peerCount: 9,
353353
redundancy: 1,
354354
expected: []*bits.BitArray{
355-
// TODO verify if this is the right result
356355
createBitArray(4, []int{0}),
357356
createBitArray(4, []int{1}),
358357
createBitArray(4, []int{2}),

consensus/propagation/types/types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,6 @@ func (h *HaveParts) IsEmpty() bool {
341341
}
342342

343343
func (h *HaveParts) GetIndex(i uint32) bool {
344-
// TODO set the parts in an ordered way and support getting them faster and also get the proof and verify it
345344
for _, part := range h.Parts {
346345
if part.Index == i {
347346
return true

0 commit comments

Comments
 (0)