Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: remove global config from x/auth and client #19447

Merged
merged 25 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
30b9967
del: global config from x/auth client/keys
JulianToledano Feb 15, 2024
515f295
fix: lint
JulianToledano Feb 15, 2024
dd03da7
fix: lint
JulianToledano Feb 27, 2024
408f198
Merge branch 'main' into julian/remove-auth-globalConfig
JulianToledano Feb 27, 2024
bfdc12b
fix: test
JulianToledano Feb 27, 2024
03b9b0f
fix: TestSigVerification
JulianToledano Feb 27, 2024
99b6d57
update: NewTxConfig
JulianToledano Feb 29, 2024
b3a9276
fix: x/auth tests
JulianToledano Feb 29, 2024
7b757c1
fix: TestConfigOptions
JulianToledano Feb 29, 2024
deab53e
lint happy
JulianToledano Feb 29, 2024
e5a743e
update: NewTxConfig uses codec ir
JulianToledano Feb 29, 2024
4d50fff
update: NewTxConfig takes address.Codec
JulianToledano Mar 1, 2024
65b76a4
update: use same codecs in app.go
JulianToledano Mar 1, 2024
ef36e35
update: codecs as arguments in NewIntegrationApp
JulianToledano Mar 1, 2024
e8fd0c3
update: CodecOptios as argument in MakeTestEncodingConfig
JulianToledano Mar 4, 2024
2c4b397
CHANGELOG & UPGRADING
JulianToledano Mar 4, 2024
901168d
Merge branch 'main' into julian/remove-auth-globalConfig
JulianToledano Mar 4, 2024
0323d2d
fix: integration tests
JulianToledano Mar 4, 2024
48465bc
fix: autocli test
JulianToledano Mar 4, 2024
05ef8e4
Merge branch 'main' into julian/remove-auth-globalConfig
JulianToledano Mar 4, 2024
8d985a5
Merge branch 'main' into julian/remove-auth-globalConfig
JulianToledano Mar 4, 2024
86d7023
Merge branch 'main' into julian/remove-auth-globalConfig
JulianToledano Mar 6, 2024
5a50d81
update: CodecOptions with codecs
JulianToledano Mar 6, 2024
42b18e0
Merge branch 'main' into julian/remove-auth-globalConfig
JulianToledano Mar 6, 2024
db3486a
fix2
JulianToledano Mar 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions baseapp/abci_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,10 @@ func (s *ABCIUtilsTestSuite) TestDefaultProposalHandler_NoOpMempoolTxSelection()
// create a codec for marshaling
cdc := codectestutil.CodecOptions{}.NewCodec()
baseapptestutil.RegisterInterfaces(cdc.InterfaceRegistry())
signingCtx := cdc.InterfaceRegistry().SigningContext()

// create a baseapp along with a tx config for tx generation
txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes)
txConfig := authtx.NewTxConfig(cdc, signingCtx.AddressCodec(), signingCtx.ValidatorAddressCodec(), authtx.DefaultSignModes)
app := baseapp.NewBaseApp(s.T().Name(), log.NewNopLogger(), dbm.NewMemDB(), txConfig.TxDecoder())

// create a proposal handler
Expand Down Expand Up @@ -422,7 +423,8 @@ func (s *ABCIUtilsTestSuite) TestDefaultProposalHandler_NoOpMempoolTxSelection()
func (s *ABCIUtilsTestSuite) TestDefaultProposalHandler_PriorityNonceMempoolTxSelection() {
cdc := codectestutil.CodecOptions{}.NewCodec()
baseapptestutil.RegisterInterfaces(cdc.InterfaceRegistry())
txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes)
signingCtx := cdc.InterfaceRegistry().SigningContext()
txConfig := authtx.NewTxConfig(cdc, signingCtx.AddressCodec(), signingCtx.ValidatorAddressCodec(), authtx.DefaultSignModes)

