Skip to content

proof of work based on bitcoin - #62

Closed
b-yap wants to merge 388 commits into
masterfrom
feat/pow/bitcoin
Closed

proof of work based on bitcoin#62
b-yap wants to merge 388 commits into
masterfrom
feat/pow/bitcoin

Conversation

@b-yap

@b-yap b-yap commented Jan 12, 2022

Copy link
Copy Markdown
Contributor

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.

Comment thread block_production/src/pow/compact.rs Outdated
Comment thread block_production/src/lib.rs Outdated
Comment thread block_production/src/pow/network.rs Outdated
Comment thread block_production/src/pow/network.rs Outdated
Comment thread block_production/src/pow/compact.rs Outdated
Comment thread block_production/src/lib.rs Outdated
b-yap added a commit that referenced this pull request Jan 14, 2022
@b-yap
b-yap changed the base branch from feat/block_production to master January 24, 2022 09:45
Comment thread block_production/src/pow/work.rs Outdated

impl Pow {
fn last_non_special_min_difficulty(_block: &Block, _pow_limit: Compact) -> Compact {
// TODO: this requires that a height can be derived.

@b-yap b-yap Jan 25, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Comment thread block_production/src/pow/work.rs Outdated
}
}

// TODO: get the ancestor: const CBlockIndex* pindexFirst = pindexLast->GetAncestor(nHeightFirst);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This line just gets the block index (block information) at height nHeightFirst, then uses that information to get the block time.

@b-yap
b-yap changed the base branch from master to carla-pow-backup February 10, 2022 08:16
@b-yap
b-yap changed the base branch from carla-pow-backup to master February 10, 2022 08:17
…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

b-yap commented Feb 10, 2022

Copy link
Copy Markdown
Contributor Author

continue to PR #99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants