From 30fae395d465eb79ee8bc122d67a58cea3ccfcf2 Mon Sep 17 00:00:00 2001 From: Determinant Date: Sun, 20 Sep 2020 16:52:45 -0400 Subject: execute full state transfer during block validation --- coreth.go | 4 ++++ plugin/evm/block.go | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/coreth.go b/coreth.go index 1d6b92e..d1fd29f 100644 --- a/coreth.go +++ b/coreth.go @@ -90,6 +90,10 @@ func (self *ETHChain) SubscribeNewMinedBlockEvent() *event.TypeMuxSubscription { return self.backend.Miner().GetWorkerMux().Subscribe(core.NewMinedBlockEvent{}) } +func (self *ETHChain) BlockChain() *core.BlockChain { + return self.backend.BlockChain() +} + func (self *ETHChain) VerifyBlock(block *types.Block) bool { txnHash := types.DeriveSha(block.Transactions(), new(trie.Trie)) uncleHash := types.CalcUncleHash(block.Uncles()) diff --git a/plugin/evm/block.go b/plugin/evm/block.go index 1e1d710..556f171 100644 --- a/plugin/evm/block.go +++ b/plugin/evm/block.go @@ -136,7 +136,9 @@ func (b *Block) Verify() error { if utx.SemanticVerify(vm, tx) != nil { return errInvalidBlock } - if utx.EVMStateTransfer(vm, pState) != nil { + bc := vm.chain.BlockChain() + _, _, _, err = bc.Processor().Process(b.ethBlock, pState, *bc.GetVMConfig()) + if err != nil { return errInvalidBlock } } -- cgit v1.2.3-70-g09d2