var (
secret1 = []byte("secret1")
Expand Down
9 changes: 5 additions & 4 deletions baseapp/baseapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/testutil"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -65,8 +64,9 @@ func NewBaseAppSuite(t *testing.T, opts ...func(*baseapp.BaseApp)) *BaseAppSuite
t.Helper()
cdc := codectestutil.CodecOptions{}.NewCodec()
baseapptestutil.RegisterInterfaces(cdc.InterfaceRegistry())
signingCtx := cdc.InterfaceRegistry().SigningContext()

txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes)
txConfig := authtx.NewTxConfig(cdc, signingCtx.AddressCodec(), signingCtx.ValidatorAddressCodec(), authtx.DefaultSignModes)
db := dbm.NewMemDB()
logBuffer := new(bytes.Buffer)
logger := log.NewLogger(logBuffer, log.ColorOption(false))
Expand Down Expand Up @@ -499,11 +499,12 @@ func TestBaseAppOptionSeal(t *testing.T) {
}

func TestTxDecoder(t *testing.T) {
cdc := codec.NewProtoCodec(codectypes.NewInterfaceRegistry())
cdc := codectestutil.CodecOptions{}.NewCodec()
baseapptestutil.RegisterInterfaces(cdc.InterfaceRegistry())
signingCtx := cdc.InterfaceRegistry().SigningContext()

// patch in TxConfig instead of using an output from x/auth/tx
txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes)
txConfig := authtx.NewTxConfig(cdc, signingCtx.AddressCodec(), signingCtx.ValidatorAddressCodec(), authtx.DefaultSignModes)

tx := newTxCounter(t, txConfig, 1, 0)
txBytes, err := txConfig.TxEncoder()(tx)
Expand Down
3 changes: 2 additions & 1 deletion baseapp/msg_service_router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,10 @@ func TestMsgService(t *testing.T) {
), &appBuilder, &cdc, &interfaceRegistry)
require.NoError(t, err)
app := appBuilder.Build(dbm.NewMemDB(), nil)
signingCtx := interfaceRegistry.SigningContext()

// patch in TxConfig instead of using an output from x/auth/tx
txConfig := authtx.NewTxConfig(cdc, authtx.DefaultSignModes)
txConfig := authtx.NewTxConfig(cdc, signingCtx.AddressCodec(), signingCtx.ValidatorAddressCodec(), authtx.DefaultSignModes)
// set the TxDecoder in the BaseApp for minimal tx simulations
app.SetTxDecoder(txConfig.TxDecoder())

Expand Down
16 changes: 16 additions & 0 deletions client/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ type Context struct {
AddressCodec address.Codec
ValidatorAddressCodec address.Codec
ConsensusAddressCodec address.Codec

// Bech32 address prefixes.
julienrbrt marked this conversation as resolved.
Show resolved Hide resolved
AddressPrefix string
ValidatorPrefix string
}

// WithCmdContext returns a copy of the context with an updated context.Context,
Expand Down Expand Up @@ -337,6 +341,18 @@ func (ctx Context) WithConsensusAddressCodec(consensusAddressCodec address.Codec
return ctx
}

// WithAddressPrefix returns the context with the provided address bech32 prefix.
func (ctx Context) WithAddressPrefix(addressPrefix string) Context {
ctx.AddressPrefix = addressPrefix
return ctx
}

// WithValidatorPrefix returns the context with the provided validator bech32 prefix.
func (ctx Context) WithValidatorPrefix(validatorPrefix string) Context {
ctx.ValidatorPrefix = validatorPrefix
return ctx
}

