-
Notifications
You must be signed in to change notification settings - Fork 773
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
Block: add methods to calculate difficulty of a consecutive header/block #929
Merged
+120
−29
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c672b07
block: replace `cmp` with their `gt`/`lt` equivalent
jochem-brouwer 515051e
block: header: allow option to provide a difficulty header
jochem-brouwer 7423290
blockchain: use new method to calculate difficulty
jochem-brouwer 73e6239
block: update docs
jochem-brouwer 8cb1b1f
block: calcDifficultyFromHeader option comment description improvements
holgerd77 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
block: calcDifficultyFromHeader option comment description improvements
- v4.1.3
- v4.1.2
- v4.1.1
- v4.1.0
- v4.0.0
- v4.0.0-beta.1
- v3.0.0
- v2.6.0
- v2.5.1
- v2.5.0
- v2.4.0
- v2.3.5
- v2.3.4
- v2.3.3
- v2.3.2
- v2.3.1
- rlp@4.0.0-beta.2
- rlp@4.0.0-beta.1
- rlp@3.0.0
- merkle-patricia-tree@4.2.4
- merkle-patricia-tree@4.2.3
- merkle-patricia-tree@4.2.2
- merkle-patricia-tree@4.2.1
- merkle-patricia-tree@4.2.0
- merkle-patricia-tree@4.1.0
- ethereumjs-util@7.1.5
- ethereumjs-util@7.1.4
- ethereumjs-util@7.1.3
- ethereumjs-util@7.1.2
- ethereumjs-util@7.1.1
- ethereumjs-util@7.1.0
- ethereumjs-util@7.0.10
- @ethereumjs/wallet@2.0.4
- @ethereumjs/wallet@2.0.3
- @ethereumjs/wallet@2.0.2
- @ethereumjs/wallet@2.0.1
- @ethereumjs/wallet@2.0.0
- @ethereumjs/wallet@2.0.0-rc.1
- @ethereumjs/vm@8.1.1
- @ethereumjs/vm@8.1.0
- @ethereumjs/vm@8.0.0
- @ethereumjs/vm@7.2.0
- @ethereumjs/vm@7.1.0
- @ethereumjs/vm@7.0.0
- @ethereumjs/vm@7.0.0-rc.1
- @ethereumjs/vm@6.5.0
- @ethereumjs/vm@6.4.2
- @ethereumjs/vm@6.4.0
- @ethereumjs/vm@6.3.0
- @ethereumjs/vm@6.2.0
- @ethereumjs/vm@6.1.0
- @ethereumjs/vm@6.0.0
- @ethereumjs/vm@6.0.0-beta.3
- @ethereumjs/vm@6.0.0-beta.2
- @ethereumjs/vm@6.0.0-beta.1
- @ethereumjs/vm@5.9.3
- @ethereumjs/vm@5.9.2
- @ethereumjs/vm@5.9.1
- @ethereumjs/vm@5.9.0
- @ethereumjs/vm@5.8.0
- @ethereumjs/vm@5.7.1
- @ethereumjs/vm@5.7.0
- @ethereumjs/vm@5.6.0
- @ethereumjs/vm@5.5.3
- @ethereumjs/vm@5.5.2
- @ethereumjs/vm@5.5.1
- @ethereumjs/vm@5.5.0
- @ethereumjs/vm@5.4.1
- @ethereumjs/vm@5.4.0
- @ethereumjs/vm@5.3.1
- @ethereumjs/vm@5.3.0
- @ethereumjs/vm@5.2.0
- @ethereumjs/vm@5.1.0
- @ethereumjs/vm@5.0.0
- @ethereumjs/vm@5.0.0-rc.1
- @ethereumjs/vm@5.0.0-beta.2
- @ethereumjs/verkle@0.1.0
- @ethereumjs/verkle@0.0.2
- @ethereumjs/util@9.1.0
- @ethereumjs/util@9.0.3
- @ethereumjs/util@9.0.2
- @ethereumjs/util@9.0.1
- @ethereumjs/util@9.0.0
- @ethereumjs/util@9.0.0-rc.1
- @ethereumjs/util@8.1.0
- @ethereumjs/util@8.0.6
- @ethereumjs/util@8.0.4
- @ethereumjs/util@8.0.3
- @ethereumjs/util@8.0.2
- @ethereumjs/util@8.0.0
- @ethereumjs/util@8.0.0-beta.3
- @ethereumjs/util@8.0.0-beta.2
- @ethereumjs/util@8.0.0-beta.1
- @ethereumjs/tx@5.4.0
- @ethereumjs/tx@5.3.0
- @ethereumjs/tx@5.2.1
- @ethereumjs/tx@5.2.0
- @ethereumjs/tx@5.1.0
- @ethereumjs/tx@5.0.0
- @ethereumjs/tx@5.0.0-rc.1
- @ethereumjs/tx@4.2.0
- @ethereumjs/tx@4.1.2
- @ethereumjs/tx@4.1.0
- @ethereumjs/tx@4.0.2
- @ethereumjs/tx@4.0.1
- @ethereumjs/tx@4.0.0
- @ethereumjs/tx@4.0.0-beta.3
- @ethereumjs/tx@4.0.0-beta.2
- @ethereumjs/tx@4.0.0-beta.1
- @ethereumjs/tx@3.5.2
- @ethereumjs/tx@3.5.1
- @ethereumjs/tx@3.5.0
- @ethereumjs/tx@3.4.0
- @ethereumjs/tx@3.3.2
- @ethereumjs/tx@3.3.1
- @ethereumjs/tx@3.3.0
- @ethereumjs/tx@3.2.1
- @ethereumjs/tx@3.2.0
- @ethereumjs/tx@3.1.4
- @ethereumjs/tx@3.1.3
- @ethereumjs/tx@3.1.2
- @ethereumjs/tx@3.1.1
- @ethereumjs/tx@3.1.0
- @ethereumjs/tx@3.0.2
- @ethereumjs/tx@3.0.1
- @ethereumjs/tx@3.0.0
- @ethereumjs/tx@3.0.0-rc.1
- @ethereumjs/tx@3.0.0-beta.2
- @ethereumjs/trie@6.2.1
- @ethereumjs/trie@6.2.0
- @ethereumjs/trie@6.1.1
- @ethereumjs/trie@6.1.0
- @ethereumjs/trie@6.0.1
- @ethereumjs/trie@6.0.0
- @ethereumjs/trie@6.0.0-rc.1
- @ethereumjs/trie@5.1.0
- @ethereumjs/trie@5.0.5
- @ethereumjs/trie@5.0.4
- @ethereumjs/trie@5.0.3
- @ethereumjs/trie@5.0.2
- @ethereumjs/trie@5.0.1
- @ethereumjs/trie@5.0.0
- @ethereumjs/trie@5.0.0-beta.3
- @ethereumjs/trie@5.0.0-beta.2
- @ethereumjs/trie@5.0.0-beta.1
- @ethereumjs/statemanager@2.4.0
- @ethereumjs/statemanager@2.3.0
- @ethereumjs/statemanager@2.2.2
- @ethereumjs/statemanager@2.2.1
- @ethereumjs/statemanager@2.2.0
- @ethereumjs/statemanager@2.1.0
- @ethereumjs/statemanager@2.0.0
- @ethereumjs/statemanager@2.0.0-rc.1
- @ethereumjs/statemanager@1.1.0
- @ethereumjs/statemanager@1.0.5
- @ethereumjs/statemanager@1.0.3
- @ethereumjs/statemanager@1.0.2
- @ethereumjs/statemanager@1.0.1
- @ethereumjs/statemanager@1.0.0
- @ethereumjs/statemanager@1.0.0-beta.3
- @ethereumjs/statemanager@1.0.0-beta.2
- @ethereumjs/statemanager@1.0.0-beta.1
- @ethereumjs/rlp@5.0.2
- @ethereumjs/rlp@5.0.1
- @ethereumjs/rlp@5.0.0
- @ethereumjs/rlp@5.0.0-rc.1
- @ethereumjs/rlp@4.0.1
- @ethereumjs/rlp@4.0.0
- @ethereumjs/rlp@4.0.0-beta.3
- @ethereumjs/genesis@0.2.3
- @ethereumjs/genesis@0.2.2
- @ethereumjs/genesis@0.2.1
- @ethereumjs/genesis@0.2.0
- @ethereumjs/genesis@0.1.0
- @ethereumjs/genesis@0.1.0-rc.1
- @ethereumjs/evm-beta.2
- @ethereumjs/evm@3.1.1
- @ethereumjs/evm@3.1.0
- @ethereumjs/evm@3.0.0
- @ethereumjs/evm@2.2.1
- @ethereumjs/evm@2.2.0
- @ethereumjs/evm@2.1.0
- @ethereumjs/evm@2.0.0
- @ethereumjs/evm@2.0.0-rc.2
- @ethereumjs/evm@2.0.0-rc.1
- @ethereumjs/evm@1.4.0
- @ethereumjs/evm@1.3.2
- @ethereumjs/evm@1.3.0
- @ethereumjs/evm@1.2.3
- @ethereumjs/evm@1.2.2
- @ethereumjs/evm@1.2.1
- @ethereumjs/evm@1.2.0
- @ethereumjs/evm@1.1.0
- @ethereumjs/evm@1.0.0
- @ethereumjs/evm@1.0.0-beta.3
- @ethereumjs/evm@1.0.0-beta.1
- @ethereumjs/ethash@3.0.4
- @ethereumjs/ethash@3.0.3
- @ethereumjs/ethash@3.0.2
- @ethereumjs/ethash@3.0.1
- @ethereumjs/ethash@3.0.0
- @ethereumjs/ethash@3.0.0-rc.1
- @ethereumjs/ethash@2.1.0
- @ethereumjs/ethash@2.0.5
- @ethereumjs/ethash@2.0.3
- @ethereumjs/ethash@2.0.2
- @ethereumjs/ethash@2.0.1
- @ethereumjs/ethash@2.0.0
- @ethereumjs/ethash@2.0.0-beta.3
- @ethereumjs/ethash@2.0.0-beta.2
- @ethereumjs/ethash@2.0.0-beta.1
- @ethereumjs/ethash@1.1.0
- @ethereumjs/ethash@1.0.0
- @ethereumjs/ethash@1.0.0-rc.1
- @ethereumjs/devp2p@6.1.3
- @ethereumjs/devp2p@6.1.2
- @ethereumjs/devp2p@6.1.1
- @ethereumjs/devp2p@6.1.0
- @ethereumjs/devp2p@6.0.1
- @ethereumjs/devp2p@6.0.0
- @ethereumjs/devp2p@6.0.0-rc.1
- @ethereumjs/devp2p@5.2.0
- @ethereumjs/devp2p@5.1.2
- @ethereumjs/devp2p@5.1.0
- @ethereumjs/devp2p@5.0.2
- @ethereumjs/devp2p@5.0.1
- @ethereumjs/devp2p@5.0.0
- @ethereumjs/devp2p@5.0.0-beta.3
- @ethereumjs/devp2p@5.0.0-beta.2
- @ethereumjs/devp2p@5.0.0-beta.1
- @ethereumjs/devp2p@4.2.2
- @ethereumjs/devp2p@4.2.1
- @ethereumjs/devp2p@4.2.0
- @ethereumjs/devp2p@4.1.0
- @ethereumjs/devp2p@4.0.0
- @ethereumjs/common@4.4.0
- @ethereumjs/common@4.3.0
- @ethereumjs/common@4.2.0
- @ethereumjs/common@4.1.0
- @ethereumjs/common@4.0.0
- @ethereumjs/common@4.0.0-rc.1
- @ethereumjs/common@3.2.0
- @ethereumjs/common@3.1.2
- @ethereumjs/common@3.1.0
- @ethereumjs/common@3.0.2
- @ethereumjs/common@3.0.1
- @ethereumjs/common@3.0.0
- @ethereumjs/common@3.0.0-beta.3
- @ethereumjs/common@3.0.0-beta.2
- @ethereumjs/common@3.0.0-beta.1
- @ethereumjs/common@2.6.5
- @ethereumjs/common@2.6.4
- @ethereumjs/common@2.6.3
- @ethereumjs/common@2.6.2
- @ethereumjs/common@2.6.1
- @ethereumjs/common@2.6.0
- @ethereumjs/common@2.5.0
- @ethereumjs/common@2.4.0
- @ethereumjs/common@2.3.1
- @ethereumjs/common@2.3.0
- @ethereumjs/common@2.2.0
- @ethereumjs/common@2.1.0
- @ethereumjs/common@2.0.0
- @ethereumjs/common@2.0.0-rc.1
- @ethereumjs/common@2.0.0-beta.2
- @ethereumjs/client@0.10.2
- @ethereumjs/client@0.10.1
- @ethereumjs/client@0.10.0
- @ethereumjs/client@0.9.0
- @ethereumjs/client@0.8.1
- @ethereumjs/client@0.8.0
- @ethereumjs/client@0.7.1
- @ethereumjs/client@0.7.0
- @ethereumjs/client@0.6.6
- @ethereumjs/client@0.6.4
- @ethereumjs/client@0.6.3
- @ethereumjs/client@0.6.1
- @ethereumjs/client@0.6.0
- @ethereumjs/client@0.5.1
- @ethereumjs/client@0.5.0
- @ethereumjs/client@0.4.1
- @ethereumjs/client@0.4.0
- @ethereumjs/client@0.3.0
- @ethereumjs/client@0.2.0
- @ethereumjs/client@0.1.0
- @ethereumjs/blockchain@7.3.0
- @ethereumjs/blockchain@7.2.0
- @ethereumjs/blockchain@7.1.0
- @ethereumjs/blockchain@7.0.1
- @ethereumjs/blockchain@7.0.0
- @ethereumjs/blockchain@7.0.0-rc.1
- @ethereumjs/blockchain@6.3.0
- @ethereumjs/blockchain@6.2.2
- @ethereumjs/blockchain@6.2.0
- @ethereumjs/blockchain@6.1.0
- @ethereumjs/blockchain@6.0.2
- @ethereumjs/blockchain@6.0.1
- @ethereumjs/blockchain@6.0.0
- @ethereumjs/blockchain@6.0.0-beta.3
- @ethereumjs/blockchain@6.0.0-beta.2
- @ethereumjs/blockchain@6.0.0-beta.1
- @ethereumjs/blockchain@5.5.3
- @ethereumjs/blockchain@5.5.2
- @ethereumjs/blockchain@5.5.1
- @ethereumjs/blockchain@5.5.0
- @ethereumjs/blockchain@5.4.2
- @ethereumjs/blockchain@5.4.1
- @ethereumjs/blockchain@5.4.0
- @ethereumjs/blockchain@5.3.1
- @ethereumjs/blockchain@5.3.0
- @ethereumjs/blockchain@5.2.1
- @ethereumjs/blockchain@5.2.0
- @ethereumjs/blockchain@5.1.0
- @ethereumjs/blockchain@5.0.0
- @ethereumjs/blockchain@5.0.0-rc.1
- @ethereumjs/blockchain@5.0.0-beta.2
- @ethereumjs/block@5.3.0
- @ethereumjs/block@5.2.0
- @ethereumjs/block@5.1.1
- @ethereumjs/block@5.1.0
- @ethereumjs/block@5.0.1
- @ethereumjs/block@5.0.0
- @ethereumjs/block@5.0.0-rc.1
- @ethereumjs/block@4.3.0
- @ethereumjs/block@4.2.2
- @ethereumjs/block@4.2.0
- @ethereumjs/block@4.1.0
- @ethereumjs/block@4.0.1
- @ethereumjs/block@4.0.0
- @ethereumjs/block@4.0.0-beta.3
- @ethereumjs/block@4.0.0-beta.2
- @ethereumjs/block@4.0.0-beta.1
- @ethereumjs/block@3.6.3
- @ethereumjs/block@3.6.2
- @ethereumjs/block@3.6.1
- @ethereumjs/block@3.6.0
- @ethereumjs/block@3.5.1
- @ethereumjs/block@3.5.0
- @ethereumjs/block@3.4.0
- @ethereumjs/block@3.3.0
- @ethereumjs/block@3.2.1
- @ethereumjs/block@3.2.0
- @ethereumjs/block@3.1.0
- @ethereumjs/block@3.0.0
- @ethereumjs/block@3.0.0-rc.1
- @ethereumjs/block@3.0.0-beta.2
commit 8cb1b1f383982f3224af54116a034c3f7e032d0e
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was to prone yet for misunderstanding, have updated the comment with an additional commit. The double
Block Header
reference was too confusing - one refering to the header provided and one to the header created.Some general note: I think the usage of "this" in these kind of option comments often don't work, since it is always a bit misleading in the sense that it becomes not 100% clear if "this" refers to "this" option provided or to "this" instance created, I now stumbled upon this (haha 😄 ) a couple of times. Think it works better to in doubt be a bit more redundant and e.g. repeat "the header provided" instead of using "this header".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes I'm somewhat used to write
this
in these descriptions, will have to self-review those sometimes 👍