We’re rewarding the question askers & reputations are being recalculated! Read more.

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.

Filter by
Sorted by
Tagged with
10
votes
3answers
4k views

How does the EVM find the entry of a called function?

I read the source code of go-ethereum and confused about how does the EVM find the entry of a called function. As the specification said, the data field in a transaction specifies the function and the ...
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 ...
1
vote
1answer
256 views

How does EVM handle the token transfer?

This is some function in some contract. Using this type of function like transfer and transferFrom in the DAO contract, use can transfer their tokens to another account or contract. But how can ...
4
votes
2answers
383 views

What if a dishonest node execute a different program on EVM?

I want to create a program (on the Ethereum Virtual Machine), that can access some data under certains condition (only if authorized). So the program checks the authorization, and then (eventually) ...
7
votes
1answer
3k views

Rationale behind 256-bit words in EVM

What were the design factors driving having EVM native words as 256-bit? It feels excessive, especially if one needs to process as large data set as blockchain.
3
votes
1answer
236 views

Unable to resolve all static JUMP destinations while disassembling ethereum vm bytecode

For educational purpose I've created a simple python based evm bytecode disassembler (see github::ethereum-dasm) that attempts to resolve static jumps (JUMP,JUMPI instructions) in order to make the ...
1
vote
2answers
323 views

Create a contract at a defined address?

Is it possible to define a smart contract at a predictable address? 0xf0 CREATE in the Yellow Paper suggests that the address is deterministically determined by x = A(Ia, σ[Ia]n) page 29 of http://...
8
votes
2answers
1k views

What would be the actual gas cost of a mapping and are there any size limitations?

I want to get an estimation of how much it would cost to store arbitrarily many elements in a mapping of the form BYTES32 -> BYTES32. I see here that a STORAGEADD operation costs 20000 gas, which ...
21
votes
1answer
2k views

Are events permanently stored and reliably available to contracts in the future?

I've seen this forum post about using Ethereum as an event store: Events in Solidity, using blockchain as eventstore. However, it doesn't seem conclusive. For instance it says: I confirmed with ...
4
votes
1answer
195 views

Is the ethereum.org/dao contract vulnerable to recursive call attacks?

