diff options
author | Determinant <[email protected]> | 2020-09-19 16:14:52 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2020-09-19 16:14:52 -0400 |
commit | 4a447f41d8f03796e8581031a41976fb5ba299b4 (patch) | |
tree | bfb2f7afdcc6adc0c03cd76cdd5d98d238593efc /plugin/evm/block.go | |
parent | eda06da4c762be9944fdc1dbb3c7786fc4719960 (diff) |
fix a critical bug in block validationv0.3.1ecstasy-fixesdev
Diffstat (limited to 'plugin/evm/block.go')
-rw-r--r-- | plugin/evm/block.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/plugin/evm/block.go b/plugin/evm/block.go index ff1f6ae..1e1d710 100644 --- a/plugin/evm/block.go +++ b/plugin/evm/block.go @@ -89,6 +89,10 @@ func (b *Block) Verify() error { vm := b.vm tx := vm.getAtomicTx(b.ethBlock) if tx != nil { + pState, err := b.vm.chain.BlockState(b.Parent().(*Block).ethBlock) + if err != nil { + return err + } switch atx := tx.UnsignedTx.(type) { case *UnsignedImportTx: if b.ethBlock.Hash() == vm.genesisHash { @@ -128,7 +132,11 @@ func (b *Block) Verify() error { return errors.New("unknown atomic tx type") } - if tx.UnsignedTx.(UnsignedAtomicTx).SemanticVerify(vm, tx) != nil { + utx := tx.UnsignedTx.(UnsignedAtomicTx) + if utx.SemanticVerify(vm, tx) != nil { + return errInvalidBlock + } + if utx.EVMStateTransfer(vm, pState) != nil { return errInvalidBlock } } |