// PrintString prints the raw string to ctx.Output if it's defined, otherwise to os.Stdout
func (ctx Context) PrintString(str string) error {
return ctx.PrintBytes([]byte(str))
Expand Down
2 changes: 1 addition & 1 deletion client/keys/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func runAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *buf

// If we're using ledger, only thing we need is the path and the bech32 prefix.
if useLedger {
bech32PrefixAccAddr := sdk.GetConfig().GetBech32AccountAddrPrefix()
bech32PrefixAccAddr := ctx.AddressPrefix
k, err := kb.SaveLedgerKey(name, hd.Secp256k1, bech32PrefixAccAddr, coinType, account, index)
if err != nil {
return err
Expand Down
34 changes: 19 additions & 15 deletions client/keys/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@ import (
"github.com/spf13/cobra"
"sigs.k8s.io/yaml"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/bech32"
)

func bech32Prefixes(config *sdk.Config) []string {
func bech32Prefixes(mainBech32Prefix string) []string {
return []string{
config.GetBech32AccountAddrPrefix(),
config.GetBech32AccountPubPrefix(),
config.GetBech32ValidatorAddrPrefix(),
config.GetBech32ValidatorPubPrefix(),
config.GetBech32ConsensusAddrPrefix(),
config.GetBech32ConsensusPubPrefix(),
mainBech32Prefix,
sdk.GetBech32PrefixAccPub(mainBech32Prefix),
sdk.GetBech32PrefixValAddr(mainBech32Prefix),
sdk.GetBech32PrefixValPub(mainBech32Prefix),
sdk.GetBech32PrefixConsAddr(mainBech32Prefix),
sdk.GetBech32PrefixConsPub(mainBech32Prefix),
}
}

Expand All @@ -44,8 +45,8 @@ type bech32Output struct {
Formats []string `json:"formats"`
}

func newBech32Output(config *sdk.Config, bs []byte) bech32Output {
bech32Prefixes := bech32Prefixes(config)
func newBech32Output(bech32Prefix string, bs []byte) bech32Output {
bech32Prefixes := bech32Prefixes(bech32Prefix)
out := bech32Output{Formats: make([]string, len(bech32Prefixes))}

for i, prefix := range bech32Prefixes {
Expand Down Expand Up @@ -80,15 +81,18 @@ hexadecimal into bech32 cosmos prefixed format and vice versa.
`,
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
config, _ := sdk.GetSealedConfig(cmd.Context())
return doParseKey(cmd, config, args)
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err
}
return doParseKey(cmd, clientCtx.AddressPrefix, args)
},
}

return cmd
}

func doParseKey(cmd *cobra.Command, config *sdk.Config, args []string) error {
func doParseKey(cmd *cobra.Command, bech32Prefix string, args []string) error {
addr := strings.TrimSpace(args[0])
outstream := cmd.OutOrStdout()

Expand All @@ -97,7 +101,7 @@ func doParseKey(cmd *cobra.Command, config *sdk.Config, args []string) error {
}

output, _ := cmd.Flags().GetString(flags.FlagOutput)
if !(runFromBech32(outstream, addr, output) || runFromHex(config, outstream, addr, output)) {
if !(runFromBech32(outstream, addr, output) || runFromHex(bech32Prefix, outstream, addr, output)) {
return errors.New("couldn't find valid bech32 nor hex data")
}

Expand All @@ -117,13 +121,13 @@ func runFromBech32(w io.Writer, bech32str, output string) bool {
}

// print info from hex
func runFromHex(config *sdk.Config, w io.Writer, hexstr, output string) bool {
func runFromHex(bech32Prefix string, w io.Writer, hexstr, output string) bool {
bz, err := hex.DecodeString(hexstr)
if err != nil {
return false
}

displayParseKeyInfo(w, newBech32Output(config, bz), output)
displayParseKeyInfo(w, newBech32Output(bech32Prefix, bz), output)

return true
}
Expand Down
6 changes: 1 addition & 5 deletions client/keys/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ import (
"testing"

"github.com/stretchr/testify/require"

sdk "github.com/cosmos/cosmos-sdk/types"
)

func TestParseKey(t *testing.T) {
bech32str := "cosmos104ytdpvrx9284zd50v9ep8c6j7pua7dkk0x3ek"
hexstr := "EB5AE9872103497EC092EF901027049E4F39200C60040D3562CD7F104A39F62E6E5A39A818F4"

config := sdk.NewConfig()

tests := []struct {
name string
args []string
Expand All @@ -27,7 +23,7 @@ func TestParseKey(t *testing.T) {
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
require.Equal(t, tt.wantErr, doParseKey(ParseKeyStringCommand(), config, tt.args) != nil)
require.Equal(t, tt.wantErr, doParseKey(ParseKeyStringCommand(), "cosmos", tt.args) != nil)
})
}
}
2 changes: 1 addition & 1 deletion client/keys/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func runShowCmd(cmd *cobra.Command, args []string) (err error) {
return err
}

return ledger.ShowAddress(*ledgerItem.Path, pk, sdk.GetConfig().GetBech32AccountAddrPrefix())
return ledger.ShowAddress(*ledgerItem.Path, pk, clientCtx.AddressPrefix)
}

return nil
Expand Down
4 changes: 3 additions & 1 deletion client/tx/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ import (

func newTestTxConfig() (client.TxConfig, codec.Codec) {
encodingConfig := moduletestutil.MakeTestEncodingConfig()
return authtx.NewTxConfig(codec.NewProtoCodec(encodingConfig.InterfaceRegistry), authtx.DefaultSignModes), encodingConfig.Codec
cdc := codec.NewProtoCodec(encodingConfig.InterfaceRegistry)
signingCtx := cdc.InterfaceRegistry().SigningContext()
return authtx.NewTxConfig(cdc, signingCtx.AddressCodec(), signingCtx.ValidatorAddressCodec(), authtx.DefaultSignModes), encodingConfig.Codec
}

// mockContext is a mock client.Context to return arbitrary simulation response, used to
Expand Down
2 changes: 1 addition & 1 deletion crypto/ledger/ledger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func TestPublicKeySafe(t *testing.T) {

require.NoError(t, err)
require.NotNil(t, priv)
require.Nil(t, ShowAddress(path, priv.PubKey(), sdk.GetConfig().GetBech32AccountAddrPrefix()))
require.Nil(t, ShowAddress(path, priv.PubKey(), "cosmos"))
JulianToledano marked this conversation as resolved.
Show resolved Hide resolved
checkDefaultPubKey(t, priv)

addr2 := sdk.AccAddress(priv.PubKey().Address()).String()
Expand Down
7 changes: 6 additions & 1 deletion simapp/app.go
JulianToledano marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ func NewSimApp(
})
appCodec := codec.NewProtoCodec(interfaceRegistry)
legacyAmino := codec.NewLegacyAmino()
txConfig := authtx.NewTxConfig(appCodec, authtx.DefaultSignModes)
signingCtx := interfaceRegistry.SigningContext()
txConfig := authtx.NewTxConfig(appCodec, signingCtx.AddressCodec(), signingCtx.ValidatorAddressCodec(), authtx.DefaultSignModes)

std.RegisterLegacyAminoCodec(legacyAmino)
std.RegisterInterfaces(interfaceRegistry)
Expand Down Expand Up @@ -315,6 +316,10 @@ func NewSimApp(
txConfigOpts := authtx.ConfigOptions{
EnabledSignModes: enabledSignModes,
TextualCoinMetadataQueryFn: txmodule.NewBankKeeperCoinMetadataQueryFn(app.BankKeeper),
SigningOptions: &signing.Options{
AddressCodec: signingCtx.AddressCodec(),
ValidatorAddressCodec: signingCtx.ValidatorAddressCodec(),
},
}
txConfig, err = authtx.NewTxConfigWithOptions(
appCodec,
Expand Down
9 changes: 8 additions & 1 deletion simapp/simd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"cosmossdk.io/x/auth/tx"
authtxconfig "cosmossdk.io/x/auth/tx/config"
"cosmossdk.io/x/auth/types"
txsigning "cosmossdk.io/x/tx/signing"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/config"
Expand Down Expand Up @@ -49,7 +50,9 @@ func NewRootCmd() *cobra.Command {
WithValidatorAddressCodec(addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix())).
WithConsensusAddressCodec(addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix())).
WithHomeDir(simapp.DefaultNodeHome).
WithViper("") // uses by default the binary name as prefix
WithViper(""). // uses by default the binary name as prefix
WithAddressPrefix(sdk.GetConfig().GetBech32AccountAddrPrefix()).
WithValidatorPrefix(sdk.GetConfig().GetBech32ValidatorAddrPrefix())

rootCmd := &cobra.Command{
Use: "simd",
Expand Down Expand Up @@ -80,6 +83,10 @@ func NewRootCmd() *cobra.Command {
txConfigOpts := tx.ConfigOptions{
EnabledSignModes: enabledSignModes,
TextualCoinMetadataQueryFn: authtxconfig.NewGRPCCoinMetadataQueryFn(initClientCtx),
SigningOptions: &txsigning.Options{
AddressCodec: initClientCtx.InterfaceRegistry.SigningContext().AddressCodec(),
ValidatorAddressCodec: initClientCtx.InterfaceRegistry.SigningContext().ValidatorAddressCodec(),
},
}
txConfig, err := tx.NewTxConfigWithOptions(
initClientCtx.Codec,
Expand Down
8 changes: 7 additions & 1 deletion simapp/simd/cmd/root_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (

"github.com/spf13/cobra"

authv1 "cosmossdk.io/api/cosmos/auth/module/v1"
stakingv1 "cosmossdk.io/api/cosmos/staking/module/v1"
"cosmossdk.io/client/v2/autocli"
clientv2keyring "cosmossdk.io/client/v2/autocli/keyring"
"cosmossdk.io/core/address"
Expand Down Expand Up @@ -103,6 +105,8 @@ func ProvideClientContext(
addressCodec address.Codec,
validatorAddressCodec runtime.ValidatorAddressCodec,
consensusAddressCodec runtime.ConsensusAddressCodec,
authConfig *authv1.Module,
stakingConfig *stakingv1.Module,
) client.Context {
var err error

Expand All @@ -116,7 +120,9 @@ func ProvideClientContext(
WithValidatorAddressCodec(validatorAddressCodec).
WithConsensusAddressCodec(consensusAddressCodec).
WithHomeDir(simapp.DefaultNodeHome).
WithViper("") // uses by default the binary name as prefix
WithViper(""). // uses by default the binary name as prefix
WithAddressPrefix(authConfig.Bech32Prefix).
WithValidatorPrefix(stakingConfig.Bech32PrefixValidator)

// Read the config to overwrite the default values with the values from the config file
customClientTemplate, customClientConfig := initClientConfig()
Expand Down
3 changes: 2 additions & 1 deletion testutil/integration/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ func NewIntegrationApp(
interfaceRegistry := codectypes.NewInterfaceRegistry()
moduleManager := module.NewManagerFromMap(modules)
moduleManager.RegisterInterfaces(interfaceRegistry)
signingCtx := interfaceRegistry.SigningContext()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one will be nil, we should take the address codecs as arguments of NewIntegrationApp


txConfig := authtx.NewTxConfig(codec.NewProtoCodec(interfaceRegistry), authtx.DefaultSignModes)
txConfig := authtx.NewTxConfig(codec.NewProtoCodec(interfaceRegistry), signingCtx.AddressCodec(), signingCtx.ValidatorAddressCodec(), authtx.DefaultSignModes)
bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), baseapp.SetChainID(appName))
bApp.MountKVStores(keys)

Expand Down
3 changes: 2 additions & 1 deletion testutil/sims/simulation_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ func SetupSimulation(config simtypes.Config, dirPrefix, dbName string, verbose,
// SimulationOperations retrieves the simulation params from the provided file path
// and returns all the modules weighted operations
func SimulationOperations(app runtime.AppSimI, cdc codec.Codec, config simtypes.Config) []simtypes.WeightedOperation {
signingCtx := cdc.InterfaceRegistry().SigningContext()
simState := module.SimulationState{
AppParams: make(simtypes.AppParams),
Cdc: cdc,
TxConfig: authtx.NewTxConfig(cdc, authtx.DefaultSignModes), // TODO(tip): we should extract this from app
TxConfig: authtx.NewTxConfig(cdc, signingCtx.AddressCodec(), signingCtx.ValidatorAddressCodec(), authtx.DefaultSignModes), // TODO(tip): we should extract this from app
BondDenom: sdk.DefaultBondDenom,
}

Expand Down
25 changes: 25 additions & 0 deletions types/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,31 @@ const (
Bech32PrefixConsPub = Bech32MainPrefix + PrefixValidator + PrefixConsensus + PrefixPublic
)

// GetBech32PrefixAccPub returns the Bech32 prefix of an account's public key.
func GetBech32PrefixAccPub(mainPrefix string) string {
return mainPrefix + PrefixPublic
}

// GetBech32PrefixValAddr returns the Bech32 prefix of a validator's operator address.
func GetBech32PrefixValAddr(mainPrefix string) string {
return mainPrefix + PrefixValidator + PrefixOperator
}

// GetBech32PrefixValPub returns the Bech32 prefix of a validator's operator public key.
func GetBech32PrefixValPub(mainPrefix string) string {
return mainPrefix + PrefixValidator + PrefixOperator + PrefixPublic
}

// GetBech32PrefixConsAddr returns the Bech32 prefix of a consensus node address.
func GetBech32PrefixConsAddr(mainPrefix string) string {
return mainPrefix + PrefixValidator + PrefixConsensus
}

// GetBech32PrefixConsPub returns the Bech32 prefix of a consensus node public key.
func GetBech32PrefixConsPub(mainPrefix string) string {
return mainPrefix + PrefixValidator + PrefixConsensus + PrefixPublic
}

// cache variables
var (
// AccAddress.String() is expensive and if unoptimized dominantly showed up in profiles,
Expand Down
Loading
Loading