-
Notifications
You must be signed in to change notification settings - Fork 12
Remove PoW consensus #1
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
Conversation
c816527
to
6cd9101
Compare
This is so satisfying. |
@@ -265,7 +239,6 @@ pub trait ConsensusEngine: Sync + Send { | |||
header.hash() | |||
} | |||
|
|||
/// In PoW consensus, the higher scored block becomes the best block. |
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.
We may remove the "score" in the header. When using the Tendermint consensus algorithm, we can't define a valid "score" value. A finalized block must have a higher score than a proposal block. Since the content of a block is not changed whether it is finalized or not. The score always has a weird value.
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.
I made an issue for it.
core/src/miner/miner.rs
Outdated
let (work, is_new) = { | ||
let mut sealing_work = self.sealing_work.lock(); | ||
let last_work_hash = sealing_work.queue.peek_last_ref().map(|pb| pb.block().header().hash()); | ||
let mut sealing_work = self.sealing_work.lock(); |
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.
@sgkim126 What do you think about removing SealingWork and SealingQueue. IMO, they were used by PoW consensus to try to make multiple blocks' seal at the same time. When we are using the Tendermint Consensus, we only create a seal at a time.
Also in another point of view, the sealing_work.queue was needed because sealing in the PoW consensus is an asynchronous job. Creating a seal in the Tendermint consensus is a blocking job. We do not need to use the queue.
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.
Looks good. I'll try.
9b03e27
to
5e9217a
Compare
Travis failed because it pulls the pr for 19. I don't know why but I think it's the fault of Travis. |
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.
LGTM
It fixes #4