8000 Fix for transaction inputs being fetched recursively by softsimon · Pull Request #1665 · mempool/mempool · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix for transaction inputs being fetched recursively #1665

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

Merged
merged 2 commits into from
May 18, 2022

Conversation

softsimon
Copy link
Member
@softsimon softsimon commented May 18, 2022

This bug is affecting bitcoin core backend.

When calculating fees and getting the address by fetching the previous-transaction (prevouts), it recursively did the same for the prevout TXs without stopping.

This PR adds a stop so it only goes 1 layer deep which is the only thing required.

The performance difference of loading the block transactions pages now is extremely noticeable.

@cla-bot cla-bot bot added the cla-signed label May 18, 2022
@softsimon softsimon requested a review from nymkappa May 18, 2022 00:48
@softsimon softsimon changed the title Fix for transactions being fetched recursively Fix for transaction inputs being fetched recursively May 18, 2022
@softsimon softsimon force-pushed the simon/getrawtransaction-recursive-fix branch from 9b27c80 to 90f4483 Compare May 18, 2022 01:07
@softsimon softsimon added this to the v2.4.0 milestone May 18, 2022
@softsimon softsimon force-pushed the simon/getrawtransaction-recursive-fix branch 2 times, most recently from 0584e86 to caff758 Compare May 18, 2022 03:50
Copy link
Member
@nymkappa nymkappa left a comment

Choose a reason for hiding this comment

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

I don't know that part of the code very well, but loading blocks is much faster when config.MEMPOOL.BACKEND is set to none with this PR.

So I'll tested ACK @ caff758

@softsimon softsimon force-pushed the simon/getrawtransaction-recursive-fix branch 2 times, most recently from ebe4200 to e79235b Compare May 18, 2022 11:00
@softsimon softsimon force-pushed the simon/getrawtransaction-recursive-fix branch from e79235b to 2dad8ba Compare May 18, 2022 11:06
Copy link
Member
@wiz wiz left a comment

Choose a reason for hiding this comment

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

Tested ACK @ v2.4.0-dev [f91d9239]

Before

% time curl -s -i http://127.0.0.1:8999/api/v1/tx/aeaadc58c6f3e7ee08c2a2a46f0174ea712d18ac06478d898af6798dae3becb1
HTTP/1.1 200 OK
...
curl -s -i   0.00s user 0.01s system 0% cpu 11.501 total

After

% time curl -s -i http://127.0.0.1:8999/api/v1/tx/aeaadc58c6f3e7ee08c2a2a46f0174ea712d18ac06478d898af6798dae3becb1         
HTTP/1.1 200 OK
...
curl -s -i   0.00s user 0.01s system 0% cpu 1.437 total

@wiz wiz merged commit d84ee4b into master May 18, 2022
@wiz wiz deleted the simon/getrawtransaction-recursive-fix branch May 18, 2022 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0