Hot answers tagged

58

Wow this is such an interesting question! TL;DR: the transaction size limit, at the time of writing, is about 780kB (about 3 million gas). But read on. There is no direct or fixed limit neither for transaction sizes nor for block sizes. This is a strength of the Etherem network, it does scale. That does not mean that there are no limits. There is the block ...


55

Due to advances in blockchain research, it was shown that significantly lower block times were possible and perhaps beneficial given the current connectivity of the internet. One of the potential risks of a low block time is a higher rate of orphaned blocks (competing blocks that do not make it into the main chain). To counter this, a GHOST protocol is used ...


29

You can also use geth removedb to remove the blockchain and state databases. geth removedb Remove local database? [y/N] After removing the old databases, run geth --fast --cache=1024 (see answer to this question by @eth). Note that using geth --fast will prevent you from using debug.traceTransaction(...) on the blocks that were --fast downloaded. Some ...


28

For geth, delete $home/Libary/Ethereum/chaindata. That should wipe out the blockchain itself and let you sync from scratch. Also you probably want to do a fast sync afterwards to get back fast-ish on the chain --fast.


28

It can't be canceled, but it can be "out-gassed". You can grab the nonce (can be found on the pending tx on etherscan) and send another transaction with a higher gas price with the same nonce. If you use a different nonce, then they can both be mined, but if you use the same nonce, only one can be mined. If miners see both, they should be smart enough to ...


21

