0

The list of 58 affected accounts during the DAO hardfork is available here: https://github.com/ethereum/go-ethereum/blob/5f55d95aea433ef97c48ae927835d833772350de/params/dao.go#L67

The list has four keys: [address, balance, extraBalance, extraBalanceAccount], what is the meaning of the keys 'balance', 'extraBalance' and 'extraBalanceAccount'.

One possible explanation is that 'balance' key signifies the balance in the account before the the hardfork. This is not true for the following accounts:

0x2c19c7f9ae8b751e37aeb2d93a699722395ae18f,
0x319f70bab6845585f412ec7724b744fec6095c85, 
0x779543a0491a837ca36ce8c635d6154e3c4911a6,
0x5c6e67ccd5849c0d29219c4f95f1a7a93b3f5dc5, 
0x6b0c4d41ba9ab8d8cfb5d379c69a612f2ced8ecb,  
0xd1ac8b1ef1b69ff51d1d401a476e7e612414f091,  
0xf0b1aa0eb660754448a7937c022e30aa692fe0c5, 
0xe308bd1ac5fda103967359b2712dd89deffb7973, 
0xac1ecab32727358dba8962a0f3b261731aad9723, 
0x304a554a310c7e546dfe434669c62820b7d83490, 
0x84ef4b2357079cd7a7c69fd7a37cd0609a679106, 
0xbb9bc244d798123fde783fcc1c72d3bb8c189413, 

As an example: the balance in address 0x2c19c7f9ae8b751e37aeb2d93a699722395ae18f before the hardfork does not match the balance mentioned in the JSON list

>>> w3.eth.getBalance(to_checksum_address('0x2c19c7f9ae8b751e37aeb2d93a699722395ae18f'), 1920000-1)
8519214441755701
>>> hex_to_integer('b14e8feab1ff435')
798519214441755701
0

The only field used of that list is address, all the other fields are probably just informative.

You can check this in consensus/misc/dao.go:

// ApplyDAOHardFork modifies the state database according to the DAO hard-fork
// rules, transferring all balances of a set of DAO accounts to a single refund
// contract.
func ApplyDAOHardFork(statedb *state.StateDB) {
    // Retrieve the contract to refund balances into
    if !statedb.Exist(params.DAORefundContract) {
        statedb.CreateAccount(params.DAORefundContract)
    }

    // Move every DAO account and extra-balance account funds into the refund contract
    for _, addr := range params.DAODrainList() {
        statedb.AddBalance(params.DAORefundContract, statedb.GetBalance(addr))
        statedb.SetBalance(addr, new(big.Int))
    }
}

As you see, only address addr is used. It gets the balance (whatever balance it has) using statedb.GetBalance(addr) and adds it to DAO refund contract with statedb.AddBalance(params.DAORefundContract,....)

And there is one thing, the fork code could not know how much balance will an account have at block 1920000, so there couldn't be any pre-calculation of account balances. Because to apply the fork you have to distribute the source code to miners and this is not done in a few minutes.

If you want to verify that the fork was applied correctly just veryfy the block hash, or the state root hash.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.