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

feat: importing ethashjs as @ethereumjs/ethash #766

Merged
merged 93 commits into from
Jun 16, 2020
Merged

Conversation

evertonfraga
Copy link
Contributor

@evertonfraga evertonfraga commented Jun 6, 2020

I have modified the monorepify.sh script to import ethashjs to this monorepo.

Thanks to @ryanio for converting this library to this monorepo standards in no-time =)

  • Update readme and package.json with new names
  • Migrate from coveralls to codecov

Note: this PR should be merged with "Create merge commit", so all commits will be present on the master branch.

Created with: 
```graph TD
  vm{VM}
  common --> blockchain
  common --> block
  common --> vm
  common --> tx
  ethash --> blockchain
  block --> blockchain
  blockchain --> vm
  block --> vm
  tx --> vm
  tx --> block
  account --> vm```
@evertonfraga evertonfraga marked this pull request as ready for review June 11, 2020 20:19
@evertonfraga
Copy link
Contributor Author

This is ready for review. The failure is due to the coverage difference, now that Ethash is in.

@evertonfraga evertonfraga requested a review from holgerd77 June 11, 2020 20:51
@ryanio
Copy link
Contributor

ryanio commented Jun 12, 2020

looks great! should i add a commit for #766 (comment)

@evertonfraga
Copy link
Contributor Author

Sure! @ryanio

@evertonfraga evertonfraga added this to the VM v5 milestone Jun 12, 2020
@@ -18,13 +18,10 @@ import {
getSeed
} from './util'
import type { LevelUp } from 'levelup'
import type { Block, BlockHeader } from '@ethereumjs/block'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -122,8 +119,8 @@ export default class Ethash {
return keccak256(Buffer.concat(this.cache))
}

headerHash(header: BlockHeader) {
return rlphash(header.slice(0, -2))
headerHash(rawHeader: Buffer[]) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryanio the Buffer type seems correct here, but why was it BlockHeader first place? The tests that cover this function actually passed before this change, so I am a bit confused.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a misunderstanding on my part of what the input was when I transcribed it to TS.

It didn't complain because I set BlockHeader to type any since block v3 still wasn't on npm.

packages/ethash/src/index.ts Outdated Show resolved Hide resolved
@evertonfraga evertonfraga requested a review from ryanio June 15, 2020 12:00
packages/ethash/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@ryanio ryanio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!
Thanks for all your help

@evertonfraga evertonfraga merged commit 094d24b into master Jun 16, 2020
@evertonfraga evertonfraga deleted the welcome-ethash branch June 16, 2020 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants