-
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: Multimsg ante handler Jae's proposal #3787
Closed
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c775602
Jae's proposal
sunnya97 ffbda5c
Remove SendEnabled
jaekwon 2907ef1
fix lcd test
jaekwon 10af5c2
fix bug
jaekwon 60890da
atomsToUatoms
sunnya97 ddbe903
Update cmd/gaia/app/app.go
alexanderbez e27b979
Update cmd/gaia/app/app.go
sunnya97 c15322c
Update cmd/gaia/app/app.go
sunnya97 d2e9c5f
cli tests run w/ send_enabled gotag
jaekwon 5255fa6
fix comment
jaekwon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// +build send_enabled | ||
|
||
package app | ||
|
||
func init() { | ||
sendEnabled = true | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hmmm maybe I'm missing something glaringly obvious, but why must we have a "filterAnteHandler" in
app
? Why can't we just use the regular ante handler and have thesendEnabled
enabled check? Then we won't need any hacky build stuff for this. Yes, the ante handler would have to be provided a "keeper contract" that implementsGetSendEnabled
.What if a bunch of nodes choose to run without this build setup? What if this introduces a spam or DoS vector? (since the entire ante handler is executed first)
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 because it needs access to
x/bank
for message validation....sigh. I still think we can avoid this though.NewAnteHandler
can be passed a tx validator function (which is defined in bank, e.g.func(tx sdk.Tx) sdk.Result
) . Then we dont need any filter ante handler OR hacky build steps.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.
Because other people are using the bank module rn, and we don't want to add Hub specific functionality to the module. We wanted to isolate this functionality change to just the gaia package.
Really, the proper way to do this is to allow for rerouting subroutes. So the route of the bank module msgs would be:
bank/send
bank/multisend
And then in the router, we route
bank/*
to the bank module, butbank/multisend
to a special handler defined in the gaia folder.However, we don't have time to do this rn, as this would involve changes to the router functionality.
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 we could just temporarily fork the entire
bank
module and add it as a specialbank
module in the gaia folder. And then to enable transfers point it back to the SDK bank module. That's actually not a bad idea.....@cwgoes @jaekwon @zmanian
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.
Yeah anything to avoid involving the build pipeline would be an ideal solution. Seems trivial to do @sunnya97
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 have all of these same concerns about using the build pipeline. I think, while messy, that forking the
bank
module may be the best way to do this. Looking forward to continuing this discussion in the sdk meeting today.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.
Also this will be a very easy change to revert if we do that (just reimport the normal bank module into
app.go
)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.
we don't know how messy it will be, this is done, lets go 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.
Alternative as suggested by @sunnya97: #3807
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.
It's not messy at all. I really don't think we should rely on the build process to enforce business logic (especially since it ties into consensus).