crank the part size; prioritize data channel
This commit is contained in:
parent
898f44ddda
commit
5e42c96267
|
@ -91,9 +91,9 @@ func (conR *ConsensusReactor) GetChannels() []*p2p.ChannelDescriptor {
|
||||||
SendQueueCapacity: 100,
|
SendQueueCapacity: 100,
|
||||||
},
|
},
|
||||||
&p2p.ChannelDescriptor{
|
&p2p.ChannelDescriptor{
|
||||||
ID: DataChannel,
|
ID: DataChannel, // maybe split between gossiping current block and catchup stuff
|
||||||
Priority: 2,
|
Priority: 200, // once we gossip the whole block there's nothing left to send until next height or round
|
||||||
SendQueueCapacity: 50,
|
SendQueueCapacity: 100,
|
||||||
RecvBufferCapacity: 50 * 4096,
|
RecvBufferCapacity: 50 * 4096,
|
||||||
},
|
},
|
||||||
&p2p.ChannelDescriptor{
|
&p2p.ChannelDescriptor{
|
||||||
|
|
|
@ -835,8 +835,8 @@ func (cs *ConsensusState) decideProposal(height, round int) {
|
||||||
part := blockParts.GetPart(i)
|
part := blockParts.GetPart(i)
|
||||||
cs.sendInternalMessage(msgInfo{&BlockPartMessage{cs.Height, cs.Round, part}, ""})
|
cs.sendInternalMessage(msgInfo{&BlockPartMessage{cs.Height, cs.Round, part}, ""})
|
||||||
}
|
}
|
||||||
log.Info("Signed and sent proposal", "height", height, "round", round, "proposal", proposal)
|
log.Info("Signed proposal", "height", height, "round", round, "proposal", proposal)
|
||||||
log.Debug(Fmt("Signed and sent proposal block: %v", block))
|
log.Debug(Fmt("Signed proposal block: %v", block))
|
||||||
} else {
|
} else {
|
||||||
log.Warn("enterPropose: Error signing proposal", "height", height, "round", round, "error", err)
|
log.Warn("enterPropose: Error signing proposal", "height", height, "round", round, "error", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -337,6 +337,7 @@ type Data struct {
|
||||||
|
|
||||||
func (data *Data) Hash() []byte {
|
func (data *Data) Hash() []byte {
|
||||||
if config.GetBool("disable_data_hash") {
|
if config.GetBool("disable_data_hash") {
|
||||||
|
// we could use the part_set hash instead
|
||||||
data.hash = []byte{}
|
data.hash = []byte{}
|
||||||
return data.hash
|
return data.hash
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
partSize = 4096 // 4KB
|
partSize = 65536 // 64KB ... 4096 // 4KB
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -203,6 +203,7 @@ func (ps *PartSet) AddPart(part *Part) (bool, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check hash proof
|
// 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()) {
|
if !part.Proof.Verify(part.Index, ps.total, part.Hash(), ps.Hash()) {
|
||||||
return false, ErrPartSetInvalidProof
|
return false, ErrPartSetInvalidProof
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue