imp(staking): detect the length of the ed25519 pubkey in CreateValidator to prevent panic (#18506)

This commit is contained in:
Chenqun Lu
2023-11-27 09:41:17 +00:00
committed by GitHub
parent 0917d347e3
commit d3e662da1f
5 changed files with 69 additions and 30 deletions
+3
View File
@@ -22,6 +22,9 @@ var (
// DefaultPowerReduction is the default amount of staking tokens required for 1 unit of consensus-engine power
DefaultPowerReduction = sdkmath.NewIntFromUint64(1000000)
// PubKeyEd25519Type is ed25519 for type the consensus params validator pub_key_types params
PubKeyEd25519Type = "ed25519"
)
// TokensToConsensusPower - convert input tokens to potential consensus-engine power