Remove DefaultMinimumPow patches in favor of using whisper config (#683)

This commit is contained in:
Alex Kohler 2018-02-19 09:53:40 -05:00 committed by Igor Mandrigin
parent ef0b3bb13d
commit 87b12ddced
5 changed files with 8 additions and 22 deletions

View File

@ -961,15 +961,6 @@ index 7a57488bd..a6c9e610d 100644
)
const (
@@ -57,7 +59,7 @@ const (
MaxMessageSize = uint32(10 * 1024 * 1024) // maximum accepted size of a message.
DefaultMaxMessageSize = uint32(1024 * 1024)
- DefaultMinimumPoW = 0.2
+ DefaultMinimumPoW = 0.001
padSizeLimit = 256 // just an arbitrary number, could be changed without breaking the protocol (must not exceed 2^24)
messageQueueLimit = 1024
@@ -85,3 +87,15 @@ type MailServer interface {
Archive(env *Envelope)
DeliverMail(whisperPeer *Peer, request *Envelope)

View File

@ -32,15 +32,6 @@ index d5d7fed60..5ad660616 100644
)
// Whisper protocol parameters
@@ -67,7 +69,7 @@ const (
MaxMessageSize = uint32(10 * 1024 * 1024) // maximum accepted size of a message.
DefaultMaxMessageSize = uint32(1024 * 1024)
- DefaultMinimumPoW = 0.2
+ DefaultMinimumPoW = 0.001
padSizeLimit = 256 // just an arbitrary number, could be changed without breaking the protocol
messageQueueLimit = 1024
@@ -95,3 +97,15 @@ type MailServer interface {
Archive(env *Envelope)
DeliverMail(whisperPeer *Peer, request *Envelope)

View File

@ -161,9 +161,13 @@ func activateShhService(stack *node.Node, config *params.NodeConfig) error {
}
serviceConstructor := func(*node.ServiceContext) (node.Service, error) {
whisperConfig := config.WhisperConfig
whisperService := whisper.New(nil)
whisperServiceConfig := &whisper.Config{
MaxMessageSize: whisper.DefaultMaxMessageSize,
MinimumAcceptedPOW: 0.001,
}
whisperService := whisper.New(whisperServiceConfig)
whisperConfig := config.WhisperConfig
// enable metrics
whisperService.RegisterEnvelopeTracer(&shhmetrics.EnvelopeTracer{})

View File

@ -59,7 +59,7 @@ const (
MaxMessageSize = uint32(10 * 1024 * 1024) // maximum accepted size of a message.
DefaultMaxMessageSize = uint32(1024 * 1024)
DefaultMinimumPoW = 0.001
DefaultMinimumPoW = 0.2
padSizeLimit = 256 // just an arbitrary number, could be changed without breaking the protocol (must not exceed 2^24)
messageQueueLimit = 1024

View File

@ -69,7 +69,7 @@ const (
MaxMessageSize = uint32(10 * 1024 * 1024) // maximum accepted size of a message.
DefaultMaxMessageSize = uint32(1024 * 1024)
DefaultMinimumPoW = 0.001
DefaultMinimumPoW = 0.2
padSizeLimit = 256 // just an arbitrary number, could be changed without breaking the protocol
messageQueueLimit = 1024