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: new grpc method #6742

Merged
merged 6 commits into from
Jan 16, 2025

Conversation

SWvheerden
Copy link
Collaborator

@SWvheerden SWvheerden commented Jan 15, 2025

Description

Creates a new grpc method to get the reward of the nextblock, the sha + rx estimate hash rates and metadata tip info
Adds caching to grpc calls

Motivation and Context

Currently, universe calls get_template to just read the reward which is an expensive operation.
It also streams up to 100 headers to calculate the estimated hash rate.

Both of these operations can be made much simpler and faster. This PR provides a call to do just that.
This Pr also adds cahcing to the calls to only update if an update is required.

@SWvheerden SWvheerden requested a review from a team as a code owner January 15, 2025 15:30
Copy link

github-actions bot commented Jan 15, 2025

Test Results (Integration tests)

36 tests  +36   36 ✅ +36   19m 54s ⏱️ + 19m 54s
11 suites +11    0 💤 ± 0 
 2 files   + 2    0 ❌ ± 0 

Results for commit 9b5f3eb. ± Comparison against base commit c7a423d.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jan 15, 2025

Test Results (CI)

    3 files    129 suites   37m 15s ⏱️
1 349 tests 1 349 ✅ 0 💤 0 ❌
4 045 runs  4 045 ✅ 0 💤 0 ❌

Results for commit 9b5f3eb.

♻️ This comment has been updated with latest results.

@SWvheerden SWvheerden requested a review from brianp January 16, 2025 08:34
hansieodendaal
hansieodendaal previously approved these changes Jan 16, 2025
Copy link
Contributor

@hansieodendaal hansieodendaal left a comment

Choose a reason for hiding this comment

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

utACK

Any system-level test comparisons?

brianp
brianp previously approved these changes Jan 16, 2025
Copy link
Contributor

@brianp brianp left a comment

Choose a reason for hiding this comment

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

LGTM

One comment, but no required changes.

Comment on lines 68 to 69
if res.1 == *current_tip {
Some(res.0.clone())
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just a nit and not a change request.

I always prefer a struct and names values over indexing from a tuple res.1 or res.0 as they lose context and meaning in these functions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

valid point, let me update

@SWvheerden SWvheerden dismissed stale reviews from brianp and hansieodendaal via 9b5f3eb January 16, 2025 11:52
@SWvheerden SWvheerden merged commit ef81ccb into tari-project:development Jan 16, 2025
17 checks passed
@SWvheerden SWvheerden deleted the sw_new_grpc_method branch January 16, 2025 13:36
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