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

Ch3 Extension hardhat chain automining #243

Open
Pabl0cks opened this issue Dec 10, 2024 · 3 comments
Open

Ch3 Extension hardhat chain automining #243

Pabl0cks opened this issue Dec 10, 2024 · 3 comments
Assignees

Comments

@Pabl0cks
Copy link
Collaborator

Trying to reproduce #242 in the current live challenge, I've realized the "Rigged Roll" was much smoother there, because in the extension challenge I had to refresh the blocks by hitting a regular roll or by using the faucet, in order to get a new block to be able to rig roll.

In our live version of the challenge, hardhat is configured to have block auto mining, but in our extensions it's not.

If the behaviour is too specific to implement it in create-eth maybe we should just hint it in the new readme?

hardhat: {
      mining: {
        auto: true,
        interval: 1000,
      },
      forking: {
        url: `https://eth-mainnet.alchemyapi.io/v2/${providerApiKey}`,
        enabled: process.env.MAINNET_FORKING_ENABLED === "true",
      },
    },
@rin-st
Copy link
Member

rin-st commented Dec 10, 2024

Good catch!

Yes, we can add it in Readme. But maybe it's better to add possibility to configure hardhat network for mining? Because with mining

  • hardhat becomes more similar to real networks
  • sometimes I meet inconveniences/errors because of absence of mining

Any cons of mining?

@damianmarti
Copy link
Member

Great catch!!

Yes, maybe we can an autoMining flag to the hardhat config template at create-eth (and maybe an interval too) to add this to the resulting hardhat.config.ts file. cc/ @carletex @technophile-04

If you think this is the way to go, I can add this.

@carletex
Copy link
Member

Any cons of mining?

I guess the "issue" is that with automining you get the TX mined instantly, but when is disabled (so interval mining is enabled) you have to wait a bit (the interval time). If the interval time is 1s I guess is fine...

In any case, since we discussed, we should rethink some of the customization options for create-eth templates (allow total customization for config objects files). I'll create an issue for it so we can discuss.

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

No branches or pull requests

4 participants