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

feat: add query param to add a tip, partialFee, and priority field to each extrinsic for /node/transaction-pool #931

Merged
merged 29 commits into from
Jun 6, 2022

Conversation

TarikGul
Copy link
Member

@TarikGul TarikGul commented May 25, 2022

Feature

Summary: Allow /node/transaction-pool to accept a query parameter called includeFee. When true it will attach a decoded tip, partialFee, and priority to each extrinsic.

Query Param includeFee

  • Default: It will be false.
  • If true: It will attach a tip, partialFee, and priority to each extrinsic within the "pool" array.

rel: #925

@TarikGul TarikGul requested a review from a team as a code owner May 25, 2022 19:42
@TarikGul TarikGul self-assigned this May 25, 2022
Copy link
Contributor

@CurlyBracketEffect CurlyBracketEffect left a comment

Choose a reason for hiding this comment

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

Logic looks good...Just the note about the comment.

@TarikGul TarikGul changed the title feat: add query param to add tip field to each transaction in the transaction pull feat: add query param to add tip field to each extrinsic for /node/transaction-pool May 25, 2022
docs/src/openapi-v1.yaml Outdated Show resolved Hide resolved
@jsdw
Copy link
Collaborator

jsdw commented May 27, 2022

Just to relay @joepetrowski's comment for consideration here:

Wouldn't you want to return the total fee including tip?
Since that's what determines priority. So if a transfer has a fee of 0.1, and a remark has a fee of 0.001, and the pool you query is loaded with transfers with a tip of 0, you could then think, "I'll put a tip of 0.01 just to make sure I'm ahead of all the stingy non-tippers", but with a total fee of 0.011 you'll still be last in line.

@jsdw jsdw self-requested a review May 27, 2022 10:48
@TarikGul
Copy link
Member Author

@jsdw Yea I am going to rewrite this a bit to include the patialFee, and totalFee. Will request reviews again after.

@TarikGul TarikGul changed the title feat: add query param to add tip field to each extrinsic for /node/transaction-pool feat: add query param to add a tip, partialFee, and priority field to each extrinsic for /node/transaction-pool May 31, 2022
@TarikGul TarikGul requested a review from a team May 31, 2022 19:08

const maxTxPerBlock = BN.min(maxTxPerBlockWeight, maxTxPerBlockLength);
const saturatedTip = tip.toBn().add(BN_ONE);
const scaledTip = this.maxReward(saturatedTip, maxTxPerBlock);
Copy link
Member

Choose a reason for hiding this comment

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

nice, totally missed that that was a closure in substrate

Copy link
Member

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

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

gucci :)

@TarikGul TarikGul merged commit 8241d34 into master Jun 6, 2022
@TarikGul TarikGul deleted the tarik-node-tip branch June 6, 2022 17:08
This pull request was closed.
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.

5 participants