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

fix(core): fix geth --init temp dir race condition #2068

Merged
merged 2 commits into from Jan 22, 2023

Commits on Jan 21, 2023

  1. fix(core): fix geth --init temp dir race condition

     * previously, if multiple instances of geth were spawned concurrently,
       only one directory would be used to populate geth's genesis.json.
       this can lead to a race condition where the genesis.json would be
       re-written by a second instance, before the first instance reads the
       genesis.json for populating its db and genesis block with the geth
       --init command. this was possible because directory returned by
       std::env::temp_dir() is often shared
     * fixes the race condition by using tempfile::tempdir(), which creates
       a unique directory per call to tempdir()
    Rjected committed Jan 21, 2023
    Configuration menu
    Copy the full SHA
    f86cb67 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3efab9c View commit details
    Browse the repository at this point in the history