Skip to content

refactor: integrate env and cache tasks #92

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

Open
wants to merge 3 commits into
base: prestwich/cache-task
Choose a base branch
from

Conversation

prestwich
Copy link
Member

@prestwich prestwich commented May 14, 2025

Integration for downstack PRs for cache and env tasks

@prestwich prestwich mentioned this pull request May 14, 2025
Copy link
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@prestwich prestwich mentioned this pull request May 14, 2025
@prestwich prestwich marked this pull request as ready for review May 14, 2025 17:41
@prestwich prestwich force-pushed the prestwich/env-cache-integration branch from ca755fb to 9c6c948 Compare May 14, 2025 18:00
@prestwich prestwich force-pushed the prestwich/env-cache-integration branch from 27f35cb to 2e97789 Compare May 14, 2025 18:59
// Calculate the time remaining in the current slot
let remaining = self.slot_calculator.calculate_timepoint_within_slot(unix_seconds);
// Deadline is equal to the start of the next slot plus the time remaining in this slot
Instant::now() + Duration::from_secs(remaining)
Copy link
Member Author

Choose a reason for hiding this comment

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

this seems to have been giving incorrect output. we need to sub remaining from duration, then add that to now

use tokio::{
sync::mpsc::{UnboundedReceiver, UnboundedSender, unbounded_channel},
task::JoinHandle,
time::{self, Duration},
};

/// Holds a bundle from the cache with a unique ID and a Zenith bundle.
Copy link
Member Author

Choose a reason for hiding this comment

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

replaced with sdk types

/// # Arguments
///
/// - finish_by: The deadline at which block simulation will end.
async fn next_block_env(&self, finish_by: Instant) -> eyre::Result<PecorinoBlockEnv> {
Copy link
Member Author

Choose a reason for hiding this comment

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

replaced by EnvTask

// remaining, we need to subtract it from the slot duration
let remaining = self.slot_calculator().slot_duration() - timepoint;

// We add a 1500 ms buffer to account for sequencer stopping signing.
Copy link
Member

Choose a reason for hiding this comment

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

might be redundant, but is this buffer also accounting for the block query cutoff itself? I thought quincey stopped signing 2s before the end of the slot

Copy link
Member Author

Choose a reason for hiding this comment

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

ahhh good point. the builder needs to know this parameter 🤔

Copy link
Member

Choose a reason for hiding this comment

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

I assume this will be implemented on another PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

can you make a linear ticket for me, im afk 😅

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@Evalir Evalir left a comment

Choose a reason for hiding this comment

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

the code lgtm. Want to see @dylanlott 's testing results

// remaining, we need to subtract it from the slot duration
let remaining = self.slot_calculator().slot_duration() - timepoint;

// We add a 1500 ms buffer to account for sequencer stopping signing.
Copy link
Member

Choose a reason for hiding this comment

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

I assume this will be implemented on another PR?

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.

2 participants