github.com/MetalBlockchain/subnet-evm@v0.4.9/core/types.go (about) 1 // (c) 2019-2020, Ava Labs, Inc. 2 // 3 // This file is a derived work, based on the go-ethereum library whose original 4 // notices appear below. 5 // 6 // It is distributed under a license compatible with the licensing terms of the 7 // original code from which it is derived. 8 // 9 // Much love to the original authors for their work. 10 // ********** 11 // Copyright 2015 The go-ethereum Authors 12 // This file is part of the go-ethereum library. 13 // 14 // The go-ethereum library is free software: you can redistribute it and/or modify 15 // it under the terms of the GNU Lesser General Public License as published by 16 // the Free Software Foundation, either version 3 of the License, or 17 // (at your option) any later version. 18 // 19 // The go-ethereum library is distributed in the hope that it will be useful, 20 // but WITHOUT ANY WARRANTY; without even the implied warranty of 21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 // GNU Lesser General Public License for more details. 23 // 24 // You should have received a copy of the GNU Lesser General Public License 25 // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. 26 27 package core 28 29 import ( 30 "github.com/MetalBlockchain/subnet-evm/core/state" 31 "github.com/MetalBlockchain/subnet-evm/core/types" 32 "github.com/MetalBlockchain/subnet-evm/core/vm" 33 ) 34 35 // Validator is an interface which defines the standard for block validation. It 36 // is only responsible for validating block contents, as the header validation is 37 // done by the specific consensus engines. 38 type Validator interface { 39 // ValidateBody validates the given block's content. 40 ValidateBody(block *types.Block) error 41 42 // ValidateState validates the given statedb and optionally the receipts and 43 // gas used. 44 ValidateState(block *types.Block, state *state.StateDB, receipts types.Receipts, usedGas uint64) error 45 } 46 47 // Prefetcher is an interface for pre-caching transaction signatures and state. 48 type Prefetcher interface { 49 // Prefetch processes the state changes according to the Ethereum rules by running 50 // the transaction messages using the statedb, but any changes are discarded. The 51 // only goal is to pre-cache transaction signatures and state trie nodes. 52 Prefetch(block *types.Block, statedb *state.StateDB, cfg vm.Config, interrupt *uint32) 53 } 54 55 // Processor is an interface for processing blocks using a given initial state. 56 type Processor interface { 57 // Process processes the state changes according to the Ethereum rules by running 58 // the transaction messages using the statedb and applying any rewards to both 59 // the processor (coinbase) and any included uncles. 60 Process(block *types.Block, parent *types.Header, statedb *state.StateDB, cfg vm.Config) (types.Receipts, []*types.Log, uint64, error) 61 }