Skip to content

Commit

Permalink
cr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
igorcrevar committed Jul 20, 2023
1 parent fb79f05 commit 691d50a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ func (b *Blockchain) verifyBlockBody(block *types.Block) ([]*types.Receipt, erro
// Make sure the transactions root matches up
if hash := buildroot.CalculateTransactionsRoot(block.Transactions, block.Number()); hash != block.Header.TxRoot {
b.logger.Error(fmt.Sprintf(
"transaction root hash mismatch: have %s, want %s",
"incorrect tx root (expected: %s, actual: %s)",
hash,
block.Header.TxRoot,
))
Expand Down
3 changes: 2 additions & 1 deletion consensus/polybft/blockchain_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ func (p *blockchainWrapper) ProcessBlock(parent *types.Header, block *types.Bloc
})

if builtBlock.Header.TxRoot != block.Header.TxRoot {
return nil, fmt.Errorf("incorrect tx root: (%s, %s)", builtBlock.Header.TxRoot, block.Header.TxRoot)
return nil, fmt.Errorf("incorrect tx root (expected: %s, actual: %s)",
builtBlock.Header.TxRoot, block.Header.TxRoot)
}

return &types.FullBlock{
Expand Down
6 changes: 3 additions & 3 deletions consensus/polybft/fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func (f *fsm) createBridgeCommitmentTx() (*types.Transaction, error) {
return nil, fmt.Errorf("failed to encode input data for bridge commitment registration: %w", err)
}

return createStateTransactionWithData(f.parent.Number+1, contracts.StateReceiverContract, inputData), nil
return createStateTransactionWithData(f.Height(), contracts.StateReceiverContract, inputData), nil
}

// getValidatorsTransition applies delta to the current validators,
Expand All @@ -255,7 +255,7 @@ func (f *fsm) createCommitEpochTx() (*types.Transaction, error) {
return nil, err
}

return createStateTransactionWithData(f.parent.Number+1, contracts.ValidatorSetContract, input), nil
return createStateTransactionWithData(f.Height(), contracts.ValidatorSetContract, input), nil
}

// createDistributeRewardsTx create a StateTransaction, which invokes RewardPool smart contract
Expand All @@ -266,7 +266,7 @@ func (f *fsm) createDistributeRewardsTx() (*types.Transaction, error) {
return nil, err
}

return createStateTransactionWithData(f.parent.Number+1, contracts.RewardPoolContract, input), nil
return createStateTransactionWithData(f.Height(), contracts.RewardPoolContract, input), nil
}

// ValidateCommit is used to validate that a given commit is valid
Expand Down

0 comments on commit 691d50a

Please sign in to comment.