Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
18

Here's code that waits specified number of blocks and verifies the transaction receipt is still valid. If a fork occurs and the replay fails, the receipt check should fail and the callback will call with Error set. I've only tested this for success and timeout failures, I've not tested it on an actual fork of the blockchain, because I haven't figured out ...


15

There are a few modules around that let you keep track of the "state" of a transaction (unconfirmed, X confirmations, conflicting transaction exists and is being confirmed, fully confirmed, definitely failed) and represent this info in the UI with color-coding. You should then probably only make "irreversible" changes to the data that's represented in the UI ...


7

You should actually read Building Ethereum Once you have installed a client, you need to download the python script that generates the Genesis file. It’s called ‘mk_genesis_block.py’, and can be downloaded here. You will then be able to generate the Genesis block by running: python mk_genesis_block.py --extradata hash_for_#1028201_goes_here > ...


4

If you already know how to create a private Ethereum chain, then you're already most of the way there. The difference between "public" and "private" is basically the process of publicising and allowing others to join. A private Ethereum testnet is only private because you've not told everyone you're running it. (There are probably a few further complexities ...


4

I can't comment whether there is or is not a function for this in web3. What I do know is that Geth and Mist have transaction replay. This means that in case of a reorganisation it will process transactions that were 'lost' during the reorganisation so in theory the state should still be the same.


4

If all miners removed the difficulty bomb and basically reject the fork (or introduce a new one by removing it) then there would still just be one chain as there is nobody else creating any other chain. In this hypothetical scenario, if the miners were the only ones and all other node operators would still have the bomb in place, then these nodes would ...


3

Both mining nodes are competing to create blocks, and mined a block at around the same time. Both blocks are valid, but they are 2 possible realities. They keep mining and one of them finds another block. The longest chain (2 blocks instead of one) becomes the accepted reality, and the shortest chain (1 block only) is a side fork, it is useless. It is ...


3

Currently I don't think there is a way to do that. Currently the docs say to just wait 12 blocks to make sure that a hard fork didn't happen and use getCode(). https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethcontract


3

To the protocol, there's no difference between the various kinds of storage (hot, cold, paper, etc.) All it knows is that a given key corresponds to a given address. So there wouldn't be anything pertaining to cold storage per se--it should all still work. But it's remotely possible that due to the nature of a fork that everyone, regardless of how they ...


2

On web3 API, section contract events, it is said that the object given to the callback has a removed field. If you listen for your event and a reorganization occurs, you should be notified by an event in wich removed is set to true. I never tried this but if understood correctly the doc, it should work.


2

Message type 1, from the relevant code: // If we're DAO hard-fork aware, validate any remote peer with regard to the hard-fork if daoBlock := pm.chainconfig.DAOForkBlock; daoBlock != nil { // Request the peer's DAO fork header for extra-data validation if err := p.RequestHeadersByNumber(daoBlock.Uint64(), 1, 0, false); err != nil { ...


2

A fork choice rule is a general term. For some history I've found, one of the early written descriptions of the term is from March 2017 https://medium.com/@VitalikButerin/minimal-slashing-conditions-20f0b500fc6c A fork choice rule is a function, evaluated by the client, that takes as input the set of blocks and other messages that have been produced, ...


2

Your understanding is close but it's not quite right. A soft fork is a change that makes some block, that was previously legal, illegal. A hard fork is a change that makes some block, that was previously illegal, legal. Now imagine the majority of the network has applied the change, and think about this from the point of view of a node that hasn't applied ...


1

Rollback is not possible. Creation of a new smartcontract is always a possibility. Nothing can stop you from deploying a new smartcontract, crafted mimic behavior of old contract, starting from certain initial state corresponding to one of the states of the old one. From the point of view of the network, these two contracts will be completely unrelated. You ...


1

You can pull the block data for block 1920000 using web3. This is the dao fork block so the block hash will be different. ETC is 0x94365e3a8c0b35089c1d1195081fe7489b528a84b22199c916180db8b28ade7f ETH is 0x4985f5ca3d2afbec36529aa96f74de3cc10a2a4a6c44f2157a57d2c6059a11bb


1

Usually, you hold some form of a coin swap. A rough way to go about this is as follows. Build a pause functionality into your ERC20 contract, and pause the contract on the swap date Have some method for users to register a public key for your chain against their ETH address. For users with an outgoing tx from their ETH address, you can calculate the pub ...


1

The easiest way is to have a list of miners (identified by address) , and only insert blocks from these miners. The list must be signed by you with your private key and downloaded every certain period by all nodes.


1

Really late to the party... Depending on the nature of the hard fork, you may need to do one of several things. For the sake of discussion, I'm going to call "Ethereum" the "One True Fork" as far as you are concerned (be it the Ethereum mainnet or Ethereum Classic). Without loss of generality, I am assuming you wish to move ether and not ether on one of the ...


1

It's a bug after recent hard fork. https://github.com/ethereum/go-ethereum/issues/3183


1

Rebuilding all blockchain from scratch has fixed it, but I would have preferred a faster solution. Any ideas? On another node, I got a similar result after upgrading: E1027 08:05:06.621020 core/blockchain.go:1170] Bad block #1813322 (0x2612c6b92ced0ae0d7cff7a303f47eab31600df326dfa6b131f4f05ca5df69fd) E1027 07:59:03.702864 core/blockchain.go:1171] gas ...


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