A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Hot answers tagged

7

At the point of writing this the supply of ether is still "infinite". Every 15 seconds two new Ether are generated. Currently we are at 107,682,753.47 Ether. These are from: Genesis (60M Crowdsale 12M Other): 72,009,990.50 Ether Mining Block Rewards: 33,168,789.59 Ether Mining Uncle Rewards: 2,503,973.38 Ether The change to PoS got delayed a few times ...


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

You can totally simulated the transaction througth eth_call. Her are the code snippets of eth_call and apply transaction (source from go-ethereum): eth_call (could not change state) // Setup the gas pool (also for unmetered requests) // and apply the message. gp := new(core.GasPool).AddGas(math.MaxUint64) res, gas, failed, err := core.ApplyMessage(evm, ...


3

You've misunderstood the steps. But close! Consensus is easily misunderstood. The fundamental problem first solved by Bitcoin was how to reach eventual consensus among nodes that do not know or necessarily trust each other. Add money to the environment and it becomes an adversarial environment. This is in no way like the situation in a typical cluster of ...


3

Your questions hint at some conceptual confusion. Fairly common misunderstandings. "Consensus" is not about the results of transactions or contracts. It's mainly about disambiguating transaction order. With deterministic contract functions (they are) and an agreed transaction order (consensus), each node runs transactions for themselves. They rely on no ...


3

Very unlikely. Machine learning is based on finding patterns in data, the very assumption of a good hashing function is that you gain no information about the data A seeing the hash of A nor you gain information about B knowing the hash of A and the hash of A + B. Therefore in theory you can not predict the output from unseen data. That said, is it "possible"...


3

Sure, you can implement your own algorithm to order the txpool. Currently, they order by gas price that make sense for mining incentive https://github.com/ethereum/go-ethereum/blob/6bd896a97f0c86fdb6d0538f5f839d7ea104e888/core/tx_list.go#L374


3

No. That isn't how it works. It's a distributed network in which no node has a privileged position, so your idea is not possible. Unless I misunderstand the question, it would require your node to receive special treatment. Gas cost for contract deployment is the price you pay to release persistent code into the network. Hope it helps.


3

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 (...


2

Ether is the only cryptocurrency in the Ethereum blockchain which needs to be mined. Ether is the native currency and the whole Ethereum blockchain works around that. In Ethereum it is possible to create different kinds of "sub" cryptocurrencies called tokens. These are simply a programmatical ledger ("who owns how many of these tokens which I just created ...


2

I haven't done it for a while, so hopefully, a kind spirit will chime in if I seem to be misleading you. Mining on Ropsten is not very competitive. You can mine coins with CPU mining and I think you'll be successful with a free tier instance. Keep in mind that you might not be able to stay within the free tier limits if you run it 24/7. CPU mining scales ...


2

I would suggest this. Smart contract execution on EVM is effectively same as code execution on any (virtual) machine For each transaction, you can trace what "CPU" instructions were executed You can assign a cost for each instructions If you want to do this in advanced way, you can for example use Intel performance tuning suites and a doctored Go Ethereum/...


2

which makes the transaction faster to be included into a block. It would get your transaction to the miner's transaction pool more quickly, but that's no guarantee it would get included in a block any faster. In the best case, if the miner's transaction pool is completely empty, your transaction might get mined more quickly. However, the block time is ~15 ...


2

The JSON_RPC eth_call method allows you to simulate a transaction on the blockchain, including contract executions. From : How can I execute code locally at given address?


2

Your understanding is correct about both nonces. The block nonce is what miners keep changing to compute a solution to Proof of Work (in Ethereum, it's Ethash). Miners probably start with a value of 0 (all bits set to 0) and then keep incrementing it by 1 until they find a solution. A definition of nonce is "occurring, used, or made only once or for a ...


2

First of all, in bitcoin and subsequently in every other blockchain nonce is shortcut for nonsense. It does not make any sense to the block data but it is there. Lets see why is it there? A Block basically should have 1) Previous block hash, and 2) List of transactions to be mined in that block With these values no matter how many times you calculate ...


2

POW and POS are both methods of choosing the miner who will have the privilege of appending a block to the canonical chain. POS doesn't change the idea of ordering transactions in ordered blocks. It changes the method of selecting a miner. Hope it helps.


2

While all the nodes operate on their local time (i.e. the local time of the computer they are being run on) large differences in time between nodes are not allowed. If you are really out of sync with an NTP server, you will experience problems with syncing blocks, consensus, etc. So while not strictly enforced, it is necessary to have accurate local time. ...


2

I've read some docs online that to get the miner/sealer/signer address of a particular block that runs with the Ethereum PoA/Clique consensus (the Rinkeby testnet for example), I need to call the clique_getSnapshot RPC interface. However when I tried it with a infura Rinkeby endpoint, it returns "The method clique_getSnapshot does not exist/is not ...


2

Thanks a lot for helps from @Ha ĐANG I finally reached this solution const Web3 = require("web3"); const web3 = new Web3("https://rinkeby.infura.io/v3/xxxxxx"); // infura Rinkeby endpoint const eju = require("ethereumjs-utils"); (async () => { let blk = await web3.eth.getBlock(4753195); let header = [ eju.toBuffer(...


2

As you said, more computation is required if the block size is bigger. But mining nodes (initially) do the actual computations - they include transactions in a block and execute the transactions. So if there are more (or more complex) transactions more computation is required from the mining nodes. Other non-mining nodes do various levels of validations (and ...


2

Why A transaction may succeed or fail depending on when/where it was mined. The initial state matters and that is only knowable when the transaction exists in unambiguous transaction order. Consider getting paid on the same day rent is due and your landlord has a post-dated check. The order of events, the transaction order, may be the determining factor (...


2

Your problem is that you can start mining from whichever block and it's totally ok. At least in theory. If we are now at block 10 and you start mining from block 5 you may eventually get your own block number 10 and 11. But at that point the rest of the blockchain is probably already at least at block 20 or 50 or 1000 - you can never catch up by solo-mining ...


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 ...


1

Faster block times are convenient for users because they both reduce both the time typically taken for an initial confirmation and the time necessary to be reasonably confident that the transaction won't be reversed in a reorg. However, fast block times also increase the number of which become orphans (or in Ethereum "uncles") because the network did not ...


1

Answering your questions in a bit of a different order. I think I covered everything, but feel free to ask follow-ups in the comments. The genesis block is simply agreed upon, and there's only ever one. Anyone working from the same genesis block is part of the same blockchain. To add a block to the chain, miners "solve a puzzle" as you said. This is called ...


1

Yes, of course. See the manual


1

As a workaround, you could preload a js file that looks for a pattern in certain transactions and start to mine only when all fours are present. For example, if you know all the transaction are from the same address: var mining_threads = 4; var txBlock = 0; var target_address = "0x83c88dbd0059edb45a3e57b9cc50e9ee0fda7190"; var batch = []; var target_batch = ...


1

In my opinion, this sounds unworkable. You can't use mining to order transactions favorably in the real world. But, you do have some options. You can group operations atomically by wrapping in another function. Also, you are assured that transactions that emit from the same EOA will be mined in nonce order. This assurance doesn't mean that someone else ...


1

Since initial work by Satoshi, who suggested proof of work consensus schema, that implies mining, many other distributed consensus schemas were invented. Some of these schemas are applicable to public trustless blockchain, while the other may only be used in private trustful ones. Here trustful means that all participants trust small group of validators ...


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