For other operating systems, the default datadir is: Mac: ~/Library/Ethereum Linux: ~/.ethereum Windows: %APPDATA%/Ethereum Delete the chaindata subdirectory that you find. Run geth --fast --cache=1024 for a recommended way to sync the chain quickly (don't forget to use a bigger --cache with a value like 1024, otherwise the default is 16, and it won't ...


19

Relationship between Transaction Trie and Receipts Trie provides a good summary: Transaction Receipts record the transaction outcome Here is the Structure of a transaction receipt blockHash: String, 32 Bytes - hash of the block where this transaction was in. blockNumber: Number - block number where this transaction was in. transactionHash: String, 32 ...


18

The 1 MB size limit per Block is for the Bitcoin's blockchain. In Ethereum, there is theoretically no limit for the block size. However, blockchain is not meant for data storage and storing large documents will be very expensive. Here are some instances where people hacked into the Bitcoin Blockchain and stored some unexpected data. You would have to ...


17

Yes. Each transaction has a gas limit. For example, there could be 5 unmined transactions where each has a gas limit of 10, 20, 30, 40, 50. The block gas limit determines how many transactions can fit in a block. For example, if the block gas limit is 100, then the first four transactions can fit in the block. Miners decide which transactions to include ...


17

A benefit of a blockchain is that it is append-only with, in practice, immutable past blocks. These past blocks are immutable because it is very difficult (via proof-of-work) to create a competing block that "rewrites history". Plus, you have to take into account the fact that subsequent blocks add their own difficulty. So to change a block in the past, and ...


15

What happens if Bob, Alice and Eve all call the Greeter at the same time and all three calls are in the same block? The three transactions would get called, not necessarily in sequence, and the last transaction's name will be persisted in the mined block. Does everyone get the proper response with their own name? No. The getName() method would return the ...


13

As of 12/08/2017, the gas limit as detailed on EthStats.net is 6,700,314. The gas limit was 'stuck' at 4.7 million. It was recommended that miners change their settings such that the gas limit could be raised. As outlined in this article, this happened. Each hexadecimal character is 4 bits. 2 characters is a byte. The yellow paper outlines the fees for ...


13

While it's not possible to explicitly cancel a transaction, you can invalidate the transaction before it's mined. The way this works is by broadcasting the same transaction using the same nonce, but with a higher gas fee. The miners are incentivized to process transactions with higer fees. If they process the newer transaction, then the old transaction ...


11

In the Ethereum blockchain, the difficulty is used to calculate a target. Here are the ethminer logs for block number 1257006 : ℹ 35:02:42.89 ethminer Solution found; Submitting to http://192.168.4.120:8545 ... ℹ 35:02:42.89 ethminer Nonce: ff4136b6b6a244ec ℹ 35:02:42.89 ethminer Mixhash: ...


11

Edit: 23 June 2017 - Added Parity details (see below) Geth For the vanilla Geth implementation, the commitNewWork() function in worker.go orders in the following way: //approach 2 transactions := self.eth.TxPool().GetTransactions() <--- fetch from pool types.SortByPriceAndNonce(transactions) <---------- order i.e. Sorts by gas price and nonce ...


10

Transaction Tries and Transaction Receipt Tries are indeed independent data structures with distinct roots stored on the blockchain header and differ in both purpose and content. Purpose: Transaction Tries: records transaction request vectors Transaction Receipt Tries: records the transaction outcome Content: Parameters used in composing a Transaction ...


9

Use web3.eth.getBlock with web3.eth.blockNumber for (var i=0; i < 10; i++) { console.log(web3.eth.getBlock(web3.eth.blockNumber - i)); } EDIT: for web3.js 1.0+ the loop's body should be: web3.eth.getBlock(web3.eth.blockNumber - i).then(console.log) (example)


9

I implemented a bitcoin blockchain parser after following along with this blog post. I havent tried changing it to work with the Ethereum blockchain but maybe it can give you some guidance. Here's a parser implemented in Go to hopefully give you some Ethereum specific examples to go off of.


9

On a public chain, it makes perfect sense to keep creating blocks, because a miner will still get the 5 ETH block reward, with or without transactions inside. Thus, geth will continuously mine as long as it is told to do so. It doesn't know that the chain isn't public. It is possible to write a script to control geth's mining. See this question. If you are ...


8

"Seal a block" is a proposed term to describe "mine a block" in a private chain. Private chains typically do not need to use proof-of-work mining, so a different term can be helpful. Specifics of what sealing means is up to a "seal engine", which is a proposed term to describe the consensus algorithm for a blockchain: one could describe that Ethereum ...


8

What you see in block explorers is the sha3 of the block header, not the ethash.


8

These are explained on the wiki in the JSON RPC README, under the entry for eth_getBlockByHash(). difficulty: QUANTITY - integer of the difficulty for this block. totalDifficulty: QUANTITY - integer of the total difficulty of the chain until this block. [ Where the difficulty itself is a measure of how difficult it is for a miner to mine a new ...


8

Your friend simply edited the HTML and changed the TimeStamp, To, and Value on that page. You can tell this because all of the other stats on the page are correct, with the exception of the items noted above. This includes the Block. You know that the image has been edited because the Block and the timestamp simply do not match (nor are they even close). ...


7

The best way to start is to understand the following few concepts and learnings. what is Smart contracts ? What is solidity and how to start writing your domain data or objects in solidity. Understand event logging, to store searchable data , and how to use it. Be aware your questions is too broad.But this three points will answer your most practical ...


7

However, only the miner earns the gas associated with the smart contract exectution. Does that mean that all nodes that execute the smart contract after the miner to verify its result do not earn any gas? Correct. I understand why in Bitcoin it's not really problematic to only reward the miner because most of the computation goes into solving a proof of ...


7

There is no Web API, but you can perform this using SQL. You can do it simply with "Presto Ethereum Connector" (https://github.com/xiaoyao1991/presto-ethereum) Using Presto Ethereum, you can query the blocks using an SQL command. You can base the where condition on block_timestamp. Bellow is the structure of the "block" table provided by Presto Ethereum: ...


6

You can take a look at the Ethereum Network Status page found here: https://ethstats.net/ to see which block the network is at. Currently, the best block is #998,717.


6

This is really an implementation detail and every miner could operate on a wide variety of mining strategies. That being said, AFAIK miner miners/pools run the standard algorithm included in Geth, which is: Discard anything below a threshold Gather all the executable transactions (i.e. one for each account) Pick the more expensive one Repeat from step 2. ...


6

Yes and no. There's no way to enforce any given betting strategy in either PoS or PoW. For example, in PoW, there's no way to force miners to never mine on an attacker's chain. So, yes, a validator could be programmed to bet in any possible way. Betting doesn't quite work this way, however. There's been multiple versions of how betting works, what exactly ...


6

Yes, the Ethereum Yellow Paper (YP) and related Ethereum block architecture. Here are the main pieces of a block and the YP has all the sizes: 4.3. The Block. The block in Ethereum is the collection of relevant pieces of information (known as the block header), H, together with information corresponding to the comprised transactions, T, and a set of ...


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