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

Introduce combined sigs commit #63

Merged
merged 3 commits into from
Nov 4, 2020

Conversation

n-hutton
Copy link
Contributor

@n-hutton n-hutton commented Nov 2, 2020

No description provided.

@n-hutton n-hutton changed the title initial commit Introduce combined sigs commit Nov 3, 2020
@@ -50,6 +52,10 @@ func NewMsgCreateValidator(
description Description, commission CommissionRates, minSelfDelegation sdk.Int,
) MsgCreateValidator {

if _, ok := pubKey.(bls12_381.PubKeyBls); !ok && pubKey != nil {
panic(fmt.Sprintf("Attempt to create validator with non bls based public key is invalid!\n"))
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if this should be a panic. Should we not just reject the msg when the MsgCreateValidator is handled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does not need to be a panic, it is quite useful when making the switch to find out when code has tried to create an incorrect validator. I can remove it if you like?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, that's fine. I agree it is useful when switching to keep this.

@@ -156,7 +158,7 @@ func TestSlashingMsgs(t *testing.T) {
require.Equal(t, sdk.ValAddress(addr1), validator.OperatorAddress)
require.Equal(t, sdk.Bonded, validator.Status)
require.True(sdk.IntEq(t, bondTokens, validator.BondedTokens()))
unjailMsg := MsgUnjail{ValidatorAddr: sdk.ValAddress(validator.ConsPubKey.Address())}
unjailMsg := MsgUnjail{ValidatorAddr: validator.OperatorAddress}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did this need to change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The address that is signing the unjail message should be the 'operating address' of the validator, which is not related to its consensus public key (now bls).

@n-hutton n-hutton merged commit 0d2783e into fetchai:master Nov 4, 2020
@n-hutton n-hutton deleted the feature/combined_sigs_switch branch November 4, 2020 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants