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

increase init time #1617

Merged
merged 1 commit into from
Oct 23, 2023
Merged

increase init time #1617

merged 1 commit into from
Oct 23, 2023

Conversation

tudor-malene
Copy link
Collaborator

Why this change is needed

remove a simulation flakyness

What changes were made as part of this PR

increase initialisation time

PR checks pre-merging

Please indicate below by ticking the checkbox that you have read and performed the required
PR checks

  • PR checks reviewed and performed

@coderabbitai
Copy link

coderabbitai bot commented Oct 20, 2023

Walkthrough

The proposed change in the Start method of the Simulation struct in the simulation.go file aims to improve the reliability of the simulation process. It increases the sleep duration to 2 seconds to ensure all L2 nodes have sufficient time to receive the genesis L2 batch before the simulation proceeds.

Changes

File Summary
.../simulation/simulation.go Increased sleep duration in the Start method to allow all L2 nodes to receive the genesis L2 batch, enhancing the reliability of the simulation process.

Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • Mention @coderabbitai in any review comment for bot assistance.
  • Note: Review comments are made on code diffs or files, not on the PR overview.

Pause Incremental Reviews

  • Insert @coderabbitai: ignore in the PR description to halt the bot's ongoing reviews. Remove the line to resume.
  • Additionally, enter @coderabbitai pause to halt the bot's ongoing reviews as any issue or review comment. To
    resume reviews, enter @coderabbitai resume as any issue or review comment.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Commits Files that changed from the base of the PR and between 85f05f9 and 90c35c7.
Files selected for processing (1)
  • integration/simulation/simulation.go (1 hunks)

Comment on lines +59 to +60
// and for all l2 nodes to receive the genesis l2 batch
time.Sleep(2 * time.Second)
Copy link

Choose a reason for hiding this comment

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

The sleep duration has been increased from 1 second to 2 seconds. This change is intended to provide more time for all L2 nodes to receive the genesis L2 batch. However, relying on arbitrary sleep times can lead to unpredictable behavior and potential race conditions. It would be more reliable to implement a mechanism that checks whether all L2 nodes have received the genesis L2 batch before proceeding.

-    time.Sleep(2 * time.Second)
+    s.waitForL2NodesToReceiveGenesisBatch()

This new method waitForL2NodesToReceiveGenesisBatch should implement a polling mechanism to check the status of L2 nodes and only return when all nodes have received the genesis batch. This will ensure a more reliable initialization of the simulation.

@tudor-malene tudor-malene merged commit 8f89805 into main Oct 23, 2023
2 checks passed
@tudor-malene tudor-malene deleted the tudor/fix_race branch October 23, 2023 14:59
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.

3 participants