8000 Lazy load tx inputs in Bitcoin Core mode by softsimon · Pull Request #1643 · mempool/mempool · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Lazy load tx inputs in Bitcoin Core mode #1643

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 4 commits into from
May 20, 2022
Merged

Lazy load tx inputs in Bitcoin Core mode #1643

merged 4 commits into from
May 20, 2022

Conversation

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

fixes #465

The issue

When opening block 736192 (0000000000000000000405c3eb4af4ca6361275baa347c35c8afb6bef09a9d4b) when running Bitcoin Core.. The transactions list is timing out due to the amount of transactions with 100 inputs each.
Screen Shot 2022-05-13 at 16 01 16

And in other occasions with less inputs the transactions list can be extremely slow when running Bitcoin core, for Raspberry Pi users.

What this PR does

Limiting the fetching of inputs to 12 (which is the limit we use before displaying the "Load all (90)" button. Suddenly we can load the page without timeout. And we can flip through pages without super slowdowns. This affects the Block transactions view and Address page view, and it won't effect the individual transaction view.

The only downside is that we can't calculate the fee (missing from down left) without knowing all the inputs.

Screen Shot 2022-05-13 at 15 58 51

After clicking Load all the inputs are lazily loaded:

Screen Shot 2022-05-13 at 15 55 19

Scrolling to the bottom we can now see the fee.

Screen Shot 2022-05-13 at 15 55 49

How to test

Make sure the features mentioned above should work on the Block transactions page and the Address page containing transactions with many inputs. Going to an individual transaction should still work. This should not be present when using Esplora.

@cla-bot cla-bot bot added the cla-signed label May 13, 2022
@softsimon softsimon requested review from wiz and knorrium May 13, 2022 12:06
@antonilol
Copy link
Contributor

maybe explicitly state that the fee is unknown other than just leaving it out

the fee can also be cached or calculated when the block is received and median fee etc is calculated

@softsimon softsimon force-pushed the simon/lazy-load-inputs branch from d205550 to fe5a5dd Compare May 17, 2022 23:29
@softsimon softsimon marked this pull request as draft May 17, 2022 23:36
@softsimon
Copy link
Member Author

Will wait before #1665 is merged.

@softsimon softsimon force-pushed the simon/lazy-load-inputs branch from fe5a5dd to 4da6f7a Compare May 20, 2022 17:18
@softsimon softsimon force-pushed the simon/lazy-load-inputs branch from d982999 to e092fa6 Compare May 20, 2022 17:30
@softsimon
Copy link
Member Author

I have added a explaining text string instead of emptiness.

Screen Shot 2022-05-20 at 21 30 26

@softsimon softsimon marked this pull request as ready for review May 20, 2022 17:31
@softsimon
Copy link
Member Author
softsimon commented May 20, 2022

A good example

Go to block 0000000000000000000865d5262df0b0ba520b2e869d5dd71b76b49a2a778693
Navigate to last page (29)
This takes so long time that the nginx will timeout error.

Now it only takes 3 seconds at most to load these extreme cases.

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 [dabfa053]

Screen Shot 2022-05-21 at 3 00 10

@wiz wiz merged commit 3a6f64b into master May 20, 2022
@wiz wiz deleted the simon/lazy-load-inputs branch May 20, 2022 18:03
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.

Bitcoind: Lazy load inputs to speed up loading
3 participants
0