status-go/geth-patches
Adam Babik c153a60dc3
Clean up whisper log delivery (#555)
2018-01-19 15:53:16 +01:00
..
0000-accounts-hd-keys.patch Upgrade to geth 1.7.3 and add geth patches (#492) 2018-01-15 21:26:41 +01:00
0002-les-api-status.patch Upgrade to geth 1.7.3 and add geth patches (#492) 2018-01-15 21:26:41 +01:00
0003-dockerfiles-wnode-swarm.patch Upgrade to geth 1.7.3 and add geth patches (#492) 2018-01-15 21:26:41 +01:00
0004-whisper-notifications.patch Upgrade to geth 1.7.3 and add geth patches (#492) 2018-01-15 21:26:41 +01:00
0006-latest-cht.patch Upgrade to geth 1.7.3 and add geth patches (#492) 2018-01-15 21:26:41 +01:00
0007-README.patch Upgrade to geth 1.7.3 and add geth patches (#492) 2018-01-15 21:26:41 +01:00
0008-tx-pool-nonce.patch Use single codepath for sending transactions to a local and remote nodes (#527) 2018-01-18 17:55:17 +01:00
README.md Clean up whisper log delivery (#555) 2018-01-19 15:53:16 +01:00

README.md

Status Patches to for geth (go-ethereum)


Status-go uses go-ethereum (upstream) as its dependency. As any other Go dependency go-ethereum code is vendored and stored in vendor/ folder.

However, there are a few changes has been made to the upstream, that are specific to Status and should not be merged to the upstream. We keep those changes as a set of patches, that can be applied upon each next release of go-ethereum. Patched version of go-ethereum is available in the status-im/go-ethereum repo.

We try to minimize number and amount of changes in those patches as much as possible, and whereas possible, to contribute changes into the upstream.

Patches

  • 0000-accounts-hd-keys.patch — adds support for HD extended keys (links/docs?)
  • 0002-les-api-status.patch — adds StatusBackend into LES code (need to be inspected, some things can and should be done outside of les code)
  • 0003-dockerfiles-wnode-swarm.patch — adds Dockerfiles (who uses this?)
  • 0004-whisper-notifications.patch — adds Whisper notifications (need to be reviewed and documented)
  • 0006-latest-cht.patch updates CHT root hashes, should be updated regularly to keep sync fast, until proper Trusted Checkpoint sync is not implemented as part of LES/2 protocol.
  • 0007-README.patch — update upstream README.md.
  • 0008-tx-pool-nonce.patch - On GetTransactionCount request with PendingBlockNumber get the nonce from transaction pool

Updating upstream version

When a new stable release of go-ethereum comes out, we need to upgrade our fork and vendored copy.

Note: The process is completely repeatable, so it's safe to remove current go-ethereum directory, clone latest upstream version and apply patches from scratch.

How to update forked version

Make sure you have status-go in your $GOPATH/src/github.com/status-im/ first.

From very scratch

Use this method if you're up to nuke forked repo for some reason and apply patches from scratch:

# from scratch
rm -rf $GOPATH/src/github.com/status-im/go-ethereum
cd $GOPATH/src/github.com/status-im/
git clone https://github.com/ethereum/go-ethereum

# update remote url to point to our fork repo
git remote set-url origin git@github.com:status-im/go-ethereum.git
# merge upstream release branch into local master
git pull git@github.com:ethereum/go-ethereum.git release/1.7:master

Apply patches

for patch in $GOPATH/src/github.com/status-im/status-go/geth-patches/*.patch;
do
    patch -p1 < $patch;
done

Once patches applied, you might want to inspect changes between current vendored version and newly patched version by this command:

diff -Nru -x "*_test.go" -x "vendor" -x ".git" -x "tests" -x "build" --brief $GOPATH/src/github.com/status-im/go-ethereum $GOPATH/src/github.com/status-im/status-go/vendor/github.com/ethereum/go-ethereum

Vendor patched version

Using dep tool

TBD

Manually

This method should be used only while dep tool workflow is not set up.

# remove existing version from vendor
rm -rf $GOPATH/src/github.com/status-im/vendor/github.com/ethereum/go-ethereum/

# copy whole directory
cp -a $GOPATH/src/github.com/status-im/go-ethereum $GOPATH/src/github.com/status-im/status-go/vendor/github.com/ethereum/

# remove unneeded folders
cd $GOPATH/src/github.com/status-im/status-go/vendor/github.com/ethereum/go-ethereum
rm -rf .git tests build vendor

# remove _test.go files
find . -type f -name "*_test.go" -exec rm '{}' ';'