Conversation
69e706e to
94e823c
Compare
| n.addrBook.AddOurAddress(nodeInfo.NetAddress()) | ||
|
|
||
| // Run the RPC server first | ||
| // so we can eg. receive txs for the first block |
There was a problem hiding this comment.
first in relation to what?
There was a problem hiding this comment.
to the p2p server we start after
types/part_set.go
Outdated
|
|
||
| func (ps *PartSet) MarshalJSON() ([]byte, error) { | ||
| if ps == nil { | ||
| return []byte("nil-PartSet"), nil |
There was a problem hiding this comment.
shouldn't this be a valid json? like null? or maybe []byte("\"nil-PartSet\"")
There was a problem hiding this comment.
yes it should. maybe we should just do {}
| defer ps.mtx.Unlock() | ||
|
|
||
| return cdc.MarshalJSON(struct { | ||
| CountTotal string `json:"count/total"` |
There was a problem hiding this comment.
why not make them 2 separate fields?
There was a problem hiding this comment.
Figured there's no need to take up the extra space but maybe that's silly (dump consensus is a big dump already). Also we're typically more interested in the ratio than we are in the two numbers
| // and without the height/round/type_ (since its already included in the votes). | ||
| func (voteSet *VoteSet) MarshalJSON() ([]byte, error) { | ||
| voteStrings := make([]string, len(voteSet.votes)) | ||
| for i, vote := range voteSet.votes { |
There was a problem hiding this comment.
what about
voteSet.mtx.Lock()
defer voteSet.mtx.Unlock()
There was a problem hiding this comment.
probably right. String() doesn't have it tho
types/part_set.go
Outdated
| PartsBitArray *cmn.BitArray `json:"parts_bit_array"` | ||
| }{ | ||
| fmt.Sprintf("%d/%d", ps.Count(), ps.Total()), | ||
| ps.partsBitArray.Copy(), |
There was a problem hiding this comment.
now that we have custom marshaller for BitArray's, I think we can drop .Copy() https://github.com/tendermint/tmlibs/blob/develop/common/bit_array.go#L327
|
Thanks for the review @melekes ! |
Codecov Report
@@ Coverage Diff @@
## develop #1511 +/- ##
===========================================
+ Coverage 63.67% 63.84% +0.17%
===========================================
Files 102 102
Lines 9461 9457 -4
===========================================
+ Hits 6024 6038 +14
+ Misses 2873 2860 -13
+ Partials 564 559 -5
|
|
@melekes addressed your comments. PTAL and approve if you like :) |
Fixes: