-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update `github.com/ethereum/go-ethereum` package to 1.8.1 branch. Part of #638 * Fix code due to some signature changes. Part of #638 * use upstream for whisper backend * Add patch to downgrade usage of Whisper v6 to v5 in some geth 1.8.1 vendor files. Part of #638 * Take into account the DNS rebinding protection introduced in 1.8.0 by adding exception for localhost. Part of #638 * Add patches required for cross-compiled builds starting with geth 1.8.0. Only applied during build. Part of #638 * Update expected JSON result in `TestRegressionGetTransactionReceipt()` and `TestCallRawResultGetTransactionReceipt()`. Part of #665 * Fix some failing e2e tests. Part of #638 * Address comments in PR #702. Part of #638
- Loading branch information
Pedro Pombeiro
authored
Feb 27, 2018
1 parent
0a15c9f
commit e4cbce1
Showing
487 changed files
with
184,304 additions
and
10,116 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
_assets/patches/geth-xgo/0001-fix-duktapev3-missing-SIZE_MAX-def.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
diff --git a/vendor/gopkg.in/olebedev/go-duktape.v3/duk_minimal_printf.c b/vendor/gopkg.in/olebedev/go-duktape.v3/duk_minimal_printf.c | ||
index e4b6e43a..baed990d 100755 | ||
--- a/vendor/gopkg.in/olebedev/go-duktape.v3/duk_minimal_printf.c | ||
+++ b/vendor/gopkg.in/olebedev/go-duktape.v3/duk_minimal_printf.c | ||
@@ -278,6 +278,7 @@ int duk_minimal_snprintf(char *str, size_t size, const char *format, ...) { | ||
} | ||
|
||
/* Minimal sprintf() entry point. */ | ||
+#if 0 | ||
int duk_minimal_sprintf(char *str, const char *format, ...) { | ||
va_list ap; | ||
int ret; | ||
@@ -288,6 +289,7 @@ int duk_minimal_sprintf(char *str, const char *format, ...) { | ||
|
||
return ret; | ||
} | ||
+#endif | ||
|
||
/* Minimal sscanf() entry point. */ | ||
int duk_minimal_sscanf(const char *str, const char *format, ...) { |
131 changes: 131 additions & 0 deletions
131
_assets/patches/geth-xgo/0002-remove-dashboard-collectData.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
diff --git a/vendor/github.com/ethereum/go-ethereum/dashboard/dashboard.go b/vendor/github.com/ethereum/go-ethereum/dashboard/dashboard.go | ||
index 09038638..070ecca3 100644 | ||
--- a/vendor/github.com/ethereum/go-ethereum/dashboard/dashboard.go | ||
+++ b/vendor/github.com/ethereum/go-ethereum/dashboard/dashboard.go | ||
@@ -29,17 +29,14 @@ import ( | ||
"net" | ||
"net/http" | ||
"path/filepath" | ||
- "runtime" | ||
"sync" | ||
"sync/atomic" | ||
"time" | ||
|
||
- "github.com/elastic/gosigar" | ||
"github.com/ethereum/go-ethereum/log" | ||
"github.com/ethereum/go-ethereum/p2p" | ||
"github.com/ethereum/go-ethereum/params" | ||
"github.com/ethereum/go-ethereum/rpc" | ||
- "github.com/rcrowley/go-metrics" | ||
"golang.org/x/net/websocket" | ||
) | ||
|
||
@@ -274,108 +271,6 @@ func (db *Dashboard) apiHandler(conn *websocket.Conn) { | ||
// collectData collects the required data to plot on the dashboard. | ||
func (db *Dashboard) collectData() { | ||
defer db.wg.Done() | ||
- systemCPUUsage := gosigar.Cpu{} | ||
- systemCPUUsage.Get() | ||
- var ( | ||
- prevNetworkIngress = metrics.DefaultRegistry.Get("p2p/InboundTraffic").(metrics.Meter).Count() | ||
- prevNetworkEgress = metrics.DefaultRegistry.Get("p2p/OutboundTraffic").(metrics.Meter).Count() | ||
- prevProcessCPUTime = getProcessCPUTime() | ||
- prevSystemCPUUsage = systemCPUUsage | ||
- prevDiskRead = metrics.DefaultRegistry.Get("eth/db/chaindata/compact/input").(metrics.Meter).Count() | ||
- prevDiskWrite = metrics.DefaultRegistry.Get("eth/db/chaindata/compact/output").(metrics.Meter).Count() | ||
- | ||
- frequency = float64(db.config.Refresh / time.Second) | ||
- numCPU = float64(runtime.NumCPU()) | ||
- ) | ||
- | ||
- for { | ||
- select { | ||
- case errc := <-db.quit: | ||
- errc <- nil | ||
- return | ||
- case <-time.After(db.config.Refresh): | ||
- systemCPUUsage.Get() | ||
- var ( | ||
- curNetworkIngress = metrics.DefaultRegistry.Get("p2p/InboundTraffic").(metrics.Meter).Count() | ||
- curNetworkEgress = metrics.DefaultRegistry.Get("p2p/OutboundTraffic").(metrics.Meter).Count() | ||
- curProcessCPUTime = getProcessCPUTime() | ||
- curSystemCPUUsage = systemCPUUsage | ||
- curDiskRead = metrics.DefaultRegistry.Get("eth/db/chaindata/compact/input").(metrics.Meter).Count() | ||
- curDiskWrite = metrics.DefaultRegistry.Get("eth/db/chaindata/compact/output").(metrics.Meter).Count() | ||
- | ||
- deltaNetworkIngress = float64(curNetworkIngress - prevNetworkIngress) | ||
- deltaNetworkEgress = float64(curNetworkEgress - prevNetworkEgress) | ||
- deltaProcessCPUTime = curProcessCPUTime - prevProcessCPUTime | ||
- deltaSystemCPUUsage = systemCPUUsage.Delta(prevSystemCPUUsage) | ||
- deltaDiskRead = curDiskRead - prevDiskRead | ||
- deltaDiskWrite = curDiskWrite - prevDiskWrite | ||
- ) | ||
- prevNetworkIngress = curNetworkIngress | ||
- prevNetworkEgress = curNetworkEgress | ||
- prevProcessCPUTime = curProcessCPUTime | ||
- prevSystemCPUUsage = curSystemCPUUsage | ||
- prevDiskRead = curDiskRead | ||
- prevDiskWrite = curDiskWrite | ||
- | ||
- now := time.Now() | ||
- | ||
- var mem runtime.MemStats | ||
- runtime.ReadMemStats(&mem) | ||
- activeMemory := &ChartEntry{ | ||
- Time: now, | ||
- Value: float64(mem.Alloc) / frequency, | ||
- } | ||
- virtualMemory := &ChartEntry{ | ||
- Time: now, | ||
- Value: float64(mem.Sys) / frequency, | ||
- } | ||
- networkIngress := &ChartEntry{ | ||
- Time: now, | ||
- Value: deltaNetworkIngress / frequency, | ||
- } | ||
- networkEgress := &ChartEntry{ | ||
- Time: now, | ||
- Value: deltaNetworkEgress / frequency, | ||
- } | ||
- processCPU := &ChartEntry{ | ||
- Time: now, | ||
- Value: deltaProcessCPUTime / frequency / numCPU * 100, | ||
- } | ||
- systemCPU := &ChartEntry{ | ||
- Time: now, | ||
- Value: float64(deltaSystemCPUUsage.Sys+deltaSystemCPUUsage.User) / frequency / numCPU, | ||
- } | ||
- diskRead := &ChartEntry{ | ||
- Time: now, | ||
- Value: float64(deltaDiskRead) / frequency, | ||
- } | ||
- diskWrite := &ChartEntry{ | ||
- Time: now, | ||
- Value: float64(deltaDiskWrite) / frequency, | ||
- } | ||
- db.charts.ActiveMemory = append(db.charts.ActiveMemory[1:], activeMemory) | ||
- db.charts.VirtualMemory = append(db.charts.VirtualMemory[1:], virtualMemory) | ||
- db.charts.NetworkIngress = append(db.charts.NetworkIngress[1:], networkIngress) | ||
- db.charts.NetworkEgress = append(db.charts.NetworkEgress[1:], networkEgress) | ||
- db.charts.ProcessCPU = append(db.charts.ProcessCPU[1:], processCPU) | ||
- db.charts.SystemCPU = append(db.charts.SystemCPU[1:], systemCPU) | ||
- db.charts.DiskRead = append(db.charts.DiskRead[1:], diskRead) | ||
- db.charts.DiskWrite = append(db.charts.DiskRead[1:], diskWrite) | ||
- | ||
- db.sendToAll(&Message{ | ||
- Home: &HomeMessage{ | ||
- ActiveMemory: ChartEntries{activeMemory}, | ||
- VirtualMemory: ChartEntries{virtualMemory}, | ||
- NetworkIngress: ChartEntries{networkIngress}, | ||
- NetworkEgress: ChartEntries{networkEgress}, | ||
- ProcessCPU: ChartEntries{processCPU}, | ||
- SystemCPU: ChartEntries{systemCPU}, | ||
- DiskRead: ChartEntries{diskRead}, | ||
- DiskWrite: ChartEntries{diskWrite}, | ||
- }, | ||
- }) | ||
- } | ||
- } | ||
} | ||
|
||
// collectLogs collects and sends the logs to the active dashboards. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Status Patches for geth (go-ethereum) cross-compiled in Xgo | ||
--- | ||
|
||
Status-go uses [go-ethereum](https://github.com/ethereum/go-ethereum) (**upstream**) as its dependency. When cross-compiling with Xgo, some headers or definitions are not available within the Xgo environment. In such a situation, we temporarily patch the sources before kicking the build in Xgo and revert them afterwards (this is taken care by the respective Makefile targets). | ||
|
||
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. | ||
|
||
# Creating patches | ||
|
||
Instructions for creating a patch from the command line: | ||
|
||
1. Enter the command line at the go-ethereum dependency root in vendor folder. | ||
1. Create the patch: | ||
1. If you already have a commit that represents the change, find its SHA1 (e.g. `$COMMIT_SHA1`) and do `git diff $COMMIT_SHA1 > file.patch` | ||
1. If the files are staged, do `git diff --cached > file.patch` | ||
|
||
# Patches | ||
|
||
- [`0001-fix-duktapev3-missing-SIZE_MAX-def.patch`](./0001-fix-duktapev3-missing-SIZE_MAX-def.patch) — Adds patch to geth 1.8.0 dependency duktapev3, to address issue where SIZE_MAX is not defined in xgo for Android | ||
- [`0002-remove-dashboard-collectData.patch`](./0002-remove-dashboard-collectData.patch) — Deletes the body of `collectData` in the `dashboard` package, since it will import the `gosigar` package which in turn includes a header (`libproc.h`) which is missing in the iOS environment in Xgo. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.