Skip to content

Conversation

shariqnaiyer
Copy link
Contributor

@shariqnaiyer shariqnaiyer commented Aug 12, 2025

What was wrong?

Fixes: #683

How was it fixed?

Refactored the interval code by creating a function create_lean_clock_interval() which returns an interval to be used in both ValidatorService and LeanChainService.

To-Do

Copy link
Contributor

@Kayden-ML Kayden-ML left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@shariqnaiyer shariqnaiyer enabled auto-merge August 12, 2025 05:02
@shariqnaiyer shariqnaiyer disabled auto-merge August 12, 2025 05:02
@shariqnaiyer shariqnaiyer enabled auto-merge August 12, 2025 05:03
@Kayden-ML Kayden-ML disabled auto-merge August 12, 2025 05:09
@syjn99
Copy link
Member

syjn99 commented Aug 12, 2025

feel free to merge this when CI is fixed!

Copy link
Contributor

@KolbyML KolbyML left a comment

Choose a reason for hiding this comment

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

Overall this PR looks good just rebase and apply the few suggestions

Comment on lines 20 to 26
let mut interval = interval_at(
interval_start,
Duration::from_secs(seconds_per_slot / INTERVALS_PER_SLOT),
);
interval.set_missed_tick_behavior(MissedTickBehavior::Burst);

Ok(interval)
Copy link
Contributor

Choose a reason for hiding this comment

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

might as well inline all these into the ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can't inline this because set missed tick behavior is called on the interval after creation

@shariqnaiyer shariqnaiyer force-pushed the feature/shariqnaiyer/common-intervals branch from 4b5b61a to ef51d13 Compare August 13, 2025 05:18
@KolbyML KolbyML enabled auto-merge August 13, 2025 05:40
@KolbyML KolbyML added this pull request to the merge queue Aug 13, 2025
Merged via the queue into ReamLabs:master with commit b790d43 Aug 13, 2025
14 checks passed
allnil pushed a commit to loadnetwork/ream that referenced this pull request Aug 18, 2025
* chore: refactor redundant interval creation

* fix: imports

* fix: import

* fix: unhide error

* fix: handle err

* fix: pass up the err

* fix: inline requested

* fix: cleanup

* fix: inline

* fix: format
@shariqnaiyer shariqnaiyer deleted the feature/shariqnaiyer/common-intervals branch October 16, 2025 03:22
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.

Add common intervals for ValidatorService and LeanChainService

4 participants