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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion integration/simulation/simulation.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ func (s *Simulation) Start() {
s.waitForObscuroGenesisOnL1()

// Arbitrary sleep to wait for RPC clients to get up and running
time.Sleep(1 * time.Second)
// and for all l2 nodes to receive the genesis l2 batch
time.Sleep(2 * time.Second)
Comment on lines +59 to +60
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.


s.bridgeFundingToObscuro()
s.trackLogs() // Create log subscriptions, to validate that they're working correctly later.
Expand Down