Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
1answer
87 views

what does “Depth” column mean(VM Trace Transaction)?

What does "Depth" column mean in VM Trace Transaction ? How it is for opcodes? for example here: https://rinkeby.etherscan.io/vmtrace?txhash=...
0
votes
3answers
478 views

How Exactly is Smart Contract Validation Performed?

I have yet to find a coherent explanation of how a smart contract - that potentially can have complex interactions with other smart contracts - is actually validated. Please no hand waving here. What ...
1
vote
1answer
47 views

Where are blockchain environmental globals stored?

Where are contract globals like msg.sender and block.number stored? It is in memory or storage?
2
votes
2answers
219 views

Storage trie - are trie nodes reused for two contract instances with the same storage content?

Reading geth code and various posts here, I think I have now a good understanding of how the data is stored in Ethereum (please correct me if I am wrong at some point). At the lowest level we have a ...
9
votes
4answers
424 views

What is the shortest bytecode that will publish a contract with non-zero bytecode?

Yes, it's golf. So sue me. Rules The response to getCode() should have some characters that aren’t either 0 or x. To test it out, you can use the following with a local testrpc: web3.eth....
2
votes
1answer
311 views

Do different ethereum client have their own EVM? How to guarantee their consistency?

Ethereum wiki introduced many different ethereum clients. https://github.com/ethereum/wiki/wiki/Ethereum-Virtual-Machine-(EVM)-Awesome-List go-ethereum A popular Ethereum client with its own EVM ...
1
vote
0answers
145 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 ...
3
votes
1answer
72 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 ...
1
vote
1answer
73 views

Under what circumstance does CALL return nonzero?

Reading the yellow paper http://yellowpaper.io/ documentation for CALL. µ'_s[0] ≡ x where x = 0 if the code execution for this operation failed due to an exceptional halting, Z(σ, µ, I) = > or if ...
4
votes
1answer
461 views

How exactly is computation performed on EVM by every node

Or in other words how smart contracts are mined? I need help with filing some blanks to really understand that issue. Let me start with what I know. The bitcoin approach (level easy) In the ...
1
vote
0answers
121 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
1answer
418 views

Are there any functional programming languages for Ethereum smart contracts?

Are there any functional programming languages for Ethereum smart contracts in development or production?
1
vote
1answer
284 views

Is it possible to retrieve an event log from a reverted transaction?

I know there is an upcoming change to solidity which will allow the returning of require() calls with a string error message. But I'm wondering if it's possible to do something like this now. Since ...
1
vote
1answer
629 views

Gas costs of storing in mapping, initial vs subsequent

I have the following simple storage code: pragma solidity ^0.4.17; //The Oracle contract provides the reference prices for the contracts. Currently the Oracle is updated by an off chain calculation ...
0
votes
1answer
113 views

Is it safe for smart contracts to handle secrets?

Is the runtime environment of a smart contract going to be seen by the hosting node? If not, how? Can the smart contract safely pass an API key to memory? Should Solidity developers just deem smart ...
1
vote
1answer
503 views

Using EVM or Swarm for datastore

I want to maintain a datastore of key value pairs. For example, I have users of my dapp input their favorite food. I would like to map their account to the food name. It is my understanding that I can ...
0
votes
1answer
67 views

Can a miner compromise an EVM that runs a smart contract?

For example, there is a private storage variable which cannot be seen by any user during the execution of the smart contract. When a miner runs the smart contract in a local EVM, can it infer the ...
2
votes
1answer
647 views

Address casting into contract implicit conversion

What happens when an address(or an uint) is cast into a contract? The documentation says that implicit conversions are done when no information is lost so you can convert from an uint128 to an uint ...
3
votes
1answer
417 views

what is more gas efficient? Looping through an array or storing the index?

I have an array that stores withdrawal information of users (funds are held in a wallet not the smart contract and users can request withdrawals). In the end the withdrawals are paid out with a for ...
4
votes
1answer
448 views

Why is the Ethereum Virtual Machine designed as a stack based language?

I heard that Ethereum is about to change into a flavor of Web Assembly (a register-based language, eWASM). Web Assembly is register-based, which means they are faster. So why is Ethereum using a ...
1
vote
2answers
308 views

Is the EVM memory model a word array or byte array?

The yellow paper says that the memory model for the EVM is a word-addressed byte array (YP 9.1), but when I run debug.traceTransaction in Geth, the memory looks more like an array of words, maybe a ...
0
votes
1answer
444 views

How does solc generate the bytecode for a contract?

I got sick of using remix and copying-pasting my web3 deploy text so I'm trying to write a python script that will generate this deploy test for me. However, one of the fields in the instantiation ...
0
votes
1answer
43 views

Are state changes reversed if the contract “crashes” during execution?

Are state changes reversed if the contract "crashes" during execution? I know that state changes are reversed, if the contract runs out of gas during execution. However, are state changes also ...
0
votes
1answer
207 views

How is the EVM initialized for a message call transaction?

I'm reading the yellow paper, but there are several aspects of how the EVM execution model is initialized for each message call transaction that aren't really clear. Where does the message call data ...
1
vote
1answer
146 views

How EIP 150 gas cost algorithm works on each stack level?

Based on EIP 150 change the call depth attach. EIP and EIP-discussion: Note that with the given parameters, the de-facto maximum call stack depth is limited to ~340 (down from ~1024), mitigating ...
4
votes
1answer
260 views

