func prefixKeyRange(prefix string) (start, end []byte) {
	start = []byte(prefix)
	for i := len(start) - 1; i >= 0; i-- {
		c := start[i]
		if c < 0xff {
			end = make([]byte, i+1)
			copy(end, start)
			end[i]++
			return
		}
	}
	return
}
Returns the start key equal to the bs of prefix and the end key which lexicographically above any key beginning
with prefix
package state
import (
	"fmt"
	"sync"
	"github.com/gallactic/gallactic/common/binary"
	"github.com/gallactic/gallactic/core/account"
	"github.com/gallactic/gallactic/core/account/permission"
	"github.com/gallactic/gallactic/core/proposal"
	"github.com/gallactic/gallactic/core/validator"
	"github.com/gallactic/gallactic/crypto"
	"github.com/tendermint/iavl"
	dbm "github.com/tendermint/tendermint/libs/db"
)
const (
	defaultCacheCapacity = 1024
	versionPrefix = "v/"
	accountPrefix   = "a/"
	storagePrefix   = "s/"
	validatorPrefix = "i/"
)
var (
	accountsStart, accountsEnd   []byte = prefixKeyRange(accountPrefix)
	validatorStart, validatorEnd []byte = prefixKeyRange(validatorPrefix)
	storageStart, storageEnd     []byte = prefixKeyRange(storagePrefix)
)
func prefixedKey(prefix string, suffixes ...[]byte) []byte {
	key := []byte(prefix)
	for _, suffix := range suffixes {
		key = append(key, suffix...)
	}
	return key
}