Validate CX receipt root from CrossTxEpoch

Previously, validation started at CrossTxEpoch+1 and CX receipts roots
were unverified in CrossTxEpoch, creating a security hole.
pull/1964/head
Eugene Kim 5 years ago
parent ef389aa9b5
commit 43c9bb46fc
  1. 2
      core/block_validator.go

@ -100,7 +100,7 @@ func (v *BlockValidator) ValidateState(block, parent *types.Block, statedb *stat
return fmt.Errorf("invalid receipt root hash (remote: %x local: %x)", header.ReceiptHash(), receiptSha)
}
if v.config.AcceptsCrossTx(block.Epoch()) {
if v.config.HasCrossTxFields(block.Epoch()) {
cxsSha := types.DeriveMultipleShardsSha(cxReceipts)
if cxsSha != header.OutgoingReceiptHash() {
return fmt.Errorf("invalid cross shard receipt root hash (remote: %x local: %x)", header.OutgoingReceiptHash(), cxsSha)

Loading…
Cancel
Save