-
Notifications
You must be signed in to change notification settings - Fork 75
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
[ETCM-177] Simplify ommers handling #745
Conversation
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.
Should we go further in the pool validation for ommers (ex. check if there were already used)
I think we are currently in the middle between 2 approaches:
- Keeping the ommers pool with a lot of tentative ommers query, which is why the pool response depends on the block being mined
- Keeping the ommers pool with only the ommers that will be valid for the block being mined, which ideally won't require any validations (neither on pool query or block generation)
Option 1. seems to be closer to what we currently have, so I'm more inclined to it as well... we could keep the removals of ommers to the bare minimum (as they are only tentative ommers), improve the validations done on the pool upon query as you said and remove validations on the block generator
val pHeader = parent.header | ||
val blockNumber = pHeader.number + 1 | ||
val parentHash = pHeader.hash | ||
|
||
val ommersV = validators.ommersValidator | ||
val ommers = validators.ommersValidator.validate(parentHash, blockNumber, x, blockchain) match { | ||
case Left(_) => emptyX |
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.
Should we log this case?
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.
mmm...now i'm thinking we could log this at ommers pool level once we finally do all the validations. Btw, the amount of ommers per block is something that we measure, so we couyld produce metrics, i mean, it won't be an issue to get track of that.
@@ -227,12 +226,9 @@ class BlockImporter( | |||
|
|||
private def broadcastNewBlocks(blocks: List[NewBlock]): Unit = broadcaster ! BroadcastBlocks(blocks) | |||
|
|||
private def updateTxAndOmmerPools(blocksAdded: Seq[Block], blocksRemoved: Seq[Block]): Unit = { | |||
blocksRemoved.headOption.foreach(block => ommersPool ! AddOmmers(block.header)) | |||
private def updateTxPool(blocksAdded: Seq[Block], blocksRemoved: Seq[Block]): Unit = { |
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 don't like much the middle ground of keeping the pool and ignoring any problems when using it on the miner, but only updating the pool it half of the times, should we:
- Remove the pool entirely and have no support with mining blocks with ommers
- Keep the pool updates as on develop and use the patch for producing blocks without ommers for handling the case that it has any invalid one
In answer to this comment and the other one too.
|
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!
.\\ //.
. \ \ / /.
.\ ,\ /` /,.-
-. \ /'/ / .
` - `-' \ -
'. /.\`
- .-
:`//.'
.`.'
.' BP
Description
fix for: https://jira.iohk.io/browse/ETCM-177
Proposed solution
TODO