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
2
votes
1answer
109 views

Reading State History - how?

I know state is mutable but changes are held in the chaindata as leveldb data. How can we actually read the chaindata history? Are there some utilities for this? if I have this code - pragma ...
0
votes
0answers
62 views

Why does this contract work on Ropsten but not on a private blockchain?

The following contract runs successfully in Ropsten but not on a private blockchain. I assumed it could be a gas issue. So I increased the gaslimit and started a new blockchain but I get the same ...
1
vote
1answer
74 views

Can Ethereum handle storage of strings in volume? [duplicate]

I have someone who wants to put strings onto a private blockchain. He thinks it will be safe for his data. So the idea is to store names and addresses etc on the blockchain (private). I did some ...
0
votes
0answers
61 views

Why would the gas cost be so high on a simple contract?

The contract does not run, it cannot get enough gas. Here is the txn - > > eth.getTransactionReceipt("0x069fdab662d9bb69f0af6a526c60289cb3d2cfa4cba1345fdd53e517cef136aa") > { blockHash: &...
0
votes
1answer
55 views

Why is eth.coinbase node based and not blockchain based?

I have tested with geth using --datadir and found that if I have more than one node created using personal.newAccount then the account data is not shared. This seems confusing to me. I believed ...
1
vote
1answer
402 views

How does a bootnode work?

I saw this - "The first time a node connects to the network it uses one of the predefined bootnodes. Through these bootnodes a node can join the network and find other nodes." At https://...
4
votes
0answers
153 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 ...
0
votes
3answers
64 views

How secure is messaging to smart contracts?

If I sent a message via http to a smart contract, how secure is that? If I cannot use TLS, then could someone listen at he port and then intercept the message and then divert the message to an unknown ...
1
vote
1answer
119 views

Ethereum Bytecode

Why does Ethereum store bytecode on the blockchain and not the sourcecode, what's the tradeoff? As far as I know sourcecode does not need as much storage.
2
votes
1answer
80 views

Where is the source code for Ethereum stored?

I am interested to see exactly what is coded for Ethereum. I know web3 is on github. Where is all the fundamental source code stored for the EVM and all the main components?
2
votes
1answer
329 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?
1
vote
3answers
169 views

How to detect if a contract has a particular function implemented?

I would like to detect if an address has a particular function implemented. In this case isSafe: interface ISafe { function isSafe() public pure returns (bool _true); // other functions I ...
2
votes
1answer
551 views

Where is contract persistent storage stored?

I am trying to work out where the data is actually stored. If a contract is deployed with a dynamic array defined, then at the time of deployment no allocation is made for the storage. I understand ...
0
votes
2answers
788 views

How to access an API from a solidity smart contract?

I saw how this can be done using Oraclize. Is there any native way to access an API from a solidity smart contract? I understand there is a restriction on the solidity program to be able to call an ...
7
votes
2answers
449 views

Ed25519 in smart contracts

Is there a practical way (preferrably OSS library or implementation) to verify Ed25519 signatures in Solidity (compiled for and run on the EVM), in smart contracts? Update: I've created EIP665
2
votes
1answer
43 views

Call to 0x00…02 in remix debug trace

I'm currently trying to reenact a random transaction and I've come across a weird call to 0x0000000000000000000000000000000000000002. Even weirder, this call seems to actually do something since the ...
3
votes
1answer
235 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 ...
0
votes
1answer
247 views

Threat Model Question - Code Injection / ROP possible in Ethereum Smart Contracts?

I am trying to understand a basic threat model for Ethereum Smart Contracts, to perform some research on how existing attacks techniques may be applied here as well. Is there a risk of a contract with ...
0
votes
1answer
107 views

SHA3_512 library, convert the input and output to 512-bit bytes

The SHA3_512 library takes an input uint64[8] and outputs uint32[16]. To convert the input from 64 bytes and the output back to bytes, I wrote this, but it gives the wrong result. What are some ...
3
votes
2answers
657 views

Get variable state at specific block number

Is it possible to get a variable state at a specific block number? Let's take the balance mapping in an ERC20 contact for example. I want to know which user had what balance at a specific time (...
0
votes
1answer
105 views

How to tell the contract deployed size? (Error: The contract code couldn't be stored, please check your gas amount.)

I get Error: The contract code couldn't be stored, please check your gas amount. whenever I deploy to any test network (rinkeby, ropsten) or the live network. Deploy to a local Ganache works perfect. ...
5
votes
1answer
142 views

First instructions in bytecode (606060405)

I'm trying to figure out how EVM bytecode works and I created an empty contract in Remix. The assembly version looks like this: PUSH1 0x60 PUSH1 0x40 MSTORE CALLVALUE ISZERO PUSH1 0xE JUMPI ...
1
vote
1answer
97 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
543 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
48 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
249 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
441 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
357 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
153 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
73 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
84 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
509 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
126 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
454 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
2answers
338 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
731 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
115 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
529 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
697 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
440 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
469 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
333 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
477 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
46 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
215 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
172 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
306 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
242 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
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 ...