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.

5
votes
1answer
64 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
79 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
13 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
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 ...
2
votes
1answer
31 views

Assertion Rely on Balance Amounts

Is it possible in Ethereum blockchain to have two or more events simultaneously occurred? Regarding the following solidity code: function _transfer(address _from, address _to, uint _value) ...
2
votes
1answer
282 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?
4
votes
0answers
131 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
208 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
0answers
115 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
0answers
183 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 ...
2
votes
0answers
20 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
133 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
0answers
277 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
0answers
83 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
0answers
204 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
36 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
0answers
27 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
43 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
0answers
21 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
24 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
61 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
61 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
0answers
35 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
32 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
0answers
50 views

Chain txvm vs EVM: Specified Differences

Chain txvm vs EVM: What are the specified differences between both platforms?
1
vote
0answers
140 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
0answers
127 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
129 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
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 ...
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
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 ...
1
vote
0answers
53 views

Similar to currency-abstraction, could there be cryptography-abstraction (free market for digital signatures on a single state)?

Currency-abstraction for mining rewards was planned for Serenity, and so on, and so is out there as an idea. I thought about "signature-abstraction", so that different digital signatures could compete ...
1
vote
0answers
581 views

Ethereum Virtual Machine and Docker Containers

I'm trying to understand what are the constraints that wouldn't allow a Docker container to be used instead of creating the specific Ethereum Virtual Machine. I followed this link: https://forum....
1
vote
0answers
46 views

How does the “block parameter” work with RPC calls? Do light nodes have access to historical data?

I'm looking at the RPC spec. Many calls (eth_getBalance, eth_getStorageAt) allow for a custom "block parameter" where I can pass in any block number. How does this work? Does each node maintain a ...
1
vote
0answers
70 views

Optional Data Feed on the EVM, what does it mean?

I am trying to understand the idea of optional data feed for EVM in the accounting field especially. I usually read that you can use two fields with the first field being a domain to register and the ...
0
votes
0answers
18 views

Instantiation of an EVM on goLang

I'm dealing with goLang on an go-ethereum fork. In order to query a contract endpoint I need to get a fresh EVM reference for properly call the contract. I've found there is a NewEVM function that ...
0
votes
0answers
29 views

Gas is 0 when executing CALL opcode?

I wrote a very simple smart contract like this: contract Test{ function test1(address payable addr, uint256 value) payable public { addr.transfer(value); } } And I compiled it using ...
0
votes
0answers
40 views

How does UTXO fit into this schema?

I have been rather confused by the eponymous web3 stack introduced by the Web3 Foundation. https://wiki.web3.foundation/en/latest/tech_stack/Layer-0/platform_neutral_computation_description_language/ ...
0
votes
0answers
15 views

Delegatecall not changing state

I was trying the code in https://gist.github.com/sogoiii/f0ced0a4e569b5f38d302e7072d78b43 to observe the difference between call and delegatecall. pragma solidity ^0.4.18; contract D { uint public ...
0
votes
0answers
25 views

Strange behavior of solidity program

After a long debugging I found that I had two following problems in a private ethereum network using geth: If I have a require statement then the code is not executed on the EVM. The solution I found ...
0
votes
0answers
25 views

get error code of “uint64 overflow” when create contract

when create contract in statedb, i get error code the error is gas uint64 overflow, the code data is not much and i just give it little gasprice, the code is following: func NewContext() vm.Context { ...
0
votes
0answers
28 views

How to call a function automatically when some condition gets false?

I am having a bidding session where every time a person Bids on some product it checks the condition if the bidding session is valid or not, I want to trigger a finalize bid function which will ...
0
votes
0answers
39 views

Why the same contract has more bytecode size in solidity 0.5 in compare to 0.4.24?

My earlier contract was compatible with solc@0.4.24. Now I am upgrading my contract to make it compatible with solidity 0.5 but it leads to an increase in bytecode size. AFAICT There is no change in ...
0
votes
0answers
30 views

Enterprise Ethereum Quorum - Smart Contract Abstraction? Business Logic / Application Tier

Understand that in Ethereum the Smart Contract lives on the EVM -- which holds both the state (data) and business logic. It is a somewhat collapse architecture where the data tier and business logic/...
0
votes
0answers
34 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 #[...
0
votes
0answers
63 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) { ...
0
votes
0answers
57 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 ...
0
votes
0answers
57 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
0answers
286 views

log output of modified function to geth console

To analyze the execution time of different opcodes I've created the following modifications to the go-ethereum file instructions.go: func opAdd(pc *uint64, evm *EVM, contract *Contract, memory *...