Skip to content

Client context uses singleton lite verifier #5116

Closed

Description

context.CLIContext.verifier is defined as a reference to the global singleton lite verifier, assuming that the process will connect to only a single chain. In https://github.com/cosmos/cosmos-sdk/blob/master/client/context/context.go#L77

var (
	verifier     tmlite.Verifier
	verifierHome string
)


	// We need to use a single verifier for all contexts
	if verifier == nil || verifierHome != viper.GetString(flags.FlagHome) {
		verifier = createVerifier()
		verifierHome = viper.GetString(flags.FlagHome)
	}

This is not true on IBC, where the handshake/packet handling requires access on both chains. We can keep it as a global verifier but it has to be map[string]tmlite.Verifier where the key is verifierHome. This way we can let the multiple contexts share the same verifier if they are connecting to the same chain but can have different verifiers if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions