Skip to content

apollo_network_benchmark: add seconds_since_epoch helper function - #11559

Closed
sirandreww-starkware wants to merge 1 commit into
01-08-apollo_network_benchmark_add_roundrobin_mode_to_enum_and_round_duration_seconds_argfrom
01-08-apollo_network_benchmark_add_seconds_since_epoch_helper_function
Closed

sirandreww-starkware wants to merge 1 commit into
01-08-apollo_network_benchmark_add_roundrobin_mode_to_enum_and_round_duration_seconds_argfrom
01-08-apollo_network_benchmark_add_seconds_since_epoch_helper_function

Conversation

@sirandreww-starkware

@sirandreww-starkware sirandreww-starkware commented Jan 8, 2026 •

Copy link
Copy Markdown
Contributor

Note

Low Risk
Small, isolated utility addition in benchmark code; only risk is the unwrap() on system clock time, which could panic in unusual environments.

Overview
Adds a seconds_since_epoch() helper in broadcast_network_stress_test_node/metrics.rs (and the required SystemTime/UNIX_EPOCH imports) to expose the current Unix timestamp in seconds for use by the benchmark/stress-test code.

Written by Cursor Bugbot for commit b7e9596. This will update automatically on new commits. Configure here.

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

sirandreww-starkware commented Jan 8, 2026 •

Copy link
Copy Markdown
Contributor 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.

@github-actions

github-actions Bot commented Feb 8, 2026

Copy link
Copy Markdown

There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale.
This PR will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@github-actions github-actions Bot added the stale label Feb 8, 2026
@github-actions github-actions Bot closed this Feb 16, 2026
pub fn seconds_since_epoch() -> u64 {
let now = SystemTime::now();
now.duration_since(UNIX_EPOCH).unwrap().as_secs()
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

New exported function seconds_since_epoch is unused

Low Severity

The newly added pub fn seconds_since_epoch() has no callers anywhere in the codebase. A grep for seconds_since_epoch returns only the definition itself. If this is intended for a downstream PR in the stack, it may be better to introduce it together with its usage to avoid dead code in the interim.

Fix in Cursor Fix in Web

@sirandreww-starkware
sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_seconds_since_epoch_helper_function branch from 6e7d057 to ffaea93 Compare February 16, 2026 09:10
@github-actions github-actions Bot removed the stale label Feb 17, 2026
@sirandreww-starkware
sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_seconds_since_epoch_helper_function branch from ffaea93 to c686f08 Compare February 19, 2026 07:24
@sirandreww-starkware
sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_roundrobin_mode_to_enum_and_round_duration_seconds_arg branch from 64dcc25 to 8cd5e64 Compare February 19, 2026 07:24
@sirandreww-starkware
sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_roundrobin_mode_to_enum_and_round_duration_seconds_arg branch from 8cd5e64 to f8aaeb3 Compare February 19, 2026 08:04
@sirandreww-starkware
sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_seconds_since_epoch_helper_function branch from c686f08 to a5e0165 Compare February 19, 2026 08:04
@sirandreww-starkware
sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_seconds_since_epoch_helper_function branch from a5e0165 to 1d13062 Compare March 16, 2026 15:13
@sirandreww-starkware
sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_roundrobin_mode_to_enum_and_round_duration_seconds_arg branch from 04b68d7 to bbb74b0 Compare March 22, 2026 17:09
@sirandreww-starkware
sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_seconds_since_epoch_helper_function branch from 1d13062 to 0edd3bd Compare March 22, 2026 17:09

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

pub fn seconds_since_epoch() -> u64 {
let now = SystemTime::now();
now.duration_since(UNIX_EPOCH).unwrap().as_secs()
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

New helper duplicates existing Clock::unix_now() utility

Low Severity

The new seconds_since_epoch function duplicates functionality already provided by Clock::unix_now() in apollo_time::time. That trait method returns u64 seconds from epoch and is available via DefaultClock. Using the existing Clock trait would also enable mocking in tests via MockClock.

Fix in Cursor Fix in Web

@sirandreww-starkware
sirandreww-starkware force-pushed the 01-08-apollo_network_benchmark_add_seconds_since_epoch_helper_function branch from 0edd3bd to b7e9596 Compare March 30, 2026 11:08
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants