-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: prestwich/cache-task
Are you sure you want to change the base?
Conversation
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
ca755fb
to
9c6c948
Compare
27f35cb
to
2e97789
Compare
// 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) |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 🤔
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already exists, we can just reassign cc @dylanlott https://linear.app/initiates/issue/ENG-992/respect-slot-timing-rules-in-the-builder-submit-task
There was a problem hiding this 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. |
There was a problem hiding this comment.
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?
Integration for downstack PRs for cache and env tasks