crank the part size; prioritize data channel

This commit is contained in:
Ethan Buchman 2016-03-10 20:20:07 -05:00
parent 898f44ddda
commit 5e42c96267
4 changed files with 8 additions and 6 deletions

View File

@ -91,9 +91,9 @@ func (conR *ConsensusReactor) GetChannels() []*p2p.ChannelDescriptor {
SendQueueCapacity: 100,
},
&p2p.ChannelDescriptor{
ID: DataChannel,
Priority: 2,
SendQueueCapacity: 50,
ID: DataChannel, // maybe split between gossiping current block and catchup stuff
Priority: 200, // once we gossip the whole block there's nothing left to send until next height or round
SendQueueCapacity: 100,
RecvBufferCapacity: 50 * 4096,
},
&p2p.ChannelDescriptor{

View File

@ -835,8 +835,8 @@ func (cs *ConsensusState) decideProposal(height, round int) {
part := blockParts.GetPart(i)
cs.sendInternalMessage(msgInfo{&BlockPartMessage{cs.Height, cs.Round, part}, ""})
}
log.Info("Signed and sent proposal", "height", height, "round", round, "proposal", proposal)
log.Debug(Fmt("Signed and sent proposal block: %v", block))
log.Info("Signed proposal", "height", height, "round", round, "proposal", proposal)
log.Debug(Fmt("Signed proposal block: %v", block))
} else {
log.Warn("enterPropose: Error signing proposal", "height", height, "round", round, "error", err)
}

View File

@ -337,6 +337,7 @@ type Data struct {
func (data *Data) Hash() []byte {
if config.GetBool("disable_data_hash") {
// we could use the part_set hash instead
data.hash = []byte{}
return data.hash
}

View File

@ -15,7 +15,7 @@ import (
)
const (
partSize = 4096 // 4KB
partSize = 65536 // 64KB ... 4096 // 4KB
)
var (
@ -203,6 +203,7 @@ func (ps *PartSet) AddPart(part *Part) (bool, error) {
}
// Check hash proof
// TODO: minor gains for not checking part sets we made
if !part.Proof.Verify(part.Index, ps.total, part.Hash(), ps.Hash()) {
return false, ErrPartSetInvalidProof
}