-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Proof-of-Concept: Add alt options to PrepareProposal
#13818
Conversation
This reverts commit 67a1bb9.
But in case I am missing something 2 of the solutions outlined in #13810 could work too. Either an API providing a validity handler (called in both Prepare/Process; this could have tight coupling to the mempool), or just allowing apps to define their own |
_, _, _, _, err = app.runTx(runTxPrepareProposal, bz) | ||
if err != nil { | ||
// Don't remove tx from app.mempool for the reason mentioned above. | ||
panic(err) |
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 don't agree that any invalid tx in the mempool should cause a panic in PrepareProposal.
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.
yah, this didn't quite feel right, but I thought it was sufficient to show case the idea
ctx := app.getContextForTx(runTxPrepareProposal, []byte{}) | ||
|
||
// `Select` doesn't necessarily have to return an iterator. It can be a slice. | ||
iterator := app.mempool.Select(ctx, req.Txs, req.MaxTxBytes) |
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 opted for an iterator to accommodate highly customized cases like you're describing. I'm leaning towards just letting apps define PrepareProposal.
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 agree with this idea!
There are two main arguments against this:
Having said that, what you have proposed in #13831 does give the app the full flexibility/control to manage Thank you all for entertaining this idea and I appreciate you guys being very responsive + receptive of feedback 💪 |
Given that #13831 addresses the main concern for this PR, I will close this PR |
Idea/Problem:
PrepareProposal
viaSelect
, the app does not know for sure if all txs will be included in theResponsePrepareProposal
.Select
were crafted in a specific way (i.e. the txs ordering or types of txs included). Ignoring or only including a subset of the returned txs would be undesirable from the app's perspective.Options:
PrepareProposal
assumes that app-side mempool will return valid set of txs. If it doesn't return a valid set then, it's considered a bug, so panic.PrepareProposal
asks app-side mempool: "hey, these are the final txs that will be included in ResponsePrepareProposal , do these txs look okay to you still?"I think there are better options out there, but drafting this PR to communicate the high-level thought