Does putting p.executed = true after p.recipient.call() make this vulnerable to recursive calls? function executeProposal(uint proposalNumber, bytes transactionBytecode) returns (int result) { ...
12
votes
1answer
2k views

How does the stack depth attack make a send() silently fail?

From a blogpost on security from Christian Reitwiessner: Because of the maximal stack depth of 1024 the new bidder can always increase the stack size to 1023 and then call bid() which will cause the ...
3
votes
0answers
151 views

Solidity benchmarking metrics [duplicate]

I am trying to figure out the best ways of benchmarking Solidity contracts. As with normal benchmarking, I presume one would basically want to measure computational effort and storage overhead: gas ...
7
votes
1answer
141 views

Can a contract know at what position in a callcode an argument begins?

using for example inline assembly with calldatacopy(t, f, s), which copies s bytes from calldata at position f to memory at position t in a call to for example function newContract(bytes data) { ... }...
2
votes
2answers
165 views

Whenever I sync my node, does it replay all steps ever taken by the ethereum virtual machine?

For what I understand unlike with bitcoin, the ethereum network has some kind of state, and all the virtual machine bytecode does is to execute some commands to create transitions between these states....
5
votes
1answer
618 views

Is it reasonable to use uint128 or less to save space?

As I understand EVM operates blocks of 256 bits. So uint256 is natural size for in memory calculations. But I can't find in the documentation how it's applied to transactions and for storage. I ...
8
votes
3answers
1k views

Create new contract via .call()

If _tois left empty, and bytecode is a new contract, should _to.call(bytecode) create a new contract ? Or is it so that when a _to address is included in the transaction then the EVM processes it as a ...
17
votes
1answer
3k views

Instrumenting EVM

I need to get all contract internal transactions. To do it, I'll need to instrument Ethereum EVM. My question is: what I should do to get the transaction details? Right now, I'm looking to the code ...
5
votes
1answer
3k views

How to check the VM trace using Geth?

How to check the VM trace using Geth? I've ran geth with --verbosity 6, and stuff like this gets logged: I0525 01:26:12.418607 core/vm/vm.go:157] running byte VM b82addc7 I0525 01:26:12.419818 core/...
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/...
6
votes
1answer
648 views

How are contracts executed on nodes?

How are contracts executed on full nodes? Do they run one by one on first-in first-served basis, or simultaneously in the isolated environments? If they run in parallel, I guess it may exhaust the ...
2
votes
3answers
1k views

Will Ethereum Smart Contracts also work on Tendermint?

I recently read about Tendermint releasing it's own public blockchain soon. After crossreading their blog, I see multiple mentions of the EVM. Does Tendermint implement the Ethereum Virtual Machine?...
7
votes
2answers
1k views

Is it possible to call another contract from a contract maintaining the msg.sender of the original caller?

Imagine that Alice calls a contract method C1 and that method calls another method in contract C2. Regularly msg.sender equals the Alice Account in the C1 method. And msg.sender equals the C1 ...
6
votes
2answers
2k views

How to know, inside the contract function, the amount of gas that will be refunded in the end

Consider the following situation: my function can be divided into 2 parts Always consumes constant gas; Always results in a refund of 0 < R < 1500000 gas. After the second part had happened, ...
4
votes
0answers
57 views

Why is there a CALL instruction in this contract? [duplicate]

This is a code snippet from a real contract. I wonder why the compiled code (can be obtained online from https://chriseth.github.io/browser-solidity) has several CALL instructions, although the ...
18
votes
2answers
4k views

Contract reading a string returned by another contract

I have 2 contracts, Parents and Child which has a public string variable - name. contract Child { string public name; function child (string _name){ name = _name; } } Parents ...
60
votes
2answers
19k views

Difference between CALL, CALLCODE and DELEGATECALL

CALL and CALLCODE take the same number of operands (in the execution stack). For the exception flag being pushed on top of the stack: 0 means exception, 1 means successful execution. CALL is easy to ...
14
votes
1answer
1k views

Is functional programming possible on the EVM?

Is there a technical limitation preventing functional programming on the EVM? For instance the cost of computation? I have heard that FP is "too costly". Is that correct? If it is, why? Because "...
8
votes
1answer
628 views

Is the cost of updating storage different than the cost of adding to storage?

Do these have a separate cost? sstore(1, 10) # first time adding a value to storage with this key sstore(1, 20) # changing the value in storage. I looked for a list of gas costs / opcodes, and the ...
2
votes
0answers
79 views

Is there a decompiler for the binary data in the blockchain [duplicate]

I want to know if there is a decompiler for the binary data in the blockchain, I want to know about the details of my contract after it was uploaded to the blockchain?
4
votes
1answer
102 views

Is it possible to establish a conditional gas limit in a transaction?

Imagine a contract that rewards the first user that publish a specific big piece of data into the blockchain. The transaction may cost an appreciable cost if the information size is big. The problem ...
12
votes
1answer
329 views

How growing contract storage increases the gas spending?

I have some further questions about this and this threads. For simplicity, let's imagine that I want to create a cryptocurrency on top of ethereum. The contract that "handles" this cryptocurrency ...
5
votes
2answers
467 views

What’s the role of the EVM in a plain ether transfer between Externally Owned Accounts?

In a plain ether transfer from one Externally Owned Account to another, for which the base fee of 21000 gas has been provided, how is the EVM involved if at all? I realize that the signature needs to ...
13
votes
2answers
801 views

Why does a simple function returning a 'string', call another contract?

This trivial contract: contract Test { function test() returns (string) { return "foobar"; } } Results in assembly code output (in the solidity web compiler) for the function 'test' ...
17
votes
2answers
1k views

What does bytecode of blank contract do?

When I compile a blank contract: contract A {} with solc --optimize --optimize-runs 300000 --opcodes test.sol I get: PUSH1 0x60 PUSH1 0x40 MSTORE PUSH1 0x6 DUP1 PUSH1 0x10 PUSH1 0x0 CODECOPY ...
4
votes
2answers
275 views

Is code execution time limited by the block time?

I'm fairly new to Ethereum, and I'm still trying to grasp the potential uses. I keep seeing articles using encrypted instant messaging as a potential application. But, there is a problem with this: ...
8
votes
1answer
565 views

Is it convenient to use mappings as temporary KeyValue instances?

Consider the following contract that illustrates the problem. Here we have a dynamic array of mappings, add() is meant to add a fresh new mapping to the end of the array, return the value for mapping ...
11
votes
1answer
1k views

Is there a formal specification for the EVM?

The yellowpaper specifies the EVM, albeit in a fashion that favors formalism over readability: But there's no indication if this is up to date with the current state of the Ethereum ecosystem or not, ...
7
votes
2answers
3k views

Clarification of “256 bit word” semantics

EVM has "256bit words". Some cases treat strings shorter than 32 bytes (256 bits) as left-justified ascii (packed into the most significant bytes of the word). Does this mean that the word value of ...
24
votes
4answers
4k views

Why does a Solidity throw consume all gas?

When you throw an exception, all gas is consumed. What is the rationale for this design decision?
6
votes
2answers
235 views

Separated Ethereum VM

I'm trying to figure out if anyone has separated out the Ethereum VM for experimentation. It would be interesting to play with the interface to the EVM for smart contract testing without all of the ...
8
votes
1answer
879 views

Can a contract access the code of another contract?

Using web3.js, the EVM (bytecode) of a contract can be obtained by web3.eth.getCode(addressOfContract). Can this be performed by a contract using the address of another contract? If so, how? ...
8
votes
1answer
652 views

Are linkable ring signatures available in Ethereum?

Are transactions with ring signatures available in Ethereum? There should be as anonymity/fungibility is important. Also, I think Vitalk Buterin mentioned it may be possible to implement an EVM ...
3
votes
1answer
485 views

Will the processing power of the EVM ever be increased?

From what I understand almost all hash power on the network is used to secure the blockchain, but the processing power of the EVM remains constant even as the hash power of the network increases, and ...
18
votes
1answer
651 views

Out of Gas invoking precompiled contracts on private blockchains

Why do precompiled contracts lead to Out of Gas on private blockchains? Some tidbits are provided in the Solidity docs but can it be explained more? It might be that you run into Out-of-Gas for ...
6
votes
2answers
802 views

Why does an empty message still invoke the code of the contract?

An empty message still invokes the code of the contract and is the mechanism that allows Solidity to implement a feature of a fallback function per contract. But when msg.data is empty, why does ...
4
votes
1answer
766 views

How does a Solidity fallback function work with the raw CALL opcode of the EVM?

Since a fallback function is a Solidity feature, how does it work if the EVM opcode CALL is used? If msg.data is empty, how can Solidity run the fallback function? Shouldn't the EVM just transfer ...
3
votes
2answers
1k views

What is chaincode (Open Blockchain) and is it compatible with the EVM?

What is chaincode and is it compatible with the EVM? Chaincode FAQ says it supports smart contracts and can these contracts be deployed and function on the Ethereum blockchain?
14
votes
2answers
2k views

Can a contract access another contract's storage?

I have a contract with numerous complex structs. Is it possible for a second contract to iterate over this data directly? I can't really use public accessor/getter methods as it's not possible to use ...
31
votes
3answers
8k views

Difference between Memory and Storage?

What is the difference between Memory and Storage ? From both the EVM point of view and the contract design one. Thanks!
4
votes
1answer
2k views

Where exactly do DApps run? Who gets rewarded for running them? [duplicate]

So I am currently running a full node, as well as a GPU miner. I am curious first of all where do DApps get run? They wouldn't make sense to run on a GPU as they aren't very parallizable, so I am ...