Questions tagged [evm]

EVM is the Ethereum Virtual Machine, the protected, distributed "sandbox area" (virtual machine) where contract execution occurs, replicated on every node in the network. EVM is also the name of the bytecode that runs on the virtual machine -- what Solidity, Serpent and LL get compiled down to before deployment.

84 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
1answer
73 views

Ethereum client implementation

I think to better my understanding of the EVM and underlying file system, I want to read through one or more ethereum client implementations and potentially build a client myself. So far I've been ...
4
votes
0answers
156 views

Is it possible to trace a function call hitting revert?

It is possible to trace a transaction with debug_traceTransaction. But it needs the transaction hash, requiring it to be a transaction in first place. I'm debugging a function call that generates a ...
4
votes
0answers
212 views

Exploit mitigation in EVM JIT

Ethereum is moving to JIT-compiled EVM code: https://blog.ethereum.org/2016/06/02/go-ethereums-jit-evm/ As JIT compiled machine code has turned out to be a common attack vector in the base of web ...
3
votes
1answer
87 views

How to get an evm reference inside go-ethereum GetBalance function?

In order to modify GetBalance function to fork go-ethereum, I find difficulties to get a reference of the running evm. The function has a reference for self *StateDB: func (self *StateDB) GetBalance(...
3
votes
1answer
17 views

Create a slightly customized version of ethereum and run it as a node on a public ethereum blockchain

I might need a small modification to ethereum virtual machine but I still want to run it as a node on the public blockchain not private, if that makes sense. I assume its doable? Since I will not be ...
3
votes
1answer
237 views

How to use evm compile?

I have been testing with evm and I am not getting any output. Code - pragma solidity ^0.4.18; contract d8 { function myBalance() pure public returns (uint) { return 880; } } My ...
3
votes
0answers
117 views

Assuming EIP140, is remaining gas refunded when a called contract throws?

Under EIP140 (REVERT) and assuming Solidity ≥0.4.10. If I call from my contract to a function on an external contract, and this external function does an invalid jump, does my contract still call ...
3
votes
2answers
64 views

In Casper, what is the incentive to store the entire chain?

Do the validators need information from the blockchain to produce blocks, or is it enough just to store a few recent blocks? What is the incentive to use large amounts of storage to store the complete ...
3
votes
0answers
184 views

Blockchain compression Suggestions

I am planning to do a course project on block chain compression so that network transfer time is optimized. I read somewhere that the EVM bytecode component of the blockchain can be compressed. Is ...
3
votes
1answer
75 views

What is the maximum computation a query or constant function in solidity can perform?

Since query or constant functions are just executed on single node there is no dependency on gas or gas limit. I am performing Quicksort in query/constant method. EVM can sort an array of length up to ...
2
votes
1answer
30 views

Modifying simple function with inline assembly

I'm trying to write a super simple contract that's gas efficient utilizing inline assembly in solidity. All this function needs to do is create a child smart contract with one function, self destruct....
2
votes
0answers
22 views

How to get a call graph for the binary code of a contract?

I need a call graph generator for the assembler level of smart contract code in order to analyse solidity compiler bugs. In that way, porosity is excatly what I need ! However there are too much bugs ...
2
votes
1answer
81 views

Using 'call' from a constant function

I am trying to determine the behavior of call when executed from a constant function. Of course, the compiler issues a warning on that: Warning: Function declared as view, but this expression (...
2
votes
0answers
36 views

What is the methodID for SafeMath function when SafeMath library is referenced internally?

For the contract below contract Example { using SafeMath for uint256; uint256 internal _amount; function example(uint256 amount) external { _amount = _amount.add(amount);...
2
votes
0answers
174 views

eWASM vs PWASM: Are they complete independent? If so, in what ways are they different?

Understanding that eWASM is more like EVM 2.0 by replacing EVM with a subset of WASM instructions set.. What is the motivation of the PWASM project from Parity? Notes: https://medium.com/paritytech/...
2
votes
2answers
341 views

How do I use filter EVM log events by an indexed field in web3j?

I've looked through the documentation, but there doesn't seem to be this scenario listed. What I want to do is filter the Ethereum event log of a specific contract by an indexed field with Web3j. ...
2
votes
0answers
321 views

Unexpected behavior with `block.timestamp` in truffle test

I am doing some experiments with block.timestamp(which is now's alias). I wrote some code to see if block.timestamp really represents the timestamp of the last mined block. From the documentation: ...
2
votes
1answer
359 views

Why can't the return value of a transaction be included in the transaction receipt?

Shouldn't this be possible as the return value will be known when the receipt is created?
2
votes
1answer
251 views

Formal definition of the EVM as a Turing Machine

I am trying to understand the EVM in the context of a classic Turing Machine. I have read through the yellow paper and taken what I can from the internet, but I still feel like I could use some help ...
2
votes
0answers
86 views

What's the value of `this` inside a library function when called via a delegatecall?

Imagine a contract C that makes a delegatecall to a library L. C -> L What's the value of this inside L: address(C) or address(L) ? If now that L makes a normal call to another contract D. C ->...
2
votes
2answers
210 views

Does the EVM process transactions or is it used solely to execute contract code?

Does the EVM process transactions or is it used solely to execute contract code? I wonder whether the EVM is used to process transactions? I know it is used to execute (or interpret) the bytecode of ...
2
votes
0answers
207 views

analysis of the opcodes used in smart contract execution on ropsten, geth

I've deployed the following verified smart-contract to ropsten: contract Incrementer { uint iteration; function Incrementer() { iteration = 0; } function increment(uint ...
2
votes
0answers
38 views

Easiest way to get maximum transaction stack depth level

When a contract causes an addresses code on the EVM, a stack depth counter is kept. I need this stack information as I am producing a EVM execution visualiser. This stack depth changes when a ...
2
votes
0answers
127 views

Possible to create new contract via a proposal in the ethereum.org/dao framework?

Is it possible to deploy contracts from within contracts, using something like p.recipient.call.value(p.amount * 1 ether)(bytecode); This article says so, https://blog.ethereum.org/2015/12/04/...
1
vote
1answer
7 views

How do I send funds from a contract to an account using bytecode?

The instruction CREATE will send funds to a new account. Is there another instruction for sending funds to an account that already exists? Or I just have to use CREATE as if the account doesn't exist?
1
vote
0answers
27 views

Who confirms Ropsten and Rinkeby transactions?

Basic or more like "fundamental" question I guess: So if I got that right, each time someone runs Geth/Parity or other software they all become part of the EVM (ethereum virtual machine). However ...
1
vote
0answers
29 views

Solidity calldata for an array of structs

I'm trying to create the calldata offchain for an on-chain low-level call to a method that accepts an array of structs as an argument. I'm not sure how to encode the calldata for this. Here's a ...
1
vote
1answer
50 views

Can I deploy smart contract written in an older version of solidity ? If yes how to recognize it in EVM?

If I can compile a smart-contract written in an older version say 0.1.3, can I still deploy it? If I can, is there a way to look at EVM bytecode and tell that this smart contract is written with an ...
1
vote
0answers
53 views

How to use the 'evm' command of go-ethereum?

I'm just engaging in geth development and was trying to put some changes into evm opcode implementation(functions like opAdd) for debugging. After compilation done, I found that there is a command '...
1
vote
0answers
50 views

Can solidity bytecode has unreachable code

I've compiled contract from https://theethereum.wiki/w/index.php/ERC20_Token_Standard (Sample Fixed Supply Token Contract: contract FixedSupplyToken version:0.5.1+commit.c8a2cb62) I try to make ...
1
vote
1answer
141 views

Debugging a VM error in solidity

I'm getting the following error while running a test in truffle: Error: Returned error: VM Exception while processing transaction: revert Now, the code is simply to big and complicated to run ...
1
vote
0answers
35 views

Passing constructor arguments in the NewContractCreation in go-ethereum

I am trying to create a transaction to deploy a contract using the types.NewContractCreation() method in the core folder of go-ethereum. However I don’t understand how to pass the parameters of the ...
1
vote
0answers
27 views

How to let parity EVM execute just some blocks from a state?

I want to do an experiment using mainchain data. The experiment aims to test EVM performance. So, I want to let EVM execute some blocks and measure the performance. Are there some tools that can be ...
1
vote
0answers
71 views

Ethereum state database persistence

Is there a way to reinstantiate a stateDB after saving the output of state.Dump()? My problem is the following : I create a new StateDB object using : db := ethdb.NewMemDatabase() state, _ := state....
1
vote
0answers
77 views

How can I run smart contract locally on my computer?

We all know that Ethereum nodes can run smart contract. But I'm wondering whether can I setup contract run-time environment from Ethereum source code locally so I can run smart contract without ...
1
vote
1answer
119 views

How to understand output of debug.trace

I have created a Private Ethereum network and I have deployed a contract in it.. Now I am trying to post a transaction in that contract but I m getting error that transaction has been reverted by EVM ...
1
vote
1answer
156 views

Concatenating byte strings in assembly for call input data

I have the following piece of code in my contract. It's supposed to take in a byte string composed of a uint flag that is followed by a variable list of uint numbers and contruct a call using those ...
1
vote
0answers
39 views

Gas cost of adding an item to a class-level (storage) array

I would like to make sure that the gas cost of adding an item to a (storage) array is constant, i.e., not dependent on the length of the array. To my understanding, the relevant EVM operation is ...
1
vote
0answers
33 views

Code scope in evm

Short question, how is code scope defined/determined by the compiler when looking at EVM opcodes (or rather bitcode)? Is it simply by looking out for jump calls or return statements? Or does it define ...
1
vote
1answer
88 views

It is possible to get bytecode from the evm in golang?

Imagine this scenario, I have a contract that has a function where I call with runtime.Call(). But this function returns an address of a newly created contract, but not the bytecode as runtime.Create ...
1
vote
0answers
65 views

Chain txvm vs EVM: Specified Differences

Chain txvm vs EVM: What are the specified differences between both platforms?
1
vote
1answer
42 views

Numerical Value of Bools in Solidity

What is the numerical value of true and false? Presumably one is 0x0000000000000000 and one is 0x0000000000000001
1
vote
0answers
165 views

Why string is expensive?

Sometimes we need to use string instead of byte32 only because of one byte (or one character) and this increases the gas and the cost of transaction. For example, I want to store the assets state of ...
1
vote
1answer
113 views

What happens in CALL when gas is set to 0?

Reading the documentation on the CALL opcode : "call contract at address a with input mem[in..(in+insize)) providing g gas and v wei and output area mem[out..(out+outsize)) returning 0 on error (eg. ...
1
vote
0answers
148 views

Gas cost of a Message Call

I was trying to calculate the cost of a message call (CALL, DELEGATECALL, CALLCODE) following the yellow paper but I've not been able to fully understand it. It seems that Ccallgas is an isolated ...
1
vote
0answers
143 views

Why Remix JavaScript VM and Web3 Provider show different behavior at the time CALL is made?

I'm using Geth evm version 1.8.4-stable to run private network and I see different behavior on CALL between the Remix environment of Javascript VM and Web3 Provider. On this example, using callHi() ...
1
vote
1answer
124 views

How does the EVM connect to all the blockchain nodes?

Someone recently told me that Ethereum does not use IP addresses to work out the node connections. I know networkid is used in the connection but how does networkid translate into the EVM finding the ...
1
vote
0answers
155 views

How can i increase the block number in testrpc?

I have the contract which has the dependencies on the block.number so in my javascript test cases I want block number jump. I know about the eth_mine but it will mine only the current block or work ...
1
vote
0answers
127 views

How can I decode the output off geth --trace?

I've already gotten pretty acquainted with using the geth RPC commands to do block traces. However, I am looking for a way to do this more directly. Hopefully without directly from geth, so I don't ...
1
vote
0answers
54 views

How can I set a previous state/storage trie when running ethereumjs-vs runCode?

I am trying to call runCode on an ethereumjs VM with the contract code, the necessary data (method specifier + params; encoded) and the contract storage trie I got from a previous call on runCode ...