diff options
author | Paweł Bylica <chfast@gmail.com> | 2018-12-06 21:34:49 +0800 |
---|---|---|
committer | Guillaume Ballet <gballet@gmail.com> | 2018-12-06 21:34:49 +0800 |
commit | de39513ced05f120b30b0daa49003982cc6b2426 (patch) | |
tree | 536d248284c62a0fb913cec44e68daa67a4be51c /les | |
parent | 3ac633ba8423851a85cb909a1f1f0f3c0d2c5351 (diff) | |
download | go-tangerine-de39513ced05f120b30b0daa49003982cc6b2426.tar go-tangerine-de39513ced05f120b30b0daa49003982cc6b2426.tar.gz go-tangerine-de39513ced05f120b30b0daa49003982cc6b2426.tar.bz2 go-tangerine-de39513ced05f120b30b0daa49003982cc6b2426.tar.lz go-tangerine-de39513ced05f120b30b0daa49003982cc6b2426.tar.xz go-tangerine-de39513ced05f120b30b0daa49003982cc6b2426.tar.zst go-tangerine-de39513ced05f120b30b0daa49003982cc6b2426.zip |
core, internal, eth, miner, les: Take VM config from BlockChain (#17955)
Until this commit, when sending an RPC request that called `NewEVM`, a blank `vm.Config`
would be taken so as to set some options, based on the default configuration. If some extra
configuration switches were passed to the blockchain, those would be ignored.
This PR adds a function to get the config from the blockchain, and this is what is now used
for RPC calls.
Some subsequent changes need to be made, see https://github.com/ethereum/go-ethereum/pull/17955#pullrequestreview-182237244
for the details of the discussion.
Diffstat (limited to 'les')
-rw-r--r-- | les/api_backend.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/les/api_backend.go b/les/api_backend.go index aa748a4ea..753139623 100644 --- a/les/api_backend.go +++ b/les/api_backend.go @@ -105,10 +105,10 @@ func (b *LesApiBackend) GetTd(hash common.Hash) *big.Int { return b.eth.blockchain.GetTdByHash(hash) } -func (b *LesApiBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header, vmCfg vm.Config) (*vm.EVM, func() error, error) { +func (b *LesApiBackend) GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header) (*vm.EVM, func() error, error) { state.SetBalance(msg.From(), math.MaxBig256) context := core.NewEVMContext(msg, header, b.eth.blockchain, nil) - return vm.NewEVM(context, state, b.eth.chainConfig, vmCfg), state.Error, nil + return vm.NewEVM(context, state, b.eth.chainConfig, vm.Config{}), state.Error, nil } func (b *LesApiBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error { |