2022 Developer Survey is open! Take survey.

Hot answers tagged

73 votes
Accepted

Is there a limit for transaction size?

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 ...
user avatar
  • 31.3k
57 votes
Accepted

Why is the average block time 17 seconds?

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 ...
user avatar
39 votes

How to delete or reset the blockchain in geth? (OSX)

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 ...
user avatar
  • 391
35 votes
Accepted

Is it possible to cancel a transaction?

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 ...
user avatar
  • 10.6k
32 votes
Accepted

What are Ethereum transaction receipts and what are they used for?

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: ...
user avatar
  • 78k
31 votes
Accepted

How to delete or reset the blockchain in geth? (OSX)

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 ...
user avatar
22 votes

How to delete or reset the blockchain in geth? (OSX)

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=...
user avatar
  • 78k
20 votes
Accepted

Are gas limit in transaction and block gas limit different?

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 ...
user avatar
  • 78k
19 votes

Storing document/file in blockchain

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 ...
user avatar
  • 3,795
19 votes
Accepted

Why does ethereum creates a new block,without even a single transaction?

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 ...
user avatar
18 votes
Accepted

What happens when a smart contract gets several similar calls in the same block?

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 ...
user avatar
17 votes

Is there a limit for transaction size?

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 ...
user avatar
17 votes
Accepted

What is the default ordering of transactions during mining?

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 := ...
user avatar
14 votes
Accepted

Relationship between Transaction Trie and Receipts Trie

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: ...
user avatar
  • 4,990
14 votes
Accepted

Why are there no leading zeroes in ethereum block hash?

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....
user avatar
14 votes

Is it possible to cancel a transaction?

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 ...
user avatar
  • 4,625
12 votes
Accepted

How can I get the data of the latest 10 blocks via web3.js?

There are a few issues with the accepted answer: as @Lam-Le mentions, .getBlock() and .getBlockNumber() are both asynchronous so if a new block is created during the loop not only will you no longer ...
user avatar
  • 236
10 votes

What does it mean to "seal a block"?

"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 ...
user avatar
  • 78k
10 votes

How can I get the data of the latest 10 blocks via web3.js?

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....
user avatar
  • 78k
10 votes

Why does ethereum creates a new block,without even a single transaction?

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 ...
user avatar
9 votes

How to parse blocks with Python?

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 ...
user avatar
  • 215
9 votes

Why are there no leading zeroes in ethereum block hash?

What you see in block explorers is the sha3 of the block header, not the ethash.
user avatar
9 votes

What is the default ordering of transactions during mining?

To add on the excellent answer by Richard Horrocks: I studied the last 1000 blocks: ~85% of blocks seem to be ordered by High gas price first (respecting nonce order for a single sender address) (The ...
user avatar
9 votes
Accepted

If all nodes execute smart contracts, why do only block creators get the gas fee?

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 ...
user avatar
  • 16.3k
9 votes

When are “pending” transactions dropped from the blockchain?

All transactions are kept in the Mempool a term borrowed from Bitcoin. You can see all the current pending transactions here: Pending Transactions There's a limit to the size of the Mempool and once ...
user avatar
  • 605
9 votes
Accepted

Why are there so many empty blocks?

In short: empty blocks propagate around the network more quickly than blocks that aren't empty. If two mining nodes find the proof-of-work solution to the blocks they're mining at the same time, only ...
user avatar
9 votes
Accepted

Block time and confirmation time

Block time is the expected interval between two blocks. For ethereum, this is around 15 seconds. For Bitcoin, it is 10 minutes. The number of confirmations is simply the number of blocks that have ...
user avatar
  • 3,790
8 votes
Accepted

How to use blockchain as a Database?

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. ...
user avatar
8 votes
Accepted

Difficulty and total difficulty

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 - ...
user avatar
8 votes

Calculate approximative block height at a certain time?

If you just mean a general formula, rather than something written in Solidity... Something along the lines of: last_block_number + ((future_time - time_now) / block_time) Where the future_time and ...
user avatar

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