Hot answers tagged

5

Block mining process in general looks like this: Miner picks transactions to be included into the block and validates them Miner organizes transactions, their receipts, resulting blockchain state into Merkle trees and calculates root hashes of them Miner chooses random nonce value Miner constructs block header from various information that, among other ...


4

A reverted transaction generally means that the logic of the smart contract being used failed or there's not enough gas to complete the transaction. The transaction was still executed by the miner, and any gas used prior to the transaction being reverted needs to be paid for. Based on this, the reverted transaction is still mined and included into the block ...


4

The transactions to mine are selected given a process that is absolutely specific to each client but even more to each miner. Indeed the transaction (tx) selection and sorting process is not part of Ethereum protocol. That is, miners can decide to select and sort transactions the way they prefer. However, miners are mainly incentivised by earning money (...


3

So you are sending a transaction in which you try to spend more Ether that you own. And you try to mine a block with that transaction. Miners validate the transactions they include in blocks. So they are responsible for validating that you don't try to spend more than you have. If the transaction is invalid it's simply refused. If you yourself try to mine ...


2

In order to determine if mining will be profitable for you or not, you should use a mining calculator. (You can just search for 'mining calculator' online.) The reason why is that profit will depend on how much you're spending on electricity and other factors. You will need to know the cost of electricity wherever you're running the ASIC. You'll need to know ...


2

Simple answer is yes. The miner can select whichever transactions from the pool they like. They can include all of them, none of them, or any combination they want based on any criteria - including the from address, or the contracts being called, or even the outcome of the contract call. Of course, they won't get paid for transactions they don't include, ...


2

Reminds me of this: reddit.com/r/ethereum/comments/7lx1do/a_christmas_mystery_sweepers_and_zero_gas_price/ So possibly the address has a known miner friend who has agreed to mine his transactions for zero gas price for whatever reason. That's not so trivial to accomplish: the miner has to be able to finish mining the blocks, at least at some point in time. ...


2

Yes, miners include transactions in blocks from the most rewarded to the least rewarded. But after the transactions are selected, the entire process for mining the block remains the same(i.e choose a random nonce value and calculate the hash repetitively until the hash is good enough) no matter which transactions you include. So even if you configure your ...


2

The receipt guarantees more than "will be executed" - it guarantees "was executed". But unfortunately, it doesn't guarantee that it will not be rejected at a later point by the nodes on the network. In fact, nothing does. But the longer it stays there, the higher the probability is that it will remain there forever. It is custom to wait 12 blocks before ...


1

Since ether on the ropsten network virtually isn't worth anything, does the gas price for transactions affect the priority in which they're mined? Ropsten ether may be worthless in "the real world" (for example, if you ever try to convert it to dollars), but in the perspective of the Ropsten network participants, it is just as worth as it is on any other ...


1

You basically already did it. As long as block reward will worth it, miners will include invocation of your function into every block they mine. However, I see minor problem with your code. As long as all token balances and transfer amounts have to be integer, your block reward has to be integer as well.


1

This will be a little over-simplified but hopefully illustrate why this isn't a vulnerability. Mining is about transaction order. When a block is mined and observed by others, this establishes a canonical order of the inputs the nodes can agree on. Given this, the nodes can compute the result independently. Success or failure depends on what the ...


1

Ethereum's Proof-of-Work mining algorithm is designed to be ASIC-resistant. Basically this means that using an ASIC should not be beneficial enough to warrant the high cost of ASICs. Yes, an ASIC gives you a lot of hashing power, but it costs a lot. So the question you need to ask yourself (and possibly research) is whether the high cost of an ASIC can be ...


1

The pool manager is in charge of validating transactions and building a candidate block for the pool miners : Most mining pools are "managed," meaning that there is a company or individual running a pool server. The owner of the pool server is called the pool operator, and he charges pool miners a percentage fee of the earnings. The pool server ...


1

Finding a block is, more precisely, organizing a block and finding a nonce. The miner will work with pending transactions (known) and the miner gets the transaction fees, so the optimal approach is roughly to organize the highest gas consumption and highest gas price, but the miner is not obligated to organize it a certain way. The block hash includes the ...


1

My understanding is that currently you could do that. It would require to be patient to be able to send your transaction because the moment when you are lucky enough to mine a block is not predictable. But with enough hashpower you could try and expect your transaction do be mined. I looked at some node code and I can't see anything preventing this. It did ...


1

will a transaction that alters the state do so before the next transaction, regardless of whether it is in the same block? Yes if their transactions are in the same block, would the second transaction be rejected? Yes An important point is that neither Alice or Bob knows who is first: the miner decides which transaction is first. See also What is the ...


1

Try specifying explicitly your private network informations such as in this example from the web3js documentation : web3.eth.accounts.signTransaction({ to: '0xF0109fC8DF283027b6285cc889F5aA624EaC1F55', value: '1000000000', gas: 2000000 common: { baseChain: 'mainnet', hardfork: 'petersburg', customChain: { name: 'custom-chain', chainId: 1, ...


1

Assuming you talk about randomness, any previous block is also vulnerable. blockhash(block.number-1) is just an example people use for 'previous blockhash'.


1

Nobody can force a miner to do anything specific. Miners are free to do whatever they want and include whichever transactions they want - within certain parameters (for example block gas limit). But the reason most miners choose to include transactions with high gas price is monetary incentive. They get more rewards for including transactions with high gas ...


1

My question is if there is a better way of measuring the time? I suspect there is a conceptual disconnect. It's not a synchronous operation and the time is dependent on more factors than are accounted for here. Also, the rapid-fire transactions would probably lead to trouble in production if done this way. Network Throughput Yes, you are measuring the ...


1

A Detailed Verification Process Blockchain wallets are what holds the Bitcoin address and also records all of your transactions. To send, receive, or store digital currencies you need to have a digital wallet. The Bitcoin address is a code created with a numbers and letters, also called a public key. The sequence of the public key can be seen by all within ...


1

Double spending affects also ERC20 tokens (and any token types for that matter). It's all about being able to double-send transactions which have some value. I don't see basically much difference between Ether and token in this sense. I'd imagine that the reason why double spending is always associated with Ethers and not tokens is that Ethers are a lot ...


1

Short answer: 1/2048 here is the highest possible natural (i.e. not taking time bomb into account) relative difficulty increase for a block with no uncles. For a block with uncles this number is twice as high: 1/1024. So if previous block had difficulty of x, then current block will have difficulty of at most x + x/2048, in case current block doesn't have ...


1

Miners have compete latitude to include or ignore any transactions they like, in almost any order. The only invariant is that transactions emitted from a given EOA must be mined in account once order. Miners will probably select transactions with the highest gas price and pack blocks with the most gas allowed. That usually happens. Hope it helps.


1

The answer is whatever one the miner wants first. A miner could choose a tx with a gasPrice of 0.5 Gwei and not include either of the 1 Gwei transactions. Most mining clients will optimize for profit (highest gasPrice). In the case of two transactions with identical profit, the client will likely choose the transaction that was broadcast first.


1

I am thinking if I could setup a miner client to mine ONLY very low-valued blocks, because, I hope, there is less people trying to solve them. Every miner is always trying to solve a different block. If two miners are not coordinated, they are each trying to mine blocks that reward them and not the other miner. So miners who aren't coordinating are trying ...


Only top voted, non community-wiki answers of a minimum length are eligible