-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
R4R: Auth Module Param Store #2998
Conversation
Codecov Report
|
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.
Was looking through here for the client functionality and not seeing it. Shouldn't we be able to query these params from both the LCD and CLI?
Also we might want to add genesis validation like #3006
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.
Quick review, structural changes look fine, a few suggestions and I would second @ValarDragon / @jackzampolin's comments.
@@ -55,28 +55,21 @@ func (tx StdTx) ValidateBasic() sdk.Error { | |||
if len(stdSigs) != len(tx.GetSigners()) { | |||
return sdk.ErrUnauthorized("wrong number of signers") | |||
} | |||
if len(tx.GetMemo()) > maxMemoCharacters { |
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.
Hmm, what about having ValidateBasic
require a params
? I like separating the stateless checks, it's cleaner.
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.
Sure! That would require updating the Tx
interface. Are we OK with this?
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.
That seems fine, maybe we could have a sub-struct in Params
just for tx validation
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.
See comment below.
|
||
sigCount := 0 | ||
for i := 0; i < len(stdSigs); i++ { | ||
sigCount += countSubKeys(stdSigs[i].PubKey) | ||
if sigCount > txSigLimit { | ||
if uint64(sigCount) > DefaultTxSigLimit { |
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 seems like it should definitely be a param
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.
Very strange. It is a param. Must've forgotten to update this.
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.
Ohhh wait, this is because it's in ValidateBasic
too. I don't know of a clean way really to support this. Maybe ValidateBasic
can take a params interface{}...
? Keep in mind, the Tx
interface is defined in /types
.
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.
I guess this is OK for now. Maybe let's discuss in an issue
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.
Created an issue here: #3164
@cwgoes updated. |
Needs a rebase. |
@cwgoes rebased. |
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.
Tested ACK
A few remaining concerns, but they don't need to block merge. This should see an additional review.
switch { | ||
case strings.Contains(pubkeyType, "ed25519"): | ||
meter.ConsumeGas(params.SigVerifyCostED25519, "ante verify: ed25519") | ||
case strings.Contains(pubkeyType, "secp256k1"): |
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 does add quite a bit of technical debt, although the struct names are unlikely to change. At minimum let's create an issue upstream.
|
||
sigCount := 0 | ||
for i := 0; i < len(stdSigs); i++ { | ||
sigCount += countSubKeys(stdSigs[i].PubKey) | ||
if sigCount > txSigLimit { | ||
if uint64(sigCount) > DefaultTxSigLimit { |
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.
I guess this is OK for now. Maybe let's discuss in an issue
Needs a rebase now @alexanderbez (sorry) - and also another review. |
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 a great addition. Tested locally and all working for me. I think this just needs a rebase.
testInput
type)am
variable and receiver usageParams
typeconsumeSignatureVerificationGas
)closes: #2996
Targeted PR against correct branch (see CONTRIBUTING.md)
Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
Wrote tests
Updated relevant documentation (
docs/
)Added entries in
PENDING.md
with issue #rereviewed
Files changed
in the github PR explorerFor Admin Use: