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

fix(rpc): get_block_* used two transactions #359

Merged
merged 3 commits into from
Jun 9, 2022
Merged

Conversation

koivunej
Copy link
Contributor

@koivunej koivunej commented Jun 9, 2022

A perf and correctness fix while looking if some of the methods could be made just blocking, and seems that they can. But separated this fix as it's independent.

Comment on lines +136 to +138
.context("Database read panic or shutting down")
.map_err(internal_server_error)
.and_then(|x| x)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking of refactoring this incantation to an Result<RpcResult<T>, JoinError>::into_rpc_result() but didn't include it here.

Joonas Koivunen added 2 commits June 9, 2022 13:36
only one connection and transaction should ever be used for request,
caused by the async nesting.
@koivunej koivunej force-pushed the fix_get_block_two_txs branch from e91bc32 to d237ae0 Compare June 9, 2022 10:37
@koivunej
Copy link
Contributor Author

koivunej commented Jun 9, 2022

This gives expected load-test visible results:

  • get_block_by_(number|hash) went from max latency of 1780 to 942 ms (2 vs 1 connections, as expected), doubling of rps

@koivunej koivunej merged commit e33d529 into main Jun 9, 2022
@koivunej koivunej deleted the fix_get_block_two_txs branch June 9, 2022 12:27
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.

3 participants