The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
1
vote
1answer
48 views

Pushing bytes to EVM stack

I am sorry if this question seems to be somewhat bad, but I am trying to work out the stack representation of the following opcodes: PUSH1 60 PUSH2 40 would the stack representation of this be: [...
0
votes
1answer
91 views

Is it still possible to reach call stack depth 1024?

In the past it was possible to reach call stack depth 1024 in EVM. However I heard that now it is impossible due to gas costs. Is this true?
2
votes
2answers
304 views

How can we implement a new opcode in the Ethereum Virtual Machine.

How can we implement a new opcode in the Ethereum Virtual Machine. For eg : I want to implement an opcode logic such that the opcode number of this operation is 0x21. The EVM-implementation I am using ...
0
votes
0answers
35 views

What does #[$] or [$] mean in remix?

Can someone tell me what the #[$] or [$] in the remix assembly output means? I assume it's a placeholder for something yet to be determined but am unable to confirm if and what. For example: PUSH #[...
4
votes
1answer
846 views

Does a function call that does not change a contract's state cost gas

I have read multiple times that everything costs gas on ethereum. But when I write and use a function that does not change the state of a contract (i.e sum up two parameters and return the sum) that ...
0
votes
2answers
600 views

How to preserve msg.sender==B when user A calls contract B which calls contract C which calls contract library D?

I have user A which calls contract B which calls contract C which calls contract D. How to call external library D from contract C while preserving msg.sender==B ? Of course, I cannot use tx.origin ...
1
vote
1answer
165 views

How does Ethereum differentiate between 0x0 and null during contract creation?

According to the EVM documentation, all values are initialized. This means to will contain the 0 address, as null is not a recognized state. The 0 address links to an external account (which we all ...
1
vote
1answer
291 views

How to run local VM from golang?

I am going to run the virtual ethereum machine from the code, pass to it a compiled smart contract code. But I do not know how to do it. It's my code: package main import ( "context" "...
7
votes
2answers
293 views

Is there any efficient way to compute the exponentiation of an fractional base and fractional exponent?

First off - not the same question as this (which is great). I need the exponent to be fractional as well. Something like 2.5^0.75
2
votes
2answers
321 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. ...
1
vote
0answers
159 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 ...
0
votes
0answers
69 views

How to call another contract via create and call in EVM?

I am reading the source code of EVM. And want to imitate a contract remote call. I made two contracts as below: callee: contract Called{ uint public myuint; function set(uint _var) { ...
1
vote
1answer
187 views

What’s the opcode chain for sending ethereum from a smart contract?

Simple question, but I couldn’t find the answer anywhere. I know CALL is used and sometimes CALLER, but I don’t have any idea on how msg.sender.call.value(100) would be performed.
1
vote
1answer
118 views

Will the introduction of sharding have an effect on the functionality of currently deployed smart contracts or the EVM?

Is there any risk the the hard fork required for sharding or Plasma to take effect on the Ethereum network will cause compatibility issues for contracts already deployed? Will the protocol in place ...
1
vote
1answer
69 views

What happens when transaction is sent from smart contract?

If during smart contract execution it decides to send a transaction, then transaction would be created, validated and broadcasted to the network from all the nodes executing this smart contract. ...
0
votes
1answer
188 views

Solidity unit tests for contracts with a dynamic array return type

I am writing a simple smart contract for storing an array of bytes32, pushing to it, and retrieving it: contract SimpleStorage { bytes32[] public items; event ItemAdded(bytes32 contents); ...
1
vote
1answer
103 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. ...
3
votes
2answers
91 views

Wouldn't a 64bit-based EVM be more efficient on the Ethereum Ecosystem?

As the Ethereum Rationale design says: 32 byte word size - the alternative is 4 or 8 byte words, as in most other architectures, or unlimited, as in Bitcoin. 4 or 8 byte words are too restrictive ...
5
votes
4answers
404 views

Why do you want to use different implementations of EVM?

Currently there are many implementations of EVM (Java, C++, Python, Go, etc). For example: I will be using Solidity to write DApp on the top of EVM-Java and EVM-Python, why would I want to use EVM-...
1
vote
3answers
498 views

Reading storage from another contract [duplicate]

Is it possible to read any storage spot in a contract from another contract in EVM? I don't care if it is hackish or not. My guts say that's not possible because it makes it possible to read internal ...
1
vote
0answers
142 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
1answer
70 views

Execution environment variables Iw and Ie

According to the yellow paper, one of the Execution Environment variables is: Iw, the permission to make modifications to the state. I can't find further information about it, for example how it'...
3
votes
1answer
234 views

How do the ethereum components work together

hy i have been reading about the ethereum project and its components, i understand that there are 3 major components (EVM, swarm, whisper) Swarm is a peer to peer data sharing network in which ...
2
votes
3answers
134 views

Are Ethereum Contracts Vulnerable to Hash Table Poisoning Attacks?

Does anybody know something about this? I know that in general terms we will say not, but looking on the internet I found that isn't sure the answer to the question: Can the EVM’s Internal ...
1
vote
0answers
137 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() ...
8
votes
3answers
1k views

How to receive revert() reason for past transactions?

I run a geth/parity nodes for broadcasting user's transactions to Ethereum blockchain. Some of contract functions provide reasons for revert (see examble below): contract Example { function test (...
2
votes
1answer
265 views

Assign metadata to a transaction

How can I append some (extra) data to a transaction that calls a contract method (with given parameters)? The transaction has only one 'data' field which is used to serialize the method call. If I ...
4
votes
1answer
155 views

How are storage pointers implemented in the EVM layer?

I'm trying to understand how storage pointers work. From looking at the ethereumjs-vm implementation it seems that the actual value is returned from SLOAD. Does the compiler handle the 'pointer' ...
0
votes
1answer
254 views

How does message call send gas?

contract Sample{ event Data(uint test) ; function test2() { Data(msg.gas) ; } } contract Sample2{ function try(address addr){ Sample(addr).test2() ; addr.call(...
2
votes
2answers
197 views

Why do we need to use “view” or “pure”?

I know when to use view and pure, but I dont know why we use it. Does EVM optimize anything When I use them?
2
votes
3answers
62 views

Given the current trend of Ethereum Network growth, is smart contract practical for long term usage/storage?

My question is actually three parts, (yes I know about the upcoming sharding development in progress): It's free to access Ethereum Network data (we don't normally need the rest of the blockchain but ...
0
votes
1answer
81 views

Writing to blockchain using Solidity

So I have been looking at solidity recently and got a hold of the voting app. Pretty simple to get a hold of. But here is what I am confused about (coming from the background of developing for the web/...
2
votes
1answer
117 views

What is the difference between sealing and mining a block?

I have seen numerous sites referring to sealing a block and mining a block. I understand a miner seals a block but I do not really understand what sealing actually involves. On that point, how does ...
5
votes
1answer
260 views

Are there any specifications/details on the call stack?

I am trying to understand how the call stack inside the EVM works. I can't find anything in the yellow paper not else where online. Can anyone explain how the call stack works and if you can access ...
2
votes
3answers
525 views

Updated list of EVM Opcodes

Is there an updated Opcode Specifications available for the EVM to date? Specifically, is there a continuously updated list of Opcode Specifications similar to that found in the ethereum yellow paper?...
0
votes
1answer
19 views

Does running a buggy function stops hole contract from work?

Does running a method in a contract that has a bug in it, stops other methods of contract from doing their work? I mean in other programming works , when a buggy method runs the hole program will ...
0
votes
1answer
57 views

Hint required for beginner

pragma solidity ^0.4.16; contract FunctionTest { bool public foo = true; string public name; uint256 public counter = 0; function setName() public { // } function ...
2
votes
0answers
302 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: ...
1
vote
1answer
489 views

What is EVM code?

I am reading about Ethereum and I am a little confused with the terms EVM code, message, and contract account. Is EVM code and smart contract the same?
3
votes
2answers
180 views

reading contract bytecode from leveldb

Is there a way to read a deployed contract's bytecode from leveldb? From what I understand, within each account in the state tree, there exists the nonce, the balance, the codehash, and the storage ...
1
vote
1answer
119 views

How is account managed in Ethereum blockchain?

What is the process for creating account? (I know I can geth account new, but what is the internal process actually being done?) Where does the entropy for randomness come from when creating an ...
5
votes
1answer
70 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 ...
3
votes
1answer
112 views

How does the EVM resolve method ID collision?

What happens if I craft an EVM binary such that the ABI sees two matching method IDs, and try to deploy the contract? Is it a valid transaction?
2
votes
1answer
63 views

which nodes have evms and how do they compare the results?

which nodes have ethereum vm? I have read that nodes with evms run the transactions and check if they all got the same result. How do they sync and compare their results?
0
votes
1answer
49 views

Online tool to get EVM code of address

Using the console of an Ethereum client, you can get the binary code of a contract placed on the blockchain. Does an online tool to get this binary code exist?
2
votes
1answer
73 views

Bytecode execution during contract deployment

during the process of contract deployment the 'loading' code is executed (60606040523415600e57600080fd5b5b603680601c6000396000f300). This bytecode sequence loads the actual contract into the evm/...
2
votes
2answers
550 views

Smart contracts and the inherent lack of security in trusting compiled byte code

Smart contracts on the blockchain are compiled. Is there any system in place to verify all the public dapp contracts do what they propose to be doing? i.e. this could be done by compiling open-source ...
4
votes
1answer
2k views

How can we add new nodes under PoA?

I implemented a PoA system successfully. But after the initial setup (eg two nodes), how are new nodes added? I understand that the acceptance of a new node is a voting process but I am not certain ...
1
vote
1answer
120 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 ...
2
votes
1answer
444 views

EVM opcodes-prices

1) Why are opcodes in Ethereum priced the way they are priced and why is the EVM so expensive? 2) Right upfront, I do not say that it is too expensive to perform a tx on Ethereum, I just say that ...