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

Ethash frontier update #757

Closed
14 of 15 tasks
zelig opened this issue Apr 20, 2015 · 10 comments
Closed
14 of 15 tasks

Ethash frontier update #757

zelig opened this issue Apr 20, 2015 · 10 comments
Milestone

Comments

@zelig
Copy link
Contributor

zelig commented Apr 20, 2015

This issue collected all ethash related issues. @LefterisJP
we need to make sure all these tick off before frontier.

  • integrate minerthreads in Ethereum.StartMining
  • pass minerthreads admin JS admin.miner.start
  • pass minerthreads in CLI flag
  • ? miner tests using the test mini-DAG
  • update CLI makedag subcommand to support generating DAG for any epoch
  • check blocktests running time and unskip them if ok

@zelig zelig added this to the Frontier milestone Apr 20, 2015
@LefterisJP
Copy link
Contributor

I will help as much as I can, but golang is not my specialty. I am currently working on making the GO bridge use the new API. I will open a Pull Request and request feedback tomorrow probably.

@fjl
Copy link
Contributor

fjl commented Apr 22, 2015

The new bridge is almost done, see ethereum/ethash#41 for progress.

@Gustav-Simonsson
Copy link

Integration PR: #808

@Gustav-Simonsson
Copy link

Update: After debugging a bunch of bugs with @LefterisJP we now have a version where DAG creation works through Go bridge and mining works both on private chain and on testnet. Will verify it for block tests as well (their startup needs some updates to work with current develop branch)

One issue we found is that this call: https://github.com/LefterisJP/ethash/blob/finalize_and_use_new_api/ethash.go#L79 causes the Go garbage collector to run https://github.com/LefterisJP/ethash/blob/finalize_and_use_new_api/ethash.go#L67 before the C function is done with building the DAG.

This results in the C code running into segfault when trying to reference the cache in https://github.com/LefterisJP/ethash/blob/finalize_and_use_new_api/src/libethash/internal.c#L93

Commenting out the finalizer call avoids deallocating the cache before DAG building is done.

We should find out why the Go runtime / GC considers this cache to be unreachable before this call returns: https://github.com/LefterisJP/ethash/blob/finalize_and_use_new_api/ethash.go#L169

@Gustav-Simonsson
Copy link

Edit: moving the finalizer until after the call also works and should have same intended behavior.

@Gustav-Simonsson
Copy link

Another update: @fjl suggested a better way to clear the cache by moving the finalizer call to getCache and explicitly free the temp cache in makeDAG

@obscuren
Copy link
Contributor

obscuren commented May 6, 2015

All that's left to do is add miner control over the CPU's being used. It will require some significant re-write on the miner's part since it initialises the amount of agents on init.

@zelig
Copy link
Contributor Author

zelig commented May 11, 2015

now only 1 issue left, support miniDAG for testing. but this is not a frontier show stopper

@fjl
Copy link
Contributor

fjl commented May 11, 2015

                                                                                  You can do this now. Just use ethash.NewForTesting.

@zelig
Copy link
Contributor Author

zelig commented May 11, 2015

i know we can, we just dont yet :) but on second thought that shouldnt be an ethash issue any more. closing this ftw

@zelig zelig closed this as completed May 11, 2015
@zelig zelig removed the type:bug label May 11, 2015
tony-ricciardi pushed a commit to tony-ricciardi/go-ethereum that referenced this issue Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants