Skip to content
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

feat(PocketIC): PocketIC certifies time after setting or advancing time #3571

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mraszyk
Copy link
Contributor

@mraszyk mraszyk commented Jan 22, 2025

This PR makes the endpoint /instances/<instance_id>/update/set_time certify state after setting time so that the latest certified state is a state with that time and, e.g., query calls and read state requests are evaluated on a state with the specified time. This also fixes flakiness when using an IC agent shortly after making a PocketIC instance live, but before the live mode executes a round.

@github-actions github-actions bot added the feat label Jan 22, 2025
@mraszyk mraszyk marked this pull request as ready for review January 22, 2025 17:02
@mraszyk mraszyk requested a review from a team as a code owner January 22, 2025 17:02
for subnet in pic.subnets.get_all() {
subnet.state_machine.set_time(set_time);
subnet.state_machine.execute_round();
Copy link
Contributor

Choose a reason for hiding this comment

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

I would favour adding a new endpoint rather than changing this one's semantics. Or are you sure that nobody could want to set the time without immediately executing a round?

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess the answer will be: Setting time without certifying it is useless. Is there no way to certify the time without running any message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there no way to certify the time without running any message?

Great question! There's a way analogously to what StateMachine tests do when, e.g., setting stable memory: 6512401

@mraszyk mraszyk marked this pull request as draft January 22, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants