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

eth_getWork starts mining #916

Closed
frozeman opened this issue May 11, 2015 · 3 comments
Closed

eth_getWork starts mining #916

frozeman opened this issue May 11, 2015 · 3 comments
Assignees
Labels
Milestone

Comments

@frozeman
Copy link
Contributor

when calling the eth_getWork RPC method, the node starts mining.

This is unexpected behaviour and can be be used as an attack vektor.

@frozeman frozeman added the RPC label May 11, 2015
@frozeman frozeman added this to the Frontier milestone May 11, 2015
obscuren added a commit to obscuren/go-ethereum that referenced this issue May 11, 2015
Miner threads are now settable through the admin interface (closes ethereum#897)
and specify 0 CPU worker threads when eth_getWork is called (closes ethereum#916)
@obscuren obscuren self-assigned this May 11, 2015
obscuren added a commit to obscuren/go-ethereum that referenced this issue May 11, 2015
Miner threads are now settable through the admin interface (closes ethereum#897)
and specify 0 CPU worker threads when eth_getWork is called (closes ethereum#916)
obscuren added a commit to obscuren/go-ethereum that referenced this issue May 11, 2015
Miner threads are now settable through the admin interface (closes ethereum#897)
and specify 0 CPU worker threads when eth_getWork is called (closes ethereum#916)
obscuren added a commit to obscuren/go-ethereum that referenced this issue May 11, 2015
Miner threads are now settable through the admin interface (closes ethereum#897)
and specify 0 CPU worker threads when eth_getWork is called (closes ethereum#916)
obscuren added a commit to obscuren/go-ethereum that referenced this issue May 11, 2015
Miner threads are now settable through the admin interface (closes ethereum#897)
and specify 0 CPU worker threads when eth_getWork is called (closes ethereum#916)
@frozeman
Copy link
Contributor Author

So it still starts mining, but now auto setting the threads to 0?
Looks like a hack to me :P

@frozeman
Copy link
Contributor Author

Additionally does the first call to eth_getWork return empty results, as it first need to start the miner:

> web3.eth.getWork()
["", "", ""]
> web3.eth.getWork()
["0x083461b6e139df6b1ac2aefd6d0ae9ed8f806fbdae2cb4da6074e6cc0fa78b01", "0x9b2baad7528ecec612c5751a6bd525905892d7892e155c3b05e61363154a940b", "0x00000010f90e0722483014401065c08da3de6a14fc51677179c69d7e8fd4b09a"]

This is not ideal, as you will always have to call it twice, to be sure you get the data.

@obscuren
Copy link
Contributor

A hack? No. Dig in the logic of the miner if you're curious but please don't cast opinions where you can't have one (yet).

maoueh pushed a commit to streamingfast/go-ethereum that referenced this issue Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants