Skip to content

Commit

Permalink
increased keystore user size. cleaned old imports
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph committed Sep 22, 2020
1 parent 5475707 commit cb653a1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
5 changes: 4 additions & 1 deletion api/keystore/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ import (
const (
// maxUserLen is the maximum allowed length of a username
maxUserLen = 1024

maxPackerSize = 1 << 20 // max size, in bytes, of something being marshalled by Marshal()
maxSliceLength = 1 << 18
)

var (
Expand Down Expand Up @@ -75,7 +78,7 @@ type Keystore struct {
// Initialize the keystore
func (ks *Keystore) Initialize(log logging.Logger, db database.Database) {
ks.log = log
ks.codec = codec.NewDefault()
ks.codec = codec.New(maxPackerSize, maxSliceLength)
ks.users = make(map[string]*password.Hash)
ks.userDB = prefixdb.New([]byte("users"), db)
ks.bcDB = prefixdb.New([]byte("bcs"), db)
Expand Down
5 changes: 2 additions & 3 deletions genesis/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import (
"encoding/hex"
"encoding/json"

"github.com/ava-labs/avalanche-go/utils/formatting"

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/constants"
"github.com/ava-labs/avalanchego/utils/formatting"
"github.com/ava-labs/avalanchego/utils/wrappers"

safemath "github.com/ava-labs/avalanche-go/utils/math"
safemath "github.com/ava-labs/avalanchego/utils/math"
)

// LockedAmount ...
Expand Down
3 changes: 1 addition & 2 deletions genesis/unparsed_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import (
"encoding/hex"
"errors"

"github.com/ava-labs/avalanche-go/utils/constants"

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/constants"
"github.com/ava-labs/avalanchego/utils/formatting"
)

Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.14
require (
github.com/AppsFlyer/go-sundheit v0.2.0
github.com/Microsoft/go-winio v0.4.14
github.com/ava-labs/avalanche-go v0.8.0-beta
github.com/ava-labs/coreth v0.3.4 // indirect
github.com/ava-labs/go-ethereum v1.9.3
github.com/btcsuite/btcutil v1.0.2
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:
github.com/aristanetworks/goarista v0.0.0-20200812190859-4cb0e71f3c0e h1:tkEt0le4Lv5+VmcxZPIVSrP8LVPLhndIm/BOP7iPh/w=
github.com/aristanetworks/goarista v0.0.0-20200812190859-4cb0e71f3c0e/go.mod h1:QZe5Yh80Hp1b6JxQdpfSEEe8X7hTyTEZSosSrFf/oJE=
github.com/aristanetworks/splunk-hec-go v0.3.3/go.mod h1:1VHO9r17b0K7WmOlLb9nTk/2YanvOEnLMUgsFrxBROc=
github.com/ava-labs/avalanche-go v0.8.0-beta h1:VdSvj5DKIdzdmK0tk8l1jQIc1m3N7KRTHXTW+9I1LfI=
github.com/ava-labs/avalanche-go v0.8.0-beta/go.mod h1:quYojL1hu0ue2glUT1ng28kADs9R94zGdEvfW0/HRg8=
github.com/ava-labs/avalanche-go v0.8.3 h1:QsfcuwQB7K5sS9NNthO8kX9rClJYFZ+awGs/eSjJgo4=
github.com/ava-labs/avalanchego v0.6.1-rc.1/go.mod h1:TT6uA1BETZpVMR0xiFtE8I5Mv4DULlS+lAL3xuYKnpA=
github.com/ava-labs/avalanchego v0.8.0-beta/go.mod h1:quYojL1hu0ue2glUT1ng28kADs9R94zGdEvfW0/HRg8=
github.com/ava-labs/avalanchego v0.8.3/go.mod h1:6zPzQv7m6vSvdKAwH+lLTga0IMd/0+HLMT5OULrpFcU=
Expand Down

0 comments on commit cb653a1

Please sign in to comment.