proof of work based on bitcoin - #62
Closed
b-yap wants to merge 388 commits into
Closed
Conversation
b-yap
added a commit
that referenced
this pull request
Jan 14, 2022
b-yap
force-pushed
the
feat/pow/bitcoin
branch
from
January 25, 2022 02:01
d8fe407 to
1e9b47f
Compare
b-yap
commented
Jan 25, 2022
|
|
||
| impl Pow { | ||
| fn last_non_special_min_difficulty(_block: &Block, _pow_limit: Compact) -> Compact { | ||
| // TODO: this requires that a height can be derived. |
Contributor
Author
There was a problem hiding this comment.
@TheQuantumPhysicist This is the line 30 of pow.cpp
I'm not yet sure how our pIndex will look like, since that's the way to get the height
Contributor
There was a problem hiding this comment.
The pIndex stuff you're pointing to is only relevant for testnet. Ignore it for now: https://github.com/bitcoin/bitcoin/blob/69ef0a107f0d371d1cd65e3033e8751738964a8d/src/pow.cpp#L21
b-yap
commented
Jan 25, 2022
| } | ||
| } | ||
|
|
||
| // TODO: get the ancestor: const CBlockIndex* pindexFirst = pindexLast->GetAncestor(nHeightFirst); |
Contributor
Author
There was a problem hiding this comment.
@TheQuantumPhysicist This here too, line 43 of pow.cpp
Contributor
There was a problem hiding this comment.
This line just gets the block index (block information) at height nHeightFirst, then uses that information to get the block time.
…unsigned 256 bits. changed from just `Vec<u8>` to `Compact`
…unsigned 256 bits. changed from just `Vec<u8>` to `Compact`
move util to common: #44 (comment) segregated the logic of nonce loop, block creation, difficulty checking: https://github.com/mintlayer/mintlayer-core/pull/44/files#r767755363 https://github.com/mintlayer/mintlayer-core/pull/44/files#r767760939 added a `ConsensusParams` where it can be POW, POS, etc: https://github.com/mintlayer/mintlayer-core/pull/44/files#r767759231 Compact inner already u32: https://github.com/mintlayer/mintlayer-core/pull/44/files#r767749840
stuck from the rebase
b-yap
force-pushed
the
feat/pow/bitcoin
branch
from
February 10, 2022 08:07
ffc7769 to
41ff78f
Compare
b-yap
force-pushed
the
feat/pow/bitcoin
branch
from
February 10, 2022 08:14
41ff78f to
ea7e597
Compare
b-yap
force-pushed
the
feat/pow/bitcoin
branch
from
February 10, 2022 08:40
f255e66 to
2114e73
Compare
b-yap
force-pushed
the
feat/pow/bitcoin
branch
from
February 10, 2022 08:57
2114e73 to
4de73a9
Compare
b-yap
force-pushed
the
feat/pow/bitcoin
branch
from
February 10, 2022 09:01
4de73a9 to
a74247f
Compare
…network to derive the bits -> and then bits used to check difficulty. updated Compact conversion, not to return as an Option for method `fn from_uint256()`
b-yap
force-pushed
the
feat/pow/bitcoin
branch
from
February 10, 2022 09:06
a74247f to
6cb706c
Compare
b-yap
added a commit
that referenced
this pull request
Feb 10, 2022
Contributor
Author
|
continue to PR #99 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This will depend on #70, so this will not actually compile just yet.proof of work based on bitcoin core.
This is not for merging to master branch, but for discussion purposes.