Skip to content

Commit c67a084

Browse files
Nishant Dasrauljordan
Nishant Das
authored andcommitted
Clean Up Todos and Add in Issue Checker (#640)
1 parent 26cad3f commit c67a084

File tree

6 files changed

+15
-8
lines changed

6 files changed

+15
-8
lines changed

beacon-chain/blockchain/service.go

-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ func NewChainService(ctx context.Context, cfg *Config) (*ChainService, error) {
7474

7575
// Start a blockchain service's main event loop.
7676
func (c *ChainService) Start() {
77-
// TODO(#474): Fetch the slot: (block, state) DAGs from persistent storage
78-
// to truly continue across sessions.
7977
log.Info("Starting service")
8078

8179
var err error

beacon-chain/db/schema.go

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ var (
2727
simulatedBlockKey = []byte("last-simulated-block")
2828

2929
// Data item suffixes.
30-
// TODO(#514): Change suffixes back to prefixes as originally designed after issue 514 is solved or after BoltDB migration
3130
blockSuffix = []byte("-block") // blockhash + blockPrefix -> block
3231
canonicalSuffix = []byte("-canonical") // num(uint64 big endian) + cannoicalSuffix -> blockhash
3332
attestationSuffix = []byte("-attestation") // attestationHash + attestationSuffix -> attestation

beacon-chain/types/crystallized_state.go

-2
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ func (c *CrystallizedState) isDynastyTransition(slotNumber uint64) bool {
245245
func (c *CrystallizedState) getAttesterIndices(attestation *pb.AggregatedAttestation) ([]uint32, error) {
246246
slotsStart := c.LastStateRecalculationSlot() - params.GetConfig().CycleLength
247247
slotIndex := (attestation.Slot - slotsStart) % params.GetConfig().CycleLength
248-
// TODO(#267): ShardAndCommitteesForSlots will return default value because the spec for dynasty transition is not finalized.
249248
shardCommitteeArray := c.data.ShardAndCommitteesForSlots
250249
shardCommittee := shardCommitteeArray[slotIndex].ArrayShardAndCommittee
251250
for i := 0; i < len(shardCommittee); i++ {
@@ -312,7 +311,6 @@ func (c *CrystallizedState) NewStateRecalculations(aState *ActiveState, block *B
312311
blockVoteBalance = 0
313312
}
314313

315-
// TODO(#542): This should have been total balance of the validators in the slot committee.
316314
if 3*blockVoteBalance >= 2*c.TotalDeposits() {
317315
if slot > justifiedSlot {
318316
justifiedSlot = slot

scripts/check-todo.sh

+14
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,18 @@ then
77
echo "Invalid TODOs found. Failing." >&2;
88
echo "$OUTPUT" >&2;
99
exit 1;
10+
fi
11+
12+
13+
while read -r line ; do
14+
linenum=`expr $line : '^\([0-9]*:\)'`
15+
issueNum=${line//$linenum}
16+
issueState=$(curl https://api.github.com/repos/prysmaticlabs/prysm/issues/$issueNum | grep -o '"state":"closed"');
17+
18+
if [ "$issueState" != "" ];
19+
then
20+
echo "Issue referenced has already been closed" >&2;
21+
echo "Issue Number: $issueNum" >&2;
22+
exit 1;
1023
fi
24+
done < <(grep -PrinH -o -h '(?<!context\.)todo\(#{0,1}\K(\d+)' --include \*.go *)

shared/p2p/service.go

-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ func (s *Server) Send(msg proto.Message, peer Peer) {
173173

174174
// Broadcast a message to the world.
175175
func (s *Server) Broadcast(msg proto.Message) {
176-
// TODO(#176): https://github.com/prysmaticlabs/prysm/issues/176
177176
topic := s.topicMapping[messageType(msg)]
178177
log.WithFields(logrus.Fields{
179178
"topic": topic,

validator/proposer/service.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ func (p *Proposer) run(done <-chan struct{}, client pb.ProposerServiceClient) {
168168
p.lock.Lock()
169169

170170
bitmask := p.GenerateBitmask(p.pendingAttestation)
171-
172-
// TODO(#552): Implement real proposals with randao reveals and attestation fields.
171+
// TODO(#619): Implement real proposals with randao reveals and attestation fields.
173172
req := &pb.ProposeRequest{
174173
ParentHash: latestBlockHash[:],
175174
// TODO(#511): Fix to be the actual, timebased slot number instead.

0 commit comments

Comments
 (0)