What are the reasons behind jumpdest?

I know, the practical reasons behind it is just to add additional security layer. But why does EVM even need it? Asm doesn't have it and works great.
0
votes
1answer
233 views

Any vulnerabilities found in the EVM or Ethereum Protocol?

I've read of several vulnerabilties w.r.t. blockchain technology, e.g., Bitcoin, that allowed hackers to steal currency tokens. From my understanding all these "hacks" have resulted from either ...
1
vote
0answers
50 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 ...
0
votes
2answers
572 views
0
votes
1answer
84 views

How Ethereum prevents miners to sent same transaction multiple time on different blocks?

For example, userA submitted transactionX (ex: which send 10 ether to minerM), and this is deployed via minerM on the block #100. If mineM is an attacker, and it is consecutively elected as a leader ...
0
votes
1answer
90 views

Unable to reproduce Keccak256 “hello world” hash within EVM

My toy program contains the following lines: (seq (def 'hash 0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad) (def 'result ...
2
votes
1answer
202 views

evm sload question

I'm trying to get my head around how computation in the EVM works in this example. PC: 3 STACK: [54] MEM: [], STORAGE: {} SLOAD pops one from the stack, and pushes the value in contract storage at ...
0
votes
1answer
506 views

Delegatecall to an internal function

Let's say I have a Dispatcher contract that delegates all function calls to an Implementation contract using delegatecall (see for example https://gist.github.com/Arachnid/...
2
votes
1answer
194 views

Does each transaction executed as atomic instruction inside the EVM?

There can be multiple transactions may executed inside a block. The states that are changed by those transactions may or may not be dependent to each other. [Q] How should a winner miner execute ...
0
votes
1answer
118 views

Hacking Ethereum implementation for private network

Note: I do mean hacking, and not cracking. I don’t want to get into people’s Ether, so don’t get over exited with the title. I am aware of the basic functioning of the Ethereum blockchain and its ...
1
vote
1answer
335 views

Are contracts able to send messages to EOA's?

I know that EOA's can send transactions between each other, but also to contracts. However, contracts can only send so-called messages, i.e. data without signature (authentication). I'm confused, ...
0
votes
1answer
62 views

LLL preprocessing/optimization issue

I have written a simple nested macro in LLL, but I can't get it to reduce to the simplest expression when calling the compiler with the optimization option. My macro looks like this: (def 'mcopy (pos ...
2
votes
1answer
228 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 ...
1
vote
1answer
103 views

Is it possible to use EVM with input data not stored on the blockchain?

I am interested in computing medical data in a decentralized way where none of the computing resources nor the requester can fully access the data for the sake of privacy concerns. In this schema, ...
5
votes
1answer
858 views

Is refunded gas for “freed” storage given to the contract, the “allocator”, or the “deleter”?

Is refunded gas for "freed" storage given to the contract, the "allocator", or the "deleter"? Suppose a contract allocates some storage. This storage is paid for by the sender of the transaction that ...
1
vote
1answer
43 views

Standalone assembly contract: control flow error

I'm trying to understand why the following toy contract does not work. I can deploy it successfully, and transactions with fewer than 36 bytes of data are successful, but those containing 36 bytes or ...
0
votes
1answer
69 views

Is it possible to inspect EVM memory or stack?

I'm curious if anyone operating a node can inspect the EVM memory or stack as contract code is being executed. For example, a gambling app contract code "draws" a random card by querying a ...
1
vote
1answer
169 views

Unable to replicate short-address attack

I was reading about the short address attack and decided to replicate and test the possible solutions. What I know about short address attack is if you skip n characters of your address, you end up ...
1
vote
1answer
188 views

Does the EVM always allocate new memory or can it reuse already allocated, but unused, memory?

Does the EVM always allocate new memory or can it reuse already allocated, but unused, memory? Reading the docs for delete (http://solidity.readthedocs.io/en/develop/types.html), it is mentioned ...
0
votes
1answer
657 views

how does a lightweight node interact with smart contracts?

In my current understanding, (1) smart contracts are code stored in the blockchain network, and access the data in the blockchain network. (When we deploy contracts, we'll get the storage address) (2)...
4
votes
2answers
330 views

Run EVM Code outside the Blockchain

is there any way to execute functions on a smart contract (as EVM-Bytecode) in a separate program like evm (provided by go-ethereum) without having to run a test-network? I need to find a way to run ...
6
votes
1answer
629 views

What do the response values of a Parity `trace_transaction` call actually represent?

Parity implements a really useful trace module for deep diving into blocks and transactions. One particular method trace_transaction allows you to investigate the EVM execution paths of a transaction....
7
votes
1answer
265 views

Tracing back tripped require() to a source code line

What would be the process to map failed transactions (require, throw, etc.) back to the source code line where they occurred? Any examples of such yet?
1
vote
1answer
453 views

Deploying contract byte code via assembly

I'm trying to write a smart contract which will deploy byte code using assembly op_code create. I'm following this post. But when I call deployCode function I got nothing. Ropsten etherscan tells me ...
0
votes
1answer
63 views

Output of log.memory.slice in Geth debug_traceTransaction

Has anyone else used the JavaScript-based tracer that Geth provides, as part of its debug_traceTransaction method? I want to look at segments of memory during a transaction's execution (specifically, ...