Skip to content

Commit

Permalink
Merge branch 'master' into rpc-userpass-checks
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph authored Mar 18, 2020
2 parents 05a2bcb + 71c01fd commit 0d29aed
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 7 additions & 1 deletion node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ import (
"github.com/ava-labs/gecko/vms/timestampvm"
)

const (
maxMessageSize = 1 << 25 // maximum size of a message sent with salticidae
)

// MainNode is the reference for node callbacks
var MainNode = Node{}

Expand All @@ -54,7 +58,7 @@ type Node struct {
LogFactory logging.Factory
HTTPLog logging.Logger

// This node's unique ID used when communicationg with other nodes
// This node's unique ID used when communicating with other nodes
// (in consensus, for example)
ID ids.ShortID

Expand Down Expand Up @@ -138,6 +142,7 @@ func (n *Node) initNetlib() error {
peerConfig := salticidae.NewPeerNetworkConfig()
if n.Config.EnableStaking {
msgConfig := peerConfig.AsMsgNetworkConfig()
msgConfig.MaxMsgSize(maxMessageSize)
msgConfig.EnableTLS(true)
msgConfig.TLSKeyFile(n.Config.StakingKeyFile)
msgConfig.TLSCertFile(n.Config.StakingCertFile)
Expand All @@ -156,6 +161,7 @@ func (n *Node) initNetlib() error {
if n.Config.ThroughputServerEnabled {
// Create the client network
msgConfig := salticidae.NewMsgNetworkConfig()
msgConfig.MaxMsgSize(maxMessageSize)
n.ClientNet = salticidae.NewMsgNetwork(n.EC, msgConfig, &err)
if code := err.GetCode(); code != 0 {
return errors.New(salticidae.StrError(code))
Expand Down
4 changes: 2 additions & 2 deletions vms/components/codec/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const (
)

const (
defaultMaxSize = 1 << 19 // default max size, in bytes, of something being marshalled by Marshal()
defaultMaxSliceLength = 1 << 19 // default max length of a slice being marshalled by Marshal()
defaultMaxSize = 1 << 18 // default max size, in bytes, of something being marshalled by Marshal()
defaultMaxSliceLength = 1 << 18 // default max length of a slice being marshalled by Marshal()
)

// ErrBadCodec is returned when one tries to perform an operation
Expand Down
2 changes: 2 additions & 0 deletions vms/platformvm/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,8 @@ func (service *Service) signAddNonDefaultSubnetValidatorTx(tx *addNonDefaultSubn
return nil, errors.New("no place for key to sign")
}

crypto.SortSECP2561RSigs(tx.ControlSigs)

return tx, nil
}

Expand Down

0 comments on commit 0d29aed

Please sign in to comment.