Skip to content

Conversation

@dylanlott
Copy link
Contributor

@dylanlott dylanlott commented Nov 21, 2025

fix: make block query cutoff properly configurable

At some point in the past, the block query cutoff configuration value was removed and a hard-coded value was added in.

This PR adds the block query cutoff back into the config and uses the config value in the calculate_deadline​ function.

Builder example environment documentation needs to be updated to reflect this change.

Copy link
Contributor Author

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

src/config.rs Outdated

/// Number of seconds before the end of the slot to stop querying for new blocks
#[from_env(
var = "BLOCK_QUERY_CUTOFF_SECS",
Copy link
Member

Choose a reason for hiding this comment

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

let's change to BLOCK_QUERY_CUTOFF

src/config.rs Outdated
desc = "Number of seconds before the end of the slot to stop querying for new blocks",
default = 2
)]
pub block_query_cutoff_secs: u64,
Copy link
Member

Choose a reason for hiding this comment

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

ditto, for consistency with other services

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.

Actually, disregard the other review. This should be called BLOCK_QUERY_CUTOFF_BUFFER

@dylanlott dylanlott marked this pull request as ready for review November 21, 2025 17:45
@dylanlott dylanlott requested a review from prestwich as a code owner November 21, 2025 17:45
@dylanlott dylanlott requested a review from Evalir November 21, 2025 17:45
#[from_env(
var = "BLOCK_QUERY_CUTOFF_BUFFER",
desc = "Number of seconds before the end of the slot to stop querying for new blocks",
default = 2
Copy link
Member

Choose a reason for hiding this comment

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

default should be 3

Copy link
Member

@prestwich prestwich left a comment

Choose a reason for hiding this comment

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

seconds is not enough resolution. needs to be milliseconds

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.

5 participants