- 
                Notifications
    You must be signed in to change notification settings 
- Fork 162
Updating ethereum version from fork #68
Conversation
| Good timing on the 1.9 release: https://blog.ethereum.org/2019/07/10/geth-v1-9-0/ 🎉 Reverts the reverting functionality from commit ChainSafe@3eae07c in PR 😂 | 
| // 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 *evmtypes.CommitStateDB) { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is from the geth codebase lets add a reference. This is a link set to the 1.9 commit so it won't change: https://github.com/ethereum/go-ethereum/blob/52f2461774bcb8cdd310f86b4bc501df5b783852/consensus/misc/dao.go#L74
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably also worth mentioning why we had to copy it
| // for the transaction, gas used and an error if the transaction failed, | ||
| // indicating the block was invalid. | ||
| func applyTransaction(config *ethparams.ChainConfig, bc ethcore.ChainContext, author *ethcmn.Address, gp *ethcore.GasPool, statedb *evmtypes.CommitStateDB, header *ethtypes.Header, tx *ethtypes.Transaction, usedGas *uint64, cfg ethvm.Config) (*ethtypes.Receipt, uint64, error) { | ||
| msg, err := tx.AsMessage(ethtypes.MakeSigner(config, header.Number)) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
Previously used a fork of Ethereum as the version of the evm, and this updates the evm to v1.8.27 and does not require using a fork.
Caveats include using a relative version of cosmos-sdk where I had fixed their replace directive to allow the evm to use
golang.org/x/cryptoinstead of having to replace it in this directory. Also I have more or less duplicated partial logic forapplyDAOHardForkandapplyDAOHardForkas the types that are used in the functions currently were not possible to just use the overridden StateDB interface, but I will look into removing either or both.To note, I had updated the go-ethereum version to the current master branch in commit ChainSafe@ef38c33 which I had to revert back to the release version, but if we want to update to the next release, I can refer to these changes to reapply the updates.
local version of the cosmos sdk is https://github.com/ChainSafe/cosmos-sdk (I just committed to master branch) which has a PR in but am waiting on that PR to pass to replace relative dependency with that update before merging this in, but all tests pass with a local version (ignore CI, I'm not updating to pull the fork to get it to pass temporarily).