Browse Source

crank the part size; prioritize data channel

pull/205/head
Ethan Buchman 9 years ago
parent
commit
5e42c96267
4 changed files with 8 additions and 6 deletions
  1. +3
    -3
      consensus/reactor.go
  2. +2
    -2
      consensus/state.go
  3. +1
    -0
      types/block.go
  4. +2
    -1
      types/part_set.go

+ 3
- 3
consensus/reactor.go 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{


+ 2
- 2
consensus/state.go 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)
}


+ 1
- 0
types/block.go 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
}


+ 2
- 1
types/part_set.go 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
}


Loading…
Cancel
Save