-
Notifications
You must be signed in to change notification settings - Fork 170
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
fix: Use the account specified in app.toml to sign BLS transactions #348
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
@@ -56,12 +59,14 @@ func (m *MsgAddBlsSig) ValidateBasic() error { | |||
} | |||
|
|||
func (m *MsgAddBlsSig) GetSigners() []sdk.AccAddress { | |||
signer, err := sdk.ValAddressFromBech32(m.BlsSig.SignerAddress) | |||
signer, err := sdk.AccAddressFromBech32(m.Signer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really a nice catch 🙈 👍
So point Point Point |
We don't have this assumption up to this point. We have added a configuration value in However, I understand the concern that this might break something somewhere else. In theory it shouldn't but I'm not an expert of the checkpointing module. Maybe we can merge this and ask @gitferry to take a look when he gets back? However, judging by the handler of the In my opinion, we should allow other addresses to submit the BLS signature as we have the requirement that the keyring that submits the transaction is a test keyring and accessible. It would not be secure for our validators to have all of their self-delegated funds in a
Agreed, this might be an interesting approach. Although I don't very much like the node explicitly knowing if it's a validator or not, but this might help us avoid some complexity. |
Couple of facets on this bug:
app.toml
was not actually getting used, but instead always the account specified as the delegator inpriv_validator_key.json
is getting used. This is evident from theclientCtx
being built with a "From Address" being the key specified in that file.AddBlsSig
message (i.e. the one that sent the transaction), was always the validator address (seeGetSigners
for this message type). When doing the fix for (1), there was a nasty bug in which it always expected 2 signatures (with one being from the delegator address). This is resolved by introducing asigner
attribute to theAddBlsSig
message, as we do with other messages. The signer is the one that submits the transaction, not the one to which the BLS key corresponds to. For example, it should be perfectly possible that I sent my BLS signature to someone else and they submit it for me.app.toml
to initialize the priv signer, I changed the default value to the empty string and added checks so that it doesn't get used in the typical case. However, if you're a validator and you have specified a key that does not exist, your application will panic. We need to be careful with this and add some sanity checks in our docs for our validators so that they don't encounter this scenario.Also,
make proto-gen
for some reason produced all kinds of different changes on the files.