-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
cmd, consensus, core, miner: instatx clique for --dev #15323
Conversation
Possibly worth delaying until a future PR, but it would be nice to be able to configure dev mode to mine blocks on a fixed schedule as well. Depending on the type of test I'm running, I sometimes want to mine blocks every time a transaction comes in, and other times I want to have regular blocks (e.g., 1 per second). The primary reason for having regular block intervals in testing is to ensure that the dApp/scripts work in an environment where there may be a delay between transaction submission and transaction mining (receipt available). Instant seal on the other hand is really useful for running unit tests, where you aren't testing the dApp->Ethereum Node interaction, but instead testing Solidity contracts or general features and you don't want to sit around waiting forever (second) for blocks to arrive to burn through your test suite. From the PR description, it sounds like this fulfills one of the two needs (instant blocks on transaction), but still requires mining and 15 second block times for the latter. Perhaps fixed block time is already possible by running a single-node clique chain? If so, then that half of the problem is already solved and this PR finishes it. :) |
@MicahZoltu Clique does support arbitrary block times, so supporting your request would entail overriding the default |
@MicahZoltu Added |
410347a
to
1e679f1
Compare
1e679f1
to
ffbb838
Compare
* cmd, consensus, core, miner: instatx clique for --dev * cmd, consensus, clique: support configurable --dev block times * cmd, core: allow --dev to use persistent storage too
Since forever we've had
--dev
in order to spin up a developer chain. Unfortunately it had quite a few issues:ethash
, it was wasting an entire CPU core to keep mining non-stopThis PR attempts to fix the
--dev
flag by:ethash
consensus engine withclique
clique
consensus engineclique
for 0 periods--dev.period
to control the block period time and not always default to0
Note: the PR also supports the
--datadir
flag for persistent storage (emphemeral by default).