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

removes loops from getNewBlockTransactions #3927

Merged
merged 1 commit into from
Jun 14, 2023
Merged

Conversation

hughy
Copy link
Contributor

@hughy hughy commented May 23, 2023

Summary

when creating a new block template the mining manager collects a list of transactions to include in the block.

the mining manager iterates over transactions in the mempool, verifies the spends in the transactions, and tracks the total size and total fee from included transactions.

we iterate over the list of included transactions twice after collecting them: once to read the fee from the transaction and again to sum the fees.

these changes remove the extra iterations over included transactions. performance gains will be neglible.

Testing Plan

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and
what additional work is required, if any.

[ ] Yes

@hughy hughy force-pushed the feature/template-tx-loops branch from ce6c63e to c9768a1 Compare May 24, 2023 00:04
when creating a new block template the mining manager collects a list of
transactions to include in the block.

the mining manager iterates over transactions in the mempool, verifies the
spends in the transactions, and tracks the total size and total fee from
included transactions.

we currently iterate over the list of included transactions twice after
collecting them: once to read the fee from the transaction and again to sum the
fees.

these changes remove the extra iteration over transactions for fees.
performance gains will likely be neglible.
@hughy hughy force-pushed the feature/template-tx-loops branch from c9768a1 to 4da6f7e Compare June 13, 2023 19:50
@hughy hughy marked this pull request as ready for review June 14, 2023 00:07
@hughy hughy requested a review from a team as a code owner June 14, 2023 00:07
@hughy hughy merged commit 8b7a604 into staging Jun 14, 2023
@hughy hughy deleted the feature/template-tx-loops branch June 14, 2023 18:28
jowparks pushed a commit that referenced this pull request Jun 21, 2023
when creating a new block template the mining manager collects a list of
transactions to include in the block.

the mining manager iterates over transactions in the mempool, verifies the
spends in the transactions, and tracks the total size and total fee from
included transactions.

we currently iterate over the list of included transactions twice after
collecting them: once to read the fee from the transaction and again to sum the
fees.

these changes remove the extra iteration over transactions for fees.
performance gains will likely be neglible.
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.

2 participants