Skip to content

Conversation

@mmrozek
Copy link
Contributor

@mmrozek mmrozek commented Nov 6, 2020

Description

  1. Change type of stateRoot from Option to ByteString in WorldStateProxy to avoid mistakes
  2. Add a parent as a parameter of prepareBlock method.

This change should also solve the issue described in ETCM-329

// // this seems to discard failures, for better errors messages we might want to implement a different method (simulateBlock?)
// val result = blockPreparator.prepareBlock(block)
// Right(result.blockResult.receipts)
// FIXME DO WE NEED THAT?
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we could create task to delete those snappy tests? (I highly doubt anybody will ever use it)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I just created https://jira.iohk.io/browse/ETCM-349

*
* @param block the block with transactions to run
*/
private[ledger] def executeBlockTransactions(block: Block): Either[BlockExecutionError, BlockResult] = {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe it would be possible to pass parent header here as param , to avoid this blockchain.getBlockHeaderByHash(block.header.parentHash ?

@mmrozek mmrozek requested a review from kapke November 10, 2020 10:02
Copy link

@ntallar ntallar left a comment

Choose a reason for hiding this comment

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

Apart from the below comments, LGTM!

Do you think there's any test that could be added for any of the two issues?

@mmrozek
Copy link
Contributor Author

mmrozek commented Nov 13, 2020

@ntallar I don't think that we are able to add some reliable test to check that. I can't imagine any

Copy link

@ntallar ntallar left a comment

Choose a reason for hiding this comment

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

LGTM!

 .\\            //.
. \ \          / /.
.\  ,\     /` /,.-
 -.   \  /'/ /  .
 ` -   `-'  \  -
   '.       /.\`
      -    .-
      :`//.'
      .`.'
      .' BP 

@mmrozek mmrozek merged commit 2047259 into develop Nov 13, 2020
@mmrozek mmrozek deleted the etcm-301-fix-block-preparation branch November 13, 2020 14:47
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.

5 participants