From b4a4a4db71f17daefc05a36674dd23fbd78fb78c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Tue, 3 Sep 2019 12:12:53 +0300 Subject: [PATCH 01/50] params: begin Geth v1.9.4 release cycle --- params/version.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/params/version.go b/params/version.go index ff491511180d..8d61e42132ff 100644 --- a/params/version.go +++ b/params/version.go @@ -21,10 +21,10 @@ import ( ) const ( - VersionMajor = 1 // Major version component of the current release - VersionMinor = 9 // Minor version component of the current release - VersionPatch = 3 // Patch version component of the current release - VersionMeta = "stable" // Version metadata to append to the version string + VersionMajor = 1 // Major version component of the current release + VersionMinor = 9 // Minor version component of the current release + VersionPatch = 4 // Patch version component of the current release + VersionMeta = "unstable" // Version metadata to append to the version string ) // Version holds the textual version string. From ce2da832ac5fb2c77d35454f567d2ba67ed54c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Wed, 4 Sep 2019 14:46:07 +0300 Subject: [PATCH 02/50] Dockerfile: expose GraphQL ports --- Dockerfile | 2 +- Dockerfile.alltools | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c766576a8f18..b9dcffb7c640 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,5 +12,5 @@ FROM alpine:latest RUN apk add --no-cache ca-certificates COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/ -EXPOSE 8545 8546 30303 30303/udp +EXPOSE 8545 8546 8547 30303 30303/udp ENTRYPOINT ["geth"] diff --git a/Dockerfile.alltools b/Dockerfile.alltools index a4adba9d5b99..721b79de332e 100644 --- a/Dockerfile.alltools +++ b/Dockerfile.alltools @@ -12,4 +12,4 @@ FROM alpine:latest RUN apk add --no-cache ca-certificates COPY --from=builder /go-ethereum/build/bin/* /usr/local/bin/ -EXPOSE 8545 8546 30303 30303/udp +EXPOSE 8545 8546 8547 30303 30303/udp From cea2c804450fa1a6ff36b6a883085d60bf906de6 Mon Sep 17 00:00:00 2001 From: Flash Sheridan Date: Tue, 10 Sep 2019 05:06:26 -0400 Subject: [PATCH 03/50] README: accounts in alloc field should exist (#20005) * Accounts in alloc field must already exist Note that accounts in alloc field must already exist, as pointed out by Simeon Vanov in https://gettoshare.com/2017/10/30/how-to-use-genesis-json-alloc-property/ * Change wording per PR review comment * README: minor fixups --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 87e2328af59a..3bfd24906324 100644 --- a/README.md +++ b/README.md @@ -233,8 +233,8 @@ aware of and agree upon. This consists of a small JSON file (e.g. call it `genes The above fields should be fine for most purposes, although we'd recommend changing the `nonce` to some random value so you prevent unknown remote nodes from being able -to connect to you. If you'd like to pre-fund some accounts for easier testing, you can -populate the `alloc` field with account configs: +to connect to you. If you'd like to pre-fund some accounts for easier testing, create +the accounts and populate the `alloc` field with their addresses. ```json "alloc": { From 49b86a28590917eebf43bce213a2e0586db58755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Tue, 10 Sep 2019 12:20:36 +0300 Subject: [PATCH 04/50] common, graphql: fix hash/address decoding + UI content type --- common/types.go | 4 ++-- graphql/graphiql.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/types.go b/common/types.go index 5cba4e9f3d1f..8ca51a05f8c1 100644 --- a/common/types.go +++ b/common/types.go @@ -149,7 +149,7 @@ func (h *Hash) UnmarshalGraphQL(input interface{}) error { var err error switch input := input.(type) { case string: - *h = HexToHash(input) + err = h.UnmarshalText([]byte(input)) default: err = fmt.Errorf("Unexpected type for Bytes32: %v", input) } @@ -288,7 +288,7 @@ func (a *Address) UnmarshalGraphQL(input interface{}) error { var err error switch input := input.(type) { case string: - *a = HexToAddress(input) + err = a.UnmarshalText([]byte(input)) default: err = fmt.Errorf("Unexpected type for Address: %v", input) } diff --git a/graphql/graphiql.go b/graphql/graphiql.go index 483d4cea3b4e..864ebf57df21 100644 --- a/graphql/graphiql.go +++ b/graphql/graphiql.go @@ -52,7 +52,7 @@ func (h GraphiQL) ServeHTTP(w http.ResponseWriter, r *http.Request) { respond(w, errorJSON("only GET requests are supported"), http.StatusMethodNotAllowed) return } - + w.Header().Set("Content-Type", "text/html") w.Write(graphiql) } From 72d5a27a397f4397082df91dd1650251e828a251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Tue, 10 Sep 2019 14:39:07 +0300 Subject: [PATCH 05/50] core, metrics, p2p: switch some invalid counters to gauges --- core/rawdb/freezer.go | 8 ++--- core/rawdb/freezer_table.go | 22 ++++++------ core/rawdb/freezer_table_test.go | 62 ++++++++++++++++---------------- core/tx_pool.go | 38 ++++++++++---------- metrics/gauge.go | 38 ++++++++++++++++++++ p2p/metrics.go | 10 +++--- 6 files changed, 108 insertions(+), 70 deletions(-) diff --git a/core/rawdb/freezer.go b/core/rawdb/freezer.go index 41677fbba220..5497c59d4908 100644 --- a/core/rawdb/freezer.go +++ b/core/rawdb/freezer.go @@ -80,9 +80,9 @@ type freezer struct { func newFreezer(datadir string, namespace string) (*freezer, error) { // Create the initial freezer object var ( - readMeter = metrics.NewRegisteredMeter(namespace+"ancient/read", nil) - writeMeter = metrics.NewRegisteredMeter(namespace+"ancient/write", nil) - sizeCounter = metrics.NewRegisteredCounter(namespace+"ancient/size", nil) + readMeter = metrics.NewRegisteredMeter(namespace+"ancient/read", nil) + writeMeter = metrics.NewRegisteredMeter(namespace+"ancient/write", nil) + sizeGauge = metrics.NewRegisteredGauge(namespace+"ancient/size", nil) ) // Ensure the datadir is not a symbolic link if it exists. if info, err := os.Lstat(datadir); !os.IsNotExist(err) { @@ -103,7 +103,7 @@ func newFreezer(datadir string, namespace string) (*freezer, error) { instanceLock: lock, } for name, disableSnappy := range freezerNoSnappy { - table, err := newTable(datadir, name, readMeter, writeMeter, sizeCounter, disableSnappy) + table, err := newTable(datadir, name, readMeter, writeMeter, sizeGauge, disableSnappy) if err != nil { for _, table := range freezer.tables { table.Close() diff --git a/core/rawdb/freezer_table.go b/core/rawdb/freezer_table.go index 61804f1f2bcf..9fb341f02558 100644 --- a/core/rawdb/freezer_table.go +++ b/core/rawdb/freezer_table.go @@ -94,18 +94,18 @@ type freezerTable struct { // to count how many historic items have gone missing. itemOffset uint32 // Offset (number of discarded items) - headBytes uint32 // Number of bytes written to the head file - readMeter metrics.Meter // Meter for measuring the effective amount of data read - writeMeter metrics.Meter // Meter for measuring the effective amount of data written - sizeCounter metrics.Counter // Counter for tracking the combined size of all freezer tables + headBytes uint32 // Number of bytes written to the head file + readMeter metrics.Meter // Meter for measuring the effective amount of data read + writeMeter metrics.Meter // Meter for measuring the effective amount of data written + sizeGauge metrics.Gauge // Gauge for tracking the combined size of all freezer tables logger log.Logger // Logger with database path and table name ambedded lock sync.RWMutex // Mutex protecting the data file descriptors } // newTable opens a freezer table with default settings - 2G files -func newTable(path string, name string, readMeter metrics.Meter, writeMeter metrics.Meter, sizeCounter metrics.Counter, disableSnappy bool) (*freezerTable, error) { - return newCustomTable(path, name, readMeter, writeMeter, sizeCounter, 2*1000*1000*1000, disableSnappy) +func newTable(path string, name string, readMeter metrics.Meter, writeMeter metrics.Meter, sizeGauge metrics.Gauge, disableSnappy bool) (*freezerTable, error) { + return newCustomTable(path, name, readMeter, writeMeter, sizeGauge, 2*1000*1000*1000, disableSnappy) } // openFreezerFileForAppend opens a freezer table file and seeks to the end @@ -149,7 +149,7 @@ func truncateFreezerFile(file *os.File, size int64) error { // newCustomTable opens a freezer table, creating the data and index files if they are // non existent. Both files are truncated to the shortest common length to ensure // they don't go out of sync. -func newCustomTable(path string, name string, readMeter metrics.Meter, writeMeter metrics.Meter, sizeCounter metrics.Counter, maxFilesize uint32, noCompression bool) (*freezerTable, error) { +func newCustomTable(path string, name string, readMeter metrics.Meter, writeMeter metrics.Meter, sizeGauge metrics.Gauge, maxFilesize uint32, noCompression bool) (*freezerTable, error) { // Ensure the containing directory exists and open the indexEntry file if err := os.MkdirAll(path, 0755); err != nil { return nil, err @@ -172,7 +172,7 @@ func newCustomTable(path string, name string, readMeter metrics.Meter, writeMete files: make(map[uint32]*os.File), readMeter: readMeter, writeMeter: writeMeter, - sizeCounter: sizeCounter, + sizeGauge: sizeGauge, name: name, path: path, logger: log.New("database", path, "table", name), @@ -189,7 +189,7 @@ func newCustomTable(path string, name string, readMeter metrics.Meter, writeMete tab.Close() return nil, err } - tab.sizeCounter.Inc(int64(size)) + tab.sizeGauge.Inc(int64(size)) return tab, nil } @@ -378,7 +378,7 @@ func (t *freezerTable) truncate(items uint64) error { if err != nil { return err } - t.sizeCounter.Dec(int64(oldSize - newSize)) + t.sizeGauge.Dec(int64(oldSize - newSize)) return nil } @@ -510,7 +510,7 @@ func (t *freezerTable) Append(item uint64, blob []byte) error { t.index.Write(idx.marshallBinary()) t.writeMeter.Mark(int64(bLen + indexEntrySize)) - t.sizeCounter.Inc(int64(bLen + indexEntrySize)) + t.sizeGauge.Inc(int64(bLen + indexEntrySize)) atomic.AddUint64(&t.items, 1) return nil diff --git a/core/rawdb/freezer_table_test.go b/core/rawdb/freezer_table_test.go index 61ba7a17e28b..7de10815176c 100644 --- a/core/rawdb/freezer_table_test.go +++ b/core/rawdb/freezer_table_test.go @@ -56,7 +56,7 @@ func TestFreezerBasics(t *testing.T) { // set cutoff at 50 bytes f, err := newCustomTable(os.TempDir(), fmt.Sprintf("unittest-%d", rand.Uint64()), - metrics.NewMeter(), metrics.NewMeter(), metrics.NewCounter(), 50, true) + metrics.NewMeter(), metrics.NewMeter(), metrics.NewGauge(), 50, true) if err != nil { t.Fatal(err) } @@ -99,11 +99,11 @@ func TestFreezerBasicsClosing(t *testing.T) { // set cutoff at 50 bytes var ( fname = fmt.Sprintf("basics-close-%d", rand.Uint64()) - rm, wm, sc = metrics.NewMeter(), metrics.NewMeter(), metrics.NewCounter() + rm, wm, sg = metrics.NewMeter(), metrics.NewMeter(), metrics.NewGauge() f *freezerTable err error ) - f, err = newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, err = newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) if err != nil { t.Fatal(err) } @@ -112,7 +112,7 @@ func TestFreezerBasicsClosing(t *testing.T) { data := getChunk(15, x) f.Append(uint64(x), data) f.Close() - f, err = newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, err = newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) if err != nil { t.Fatal(err) } @@ -129,7 +129,7 @@ func TestFreezerBasicsClosing(t *testing.T) { t.Fatalf("test %d, got \n%x != \n%x", y, got, exp) } f.Close() - f, err = newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, err = newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) if err != nil { t.Fatal(err) } @@ -139,11 +139,11 @@ func TestFreezerBasicsClosing(t *testing.T) { // TestFreezerRepairDanglingHead tests that we can recover if index entries are removed func TestFreezerRepairDanglingHead(t *testing.T) { t.Parallel() - rm, wm, sc := metrics.NewMeter(), metrics.NewMeter(), metrics.NewCounter() + rm, wm, sg := metrics.NewMeter(), metrics.NewMeter(), metrics.NewGauge() fname := fmt.Sprintf("dangling_headtest-%d", rand.Uint64()) { // Fill table - f, err := newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) if err != nil { t.Fatal(err) } @@ -172,7 +172,7 @@ func TestFreezerRepairDanglingHead(t *testing.T) { idxFile.Close() // Now open it again { - f, err := newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) if err != nil { t.Fatal(err) } @@ -190,11 +190,11 @@ func TestFreezerRepairDanglingHead(t *testing.T) { // TestFreezerRepairDanglingHeadLarge tests that we can recover if very many index entries are removed func TestFreezerRepairDanglingHeadLarge(t *testing.T) { t.Parallel() - rm, wm, sc := metrics.NewMeter(), metrics.NewMeter(), metrics.NewCounter() + rm, wm, sg := metrics.NewMeter(), metrics.NewMeter(), metrics.NewGauge() fname := fmt.Sprintf("dangling_headtest-%d", rand.Uint64()) { // Fill a table and close it - f, err := newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) if err != nil { t.Fatal(err) } @@ -222,7 +222,7 @@ func TestFreezerRepairDanglingHeadLarge(t *testing.T) { idxFile.Close() // Now open it again { - f, err := newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) if err != nil { t.Fatal(err) } @@ -243,7 +243,7 @@ func TestFreezerRepairDanglingHeadLarge(t *testing.T) { } // And if we open it, we should now be able to read all of them (new values) { - f, _ := newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, _ := newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) for y := 1; y < 255; y++ { exp := getChunk(15, ^y) got, err := f.Retrieve(uint64(y)) @@ -260,11 +260,11 @@ func TestFreezerRepairDanglingHeadLarge(t *testing.T) { // TestSnappyDetection tests that we fail to open a snappy database and vice versa func TestSnappyDetection(t *testing.T) { t.Parallel() - rm, wm, sc := metrics.NewMeter(), metrics.NewMeter(), metrics.NewCounter() + rm, wm, sg := metrics.NewMeter(), metrics.NewMeter(), metrics.NewGauge() fname := fmt.Sprintf("snappytest-%d", rand.Uint64()) // Open with snappy { - f, err := newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) if err != nil { t.Fatal(err) } @@ -277,7 +277,7 @@ func TestSnappyDetection(t *testing.T) { } // Open without snappy { - f, err := newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, false) + f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, false) if err != nil { t.Fatal(err) } @@ -289,7 +289,7 @@ func TestSnappyDetection(t *testing.T) { // Open with snappy { - f, err := newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) if err != nil { t.Fatal(err) } @@ -317,11 +317,11 @@ func assertFileSize(f string, size int64) error { // the index is repaired func TestFreezerRepairDanglingIndex(t *testing.T) { t.Parallel() - rm, wm, sc := metrics.NewMeter(), metrics.NewMeter(), metrics.NewCounter() + rm, wm, sg := metrics.NewMeter(), metrics.NewMeter(), metrics.NewGauge() fname := fmt.Sprintf("dangling_indextest-%d", rand.Uint64()) { // Fill a table and close it - f, err := newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) if err != nil { t.Fatal(err) } @@ -357,7 +357,7 @@ func TestFreezerRepairDanglingIndex(t *testing.T) { // 45, 45, 15 // with 3+3+1 items { - f, err := newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) if err != nil { t.Fatal(err) } @@ -374,11 +374,11 @@ func TestFreezerRepairDanglingIndex(t *testing.T) { func TestFreezerTruncate(t *testing.T) { t.Parallel() - rm, wm, sc := metrics.NewMeter(), metrics.NewMeter(), metrics.NewCounter() + rm, wm, sg := metrics.NewMeter(), metrics.NewMeter(), metrics.NewGauge() fname := fmt.Sprintf("truncation-%d", rand.Uint64()) { // Fill table - f, err := newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) if err != nil { t.Fatal(err) } @@ -395,7 +395,7 @@ func TestFreezerTruncate(t *testing.T) { } // Reopen, truncate { - f, err := newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) if err != nil { t.Fatal(err) } @@ -417,10 +417,10 @@ func TestFreezerTruncate(t *testing.T) { // That will rewind the index, and _should_ truncate the head file func TestFreezerRepairFirstFile(t *testing.T) { t.Parallel() - rm, wm, sc := metrics.NewMeter(), metrics.NewMeter(), metrics.NewCounter() + rm, wm, sg := metrics.NewMeter(), metrics.NewMeter(), metrics.NewGauge() fname := fmt.Sprintf("truncationfirst-%d", rand.Uint64()) { // Fill table - f, err := newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) if err != nil { t.Fatal(err) } @@ -448,7 +448,7 @@ func TestFreezerRepairFirstFile(t *testing.T) { } // Reopen { - f, err := newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) if err != nil { t.Fatal(err) } @@ -473,10 +473,10 @@ func TestFreezerRepairFirstFile(t *testing.T) { // - check that we did not keep the rdonly file descriptors func TestFreezerReadAndTruncate(t *testing.T) { t.Parallel() - rm, wm, sc := metrics.NewMeter(), metrics.NewMeter(), metrics.NewCounter() + rm, wm, sg := metrics.NewMeter(), metrics.NewMeter(), metrics.NewGauge() fname := fmt.Sprintf("read_truncate-%d", rand.Uint64()) { // Fill table - f, err := newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) if err != nil { t.Fatal(err) } @@ -493,7 +493,7 @@ func TestFreezerReadAndTruncate(t *testing.T) { } // Reopen and read all files { - f, err := newCustomTable(os.TempDir(), fname, rm, wm, sc, 50, true) + f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 50, true) if err != nil { t.Fatal(err) } @@ -519,10 +519,10 @@ func TestFreezerReadAndTruncate(t *testing.T) { func TestOffset(t *testing.T) { t.Parallel() - rm, wm, sc := metrics.NewMeter(), metrics.NewMeter(), metrics.NewCounter() + rm, wm, sg := metrics.NewMeter(), metrics.NewMeter(), metrics.NewGauge() fname := fmt.Sprintf("offset-%d", rand.Uint64()) { // Fill table - f, err := newCustomTable(os.TempDir(), fname, rm, wm, sc, 40, true) + f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 40, true) if err != nil { t.Fatal(err) } @@ -578,7 +578,7 @@ func TestOffset(t *testing.T) { } // Now open again { - f, err := newCustomTable(os.TempDir(), fname, rm, wm, sc, 40, true) + f, err := newCustomTable(os.TempDir(), fname, rm, wm, sg, 40, true) if err != nil { t.Fatal(err) } diff --git a/core/tx_pool.go b/core/tx_pool.go index a49b42261421..161489cc5a99 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -101,9 +101,9 @@ var ( invalidTxMeter = metrics.NewRegisteredMeter("txpool/invalid", nil) underpricedTxMeter = metrics.NewRegisteredMeter("txpool/underpriced", nil) - pendingCounter = metrics.NewRegisteredCounter("txpool/pending", nil) - queuedCounter = metrics.NewRegisteredCounter("txpool/queued", nil) - localCounter = metrics.NewRegisteredCounter("txpool/local", nil) + pendingGauge = metrics.NewRegisteredGauge("txpool/pending", nil) + queuedGauge = metrics.NewRegisteredGauge("txpool/queued", nil) + localGauge = metrics.NewRegisteredGauge("txpool/local", nil) ) // TxStatus is the current status of a transaction as seen by the pool. @@ -628,7 +628,7 @@ func (pool *TxPool) add(tx *types.Transaction, local bool) (replaced bool, err e } } if local || pool.locals.contains(from) { - localCounter.Inc(1) + localGauge.Inc(1) } pool.journalTx(from, tx) @@ -658,7 +658,7 @@ func (pool *TxPool) enqueueTx(hash common.Hash, tx *types.Transaction) (bool, er queuedReplaceMeter.Mark(1) } else { // Nothing was replaced, bump the queued counter - queuedCounter.Inc(1) + queuedGauge.Inc(1) } if pool.all.Get(hash) == nil { pool.all.Add(tx) @@ -707,7 +707,7 @@ func (pool *TxPool) promoteTx(addr common.Address, hash common.Hash, tx *types.T pendingReplaceMeter.Mark(1) } else { // Nothing was replaced, bump the pending counter - pendingCounter.Inc(1) + pendingGauge.Inc(1) } // Failsafe to work around direct pending inserts (tests) if pool.all.Get(hash) == nil { @@ -841,7 +841,7 @@ func (pool *TxPool) removeTx(hash common.Hash, outofbound bool) { pool.priced.Removed(1) } if pool.locals.contains(addr) { - localCounter.Dec(1) + localGauge.Dec(1) } // Remove the transaction from the pending lists and reset the account nonce if pending := pool.pending[addr]; pending != nil { @@ -858,7 +858,7 @@ func (pool *TxPool) removeTx(hash common.Hash, outofbound bool) { // Update the account nonce if needed pool.pendingNonces.setIfLower(addr, tx.Nonce()) // Reduce the pending counter - pendingCounter.Dec(int64(1 + len(invalids))) + pendingGauge.Dec(int64(1 + len(invalids))) return } } @@ -866,7 +866,7 @@ func (pool *TxPool) removeTx(hash common.Hash, outofbound bool) { if future := pool.queue[addr]; future != nil { if removed, _ := future.Remove(tx); removed { // Reduce the queued counter - queuedCounter.Dec(1) + queuedGauge.Dec(1) } if future.Empty() { delete(pool.queue, addr) @@ -1164,7 +1164,7 @@ func (pool *TxPool) promoteExecutables(accounts []common.Address) []*types.Trans promoted = append(promoted, tx) } } - queuedCounter.Dec(int64(len(readies))) + queuedGauge.Dec(int64(len(readies))) // Drop all transactions over the allowed limit var caps types.Transactions @@ -1179,9 +1179,9 @@ func (pool *TxPool) promoteExecutables(accounts []common.Address) []*types.Trans } // Mark all the items dropped as removed pool.priced.Removed(len(forwards) + len(drops) + len(caps)) - queuedCounter.Dec(int64(len(forwards) + len(drops) + len(caps))) + queuedGauge.Dec(int64(len(forwards) + len(drops) + len(caps))) if pool.locals.contains(addr) { - localCounter.Dec(int64(len(forwards) + len(drops) + len(caps))) + localGauge.Dec(int64(len(forwards) + len(drops) + len(caps))) } // Delete the entire queue entry if it became empty. if list.Empty() { @@ -1240,9 +1240,9 @@ func (pool *TxPool) truncatePending() { log.Trace("Removed fairness-exceeding pending transaction", "hash", hash) } pool.priced.Removed(len(caps)) - pendingCounter.Dec(int64(len(caps))) + pendingGauge.Dec(int64(len(caps))) if pool.locals.contains(offenders[i]) { - localCounter.Dec(int64(len(caps))) + localGauge.Dec(int64(len(caps))) } pending-- } @@ -1267,9 +1267,9 @@ func (pool *TxPool) truncatePending() { log.Trace("Removed fairness-exceeding pending transaction", "hash", hash) } pool.priced.Removed(len(caps)) - pendingCounter.Dec(int64(len(caps))) + pendingGauge.Dec(int64(len(caps))) if pool.locals.contains(addr) { - localCounter.Dec(int64(len(caps))) + localGauge.Dec(int64(len(caps))) } pending-- } @@ -1353,9 +1353,9 @@ func (pool *TxPool) demoteUnexecutables() { log.Trace("Demoting pending transaction", "hash", hash) pool.enqueueTx(hash, tx) } - pendingCounter.Dec(int64(len(olds) + len(drops) + len(invalids))) + pendingGauge.Dec(int64(len(olds) + len(drops) + len(invalids))) if pool.locals.contains(addr) { - localCounter.Dec(int64(len(olds) + len(drops) + len(invalids))) + localGauge.Dec(int64(len(olds) + len(drops) + len(invalids))) } // If there's a gap in front, alert (should never happen) and postpone all transactions if list.Len() > 0 && list.txs.Get(nonce) == nil { @@ -1365,7 +1365,7 @@ func (pool *TxPool) demoteUnexecutables() { log.Error("Demoting invalidated transaction", "hash", hash) pool.enqueueTx(hash, tx) } - pendingCounter.Dec(int64(len(gapped))) + pendingGauge.Dec(int64(len(gapped))) } // Delete the entire queue entry if it became empty. if list.Empty() { diff --git a/metrics/gauge.go b/metrics/gauge.go index 0fbfdb86033b..b6b2758b0d13 100644 --- a/metrics/gauge.go +++ b/metrics/gauge.go @@ -6,6 +6,8 @@ import "sync/atomic" type Gauge interface { Snapshot() Gauge Update(int64) + Dec(int64) + Inc(int64) Value() int64 } @@ -65,6 +67,16 @@ func (GaugeSnapshot) Update(int64) { panic("Update called on a GaugeSnapshot") } +// Dec panics. +func (GaugeSnapshot) Dec(int64) { + panic("Dec called on a GaugeSnapshot") +} + +// Inc panics. +func (GaugeSnapshot) Inc(int64) { + panic("Inc called on a GaugeSnapshot") +} + // Value returns the value at the time the snapshot was taken. func (g GaugeSnapshot) Value() int64 { return int64(g) } @@ -77,6 +89,12 @@ func (NilGauge) Snapshot() Gauge { return NilGauge{} } // Update is a no-op. func (NilGauge) Update(v int64) {} +// Dec is a no-op. +func (NilGauge) Dec(i int64) {} + +// Inc is a no-op. +func (NilGauge) Inc(i int64) {} + // Value is a no-op. func (NilGauge) Value() int64 { return 0 } @@ -101,6 +119,16 @@ func (g *StandardGauge) Value() int64 { return atomic.LoadInt64(&g.value) } +// Dec decrements the gauge's current value by the given amount. +func (g *StandardGauge) Dec(i int64) { + atomic.AddInt64(&g.value, -i) +} + +// Inc increments the gauge's current value by the given amount. +func (g *StandardGauge) Inc(i int64) { + atomic.AddInt64(&g.value, i) +} + // FunctionalGauge returns value from given function type FunctionalGauge struct { value func() int64 @@ -118,3 +146,13 @@ func (g FunctionalGauge) Snapshot() Gauge { return GaugeSnapshot(g.Value()) } func (FunctionalGauge) Update(int64) { panic("Update called on a FunctionalGauge") } + +// Dec panics. +func (FunctionalGauge) Dec(int64) { + panic("Dec called on a FunctionalGauge") +} + +// Inc panics. +func (FunctionalGauge) Inc(int64) { + panic("Inc called on a FunctionalGauge") +} diff --git a/p2p/metrics.go b/p2p/metrics.go index c04e5ab4c3ad..8b29efdcdbd6 100644 --- a/p2p/metrics.go +++ b/p2p/metrics.go @@ -45,7 +45,7 @@ var ( ingressTrafficMeter = metrics.NewRegisteredMeter(MetricsInboundTraffic, nil) // Meter metering the cumulative ingress traffic egressConnectMeter = metrics.NewRegisteredMeter(MetricsOutboundConnects, nil) // Meter counting the egress connections egressTrafficMeter = metrics.NewRegisteredMeter(MetricsOutboundTraffic, nil) // Meter metering the cumulative egress traffic - activePeerCounter = metrics.NewRegisteredCounter("p2p/peers", nil) // Gauge tracking the current peer count + activePeerGauge = metrics.NewRegisteredGauge("p2p/peers", nil) // Gauge tracking the current peer count PeerIngressRegistry = metrics.NewPrefixedChildRegistry(metrics.EphemeralRegistry, MetricsInboundTraffic+"/") // Registry containing the peer ingress PeerEgressRegistry = metrics.NewPrefixedChildRegistry(metrics.EphemeralRegistry, MetricsOutboundTraffic+"/") // Registry containing the peer egress @@ -124,7 +124,7 @@ func newMeteredConn(conn net.Conn, ingress bool, ip net.IP) net.Conn { } else { egressConnectMeter.Mark(1) } - activePeerCounter.Inc(1) + activePeerGauge.Inc(1) return &meteredConn{ Conn: conn, @@ -200,7 +200,7 @@ func (c *meteredConn) Close() error { IP: c.ip, Elapsed: time.Since(c.connected), }) - activePeerCounter.Dec(1) + activePeerGauge.Dec(1) return err } id := c.id @@ -212,7 +212,7 @@ func (c *meteredConn) Close() error { IP: c.ip, ID: id, }) - activePeerCounter.Dec(1) + activePeerGauge.Dec(1) return err } ingress, egress := uint64(c.ingressMeter.Count()), uint64(c.egressMeter.Count()) @@ -233,6 +233,6 @@ func (c *meteredConn) Close() error { Ingress: ingress, Egress: egress, }) - activePeerCounter.Dec(1) + activePeerGauge.Dec(1) return err } From 72045dff4f766d4b8332f126e377ab54a683276e Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Thu, 5 Sep 2019 13:19:55 +0200 Subject: [PATCH 06/50] core/state: optimize some internals during encoding --- common/bytes.go | 11 ++++++ core/state/state_object.go | 2 +- core/state/state_object_test.go | 70 +++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 core/state/state_object_test.go diff --git a/common/bytes.go b/common/bytes.go index 910c97d3c111..fa457b92cf3a 100644 --- a/common/bytes.go +++ b/common/bytes.go @@ -134,3 +134,14 @@ func LeftPadBytes(slice []byte, l int) []byte { return padded } + +// TrimLeftZeroes returns a subslice of s without leading zeroes +func TrimLeftZeroes(s []byte) []byte { + idx := 0 + for ; idx < len(s); idx++ { + if s[idx] != 0 { + break + } + } + return s[idx:] +} diff --git a/core/state/state_object.go b/core/state/state_object.go index 45ae95a2a92c..4967c7046508 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -274,7 +274,7 @@ func (s *stateObject) updateTrie(db Database) Trie { continue } // Encoding []byte cannot fail, ok to ignore the error. - v, _ := rlp.EncodeToBytes(bytes.TrimLeft(value[:], "\x00")) + v, _ := rlp.EncodeToBytes(common.TrimLeftZeroes(value[:])) s.setError(tr.TryUpdate(key[:], v)) } return tr diff --git a/core/state/state_object_test.go b/core/state/state_object_test.go new file mode 100644 index 000000000000..e86d3b994371 --- /dev/null +++ b/core/state/state_object_test.go @@ -0,0 +1,70 @@ +// Copyright 2019 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + +package state + +import ( + "bytes" + "fmt" + "math/rand" + "testing" + "time" + + "github.com/ethereum/go-ethereum/common" +) + +func BenchmarkCutOriginal(b *testing.B) { + value := common.HexToHash("0x01") + for i := 0; i < b.N; i++ { + bytes.TrimLeft(value[:], "\x00") + } +} + +func BenchmarkCutsetterFn(b *testing.B) { + value := common.HexToHash("0x01") + cutSetFn := func(r rune) bool { + return int32(r) == int32(0) + } + for i := 0; i < b.N; i++ { + bytes.TrimLeftFunc(value[:], cutSetFn) + } +} + +func BenchmarkCutCustomTrim(b *testing.B) { + value := common.HexToHash("0x01") + for i := 0; i < b.N; i++ { + common.TrimLeftZeroes(value[:]) + } +} + +func xTestFuzzCutter(t *testing.T) { + rand.Seed(time.Now().Unix()) + for { + v := make([]byte, 20) + zeroes := rand.Intn(21) + rand.Read(v[zeroes:]) + exp := bytes.TrimLeft(v[:], "\x00") + got := common.TrimLeftZeroes(v) + if !bytes.Equal(exp, got) { + + fmt.Printf("Input %x\n", v) + fmt.Printf("Exp %x\n", exp) + fmt.Printf("Got %x\n", got) + t.Fatalf("Error") + } + //break + } +} From 52a967cfab1f01120a4324e25c655a5a1497fcd3 Mon Sep 17 00:00:00 2001 From: Nguyen Kien Trung Date: Tue, 10 Sep 2019 18:38:42 -0400 Subject: [PATCH 07/50] eth: remove unused field (#20049) --- eth/backend.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/eth/backend.go b/eth/backend.go index ce37541f4d1f..83e05e96a88e 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -69,8 +69,6 @@ type Ethereum struct { // Channel for shutting down the service shutdownChan chan bool - server *p2p.Server - // Handlers txPool *core.TxPool blockchain *core.BlockChain From 91b73495098c7941e3eb1c58a702952bf5acf1a6 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Wed, 11 Sep 2019 13:46:14 +0200 Subject: [PATCH 08/50] tests: expose internal RunNoVerify method (#20051) --- tests/state_test_util.go | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/tests/state_test_util.go b/tests/state_test_util.go index c6341e5248eb..59ebcb6e1ec2 100644 --- a/tests/state_test_util.go +++ b/tests/state_test_util.go @@ -144,11 +144,29 @@ func (t *StateTest) Subtests() []StateSubtest { return sub } -// Run executes a specific subtest. +// Run executes a specific subtest and verifies the post-state and logs func (t *StateTest) Run(subtest StateSubtest, vmconfig vm.Config) (*state.StateDB, error) { + statedb, root, err := t.RunNoVerify(subtest, vmconfig) + if err != nil { + return statedb, err + } + post := t.json.Post[subtest.Fork][subtest.Index] + // N.B: We need to do this in a two-step process, because the first Commit takes care + // of suicides, and we need to touch the coinbase _after_ it has potentially suicided. + if root != common.Hash(post.Root) { + return statedb, fmt.Errorf("post state root mismatch: got %x, want %x", root, post.Root) + } + if logs := rlpHash(statedb.Logs()); logs != common.Hash(post.Logs) { + return statedb, fmt.Errorf("post state logs hash mismatch: got %x, want %x", logs, post.Logs) + } + return statedb, nil +} + +// RunNoVerify runs a specific subtest and returns the statedb and post-state root +func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config) (*state.StateDB, common.Hash, error) { config, eips, err := getVMConfig(subtest.Fork) if err != nil { - return nil, UnsupportedForkError{subtest.Fork} + return nil, common.Hash{}, UnsupportedForkError{subtest.Fork} } vmconfig.ExtraEips = eips block := t.genesis(config).ToBlock(nil) @@ -157,7 +175,7 @@ func (t *StateTest) Run(subtest StateSubtest, vmconfig vm.Config) (*state.StateD post := t.json.Post[subtest.Fork][subtest.Index] msg, err := t.json.Tx.toMessage(post) if err != nil { - return nil, err + return nil, common.Hash{}, err } context := core.NewEVMContext(msg, block.Header(), nil, &t.json.Env.Coinbase) context.GetHash = vmTestBlockHash @@ -179,15 +197,7 @@ func (t *StateTest) Run(subtest StateSubtest, vmconfig vm.Config) (*state.StateD statedb.AddBalance(block.Coinbase(), new(big.Int)) // And _now_ get the state root root := statedb.IntermediateRoot(config.IsEIP158(block.Number())) - // N.B: We need to do this in a two-step process, because the first Commit takes care - // of suicides, and we need to touch the coinbase _after_ it has potentially suicided. - if root != common.Hash(post.Root) { - return statedb, fmt.Errorf("post state root mismatch: got %x, want %x", root, post.Root) - } - if logs := rlpHash(statedb.Logs()); logs != common.Hash(post.Logs) { - return statedb, fmt.Errorf("post state logs hash mismatch: got %x, want %x", logs, post.Logs) - } - return statedb, nil + return statedb, root, nil } func (t *StateTest) gasLimit(subtest StateSubtest) uint64 { From 39b0b1a1a6506c8c25fcff56f4d70a85739dcb6a Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 11 Sep 2019 14:41:22 +0200 Subject: [PATCH 09/50] all: make unit tests work with Go 1.13 (#20053) Most of these changes are related to the Go 1.13 changes to test binary flag handling. * cmd/geth: make attach tests more reliable This makes the test wait for the endpoint to come up by polling it instead of waiting for two seconds. * tests: fix test binary flags for Go 1.13 Calling flag.Parse during package initialization is prohibited as of Go 1.13 and causes test failures. Call it in TestMain instead. * crypto/ecies: remove useless -dump flag in tests * p2p/simulations: fix test binary flags for Go 1.13 Calling flag.Parse during package initialization is prohibited as of Go 1.13 and causes test failures. Call it in TestMain instead. * build: remove workaround for ./... vendor matching This workaround was necessary for Go 1.8. The Go 1.9 release changed the expansion rules to exclude vendored packages. * Makefile: use relative path for GOBIN This makes the "Run ./build/bin/..." line look nicer. * les: fix test binary flags for Go 1.13 Calling flag.Parse during package initialization is prohibited as of Go 1.13 and causes test failures. Call it in TestMain instead. --- Makefile | 2 +- build/ci.go | 2 -- cmd/geth/consolecmd_test.go | 12 ++++++----- cmd/geth/run_test.go | 28 ++++++++++++++++++++++++ crypto/ecies/ecies_test.go | 9 -------- internal/build/util.go | 26 ---------------------- les/api_test.go | 42 +++++++++++++++++------------------- p2p/simulations/http_test.go | 9 ++++---- tests/init_test.go | 12 +++++++++++ tests/state_test.go | 20 ++++++----------- 10 files changed, 79 insertions(+), 83 deletions(-) diff --git a/Makefile b/Makefile index 4bf52f5c9626..5d4a82de83c3 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ .PHONY: geth-darwin geth-darwin-386 geth-darwin-amd64 .PHONY: geth-windows geth-windows-386 geth-windows-amd64 -GOBIN = $(shell pwd)/build/bin +GOBIN = ./build/bin GO ?= latest geth: diff --git a/build/ci.go b/build/ci.go index d4e2814ec844..002f6bb15297 100644 --- a/build/ci.go +++ b/build/ci.go @@ -214,7 +214,6 @@ func doInstall(cmdline []string) { if flag.NArg() > 0 { packages = flag.Args() } - packages = build.ExpandPackagesNoVendor(packages) if *arch == "" || *arch == runtime.GOARCH { goinstall := goTool("install", buildFlags(env)...) @@ -311,7 +310,6 @@ func doTest(cmdline []string) { if len(flag.CommandLine.Args()) > 0 { packages = flag.CommandLine.Args() } - packages = build.ExpandPackagesNoVendor(packages) // Run the actual tests. // Test a single package at a time. CI builders are slow diff --git a/cmd/geth/consolecmd_test.go b/cmd/geth/consolecmd_test.go index 4360451195b1..33c83b7ede82 100644 --- a/cmd/geth/consolecmd_test.go +++ b/cmd/geth/consolecmd_test.go @@ -87,7 +87,7 @@ func TestIPCAttachWelcome(t *testing.T) { "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", "--etherbase", coinbase, "--shh", "--ipcpath", ipc) - time.Sleep(2 * time.Second) // Simple way to wait for the RPC endpoint to open + waitForEndpoint(t, ipc, 3*time.Second) testAttachWelcome(t, geth, "ipc:"+ipc, ipcAPIs) geth.Interrupt() @@ -101,8 +101,9 @@ func TestHTTPAttachWelcome(t *testing.T) { "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", "--etherbase", coinbase, "--rpc", "--rpcport", port) - time.Sleep(2 * time.Second) // Simple way to wait for the RPC endpoint to open - testAttachWelcome(t, geth, "http://localhost:"+port, httpAPIs) + endpoint := "http://127.0.0.1:" + port + waitForEndpoint(t, endpoint, 3*time.Second) + testAttachWelcome(t, geth, endpoint, httpAPIs) geth.Interrupt() geth.ExpectExit() @@ -116,8 +117,9 @@ func TestWSAttachWelcome(t *testing.T) { "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", "--etherbase", coinbase, "--ws", "--wsport", port) - time.Sleep(2 * time.Second) // Simple way to wait for the RPC endpoint to open - testAttachWelcome(t, geth, "ws://localhost:"+port, httpAPIs) + endpoint := "ws://127.0.0.1:" + port + waitForEndpoint(t, endpoint, 3*time.Second) + testAttachWelcome(t, geth, endpoint, httpAPIs) geth.Interrupt() geth.ExpectExit() diff --git a/cmd/geth/run_test.go b/cmd/geth/run_test.go index da82facac36e..f7b735b84c14 100644 --- a/cmd/geth/run_test.go +++ b/cmd/geth/run_test.go @@ -17,13 +17,16 @@ package main import ( + "context" "fmt" "io/ioutil" "os" "testing" + "time" "github.com/docker/docker/pkg/reexec" "github.com/ethereum/go-ethereum/internal/cmdtest" + "github.com/ethereum/go-ethereum/rpc" ) func tmpdir(t *testing.T) string { @@ -96,3 +99,28 @@ func runGeth(t *testing.T, args ...string) *testgeth { return tt } + +// waitForEndpoint attempts to connect to an RPC endpoint until it succeeds. +func waitForEndpoint(t *testing.T, endpoint string, timeout time.Duration) { + probe := func() bool { + ctx, cancel := context.WithTimeout(context.Background(), timeout) + defer cancel() + c, err := rpc.DialContext(ctx, endpoint) + if c != nil { + _, err = c.SupportedModules() + c.Close() + } + return err == nil + } + + start := time.Now() + for { + if probe() { + return + } + if time.Since(start) > timeout { + t.Fatal("endpoint", endpoint, "did not open within", timeout) + } + time.Sleep(200 * time.Millisecond) + } +} diff --git a/crypto/ecies/ecies_test.go b/crypto/ecies/ecies_test.go index 2836b8126070..2def505d0c0b 100644 --- a/crypto/ecies/ecies_test.go +++ b/crypto/ecies/ecies_test.go @@ -35,7 +35,6 @@ import ( "crypto/rand" "crypto/sha256" "encoding/hex" - "flag" "fmt" "math/big" "testing" @@ -43,14 +42,6 @@ import ( "github.com/ethereum/go-ethereum/crypto" ) -var dumpEnc bool - -func init() { - flDump := flag.Bool("dump", false, "write encrypted test message to file") - flag.Parse() - dumpEnc = *flDump -} - // Ensure the KDF generates appropriately sized keys. func TestKDF(t *testing.T) { msg := []byte("Hello, world") diff --git a/internal/build/util.go b/internal/build/util.go index 971d948c44e5..a1f4567776bf 100644 --- a/internal/build/util.go +++ b/internal/build/util.go @@ -153,32 +153,6 @@ func GoTool(tool string, args ...string) *exec.Cmd { return exec.Command(filepath.Join(runtime.GOROOT(), "bin", "go"), args...) } -// ExpandPackagesNoVendor expands a cmd/go import path pattern, skipping -// vendored packages. -func ExpandPackagesNoVendor(patterns []string) []string { - expand := false - for _, pkg := range patterns { - if strings.Contains(pkg, "...") { - expand = true - } - } - if expand { - cmd := GoTool("list", patterns...) - out, err := cmd.CombinedOutput() - if err != nil { - log.Fatalf("package listing failed: %v\n%s", err, string(out)) - } - var packages []string - for _, line := range strings.Split(string(out), "\n") { - if !strings.Contains(line, "/vendor/") { - packages = append(packages, strings.TrimSpace(line)) - } - } - return packages - } - return patterns -} - // UploadSFTP uploads files to a remote host using the sftp command line tool. // The destination host may be specified either as [user@]host[: or as a URI in // the form sftp://[user@]host[:port]. diff --git a/les/api_test.go b/les/api_test.go index 7d3b4ce5daf9..660af8eeecb9 100644 --- a/les/api_test.go +++ b/les/api_test.go @@ -43,11 +43,25 @@ import ( "github.com/mattn/go-colorable" ) -/* -This test is not meant to be a part of the automatic testing process because it -runs for a long time and also requires a large database in order to do a meaningful -request performance test. When testServerDataDir is empty, the test is skipped. -*/ +// Additional command line flags for the test binary. +var ( + loglevel = flag.Int("loglevel", 0, "verbosity of logs") + simAdapter = flag.String("adapter", "exec", "type of simulation: sim|socket|exec|docker") +) + +func TestMain(m *testing.M) { + flag.Parse() + log.PrintOrigins(true) + log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(*loglevel), log.StreamHandler(colorable.NewColorableStderr(), log.TerminalFormat(true)))) + // register the Delivery service which will run as a devp2p + // protocol when using the exec adapter + adapters.RegisterServices(services) + os.Exit(m.Run()) +} + +// This test is not meant to be a part of the automatic testing process because it +// runs for a long time and also requires a large database in order to do a meaningful +// request performance test. When testServerDataDir is empty, the test is skipped. const ( testServerDataDir = "" // should always be empty on the master branch @@ -377,29 +391,13 @@ func getCapacityInfo(ctx context.Context, t *testing.T, server *rpc.Client) (min return } -func init() { - flag.Parse() - // register the Delivery service which will run as a devp2p - // protocol when using the exec adapter - adapters.RegisterServices(services) - - log.PrintOrigins(true) - log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(*loglevel), log.StreamHandler(colorable.NewColorableStderr(), log.TerminalFormat(true)))) -} - -var ( - adapter = flag.String("adapter", "exec", "type of simulation: sim|socket|exec|docker") - loglevel = flag.Int("loglevel", 0, "verbosity of logs") - nodes = flag.Int("nodes", 0, "number of nodes") -) - var services = adapters.Services{ "lesclient": newLesClientService, "lesserver": newLesServerService, } func NewNetwork() (*simulations.Network, func(), error) { - adapter, adapterTeardown, err := NewAdapter(*adapter, services) + adapter, adapterTeardown, err := NewAdapter(*simAdapter, services) if err != nil { return nil, adapterTeardown, err } diff --git a/p2p/simulations/http_test.go b/p2p/simulations/http_test.go index ed43c0ed76a2..84f6ce2a517c 100644 --- a/p2p/simulations/http_test.go +++ b/p2p/simulations/http_test.go @@ -22,6 +22,7 @@ import ( "fmt" "math/rand" "net/http/httptest" + "os" "reflect" "sync" "sync/atomic" @@ -38,15 +39,13 @@ import ( "github.com/mattn/go-colorable" ) -var ( - loglevel = flag.Int("loglevel", 2, "verbosity of logs") -) +func TestMain(m *testing.M) { + loglevel := flag.Int("loglevel", 2, "verbosity of logs") -func init() { flag.Parse() - log.PrintOrigins(true) log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(*loglevel), log.StreamHandler(colorable.NewColorableStderr(), log.TerminalFormat(true)))) + os.Exit(m.Run()) } // testService implements the node.Service interface and provides protocols diff --git a/tests/init_test.go b/tests/init_test.go index 053cbd6fcd39..d715de02fbe0 100644 --- a/tests/init_test.go +++ b/tests/init_test.go @@ -18,6 +18,7 @@ package tests import ( "encoding/json" + "flag" "fmt" "io" "io/ioutil" @@ -33,6 +34,17 @@ import ( "github.com/ethereum/go-ethereum/params" ) +// Command line flags to configure the interpreters. +var ( + testEVM = flag.String("vm.evm", "", "EVM configuration") + testEWASM = flag.String("vm.ewasm", "", "EWASM configuration") +) + +func TestMain(m *testing.M) { + flag.Parse() + os.Exit(m.Run()) +} + var ( baseDir = filepath.Join(".", "testdata") blockTestDir = filepath.Join(baseDir, "BlockchainTests") diff --git a/tests/state_test.go b/tests/state_test.go index 0cf124d727f4..d25b157275b4 100644 --- a/tests/state_test.go +++ b/tests/state_test.go @@ -19,12 +19,10 @@ package tests import ( "bufio" "bytes" - "flag" "fmt" "reflect" "testing" - "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/core/vm" ) @@ -71,20 +69,15 @@ func TestState(t *testing.T) { // Transactions with gasLimit above this value will not get a VM trace on failure. const traceErrorLimit = 400000 -// The VM config for state tests that accepts --vm.* command line arguments. -var testVMConfig = func() vm.Config { - vmconfig := vm.Config{} - flag.StringVar(&vmconfig.EVMInterpreter, utils.EVMInterpreterFlag.Name, utils.EVMInterpreterFlag.Value, utils.EVMInterpreterFlag.Usage) - flag.StringVar(&vmconfig.EWASMInterpreter, utils.EWASMInterpreterFlag.Name, utils.EWASMInterpreterFlag.Value, utils.EWASMInterpreterFlag.Usage) - flag.Parse() - return vmconfig -}() - func withTrace(t *testing.T, gasLimit uint64, test func(vm.Config) error) { - err := test(testVMConfig) + // Use config from command line arguments. + config := vm.Config{EVMInterpreter: *testEVM, EWASMInterpreter: *testEWASM} + err := test(config) if err == nil { return } + + // Test failed, re-run with tracing enabled. t.Error(err) if gasLimit > traceErrorLimit { t.Log("gas limit too high for EVM trace") @@ -93,7 +86,8 @@ func withTrace(t *testing.T, gasLimit uint64, test func(vm.Config) error) { buf := new(bytes.Buffer) w := bufio.NewWriter(buf) tracer := vm.NewJSONLogger(&vm.LogConfig{DisableMemory: true}, w) - err2 := test(vm.Config{Debug: true, Tracer: tracer}) + config.Debug, config.Tracer = true, tracer + err2 := test(config) if !reflect.DeepEqual(err, err2) { t.Errorf("different error for second run: %v", err2) } From 2469c4ecd4757e56ed22da1285ed7deab9d5b112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 12 Sep 2019 11:09:11 +0300 Subject: [PATCH 10/50] travis, Dockerfile, appveyor: bump to Go 1.13 --- .travis.yml | 24 ++++++++++++------------ Dockerfile | 2 +- Dockerfile.alltools | 2 +- appveyor.yml | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3a40ff5834b1..996ec4fdcb9d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,15 +18,15 @@ jobs: - stage: build os: linux dist: xenial - go: 1.10.x + go: 1.11.x script: - - go run build/ci.go install - - go run build/ci.go test -coverage $TEST_PACKAGES + - go run build/ci.go install + - go run build/ci.go test -coverage $TEST_PACKAGES - stage: build os: linux dist: xenial - go: 1.11.x + go: 1.12.x script: - go run build/ci.go install - go run build/ci.go test -coverage $TEST_PACKAGES @@ -35,14 +35,14 @@ jobs: - stage: build os: linux dist: xenial - go: 1.12.x + go: 1.13.x script: - go run build/ci.go install - go run build/ci.go test -coverage $TEST_PACKAGES - stage: build os: osx - go: 1.12.x + go: 1.13.x script: - echo "Increase the maximum number of open file descriptors on macOS" - NOFILE=20480 @@ -61,7 +61,7 @@ jobs: if: type = push os: linux dist: xenial - go: 1.12.x + go: 1.13.x env: - ubuntu-ppa git: @@ -85,7 +85,7 @@ jobs: os: linux dist: xenial sudo: required - go: 1.12.x + go: 1.13.x env: - azure-linux git: @@ -121,7 +121,7 @@ jobs: dist: xenial services: - docker - go: 1.12.x + go: 1.13.x env: - azure-linux-mips git: @@ -167,7 +167,7 @@ jobs: git: submodules: false # avoid cloning ethereum/tests before_install: - - curl https://dl.google.com/go/go1.12.linux-amd64.tar.gz | tar -xz + - curl https://dl.google.com/go/go1.13.linux-amd64.tar.gz | tar -xz - export PATH=`pwd`/go/bin:$PATH - export GOROOT=`pwd`/go - export GOPATH=$HOME/go @@ -185,7 +185,7 @@ jobs: - stage: build if: type = push os: osx - go: 1.12.x + go: 1.13.x env: - azure-osx - azure-ios @@ -216,7 +216,7 @@ jobs: if: type = cron os: linux dist: xenial - go: 1.12.x + go: 1.13.x env: - azure-purge git: diff --git a/Dockerfile b/Dockerfile index b9dcffb7c640..114e7620581e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build Geth in a stock Go builder container -FROM golang:1.12-alpine as builder +FROM golang:1.13-alpine as builder RUN apk add --no-cache make gcc musl-dev linux-headers git diff --git a/Dockerfile.alltools b/Dockerfile.alltools index 721b79de332e..2f661ba01c6f 100644 --- a/Dockerfile.alltools +++ b/Dockerfile.alltools @@ -1,5 +1,5 @@ # Build Geth in a stock Go builder container -FROM golang:1.12-alpine as builder +FROM golang:1.13-alpine as builder RUN apk add --no-cache make gcc musl-dev linux-headers git diff --git a/appveyor.yml b/appveyor.yml index 473ee1b78c20..7d7a575a1be1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,8 +23,8 @@ environment: install: - git submodule update --init - rmdir C:\go /s /q - - appveyor DownloadFile https://dl.google.com/go/go1.12.9.windows-%GETH_ARCH%.zip - - 7z x go1.12.9.windows-%GETH_ARCH%.zip -y -oC:\ > NUL + - appveyor DownloadFile https://dl.google.com/go/go1.13.windows-%GETH_ARCH%.zip + - 7z x go1.13.windows-%GETH_ARCH%.zip -y -oC:\ > NUL - go version - gcc --version From c02d5bc5a95238b3fe01425d122c7d5ec38869eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 12 Sep 2019 13:00:18 +0300 Subject: [PATCH 11/50] build: switch PPA from Gophers dep to manual download --- build/ci-notes.md | 9 +++------ build/deb/ethereum/deb.control | 2 +- build/deb/ethereum/deb.rules | 7 ++++--- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/build/ci-notes.md b/build/ci-notes.md index 13e1fd2307c4..dca60c95cc79 100644 --- a/build/ci-notes.md +++ b/build/ci-notes.md @@ -22,19 +22,16 @@ variables `PPA_SIGNING_KEY` and `PPA_SSH_KEY` on Travis. We want to build go-ethereum with the most recent version of Go, irrespective of the Go version that is available in the main Ubuntu repository. In order to make this possible, -our PPA depends on the ~gophers/ubuntu/archive PPA. Our source package build-depends on -golang-1.11, which is co-installable alongside the regular golang package. PPA dependencies -can be edited at https://launchpad.net/%7Eethereum/+archive/ubuntu/ethereum/+edit-dependencies +our PPA always fetches a recent Go release for the upstream server and uses that. ## Building Packages Locally (for testing) You need to run Ubuntu to do test packaging. -Add the gophers PPA and install Go 1.11 and Debian packaging tools: +Install Go and the Debian packaging tools: - $ sudo apt-add-repository ppa:gophers/ubuntu/archive $ sudo apt-get update - $ sudo apt-get install build-essential golang-1.11 devscripts debhelper python-bzrlib python-paramiko + $ sudo apt-get install build-essential golang devscripts debhelper python-bzrlib python-paramiko Create the source packages: diff --git a/build/deb/ethereum/deb.control b/build/deb/ethereum/deb.control index 5b3ff93542c4..1dcc4a9af7f5 100644 --- a/build/deb/ethereum/deb.control +++ b/build/deb/ethereum/deb.control @@ -2,7 +2,7 @@ Source: {{.Name}} Section: science Priority: extra Maintainer: {{.Author}} -Build-Depends: debhelper (>= 8.0.0), golang-1.11 +Build-Depends: debhelper (>= 8.0.0), golang Standards-Version: 3.9.5 Homepage: https://ethereum.org Vcs-Git: git://github.com/ethereum/go-ethereum.git diff --git a/build/deb/ethereum/deb.rules b/build/deb/ethereum/deb.rules index 5280e0e55aa4..0dab914ad204 100644 --- a/build/deb/ethereum/deb.rules +++ b/build/deb/ethereum/deb.rules @@ -4,11 +4,12 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -# Launchpad rejects Go's access to $HOME/.cache, use custom folder -export GOCACHE=/tmp/go-build +# Launchpad rejects Go's access to $HOME, use custom folder +export HOME=/tmp/home override_dh_auto_build: - build/env.sh /usr/lib/go-1.11/bin/go run build/ci.go install -git-commit={{.Env.Commit}} -git-branch={{.Env.Branch}} -git-tag={{.Env.Tag}} -buildnum={{.Env.Buildnum}} -pull-request={{.Env.IsPullRequest}} + go get golang.org/dl/go1.13 && $HOME/go/bin/go1.13 download + build/env.sh $HOME/go/bin/go1.13 run build/ci.go install -git-commit={{.Env.Commit}} -git-branch={{.Env.Branch}} -git-tag={{.Env.Tag}} -buildnum={{.Env.Buildnum}} -pull-request={{.Env.IsPullRequest}} override_dh_auto_test: From efe123759ab5c6eb536dc3f0718ec5acc2dca7fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 12 Sep 2019 14:23:34 +0300 Subject: [PATCH 12/50] Revert "build: switch PPA from Gophers dep to manual download" (#20061) --- build/ci-notes.md | 9 ++++++--- build/deb/ethereum/deb.control | 2 +- build/deb/ethereum/deb.rules | 7 +++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/build/ci-notes.md b/build/ci-notes.md index dca60c95cc79..13e1fd2307c4 100644 --- a/build/ci-notes.md +++ b/build/ci-notes.md @@ -22,16 +22,19 @@ variables `PPA_SIGNING_KEY` and `PPA_SSH_KEY` on Travis. We want to build go-ethereum with the most recent version of Go, irrespective of the Go version that is available in the main Ubuntu repository. In order to make this possible, -our PPA always fetches a recent Go release for the upstream server and uses that. +our PPA depends on the ~gophers/ubuntu/archive PPA. Our source package build-depends on +golang-1.11, which is co-installable alongside the regular golang package. PPA dependencies +can be edited at https://launchpad.net/%7Eethereum/+archive/ubuntu/ethereum/+edit-dependencies ## Building Packages Locally (for testing) You need to run Ubuntu to do test packaging. -Install Go and the Debian packaging tools: +Add the gophers PPA and install Go 1.11 and Debian packaging tools: + $ sudo apt-add-repository ppa:gophers/ubuntu/archive $ sudo apt-get update - $ sudo apt-get install build-essential golang devscripts debhelper python-bzrlib python-paramiko + $ sudo apt-get install build-essential golang-1.11 devscripts debhelper python-bzrlib python-paramiko Create the source packages: diff --git a/build/deb/ethereum/deb.control b/build/deb/ethereum/deb.control index 1dcc4a9af7f5..5b3ff93542c4 100644 --- a/build/deb/ethereum/deb.control +++ b/build/deb/ethereum/deb.control @@ -2,7 +2,7 @@ Source: {{.Name}} Section: science Priority: extra Maintainer: {{.Author}} -Build-Depends: debhelper (>= 8.0.0), golang +Build-Depends: debhelper (>= 8.0.0), golang-1.11 Standards-Version: 3.9.5 Homepage: https://ethereum.org Vcs-Git: git://github.com/ethereum/go-ethereum.git diff --git a/build/deb/ethereum/deb.rules b/build/deb/ethereum/deb.rules index 0dab914ad204..5280e0e55aa4 100644 --- a/build/deb/ethereum/deb.rules +++ b/build/deb/ethereum/deb.rules @@ -4,12 +4,11 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -# Launchpad rejects Go's access to $HOME, use custom folder -export HOME=/tmp/home +# Launchpad rejects Go's access to $HOME/.cache, use custom folder +export GOCACHE=/tmp/go-build override_dh_auto_build: - go get golang.org/dl/go1.13 && $HOME/go/bin/go1.13 download - build/env.sh $HOME/go/bin/go1.13 run build/ci.go install -git-commit={{.Env.Commit}} -git-branch={{.Env.Branch}} -git-tag={{.Env.Tag}} -buildnum={{.Env.Buildnum}} -pull-request={{.Env.IsPullRequest}} + build/env.sh /usr/lib/go-1.11/bin/go run build/ci.go install -git-commit={{.Env.Commit}} -git-branch={{.Env.Branch}} -git-tag={{.Env.Tag}} -buildnum={{.Env.Buildnum}} -pull-request={{.Env.IsPullRequest}} override_dh_auto_test: From 3b6c9902f308ffc595912802644c5d21616e61f5 Mon Sep 17 00:00:00 2001 From: Rob Mulholand Date: Thu, 12 Sep 2019 14:22:22 -0500 Subject: [PATCH 13/50] core: remove unused gas return in ApplyTransaction (#20065) --- cmd/geth/retesteth.go | 2 +- core/chain_makers.go | 2 +- core/state_processor.go | 10 +++++----- miner/worker.go | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/geth/retesteth.go b/cmd/geth/retesteth.go index 9469c9f5f6a6..b6aa3706b2b3 100644 --- a/cmd/geth/retesteth.go +++ b/cmd/geth/retesteth.go @@ -508,7 +508,7 @@ func (api *RetestethAPI) mineBlock() error { statedb.Prepare(tx.Hash(), common.Hash{}, txCount) snap := statedb.Snapshot() - receipt, _, err := core.ApplyTransaction( + receipt, err := core.ApplyTransaction( api.chainConfig, api.blockchain, &api.author, diff --git a/core/chain_makers.go b/core/chain_makers.go index 17f4042116fa..0b0fcdb4aa39 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -103,7 +103,7 @@ func (b *BlockGen) AddTxWithChain(bc *BlockChain, tx *types.Transaction) { b.SetCoinbase(common.Address{}) } b.statedb.Prepare(tx.Hash(), common.Hash{}, len(b.txs)) - receipt, _, err := ApplyTransaction(b.config, bc, &b.header.Coinbase, b.gasPool, b.statedb, b.header, tx, &b.header.GasUsed, vm.Config{}) + receipt, err := ApplyTransaction(b.config, bc, &b.header.Coinbase, b.gasPool, b.statedb, b.header, tx, &b.header.GasUsed, vm.Config{}) if err != nil { panic(err) } diff --git a/core/state_processor.go b/core/state_processor.go index bed6a073063d..cfe17d587b46 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -68,7 +68,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg // Iterate over and process the individual transactions for i, tx := range block.Transactions() { statedb.Prepare(tx.Hash(), block.Hash(), i) - receipt, _, err := ApplyTransaction(p.config, p.bc, nil, gp, statedb, header, tx, usedGas, cfg) + receipt, err := ApplyTransaction(p.config, p.bc, nil, gp, statedb, header, tx, usedGas, cfg) if err != nil { return nil, nil, 0, err } @@ -85,10 +85,10 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg // and uses the input parameters for its environment. It returns the receipt // for the transaction, gas used and an error if the transaction failed, // indicating the block was invalid. -func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *common.Address, gp *GasPool, statedb *state.StateDB, header *types.Header, tx *types.Transaction, usedGas *uint64, cfg vm.Config) (*types.Receipt, uint64, error) { +func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *common.Address, gp *GasPool, statedb *state.StateDB, header *types.Header, tx *types.Transaction, usedGas *uint64, cfg vm.Config) (*types.Receipt, error) { msg, err := tx.AsMessage(types.MakeSigner(config, header.Number)) if err != nil { - return nil, 0, err + return nil, err } // Create a new context to be used in the EVM environment context := NewEVMContext(msg, header, bc, author) @@ -98,7 +98,7 @@ func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *commo // Apply the transaction to the current state (included in the env) _, gas, failed, err := ApplyMessage(vmenv, msg, gp) if err != nil { - return nil, 0, err + return nil, err } // Update the state with pending changes var root []byte @@ -125,5 +125,5 @@ func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *commo receipt.BlockNumber = header.Number receipt.TransactionIndex = uint(statedb.TxIndex()) - return receipt, gas, err + return receipt, err } diff --git a/miner/worker.go b/miner/worker.go index 4a9528c39565..183499ec308d 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -704,7 +704,7 @@ func (w *worker) updateSnapshot() { func (w *worker) commitTransaction(tx *types.Transaction, coinbase common.Address) ([]*types.Log, error) { snap := w.current.state.Snapshot() - receipt, _, err := core.ApplyTransaction(w.chainConfig, w.chain, &coinbase, w.current.gasPool, w.current.state, w.current.header, tx, &w.current.header.GasUsed, *w.chain.GetVMConfig()) + receipt, err := core.ApplyTransaction(w.chainConfig, w.chain, &coinbase, w.current.gasPool, w.current.state, w.current.header, tx, &w.current.header.GasUsed, *w.chain.GetVMConfig()) if err != nil { w.current.state.RevertToSnapshot(snap) return nil, err From 96fb839133183960571d9a2e7222536362791899 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 13 Sep 2019 11:10:57 +0200 Subject: [PATCH 14/50] rlp: improve nil pointer handling (#20064) * rlp: improve nil pointer handling In both encoder and decoder, the rules for encoding nil pointers were a bit hard to understand, and didn't leave much choice. Since RLP allows two empty values (empty list, empty string), any protocol built on RLP must choose either of these values to represent the null value in a certain context. This change adds choice in the form of two new struct tags, "nilString" and "nilList". These can be used to specify how a nil pointer value is encoded. The "nil" tag still exists, but its implementation is now explicit and defines exactly how nil pointers are handled in a single place. Another important change in this commit is how nil pointers and the Encoder interface interact. The EncodeRLP method was previously called even on nil values, which was supposed to give users a choice of how their value would be handled when nil. It turns out this is a stupid idea. If you create a network protocol containing an object defined in another package, it's better to be able to say that the object should be a list or string when nil in the definition of the protocol message rather than defining the encoding of nil on the object itself. As of this commit, the encoding rules for pointers now take precedence over the Encoder interface rule. I think the "nil" tag will work fine for most cases. For special kinds of objects which are a struct in Go but strings in RLP, code using the object can specify the desired encoding of nil using the "nilString" and "nilList" tags. * rlp: propagate struct field type errors If a struct contained fields of undecodable type, the encoder and decoder would panic instead of returning an error. Fix this by propagating type errors in makeStruct{Writer,Decoder} and add a test. --- rlp/decode.go | 168 ++++++++++++------------------------ rlp/decode_test.go | 95 ++++++++++++++++++-- rlp/doc.go | 121 +++++++++++++++++++++++--- rlp/encode.go | 127 ++++++++++----------------- rlp/encode_test.go | 75 +++++++++++++--- rlp/encoder_example_test.go | 12 +-- rlp/typecache.go | 62 +++++++++++-- 7 files changed, 416 insertions(+), 244 deletions(-) diff --git a/rlp/decode.go b/rlp/decode.go index 4f29f2fb0368..524395915d34 100644 --- a/rlp/decode.go +++ b/rlp/decode.go @@ -55,81 +55,23 @@ var ( } ) -// Decoder is implemented by types that require custom RLP -// decoding rules or need to decode into private fields. +// Decoder is implemented by types that require custom RLP decoding rules or need to decode +// into private fields. // -// The DecodeRLP method should read one value from the given -// Stream. It is not forbidden to read less or more, but it might -// be confusing. +// The DecodeRLP method should read one value from the given Stream. It is not forbidden to +// read less or more, but it might be confusing. type Decoder interface { DecodeRLP(*Stream) error } -// Decode parses RLP-encoded data from r and stores the result in the -// value pointed to by val. Val must be a non-nil pointer. If r does -// not implement ByteReader, Decode will do its own buffering. +// Decode parses RLP-encoded data from r and stores the result in the value pointed to by +// val. Please see package-level documentation for the decoding rules. Val must be a +// non-nil pointer. // -// Decode uses the following type-dependent decoding rules: +// If r does not implement ByteReader, Decode will do its own buffering. // -// If the type implements the Decoder interface, decode calls -// DecodeRLP. -// -// To decode into a pointer, Decode will decode into the value pointed -// to. If the pointer is nil, a new value of the pointer's element -// type is allocated. If the pointer is non-nil, the existing value -// will be reused. -// -// To decode into a struct, Decode expects the input to be an RLP -// list. The decoded elements of the list are assigned to each public -// field in the order given by the struct's definition. The input list -// must contain an element for each decoded field. Decode returns an -// error if there are too few or too many elements. -// -// The decoding of struct fields honours certain struct tags, "tail", -// "nil" and "-". -// -// The "-" tag ignores fields. -// -// For an explanation of "tail", see the example. -// -// The "nil" tag applies to pointer-typed fields and changes the decoding -// rules for the field such that input values of size zero decode as a nil -// pointer. This tag can be useful when decoding recursive types. -// -// type StructWithEmptyOK struct { -// Foo *[20]byte `rlp:"nil"` -// } -// -// To decode into a slice, the input must be a list and the resulting -// slice will contain the input elements in order. For byte slices, -// the input must be an RLP string. Array types decode similarly, with -// the additional restriction that the number of input elements (or -// bytes) must match the array's length. -// -// To decode into a Go string, the input must be an RLP string. The -// input bytes are taken as-is and will not necessarily be valid UTF-8. -// -// To decode into an unsigned integer type, the input must also be an RLP -// string. The bytes are interpreted as a big endian representation of -// the integer. If the RLP string is larger than the bit size of the -// type, Decode will return an error. Decode also supports *big.Int. -// There is no size limit for big integers. -// -// To decode into a boolean, the input must contain an unsigned integer -// of value zero (false) or one (true). -// -// To decode into an interface value, Decode stores one of these -// in the value: -// -// []interface{}, for RLP lists -// []byte, for RLP strings -// -// Non-empty interface types are not supported, nor are signed integers, -// floating point numbers, maps, channels and functions. -// -// Note that Decode does not set an input limit for all readers -// and may be vulnerable to panics cause by huge value sizes. If -// you need an input limit, use +// Note that Decode does not set an input limit for all readers and may be vulnerable to +// panics cause by huge value sizes. If you need an input limit, use // // NewStream(r, limit).Decode(val) func Decode(r io.Reader, val interface{}) error { @@ -140,9 +82,8 @@ func Decode(r io.Reader, val interface{}) error { return stream.Decode(val) } -// DecodeBytes parses RLP data from b into val. -// Please see the documentation of Decode for the decoding rules. -// The input must contain exactly one value and no trailing data. +// DecodeBytes parses RLP data from b into val. Please see package-level documentation for +// the decoding rules. The input must contain exactly one value and no trailing data. func DecodeBytes(b []byte, val interface{}) error { r := bytes.NewReader(b) @@ -211,14 +152,15 @@ func makeDecoder(typ reflect.Type, tags tags) (dec decoder, err error) { switch { case typ == rawValueType: return decodeRawValue, nil - case typ.Implements(decoderInterface): return decodeDecoder, nil - case kind != reflect.Ptr && reflect.PtrTo(typ).Implements(decoderInterface): - return decodeDecoderNoPtr, nil case typ.AssignableTo(reflect.PtrTo(bigInt)): return decodeBigInt, nil case typ.AssignableTo(bigInt): return decodeBigIntNoPtr, nil + case kind == reflect.Ptr: + return makePtrDecoder(typ, tags) + case reflect.PtrTo(typ).Implements(decoderInterface): + return decodeDecoder, nil case isUint(kind): return decodeUint, nil case kind == reflect.Bool: @@ -229,11 +171,6 @@ func makeDecoder(typ reflect.Type, tags tags) (dec decoder, err error) { return makeListDecoder(typ, tags) case kind == reflect.Struct: return makeStructDecoder(typ) - case kind == reflect.Ptr: - if tags.nilOK { - return makeOptionalPtrDecoder(typ) - } - return makePtrDecoder(typ) case kind == reflect.Interface: return decodeInterface, nil default: @@ -448,6 +385,11 @@ func makeStructDecoder(typ reflect.Type) (decoder, error) { if err != nil { return nil, err } + for _, f := range fields { + if f.info.decoderErr != nil { + return nil, structFieldError{typ, f.index, f.info.decoderErr} + } + } dec := func(s *Stream, val reflect.Value) (err error) { if _, err := s.List(); err != nil { return wrapStreamError(err, typ) @@ -465,15 +407,22 @@ func makeStructDecoder(typ reflect.Type) (decoder, error) { return dec, nil } -// makePtrDecoder creates a decoder that decodes into -// the pointer's element type. -func makePtrDecoder(typ reflect.Type) (decoder, error) { +// makePtrDecoder creates a decoder that decodes into the pointer's element type. +func makePtrDecoder(typ reflect.Type, tag tags) (decoder, error) { etype := typ.Elem() etypeinfo := cachedTypeInfo1(etype, tags{}) - if etypeinfo.decoderErr != nil { + switch { + case etypeinfo.decoderErr != nil: return nil, etypeinfo.decoderErr + case !tag.nilOK: + return makeSimplePtrDecoder(etype, etypeinfo), nil + default: + return makeNilPtrDecoder(etype, etypeinfo, tag.nilKind), nil } - dec := func(s *Stream, val reflect.Value) (err error) { +} + +func makeSimplePtrDecoder(etype reflect.Type, etypeinfo *typeinfo) decoder { + return func(s *Stream, val reflect.Value) (err error) { newval := val if val.IsNil() { newval = reflect.New(etype) @@ -483,30 +432,35 @@ func makePtrDecoder(typ reflect.Type) (decoder, error) { } return err } - return dec, nil } -// makeOptionalPtrDecoder creates a decoder that decodes empty values -// as nil. Non-empty values are decoded into a value of the element type, -// just like makePtrDecoder does. +// makeNilPtrDecoder creates a decoder that decodes empty values as nil. Non-empty +// values are decoded into a value of the element type, just like makePtrDecoder does. // // This decoder is used for pointer-typed struct fields with struct tag "nil". -func makeOptionalPtrDecoder(typ reflect.Type) (decoder, error) { - etype := typ.Elem() - etypeinfo := cachedTypeInfo1(etype, tags{}) - if etypeinfo.decoderErr != nil { - return nil, etypeinfo.decoderErr - } - dec := func(s *Stream, val reflect.Value) (err error) { +func makeNilPtrDecoder(etype reflect.Type, etypeinfo *typeinfo, nilKind Kind) decoder { + typ := reflect.PtrTo(etype) + nilPtr := reflect.Zero(typ) + return func(s *Stream, val reflect.Value) (err error) { kind, size, err := s.Kind() - if err != nil || size == 0 && kind != Byte { + if err != nil { + val.Set(nilPtr) + return wrapStreamError(err, typ) + } + // Handle empty values as a nil pointer. + if kind != Byte && size == 0 { + if kind != nilKind { + return &decodeError{ + msg: fmt.Sprintf("wrong kind of empty value (got %v, want %v)", kind, nilKind), + typ: typ, + } + } // rearm s.Kind. This is important because the input // position must advance to the next value even though // we don't read anything. s.kind = -1 - // set the pointer to nil. - val.Set(reflect.Zero(typ)) - return err + val.Set(nilPtr) + return nil } newval := val if val.IsNil() { @@ -517,7 +471,6 @@ func makeOptionalPtrDecoder(typ reflect.Type) (decoder, error) { } return err } - return dec, nil } var ifsliceType = reflect.TypeOf([]interface{}{}) @@ -546,21 +499,8 @@ func decodeInterface(s *Stream, val reflect.Value) error { return nil } -// This decoder is used for non-pointer values of types -// that implement the Decoder interface using a pointer receiver. -func decodeDecoderNoPtr(s *Stream, val reflect.Value) error { - return val.Addr().Interface().(Decoder).DecodeRLP(s) -} - func decodeDecoder(s *Stream, val reflect.Value) error { - // Decoder instances are not handled using the pointer rule if the type - // implements Decoder with pointer receiver (i.e. always) - // because it might handle empty values specially. - // We need to allocate one here in this case, like makePtrDecoder does. - if val.Kind() == reflect.Ptr && val.IsNil() { - val.Set(reflect.New(val.Type().Elem())) - } - return val.Interface().(Decoder).DecodeRLP(s) + return val.Addr().Interface().(Decoder).DecodeRLP(s) } // Kind represents the kind of value contained in an RLP stream. diff --git a/rlp/decode_test.go b/rlp/decode_test.go index fa57182c992a..634d1cf3bb7d 100644 --- a/rlp/decode_test.go +++ b/rlp/decode_test.go @@ -327,6 +327,10 @@ type recstruct struct { Child *recstruct `rlp:"nil"` } +type invalidNilTag struct { + X []byte `rlp:"nil"` +} + type invalidTail1 struct { A uint `rlp:"tail"` B string @@ -353,6 +357,18 @@ type tailPrivateFields struct { x, y bool } +type nilListUint struct { + X *uint `rlp:"nilList"` +} + +type nilStringSlice struct { + X *[]uint `rlp:"nilString"` +} + +type intField struct { + X int +} + var ( veryBigInt = big.NewInt(0).Add( big.NewInt(0).Lsh(big.NewInt(0xFFFFFFFFFFFFFF), 16), @@ -485,20 +501,20 @@ var decodeTests = []decodeTest{ error: "rlp: expected input string or byte for uint, decoding into (rlp.recstruct).Child.I", }, { - input: "C0", - ptr: new(invalidTail1), - error: "rlp: invalid struct tag \"tail\" for rlp.invalidTail1.A (must be on last field)", - }, - { - input: "C0", - ptr: new(invalidTail2), - error: "rlp: invalid struct tag \"tail\" for rlp.invalidTail2.B (field type is not slice)", + input: "C103", + ptr: new(intField), + error: "rlp: type int is not RLP-serializable (struct field rlp.intField.X)", }, { input: "C50102C20102", ptr: new(tailUint), error: "rlp: expected input string or byte for uint, decoding into (rlp.tailUint).Tail[1]", }, + { + input: "C0", + ptr: new(invalidNilTag), + error: `rlp: invalid struct tag "nil" for rlp.invalidNilTag.X (field is not a pointer)`, + }, // struct tag "tail" { @@ -521,6 +537,16 @@ var decodeTests = []decodeTest{ ptr: new(tailPrivateFields), value: tailPrivateFields{A: 1, Tail: []uint{2, 3}}, }, + { + input: "C0", + ptr: new(invalidTail1), + error: `rlp: invalid struct tag "tail" for rlp.invalidTail1.A (must be on last field)`, + }, + { + input: "C0", + ptr: new(invalidTail2), + error: `rlp: invalid struct tag "tail" for rlp.invalidTail2.B (field type is not slice)`, + }, // struct tag "-" { @@ -529,6 +555,43 @@ var decodeTests = []decodeTest{ value: hasIgnoredField{A: 1, C: 2}, }, + // struct tag "nilList" + { + input: "C180", + ptr: new(nilListUint), + error: "rlp: wrong kind of empty value (got String, want List) for *uint, decoding into (rlp.nilListUint).X", + }, + { + input: "C1C0", + ptr: new(nilListUint), + value: nilListUint{}, + }, + { + input: "C103", + ptr: new(nilListUint), + value: func() interface{} { + v := uint(3) + return nilListUint{X: &v} + }(), + }, + + // struct tag "nilString" + { + input: "C1C0", + ptr: new(nilStringSlice), + error: "rlp: wrong kind of empty value (got List, want String) for *[]uint, decoding into (rlp.nilStringSlice).X", + }, + { + input: "C180", + ptr: new(nilStringSlice), + value: nilStringSlice{}, + }, + { + input: "C2C103", + ptr: new(nilStringSlice), + value: nilStringSlice{X: &[]uint{3}}, + }, + // RawValue {input: "01", ptr: new(RawValue), value: RawValue(unhex("01"))}, {input: "82FFFF", ptr: new(RawValue), value: RawValue(unhex("82FFFF"))}, @@ -672,6 +735,22 @@ func TestDecodeDecoder(t *testing.T) { } } +func TestDecodeDecoderNilPointer(t *testing.T) { + var s struct { + T1 *testDecoder `rlp:"nil"` + T2 *testDecoder + } + if err := Decode(bytes.NewReader(unhex("C2C002")), &s); err != nil { + t.Fatalf("Decode error: %v", err) + } + if s.T1 != nil { + t.Errorf("decoder T1 allocated for empty input (called: %v)", s.T1.called) + } + if s.T2 == nil || !s.T2.called { + t.Errorf("decoder T2 not allocated/called") + } +} + type byteDecoder byte func (bd *byteDecoder) DecodeRLP(s *Stream) error { diff --git a/rlp/doc.go b/rlp/doc.go index b3a81fe2326f..7e6ee8520019 100644 --- a/rlp/doc.go +++ b/rlp/doc.go @@ -17,17 +17,114 @@ /* Package rlp implements the RLP serialization format. -The purpose of RLP (Recursive Linear Prefix) is to encode arbitrarily -nested arrays of binary data, and RLP is the main encoding method used -to serialize objects in Ethereum. The only purpose of RLP is to encode -structure; encoding specific atomic data types (eg. strings, ints, -floats) is left up to higher-order protocols; in Ethereum integers -must be represented in big endian binary form with no leading zeroes -(thus making the integer value zero equivalent to the empty byte -array). - -RLP values are distinguished by a type tag. The type tag precedes the -value in the input stream and defines the size and kind of the bytes -that follow. +The purpose of RLP (Recursive Linear Prefix) is to encode arbitrarily nested arrays of +binary data, and RLP is the main encoding method used to serialize objects in Ethereum. +The only purpose of RLP is to encode structure; encoding specific atomic data types (eg. +strings, ints, floats) is left up to higher-order protocols. In Ethereum integers must be +represented in big endian binary form with no leading zeroes (thus making the integer +value zero equivalent to the empty string). + +RLP values are distinguished by a type tag. The type tag precedes the value in the input +stream and defines the size and kind of the bytes that follow. + + +Encoding Rules + +Package rlp uses reflection and encodes RLP based on the Go type of the value. + +If the type implements the Encoder interface, Encode calls EncodeRLP. It does not +call EncodeRLP on nil pointer values. + +To encode a pointer, the value being pointed to is encoded. A nil pointer to a struct +type, slice or array always encodes as an empty RLP list unless the slice or array has +elememt type byte. A nil pointer to any other value encodes as the empty string. + +Struct values are encoded as an RLP list of all their encoded public fields. Recursive +struct types are supported. + +To encode slices and arrays, the elements are encoded as an RLP list of the value's +elements. Note that arrays and slices with element type uint8 or byte are always encoded +as an RLP string. + +A Go string is encoded as an RLP string. + +An unsigned integer value is encoded as an RLP string. Zero always encodes as an empty RLP +string. big.Int values are treated as integers. Signed integers (int, int8, int16, ...) +are not supported and will return an error when encoding. + +Boolean values are encoded as the unsigned integers zero (false) and one (true). + +An interface value encodes as the value contained in the interface. + +Floating point numbers, maps, channels and functions are not supported. + + +Decoding Rules + +Decoding uses the following type-dependent rules: + +If the type implements the Decoder interface, DecodeRLP is called. + +To decode into a pointer, the value will be decoded as the element type of the pointer. If +the pointer is nil, a new value of the pointer's element type is allocated. If the pointer +is non-nil, the existing value will be reused. Note that package rlp never leaves a +pointer-type struct field as nil unless one of the "nil" struct tags is present. + +To decode into a struct, decoding expects the input to be an RLP list. The decoded +elements of the list are assigned to each public field in the order given by the struct's +definition. The input list must contain an element for each decoded field. Decoding +returns an error if there are too few or too many elements for the struct. + +To decode into a slice, the input must be a list and the resulting slice will contain the +input elements in order. For byte slices, the input must be an RLP string. Array types +decode similarly, with the additional restriction that the number of input elements (or +bytes) must match the array's defined length. + +To decode into a Go string, the input must be an RLP string. The input bytes are taken +as-is and will not necessarily be valid UTF-8. + +To decode into an unsigned integer type, the input must also be an RLP string. The bytes +are interpreted as a big endian representation of the integer. If the RLP string is larger +than the bit size of the type, decoding will return an error. Decode also supports +*big.Int. There is no size limit for big integers. + +To decode into a boolean, the input must contain an unsigned integer of value zero (false) +or one (true). + +To decode into an interface value, one of these types is stored in the value: + + []interface{}, for RLP lists + []byte, for RLP strings + +Non-empty interface types are not supported when decoding. +Signed integers, floating point numbers, maps, channels and functions cannot be decoded into. + + +Struct Tags + +Package rlp honours certain struct tags: "-", "tail", "nil", "nilList" and "nilString". + +The "-" tag ignores fields. + +The "tail" tag, which may only be used on the last exported struct field, allows slurping +up any excess list elements into a slice. See examples for more details. + +The "nil" tag applies to pointer-typed fields and changes the decoding rules for the field +such that input values of size zero decode as a nil pointer. This tag can be useful when +decoding recursive types. + + type StructWithOptionalFoo struct { + Foo *[20]byte `rlp:"nil"` + } + +RLP supports two kinds of empty values: empty lists and empty strings. When using the +"nil" tag, the kind of empty value allowed for a type is chosen automatically. A struct +field whose Go type is a pointer to an unsigned integer, string, boolean or byte +array/slice expects an empty RLP string. Any other pointer field type encodes/decodes as +an empty RLP list. + +The choice of null value can be made explicit with the "nilList" and "nilString" struct +tags. Using these tags encodes/decodes a Go nil pointer value as the kind of empty +RLP value defined by the tag. */ package rlp diff --git a/rlp/encode.go b/rlp/encode.go index f255c38a9cfe..9c9e8d706d07 100644 --- a/rlp/encode.go +++ b/rlp/encode.go @@ -49,36 +49,7 @@ type Encoder interface { // perform many small writes in some cases. Consider making w // buffered. // -// Encode uses the following type-dependent encoding rules: -// -// If the type implements the Encoder interface, Encode calls -// EncodeRLP. This is true even for nil pointers, please see the -// documentation for Encoder. -// -// To encode a pointer, the value being pointed to is encoded. For nil -// pointers, Encode will encode the zero value of the type. A nil -// pointer to a struct type always encodes as an empty RLP list. -// A nil pointer to an array encodes as an empty list (or empty string -// if the array has element type byte). -// -// Struct values are encoded as an RLP list of all their encoded -// public fields. Recursive struct types are supported. -// -// To encode slices and arrays, the elements are encoded as an RLP -// list of the value's elements. Note that arrays and slices with -// element type uint8 or byte are always encoded as an RLP string. -// -// A Go string is encoded as an RLP string. -// -// An unsigned integer value is encoded as an RLP string. Zero always -// encodes as an empty RLP string. Encode also supports *big.Int. -// -// Boolean values are encoded as unsigned integers zero (false) and one (true). -// -// An interface value encodes as the value contained in the interface. -// -// Signed integers are not supported, nor are floating point numbers, maps, -// channels and functions. +// Please see package-level documentation of encoding rules. func Encode(w io.Writer, val interface{}) error { if outer, ok := w.(*encbuf); ok { // Encode was called by some type's EncodeRLP. @@ -95,7 +66,7 @@ func Encode(w io.Writer, val interface{}) error { } // EncodeToBytes returns the RLP encoding of val. -// Please see the documentation of Encode for the encoding rules. +// Please see package-level documentation for the encoding rules. func EncodeToBytes(val interface{}) ([]byte, error) { eb := encbufPool.Get().(*encbuf) defer encbufPool.Put(eb) @@ -349,16 +320,14 @@ func makeWriter(typ reflect.Type, ts tags) (writer, error) { switch { case typ == rawValueType: return writeRawValue, nil - case typ.Implements(encoderInterface): - return writeEncoder, nil - case kind != reflect.Ptr && reflect.PtrTo(typ).Implements(encoderInterface): - return writeEncoderNoPtr, nil - case kind == reflect.Interface: - return writeInterface, nil case typ.AssignableTo(reflect.PtrTo(bigInt)): return writeBigIntPtr, nil case typ.AssignableTo(bigInt): return writeBigIntNoPtr, nil + case kind == reflect.Ptr: + return makePtrWriter(typ, ts) + case reflect.PtrTo(typ).Implements(encoderInterface): + return makeEncoderWriter(typ), nil case isUint(kind): return writeUint, nil case kind == reflect.Bool: @@ -373,8 +342,8 @@ func makeWriter(typ reflect.Type, ts tags) (writer, error) { return makeSliceWriter(typ, ts) case kind == reflect.Struct: return makeStructWriter(typ) - case kind == reflect.Ptr: - return makePtrWriter(typ) + case kind == reflect.Interface: + return writeInterface, nil default: return nil, fmt.Errorf("rlp: type %v is not RLP-serializable", typ) } @@ -470,26 +439,6 @@ func writeString(val reflect.Value, w *encbuf) error { return nil } -func writeEncoder(val reflect.Value, w *encbuf) error { - return val.Interface().(Encoder).EncodeRLP(w) -} - -// writeEncoderNoPtr handles non-pointer values that implement Encoder -// with a pointer receiver. -func writeEncoderNoPtr(val reflect.Value, w *encbuf) error { - if !val.CanAddr() { - // We can't get the address. It would be possible to make the - // value addressable by creating a shallow copy, but this - // creates other problems so we're not doing it (yet). - // - // package json simply doesn't call MarshalJSON for cases like - // this, but encodes the value as if it didn't implement the - // interface. We don't want to handle it that way. - return fmt.Errorf("rlp: game over: unadressable value of type %v, EncodeRLP is pointer method", val.Type()) - } - return val.Addr().Interface().(Encoder).EncodeRLP(w) -} - func writeInterface(val reflect.Value, w *encbuf) error { if val.IsNil() { // Write empty list. This is consistent with the previous RLP @@ -531,6 +480,11 @@ func makeStructWriter(typ reflect.Type) (writer, error) { if err != nil { return nil, err } + for _, f := range fields { + if f.info.writerErr != nil { + return nil, structFieldError{typ, f.index, f.info.writerErr} + } + } writer := func(val reflect.Value, w *encbuf) error { lh := w.list() for _, f := range fields { @@ -544,44 +498,51 @@ func makeStructWriter(typ reflect.Type) (writer, error) { return writer, nil } -func makePtrWriter(typ reflect.Type) (writer, error) { +func makePtrWriter(typ reflect.Type, ts tags) (writer, error) { etypeinfo := cachedTypeInfo1(typ.Elem(), tags{}) if etypeinfo.writerErr != nil { return nil, etypeinfo.writerErr } - - // determine nil pointer handler - var nilfunc func(*encbuf) error - kind := typ.Elem().Kind() - switch { - case kind == reflect.Array && isByte(typ.Elem().Elem()): - nilfunc = func(w *encbuf) error { - w.str = append(w.str, 0x80) - return nil - } - case kind == reflect.Struct || kind == reflect.Array: - nilfunc = func(w *encbuf) error { - // encoding the zero value of a struct/array could trigger - // infinite recursion, avoid that. - w.listEnd(w.list()) - return nil - } - default: - zero := reflect.Zero(typ.Elem()) - nilfunc = func(w *encbuf) error { - return etypeinfo.writer(zero, w) - } + // Determine how to encode nil pointers. + var nilKind Kind + if ts.nilOK { + nilKind = ts.nilKind // use struct tag if provided + } else { + nilKind = defaultNilKind(typ.Elem()) } writer := func(val reflect.Value, w *encbuf) error { if val.IsNil() { - return nilfunc(w) + if nilKind == String { + w.str = append(w.str, 0x80) + } else { + w.listEnd(w.list()) + } + return nil } return etypeinfo.writer(val.Elem(), w) } return writer, nil } +func makeEncoderWriter(typ reflect.Type) writer { + if typ.Implements(encoderInterface) { + return func(val reflect.Value, w *encbuf) error { + return val.Interface().(Encoder).EncodeRLP(w) + } + } + w := func(val reflect.Value, w *encbuf) error { + if !val.CanAddr() { + // package json simply doesn't call MarshalJSON for this case, but encodes the + // value as if it didn't implement the interface. We don't want to handle it that + // way. + return fmt.Errorf("rlp: unadressable value of type %v, EncodeRLP is pointer method", val.Type()) + } + return val.Addr().Interface().(Encoder).EncodeRLP(w) + } + return w +} + // putint writes i to the beginning of b in big endian byte // order, using the least number of bytes needed to represent i. func putint(b []byte, i uint64) (size int) { diff --git a/rlp/encode_test.go b/rlp/encode_test.go index 6e49b89a85af..b4b9e5128740 100644 --- a/rlp/encode_test.go +++ b/rlp/encode_test.go @@ -33,8 +33,9 @@ type testEncoder struct { func (e *testEncoder) EncodeRLP(w io.Writer) error { if e == nil { - w.Write([]byte{0, 0, 0, 0}) - } else if e.err != nil { + panic("EncodeRLP called on nil value") + } + if e.err != nil { return e.err } else { w.Write([]byte{0, 1, 0, 1, 0, 1, 0, 1, 0, 1}) @@ -42,6 +43,13 @@ func (e *testEncoder) EncodeRLP(w io.Writer) error { return nil } +type testEncoderValueMethod struct{} + +func (e testEncoderValueMethod) EncodeRLP(w io.Writer) error { + w.Write([]byte{0xFA, 0xFE, 0xF0}) + return nil +} + type byteEncoder byte func (e byteEncoder) EncodeRLP(w io.Writer) error { @@ -52,8 +60,8 @@ func (e byteEncoder) EncodeRLP(w io.Writer) error { type undecodableEncoder func() func (f undecodableEncoder) EncodeRLP(w io.Writer) error { - _, err := w.Write(EmptyList) - return err + w.Write([]byte{0xF5, 0xF5, 0xF5}) + return nil } type encodableReader struct { @@ -226,6 +234,7 @@ var encTests = []encTest{ {val: &tailRaw{A: 1, Tail: []RawValue{}}, output: "C101"}, {val: &tailRaw{A: 1, Tail: nil}, output: "C101"}, {val: &hasIgnoredField{A: 1, B: 2, C: 3}, output: "C20103"}, + {val: &intField{X: 3}, error: "rlp: type int is not RLP-serializable (struct field rlp.intField.X)"}, // nil {val: (*uint)(nil), output: "80"}, @@ -239,22 +248,66 @@ var encTests = []encTest{ {val: (*[]struct{ uint })(nil), output: "C0"}, {val: (*interface{})(nil), output: "C0"}, + // nil struct fields + { + val: struct { + X *[]byte + }{}, + output: "C180", + }, + { + val: struct { + X *[2]byte + }{}, + output: "C180", + }, + { + val: struct { + X *uint64 + }{}, + output: "C180", + }, + { + val: struct { + X *uint64 `rlp:"nilList"` + }{}, + output: "C1C0", + }, + { + val: struct { + X *[]uint64 + }{}, + output: "C1C0", + }, + { + val: struct { + X *[]uint64 `rlp:"nilString"` + }{}, + output: "C180", + }, + // interfaces {val: []io.Reader{reader}, output: "C3C20102"}, // the contained value is a struct // Encoder - {val: (*testEncoder)(nil), output: "00000000"}, + {val: (*testEncoder)(nil), output: "C0"}, {val: &testEncoder{}, output: "00010001000100010001"}, {val: &testEncoder{errors.New("test error")}, error: "test error"}, - // verify that the Encoder interface works for unsupported types like func(). - {val: undecodableEncoder(func() {}), output: "C0"}, - // verify that pointer method testEncoder.EncodeRLP is called for + {val: struct{ E testEncoderValueMethod }{}, output: "C3FAFEF0"}, + {val: struct{ E *testEncoderValueMethod }{}, output: "C1C0"}, + + // Verify that the Encoder interface works for unsupported types like func(). + {val: undecodableEncoder(func() {}), output: "F5F5F5"}, + + // Verify that pointer method testEncoder.EncodeRLP is called for // addressable non-pointer values. {val: &struct{ TE testEncoder }{testEncoder{}}, output: "CA00010001000100010001"}, {val: &struct{ TE testEncoder }{testEncoder{errors.New("test error")}}, error: "test error"}, - // verify the error for non-addressable non-pointer Encoder - {val: testEncoder{}, error: "rlp: game over: unadressable value of type rlp.testEncoder, EncodeRLP is pointer method"}, - // verify the special case for []byte + + // Verify the error for non-addressable non-pointer Encoder. + {val: testEncoder{}, error: "rlp: unadressable value of type rlp.testEncoder, EncodeRLP is pointer method"}, + + // Verify Encoder takes precedence over []byte. {val: []byteEncoder{0, 1, 2, 3, 4}, output: "C5C0C0C0C0C0"}, } diff --git a/rlp/encoder_example_test.go b/rlp/encoder_example_test.go index 1cffa241c259..42c1c5c89064 100644 --- a/rlp/encoder_example_test.go +++ b/rlp/encoder_example_test.go @@ -28,15 +28,7 @@ type MyCoolType struct { // EncodeRLP writes x as RLP list [a, b] that omits the Name field. func (x *MyCoolType) EncodeRLP(w io.Writer) (err error) { - // Note: the receiver can be a nil pointer. This allows you to - // control the encoding of nil, but it also means that you have to - // check for a nil receiver. - if x == nil { - err = Encode(w, []uint{0, 0}) - } else { - err = Encode(w, []uint{x.a, x.b}) - } - return err + return Encode(w, []uint{x.a, x.b}) } func ExampleEncoder() { @@ -49,6 +41,6 @@ func ExampleEncoder() { fmt.Printf("%v → %X\n", t, bytes) // Output: - // → C28080 + // → C0 // &{foobar 5 6} → C20506 } diff --git a/rlp/typecache.go b/rlp/typecache.go index ab5ee3da76ba..e9a1e3f9e26a 100644 --- a/rlp/typecache.go +++ b/rlp/typecache.go @@ -35,22 +35,28 @@ type typeinfo struct { writerErr error // error from makeWriter } -// represents struct tags +// tags represents struct tags. type tags struct { // rlp:"nil" controls whether empty input results in a nil pointer. nilOK bool + + // This controls whether nil pointers are encoded/decoded as empty strings + // or empty lists. + nilKind Kind + // rlp:"tail" controls whether this field swallows additional list // elements. It can only be set for the last field, which must be // of slice type. tail bool + // rlp:"-" ignores fields. ignored bool } +// typekey is the key of a type in typeCache. It includes the struct tags because +// they might generate a different decoder. type typekey struct { reflect.Type - // the key must include the struct tags because they - // might generate a different decoder. tags } @@ -120,6 +126,25 @@ func structFields(typ reflect.Type) (fields []field, err error) { return fields, nil } +type structFieldError struct { + typ reflect.Type + field int + err error +} + +func (e structFieldError) Error() string { + return fmt.Sprintf("%v (struct field %v.%s)", e.err, e.typ, e.typ.Field(e.field).Name) +} + +type structTagError struct { + typ reflect.Type + field, tag, err string +} + +func (e structTagError) Error() string { + return fmt.Sprintf("rlp: invalid struct tag %q for %v.%s (%s)", e.tag, e.typ, e.field, e.err) +} + func parseStructTag(typ reflect.Type, fi, lastPublic int) (tags, error) { f := typ.Field(fi) var ts tags @@ -128,15 +153,26 @@ func parseStructTag(typ reflect.Type, fi, lastPublic int) (tags, error) { case "": case "-": ts.ignored = true - case "nil": + case "nil", "nilString", "nilList": ts.nilOK = true + if f.Type.Kind() != reflect.Ptr { + return ts, structTagError{typ, f.Name, t, "field is not a pointer"} + } + switch t { + case "nil": + ts.nilKind = defaultNilKind(f.Type.Elem()) + case "nilString": + ts.nilKind = String + case "nilList": + ts.nilKind = List + } case "tail": ts.tail = true if fi != lastPublic { - return ts, fmt.Errorf(`rlp: invalid struct tag "tail" for %v.%s (must be on last field)`, typ, f.Name) + return ts, structTagError{typ, f.Name, t, "must be on last field"} } if f.Type.Kind() != reflect.Slice { - return ts, fmt.Errorf(`rlp: invalid struct tag "tail" for %v.%s (field type is not slice)`, typ, f.Name) + return ts, structTagError{typ, f.Name, t, "field type is not slice"} } default: return ts, fmt.Errorf("rlp: unknown struct tag %q on %v.%s", t, typ, f.Name) @@ -160,6 +196,20 @@ func (i *typeinfo) generate(typ reflect.Type, tags tags) { i.writer, i.writerErr = makeWriter(typ, tags) } +// defaultNilKind determines whether a nil pointer to typ encodes/decodes +// as an empty string or empty list. +func defaultNilKind(typ reflect.Type) Kind { + k := typ.Kind() + if isUint(k) || k == reflect.String || k == reflect.Bool || isByteArray(typ) { + return String + } + return List +} + func isUint(k reflect.Kind) bool { return k >= reflect.Uint && k <= reflect.Uintptr } + +func isByteArray(typ reflect.Type) bool { + return (typ.Kind() == reflect.Slice || typ.Kind() == reflect.Array) && isByte(typ.Elem()) +} From 16f0fb70f17838e6e3db0230034f9da15b7aeedb Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Fri, 13 Sep 2019 22:32:20 +0200 Subject: [PATCH 15/50] cmd/evm: make evm default to all ethash protocol changes --- cmd/evm/runner.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/evm/runner.go b/cmd/evm/runner.go index 318aa222a33a..3e8ecf6c3c5c 100644 --- a/cmd/evm/runner.go +++ b/cmd/evm/runner.go @@ -198,6 +198,8 @@ func runCmd(ctx *cli.Context) error { if chainConfig != nil { runtimeConfig.ChainConfig = chainConfig + } else { + runtimeConfig.ChainConfig = params.AllEthashProtocolChanges } tstart := time.Now() var leftOverGas uint64 From 223b950944f494a5b4e0957fd9f92c48b09037ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Mon, 12 Aug 2019 22:56:07 +0300 Subject: [PATCH 16/50] core/state: accumulate writes and only update tries when must --- core/state/state_object.go | 55 +++++++++---- core/state/statedb.go | 161 +++++++++++++++++++++---------------- core/state/statedb_test.go | 35 ++++++++ 3 files changed, 167 insertions(+), 84 deletions(-) diff --git a/core/state/state_object.go b/core/state/state_object.go index 4967c7046508..f9d7559d866e 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -79,9 +79,10 @@ type stateObject struct { trie Trie // storage trie, which becomes non-nil on first access code Code // contract bytecode, which gets set when code is loaded - originStorage Storage // Storage cache of original entries to dedup rewrites - dirtyStorage Storage // Storage entries that need to be flushed to disk - fakeStorage Storage // Fake storage which constructed by caller for debugging purpose. + originStorage Storage // Storage cache of original entries to dedup rewrites, reset for every transaction + pendingStorage Storage // Storage entries that need to be flushed to disk, at the end of an entire block + dirtyStorage Storage // Storage entries that have been modified in the current transaction execution + fakeStorage Storage // Fake storage which constructed by caller for debugging purpose. // Cache flags. // When an object is marked suicided it will be delete from the trie @@ -113,13 +114,17 @@ func newObject(db *StateDB, address common.Address, data Account) *stateObject { if data.CodeHash == nil { data.CodeHash = emptyCodeHash } + if data.Root == (common.Hash{}) { + data.Root = emptyRoot + } return &stateObject{ - db: db, - address: address, - addrHash: crypto.Keccak256Hash(address[:]), - data: data, - originStorage: make(Storage), - dirtyStorage: make(Storage), + db: db, + address: address, + addrHash: crypto.Keccak256Hash(address[:]), + data: data, + originStorage: make(Storage), + pendingStorage: make(Storage), + dirtyStorage: make(Storage), } } @@ -183,9 +188,11 @@ func (s *stateObject) GetCommittedState(db Database, key common.Hash) common.Has if s.fakeStorage != nil { return s.fakeStorage[key] } - // If we have the original value cached, return that - value, cached := s.originStorage[key] - if cached { + // If we have a pending write or clean cached, return that + if value, pending := s.pendingStorage[key]; pending { + return value + } + if value, cached := s.originStorage[key]; cached { return value } // Track the amount of time wasted on reading the storage trie @@ -198,6 +205,7 @@ func (s *stateObject) GetCommittedState(db Database, key common.Hash) common.Has s.setError(err) return common.Hash{} } + var value common.Hash if len(enc) > 0 { _, content, _, err := rlp.Split(enc) if err != nil { @@ -252,17 +260,29 @@ func (s *stateObject) setState(key, value common.Hash) { s.dirtyStorage[key] = value } +// finalise moves all dirty storage slots into the pending area to be hashed or +// committed later. It is invoked at the end of every transaction. +func (s *stateObject) finalise() { + for key, value := range s.dirtyStorage { + s.pendingStorage[key] = value + } + if len(s.dirtyStorage) > 0 { + s.dirtyStorage = make(Storage) + } +} + // updateTrie writes cached storage modifications into the object's storage trie. func (s *stateObject) updateTrie(db Database) Trie { + // Make sure all dirty slots are finalized into the pending storage area + s.finalise() + // Track the amount of time wasted on updating the storge trie if metrics.EnabledExpensive { defer func(start time.Time) { s.db.StorageUpdates += time.Since(start) }(time.Now()) } - // Update all the dirty slots in the trie + // Insert all the pending updates into the trie tr := s.getTrie(db) - for key, value := range s.dirtyStorage { - delete(s.dirtyStorage, key) - + for key, value := range s.pendingStorage { // Skip noop changes, persist actual changes if value == s.originStorage[key] { continue @@ -277,6 +297,9 @@ func (s *stateObject) updateTrie(db Database) Trie { v, _ := rlp.EncodeToBytes(common.TrimLeftZeroes(value[:])) s.setError(tr.TryUpdate(key[:], v)) } + if len(s.pendingStorage) > 0 { + s.pendingStorage = make(Storage) + } return tr } diff --git a/core/state/statedb.go b/core/state/statedb.go index b07f08fd2121..9034d553361d 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -67,8 +67,9 @@ type StateDB struct { trie Trie // This map holds 'live' objects, which will get modified while processing a state transition. - stateObjects map[common.Address]*stateObject - stateObjectsDirty map[common.Address]struct{} + stateObjects map[common.Address]*stateObject + stateObjectsPending map[common.Address]struct{} // State objects finalized but not yet written to the trie + stateObjectsDirty map[common.Address]struct{} // State objects modified in the current execution // DB error. // State objects are used by the consensus core and VM which are @@ -111,13 +112,14 @@ func New(root common.Hash, db Database) (*StateDB, error) { return nil, err } return &StateDB{ - db: db, - trie: tr, - stateObjects: make(map[common.Address]*stateObject), - stateObjectsDirty: make(map[common.Address]struct{}), - logs: make(map[common.Hash][]*types.Log), - preimages: make(map[common.Hash][]byte), - journal: newJournal(), + db: db, + trie: tr, + stateObjects: make(map[common.Address]*stateObject), + stateObjectsPending: make(map[common.Address]struct{}), + stateObjectsDirty: make(map[common.Address]struct{}), + logs: make(map[common.Hash][]*types.Log), + preimages: make(map[common.Hash][]byte), + journal: newJournal(), }, nil } @@ -141,6 +143,7 @@ func (self *StateDB) Reset(root common.Hash) error { } self.trie = tr self.stateObjects = make(map[common.Address]*stateObject) + self.stateObjectsPending = make(map[common.Address]struct{}) self.stateObjectsDirty = make(map[common.Address]struct{}) self.thash = common.Hash{} self.bhash = common.Hash{} @@ -421,15 +424,15 @@ func (self *StateDB) Suicide(addr common.Address) bool { // // updateStateObject writes the given object to the trie. -func (s *StateDB) updateStateObject(stateObject *stateObject) { +func (s *StateDB) updateStateObject(obj *stateObject) { // Track the amount of time wasted on updating the account from the trie if metrics.EnabledExpensive { defer func(start time.Time) { s.AccountUpdates += time.Since(start) }(time.Now()) } // Encode the account and update the account trie - addr := stateObject.Address() + addr := obj.Address() - data, err := rlp.EncodeToBytes(stateObject) + data, err := rlp.EncodeToBytes(obj) if err != nil { panic(fmt.Errorf("can't encode object at %x: %v", addr[:], err)) } @@ -437,25 +440,33 @@ func (s *StateDB) updateStateObject(stateObject *stateObject) { } // deleteStateObject removes the given object from the state trie. -func (s *StateDB) deleteStateObject(stateObject *stateObject) { +func (s *StateDB) deleteStateObject(obj *stateObject) { // Track the amount of time wasted on deleting the account from the trie if metrics.EnabledExpensive { defer func(start time.Time) { s.AccountUpdates += time.Since(start) }(time.Now()) } // Delete the account from the trie - stateObject.deleted = true - - addr := stateObject.Address() + addr := obj.Address() s.setError(s.trie.TryDelete(addr[:])) } -// Retrieve a state object given by the address. Returns nil if not found. -func (s *StateDB) getStateObject(addr common.Address) (stateObject *stateObject) { - // Prefer live objects +// getStateObject retrieves a state object given by the address, returning nil if +// the object is not found or was deleted in this execution context. If you need +// to differentiate between non-existent/just-deleted, use getDeletedStateObject. +func (s *StateDB) getStateObject(addr common.Address) *stateObject { + if obj := s.getDeletedStateObject(addr); obj != nil && !obj.deleted { + return obj + } + return nil +} + +// getDeletedStateObject is similar to getStateObject, but instead of returning +// nil for a deleted state object, it returns the actual object with the deleted +// flag set. This is needed by the state journal to revert to the correct self- +// destructed object instead of wiping all knowledge about the state object. +func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject { + // Prefer live objects if any is available if obj := s.stateObjects[addr]; obj != nil { - if obj.deleted { - return nil - } return obj } // Track the amount of time wasted on loading the object from the database @@ -486,7 +497,7 @@ func (self *StateDB) setStateObject(object *stateObject) { // Retrieve a state object or create a new state object if nil. func (self *StateDB) GetOrNewStateObject(addr common.Address) *stateObject { stateObject := self.getStateObject(addr) - if stateObject == nil || stateObject.deleted { + if stateObject == nil { stateObject, _ = self.createObject(addr) } return stateObject @@ -495,7 +506,8 @@ func (self *StateDB) GetOrNewStateObject(addr common.Address) *stateObject { // createObject creates a new state object. If there is an existing account with // the given address, it is overwritten and returned as the second return value. func (self *StateDB) createObject(addr common.Address) (newobj, prev *stateObject) { - prev = self.getStateObject(addr) + prev = self.getDeletedStateObject(addr) // Note, prev might have been deleted, we need that! + newobj = newObject(self, addr, Account{}) newobj.setNonce(0) // sets the object to dirty if prev == nil { @@ -558,15 +570,16 @@ func (db *StateDB) ForEachStorage(addr common.Address, cb func(key, value common func (self *StateDB) Copy() *StateDB { // Copy all the basic fields, initialize the memory ones state := &StateDB{ - db: self.db, - trie: self.db.CopyTrie(self.trie), - stateObjects: make(map[common.Address]*stateObject, len(self.journal.dirties)), - stateObjectsDirty: make(map[common.Address]struct{}, len(self.journal.dirties)), - refund: self.refund, - logs: make(map[common.Hash][]*types.Log, len(self.logs)), - logSize: self.logSize, - preimages: make(map[common.Hash][]byte, len(self.preimages)), - journal: newJournal(), + db: self.db, + trie: self.db.CopyTrie(self.trie), + stateObjects: make(map[common.Address]*stateObject, len(self.journal.dirties)), + stateObjectsPending: make(map[common.Address]struct{}, len(self.stateObjectsPending)), + stateObjectsDirty: make(map[common.Address]struct{}, len(self.journal.dirties)), + refund: self.refund, + logs: make(map[common.Hash][]*types.Log, len(self.logs)), + logSize: self.logSize, + preimages: make(map[common.Hash][]byte, len(self.preimages)), + journal: newJournal(), } // Copy the dirty states, logs, and preimages for addr := range self.journal.dirties { @@ -582,11 +595,17 @@ func (self *StateDB) Copy() *StateDB { // Above, we don't copy the actual journal. This means that if the copy is copied, the // loop above will be a no-op, since the copy's journal is empty. // Thus, here we iterate over stateObjects, to enable copies of copies + for addr := range self.stateObjectsPending { + if _, exist := state.stateObjects[addr]; !exist { + state.stateObjects[addr] = self.stateObjects[addr].deepCopy(state) + } + state.stateObjectsPending[addr] = struct{}{} + } for addr := range self.stateObjectsDirty { if _, exist := state.stateObjects[addr]; !exist { state.stateObjects[addr] = self.stateObjects[addr].deepCopy(state) - state.stateObjectsDirty[addr] = struct{}{} } + state.stateObjectsDirty[addr] = struct{}{} } for hash, logs := range self.logs { cpy := make([]*types.Log, len(logs)) @@ -631,11 +650,12 @@ func (self *StateDB) GetRefund() uint64 { return self.refund } -// Finalise finalises the state by removing the self destructed objects -// and clears the journal as well as the refunds. +// Finalise finalises the state by removing the self destructed objects and clears +// the journal as well as the refunds. Finalise, however, will not push any updates +// into the tries just yet. Only IntermediateRoot or Commit will do that. func (s *StateDB) Finalise(deleteEmptyObjects bool) { for addr := range s.journal.dirties { - stateObject, exist := s.stateObjects[addr] + obj, exist := s.stateObjects[addr] if !exist { // ripeMD is 'touched' at block 1714175, in tx 0x1237f737031e40bcde4a8b7e717b2d15e3ecadfe49bb1bbc71ee9deb09c6fcf2 // That tx goes out of gas, and although the notion of 'touched' does not exist there, the @@ -645,13 +665,12 @@ func (s *StateDB) Finalise(deleteEmptyObjects bool) { // Thus, we can safely ignore it here continue } - - if stateObject.suicided || (deleteEmptyObjects && stateObject.empty()) { - s.deleteStateObject(stateObject) + if obj.suicided || (deleteEmptyObjects && obj.empty()) { + obj.deleted = true } else { - stateObject.updateRoot(s.db) - s.updateStateObject(stateObject) + obj.finalise() } + s.stateObjectsPending[addr] = struct{}{} s.stateObjectsDirty[addr] = struct{}{} } // Invalidate journal because reverting across transactions is not allowed. @@ -662,8 +681,21 @@ func (s *StateDB) Finalise(deleteEmptyObjects bool) { // It is called in between transactions to get the root hash that // goes into transaction receipts. func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash { + // Finalise all the dirty storage states and write them into the tries s.Finalise(deleteEmptyObjects) + for addr := range s.stateObjectsPending { + obj := s.stateObjects[addr] + if obj.deleted { + s.deleteStateObject(obj) + } else { + obj.updateRoot(s.db) + s.updateStateObject(obj) + } + } + if len(s.stateObjectsPending) > 0 { + s.stateObjectsPending = make(map[common.Address]struct{}) + } // Track the amount of time wasted on hashing the account trie if metrics.EnabledExpensive { defer func(start time.Time) { s.AccountHashes += time.Since(start) }(time.Now()) @@ -680,46 +712,40 @@ func (self *StateDB) Prepare(thash, bhash common.Hash, ti int) { } func (s *StateDB) clearJournalAndRefund() { - s.journal = newJournal() - s.validRevisions = s.validRevisions[:0] - s.refund = 0 + if len(s.journal.entries) > 0 { + s.journal = newJournal() + s.refund = 0 + } + s.validRevisions = s.validRevisions[:0] // Snapshots can be created without journal entires } // Commit writes the state to the underlying in-memory trie database. -func (s *StateDB) Commit(deleteEmptyObjects bool) (root common.Hash, err error) { - defer s.clearJournalAndRefund() +func (s *StateDB) Commit(deleteEmptyObjects bool) (common.Hash, error) { + // Finalize any pending changes and merge everything into the tries + s.IntermediateRoot(deleteEmptyObjects) - for addr := range s.journal.dirties { - s.stateObjectsDirty[addr] = struct{}{} - } // Commit objects to the trie, measuring the elapsed time - for addr, stateObject := range s.stateObjects { - _, isDirty := s.stateObjectsDirty[addr] - switch { - case stateObject.suicided || (isDirty && deleteEmptyObjects && stateObject.empty()): - // If the object has been removed, don't bother syncing it - // and just mark it for deletion in the trie. - s.deleteStateObject(stateObject) - case isDirty: + for addr := range s.stateObjectsDirty { + if obj := s.stateObjects[addr]; !obj.deleted { // Write any contract code associated with the state object - if stateObject.code != nil && stateObject.dirtyCode { - s.db.TrieDB().InsertBlob(common.BytesToHash(stateObject.CodeHash()), stateObject.code) - stateObject.dirtyCode = false + if obj.code != nil && obj.dirtyCode { + s.db.TrieDB().InsertBlob(common.BytesToHash(obj.CodeHash()), obj.code) + obj.dirtyCode = false } - // Write any storage changes in the state object to its storage trie. - if err := stateObject.CommitTrie(s.db); err != nil { + // Write any storage changes in the state object to its storage trie + if err := obj.CommitTrie(s.db); err != nil { return common.Hash{}, err } - // Update the object in the main account trie. - s.updateStateObject(stateObject) } - delete(s.stateObjectsDirty, addr) + } + if len(s.stateObjectsDirty) > 0 { + s.stateObjectsDirty = make(map[common.Address]struct{}) } // Write the account trie changes, measuing the amount of wasted time if metrics.EnabledExpensive { defer func(start time.Time) { s.AccountCommits += time.Since(start) }(time.Now()) } - root, err = s.trie.Commit(func(leaf []byte, parent common.Hash) error { + return s.trie.Commit(func(leaf []byte, parent common.Hash) error { var account Account if err := rlp.DecodeBytes(leaf, &account); err != nil { return nil @@ -733,5 +759,4 @@ func (s *StateDB) Commit(deleteEmptyObjects bool) (root common.Hash, err error) } return nil }) - return root, err } diff --git a/core/state/statedb_test.go b/core/state/statedb_test.go index bf073bc94827..bb3b87ead2e7 100644 --- a/core/state/statedb_test.go +++ b/core/state/statedb_test.go @@ -449,3 +449,38 @@ func TestCopyOfCopy(t *testing.T) { t.Fatalf("2nd copy fail, expected 42, got %v", got) } } + +// TestDeleteCreateRevert tests a weird state transition corner case that we hit +// while changing the internals of statedb. The workflow is that a contract is +// self destructed, then in a followup transaction (but same block) it's created +// again and the transaction reverted. +// +// The original statedb implementation flushed dirty objects to the tries after +// each transaction, so this works ok. The rework accumulated writes in memory +// first, but the journal wiped the entire state object on create-revert. +func TestDeleteCreateRevert(t *testing.T) { + // Create an initial state with a single contract + state, _ := New(common.Hash{}, NewDatabase(rawdb.NewMemoryDatabase())) + + addr := toAddr([]byte("so")) + state.SetBalance(addr, big.NewInt(1)) + + root, _ := state.Commit(false) + state.Reset(root) + + // Simulate self-destructing in one transaction, then create-reverting in another + state.Suicide(addr) + state.Finalise(true) + + id := state.Snapshot() + state.SetBalance(addr, big.NewInt(2)) + state.RevertToSnapshot(id) + + // Commit the entire state and make sure we don't crash and have the correct state + root, _ = state.Commit(true) + state.Reset(root) + + if state.getStateObject(addr) != nil { + t.Fatalf("self-destructed contract came alive") + } +} From f49d6e5ec09b740ae88c3a04edbe60b357b81991 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Mon, 16 Sep 2019 11:39:41 +0300 Subject: [PATCH 17/50] core: add blockchain test too for revert cornercase --- core/blockchain_test.go | 75 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/core/blockchain_test.go b/core/blockchain_test.go index db624c4dc0c7..a0fa50678382 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -2287,3 +2287,78 @@ func TestSideImportPrunedBlocks(t *testing.T) { t.Errorf("Got error, %v", err) } } + +// TestDeleteCreateRevert tests a weird state transition corner case that we hit +// while changing the internals of statedb. The workflow is that a contract is +// self destructed, then in a followup transaction (but same block) it's created +// again and the transaction reverted. +// +// The original statedb implementation flushed dirty objects to the tries after +// each transaction, so this works ok. The rework accumulated writes in memory +// first, but the journal wiped the entire state object on create-revert. +func TestDeleteCreateRevert(t *testing.T) { + var ( + aa = common.HexToAddress("0x000000000000000000000000000000000000aaaa") + bb = common.HexToAddress("0x000000000000000000000000000000000000bbbb") + // Generate a canonical chain to act as the main dataset + engine = ethash.NewFaker() + db = rawdb.NewMemoryDatabase() + + // A sender who makes transactions, has some funds + key, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") + address = crypto.PubkeyToAddress(key.PublicKey) + funds = big.NewInt(1000000000) + gspec = &Genesis{ + Config: params.TestChainConfig, + Alloc: GenesisAlloc{ + address: {Balance: funds}, + // The address 0xAAAAA selfdestructs if called + aa: { + // Code needs to just selfdestruct + Code: []byte{byte(vm.PC), 0xFF}, + Nonce: 1, + Balance: big.NewInt(0), + }, + // The address 0xBBBB send 1 wei to 0xAAAA, then reverts + bb: { + Code: []byte{ + byte(vm.PC), // [0] + byte(vm.DUP1), // [0,0] + byte(vm.DUP1), // [0,0,0] + byte(vm.DUP1), // [0,0,0,0] + byte(vm.PUSH1), 0x01, // [0,0,0,0,1] (value) + byte(vm.PUSH2), 0xaa, 0xaa, // [0,0,0,0,1, 0xaaaa] + byte(vm.GAS), + byte(vm.CALL), + byte(vm.REVERT), + }, + Balance: big.NewInt(1), + }, + }, + } + genesis = gspec.MustCommit(db) + ) + + blocks, _ := GenerateChain(params.TestChainConfig, genesis, engine, db, 1, func(i int, b *BlockGen) { + b.SetCoinbase(common.Address{1}) + // One transaction to AAAA + tx, _ := types.SignTx(types.NewTransaction(0, aa, + big.NewInt(0), 50000, big.NewInt(1), nil), types.HomesteadSigner{}, key) + b.AddTx(tx) + // One transaction to BBBB + tx, _ = types.SignTx(types.NewTransaction(1, bb, + big.NewInt(0), 100000, big.NewInt(1), nil), types.HomesteadSigner{}, key) + b.AddTx(tx) + }) + // Import the canonical chain + diskdb := rawdb.NewMemoryDatabase() + gspec.MustCommit(diskdb) + + chain, err := NewBlockChain(diskdb, nil, params.TestChainConfig, engine, vm.Config{}, nil) + if err != nil { + t.Fatalf("failed to create tester chain: %v", err) + } + if n, err := chain.InsertChain(blocks); err != nil { + t.Fatalf("block %d: failed to insert into chain: %v", n, err) + } +} From b1c3010bf2c334241a8cb01eab110e5f1cd88f71 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Mon, 16 Sep 2019 11:16:30 +0200 Subject: [PATCH 18/50] common/mclock: clean up AfterFunc support (#20054) This change adds tests for the virtual clock and aligns the interface with the time package by renaming Cancel to Stop. It also removes the binary search from Stop because it complicates the code unnecessarily. --- common/mclock/mclock.go | 30 ++++----- common/mclock/simclock.go | 72 +++++++++------------ common/mclock/simclock_test.go | 115 +++++++++++++++++++++++++++++++++ les/balance.go | 6 +- 4 files changed, 158 insertions(+), 65 deletions(-) create mode 100644 common/mclock/simclock_test.go diff --git a/common/mclock/mclock.go b/common/mclock/mclock.go index 0c941082f3b1..d0e0cd78be96 100644 --- a/common/mclock/mclock.go +++ b/common/mclock/mclock.go @@ -36,47 +36,39 @@ func (t AbsTime) Add(d time.Duration) AbsTime { return t + AbsTime(d) } -// Clock interface makes it possible to replace the monotonic system clock with +// The Clock interface makes it possible to replace the monotonic system clock with // a simulated clock. type Clock interface { Now() AbsTime Sleep(time.Duration) After(time.Duration) <-chan time.Time - AfterFunc(d time.Duration, f func()) Event + AfterFunc(d time.Duration, f func()) Timer } -// Event represents a cancellable event returned by AfterFunc -type Event interface { - Cancel() bool +// Timer represents a cancellable event returned by AfterFunc +type Timer interface { + Stop() bool } // System implements Clock using the system clock. type System struct{} -// Now implements Clock. +// Now returns the current monotonic time. func (System) Now() AbsTime { return AbsTime(monotime.Now()) } -// Sleep implements Clock. +// Sleep blocks for the given duration. func (System) Sleep(d time.Duration) { time.Sleep(d) } -// After implements Clock. +// After returns a channel which receives the current time after d has elapsed. func (System) After(d time.Duration) <-chan time.Time { return time.After(d) } -// AfterFunc implements Clock. -func (System) AfterFunc(d time.Duration, f func()) Event { - return (*SystemEvent)(time.AfterFunc(d, f)) -} - -// SystemEvent implements Event using time.Timer. -type SystemEvent time.Timer - -// Cancel implements Event. -func (e *SystemEvent) Cancel() bool { - return (*time.Timer)(e).Stop() +// AfterFunc runs f on a new goroutine after the duration has elapsed. +func (System) AfterFunc(d time.Duration, f func()) Timer { + return time.AfterFunc(d, f) } diff --git a/common/mclock/simclock.go b/common/mclock/simclock.go index af0f71c430b4..4d351252ff32 100644 --- a/common/mclock/simclock.go +++ b/common/mclock/simclock.go @@ -32,22 +32,17 @@ import ( // the timeout using a channel or semaphore. type Simulated struct { now AbsTime - scheduled []event + scheduled []*simTimer mu sync.RWMutex cond *sync.Cond lastId uint64 } -type event struct { +// simTimer implements Timer on the virtual clock. +type simTimer struct { do func() at AbsTime id uint64 -} - -// SimulatedEvent implements Event for a virtual clock. -type SimulatedEvent struct { - at AbsTime - id uint64 s *Simulated } @@ -75,6 +70,7 @@ func (s *Simulated) Run(d time.Duration) { } } +// ActiveTimers returns the number of timers that haven't fired. func (s *Simulated) ActiveTimers() int { s.mu.RLock() defer s.mu.RUnlock() @@ -82,6 +78,7 @@ func (s *Simulated) ActiveTimers() int { return len(s.scheduled) } +// WaitForTimers waits until the clock has at least n scheduled timers. func (s *Simulated) WaitForTimers(n int) { s.mu.Lock() defer s.mu.Unlock() @@ -92,7 +89,7 @@ func (s *Simulated) WaitForTimers(n int) { } } -// Now implements Clock. +// Now returns the current virtual time. func (s *Simulated) Now() AbsTime { s.mu.RLock() defer s.mu.RUnlock() @@ -100,12 +97,13 @@ func (s *Simulated) Now() AbsTime { return s.now } -// Sleep implements Clock. +// Sleep blocks until the clock has advanced by d. func (s *Simulated) Sleep(d time.Duration) { <-s.After(d) } -// After implements Clock. +// After returns a channel which receives the current time after the clock +// has advanced by d. func (s *Simulated) After(d time.Duration) <-chan time.Time { after := make(chan time.Time, 1) s.AfterFunc(d, func() { @@ -114,8 +112,9 @@ func (s *Simulated) After(d time.Duration) <-chan time.Time { return after } -// AfterFunc implements Clock. -func (s *Simulated) AfterFunc(d time.Duration, do func()) Event { +// AfterFunc runs fn after the clock has advanced by d. Unlike with the system +// clock, fn runs on the goroutine that calls Run. +func (s *Simulated) AfterFunc(d time.Duration, fn func()) Timer { s.mu.Lock() defer s.mu.Unlock() s.init() @@ -133,44 +132,31 @@ func (s *Simulated) AfterFunc(d time.Duration, do func()) Event { l = m + 1 } } - s.scheduled = append(s.scheduled, event{}) + ev := &simTimer{do: fn, at: at, s: s} + s.scheduled = append(s.scheduled, nil) copy(s.scheduled[l+1:], s.scheduled[l:ll]) - e := event{do: do, at: at, id: id} - s.scheduled[l] = e + s.scheduled[l] = ev s.cond.Broadcast() - return &SimulatedEvent{at: at, id: id, s: s} -} - -func (s *Simulated) init() { - if s.cond == nil { - s.cond = sync.NewCond(&s.mu) - } + return ev } -// Cancel implements Event. -func (e *SimulatedEvent) Cancel() bool { - s := e.s +func (ev *simTimer) Stop() bool { + s := ev.s s.mu.Lock() defer s.mu.Unlock() - l, h := 0, len(s.scheduled) - ll := h - for l != h { - m := (l + h) / 2 - if e.id == s.scheduled[m].id { - l = m - break - } - if (e.at < s.scheduled[m].at) || ((e.at == s.scheduled[m].at) && (e.id < s.scheduled[m].id)) { - h = m - } else { - l = m + 1 + for i := 0; i < len(s.scheduled); i++ { + if s.scheduled[i] == ev { + s.scheduled = append(s.scheduled[:i], s.scheduled[i+1:]...) + s.cond.Broadcast() + return true } } - if l >= ll || s.scheduled[l].id != e.id { - return false + return false +} + +func (s *Simulated) init() { + if s.cond == nil { + s.cond = sync.NewCond(&s.mu) } - copy(s.scheduled[l:ll-1], s.scheduled[l+1:]) - s.scheduled = s.scheduled[:ll-1] - return true } diff --git a/common/mclock/simclock_test.go b/common/mclock/simclock_test.go new file mode 100644 index 000000000000..09e4391c1c09 --- /dev/null +++ b/common/mclock/simclock_test.go @@ -0,0 +1,115 @@ +// Copyright 2018 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + +package mclock + +import ( + "testing" + "time" +) + +var _ Clock = System{} +var _ Clock = new(Simulated) + +func TestSimulatedAfter(t *testing.T) { + const timeout = 30 * time.Minute + const adv = time.Minute + + var ( + c Simulated + end = c.Now().Add(timeout) + ch = c.After(timeout) + ) + for c.Now() < end.Add(-adv) { + c.Run(adv) + select { + case <-ch: + t.Fatal("Timer fired early") + default: + } + } + + c.Run(adv) + select { + case stamp := <-ch: + want := time.Time{}.Add(timeout) + if !stamp.Equal(want) { + t.Errorf("Wrong time sent on timer channel: got %v, want %v", stamp, want) + } + default: + t.Fatal("Timer didn't fire") + } +} + +func TestSimulatedAfterFunc(t *testing.T) { + var c Simulated + + called1 := false + timer1 := c.AfterFunc(100*time.Millisecond, func() { called1 = true }) + if c.ActiveTimers() != 1 { + t.Fatalf("%d active timers, want one", c.ActiveTimers()) + } + if fired := timer1.Stop(); !fired { + t.Fatal("Stop returned false even though timer didn't fire") + } + if c.ActiveTimers() != 0 { + t.Fatalf("%d active timers, want zero", c.ActiveTimers()) + } + if called1 { + t.Fatal("timer 1 called") + } + if fired := timer1.Stop(); fired { + t.Fatal("Stop returned true after timer was already stopped") + } + + called2 := false + timer2 := c.AfterFunc(100*time.Millisecond, func() { called2 = true }) + c.Run(50 * time.Millisecond) + if called2 { + t.Fatal("timer 2 called") + } + c.Run(51 * time.Millisecond) + if !called2 { + t.Fatal("timer 2 not called") + } + if fired := timer2.Stop(); fired { + t.Fatal("Stop returned true after timer has fired") + } +} + +func TestSimulatedSleep(t *testing.T) { + var ( + c Simulated + timeout = 1 * time.Hour + done = make(chan AbsTime) + ) + go func() { + c.Sleep(timeout) + done <- c.Now() + }() + + c.WaitForTimers(1) + c.Run(2 * timeout) + select { + case stamp := <-done: + want := AbsTime(2 * timeout) + if stamp != want { + t.Errorf("Wrong time after sleep: got %v, want %v", stamp, want) + } + case <-time.After(5 * time.Second): + t.Fatal("Sleep didn't return in time") + } +} diff --git a/les/balance.go b/les/balance.go index 4f08a304ebea..a36a997cf3ad 100644 --- a/les/balance.go +++ b/les/balance.go @@ -42,7 +42,7 @@ type balanceTracker struct { negTimeFactor, negRequestFactor float64 sumReqCost uint64 lastUpdate, nextUpdate, initTime mclock.AbsTime - updateEvent mclock.Event + updateEvent mclock.Timer // since only a limited and fixed number of callbacks are needed, they are // stored in a fixed size array ordered by priority threshold. callbacks [balanceCallbackCount]balanceCallback @@ -86,7 +86,7 @@ func (bt *balanceTracker) stop(now mclock.AbsTime) { bt.timeFactor = 0 bt.requestFactor = 0 if bt.updateEvent != nil { - bt.updateEvent.Cancel() + bt.updateEvent.Stop() bt.updateEvent = nil } } @@ -235,7 +235,7 @@ func (bt *balanceTracker) checkCallbacks(now mclock.AbsTime) { // updateAfter schedules a balance update and callback check in the future func (bt *balanceTracker) updateAfter(dt time.Duration) { - if bt.updateEvent == nil || bt.updateEvent.Cancel() { + if bt.updateEvent == nil || bt.updateEvent.Stop() { if dt == 0 { bt.updateEvent = nil } else { From 8d41e885e6c4bd8d6c1bd08d385165dd41f7edf1 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Tue, 17 Sep 2019 09:34:28 +0200 Subject: [PATCH 19/50] core: smaller txpool status locking (#20080) * txpool: smaller lock portion * core/tx_pool: fix data race --- core/tx_pool.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/core/tx_pool.go b/core/tx_pool.go index 161489cc5a99..e25877a1aa56 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -803,19 +803,22 @@ func (pool *TxPool) addTxsLocked(txs []*types.Transaction, local bool) ([]error, // Status returns the status (unknown/pending/queued) of a batch of transactions // identified by their hashes. func (pool *TxPool) Status(hashes []common.Hash) []TxStatus { - pool.mu.RLock() - defer pool.mu.RUnlock() - status := make([]TxStatus, len(hashes)) for i, hash := range hashes { - if tx := pool.all.Get(hash); tx != nil { - from, _ := types.Sender(pool.signer, tx) // already validated - if pool.pending[from] != nil && pool.pending[from].txs.items[tx.Nonce()] != nil { - status[i] = TxStatusPending - } else { - status[i] = TxStatusQueued - } + tx := pool.Get(hash) + if tx == nil { + continue + } + from, _ := types.Sender(pool.signer, tx) // already validated + pool.mu.RLock() + if txList := pool.pending[from]; txList != nil && txList.txs.items[tx.Nonce()] != nil { + status[i] = TxStatusPending + } else if txList := pool.queue[from]; txList != nil && txList.txs.items[tx.Nonce()] != nil { + status[i] = TxStatusQueued } + // implicit else: the tx may have been included into a block between + // checking pool.Get and obtaining the lock. In that case, TxStatusUnknown is correct + pool.mu.RUnlock() } return status } From 056183c05634efeaee2bab6c3ace781f6da59cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Tue, 17 Sep 2019 15:50:34 +0300 Subject: [PATCH 20/50] core: dedup known transactions without global lock, track metrics --- core/tx_pool.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/core/tx_pool.go b/core/tx_pool.go index e25877a1aa56..d67be96e58c5 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -97,7 +97,8 @@ var ( queuedNofundsMeter = metrics.NewRegisteredMeter("txpool/queued/nofunds", nil) // Dropped due to out-of-funds // General tx metrics - validMeter = metrics.NewRegisteredMeter("txpool/valid", nil) + knownTxMeter = metrics.NewRegisteredMeter("txpool/known", nil) + validTxMeter = metrics.NewRegisteredMeter("txpool/valid", nil) invalidTxMeter = metrics.NewRegisteredMeter("txpool/invalid", nil) underpricedTxMeter = metrics.NewRegisteredMeter("txpool/underpriced", nil) @@ -564,16 +565,15 @@ func (pool *TxPool) add(tx *types.Transaction, local bool) (replaced bool, err e hash := tx.Hash() if pool.all.Get(hash) != nil { log.Trace("Discarding already known transaction", "hash", hash) + knownTxMeter.Mark(1) return false, fmt.Errorf("known transaction: %x", hash) } - // If the transaction fails basic validation, discard it if err := pool.validateTx(tx, local); err != nil { log.Trace("Discarding invalid transaction", "hash", hash, "err", err) invalidTxMeter.Mark(1) return false, err } - // If the transaction pool is full, discard underpriced transactions if uint64(pool.all.Count()) >= pool.config.GlobalSlots+pool.config.GlobalQueue { // If the new transaction is underpriced, don't accept it @@ -590,7 +590,6 @@ func (pool *TxPool) add(tx *types.Transaction, local bool) (replaced bool, err e pool.removeTx(tx.Hash(), false) } } - // Try to replace an existing transaction in the pending pool from, _ := types.Sender(pool.signer, tx) // already validated if list := pool.pending[from]; list != nil && list.Overlaps(tx) { @@ -613,13 +612,11 @@ func (pool *TxPool) add(tx *types.Transaction, local bool) (replaced bool, err e log.Trace("Pooled new executable transaction", "hash", hash, "from", from, "to", tx.To()) return old != nil, nil } - // New transaction isn't replacing a pending one, push into queue replaced, err = pool.enqueueTx(hash, tx) if err != nil { return false, err } - // Mark local addresses and journal local transactions if local { if !pool.locals.contains(from) { @@ -768,11 +765,18 @@ func (pool *TxPool) AddRemote(tx *types.Transaction) error { // addTxs attempts to queue a batch of transactions if they are valid. func (pool *TxPool) addTxs(txs []*types.Transaction, local, sync bool) []error { + // Filter out known ones without obtaining the pool lock or recovering signatures + for i := 0; i < len(txs); i++ { + if pool.all.Get(txs[i].Hash()) != nil { + knownTxMeter.Mark(1) + txs = append(txs[:i], txs[i+1:]...) + i-- + } + } // Cache senders in transactions before obtaining lock (pool.signer is immutable) for _, tx := range txs { types.Sender(pool.signer, tx) } - pool.mu.Lock() errs, dirtyAddrs := pool.addTxsLocked(txs, local) pool.mu.Unlock() @@ -796,7 +800,7 @@ func (pool *TxPool) addTxsLocked(txs []*types.Transaction, local bool) ([]error, dirty.addTx(tx) } } - validMeter.Mark(int64(len(dirty.accounts))) + validTxMeter.Mark(int64(len(dirty.accounts))) return errs, dirty } From 0ac9bbba6cd259bc9895e786121cdcb6e7c5d9d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felf=C3=B6ldi=20Zsolt?= Date: Tue, 17 Sep 2019 15:28:41 +0200 Subject: [PATCH 21/50] les: multiple server bugfixes (#20079) * les: detailed relative cost metrics * les: filter txpool relative request statistic * les: initialize price factors * les: increased connected bias to lower churn rate * les: fixed clientPool.setLimits * core: do not use mutex in GetAncestor * les: bump factor db version again * les: add metrics * les, light: minor fixes --- core/blockchain.go | 3 --- core/headerchain.go | 7 +++++-- les/clientpool.go | 16 +++++++++------- les/costtracker.go | 43 ++++++++++++++++++++++++++++++++++++++++--- les/metrics.go | 30 ++++++++++++++++++++++++------ les/server.go | 1 + les/server_handler.go | 8 ++++++++ light/lightchain.go | 3 --- 8 files changed, 87 insertions(+), 24 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 833de3bc7e69..1bf31b2399d1 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -2151,9 +2151,6 @@ func (bc *BlockChain) GetBlockHashesFromHash(hash common.Hash, max uint64) []com // // Note: ancestor == 0 returns the same block, 1 returns its parent and so on. func (bc *BlockChain) GetAncestor(hash common.Hash, number, ancestor uint64, maxNonCanonical *uint64) (common.Hash, uint64) { - bc.chainmu.RLock() - defer bc.chainmu.RUnlock() - return bc.hc.GetAncestor(hash, number, ancestor, maxNonCanonical) } diff --git a/core/headerchain.go b/core/headerchain.go index 034858f651cf..a2faa3303ae0 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -349,8 +349,11 @@ func (hc *HeaderChain) GetAncestor(hash common.Hash, number, ancestor uint64, ma } for ancestor != 0 { if rawdb.ReadCanonicalHash(hc.chainDb, number) == hash { - number -= ancestor - return rawdb.ReadCanonicalHash(hc.chainDb, number), number + ancestorHash := rawdb.ReadCanonicalHash(hc.chainDb, number-ancestor) + if rawdb.ReadCanonicalHash(hc.chainDb, number) == hash { + number -= ancestor + return ancestorHash, number + } } if *maxNonCanonical == 0 { return common.Hash{}, 0 diff --git a/les/clientpool.go b/les/clientpool.go index cff5f41edd5a..6773aab551f8 100644 --- a/les/clientpool.go +++ b/les/clientpool.go @@ -33,7 +33,7 @@ import ( const ( negBalanceExpTC = time.Hour // time constant for exponentially reducing negative balance fixedPointMultiplier = 0x1000000 // constant to convert logarithms to fixed point format - connectedBias = time.Minute // this bias is applied in favor of already connected clients in order to avoid kicking them out very soon + connectedBias = time.Minute * 5 // this bias is applied in favor of already connected clients in order to avoid kicking them out very soon lazyQueueRefresh = time.Second * 10 // refresh period of the connected queue ) @@ -366,12 +366,14 @@ func (f *clientPool) setLimits(count int, totalCap uint64) { f.countLimit = count f.capacityLimit = totalCap - now := mclock.Now() - f.connectedQueue.MultiPop(func(data interface{}, priority int64) bool { - c := data.(*clientInfo) - f.dropClient(c, now, true) - return f.connectedCapacity > f.capacityLimit || f.connectedQueue.Size() > f.countLimit - }) + if f.connectedCapacity > f.capacityLimit || f.connectedQueue.Size() > f.countLimit { + now := mclock.Now() + f.connectedQueue.MultiPop(func(data interface{}, priority int64) bool { + c := data.(*clientInfo) + f.dropClient(c, now, true) + return f.connectedCapacity > f.capacityLimit || f.connectedQueue.Size() > f.countLimit + }) + } } // requestCost feeds request cost after serving a request from the given peer. diff --git a/les/costtracker.go b/les/costtracker.go index d1f5b54ca5d0..81da04566007 100644 --- a/les/costtracker.go +++ b/les/costtracker.go @@ -28,6 +28,7 @@ import ( "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/les/flowcontrol" "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" ) const makeCostStats = false // make request cost statistics during operation @@ -87,7 +88,7 @@ const ( gfUsageTC = time.Second gfRaiseTC = time.Second * 200 gfDropTC = time.Second * 50 - gfDbKey = "_globalCostFactorV3" + gfDbKey = "_globalCostFactorV6" ) // costTracker is responsible for calculating costs and cost estimates on the @@ -226,6 +227,9 @@ type reqInfo struct { // servingTime is the CPU time corresponding to the actual processing of // the request. servingTime float64 + + // msgCode indicates the type of request. + msgCode uint64 } // gfLoop starts an event loop which updates the global cost factor which is @@ -269,11 +273,43 @@ func (ct *costTracker) gfLoop() { for { select { case r := <-ct.reqInfoCh: + relCost := int64(factor * r.servingTime * 100 / r.avgTimeCost) // Convert the value to a percentage form + + // Record more metrics if we are debugging + if metrics.EnabledExpensive { + switch r.msgCode { + case GetBlockHeadersMsg: + relativeCostHeaderHistogram.Update(relCost) + case GetBlockBodiesMsg: + relativeCostBodyHistogram.Update(relCost) + case GetReceiptsMsg: + relativeCostReceiptHistogram.Update(relCost) + case GetCodeMsg: + relativeCostCodeHistogram.Update(relCost) + case GetProofsV2Msg: + relativeCostProofHistogram.Update(relCost) + case GetHelperTrieProofsMsg: + relativeCostHelperProofHistogram.Update(relCost) + case SendTxV2Msg: + relativeCostSendTxHistogram.Update(relCost) + case GetTxStatusMsg: + relativeCostTxStatusHistogram.Update(relCost) + } + } + // SendTxV2 and GetTxStatus requests are two special cases. + // All other requests will only put pressure on the database, and + // the corresponding delay is relatively stable. While these two + // requests involve txpool query, which is usually unstable. + // + // TODO(rjl493456442) fixes this. + if r.msgCode == SendTxV2Msg || r.msgCode == GetTxStatusMsg { + continue + } requestServedMeter.Mark(int64(r.servingTime)) requestServedTimer.Update(time.Duration(r.servingTime)) requestEstimatedMeter.Mark(int64(r.avgTimeCost / factor)) requestEstimatedTimer.Update(time.Duration(r.avgTimeCost / factor)) - relativeCostHistogram.Update(int64(r.avgTimeCost / factor / r.servingTime)) + relativeCostHistogram.Update(relCost) now := mclock.Now() dt := float64(now - expUpdate) @@ -324,6 +360,7 @@ func (ct *costTracker) gfLoop() { default: } } + globalFactorGauge.Update(int64(1000 * factor)) log.Debug("global cost factor updated", "factor", factor) } } @@ -375,7 +412,7 @@ func (ct *costTracker) updateStats(code, amount, servingTime, realCost uint64) { avg := reqAvgTimeCost[code] avgTimeCost := avg.baseCost + amount*avg.reqCost select { - case ct.reqInfoCh <- reqInfo{float64(avgTimeCost), float64(servingTime)}: + case ct.reqInfoCh <- reqInfo{float64(avgTimeCost), float64(servingTime), code}: default: } if makeCostStats { diff --git a/les/metrics.go b/les/metrics.go index 797631b8ef7d..9ef8c365180c 100644 --- a/les/metrics.go +++ b/les/metrics.go @@ -60,6 +60,15 @@ var ( miscOutTxStatusPacketsMeter = metrics.NewRegisteredMeter("les/misc/out/packets/txStatus", nil) miscOutTxStatusTrafficMeter = metrics.NewRegisteredMeter("les/misc/out/traffic/txStatus", nil) + miscServingTimeHeaderTimer = metrics.NewRegisteredTimer("les/misc/serve/header", nil) + miscServingTimeBodyTimer = metrics.NewRegisteredTimer("les/misc/serve/body", nil) + miscServingTimeCodeTimer = metrics.NewRegisteredTimer("les/misc/serve/code", nil) + miscServingTimeReceiptTimer = metrics.NewRegisteredTimer("les/misc/serve/receipt", nil) + miscServingTimeTrieProofTimer = metrics.NewRegisteredTimer("les/misc/serve/proof", nil) + miscServingTimeHelperTrieTimer = metrics.NewRegisteredTimer("les/misc/serve/helperTrie", nil) + miscServingTimeTxTimer = metrics.NewRegisteredTimer("les/misc/serve/txs", nil) + miscServingTimeTxStatusTimer = metrics.NewRegisteredTimer("les/misc/serve/txStatus", nil) + connectionTimer = metrics.NewRegisteredTimer("les/connection/duration", nil) serverConnectionGauge = metrics.NewRegisteredGauge("les/connection/server", nil) clientConnectionGauge = metrics.NewRegisteredGauge("les/connection/client", nil) @@ -69,12 +78,21 @@ var ( totalConnectedGauge = metrics.NewRegisteredGauge("les/server/totalConnected", nil) blockProcessingTimer = metrics.NewRegisteredTimer("les/server/blockProcessingTime", nil) - requestServedMeter = metrics.NewRegisteredMeter("les/server/req/avgServedTime", nil) - requestServedTimer = metrics.NewRegisteredTimer("les/server/req/servedTime", nil) - requestEstimatedMeter = metrics.NewRegisteredMeter("les/server/req/avgEstimatedTime", nil) - requestEstimatedTimer = metrics.NewRegisteredTimer("les/server/req/estimatedTime", nil) - relativeCostHistogram = metrics.NewRegisteredHistogram("les/server/req/relative", nil, metrics.NewExpDecaySample(1028, 0.015)) - + requestServedMeter = metrics.NewRegisteredMeter("les/server/req/avgServedTime", nil) + requestServedTimer = metrics.NewRegisteredTimer("les/server/req/servedTime", nil) + requestEstimatedMeter = metrics.NewRegisteredMeter("les/server/req/avgEstimatedTime", nil) + requestEstimatedTimer = metrics.NewRegisteredTimer("les/server/req/estimatedTime", nil) + relativeCostHistogram = metrics.NewRegisteredHistogram("les/server/req/relative", nil, metrics.NewExpDecaySample(1028, 0.015)) + relativeCostHeaderHistogram = metrics.NewRegisteredHistogram("les/server/req/relative/header", nil, metrics.NewExpDecaySample(1028, 0.015)) + relativeCostBodyHistogram = metrics.NewRegisteredHistogram("les/server/req/relative/body", nil, metrics.NewExpDecaySample(1028, 0.015)) + relativeCostReceiptHistogram = metrics.NewRegisteredHistogram("les/server/req/relative/receipt", nil, metrics.NewExpDecaySample(1028, 0.015)) + relativeCostCodeHistogram = metrics.NewRegisteredHistogram("les/server/req/relative/code", nil, metrics.NewExpDecaySample(1028, 0.015)) + relativeCostProofHistogram = metrics.NewRegisteredHistogram("les/server/req/relative/proof", nil, metrics.NewExpDecaySample(1028, 0.015)) + relativeCostHelperProofHistogram = metrics.NewRegisteredHistogram("les/server/req/relative/helperTrie", nil, metrics.NewExpDecaySample(1028, 0.015)) + relativeCostSendTxHistogram = metrics.NewRegisteredHistogram("les/server/req/relative/txs", nil, metrics.NewExpDecaySample(1028, 0.015)) + relativeCostTxStatusHistogram = metrics.NewRegisteredHistogram("les/server/req/relative/txStatus", nil, metrics.NewExpDecaySample(1028, 0.015)) + + globalFactorGauge = metrics.NewRegisteredGauge("les/server/globalFactor", nil) recentServedGauge = metrics.NewRegisteredGauge("les/server/recentRequestServed", nil) recentEstimatedGauge = metrics.NewRegisteredGauge("les/server/recentRequestEstimated", nil) sqServedGauge = metrics.NewRegisteredGauge("les/server/servingQueue/served", nil) diff --git a/les/server.go b/les/server.go index 8e790323f6d7..592858cb91e4 100644 --- a/les/server.go +++ b/les/server.go @@ -113,6 +113,7 @@ func NewLesServer(e *eth.Ethereum, config *eth.Config) (*LesServer, error) { } srv.fcManager.SetCapacityLimits(srv.freeCapacity, maxCapacity, srv.freeCapacity*2) srv.clientPool = newClientPool(srv.chainDb, srv.freeCapacity, 10000, mclock.System{}, func(id enode.ID) { go srv.peers.Unregister(peerIdToString(id)) }) + srv.clientPool.setPriceFactors(priceFactors{0, 1, 1}, priceFactors{0, 1, 1}) checkpoint := srv.latestLocalCheckpoint() if !checkpoint.Empty() { diff --git a/les/server_handler.go b/les/server_handler.go index 79c0a08a91f6..16249ef1ba27 100644 --- a/les/server_handler.go +++ b/les/server_handler.go @@ -268,6 +268,7 @@ func (h *serverHandler) handleMsg(p *peer, wg *sync.WaitGroup) error { if metrics.EnabledExpensive { miscInHeaderPacketsMeter.Mark(1) miscInHeaderTrafficMeter.Mark(int64(msg.Size)) + defer func(start time.Time) { miscServingTimeHeaderTimer.UpdateSince(start) }(time.Now()) } var req struct { ReqID uint64 @@ -380,6 +381,7 @@ func (h *serverHandler) handleMsg(p *peer, wg *sync.WaitGroup) error { if metrics.EnabledExpensive { miscInBodyPacketsMeter.Mark(1) miscInBodyTrafficMeter.Mark(int64(msg.Size)) + defer func(start time.Time) { miscServingTimeBodyTimer.UpdateSince(start) }(time.Now()) } var req struct { ReqID uint64 @@ -428,6 +430,7 @@ func (h *serverHandler) handleMsg(p *peer, wg *sync.WaitGroup) error { if metrics.EnabledExpensive { miscInCodePacketsMeter.Mark(1) miscInCodeTrafficMeter.Mark(int64(msg.Size)) + defer func(start time.Time) { miscServingTimeCodeTimer.UpdateSince(start) }(time.Now()) } var req struct { ReqID uint64 @@ -499,6 +502,7 @@ func (h *serverHandler) handleMsg(p *peer, wg *sync.WaitGroup) error { if metrics.EnabledExpensive { miscInReceiptPacketsMeter.Mark(1) miscInReceiptTrafficMeter.Mark(int64(msg.Size)) + defer func(start time.Time) { miscServingTimeReceiptTimer.UpdateSince(start) }(time.Now()) } var req struct { ReqID uint64 @@ -555,6 +559,7 @@ func (h *serverHandler) handleMsg(p *peer, wg *sync.WaitGroup) error { if metrics.EnabledExpensive { miscInTrieProofPacketsMeter.Mark(1) miscInTrieProofTrafficMeter.Mark(int64(msg.Size)) + defer func(start time.Time) { miscServingTimeTrieProofTimer.UpdateSince(start) }(time.Now()) } var req struct { ReqID uint64 @@ -657,6 +662,7 @@ func (h *serverHandler) handleMsg(p *peer, wg *sync.WaitGroup) error { if metrics.EnabledExpensive { miscInHelperTriePacketsMeter.Mark(1) miscInHelperTrieTrafficMeter.Mark(int64(msg.Size)) + defer func(start time.Time) { miscServingTimeHelperTrieTimer.UpdateSince(start) }(time.Now()) } var req struct { ReqID uint64 @@ -731,6 +737,7 @@ func (h *serverHandler) handleMsg(p *peer, wg *sync.WaitGroup) error { if metrics.EnabledExpensive { miscInTxsPacketsMeter.Mark(1) miscInTxsTrafficMeter.Mark(int64(msg.Size)) + defer func(start time.Time) { miscServingTimeTxTimer.UpdateSince(start) }(time.Now()) } var req struct { ReqID uint64 @@ -779,6 +786,7 @@ func (h *serverHandler) handleMsg(p *peer, wg *sync.WaitGroup) error { if metrics.EnabledExpensive { miscInTxStatusPacketsMeter.Mark(1) miscInTxStatusTrafficMeter.Mark(int64(msg.Size)) + defer func(start time.Time) { miscServingTimeTxStatusTimer.UpdateSince(start) }(time.Now()) } var req struct { ReqID uint64 diff --git a/light/lightchain.go b/light/lightchain.go index 7f64d1c28bbe..9529c2e1b90a 100644 --- a/light/lightchain.go +++ b/light/lightchain.go @@ -438,9 +438,6 @@ func (lc *LightChain) GetBlockHashesFromHash(hash common.Hash, max uint64) []com // // Note: ancestor == 0 returns the same block, 1 returns its parent and so on. func (lc *LightChain) GetAncestor(hash common.Hash, number, ancestor uint64, maxNonCanonical *uint64) (common.Hash, uint64) { - lc.chainmu.RLock() - defer lc.chainmu.RUnlock() - return lc.hc.GetAncestor(hash, number, ancestor, maxNonCanonical) } From f40ff23b7bf5396936159ae500ed5b18fdaec27d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Wed, 18 Sep 2019 10:53:01 +0300 Subject: [PATCH 22/50] core: fix tx dedup return error count --- core/tx_pool.go | 31 +++++++++++++++++---- core/tx_pool_test.go | 65 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 6 deletions(-) diff --git a/core/tx_pool.go b/core/tx_pool.go index d67be96e58c5..f7032dbd1e8a 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -766,21 +766,40 @@ func (pool *TxPool) AddRemote(tx *types.Transaction) error { // addTxs attempts to queue a batch of transactions if they are valid. func (pool *TxPool) addTxs(txs []*types.Transaction, local, sync bool) []error { // Filter out known ones without obtaining the pool lock or recovering signatures - for i := 0; i < len(txs); i++ { - if pool.all.Get(txs[i].Hash()) != nil { + var ( + errs = make([]error, len(txs)) + news = make([]*types.Transaction, 0, len(txs)) + ) + for i, tx := range txs { + // If the transaction is known, pre-set the error slot + if pool.all.Get(tx.Hash()) != nil { + errs[i] = fmt.Errorf("known transaction: %x", tx.Hash()) knownTxMeter.Mark(1) - txs = append(txs[:i], txs[i+1:]...) - i-- + continue } + // Accumulate all unknown transactions for deeper processing + news = append(news, tx) + } + if len(news) == 0 { + return errs } // Cache senders in transactions before obtaining lock (pool.signer is immutable) - for _, tx := range txs { + for _, tx := range news { types.Sender(pool.signer, tx) } + // Process all the new transaction and merge any errors into the original slice pool.mu.Lock() - errs, dirtyAddrs := pool.addTxsLocked(txs, local) + newErrs, dirtyAddrs := pool.addTxsLocked(news, local) pool.mu.Unlock() + var nilSlot = 0 + for _, err := range newErrs { + for errs[nilSlot] != nil { + nilSlot++ + } + errs[nilSlot] = err + } + // Reorg the pool internals if needed and return done := pool.requestPromoteExecutables(dirtyAddrs) if sync { <-done diff --git a/core/tx_pool_test.go b/core/tx_pool_test.go index 388668ed8b0b..0f1e7ac8f8fd 100644 --- a/core/tx_pool_test.go +++ b/core/tx_pool_test.go @@ -1438,6 +1438,71 @@ func TestTransactionPoolStableUnderpricing(t *testing.T) { } } +// Tests that the pool rejects duplicate transactions. +func TestTransactionDeduplication(t *testing.T) { + t.Parallel() + + // Create the pool to test the pricing enforcement with + statedb, _ := state.New(common.Hash{}, state.NewDatabase(rawdb.NewMemoryDatabase())) + blockchain := &testBlockChain{statedb, 1000000, new(event.Feed)} + + pool := NewTxPool(testTxPoolConfig, params.TestChainConfig, blockchain) + defer pool.Stop() + + // Create a test account to add transactions with + key, _ := crypto.GenerateKey() + pool.currentState.AddBalance(crypto.PubkeyToAddress(key.PublicKey), big.NewInt(1000000000)) + + // Create a batch of transactions and add a few of them + txs := make([]*types.Transaction, 16) + for i := 0; i < len(txs); i++ { + txs[i] = pricedTransaction(uint64(i), 100000, big.NewInt(1), key) + } + var firsts []*types.Transaction + for i := 0; i < len(txs); i += 2 { + firsts = append(firsts, txs[i]) + } + errs := pool.AddRemotesSync(firsts) + if len(errs) != len(firsts) { + t.Fatalf("first add mismatching result count: have %d, want %d", len(errs), len(firsts)) + } + for i, err := range errs { + if err != nil { + t.Errorf("add %d failed: %v", i, err) + } + } + pending, queued := pool.Stats() + if pending != 1 { + t.Fatalf("pending transactions mismatched: have %d, want %d", pending, 1) + } + if queued != len(txs)/2-1 { + t.Fatalf("queued transactions mismatched: have %d, want %d", queued, len(txs)/2-1) + } + // Try to add all of them now and ensure previous ones error out as knowns + errs = pool.AddRemotesSync(txs) + if len(errs) != len(txs) { + t.Fatalf("all add mismatching result count: have %d, want %d", len(errs), len(txs)) + } + for i, err := range errs { + if i%2 == 0 && err == nil { + t.Errorf("add %d succeeded, should have failed as known", i) + } + if i%2 == 1 && err != nil { + t.Errorf("add %d failed: %v", i, err) + } + } + pending, queued = pool.Stats() + if pending != len(txs) { + t.Fatalf("pending transactions mismatched: have %d, want %d", pending, len(txs)) + } + if queued != 0 { + t.Fatalf("queued transactions mismatched: have %d, want %d", queued, 0) + } + if err := validateTxPoolInternals(pool); err != nil { + t.Fatalf("pool internal state corrupted: %v", err) + } +} + // Tests that the pool rejects replacement transactions that don't meet the minimum // price bump required. func TestTransactionReplacement(t *testing.T) { From ad380cd57f9b7f8ed748b61b568f8733836ba2e3 Mon Sep 17 00:00:00 2001 From: soc1c Date: Thu, 19 Sep 2019 08:25:08 +0200 Subject: [PATCH 23/50] =?UTF-8?q?params:=20activate=20Istanbul=20on=20Rops?= =?UTF-8?q?ten=20and=20G=C3=B6rli?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- params/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/params/config.go b/params/config.go index 200add01b59f..3b2886d53533 100644 --- a/params/config.go +++ b/params/config.go @@ -103,7 +103,7 @@ var ( ByzantiumBlock: big.NewInt(1700000), ConstantinopleBlock: big.NewInt(4230000), PetersburgBlock: big.NewInt(4939394), - IstanbulBlock: nil, + IstanbulBlock: big.NewInt(6485846), Ethash: new(EthashConfig), } @@ -180,7 +180,7 @@ var ( ByzantiumBlock: big.NewInt(0), ConstantinopleBlock: big.NewInt(0), PetersburgBlock: big.NewInt(0), - IstanbulBlock: nil, + IstanbulBlock: big.NewInt(1561651), Clique: &CliqueConfig{ Period: 15, Epoch: 30000, From 2becb995830f3951643cf973fbf29ca313b833b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 19 Sep 2019 09:45:40 +0300 Subject: [PATCH 24/50] params: bump CHTs for the 1.9.4 release --- params/config.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/params/config.go b/params/config.go index 200add01b59f..d74b81159ff8 100644 --- a/params/config.go +++ b/params/config.go @@ -71,10 +71,10 @@ var ( // MainnetTrustedCheckpoint contains the light client trusted checkpoint for the main network. MainnetTrustedCheckpoint = &TrustedCheckpoint{ - SectionIndex: 253, - SectionHead: common.HexToHash("0xf35fabd036e2030196183bb70ae194f6ce1ea7b58559e3825c168f1df9c0a258"), - CHTRoot: common.HexToHash("0x8992849e2be3390696eaf66312626e484045501cd3ec207922c27a6a80a7bb07"), - BloomRoot: common.HexToHash("0xcc510b51ca4d73fb3fdf43208d73286f8f23817cdc31b8ea9f4de8d645f07df4"), + SectionIndex: 260, + SectionHead: common.HexToHash("0x613fc3c65f2abe9d66564c2d1f7c7600cd51a90a26bd9c0fda1ad9c6739428eb"), + CHTRoot: common.HexToHash("0x2a81a659f524be86929e4d34e4da05c024a68c9f44bd1184eae303802baa121e"), + BloomRoot: common.HexToHash("0x7718ec4b9ce11365b98063dc90808a87c7c1dc14c76e418a2a64a717688a601d"), } // MainnetCheckpointOracle contains a set of configs for the main network oracle. @@ -109,10 +109,10 @@ var ( // TestnetTrustedCheckpoint contains the light client trusted checkpoint for the Ropsten test network. TestnetTrustedCheckpoint = &TrustedCheckpoint{ - SectionIndex: 187, - SectionHead: common.HexToHash("0x7d6db64d8ec43303e4392fb726d2346f7231b246decca3d8140dd7e2c0d0b07d"), - CHTRoot: common.HexToHash("0xa5095e1a004a8642fb93ca682eb91e8f20ef5bce151e47404fbb68772d17705b"), - BloomRoot: common.HexToHash("0x90b28050f948ec6fb35b23a91d9aed38ce0c92d3cdd6e1d383c1bddf8b4071cf"), + SectionIndex: 194, + SectionHead: common.HexToHash("0x34b61d0b77bbbbc7747db9a786e5ac976a83ec0c7c0238d319ec95243754cfcc"), + CHTRoot: common.HexToHash("0x6793d6efd08e5f17074f5cfe3f32cc552a7514d967d03ea253b0c1cefec68f00"), + BloomRoot: common.HexToHash("0x07570f99a7d5dcdc95c40ec9145b65ecbda0c4e61f9f99fa9eff39d91a4d8ad5"), } // TestnetCheckpointOracle contains a set of configs for the Ropsten test network oracle. @@ -150,10 +150,10 @@ var ( // RinkebyTrustedCheckpoint contains the light client trusted checkpoint for the Rinkeby test network. RinkebyTrustedCheckpoint = &TrustedCheckpoint{ - SectionIndex: 148, - SectionHead: common.HexToHash("0x45918f4686732c2a3e80827e1bc39cdb6a27fa362ddfe1fdfb61c69a7f1df1a9"), - CHTRoot: common.HexToHash("0x8ac7046391fec14834a2a0183513937c0b5f696666545991477d24b067008961"), - BloomRoot: common.HexToHash("0xfe4b852517612d7da54bf7e9fc18861a83171a93c72583bb6a61893b74422168"), + SectionIndex: 155, + SectionHead: common.HexToHash("0x746df19e755fa6310ce3b00bb29229d590aa80002012e64ef648010b8b63db67"), + CHTRoot: common.HexToHash("0xc6a1093d82003141feb1052a96e0c95cea62d64c230f805d7835857d321c0c1a"), + BloomRoot: common.HexToHash("0x9d0fc2ea21c5850a9bceb73a82a405e9934788f56a5d20f81b0bb417497a9f92"), } // RinkebyCheckpointOracle contains a set of configs for the Rinkeby test network oracle. @@ -189,10 +189,10 @@ var ( // GoerliTrustedCheckpoint contains the light client trusted checkpoint for the Görli test network. GoerliTrustedCheckpoint = &TrustedCheckpoint{ - SectionIndex: 32, - SectionHead: common.HexToHash("0x50eaedd8361fa9edd0ac2dec410310b9bdf67b963b60f3b1dce47f84b30670f9"), - CHTRoot: common.HexToHash("0x6504db73139f75ffa9102ae980e41b361cf3d5b66cea06c79cde9f457368820c"), - BloomRoot: common.HexToHash("0x7551ae027bb776252a20ded51ee2ff0cbfbd1d8d57261b9161cc1f2f80237001"), + SectionIndex: 39, + SectionHead: common.HexToHash("0x512b5c1533d6faa3b968f095e61ad96007fda91ea296af433d96045580d9c140"), + CHTRoot: common.HexToHash("0x1a8e8ffd2cae5de61c2d06a686944b7809064ce38109c0e3ca203b5ed363bb0e"), + BloomRoot: common.HexToHash("0x32a3fec7d590143b0ccc4f1bb9fc1d9e03a30894e625a1d44d5be60e7b932491"), } // GoerliCheckpointOracle contains a set of configs for the Goerli test network oracle. From f9eb3072167603e70b018c295e305d71b69756e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 19 Sep 2019 10:13:11 +0300 Subject: [PATCH 25/50] core/forkid, params: fix tests, enable Istanbul on Rinkeby + testers --- core/forkid/forkid_test.go | 18 ++++++++++++------ params/config.go | 8 ++++---- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/core/forkid/forkid_test.go b/core/forkid/forkid_test.go index b33f85bec7ab..3048940236e4 100644 --- a/core/forkid/forkid_test.go +++ b/core/forkid/forkid_test.go @@ -72,8 +72,10 @@ func TestCreation(t *testing.T) { {4229999, ID{Hash: checksumToBytes(0x3ea159c7), Next: 4230000}}, // Last Byzantium block {4230000, ID{Hash: checksumToBytes(0x97b544f3), Next: 4939394}}, // First Constantinople block {4939393, ID{Hash: checksumToBytes(0x97b544f3), Next: 4939394}}, // Last Constantinople block - {4939394, ID{Hash: checksumToBytes(0xd6e2149b), Next: 0}}, // First Petersburg block - {5822692, ID{Hash: checksumToBytes(0xd6e2149b), Next: 0}}, // Today Petersburg block + {4939394, ID{Hash: checksumToBytes(0xd6e2149b), Next: 6485846}}, // First Petersburg block + {6485845, ID{Hash: checksumToBytes(0xd6e2149b), Next: 6485846}}, // Last Petersburg block + {6485846, ID{Hash: checksumToBytes(0x4bc66396), Next: 0}}, // First Istanbul block + {7500000, ID{Hash: checksumToBytes(0x4bc66396), Next: 0}}, // Future Istanbul block }, }, // Rinkeby test cases @@ -90,8 +92,10 @@ func TestCreation(t *testing.T) { {3660662, ID{Hash: checksumToBytes(0x8d748b57), Next: 3660663}}, // Last Byzantium block {3660663, ID{Hash: checksumToBytes(0xe49cab14), Next: 4321234}}, // First Constantinople block {4321233, ID{Hash: checksumToBytes(0xe49cab14), Next: 4321234}}, // Last Constantinople block - {4321234, ID{Hash: checksumToBytes(0xafec6b27), Next: 0}}, // First Petersburg block - {4586649, ID{Hash: checksumToBytes(0xafec6b27), Next: 0}}, // Today Petersburg block + {4321234, ID{Hash: checksumToBytes(0xafec6b27), Next: 5435345}}, // First Petersburg block + {5435344, ID{Hash: checksumToBytes(0xafec6b27), Next: 5435345}}, // Last Petersburg block + {5435345, ID{Hash: checksumToBytes(0xcbdb8838), Next: 0}}, // First Istanbul block + {6000000, ID{Hash: checksumToBytes(0xcbdb8838), Next: 0}}, // Future Istanbul block }, }, // Goerli test cases @@ -99,8 +103,10 @@ func TestCreation(t *testing.T) { params.GoerliChainConfig, params.GoerliGenesisHash, []testcase{ - {0, ID{Hash: checksumToBytes(0xa3f5ab08), Next: 0}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople and first Petersburg block - {795329, ID{Hash: checksumToBytes(0xa3f5ab08), Next: 0}}, // Today Petersburg block + {0, ID{Hash: checksumToBytes(0xa3f5ab08), Next: 1561651}}, // Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople and first Petersburg block + {1561650, ID{Hash: checksumToBytes(0xa3f5ab08), Next: 1561651}}, // Last Petersburg block + {1561651, ID{Hash: checksumToBytes(0xc25efa5c), Next: 0}}, // First Istanbul block + {2000000, ID{Hash: checksumToBytes(0xc25efa5c), Next: 0}}, // Future Istanbul block }, }, } diff --git a/params/config.go b/params/config.go index 3b2886d53533..75facce02ab5 100644 --- a/params/config.go +++ b/params/config.go @@ -141,7 +141,7 @@ var ( ByzantiumBlock: big.NewInt(1035301), ConstantinopleBlock: big.NewInt(3660663), PetersburgBlock: big.NewInt(4321234), - IstanbulBlock: nil, + IstanbulBlock: big.NewInt(5435345), Clique: &CliqueConfig{ Period: 15, Epoch: 30000, @@ -213,16 +213,16 @@ var ( // // This configuration is intentionally not using keyed fields to force anyone // adding flags to the config to also have to set these fields. - AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, new(EthashConfig), nil} + AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil} // AllCliqueProtocolChanges contains every protocol change (EIPs) introduced // and accepted by the Ethereum core developers into the Clique consensus. // // This configuration is intentionally not using keyed fields to force anyone // adding flags to the config to also have to set these fields. - AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, &CliqueConfig{Period: 0, Epoch: 30000}} + AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, &CliqueConfig{Period: 0, Epoch: 30000}} - TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, new(EthashConfig), nil} + TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil} TestRules = TestChainConfig.Rules(new(big.Int)) ) From 9f98628dc220e5b7000f29be077be568c3ced51a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 19 Sep 2019 11:02:48 +0300 Subject: [PATCH 26/50] vendor: pull in USB Windows fixes --- vendor/github.com/karalabe/usb/appveyor.yml | 4 ++-- vendor/github.com/karalabe/usb/hidapi/windows/hid.c | 4 +++- vendor/vendor.json | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/vendor/github.com/karalabe/usb/appveyor.yml b/vendor/github.com/karalabe/usb/appveyor.yml index 1d921ae51da1..73a9664ae7a2 100644 --- a/vendor/github.com/karalabe/usb/appveyor.yml +++ b/vendor/github.com/karalabe/usb/appveyor.yml @@ -22,8 +22,8 @@ environment: install: - rmdir C:\go /s /q - - appveyor DownloadFile https://storage.googleapis.com/golang/go1.12.6.windows-%GOARCH%.zip - - 7z x go1.12.6.windows-%GOARCH%.zip -y -oC:\ > NUL + - appveyor DownloadFile https://storage.googleapis.com/golang/go1.12.9.windows-%GOARCH%.zip + - 7z x go1.12.9.windows-%GOARCH%.zip -y -oC:\ > NUL - go version - gcc --version diff --git a/vendor/github.com/karalabe/usb/hidapi/windows/hid.c b/vendor/github.com/karalabe/usb/hidapi/windows/hid.c index 4e92cc8bc9c1..60da64608c5e 100644 --- a/vendor/github.com/karalabe/usb/hidapi/windows/hid.c +++ b/vendor/github.com/karalabe/usb/hidapi/windows/hid.c @@ -74,6 +74,8 @@ extern "C" { #pragma warning(disable:4996) #endif +#pragma GCC diagnostic ignored "-Wstringop-overflow" + #ifdef __cplusplus extern "C" { #endif @@ -428,7 +430,7 @@ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned shor if (str) { len = strlen(str); cur_dev->path = (char*) calloc(len+1, sizeof(char)); - strncpy(cur_dev->path, str, sizeof(cur_dev->path)); + strncpy(cur_dev->path, str, len+1); cur_dev->path[len] = '\0'; } else diff --git a/vendor/vendor.json b/vendor/vendor.json index 33aab0e11907..06b4a2cf4f0e 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -249,10 +249,10 @@ "revisionTime": "2017-04-30T22:20:11Z" }, { - "checksumSHA1": "X7ZY5gt+qBd/lafKNbPbouL819w=", + "checksumSHA1": "AkW2LisC8HZAFIthaamcxOVl3RU=", "path": "github.com/karalabe/usb", - "revision": "6a7de9d893feb2324aaef49331e923ce279c7973", - "revisionTime": "2019-07-03T09:51:11Z", + "revision": "51dc0efba3568b598359930901dc6647e9b2c6a1", + "revisionTime": "2019-09-19T08:00:40Z", "tree": true }, { From 46891c12ab54c9e179f26378ce618fd48460190c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 19 Sep 2019 11:36:53 +0300 Subject: [PATCH 27/50] params: release Geth v1.9.4 stable --- params/version.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/params/version.go b/params/version.go index 8d61e42132ff..b25e4915aa53 100644 --- a/params/version.go +++ b/params/version.go @@ -21,10 +21,10 @@ import ( ) const ( - VersionMajor = 1 // Major version component of the current release - VersionMinor = 9 // Minor version component of the current release - VersionPatch = 4 // Patch version component of the current release - VersionMeta = "unstable" // Version metadata to append to the version string + VersionMajor = 1 // Major version component of the current release + VersionMinor = 9 // Minor version component of the current release + VersionPatch = 4 // Patch version component of the current release + VersionMeta = "stable" // Version metadata to append to the version string ) // Version holds the textual version string. From 24ef83518c5e3c173784b20eabba140162d66dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 19 Sep 2019 11:38:43 +0300 Subject: [PATCH 28/50] params: start v1.9.5 release cycle --- params/version.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/params/version.go b/params/version.go index b25e4915aa53..511bc075ecb4 100644 --- a/params/version.go +++ b/params/version.go @@ -21,10 +21,10 @@ import ( ) const ( - VersionMajor = 1 // Major version component of the current release - VersionMinor = 9 // Minor version component of the current release - VersionPatch = 4 // Patch version component of the current release - VersionMeta = "stable" // Version metadata to append to the version string + VersionMajor = 1 // Major version component of the current release + VersionMinor = 9 // Minor version component of the current release + VersionPatch = 5 // Patch version component of the current release + VersionMeta = "unstable" // Version metadata to append to the version string ) // Version holds the textual version string. From 75aec8a28dd065f63b061c0b575ca2ba4c3870cd Mon Sep 17 00:00:00 2001 From: Rafael Matias Date: Thu, 19 Sep 2019 19:35:57 +0200 Subject: [PATCH 29/50] params: remove legacy bootnodes --- params/bootnodes.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/params/bootnodes.go b/params/bootnodes.go index 36f13d1787ae..967cba5bc4fd 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -29,13 +29,6 @@ var MainnetBootnodes = []string{ "enode://715171f50508aba88aecd1250af392a45a330af91d7b90701c436b618c86aaa1589c9184561907bebbb56439b8f8787bc01f49a7c77276c58c1b09822d75e8e8@52.231.165.108:30303", // bootnode-azure-koreasouth-001 "enode://5d6d7cd20d6da4bb83a1d28cadb5d409b64edf314c0335df658c1a54e32c7c4a7ab7823d57c39b6a757556e68ff1df17c748b698544a55cb488b52479a92b60f@104.42.217.25:30303", // bootnode-azure-westus-001 - // Ethereum Foundation Go Bootnodes (legacy) - "enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@52.16.188.185:30303", // IE - "enode://3f1d12044546b76342d59d4a05532c14b85aa669704bfe1f864fe079415aa2c02d743e03218e57a33fb94523adb54032871a6c51b2cc5514cb7c7e35b3ed0a99@13.93.211.84:30303", // US-WEST - "enode://78de8a0916848093c73790ead81d1928bec737d565119932b98c6b100d944b7a95e94f847f689fc723399d2e31129d182f7ef3863f2b4c820abbf3ab2722344d@191.235.84.50:30303", // BR - "enode://158f8aab45f6d19c6cbf4a089c2670541a8da11978a2f90dbf6a502a4a3bab80d288afdbeb7ec0ef6d92de563767f3b1ea9e8e334ca711e9f8e2df5a0385e8e6@13.75.154.138:30303", // AU - "enode://1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082@52.74.57.123:30303", // SG - // Ethereum Foundation C++ Bootnodes "enode://979b7fa28feeb35a4741660a16076f1943202cb72b6af70d327f053e248bab9ba81760f39d0701ef1d8f89cc1fbd2cacba0710a12cd5314d5e0c9021aa3637f9@5.1.83.226:30303", // DE } From 05347b3d982504e383cfb72fbfc341bd2fe75e94 Mon Sep 17 00:00:00 2001 From: gary rong Date: Fri, 20 Sep 2019 17:55:44 +0800 Subject: [PATCH 30/50] core/state: fix state object deep copy (#20100) deepCopy didn't copy pending storage updates, leading to the creation of blocks with invalid state root. --- core/state/state_object.go | 1 + 1 file changed, 1 insertion(+) diff --git a/core/state/state_object.go b/core/state/state_object.go index f9d7559d866e..8680de021f42 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -379,6 +379,7 @@ func (s *stateObject) deepCopy(db *StateDB) *stateObject { stateObject.code = s.code stateObject.dirtyStorage = s.dirtyStorage.Copy() stateObject.originStorage = s.originStorage.Copy() + stateObject.pendingStorage = s.pendingStorage.Copy() stateObject.suicided = s.suicided stateObject.dirtyCode = s.dirtyCode stateObject.deleted = s.deleted From a1c09b93871dd3770adffb177086abda1b2ff3af Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 20 Sep 2019 13:32:10 +0200 Subject: [PATCH 31/50] params: release Geth v1.9.5 stable --- params/version.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/params/version.go b/params/version.go index 511bc075ecb4..9b6fb3f5844a 100644 --- a/params/version.go +++ b/params/version.go @@ -21,10 +21,10 @@ import ( ) const ( - VersionMajor = 1 // Major version component of the current release - VersionMinor = 9 // Minor version component of the current release - VersionPatch = 5 // Patch version component of the current release - VersionMeta = "unstable" // Version metadata to append to the version string + VersionMajor = 1 // Major version component of the current release + VersionMinor = 9 // Minor version component of the current release + VersionPatch = 5 // Patch version component of the current release + VersionMeta = "stable" // Version metadata to append to the version string ) // Version holds the textual version string. From 63b18027dc9e5ad86992b3e7acbd3f033a458192 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 20 Sep 2019 13:33:08 +0200 Subject: [PATCH 32/50] params: start v1.9.6 release cycle --- params/version.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/params/version.go b/params/version.go index 9b6fb3f5844a..51033baa5c61 100644 --- a/params/version.go +++ b/params/version.go @@ -21,10 +21,10 @@ import ( ) const ( - VersionMajor = 1 // Major version component of the current release - VersionMinor = 9 // Minor version component of the current release - VersionPatch = 5 // Patch version component of the current release - VersionMeta = "stable" // Version metadata to append to the version string + VersionMajor = 1 // Major version component of the current release + VersionMinor = 9 // Minor version component of the current release + VersionPatch = 6 // Patch version component of the current release + VersionMeta = "unstable" // Version metadata to append to the version string ) // Version holds the textual version string. From a308f012ba6bac3249ae52727e1c52273390d7e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Tue, 24 Sep 2019 10:49:59 +0300 Subject: [PATCH 33/50] core/state: fix copy-commit-copy (#20113) * core/state: revert noop finalise, fix copy-commit-copy * core/state: reintroduce net sstore tracking, extend tests for it --- core/state/statedb.go | 7 +- core/state/statedb_test.go | 165 ++++++++++++++++++++++++++++++++++++- 2 files changed, 167 insertions(+), 5 deletions(-) diff --git a/core/state/statedb.go b/core/state/statedb.go index 9034d553361d..4b4f374c9245 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -588,8 +588,13 @@ func (self *StateDB) Copy() *StateDB { // in the stateObjects: OOG after touch on ripeMD prior to Byzantium. Thus, we need to check for // nil if object, exist := self.stateObjects[addr]; exist { + // Even though the original object is dirty, we are not copying the journal, + // so we need to make sure that anyside effect the journal would have caused + // during a commit (or similar op) is already applied to the copy. state.stateObjects[addr] = object.deepCopy(state) - state.stateObjectsDirty[addr] = struct{}{} + + state.stateObjectsDirty[addr] = struct{}{} // Mark the copy dirty to force internal (code/state) commits + state.stateObjectsPending[addr] = struct{}{} // Mark the copy pending to force external (account) commits } } // Above, we don't copy the actual journal. This means that if the copy is copied, the diff --git a/core/state/statedb_test.go b/core/state/statedb_test.go index bb3b87ead2e7..5f58a234cac9 100644 --- a/core/state/statedb_test.go +++ b/core/state/statedb_test.go @@ -438,18 +438,175 @@ func (s *StateSuite) TestTouchDelete(c *check.C) { // TestCopyOfCopy tests that modified objects are carried over to the copy, and the copy of the copy. // See https://github.com/ethereum/go-ethereum/pull/15225#issuecomment-380191512 func TestCopyOfCopy(t *testing.T) { - sdb, _ := New(common.Hash{}, NewDatabase(rawdb.NewMemoryDatabase())) + state, _ := New(common.Hash{}, NewDatabase(rawdb.NewMemoryDatabase())) addr := common.HexToAddress("aaaa") - sdb.SetBalance(addr, big.NewInt(42)) + state.SetBalance(addr, big.NewInt(42)) - if got := sdb.Copy().GetBalance(addr).Uint64(); got != 42 { + if got := state.Copy().GetBalance(addr).Uint64(); got != 42 { t.Fatalf("1st copy fail, expected 42, got %v", got) } - if got := sdb.Copy().Copy().GetBalance(addr).Uint64(); got != 42 { + if got := state.Copy().Copy().GetBalance(addr).Uint64(); got != 42 { t.Fatalf("2nd copy fail, expected 42, got %v", got) } } +// Tests a regression where committing a copy lost some internal meta information, +// leading to corrupted subsequent copies. +// +// See https://github.com/ethereum/go-ethereum/issues/20106. +func TestCopyCommitCopy(t *testing.T) { + state, _ := New(common.Hash{}, NewDatabase(rawdb.NewMemoryDatabase())) + + // Create an account and check if the retrieved balance is correct + addr := common.HexToAddress("0xaffeaffeaffeaffeaffeaffeaffeaffeaffeaffe") + skey := common.HexToHash("aaa") + sval := common.HexToHash("bbb") + + state.SetBalance(addr, big.NewInt(42)) // Change the account trie + state.SetCode(addr, []byte("hello")) // Change an external metadata + state.SetState(addr, skey, sval) // Change the storage trie + + if balance := state.GetBalance(addr); balance.Cmp(big.NewInt(42)) != 0 { + t.Fatalf("initial balance mismatch: have %v, want %v", balance, 42) + } + if code := state.GetCode(addr); !bytes.Equal(code, []byte("hello")) { + t.Fatalf("initial code mismatch: have %x, want %x", code, []byte("hello")) + } + if val := state.GetState(addr, skey); val != sval { + t.Fatalf("initial non-committed storage slot mismatch: have %x, want %x", val, sval) + } + if val := state.GetCommittedState(addr, skey); val != (common.Hash{}) { + t.Fatalf("initial committed storage slot mismatch: have %x, want %x", val, common.Hash{}) + } + // Copy the non-committed state database and check pre/post commit balance + copyOne := state.Copy() + if balance := copyOne.GetBalance(addr); balance.Cmp(big.NewInt(42)) != 0 { + t.Fatalf("first copy pre-commit balance mismatch: have %v, want %v", balance, 42) + } + if code := copyOne.GetCode(addr); !bytes.Equal(code, []byte("hello")) { + t.Fatalf("first copy pre-commit code mismatch: have %x, want %x", code, []byte("hello")) + } + if val := copyOne.GetState(addr, skey); val != sval { + t.Fatalf("first copy pre-commit non-committed storage slot mismatch: have %x, want %x", val, sval) + } + if val := copyOne.GetCommittedState(addr, skey); val != (common.Hash{}) { + t.Fatalf("first copy pre-commit committed storage slot mismatch: have %x, want %x", val, common.Hash{}) + } + + copyOne.Commit(false) + if balance := copyOne.GetBalance(addr); balance.Cmp(big.NewInt(42)) != 0 { + t.Fatalf("first copy post-commit balance mismatch: have %v, want %v", balance, 42) + } + if code := copyOne.GetCode(addr); !bytes.Equal(code, []byte("hello")) { + t.Fatalf("first copy post-commit code mismatch: have %x, want %x", code, []byte("hello")) + } + if val := copyOne.GetState(addr, skey); val != sval { + t.Fatalf("first copy post-commit non-committed storage slot mismatch: have %x, want %x", val, sval) + } + if val := copyOne.GetCommittedState(addr, skey); val != sval { + t.Fatalf("first copy post-commit committed storage slot mismatch: have %x, want %x", val, sval) + } + // Copy the copy and check the balance once more + copyTwo := copyOne.Copy() + if balance := copyTwo.GetBalance(addr); balance.Cmp(big.NewInt(42)) != 0 { + t.Fatalf("second copy balance mismatch: have %v, want %v", balance, 42) + } + if code := copyTwo.GetCode(addr); !bytes.Equal(code, []byte("hello")) { + t.Fatalf("second copy code mismatch: have %x, want %x", code, []byte("hello")) + } + if val := copyTwo.GetState(addr, skey); val != sval { + t.Fatalf("second copy non-committed storage slot mismatch: have %x, want %x", val, sval) + } + if val := copyTwo.GetCommittedState(addr, skey); val != sval { + t.Fatalf("second copy post-commit committed storage slot mismatch: have %x, want %x", val, sval) + } +} + +// Tests a regression where committing a copy lost some internal meta information, +// leading to corrupted subsequent copies. +// +// See https://github.com/ethereum/go-ethereum/issues/20106. +func TestCopyCopyCommitCopy(t *testing.T) { + state, _ := New(common.Hash{}, NewDatabase(rawdb.NewMemoryDatabase())) + + // Create an account and check if the retrieved balance is correct + addr := common.HexToAddress("0xaffeaffeaffeaffeaffeaffeaffeaffeaffeaffe") + skey := common.HexToHash("aaa") + sval := common.HexToHash("bbb") + + state.SetBalance(addr, big.NewInt(42)) // Change the account trie + state.SetCode(addr, []byte("hello")) // Change an external metadata + state.SetState(addr, skey, sval) // Change the storage trie + + if balance := state.GetBalance(addr); balance.Cmp(big.NewInt(42)) != 0 { + t.Fatalf("initial balance mismatch: have %v, want %v", balance, 42) + } + if code := state.GetCode(addr); !bytes.Equal(code, []byte("hello")) { + t.Fatalf("initial code mismatch: have %x, want %x", code, []byte("hello")) + } + if val := state.GetState(addr, skey); val != sval { + t.Fatalf("initial non-committed storage slot mismatch: have %x, want %x", val, sval) + } + if val := state.GetCommittedState(addr, skey); val != (common.Hash{}) { + t.Fatalf("initial committed storage slot mismatch: have %x, want %x", val, common.Hash{}) + } + // Copy the non-committed state database and check pre/post commit balance + copyOne := state.Copy() + if balance := copyOne.GetBalance(addr); balance.Cmp(big.NewInt(42)) != 0 { + t.Fatalf("first copy balance mismatch: have %v, want %v", balance, 42) + } + if code := copyOne.GetCode(addr); !bytes.Equal(code, []byte("hello")) { + t.Fatalf("first copy code mismatch: have %x, want %x", code, []byte("hello")) + } + if val := copyOne.GetState(addr, skey); val != sval { + t.Fatalf("first copy non-committed storage slot mismatch: have %x, want %x", val, sval) + } + if val := copyOne.GetCommittedState(addr, skey); val != (common.Hash{}) { + t.Fatalf("first copy committed storage slot mismatch: have %x, want %x", val, common.Hash{}) + } + // Copy the copy and check the balance once more + copyTwo := copyOne.Copy() + if balance := copyTwo.GetBalance(addr); balance.Cmp(big.NewInt(42)) != 0 { + t.Fatalf("second copy pre-commit balance mismatch: have %v, want %v", balance, 42) + } + if code := copyTwo.GetCode(addr); !bytes.Equal(code, []byte("hello")) { + t.Fatalf("second copy pre-commit code mismatch: have %x, want %x", code, []byte("hello")) + } + if val := copyTwo.GetState(addr, skey); val != sval { + t.Fatalf("second copy pre-commit non-committed storage slot mismatch: have %x, want %x", val, sval) + } + if val := copyTwo.GetCommittedState(addr, skey); val != (common.Hash{}) { + t.Fatalf("second copy pre-commit committed storage slot mismatch: have %x, want %x", val, common.Hash{}) + } + copyTwo.Commit(false) + if balance := copyTwo.GetBalance(addr); balance.Cmp(big.NewInt(42)) != 0 { + t.Fatalf("second copy post-commit balance mismatch: have %v, want %v", balance, 42) + } + if code := copyTwo.GetCode(addr); !bytes.Equal(code, []byte("hello")) { + t.Fatalf("second copy post-commit code mismatch: have %x, want %x", code, []byte("hello")) + } + if val := copyTwo.GetState(addr, skey); val != sval { + t.Fatalf("second copy post-commit non-committed storage slot mismatch: have %x, want %x", val, sval) + } + if val := copyTwo.GetCommittedState(addr, skey); val != sval { + t.Fatalf("second copy post-commit committed storage slot mismatch: have %x, want %x", val, sval) + } + // Copy the copy-copy and check the balance once more + copyThree := copyTwo.Copy() + if balance := copyThree.GetBalance(addr); balance.Cmp(big.NewInt(42)) != 0 { + t.Fatalf("third copy balance mismatch: have %v, want %v", balance, 42) + } + if code := copyThree.GetCode(addr); !bytes.Equal(code, []byte("hello")) { + t.Fatalf("third copy code mismatch: have %x, want %x", code, []byte("hello")) + } + if val := copyThree.GetState(addr, skey); val != sval { + t.Fatalf("third copy non-committed storage slot mismatch: have %x, want %x", val, sval) + } + if val := copyThree.GetCommittedState(addr, skey); val != sval { + t.Fatalf("third copy committed storage slot mismatch: have %x, want %x", val, sval) + } +} + // TestDeleteCreateRevert tests a weird state transition corner case that we hit // while changing the internals of statedb. The workflow is that a contract is // self destructed, then in a followup transaction (but same block) it's created From be500b57d29dbb93fa9de782406c2147712fad7c Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Tue, 24 Sep 2019 10:08:46 +0200 Subject: [PATCH 34/50] dashboard: log host+port --- dashboard/dashboard.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/dashboard.go b/dashboard/dashboard.go index d69a750f101e..b576293bc92b 100644 --- a/dashboard/dashboard.go +++ b/dashboard/dashboard.go @@ -125,7 +125,7 @@ func (db *Dashboard) APIs() []rpc.API { return nil } // Start starts the data collection thread and the listening server of the dashboard. // Implements the node.Service interface. func (db *Dashboard) Start(server *p2p.Server) error { - log.Info("Starting dashboard") + log.Info("Starting dashboard", "url", fmt.Sprintf("http://%s:%d", db.config.Host, db.config.Port)) db.wg.Add(3) go db.collectSystemData() From 32b07e8b1f970ac76c78dcd27401658f8e3fe3a3 Mon Sep 17 00:00:00 2001 From: gary rong Date: Wed, 25 Sep 2019 16:05:15 +0800 Subject: [PATCH 35/50] les: fix checkpoint sync (#20120) --- les/checkpointoracle.go | 7 +-- les/client_handler.go | 10 ++-- les/sync.go | 15 +++--- les/sync_test.go | 101 +++++++++++++++++++++++++++++++++++++++- 4 files changed, 117 insertions(+), 16 deletions(-) diff --git a/les/checkpointoracle.go b/les/checkpointoracle.go index 4695fbc16ced..5494e3d6d9d5 100644 --- a/les/checkpointoracle.go +++ b/les/checkpointoracle.go @@ -35,11 +35,8 @@ type checkpointOracle struct { config *params.CheckpointOracleConfig contract *checkpointoracle.CheckpointOracle - // Whether the contract backend is set. - running int32 - - getLocal func(uint64) params.TrustedCheckpoint // Function used to retrieve local checkpoint - syncDoneHook func() // Function used to notify that light syncing has completed. + running int32 // Flag whether the contract backend is set or not + getLocal func(uint64) params.TrustedCheckpoint // Function used to retrieve local checkpoint } // newCheckpointOracle returns a checkpoint registrar handler. diff --git a/les/client_handler.go b/les/client_handler.go index aff05ddbc9d5..7fdb1657194c 100644 --- a/les/client_handler.go +++ b/les/client_handler.go @@ -40,14 +40,16 @@ type clientHandler struct { downloader *downloader.Downloader backend *LightEthereum - closeCh chan struct{} - wg sync.WaitGroup // WaitGroup used to track all connected peers. + closeCh chan struct{} + wg sync.WaitGroup // WaitGroup used to track all connected peers. + syncDone func() // Test hooks when syncing is done. } func newClientHandler(ulcServers []string, ulcFraction int, checkpoint *params.TrustedCheckpoint, backend *LightEthereum) *clientHandler { handler := &clientHandler{ - backend: backend, - closeCh: make(chan struct{}), + checkpoint: checkpoint, + backend: backend, + closeCh: make(chan struct{}), } if ulcServers != nil { ulc, err := newULC(ulcServers, ulcFraction) diff --git a/les/sync.go b/les/sync.go index 693394464c12..1214fefcaf13 100644 --- a/les/sync.go +++ b/les/sync.go @@ -135,21 +135,24 @@ func (h *clientHandler) synchronise(peer *peer) { mode = legacyCheckpointSync log.Debug("Disable checkpoint syncing", "reason", "checkpoint is hardcoded") case h.backend.oracle == nil || !h.backend.oracle.isRunning(): - mode = legacyCheckpointSync + if h.checkpoint == nil { + mode = lightSync // Downgrade to light sync unfortunately. + } else { + checkpoint = h.checkpoint + mode = legacyCheckpointSync + } log.Debug("Disable checkpoint syncing", "reason", "checkpoint syncing is not activated") } // Notify testing framework if syncing has completed(for testing purpose). defer func() { - if h.backend.oracle != nil && h.backend.oracle.syncDoneHook != nil { - h.backend.oracle.syncDoneHook() + if h.syncDone != nil { + h.syncDone() } }() start := time.Now() if mode == checkpointSync || mode == legacyCheckpointSync { // Validate the advertised checkpoint - if mode == legacyCheckpointSync { - checkpoint = h.checkpoint - } else if mode == checkpointSync { + if mode == checkpointSync { if err := h.validateCheckpoint(peer); err != nil { log.Debug("Failed to validate checkpoint", "reason", err) h.removePeer(peer.id) diff --git a/les/sync_test.go b/les/sync_test.go index 63833c1ab434..b02c3582f09d 100644 --- a/les/sync_test.go +++ b/les/sync_test.go @@ -102,7 +102,7 @@ func testCheckpointSyncing(t *testing.T, protocol int, syncMode int) { } done := make(chan error) - client.handler.backend.oracle.syncDoneHook = func() { + client.handler.syncDone = func() { header := client.handler.backend.blockchain.CurrentHeader() if header.Number.Uint64() == expected { done <- nil @@ -131,3 +131,102 @@ func testCheckpointSyncing(t *testing.T, protocol int, syncMode int) { t.Error("checkpoint syncing timeout") } } + +func TestMissOracleBackend(t *testing.T) { testMissOracleBackend(t, true) } +func TestMissOracleBackendNoCheckpoint(t *testing.T) { testMissOracleBackend(t, false) } + +func testMissOracleBackend(t *testing.T, hasCheckpoint bool) { + config := light.TestServerIndexerConfig + + waitIndexers := func(cIndexer, bIndexer, btIndexer *core.ChainIndexer) { + for { + cs, _, _ := cIndexer.Sections() + bts, _, _ := btIndexer.Sections() + if cs >= 1 && bts >= 1 { + break + } + time.Sleep(10 * time.Millisecond) + } + } + // Generate 512+4 blocks (totally 1 CHT sections) + server, client, tearDown := newClientServerEnv(t, int(config.ChtSize+config.ChtConfirms), 3, waitIndexers, nil, 0, false, false) + defer tearDown() + + expected := config.ChtSize + config.ChtConfirms + + s, _, head := server.chtIndexer.Sections() + cp := ¶ms.TrustedCheckpoint{ + SectionIndex: 0, + SectionHead: head, + CHTRoot: light.GetChtRoot(server.db, s-1, head), + BloomRoot: light.GetBloomTrieRoot(server.db, s-1, head), + } + // Register the assembled checkpoint into oracle. + header := server.backend.Blockchain().CurrentHeader() + + data := append([]byte{0x19, 0x00}, append(registrarAddr.Bytes(), append([]byte{0, 0, 0, 0, 0, 0, 0, 0}, cp.Hash().Bytes()...)...)...) + sig, _ := crypto.Sign(crypto.Keccak256(data), signerKey) + sig[64] += 27 // Transform V from 0/1 to 27/28 according to the yellow paper + if _, err := server.handler.server.oracle.contract.RegisterCheckpoint(bind.NewKeyedTransactor(signerKey), cp.SectionIndex, cp.Hash().Bytes(), new(big.Int).Sub(header.Number, big.NewInt(1)), header.ParentHash, [][]byte{sig}); err != nil { + t.Error("register checkpoint failed", err) + } + server.backend.Commit() + + // Wait for the checkpoint registration + for { + _, hash, _, err := server.handler.server.oracle.contract.Contract().GetLatestCheckpoint(nil) + if err != nil || hash == [32]byte{} { + time.Sleep(100 * time.Millisecond) + continue + } + break + } + expected += 1 + + // Explicitly set the oracle as nil. In normal use case it can happen + // that user wants to unlock something which blocks the oracle backend + // initialisation. But at the same time syncing starts. + // + // See https://github.com/ethereum/go-ethereum/issues/20097 for more detail. + // + // In this case, client should run light sync or legacy checkpoint sync + // if hardcoded checkpoint is configured. + client.handler.backend.oracle = nil + + // For some private networks it can happen checkpoint syncing is enabled + // but there is no hardcoded checkpoint configured. + if hasCheckpoint { + client.handler.checkpoint = cp + client.handler.backend.blockchain.AddTrustedCheckpoint(cp) + } + + done := make(chan error) + client.handler.syncDone = func() { + header := client.handler.backend.blockchain.CurrentHeader() + if header.Number.Uint64() == expected { + done <- nil + } else { + done <- fmt.Errorf("blockchain length mismatch, want %d, got %d", expected, header.Number) + } + } + + // Create connected peer pair. + _, err1, _, err2 := newTestPeerPair("peer", 2, server.handler, client.handler) + select { + case <-time.After(time.Millisecond * 100): + case err := <-err1: + t.Fatalf("peer 1 handshake error: %v", err) + case err := <-err2: + t.Fatalf("peer 2 handshake error: %v", err) + } + + select { + case err := <-done: + if err != nil { + t.Error("sync failed", err) + } + return + case <-time.NewTimer(10 * time.Second).C: + t.Error("checkpoint syncing timeout") + } +} From 0568e817012753a9f71fffa50160990dbc3779a2 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 25 Sep 2019 11:38:13 +0200 Subject: [PATCH 36/50] p2p/dnsdisc: add implementation of EIP-1459 (#20094) This adds an implementation of node discovery via DNS TXT records to the go-ethereum library. The implementation doesn't match EIP-1459 exactly, the main difference being that this implementation uses separate merkle trees for tree links and ENRs. The EIP will be updated to match p2p/dnsdisc. To maintain DNS trees, cmd/devp2p provides a frontend for the p2p/dnsdisc library. The new 'dns' subcommands can be used to create, sign and deploy DNS discovery trees. --- cmd/devp2p/discv4cmd.go | 120 +-- cmd/devp2p/dns_cloudflare.go | 163 ++++ cmd/devp2p/dnscmd.go | 358 +++++++++ cmd/devp2p/main.go | 34 +- cmd/devp2p/nodeset.go | 87 ++ p2p/dnsdisc/client.go | 260 ++++++ p2p/dnsdisc/client_test.go | 306 ++++++++ p2p/dnsdisc/doc.go | 18 + p2p/dnsdisc/error.go | 63 ++ p2p/dnsdisc/sync.go | 277 +++++++ p2p/dnsdisc/tree.go | 384 +++++++++ p2p/dnsdisc/tree_test.go | 144 ++++ .../cloudflare-go/CODE_OF_CONDUCT.md | 77 ++ .../cloudflare/cloudflare-go/LICENSE | 26 + .../cloudflare/cloudflare-go/README.md | 107 +++ .../cloudflare-go/access_application.go | 180 +++++ .../cloudflare-go/access_identity_provider.go | 331 ++++++++ .../cloudflare-go/access_organization.go | 101 +++ .../cloudflare/cloudflare-go/access_policy.go | 221 ++++++ .../cloudflare-go/access_service_tokens.go | 167 ++++ .../cloudflare-go/account_members.go | 186 +++++ .../cloudflare/cloudflare-go/account_roles.go | 80 ++ .../cloudflare/cloudflare-go/accounts.go | 114 +++ .../cloudflare/cloudflare-go/argo.go | 120 +++ .../cloudflare/cloudflare-go/auditlogs.go | 143 ++++ .../cloudflare/cloudflare-go/cloudflare.go | 435 ++++++++++ .../cloudflare-go/custom_hostname.go | 161 ++++ .../cloudflare/cloudflare-go/custom_pages.go | 176 +++++ .../cloudflare/cloudflare-go/dns.go | 174 ++++ .../cloudflare/cloudflare-go/duration.go | 40 + .../cloudflare/cloudflare-go/errors.go | 50 ++ .../cloudflare/cloudflare-go/filter.go | 241 ++++++ .../cloudflare/cloudflare-go/firewall.go | 280 +++++++ .../cloudflare-go/firewall_rules.go | 196 +++++ .../cloudflare/cloudflare-go/go.mod | 13 + .../cloudflare/cloudflare-go/go.sum | 26 + .../cloudflare/cloudflare-go/ips.go | 44 ++ .../cloudflare/cloudflare-go/keyless.go | 52 ++ .../cloudflare-go/load_balancing.go | 387 +++++++++ .../cloudflare/cloudflare-go/lockdown.go | 151 ++++ .../cloudflare/cloudflare-go/logpush.go | 224 ++++++ .../cloudflare/cloudflare-go/options.go | 101 +++ .../cloudflare/cloudflare-go/origin_ca.go | 169 ++++ .../cloudflare/cloudflare-go/page_rules.go | 235 ++++++ .../cloudflare/cloudflare-go/railgun.go | 297 +++++++ .../cloudflare/cloudflare-go/rate_limiting.go | 210 +++++ .../cloudflare/cloudflare-go/registrar.go | 175 +++++ .../cloudflare/cloudflare-go/renovate.json | 5 + .../cloudflare/cloudflare-go/spectrum.go | 158 ++++ .../cloudflare/cloudflare-go/ssl.go | 157 ++++ .../cloudflare/cloudflare-go/universal_ssl.go | 88 +++ .../cloudflare/cloudflare-go/user.go | 113 +++ .../cloudflare/cloudflare-go/user_agent.go | 149 ++++ .../cloudflare/cloudflare-go/virtualdns.go | 192 +++++ .../cloudflare/cloudflare-go/waf.go | 300 +++++++ .../cloudflare/cloudflare-go/workers.go | 314 ++++++++ .../cloudflare/cloudflare-go/workers_kv.go | 192 +++++ .../cloudflare/cloudflare-go/zone.go | 740 ++++++++++++++++++ vendor/golang.org/x/time/LICENSE | 27 + vendor/golang.org/x/time/PATENTS | 22 + vendor/golang.org/x/time/rate/rate.go | 374 +++++++++ vendor/vendor.json | 12 + 62 files changed, 10698 insertions(+), 49 deletions(-) create mode 100644 cmd/devp2p/dns_cloudflare.go create mode 100644 cmd/devp2p/dnscmd.go create mode 100644 cmd/devp2p/nodeset.go create mode 100644 p2p/dnsdisc/client.go create mode 100644 p2p/dnsdisc/client_test.go create mode 100644 p2p/dnsdisc/doc.go create mode 100644 p2p/dnsdisc/error.go create mode 100644 p2p/dnsdisc/sync.go create mode 100644 p2p/dnsdisc/tree.go create mode 100644 p2p/dnsdisc/tree_test.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/CODE_OF_CONDUCT.md create mode 100644 vendor/github.com/cloudflare/cloudflare-go/LICENSE create mode 100644 vendor/github.com/cloudflare/cloudflare-go/README.md create mode 100644 vendor/github.com/cloudflare/cloudflare-go/access_application.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/access_identity_provider.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/access_organization.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/access_policy.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/access_service_tokens.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/account_members.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/account_roles.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/accounts.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/argo.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/auditlogs.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/cloudflare.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/custom_hostname.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/custom_pages.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/dns.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/duration.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/errors.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/filter.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/firewall.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/firewall_rules.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/go.mod create mode 100644 vendor/github.com/cloudflare/cloudflare-go/go.sum create mode 100644 vendor/github.com/cloudflare/cloudflare-go/ips.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/keyless.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/load_balancing.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/lockdown.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/logpush.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/options.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/origin_ca.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/page_rules.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/railgun.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/rate_limiting.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/registrar.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/renovate.json create mode 100644 vendor/github.com/cloudflare/cloudflare-go/spectrum.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/ssl.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/universal_ssl.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/user.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/user_agent.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/virtualdns.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/waf.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/workers.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/workers_kv.go create mode 100644 vendor/github.com/cloudflare/cloudflare-go/zone.go create mode 100644 vendor/golang.org/x/time/LICENSE create mode 100644 vendor/golang.org/x/time/PATENTS create mode 100644 vendor/golang.org/x/time/rate/rate.go diff --git a/cmd/devp2p/discv4cmd.go b/cmd/devp2p/discv4cmd.go index 1e56687a6c78..ab5b874029df 100644 --- a/cmd/devp2p/discv4cmd.go +++ b/cmd/devp2p/discv4cmd.go @@ -19,10 +19,10 @@ package main import ( "fmt" "net" - "sort" "strings" "time" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/enode" @@ -38,23 +38,34 @@ var ( discv4PingCommand, discv4RequestRecordCommand, discv4ResolveCommand, + discv4ResolveJSONCommand, }, } discv4PingCommand = cli.Command{ - Name: "ping", - Usage: "Sends ping to a node", - Action: discv4Ping, + Name: "ping", + Usage: "Sends ping to a node", + Action: discv4Ping, + ArgsUsage: "", } discv4RequestRecordCommand = cli.Command{ - Name: "requestenr", - Usage: "Requests a node record using EIP-868 enrRequest", - Action: discv4RequestRecord, + Name: "requestenr", + Usage: "Requests a node record using EIP-868 enrRequest", + Action: discv4RequestRecord, + ArgsUsage: "", } discv4ResolveCommand = cli.Command{ - Name: "resolve", - Usage: "Finds a node in the DHT", - Action: discv4Resolve, - Flags: []cli.Flag{bootnodesFlag}, + Name: "resolve", + Usage: "Finds a node in the DHT", + Action: discv4Resolve, + ArgsUsage: "", + Flags: []cli.Flag{bootnodesFlag}, + } + discv4ResolveJSONCommand = cli.Command{ + Name: "resolve-json", + Usage: "Re-resolves nodes in a nodes.json file", + Action: discv4ResolveJSON, + Flags: []cli.Flag{bootnodesFlag}, + ArgsUsage: "", } ) @@ -64,10 +75,8 @@ var bootnodesFlag = cli.StringFlag{ } func discv4Ping(ctx *cli.Context) error { - n, disc, err := getNodeArgAndStartV4(ctx) - if err != nil { - return err - } + n := getNodeArg(ctx) + disc := startV4(ctx) defer disc.Close() start := time.Now() @@ -79,10 +88,8 @@ func discv4Ping(ctx *cli.Context) error { } func discv4RequestRecord(ctx *cli.Context) error { - n, disc, err := getNodeArgAndStartV4(ctx) - if err != nil { - return err - } + n := getNodeArg(ctx) + disc := startV4(ctx) defer disc.Close() respN, err := disc.RequestENR(n) @@ -94,33 +101,43 @@ func discv4RequestRecord(ctx *cli.Context) error { } func discv4Resolve(ctx *cli.Context) error { - n, disc, err := getNodeArgAndStartV4(ctx) - if err != nil { - return err - } + n := getNodeArg(ctx) + disc := startV4(ctx) defer disc.Close() fmt.Println(disc.Resolve(n).String()) return nil } -func getNodeArgAndStartV4(ctx *cli.Context) (*enode.Node, *discover.UDPv4, error) { - if ctx.NArg() != 1 { - return nil, nil, fmt.Errorf("missing node as command-line argument") +func discv4ResolveJSON(ctx *cli.Context) error { + if ctx.NArg() < 1 { + return fmt.Errorf("need nodes file as argument") } - n, err := parseNode(ctx.Args()[0]) - if err != nil { - return nil, nil, err + disc := startV4(ctx) + defer disc.Close() + file := ctx.Args().Get(0) + + // Load existing nodes in file. + var nodes []*enode.Node + if common.FileExist(file) { + nodes = loadNodesJSON(file).nodes() } - var bootnodes []*enode.Node - if commandHasFlag(ctx, bootnodesFlag) { - bootnodes, err = parseBootnodes(ctx) + // Add nodes from command line arguments. + for i := 1; i < ctx.NArg(); i++ { + n, err := parseNode(ctx.Args().Get(i)) if err != nil { - return nil, nil, err + exit(err) } + nodes = append(nodes, n) + } + + result := make(nodeSet, len(nodes)) + for _, n := range nodes { + n = disc.Resolve(n) + result[n.ID()] = nodeJSON{Seq: n.Seq(), N: n} } - disc, err := startV4(bootnodes) - return n, disc, err + writeNodesJSON(file, result) + return nil } func parseBootnodes(ctx *cli.Context) ([]*enode.Node, error) { @@ -139,28 +156,39 @@ func parseBootnodes(ctx *cli.Context) ([]*enode.Node, error) { return nodes, nil } -// commandHasFlag returns true if the current command supports the given flag. -func commandHasFlag(ctx *cli.Context, flag cli.Flag) bool { - flags := ctx.FlagNames() - sort.Strings(flags) - i := sort.SearchStrings(flags, flag.GetName()) - return i != len(flags) && flags[i] == flag.GetName() +// startV4 starts an ephemeral discovery V4 node. +func startV4(ctx *cli.Context) *discover.UDPv4 { + socket, ln, cfg, err := listen() + if err != nil { + exit(err) + } + if commandHasFlag(ctx, bootnodesFlag) { + bn, err := parseBootnodes(ctx) + if err != nil { + exit(err) + } + cfg.Bootnodes = bn + } + disc, err := discover.ListenV4(socket, ln, cfg) + if err != nil { + exit(err) + } + return disc } -// startV4 starts an ephemeral discovery V4 node. -func startV4(bootnodes []*enode.Node) (*discover.UDPv4, error) { +func listen() (*net.UDPConn, *enode.LocalNode, discover.Config, error) { var cfg discover.Config - cfg.Bootnodes = bootnodes cfg.PrivateKey, _ = crypto.GenerateKey() db, _ := enode.OpenDB("") ln := enode.NewLocalNode(db, cfg.PrivateKey) socket, err := net.ListenUDP("udp4", &net.UDPAddr{IP: net.IP{0, 0, 0, 0}}) if err != nil { - return nil, err + db.Close() + return nil, nil, cfg, err } addr := socket.LocalAddr().(*net.UDPAddr) ln.SetFallbackIP(net.IP{127, 0, 0, 1}) ln.SetFallbackUDP(addr.Port) - return discover.ListenUDP(socket, ln, cfg) + return socket, ln, cfg, nil } diff --git a/cmd/devp2p/dns_cloudflare.go b/cmd/devp2p/dns_cloudflare.go new file mode 100644 index 000000000000..83279168ccae --- /dev/null +++ b/cmd/devp2p/dns_cloudflare.go @@ -0,0 +1,163 @@ +// Copyright 2019 The go-ethereum Authors +// This file is part of go-ethereum. +// +// go-ethereum is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// go-ethereum is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with go-ethereum. If not, see . + +package main + +import ( + "fmt" + "strings" + + "github.com/cloudflare/cloudflare-go" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/dnsdisc" + "gopkg.in/urfave/cli.v1" +) + +var ( + cloudflareTokenFlag = cli.StringFlag{ + Name: "token", + Usage: "CloudFlare API token", + EnvVar: "CLOUDFLARE_API_TOKEN", + } + cloudflareZoneIDFlag = cli.StringFlag{ + Name: "zoneid", + Usage: "CloudFlare Zone ID (optional)", + } +) + +type cloudflareClient struct { + *cloudflare.API + zoneID string +} + +// newCloudflareClient sets up a CloudFlare API client from command line flags. +func newCloudflareClient(ctx *cli.Context) *cloudflareClient { + token := ctx.String(cloudflareTokenFlag.Name) + if token == "" { + exit(fmt.Errorf("need cloudflare API token to proceed")) + } + api, err := cloudflare.NewWithAPIToken(token) + if err != nil { + exit(fmt.Errorf("can't create Cloudflare client: %v", err)) + } + return &cloudflareClient{ + API: api, + zoneID: ctx.String(cloudflareZoneIDFlag.Name), + } +} + +// deploy uploads the given tree to CloudFlare DNS. +func (c *cloudflareClient) deploy(name string, t *dnsdisc.Tree) error { + if err := c.checkZone(name); err != nil { + return err + } + records := t.ToTXT(name) + return c.uploadRecords(name, records) +} + +// checkZone verifies permissions on the CloudFlare DNS Zone for name. +func (c *cloudflareClient) checkZone(name string) error { + if c.zoneID == "" { + log.Info(fmt.Sprintf("Finding CloudFlare zone ID for %s", name)) + id, err := c.ZoneIDByName(name) + if err != nil { + return err + } + c.zoneID = id + } + log.Info(fmt.Sprintf("Checking Permissions on zone %s", c.zoneID)) + zone, err := c.ZoneDetails(c.zoneID) + if err != nil { + return err + } + if !strings.HasSuffix(name, "."+zone.Name) { + return fmt.Errorf("CloudFlare zone name %q does not match name %q to be deployed", zone.Name, name) + } + needPerms := map[string]bool{"#zone:edit": false, "#zone:read": false} + for _, perm := range zone.Permissions { + if _, ok := needPerms[perm]; ok { + needPerms[perm] = true + } + } + for _, ok := range needPerms { + if !ok { + return fmt.Errorf("wrong permissions on zone %s: %v", c.zoneID, needPerms) + } + } + return nil +} + +// uploadRecords updates the TXT records at a particular subdomain. All non-root records +// will have a TTL of "infinity" and all existing records not in the new map will be +// nuked! +func (c *cloudflareClient) uploadRecords(name string, records map[string]string) error { + // Convert all names to lowercase. + lrecords := make(map[string]string, len(records)) + for name, r := range records { + lrecords[strings.ToLower(name)] = r + } + records = lrecords + + log.Info(fmt.Sprintf("Retrieving existing TXT records on %s", name)) + entries, err := c.DNSRecords(c.zoneID, cloudflare.DNSRecord{Type: "TXT"}) + if err != nil { + return err + } + existing := make(map[string]cloudflare.DNSRecord) + for _, entry := range entries { + if !strings.HasSuffix(entry.Name, name) { + continue + } + existing[strings.ToLower(entry.Name)] = entry + } + + // Iterate over the new records and inject anything missing. + for path, val := range records { + old, exists := existing[path] + if !exists { + // Entry is unknown, push a new one to Cloudflare. + log.Info(fmt.Sprintf("Creating %s = %q", path, val)) + ttl := 1 + if path != name { + ttl = 2147483647 // Max TTL permitted by Cloudflare + } + _, err = c.CreateDNSRecord(c.zoneID, cloudflare.DNSRecord{Type: "TXT", Name: path, Content: val, TTL: ttl}) + } else if old.Content != val { + // Entry already exists, only change its content. + log.Info(fmt.Sprintf("Updating %s from %q to %q", path, old.Content, val)) + old.Content = val + err = c.UpdateDNSRecord(c.zoneID, old.ID, old) + } else { + log.Info(fmt.Sprintf("Skipping %s = %q", path, val)) + } + if err != nil { + return fmt.Errorf("failed to publish %s: %v", path, err) + } + } + + // Iterate over the old records and delete anything stale. + for path, entry := range existing { + if _, ok := records[path]; ok { + continue + } + // Stale entry, nuke it. + log.Info(fmt.Sprintf("Deleting %s = %q", path, entry.Content)) + if err := c.DeleteDNSRecord(c.zoneID, entry.ID); err != nil { + return fmt.Errorf("failed to delete %s: %v", path, err) + } + } + return nil +} diff --git a/cmd/devp2p/dnscmd.go b/cmd/devp2p/dnscmd.go new file mode 100644 index 000000000000..74d70d3aaaf9 --- /dev/null +++ b/cmd/devp2p/dnscmd.go @@ -0,0 +1,358 @@ +// Copyright 2018 The go-ethereum Authors +// This file is part of go-ethereum. +// +// go-ethereum is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// go-ethereum is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with go-ethereum. If not, see . + +package main + +import ( + "crypto/ecdsa" + "encoding/json" + "fmt" + "io/ioutil" + "os" + "path/filepath" + "time" + + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/console" + "github.com/ethereum/go-ethereum/p2p/dnsdisc" + "github.com/ethereum/go-ethereum/p2p/enode" + cli "gopkg.in/urfave/cli.v1" +) + +var ( + dnsCommand = cli.Command{ + Name: "dns", + Usage: "DNS Discovery Commands", + Subcommands: []cli.Command{ + dnsSyncCommand, + dnsSignCommand, + dnsTXTCommand, + dnsCloudflareCommand, + }, + } + dnsSyncCommand = cli.Command{ + Name: "sync", + Usage: "Download a DNS discovery tree", + ArgsUsage: " [ ]", + Action: dnsSync, + Flags: []cli.Flag{dnsTimeoutFlag}, + } + dnsSignCommand = cli.Command{ + Name: "sign", + Usage: "Sign a DNS discovery tree", + ArgsUsage: " ", + Action: dnsSign, + Flags: []cli.Flag{dnsDomainFlag, dnsSeqFlag}, + } + dnsTXTCommand = cli.Command{ + Name: "to-txt", + Usage: "Create a DNS TXT records for a discovery tree", + ArgsUsage: " ", + Action: dnsToTXT, + } + dnsCloudflareCommand = cli.Command{ + Name: "to-cloudflare", + Usage: "Deploy DNS TXT records to cloudflare", + ArgsUsage: "", + Action: dnsToCloudflare, + Flags: []cli.Flag{cloudflareTokenFlag, cloudflareZoneIDFlag}, + } +) + +var ( + dnsTimeoutFlag = cli.DurationFlag{ + Name: "timeout", + Usage: "Timeout for DNS lookups", + } + dnsDomainFlag = cli.StringFlag{ + Name: "domain", + Usage: "Domain name of the tree", + } + dnsSeqFlag = cli.UintFlag{ + Name: "seq", + Usage: "New sequence number of the tree", + } +) + +// dnsSync performs dnsSyncCommand. +func dnsSync(ctx *cli.Context) error { + var ( + c = dnsClient(ctx) + url = ctx.Args().Get(0) + outdir = ctx.Args().Get(1) + ) + domain, _, err := dnsdisc.ParseURL(url) + if err != nil { + return err + } + if outdir == "" { + outdir = domain + } + + t, err := c.SyncTree(url) + if err != nil { + return err + } + def := treeToDefinition(url, t) + def.Meta.LastModified = time.Now() + writeTreeDefinition(outdir, def) + return nil +} + +func dnsSign(ctx *cli.Context) error { + if ctx.NArg() < 2 { + return fmt.Errorf("need tree definition directory and key file as arguments") + } + var ( + defdir = ctx.Args().Get(0) + keyfile = ctx.Args().Get(1) + def = loadTreeDefinition(defdir) + domain = directoryName(defdir) + ) + if def.Meta.URL != "" { + d, _, err := dnsdisc.ParseURL(def.Meta.URL) + if err != nil { + return fmt.Errorf("invalid 'url' field: %v", err) + } + domain = d + } + if ctx.IsSet(dnsDomainFlag.Name) { + domain = ctx.String(dnsDomainFlag.Name) + } + if ctx.IsSet(dnsSeqFlag.Name) { + def.Meta.Seq = ctx.Uint(dnsSeqFlag.Name) + } else { + def.Meta.Seq++ // Auto-bump sequence number if not supplied via flag. + } + t, err := dnsdisc.MakeTree(def.Meta.Seq, def.Nodes, def.Meta.Links) + if err != nil { + return err + } + + key := loadSigningKey(keyfile) + url, err := t.Sign(key, domain) + if err != nil { + return fmt.Errorf("can't sign: %v", err) + } + + def = treeToDefinition(url, t) + def.Meta.LastModified = time.Now() + writeTreeDefinition(defdir, def) + return nil +} + +func directoryName(dir string) string { + abs, err := filepath.Abs(dir) + if err != nil { + exit(err) + } + return filepath.Base(abs) +} + +// dnsToTXT peforms dnsTXTCommand. +func dnsToTXT(ctx *cli.Context) error { + if ctx.NArg() < 1 { + return fmt.Errorf("need tree definition directory as argument") + } + output := ctx.Args().Get(1) + if output == "" { + output = "-" // default to stdout + } + domain, t, err := loadTreeDefinitionForExport(ctx.Args().Get(0)) + if err != nil { + return err + } + writeTXTJSON(output, t.ToTXT(domain)) + return nil +} + +// dnsToCloudflare peforms dnsCloudflareCommand. +func dnsToCloudflare(ctx *cli.Context) error { + if ctx.NArg() < 1 { + return fmt.Errorf("need tree definition directory as argument") + } + domain, t, err := loadTreeDefinitionForExport(ctx.Args().Get(0)) + if err != nil { + return err + } + client := newCloudflareClient(ctx) + return client.deploy(domain, t) +} + +// loadSigningKey loads a private key in Ethereum keystore format. +func loadSigningKey(keyfile string) *ecdsa.PrivateKey { + keyjson, err := ioutil.ReadFile(keyfile) + if err != nil { + exit(fmt.Errorf("failed to read the keyfile at '%s': %v", keyfile, err)) + } + password, _ := console.Stdin.PromptPassword("Please enter the password for '" + keyfile + "': ") + key, err := keystore.DecryptKey(keyjson, password) + if err != nil { + exit(fmt.Errorf("error decrypting key: %v", err)) + } + return key.PrivateKey +} + +// dnsClient configures the DNS discovery client from command line flags. +func dnsClient(ctx *cli.Context) *dnsdisc.Client { + var cfg dnsdisc.Config + if commandHasFlag(ctx, dnsTimeoutFlag) { + cfg.Timeout = ctx.Duration(dnsTimeoutFlag.Name) + } + c, _ := dnsdisc.NewClient(cfg) // cannot fail because no URLs given + return c +} + +// There are two file formats for DNS node trees on disk: +// +// The 'TXT' format is a single JSON file containing DNS TXT records +// as a JSON object where the keys are names and the values are objects +// containing the value of the record. +// +// The 'definition' format is a directory containing two files: +// +// enrtree-info.json -- contains sequence number & links to other trees +// nodes.json -- contains the nodes as a JSON array. +// +// This format exists because it's convenient to edit. nodes.json can be generated +// in multiple ways: it may be written by a DHT crawler or compiled by a human. + +type dnsDefinition struct { + Meta dnsMetaJSON + Nodes []*enode.Node +} + +type dnsMetaJSON struct { + URL string `json:"url,omitempty"` + Seq uint `json:"seq"` + Sig string `json:"signature,omitempty"` + Links []string `json:"links"` + LastModified time.Time `json:"lastModified"` +} + +func treeToDefinition(url string, t *dnsdisc.Tree) *dnsDefinition { + meta := dnsMetaJSON{ + URL: url, + Seq: t.Seq(), + Sig: t.Signature(), + Links: t.Links(), + } + if meta.Links == nil { + meta.Links = []string{} + } + return &dnsDefinition{Meta: meta, Nodes: t.Nodes()} +} + +// loadTreeDefinition loads a directory in 'definition' format. +func loadTreeDefinition(directory string) *dnsDefinition { + metaFile, nodesFile := treeDefinitionFiles(directory) + var def dnsDefinition + err := common.LoadJSON(metaFile, &def.Meta) + if err != nil && !os.IsNotExist(err) { + exit(err) + } + if def.Meta.Links == nil { + def.Meta.Links = []string{} + } + // Check link syntax. + for _, link := range def.Meta.Links { + if _, _, err := dnsdisc.ParseURL(link); err != nil { + exit(fmt.Errorf("invalid link %q: %v", link, err)) + } + } + // Check/convert nodes. + nodes := loadNodesJSON(nodesFile) + if err := nodes.verify(); err != nil { + exit(err) + } + def.Nodes = nodes.nodes() + return &def +} + +// loadTreeDefinitionForExport loads a DNS tree and ensures it is signed. +func loadTreeDefinitionForExport(dir string) (domain string, t *dnsdisc.Tree, err error) { + metaFile, _ := treeDefinitionFiles(dir) + def := loadTreeDefinition(dir) + if def.Meta.URL == "" { + return "", nil, fmt.Errorf("missing 'url' field in %v", metaFile) + } + domain, pubkey, err := dnsdisc.ParseURL(def.Meta.URL) + if err != nil { + return "", nil, fmt.Errorf("invalid 'url' field in %v: %v", metaFile, err) + } + if t, err = dnsdisc.MakeTree(def.Meta.Seq, def.Nodes, def.Meta.Links); err != nil { + return "", nil, err + } + if err := ensureValidTreeSignature(t, pubkey, def.Meta.Sig); err != nil { + return "", nil, err + } + return domain, t, nil +} + +// ensureValidTreeSignature checks that sig is valid for tree and assigns it as the +// tree's signature if valid. +func ensureValidTreeSignature(t *dnsdisc.Tree, pubkey *ecdsa.PublicKey, sig string) error { + if sig == "" { + return fmt.Errorf("missing signature, run 'devp2p dns sign' first") + } + if err := t.SetSignature(pubkey, sig); err != nil { + return fmt.Errorf("invalid signature on tree, run 'devp2p dns sign' to update it") + } + return nil +} + +// writeTreeDefinition writes a DNS node tree definition to the given directory. +func writeTreeDefinition(directory string, def *dnsDefinition) { + metaJSON, err := json.MarshalIndent(&def.Meta, "", jsonIndent) + if err != nil { + exit(err) + } + // Convert nodes. + nodes := make(nodeSet, len(def.Nodes)) + nodes.add(def.Nodes...) + // Write. + if err := os.Mkdir(directory, 0744); err != nil && !os.IsExist(err) { + exit(err) + } + metaFile, nodesFile := treeDefinitionFiles(directory) + writeNodesJSON(nodesFile, nodes) + if err := ioutil.WriteFile(metaFile, metaJSON, 0644); err != nil { + exit(err) + } +} + +func treeDefinitionFiles(directory string) (string, string) { + meta := filepath.Join(directory, "enrtree-info.json") + nodes := filepath.Join(directory, "nodes.json") + return meta, nodes +} + +// writeTXTJSON writes TXT records in JSON format. +func writeTXTJSON(file string, txt map[string]string) { + txtJSON, err := json.MarshalIndent(txt, "", jsonIndent) + if err != nil { + exit(err) + } + if file == "-" { + os.Stdout.Write(txtJSON) + fmt.Println() + return + } + if err := ioutil.WriteFile(file, txtJSON, 0644); err != nil { + exit(err) + } +} diff --git a/cmd/devp2p/main.go b/cmd/devp2p/main.go index 4532ab968372..c88fe6f6123e 100644 --- a/cmd/devp2p/main.go +++ b/cmd/devp2p/main.go @@ -20,8 +20,10 @@ import ( "fmt" "os" "path/filepath" + "sort" "github.com/ethereum/go-ethereum/internal/debug" + "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/params" "gopkg.in/urfave/cli.v1" ) @@ -57,12 +59,38 @@ func init() { app.Commands = []cli.Command{ enrdumpCommand, discv4Command, + dnsCommand, } } func main() { - if err := app.Run(os.Args); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) + exit(app.Run(os.Args)) +} + +// commandHasFlag returns true if the current command supports the given flag. +func commandHasFlag(ctx *cli.Context, flag cli.Flag) bool { + flags := ctx.FlagNames() + sort.Strings(flags) + i := sort.SearchStrings(flags, flag.GetName()) + return i != len(flags) && flags[i] == flag.GetName() +} + +// getNodeArg handles the common case of a single node descriptor argument. +func getNodeArg(ctx *cli.Context) *enode.Node { + if ctx.NArg() != 1 { + exit("missing node as command-line argument") + } + n, err := parseNode(ctx.Args()[0]) + if err != nil { + exit(err) + } + return n +} + +func exit(err interface{}) { + if err == nil { + os.Exit(0) } + fmt.Fprintln(os.Stderr, err) + os.Exit(1) } diff --git a/cmd/devp2p/nodeset.go b/cmd/devp2p/nodeset.go new file mode 100644 index 000000000000..a4a05016e92e --- /dev/null +++ b/cmd/devp2p/nodeset.go @@ -0,0 +1,87 @@ +// Copyright 2019 The go-ethereum Authors +// This file is part of go-ethereum. +// +// go-ethereum is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// go-ethereum is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with go-ethereum. If not, see . + +package main + +import ( + "bytes" + "encoding/json" + "fmt" + "io/ioutil" + "sort" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/p2p/enode" +) + +const jsonIndent = " " + +// nodeSet is the nodes.json file format. It holds a set of node records +// as a JSON object. +type nodeSet map[enode.ID]nodeJSON + +type nodeJSON struct { + Seq uint64 `json:"seq"` + N *enode.Node `json:"record"` +} + +func loadNodesJSON(file string) nodeSet { + var nodes nodeSet + if err := common.LoadJSON(file, &nodes); err != nil { + exit(err) + } + return nodes +} + +func writeNodesJSON(file string, nodes nodeSet) { + nodesJSON, err := json.MarshalIndent(nodes, "", jsonIndent) + if err != nil { + exit(err) + } + if err := ioutil.WriteFile(file, nodesJSON, 0644); err != nil { + exit(err) + } +} + +func (ns nodeSet) nodes() []*enode.Node { + result := make([]*enode.Node, 0, len(ns)) + for _, n := range ns { + result = append(result, n.N) + } + // Sort by ID. + sort.Slice(result, func(i, j int) bool { + return bytes.Compare(result[i].ID().Bytes(), result[j].ID().Bytes()) < 0 + }) + return result +} + +func (ns nodeSet) add(nodes ...*enode.Node) { + for _, n := range nodes { + ns[n.ID()] = nodeJSON{Seq: n.Seq(), N: n} + } +} + +func (ns nodeSet) verify() error { + for id, n := range ns { + if n.N.ID() != id { + return fmt.Errorf("invalid node %v: ID does not match ID %v in record", id, n.N.ID()) + } + if n.N.Seq() != n.Seq { + return fmt.Errorf("invalid node %v: 'seq' does not match seq %d from record", id, n.N.Seq()) + } + } + return nil +} diff --git a/p2p/dnsdisc/client.go b/p2p/dnsdisc/client.go new file mode 100644 index 000000000000..d4ed08ecb7b2 --- /dev/null +++ b/p2p/dnsdisc/client.go @@ -0,0 +1,260 @@ +// Copyright 2018 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + +package dnsdisc + +import ( + "bytes" + "context" + "fmt" + "math/rand" + "net" + "strings" + "time" + + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enr" + lru "github.com/hashicorp/golang-lru" +) + +// Client discovers nodes by querying DNS servers. +type Client struct { + cfg Config + clock mclock.Clock + linkCache linkCache + trees map[string]*clientTree + + entries *lru.Cache +} + +// Config holds configuration options for the client. +type Config struct { + Timeout time.Duration // timeout used for DNS lookups (default 5s) + RecheckInterval time.Duration // time between tree root update checks (default 30min) + CacheLimit int // maximum number of cached records (default 1000) + ValidSchemes enr.IdentityScheme // acceptable ENR identity schemes (default enode.ValidSchemes) + Resolver Resolver // the DNS resolver to use (defaults to system DNS) + Logger log.Logger // destination of client log messages (defaults to root logger) +} + +// Resolver is a DNS resolver that can query TXT records. +type Resolver interface { + LookupTXT(ctx context.Context, domain string) ([]string, error) +} + +func (cfg Config) withDefaults() Config { + const ( + defaultTimeout = 5 * time.Second + defaultRecheck = 30 * time.Minute + defaultCache = 1000 + ) + if cfg.Timeout == 0 { + cfg.Timeout = defaultTimeout + } + if cfg.RecheckInterval == 0 { + cfg.RecheckInterval = defaultRecheck + } + if cfg.CacheLimit == 0 { + cfg.CacheLimit = defaultCache + } + if cfg.ValidSchemes == nil { + cfg.ValidSchemes = enode.ValidSchemes + } + if cfg.Resolver == nil { + cfg.Resolver = new(net.Resolver) + } + if cfg.Logger == nil { + cfg.Logger = log.Root() + } + return cfg +} + +// NewClient creates a client. +func NewClient(cfg Config, urls ...string) (*Client, error) { + c := &Client{ + cfg: cfg.withDefaults(), + clock: mclock.System{}, + trees: make(map[string]*clientTree), + } + var err error + if c.entries, err = lru.New(c.cfg.CacheLimit); err != nil { + return nil, err + } + for _, url := range urls { + if err := c.AddTree(url); err != nil { + return nil, err + } + } + return c, nil +} + +// SyncTree downloads the entire node tree at the given URL. This doesn't add the tree for +// later use, but any previously-synced entries are reused. +func (c *Client) SyncTree(url string) (*Tree, error) { + le, err := parseURL(url) + if err != nil { + return nil, fmt.Errorf("invalid enrtree URL: %v", err) + } + ct := newClientTree(c, le) + t := &Tree{entries: make(map[string]entry)} + if err := ct.syncAll(t.entries); err != nil { + return nil, err + } + t.root = ct.root + return t, nil +} + +// AddTree adds a enrtree:// URL to crawl. +func (c *Client) AddTree(url string) error { + le, err := parseURL(url) + if err != nil { + return fmt.Errorf("invalid enrtree URL: %v", err) + } + ct, err := c.ensureTree(le) + if err != nil { + return err + } + c.linkCache.add(ct) + return nil +} + +func (c *Client) ensureTree(le *linkEntry) (*clientTree, error) { + if tree, ok := c.trees[le.domain]; ok { + if !tree.matchPubkey(le.pubkey) { + return nil, fmt.Errorf("conflicting public keys for domain %q", le.domain) + } + return tree, nil + } + ct := newClientTree(c, le) + c.trees[le.domain] = ct + return ct, nil +} + +// RandomNode retrieves the next random node. +func (c *Client) RandomNode(ctx context.Context) *enode.Node { + for { + ct := c.randomTree() + if ct == nil { + return nil + } + n, err := ct.syncRandom(ctx) + if err != nil { + if err == ctx.Err() { + return nil // context canceled. + } + c.cfg.Logger.Debug("Error in DNS random node sync", "tree", ct.loc.domain, "err", err) + continue + } + if n != nil { + return n + } + } +} + +// randomTree returns a random tree. +func (c *Client) randomTree() *clientTree { + if !c.linkCache.valid() { + c.gcTrees() + } + limit := rand.Intn(len(c.trees)) + for _, ct := range c.trees { + if limit == 0 { + return ct + } + limit-- + } + return nil +} + +// gcTrees rebuilds the 'trees' map. +func (c *Client) gcTrees() { + trees := make(map[string]*clientTree) + for t := range c.linkCache.all() { + trees[t.loc.domain] = t + } + c.trees = trees +} + +// resolveRoot retrieves a root entry via DNS. +func (c *Client) resolveRoot(ctx context.Context, loc *linkEntry) (rootEntry, error) { + txts, err := c.cfg.Resolver.LookupTXT(ctx, loc.domain) + c.cfg.Logger.Trace("Updating DNS discovery root", "tree", loc.domain, "err", err) + if err != nil { + return rootEntry{}, err + } + for _, txt := range txts { + if strings.HasPrefix(txt, rootPrefix) { + return parseAndVerifyRoot(txt, loc) + } + } + return rootEntry{}, nameError{loc.domain, errNoRoot} +} + +func parseAndVerifyRoot(txt string, loc *linkEntry) (rootEntry, error) { + e, err := parseRoot(txt) + if err != nil { + return e, err + } + if !e.verifySignature(loc.pubkey) { + return e, entryError{typ: "root", err: errInvalidSig} + } + return e, nil +} + +// resolveEntry retrieves an entry from the cache or fetches it from the network +// if it isn't cached. +func (c *Client) resolveEntry(ctx context.Context, domain, hash string) (entry, error) { + cacheKey := truncateHash(hash) + if e, ok := c.entries.Get(cacheKey); ok { + return e.(entry), nil + } + e, err := c.doResolveEntry(ctx, domain, hash) + if err != nil { + return nil, err + } + c.entries.Add(cacheKey, e) + return e, nil +} + +// doResolveEntry fetches an entry via DNS. +func (c *Client) doResolveEntry(ctx context.Context, domain, hash string) (entry, error) { + wantHash, err := b32format.DecodeString(hash) + if err != nil { + return nil, fmt.Errorf("invalid base32 hash") + } + name := hash + "." + domain + txts, err := c.cfg.Resolver.LookupTXT(ctx, hash+"."+domain) + c.cfg.Logger.Trace("DNS discovery lookup", "name", name, "err", err) + if err != nil { + return nil, err + } + for _, txt := range txts { + e, err := parseEntry(txt, c.cfg.ValidSchemes) + if err == errUnknownEntry { + continue + } + if !bytes.HasPrefix(crypto.Keccak256([]byte(txt)), wantHash) { + err = nameError{name, errHashMismatch} + } else if err != nil { + err = nameError{name, err} + } + return e, err + } + return nil, nameError{name, errNoEntry} +} diff --git a/p2p/dnsdisc/client_test.go b/p2p/dnsdisc/client_test.go new file mode 100644 index 000000000000..7e3a0f4826a5 --- /dev/null +++ b/p2p/dnsdisc/client_test.go @@ -0,0 +1,306 @@ +// Copyright 2018 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + +package dnsdisc + +import ( + "context" + "crypto/ecdsa" + "math/rand" + "reflect" + "testing" + "time" + + "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/internal/testlog" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enr" +) + +const ( + signingKeySeed = 0x111111 + nodesSeed1 = 0x2945237 + nodesSeed2 = 0x4567299 +) + +func TestClientSyncTree(t *testing.T) { + r := mapResolver{ + "3CA2MBMUQ55ZCT74YEEQLANJDI.n": "enr=-HW4QAggRauloj2SDLtIHN1XBkvhFZ1vtf1raYQp9TBW2RD5EEawDzbtSmlXUfnaHcvwOizhVYLtr7e6vw7NAf6mTuoCgmlkgnY0iXNlY3AyNTZrMaECjrXI8TLNXU0f8cthpAMxEshUyQlK-AM0PW2wfrnacNI=", + "53HBTPGGZ4I76UEPCNQGZWIPTQ.n": "enr=-HW4QOFzoVLaFJnNhbgMoDXPnOvcdVuj7pDpqRvh6BRDO68aVi5ZcjB3vzQRZH2IcLBGHzo8uUN3snqmgTiE56CH3AMBgmlkgnY0iXNlY3AyNTZrMaECC2_24YYkYHEgdzxlSNKQEnHhuNAbNlMlWJxrJxbAFvA=", + "BG7SVUBUAJ3UAWD2ATEBLMRNEE.n": "enrtree=53HBTPGGZ4I76UEPCNQGZWIPTQ,3CA2MBMUQ55ZCT74YEEQLANJDI,HNHR6UTVZF5TJKK3FV27ZI76P4", + "HNHR6UTVZF5TJKK3FV27ZI76P4.n": "enr=-HW4QLAYqmrwllBEnzWWs7I5Ev2IAs7x_dZlbYdRdMUx5EyKHDXp7AV5CkuPGUPdvbv1_Ms1CPfhcGCvSElSosZmyoqAgmlkgnY0iXNlY3AyNTZrMaECriawHKWdDRk2xeZkrOXBQ0dfMFLHY4eENZwdufn1S1o=", + "JGUFMSAGI7KZYB3P7IZW4S5Y3A.n": "enrtree-link=AM5FCQLWIZX2QFPNJAP7VUERCCRNGRHWZG3YYHIUV7BVDQ5FDPRT2@morenodes.example.org", + "n": "enrtree-root=v1 e=BG7SVUBUAJ3UAWD2ATEBLMRNEE l=JGUFMSAGI7KZYB3P7IZW4S5Y3A seq=1 sig=gacuU0nTy9duIdu1IFDyF5Lv9CFHqHiNcj91n0frw70tZo3tZZsCVkE3j1ILYyVOHRLWGBmawo_SEkThZ9PgcQE=", + } + var ( + wantNodes = testNodes(0x29452, 3) + wantLinks = []string{"enrtree://AM5FCQLWIZX2QFPNJAP7VUERCCRNGRHWZG3YYHIUV7BVDQ5FDPRT2@morenodes.example.org"} + wantSeq = uint(1) + ) + + c, _ := NewClient(Config{Resolver: r, Logger: testlog.Logger(t, log.LvlTrace)}) + stree, err := c.SyncTree("enrtree://AKPYQIUQIL7PSIACI32J7FGZW56E5FKHEFCCOFHILBIMW3M6LWXS2@n") + if err != nil { + t.Fatal("sync error:", err) + } + if !reflect.DeepEqual(sortByID(stree.Nodes()), sortByID(wantNodes)) { + t.Errorf("wrong nodes in synced tree:\nhave %v\nwant %v", spew.Sdump(stree.Nodes()), spew.Sdump(wantNodes)) + } + if !reflect.DeepEqual(stree.Links(), wantLinks) { + t.Errorf("wrong links in synced tree: %v", stree.Links()) + } + if stree.Seq() != wantSeq { + t.Errorf("synced tree has wrong seq: %d", stree.Seq()) + } + if len(c.trees) > 0 { + t.Errorf("tree from SyncTree added to client") + } +} + +// In this test, syncing the tree fails because it contains an invalid ENR entry. +func TestClientSyncTreeBadNode(t *testing.T) { + r := mapResolver{ + "n": "enrtree-root=v1 e=ZFJZDQKSOMJRYYQSZKJZC54HCF l=JGUFMSAGI7KZYB3P7IZW4S5Y3A seq=3 sig=WEy8JTZ2dHmXM2qeBZ7D2ECK7SGbnurl1ge_S_5GQBAqnADk0gLTcg8Lm5QNqLHZjJKGAb443p996idlMcBqEQA=", + "JGUFMSAGI7KZYB3P7IZW4S5Y3A.n": "enrtree-link=AM5FCQLWIZX2QFPNJAP7VUERCCRNGRHWZG3YYHIUV7BVDQ5FDPRT2@morenodes.example.org", + "ZFJZDQKSOMJRYYQSZKJZC54HCF.n": "enr=gggggggggggggg=", + } + + c, _ := NewClient(Config{Resolver: r, Logger: testlog.Logger(t, log.LvlTrace)}) + _, err := c.SyncTree("enrtree://APFGGTFOBVE2ZNAB3CSMNNX6RRK3ODIRLP2AA5U4YFAA6MSYZUYTQ@n") + wantErr := nameError{name: "ZFJZDQKSOMJRYYQSZKJZC54HCF.n", err: entryError{typ: "enr", err: errInvalidENR}} + if err != wantErr { + t.Fatalf("expected sync error %q, got %q", wantErr, err) + } +} + +// This test checks that RandomNode hits all entries. +func TestClientRandomNode(t *testing.T) { + nodes := testNodes(nodesSeed1, 30) + tree, url := makeTestTree("n", nodes, nil) + r := mapResolver(tree.ToTXT("n")) + c, _ := NewClient(Config{Resolver: r, Logger: testlog.Logger(t, log.LvlTrace)}) + if err := c.AddTree(url); err != nil { + t.Fatal(err) + } + + checkRandomNode(t, c, nodes) +} + +// This test checks that RandomNode traverses linked trees as well as explicitly added trees. +func TestClientRandomNodeLinks(t *testing.T) { + nodes := testNodes(nodesSeed1, 40) + tree1, url1 := makeTestTree("t1", nodes[:10], nil) + tree2, url2 := makeTestTree("t2", nodes[10:], []string{url1}) + cfg := Config{ + Resolver: newMapResolver(tree1.ToTXT("t1"), tree2.ToTXT("t2")), + Logger: testlog.Logger(t, log.LvlTrace), + } + c, _ := NewClient(cfg) + if err := c.AddTree(url2); err != nil { + t.Fatal(err) + } + + checkRandomNode(t, c, nodes) +} + +// This test verifies that RandomNode re-checks the root of the tree to catch +// updates to nodes. +func TestClientRandomNodeUpdates(t *testing.T) { + var ( + clock = new(mclock.Simulated) + nodes = testNodes(nodesSeed1, 30) + resolver = newMapResolver() + cfg = Config{ + Resolver: resolver, + Logger: testlog.Logger(t, log.LvlTrace), + RecheckInterval: 20 * time.Minute, + } + c, _ = NewClient(cfg) + ) + c.clock = clock + tree1, url := makeTestTree("n", nodes[:25], nil) + + // Sync the original tree. + resolver.add(tree1.ToTXT("n")) + c.AddTree(url) + checkRandomNode(t, c, nodes[:25]) + + // Update some nodes and ensure RandomNode returns the new nodes as well. + keys := testKeys(nodesSeed1, len(nodes)) + for i, n := range nodes[:len(nodes)/2] { + r := n.Record() + r.Set(enr.IP{127, 0, 0, 1}) + r.SetSeq(55) + enode.SignV4(r, keys[i]) + n2, _ := enode.New(enode.ValidSchemes, r) + nodes[i] = n2 + } + tree2, _ := makeTestTree("n", nodes, nil) + clock.Run(cfg.RecheckInterval + 1*time.Second) + resolver.clear() + resolver.add(tree2.ToTXT("n")) + checkRandomNode(t, c, nodes) +} + +// This test verifies that RandomNode re-checks the root of the tree to catch +// updates to links. +func TestClientRandomNodeLinkUpdates(t *testing.T) { + var ( + clock = new(mclock.Simulated) + nodes = testNodes(nodesSeed1, 30) + resolver = newMapResolver() + cfg = Config{ + Resolver: resolver, + Logger: testlog.Logger(t, log.LvlTrace), + RecheckInterval: 20 * time.Minute, + } + c, _ = NewClient(cfg) + ) + c.clock = clock + tree3, url3 := makeTestTree("t3", nodes[20:30], nil) + tree2, url2 := makeTestTree("t2", nodes[10:20], nil) + tree1, url1 := makeTestTree("t1", nodes[0:10], []string{url2}) + resolver.add(tree1.ToTXT("t1")) + resolver.add(tree2.ToTXT("t2")) + resolver.add(tree3.ToTXT("t3")) + + // Sync tree1 using RandomNode. + c.AddTree(url1) + checkRandomNode(t, c, nodes[:20]) + + // Add link to tree3, remove link to tree2. + tree1, _ = makeTestTree("t1", nodes[:10], []string{url3}) + resolver.add(tree1.ToTXT("t1")) + clock.Run(cfg.RecheckInterval + 1*time.Second) + t.Log("tree1 updated") + + var wantNodes []*enode.Node + wantNodes = append(wantNodes, tree1.Nodes()...) + wantNodes = append(wantNodes, tree3.Nodes()...) + checkRandomNode(t, c, wantNodes) + + // Check that linked trees are GCed when they're no longer referenced. + if len(c.trees) != 2 { + t.Errorf("client knows %d trees, want 2", len(c.trees)) + } +} + +func checkRandomNode(t *testing.T, c *Client, wantNodes []*enode.Node) { + t.Helper() + + var ( + want = make(map[enode.ID]*enode.Node) + maxCalls = len(wantNodes) * 2 + calls = 0 + ctx = context.Background() + ) + for _, n := range wantNodes { + want[n.ID()] = n + } + for ; len(want) > 0 && calls < maxCalls; calls++ { + n := c.RandomNode(ctx) + if n == nil { + t.Fatalf("RandomNode returned nil (call %d)", calls) + } + delete(want, n.ID()) + } + t.Logf("checkRandomNode called RandomNode %d times to find %d nodes", calls, len(wantNodes)) + for _, n := range want { + t.Errorf("RandomNode didn't discover node %v", n.ID()) + } +} + +func makeTestTree(domain string, nodes []*enode.Node, links []string) (*Tree, string) { + tree, err := MakeTree(1, nodes, links) + if err != nil { + panic(err) + } + url, err := tree.Sign(testKey(signingKeySeed), domain) + if err != nil { + panic(err) + } + return tree, url +} + +// testKeys creates deterministic private keys for testing. +func testKeys(seed int64, n int) []*ecdsa.PrivateKey { + rand := rand.New(rand.NewSource(seed)) + keys := make([]*ecdsa.PrivateKey, n) + for i := 0; i < n; i++ { + key, err := ecdsa.GenerateKey(crypto.S256(), rand) + if err != nil { + panic("can't generate key: " + err.Error()) + } + keys[i] = key + } + return keys +} + +func testKey(seed int64) *ecdsa.PrivateKey { + return testKeys(seed, 1)[0] +} + +func testNodes(seed int64, n int) []*enode.Node { + keys := testKeys(seed, n) + nodes := make([]*enode.Node, n) + for i, key := range keys { + record := new(enr.Record) + record.SetSeq(uint64(i)) + enode.SignV4(record, key) + n, err := enode.New(enode.ValidSchemes, record) + if err != nil { + panic(err) + } + nodes[i] = n + } + return nodes +} + +func testNode(seed int64) *enode.Node { + return testNodes(seed, 1)[0] +} + +type mapResolver map[string]string + +func newMapResolver(maps ...map[string]string) mapResolver { + mr := make(mapResolver) + for _, m := range maps { + mr.add(m) + } + return mr +} + +func (mr mapResolver) clear() { + for k := range mr { + delete(mr, k) + } +} + +func (mr mapResolver) add(m map[string]string) { + for k, v := range m { + mr[k] = v + } +} + +func (mr mapResolver) LookupTXT(ctx context.Context, name string) ([]string, error) { + if record, ok := mr[name]; ok { + return []string{record}, nil + } + return nil, nil +} diff --git a/p2p/dnsdisc/doc.go b/p2p/dnsdisc/doc.go new file mode 100644 index 000000000000..227467d084b5 --- /dev/null +++ b/p2p/dnsdisc/doc.go @@ -0,0 +1,18 @@ +// Copyright 2018 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + +// Package dnsdisc implements node discovery via DNS (EIP-1459). +package dnsdisc diff --git a/p2p/dnsdisc/error.go b/p2p/dnsdisc/error.go new file mode 100644 index 000000000000..e0998c7350f7 --- /dev/null +++ b/p2p/dnsdisc/error.go @@ -0,0 +1,63 @@ +// Copyright 2018 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + +package dnsdisc + +import ( + "errors" + "fmt" +) + +// Entry parse errors. +var ( + errUnknownEntry = errors.New("unknown entry type") + errNoPubkey = errors.New("missing public key") + errBadPubkey = errors.New("invalid public key") + errInvalidENR = errors.New("invalid node record") + errInvalidChild = errors.New("invalid child hash") + errInvalidSig = errors.New("invalid base64 signature") + errSyntax = errors.New("invalid syntax") +) + +// Resolver/sync errors +var ( + errNoRoot = errors.New("no valid root found") + errNoEntry = errors.New("no valid tree entry found") + errHashMismatch = errors.New("hash mismatch") + errENRInLinkTree = errors.New("enr entry in link tree") + errLinkInENRTree = errors.New("link entry in ENR tree") +) + +type nameError struct { + name string + err error +} + +func (err nameError) Error() string { + if ee, ok := err.err.(entryError); ok { + return fmt.Sprintf("invalid %s entry at %s: %v", ee.typ, err.name, ee.err) + } + return err.name + ": " + err.err.Error() +} + +type entryError struct { + typ string + err error +} + +func (err entryError) Error() string { + return fmt.Sprintf("invalid %s entry: %v", err.typ, err.err) +} diff --git a/p2p/dnsdisc/sync.go b/p2p/dnsdisc/sync.go new file mode 100644 index 000000000000..bd5c8d023f15 --- /dev/null +++ b/p2p/dnsdisc/sync.go @@ -0,0 +1,277 @@ +// Copyright 2019 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + +package dnsdisc + +import ( + "context" + "crypto/ecdsa" + "math/rand" + "time" + + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/p2p/enode" +) + +// clientTree is a full tree being synced. +type clientTree struct { + c *Client + loc *linkEntry + root *rootEntry + lastRootCheck mclock.AbsTime // last revalidation of root + enrs *subtreeSync + links *subtreeSync + linkCache linkCache +} + +func newClientTree(c *Client, loc *linkEntry) *clientTree { + ct := &clientTree{c: c, loc: loc} + ct.linkCache.self = ct + return ct +} + +func (ct *clientTree) matchPubkey(key *ecdsa.PublicKey) bool { + return keysEqual(ct.loc.pubkey, key) +} + +func keysEqual(k1, k2 *ecdsa.PublicKey) bool { + return k1.Curve == k2.Curve && k1.X.Cmp(k2.X) == 0 && k1.Y.Cmp(k2.Y) == 0 +} + +// syncAll retrieves all entries of the tree. +func (ct *clientTree) syncAll(dest map[string]entry) error { + if err := ct.updateRoot(); err != nil { + return err + } + if err := ct.links.resolveAll(dest); err != nil { + return err + } + if err := ct.enrs.resolveAll(dest); err != nil { + return err + } + return nil +} + +// syncRandom retrieves a single entry of the tree. The Node return value +// is non-nil if the entry was a node. +func (ct *clientTree) syncRandom(ctx context.Context) (*enode.Node, error) { + if ct.rootUpdateDue() { + if err := ct.updateRoot(); err != nil { + return nil, err + } + } + // Link tree sync has priority, run it to completion before syncing ENRs. + if !ct.links.done() { + err := ct.syncNextLink(ctx) + return nil, err + } + + // Sync next random entry in ENR tree. Once every node has been visited, we simply + // start over. This is fine because entries are cached. + if ct.enrs.done() { + ct.enrs = newSubtreeSync(ct.c, ct.loc, ct.root.eroot, false) + } + return ct.syncNextRandomENR(ctx) +} + +func (ct *clientTree) syncNextLink(ctx context.Context) error { + hash := ct.links.missing[0] + e, err := ct.links.resolveNext(ctx, hash) + if err != nil { + return err + } + ct.links.missing = ct.links.missing[1:] + + if le, ok := e.(*linkEntry); ok { + lt, err := ct.c.ensureTree(le) + if err != nil { + return err + } + ct.linkCache.add(lt) + } + return nil +} + +func (ct *clientTree) syncNextRandomENR(ctx context.Context) (*enode.Node, error) { + index := rand.Intn(len(ct.enrs.missing)) + hash := ct.enrs.missing[index] + e, err := ct.enrs.resolveNext(ctx, hash) + if err != nil { + return nil, err + } + ct.enrs.missing = removeHash(ct.enrs.missing, index) + if ee, ok := e.(*enrEntry); ok { + return ee.node, nil + } + return nil, nil +} + +func (ct *clientTree) String() string { + return ct.loc.url() +} + +// removeHash removes the element at index from h. +func removeHash(h []string, index int) []string { + if len(h) == 1 { + return nil + } + last := len(h) - 1 + if index < last { + h[index] = h[last] + h[last] = "" + } + return h[:last] +} + +// updateRoot ensures that the given tree has an up-to-date root. +func (ct *clientTree) updateRoot() error { + ct.lastRootCheck = ct.c.clock.Now() + ctx, cancel := context.WithTimeout(context.Background(), ct.c.cfg.Timeout) + defer cancel() + root, err := ct.c.resolveRoot(ctx, ct.loc) + if err != nil { + return err + } + ct.root = &root + + // Invalidate subtrees if changed. + if ct.links == nil || root.lroot != ct.links.root { + ct.links = newSubtreeSync(ct.c, ct.loc, root.lroot, true) + ct.linkCache.reset() + } + if ct.enrs == nil || root.eroot != ct.enrs.root { + ct.enrs = newSubtreeSync(ct.c, ct.loc, root.eroot, false) + } + return nil +} + +// rootUpdateDue returns true when a root update is needed. +func (ct *clientTree) rootUpdateDue() bool { + return ct.root == nil || time.Duration(ct.c.clock.Now()-ct.lastRootCheck) > ct.c.cfg.RecheckInterval +} + +// subtreeSync is the sync of an ENR or link subtree. +type subtreeSync struct { + c *Client + loc *linkEntry + root string + missing []string // missing tree node hashes + link bool // true if this sync is for the link tree +} + +func newSubtreeSync(c *Client, loc *linkEntry, root string, link bool) *subtreeSync { + return &subtreeSync{c, loc, root, []string{root}, link} +} + +func (ts *subtreeSync) done() bool { + return len(ts.missing) == 0 +} + +func (ts *subtreeSync) resolveAll(dest map[string]entry) error { + for !ts.done() { + hash := ts.missing[0] + ctx, cancel := context.WithTimeout(context.Background(), ts.c.cfg.Timeout) + e, err := ts.resolveNext(ctx, hash) + cancel() + if err != nil { + return err + } + dest[hash] = e + ts.missing = ts.missing[1:] + } + return nil +} + +func (ts *subtreeSync) resolveNext(ctx context.Context, hash string) (entry, error) { + e, err := ts.c.resolveEntry(ctx, ts.loc.domain, hash) + if err != nil { + return nil, err + } + switch e := e.(type) { + case *enrEntry: + if ts.link { + return nil, errENRInLinkTree + } + case *linkEntry: + if !ts.link { + return nil, errLinkInENRTree + } + case *subtreeEntry: + ts.missing = append(ts.missing, e.children...) + } + return e, nil +} + +// linkCache tracks the links of a tree. +type linkCache struct { + self *clientTree + directM map[*clientTree]struct{} // direct links + allM map[*clientTree]struct{} // direct & transitive links +} + +// reset clears the cache. +func (lc *linkCache) reset() { + lc.directM = nil + lc.allM = nil +} + +// add adds a direct link to the cache. +func (lc *linkCache) add(ct *clientTree) { + if lc.directM == nil { + lc.directM = make(map[*clientTree]struct{}) + } + if _, ok := lc.directM[ct]; !ok { + lc.invalidate() + } + lc.directM[ct] = struct{}{} +} + +// invalidate resets the cache of transitive links. +func (lc *linkCache) invalidate() { + lc.allM = nil +} + +// valid returns true when the cache of transitive links is up-to-date. +func (lc *linkCache) valid() bool { + // Re-check validity of child caches to catch updates. + for ct := range lc.allM { + if ct != lc.self && !ct.linkCache.valid() { + lc.allM = nil + break + } + } + return lc.allM != nil +} + +// all returns all trees reachable through the cache. +func (lc *linkCache) all() map[*clientTree]struct{} { + if lc.valid() { + return lc.allM + } + // Remake lc.allM it by taking the union of all() across children. + m := make(map[*clientTree]struct{}) + if lc.self != nil { + m[lc.self] = struct{}{} + } + for ct := range lc.directM { + m[ct] = struct{}{} + for lt := range ct.linkCache.all() { + m[lt] = struct{}{} + } + } + lc.allM = m + return m +} diff --git a/p2p/dnsdisc/tree.go b/p2p/dnsdisc/tree.go new file mode 100644 index 000000000000..855d4968c518 --- /dev/null +++ b/p2p/dnsdisc/tree.go @@ -0,0 +1,384 @@ +// Copyright 2018 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + +package dnsdisc + +import ( + "bytes" + "crypto/ecdsa" + "encoding/base32" + "encoding/base64" + "fmt" + "io" + "sort" + "strings" + + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethereum/go-ethereum/rlp" + "golang.org/x/crypto/sha3" +) + +// Tree is a merkle tree of node records. +type Tree struct { + root *rootEntry + entries map[string]entry +} + +// Sign signs the tree with the given private key and sets the sequence number. +func (t *Tree) Sign(key *ecdsa.PrivateKey, domain string) (url string, err error) { + root := *t.root + sig, err := crypto.Sign(root.sigHash(), key) + if err != nil { + return "", err + } + root.sig = sig + t.root = &root + link := &linkEntry{domain, &key.PublicKey} + return link.url(), nil +} + +// SetSignature verifies the given signature and assigns it as the tree's current +// signature if valid. +func (t *Tree) SetSignature(pubkey *ecdsa.PublicKey, signature string) error { + sig, err := b64format.DecodeString(signature) + if err != nil || len(sig) != crypto.SignatureLength { + return errInvalidSig + } + root := *t.root + root.sig = sig + if !root.verifySignature(pubkey) { + return errInvalidSig + } + t.root = &root + return nil +} + +// Seq returns the sequence number of the tree. +func (t *Tree) Seq() uint { + return t.root.seq +} + +// Signature returns the signature of the tree. +func (t *Tree) Signature() string { + return b64format.EncodeToString(t.root.sig) +} + +// ToTXT returns all DNS TXT records required for the tree. +func (t *Tree) ToTXT(domain string) map[string]string { + records := map[string]string{domain: t.root.String()} + for _, e := range t.entries { + sd := subdomain(e) + if domain != "" { + sd = sd + "." + domain + } + records[sd] = e.String() + } + return records +} + +// Links returns all links contained in the tree. +func (t *Tree) Links() []string { + var links []string + for _, e := range t.entries { + if le, ok := e.(*linkEntry); ok { + links = append(links, le.url()) + } + } + return links +} + +// Nodes returns all nodes contained in the tree. +func (t *Tree) Nodes() []*enode.Node { + var nodes []*enode.Node + for _, e := range t.entries { + if ee, ok := e.(*enrEntry); ok { + nodes = append(nodes, ee.node) + } + } + return nodes +} + +const ( + hashAbbrev = 16 + maxChildren = 300 / (hashAbbrev * (13 / 8)) + minHashLength = 12 + rootPrefix = "enrtree-root=v1" +) + +// MakeTree creates a tree containing the given nodes and links. +func MakeTree(seq uint, nodes []*enode.Node, links []string) (*Tree, error) { + // Sort records by ID and ensure all nodes have a valid record. + records := make([]*enode.Node, len(nodes)) + copy(records, nodes) + sortByID(records) + for _, n := range records { + if len(n.Record().Signature()) == 0 { + return nil, fmt.Errorf("can't add node %v: unsigned node record", n.ID()) + } + } + + // Create the leaf list. + enrEntries := make([]entry, len(records)) + for i, r := range records { + enrEntries[i] = &enrEntry{r} + } + linkEntries := make([]entry, len(links)) + for i, l := range links { + le, err := parseURL(l) + if err != nil { + return nil, err + } + linkEntries[i] = le + } + + // Create intermediate nodes. + t := &Tree{entries: make(map[string]entry)} + eroot := t.build(enrEntries) + t.entries[subdomain(eroot)] = eroot + lroot := t.build(linkEntries) + t.entries[subdomain(lroot)] = lroot + t.root = &rootEntry{seq: seq, eroot: subdomain(eroot), lroot: subdomain(lroot)} + return t, nil +} + +func (t *Tree) build(entries []entry) entry { + if len(entries) == 1 { + return entries[0] + } + if len(entries) <= maxChildren { + hashes := make([]string, len(entries)) + for i, e := range entries { + hashes[i] = subdomain(e) + t.entries[hashes[i]] = e + } + return &subtreeEntry{hashes} + } + var subtrees []entry + for len(entries) > 0 { + n := maxChildren + if len(entries) < n { + n = len(entries) + } + sub := t.build(entries[:n]) + entries = entries[n:] + subtrees = append(subtrees, sub) + t.entries[subdomain(sub)] = sub + } + return t.build(subtrees) +} + +func sortByID(nodes []*enode.Node) []*enode.Node { + sort.Slice(nodes, func(i, j int) bool { + return bytes.Compare(nodes[i].ID().Bytes(), nodes[j].ID().Bytes()) < 0 + }) + return nodes +} + +// Entry Types + +type entry interface { + fmt.Stringer +} + +type ( + rootEntry struct { + eroot string + lroot string + seq uint + sig []byte + } + subtreeEntry struct { + children []string + } + enrEntry struct { + node *enode.Node + } + linkEntry struct { + domain string + pubkey *ecdsa.PublicKey + } +) + +// Entry Encoding + +var ( + b32format = base32.StdEncoding.WithPadding(base32.NoPadding) + b64format = base64.URLEncoding +) + +func subdomain(e entry) string { + h := sha3.NewLegacyKeccak256() + io.WriteString(h, e.String()) + return b32format.EncodeToString(h.Sum(nil)[:16]) +} + +func (e *rootEntry) String() string { + return fmt.Sprintf(rootPrefix+" e=%s l=%s seq=%d sig=%s", e.eroot, e.lroot, e.seq, b64format.EncodeToString(e.sig)) +} + +func (e *rootEntry) sigHash() []byte { + h := sha3.NewLegacyKeccak256() + fmt.Fprintf(h, rootPrefix+" e=%s l=%s seq=%d", e.eroot, e.lroot, e.seq) + return h.Sum(nil) +} + +func (e *rootEntry) verifySignature(pubkey *ecdsa.PublicKey) bool { + sig := e.sig[:crypto.RecoveryIDOffset] // remove recovery id + return crypto.VerifySignature(crypto.FromECDSAPub(pubkey), e.sigHash(), sig) +} + +func (e *subtreeEntry) String() string { + return "enrtree=" + strings.Join(e.children, ",") +} + +func (e *enrEntry) String() string { + enc, _ := rlp.EncodeToBytes(e.node.Record()) + return "enr=" + b64format.EncodeToString(enc) +} + +func (e *linkEntry) String() string { + return "enrtree-link=" + e.link() +} + +func (e *linkEntry) url() string { + return "enrtree://" + e.link() +} + +func (e *linkEntry) link() string { + return fmt.Sprintf("%s@%s", b32format.EncodeToString(crypto.CompressPubkey(e.pubkey)), e.domain) +} + +// Entry Parsing + +func parseEntry(e string, validSchemes enr.IdentityScheme) (entry, error) { + switch { + case strings.HasPrefix(e, "enrtree-link="): + return parseLink(e[13:]) + case strings.HasPrefix(e, "enrtree="): + return parseSubtree(e[8:]) + case strings.HasPrefix(e, "enr="): + return parseENR(e[4:], validSchemes) + default: + return nil, errUnknownEntry + } +} + +func parseRoot(e string) (rootEntry, error) { + var eroot, lroot, sig string + var seq uint + if _, err := fmt.Sscanf(e, rootPrefix+" e=%s l=%s seq=%d sig=%s", &eroot, &lroot, &seq, &sig); err != nil { + return rootEntry{}, entryError{"root", errSyntax} + } + if !isValidHash(eroot) || !isValidHash(lroot) { + return rootEntry{}, entryError{"root", errInvalidChild} + } + sigb, err := b64format.DecodeString(sig) + if err != nil || len(sigb) != crypto.SignatureLength { + return rootEntry{}, entryError{"root", errInvalidSig} + } + return rootEntry{eroot, lroot, seq, sigb}, nil +} + +func parseLink(e string) (entry, error) { + pos := strings.IndexByte(e, '@') + if pos == -1 { + return nil, entryError{"link", errNoPubkey} + } + keystring, domain := e[:pos], e[pos+1:] + keybytes, err := b32format.DecodeString(keystring) + if err != nil { + return nil, entryError{"link", errBadPubkey} + } + key, err := crypto.DecompressPubkey(keybytes) + if err != nil { + return nil, entryError{"link", errBadPubkey} + } + return &linkEntry{domain, key}, nil +} + +func parseSubtree(e string) (entry, error) { + if e == "" { + return &subtreeEntry{}, nil // empty entry is OK + } + hashes := make([]string, 0, strings.Count(e, ",")) + for _, c := range strings.Split(e, ",") { + if !isValidHash(c) { + return nil, entryError{"subtree", errInvalidChild} + } + hashes = append(hashes, c) + } + return &subtreeEntry{hashes}, nil +} + +func parseENR(e string, validSchemes enr.IdentityScheme) (entry, error) { + enc, err := b64format.DecodeString(e) + if err != nil { + return nil, entryError{"enr", errInvalidENR} + } + var rec enr.Record + if err := rlp.DecodeBytes(enc, &rec); err != nil { + return nil, entryError{"enr", err} + } + n, err := enode.New(validSchemes, &rec) + if err != nil { + return nil, entryError{"enr", err} + } + return &enrEntry{n}, nil +} + +func isValidHash(s string) bool { + dlen := b32format.DecodedLen(len(s)) + if dlen < minHashLength || dlen > 32 || strings.ContainsAny(s, "\n\r") { + return false + } + buf := make([]byte, 32) + _, err := b32format.Decode(buf, []byte(s)) + return err == nil +} + +// truncateHash truncates the given base32 hash string to the minimum acceptable length. +func truncateHash(hash string) string { + maxLen := b32format.EncodedLen(minHashLength) + if len(hash) < maxLen { + panic(fmt.Errorf("dnsdisc: hash %q is too short", hash)) + } + return hash[:maxLen] +} + +// URL encoding + +// ParseURL parses an enrtree:// URL and returns its components. +func ParseURL(url string) (domain string, pubkey *ecdsa.PublicKey, err error) { + le, err := parseURL(url) + if err != nil { + return "", nil, err + } + return le.domain, le.pubkey, nil +} + +func parseURL(url string) (*linkEntry, error) { + const scheme = "enrtree://" + if !strings.HasPrefix(url, scheme) { + return nil, fmt.Errorf("wrong/missing scheme 'enrtree' in URL") + } + le, err := parseLink(url[len(scheme):]) + if err != nil { + return nil, err.(entryError).err + } + return le.(*linkEntry), nil +} diff --git a/p2p/dnsdisc/tree_test.go b/p2p/dnsdisc/tree_test.go new file mode 100644 index 000000000000..e2fe962452e0 --- /dev/null +++ b/p2p/dnsdisc/tree_test.go @@ -0,0 +1,144 @@ +// Copyright 2018 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + +package dnsdisc + +import ( + "reflect" + "testing" + + "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/p2p/enode" +) + +func TestParseRoot(t *testing.T) { + tests := []struct { + input string + e rootEntry + err error + }{ + { + input: "enrtree-root=v1 e=TO4Q75OQ2N7DX4EOOR7X66A6OM seq=3 sig=N-YY6UB9xD0hFx1Gmnt7v0RfSxch5tKyry2SRDoLx7B4GfPXagwLxQqyf7gAMvApFn_ORwZQekMWa_pXrcGCtw=", + err: entryError{"root", errSyntax}, + }, + { + input: "enrtree-root=v1 e=TO4Q75OQ2N7DX4EOOR7X66A6OM l=TO4Q75OQ2N7DX4EOOR7X66A6OM seq=3 sig=N-YY6UB9xD0hFx1Gmnt7v0RfSxch5tKyry2SRDoLx7B4GfPXagwLxQqyf7gAMvApFn_ORwZQekMWa_pXrcGCtw=", + err: entryError{"root", errInvalidSig}, + }, + { + input: "enrtree-root=v1 e=QFT4PBCRX4XQCV3VUYJ6BTCEPU l=JGUFMSAGI7KZYB3P7IZW4S5Y3A seq=3 sig=3FmXuVwpa8Y7OstZTx9PIb1mt8FrW7VpDOFv4AaGCsZ2EIHmhraWhe4NxYhQDlw5MjeFXYMbJjsPeKlHzmJREQE=", + e: rootEntry{ + eroot: "QFT4PBCRX4XQCV3VUYJ6BTCEPU", + lroot: "JGUFMSAGI7KZYB3P7IZW4S5Y3A", + seq: 3, + sig: hexutil.MustDecode("0xdc5997b95c296bc63b3acb594f1f4f21bd66b7c16b5bb5690ce16fe006860ac6761081e686b69685ee0dc588500e5c393237855d831b263b0f78a947ce62511101"), + }, + }, + } + for i, test := range tests { + e, err := parseRoot(test.input) + if !reflect.DeepEqual(e, test.e) { + t.Errorf("test %d: wrong entry %s, want %s", i, spew.Sdump(e), spew.Sdump(test.e)) + } + if err != test.err { + t.Errorf("test %d: wrong error %q, want %q", i, err, test.err) + } + } +} + +func TestParseEntry(t *testing.T) { + testkey := testKey(signingKeySeed) + tests := []struct { + input string + e entry + err error + }{ + // Subtrees: + { + input: "enrtree=1,2", + err: entryError{"subtree", errInvalidChild}, + }, + { + input: "enrtree=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + err: entryError{"subtree", errInvalidChild}, + }, + { + input: "enrtree=", + e: &subtreeEntry{}, + }, + { + input: "enrtree=AAAAAAAAAAAAAAAAAAAA", + e: &subtreeEntry{[]string{"AAAAAAAAAAAAAAAAAAAA"}}, + }, + { + input: "enrtree=AAAAAAAAAAAAAAAAAAAA,BBBBBBBBBBBBBBBBBBBB", + e: &subtreeEntry{[]string{"AAAAAAAAAAAAAAAAAAAA", "BBBBBBBBBBBBBBBBBBBB"}}, + }, + // Links + { + input: "enrtree-link=AKPYQIUQIL7PSIACI32J7FGZW56E5FKHEFCCOFHILBIMW3M6LWXS2@nodes.example.org", + e: &linkEntry{"nodes.example.org", &testkey.PublicKey}, + }, + { + input: "enrtree-link=nodes.example.org", + err: entryError{"link", errNoPubkey}, + }, + { + input: "enrtree-link=AP62DT7WOTEQZGQZOU474PP3KMEGVTTE7A7NPRXKX3DUD57@nodes.example.org", + err: entryError{"link", errBadPubkey}, + }, + { + input: "enrtree-link=AP62DT7WONEQZGQZOU474PP3KMEGVTTE7A7NPRXKX3DUD57TQHGIA@nodes.example.org", + err: entryError{"link", errBadPubkey}, + }, + // ENRs + { + input: "enr=-HW4QES8QIeXTYlDzbfr1WEzE-XKY4f8gJFJzjJL-9D7TC9lJb4Z3JPRRz1lP4pL_N_QpT6rGQjAU9Apnc-C1iMP36OAgmlkgnY0iXNlY3AyNTZrMaED5IdwfMxdmR8W37HqSFdQLjDkIwBd4Q_MjxgZifgKSdM=", + e: &enrEntry{node: testNode(nodesSeed1)}, + }, + { + input: "enr=-HW4QLZHjM4vZXkbp-5xJoHsKSbE7W39FPC8283X-y8oHcHPTnDDlIlzL5ArvDUlHZVDPgmFASrh7cWgLOLxj4wprRkHgmlkgnY0iXNlY3AyNTZrMaEC3t2jLMhDpCDX5mbSEwDn4L3iUfyXzoO8G28XvjGRkrAg=", + err: entryError{"enr", errInvalidENR}, + }, + // Invalid: + {input: "", err: errUnknownEntry}, + {input: "foo", err: errUnknownEntry}, + {input: "enrtree", err: errUnknownEntry}, + {input: "enrtree-x=", err: errUnknownEntry}, + } + for i, test := range tests { + e, err := parseEntry(test.input, enode.ValidSchemes) + if !reflect.DeepEqual(e, test.e) { + t.Errorf("test %d: wrong entry %s, want %s", i, spew.Sdump(e), spew.Sdump(test.e)) + } + if err != test.err { + t.Errorf("test %d: wrong error %q, want %q", i, err, test.err) + } + } +} + +func TestMakeTree(t *testing.T) { + nodes := testNodes(nodesSeed2, 50) + tree, err := MakeTree(2, nodes, nil) + if err != nil { + t.Fatal(err) + } + txt := tree.ToTXT("") + if len(txt) < len(nodes)+1 { + t.Fatal("too few TXT records in output") + } +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/CODE_OF_CONDUCT.md b/vendor/github.com/cloudflare/cloudflare-go/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..bfbc69d229dd --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/CODE_OF_CONDUCT.md @@ -0,0 +1,77 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at ggalow@cloudflare.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq + diff --git a/vendor/github.com/cloudflare/cloudflare-go/LICENSE b/vendor/github.com/cloudflare/cloudflare-go/LICENSE new file mode 100644 index 000000000000..33865c30fb31 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2015-2019, Cloudflare. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors +may be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/cloudflare/cloudflare-go/README.md b/vendor/github.com/cloudflare/cloudflare-go/README.md new file mode 100644 index 000000000000..8f5d77b74091 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/README.md @@ -0,0 +1,107 @@ +# cloudflare-go + +[![GoDoc](https://img.shields.io/badge/godoc-reference-5673AF.svg?style=flat-square)](https://godoc.org/github.com/cloudflare/cloudflare-go) +[![Build Status](https://img.shields.io/travis/cloudflare/cloudflare-go/master.svg?style=flat-square)](https://travis-ci.org/cloudflare/cloudflare-go) +[![Go Report Card](https://goreportcard.com/badge/github.com/cloudflare/cloudflare-go?style=flat-square)](https://goreportcard.com/report/github.com/cloudflare/cloudflare-go) + +> **Note**: This library is under active development as we expand it to cover +> our (expanding!) API. Consider the public API of this package a little +> unstable as we work towards a v1.0. + +A Go library for interacting with +[Cloudflare's API v4](https://api.cloudflare.com/). This library allows you to: + +* Manage and automate changes to your DNS records within Cloudflare +* Manage and automate changes to your zones (domains) on Cloudflare, including + adding new zones to your account +* List and modify the status of WAF (Web Application Firewall) rules for your + zones +* Fetch Cloudflare's IP ranges for automating your firewall whitelisting + +A command-line client, [flarectl](cmd/flarectl), is also available as part of +this project. + +## Features + +The current feature list includes: + +* [x] Cache purging +* [x] Cloudflare IPs +* [x] Custom hostnames +* [x] DNS Records +* [x] Firewall (partial) +* [ ] [Keyless SSL](https://blog.cloudflare.com/keyless-ssl-the-nitty-gritty-technical-details/) +* [x] [Load Balancing](https://blog.cloudflare.com/introducing-load-balancing-intelligent-failover-with-cloudflare/) +* [x] [Logpush Jobs](https://developers.cloudflare.com/logs/logpush/) +* [ ] Organization Administration +* [x] [Origin CA](https://blog.cloudflare.com/universal-ssl-encryption-all-the-way-to-the-origin-for-free/) +* [x] [Railgun](https://www.cloudflare.com/railgun/) administration +* [x] Rate Limiting +* [x] User Administration (partial) +* [x] Virtual DNS Management +* [x] Web Application Firewall (WAF) +* [x] Zone Lockdown and User-Agent Block rules +* [x] Zones + +Pull Requests are welcome, but please open an issue (or comment in an existing +issue) to discuss any non-trivial changes before submitting code. + +## Installation + +You need a working Go environment. + +``` +go get github.com/cloudflare/cloudflare-go +``` + +## Getting Started + +```go +package main + +import ( + "fmt" + "log" + "os" + + "github.com/cloudflare/cloudflare-go" +) + +func main() { + // Construct a new API object + api, err := cloudflare.New(os.Getenv("CF_API_KEY"), os.Getenv("CF_API_EMAIL")) + if err != nil { + log.Fatal(err) + } + + // Fetch user details on the account + u, err := api.UserDetails() + if err != nil { + log.Fatal(err) + } + // Print user details + fmt.Println(u) + + // Fetch the zone ID + id, err := api.ZoneIDByName("example.com") // Assuming example.com exists in your Cloudflare account already + if err != nil { + log.Fatal(err) + } + + // Fetch zone details + zone, err := api.ZoneDetails(id) + if err != nil { + log.Fatal(err) + } + // Print zone details + fmt.Println(zone) +} +``` + +Also refer to the +[API documentation](https://godoc.org/github.com/cloudflare/cloudflare-go) for +how to use this package in-depth. + +# License + +BSD licensed. See the [LICENSE](LICENSE) file for details. diff --git a/vendor/github.com/cloudflare/cloudflare-go/access_application.go b/vendor/github.com/cloudflare/cloudflare-go/access_application.go new file mode 100644 index 000000000000..0893c56812e1 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/access_application.go @@ -0,0 +1,180 @@ +package cloudflare + +import ( + "encoding/json" + "fmt" + "net/url" + "strconv" + "time" + + "github.com/pkg/errors" +) + +// AccessApplication represents an Access application. +type AccessApplication struct { + ID string `json:"id,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + AUD string `json:"aud,omitempty"` + Name string `json:"name"` + Domain string `json:"domain"` + SessionDuration string `json:"session_duration,omitempty"` +} + +// AccessApplicationListResponse represents the response from the list +// access applications endpoint. +type AccessApplicationListResponse struct { + Result []AccessApplication `json:"result"` + Response + ResultInfo `json:"result_info"` +} + +// AccessApplicationDetailResponse is the API response, containing a single +// access application. +type AccessApplicationDetailResponse struct { + Success bool `json:"success"` + Errors []string `json:"errors"` + Messages []string `json:"messages"` + Result AccessApplication `json:"result"` +} + +// AccessApplications returns all applications within a zone. +// +// API reference: https://api.cloudflare.com/#access-applications-list-access-applications +func (api *API) AccessApplications(zoneID string, pageOpts PaginationOptions) ([]AccessApplication, ResultInfo, error) { + v := url.Values{} + if pageOpts.PerPage > 0 { + v.Set("per_page", strconv.Itoa(pageOpts.PerPage)) + } + if pageOpts.Page > 0 { + v.Set("page", strconv.Itoa(pageOpts.Page)) + } + + uri := "/zones/" + zoneID + "/access/apps" + if len(v) > 0 { + uri = uri + "?" + v.Encode() + } + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []AccessApplication{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError) + } + + var accessApplicationListResponse AccessApplicationListResponse + err = json.Unmarshal(res, &accessApplicationListResponse) + if err != nil { + return []AccessApplication{}, ResultInfo{}, errors.Wrap(err, errUnmarshalError) + } + + return accessApplicationListResponse.Result, accessApplicationListResponse.ResultInfo, nil +} + +// AccessApplication returns a single application based on the +// application ID. +// +// API reference: https://api.cloudflare.com/#access-applications-access-applications-details +func (api *API) AccessApplication(zoneID, applicationID string) (AccessApplication, error) { + uri := fmt.Sprintf( + "/zones/%s/access/apps/%s", + zoneID, + applicationID, + ) + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return AccessApplication{}, errors.Wrap(err, errMakeRequestError) + } + + var accessApplicationDetailResponse AccessApplicationDetailResponse + err = json.Unmarshal(res, &accessApplicationDetailResponse) + if err != nil { + return AccessApplication{}, errors.Wrap(err, errUnmarshalError) + } + + return accessApplicationDetailResponse.Result, nil +} + +// CreateAccessApplication creates a new access application. +// +// API reference: https://api.cloudflare.com/#access-applications-create-access-application +func (api *API) CreateAccessApplication(zoneID string, accessApplication AccessApplication) (AccessApplication, error) { + uri := "/zones/" + zoneID + "/access/apps" + + res, err := api.makeRequest("POST", uri, accessApplication) + if err != nil { + return AccessApplication{}, errors.Wrap(err, errMakeRequestError) + } + + var accessApplicationDetailResponse AccessApplicationDetailResponse + err = json.Unmarshal(res, &accessApplicationDetailResponse) + if err != nil { + return AccessApplication{}, errors.Wrap(err, errUnmarshalError) + } + + return accessApplicationDetailResponse.Result, nil +} + +// UpdateAccessApplication updates an existing access application. +// +// API reference: https://api.cloudflare.com/#access-applications-update-access-application +func (api *API) UpdateAccessApplication(zoneID string, accessApplication AccessApplication) (AccessApplication, error) { + if accessApplication.ID == "" { + return AccessApplication{}, errors.Errorf("access application ID cannot be empty") + } + + uri := fmt.Sprintf( + "/zones/%s/access/apps/%s", + zoneID, + accessApplication.ID, + ) + + res, err := api.makeRequest("PUT", uri, accessApplication) + if err != nil { + return AccessApplication{}, errors.Wrap(err, errMakeRequestError) + } + + var accessApplicationDetailResponse AccessApplicationDetailResponse + err = json.Unmarshal(res, &accessApplicationDetailResponse) + if err != nil { + return AccessApplication{}, errors.Wrap(err, errUnmarshalError) + } + + return accessApplicationDetailResponse.Result, nil +} + +// DeleteAccessApplication deletes an access application. +// +// API reference: https://api.cloudflare.com/#access-applications-delete-access-application +func (api *API) DeleteAccessApplication(zoneID, applicationID string) error { + uri := fmt.Sprintf( + "/zones/%s/access/apps/%s", + zoneID, + applicationID, + ) + + _, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + + return nil +} + +// RevokeAccessApplicationTokens revokes tokens associated with an +// access application. +// +// API reference: https://api.cloudflare.com/#access-applications-revoke-access-tokens +func (api *API) RevokeAccessApplicationTokens(zoneID, applicationID string) error { + uri := fmt.Sprintf( + "/zones/%s/access/apps/%s/revoke-tokens", + zoneID, + applicationID, + ) + + _, err := api.makeRequest("POST", uri, nil) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + + return nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/access_identity_provider.go b/vendor/github.com/cloudflare/cloudflare-go/access_identity_provider.go new file mode 100644 index 000000000000..b41ed8ff0c60 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/access_identity_provider.go @@ -0,0 +1,331 @@ +package cloudflare + +import ( + "encoding/json" + "fmt" + + "github.com/pkg/errors" +) + +// AccessIdentityProvider is the structure of the provider object. +type AccessIdentityProvider struct { + ID string `json:"id,omitemtpy"` + Name string `json:"name"` + Type string `json:"type"` + Config interface{} `json:"config"` +} + +// AccessAzureADConfiguration is the representation of the Azure AD identity +// provider. +// +// API reference: https://developers.cloudflare.com/access/configuring-identity-providers/azuread/ +type AccessAzureADConfiguration struct { + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` + DirectoryID string `json:"directory_id"` + SupportGroups bool `json:"support_groups"` +} + +// AccessCentrifyConfiguration is the representation of the Centrify identity +// provider. +// +// API reference: https://developers.cloudflare.com/access/configuring-identity-providers/centrify/ +type AccessCentrifyConfiguration struct { + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` + CentrifyAccount string `json:"centrify_account"` + CentrifyAppID string `json:"centrify_app_id"` +} + +// AccessCentrifySAMLConfiguration is the representation of the Centrify +// identity provider using SAML. +// +// API reference: https://developers.cloudflare.com/access/configuring-identity-providers/saml-centrify/ +type AccessCentrifySAMLConfiguration struct { + IssuerURL string `json:"issuer_url"` + SsoTargetURL string `json:"sso_target_url"` + Attributes []string `json:"attributes"` + EmailAttributeName string `json:"email_attribute_name"` + SignRequest bool `json:"sign_request"` + IdpPublicCert string `json:"idp_public_cert"` +} + +// AccessFacebookConfiguration is the representation of the Facebook identity +// provider. +// +// API reference: https://developers.cloudflare.com/access/configuring-identity-providers/facebook-login/ +type AccessFacebookConfiguration struct { + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` +} + +// AccessGSuiteConfiguration is the representation of the GSuite identity +// provider. +// +// API reference: https://developers.cloudflare.com/access/configuring-identity-providers/gsuite/ +type AccessGSuiteConfiguration struct { + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` + AppsDomain string `json:"apps_domain"` +} + +// AccessGenericOIDCConfiguration is the representation of the generic OpenID +// Connect (OIDC) connector. +// +// API reference: https://developers.cloudflare.com/access/configuring-identity-providers/generic-oidc/ +type AccessGenericOIDCConfiguration struct { + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` + AuthURL string `json:"auth_url"` + TokenURL string `json:"token_url"` + CertsURL string `json:"certs_url"` +} + +// AccessGitHubConfiguration is the representation of the GitHub identity +// provider. +// +// API reference: https://developers.cloudflare.com/access/configuring-identity-providers/github/ +type AccessGitHubConfiguration struct { + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` +} + +// AccessGoogleConfiguration is the representation of the Google identity +// provider. +// +// API reference: https://developers.cloudflare.com/access/configuring-identity-providers/google/ +type AccessGoogleConfiguration struct { + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` +} + +// AccessJumpCloudSAMLConfiguration is the representation of the Jump Cloud +// identity provider using SAML. +// +// API reference: https://developers.cloudflare.com/access/configuring-identity-providers/jumpcloud-saml/ +type AccessJumpCloudSAMLConfiguration struct { + IssuerURL string `json:"issuer_url"` + SsoTargetURL string `json:"sso_target_url"` + Attributes []string `json:"attributes"` + EmailAttributeName string `json:"email_attribute_name"` + SignRequest bool `json:"sign_request"` + IdpPublicCert string `json:"idp_public_cert"` +} + +// AccessOktaConfiguration is the representation of the Okta identity provider. +// +// API reference: https://developers.cloudflare.com/access/configuring-identity-providers/okta/ +type AccessOktaConfiguration struct { + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` + OktaAccount string `json:"okta_account"` +} + +// AccessOktaSAMLConfiguration is the representation of the Okta identity +// provider using SAML. +// +// API reference: https://developers.cloudflare.com/access/configuring-identity-providers/saml-okta/ +type AccessOktaSAMLConfiguration struct { + IssuerURL string `json:"issuer_url"` + SsoTargetURL string `json:"sso_target_url"` + Attributes []string `json:"attributes"` + EmailAttributeName string `json:"email_attribute_name"` + SignRequest bool `json:"sign_request"` + IdpPublicCert string `json:"idp_public_cert"` +} + +// AccessOneTimePinConfiguration is the representation of the default One Time +// Pin identity provider. +// +// API reference: https://developers.cloudflare.com/access/configuring-identity-providers/one-time-pin/ +type AccessOneTimePinConfiguration struct{} + +// AccessOneLoginOIDCConfiguration is the representation of the OneLogin +// OpenID connector as an identity provider. +// +// API reference: https://developers.cloudflare.com/access/configuring-identity-providers/onelogin-oidc/ +type AccessOneLoginOIDCConfiguration struct { + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` + OneloginAccount string `json:"onelogin_account"` +} + +// AccessOneLoginSAMLConfiguration is the representation of the OneLogin +// identity provider using SAML. +// +// API reference: https://developers.cloudflare.com/access/configuring-identity-providers/onelogin-saml/ +type AccessOneLoginSAMLConfiguration struct { + IssuerURL string `json:"issuer_url"` + SsoTargetURL string `json:"sso_target_url"` + Attributes []string `json:"attributes"` + EmailAttributeName string `json:"email_attribute_name"` + SignRequest bool `json:"sign_request"` + IdpPublicCert string `json:"idp_public_cert"` +} + +// AccessPingSAMLConfiguration is the representation of the Ping identity +// provider using SAML. +// +// API reference: https://developers.cloudflare.com/access/configuring-identity-providers/ping-saml/ +type AccessPingSAMLConfiguration struct { + IssuerURL string `json:"issuer_url"` + SsoTargetURL string `json:"sso_target_url"` + Attributes []string `json:"attributes"` + EmailAttributeName string `json:"email_attribute_name"` + SignRequest bool `json:"sign_request"` + IdpPublicCert string `json:"idp_public_cert"` +} + +// AccessYandexConfiguration is the representation of the Yandex identity provider. +// +// API reference: https://developers.cloudflare.com/access/configuring-identity-providers/yandex/ +type AccessYandexConfiguration struct { + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` +} + +// AccessADSAMLConfiguration is the representation of the Active Directory +// identity provider using SAML. +// +// API reference: https://developers.cloudflare.com/access/configuring-identity-providers/adfs/ +type AccessADSAMLConfiguration struct { + IssuerURL string `json:"issuer_url"` + SsoTargetURL string `json:"sso_target_url"` + Attributes []string `json:"attributes"` + EmailAttributeName string `json:"email_attribute_name"` + SignRequest bool `json:"sign_request"` + IdpPublicCert string `json:"idp_public_cert"` +} + +// AccessIdentityProvidersListResponse is the API response for multiple +// Access Identity Providers. +type AccessIdentityProvidersListResponse struct { + Success bool `json:"success"` + Errors []string `json:"errors"` + Messages []string `json:"messages"` + Result []AccessIdentityProvider `json:"result"` +} + +// AccessIdentityProviderListResponse is the API response for a single +// Access Identity Provider. +type AccessIdentityProviderListResponse struct { + Success bool `json:"success"` + Errors []string `json:"errors"` + Messages []string `json:"messages"` + Result AccessIdentityProvider `json:"result"` +} + +// AccessIdentityProviders returns all Access Identity Providers for an +// account. +// +// API reference: https://api.cloudflare.com/#access-identity-providers-list-access-identity-providers +func (api *API) AccessIdentityProviders(accountID string) ([]AccessIdentityProvider, error) { + uri := "/accounts/" + accountID + "/access/identity_providers" + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []AccessIdentityProvider{}, errors.Wrap(err, errMakeRequestError) + } + + var accessIdentityProviderResponse AccessIdentityProvidersListResponse + err = json.Unmarshal(res, &accessIdentityProviderResponse) + if err != nil { + return []AccessIdentityProvider{}, errors.Wrap(err, errUnmarshalError) + } + + return accessIdentityProviderResponse.Result, nil +} + +// AccessIdentityProviderDetails returns a single Access Identity +// Provider for an account. +// +// API reference: https://api.cloudflare.com/#access-identity-providers-access-identity-providers-details +func (api *API) AccessIdentityProviderDetails(accountID, identityProviderID string) (AccessIdentityProvider, error) { + uri := fmt.Sprintf( + "/accounts/%s/access/identity_providers/%s", + accountID, + identityProviderID, + ) + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return AccessIdentityProvider{}, errors.Wrap(err, errMakeRequestError) + } + + var accessIdentityProviderResponse AccessIdentityProviderListResponse + err = json.Unmarshal(res, &accessIdentityProviderResponse) + if err != nil { + return AccessIdentityProvider{}, errors.Wrap(err, errUnmarshalError) + } + + return accessIdentityProviderResponse.Result, nil +} + +// CreateAccessIdentityProvider creates a new Access Identity Provider. +// +// API reference: https://api.cloudflare.com/#access-identity-providers-create-access-identity-provider +func (api *API) CreateAccessIdentityProvider(accountID string, identityProviderConfiguration AccessIdentityProvider) (AccessIdentityProvider, error) { + uri := "/accounts/" + accountID + "/access/identity_providers" + + res, err := api.makeRequest("POST", uri, identityProviderConfiguration) + if err != nil { + return AccessIdentityProvider{}, errors.Wrap(err, errMakeRequestError) + } + + var accessIdentityProviderResponse AccessIdentityProviderListResponse + err = json.Unmarshal(res, &accessIdentityProviderResponse) + if err != nil { + return AccessIdentityProvider{}, errors.Wrap(err, errUnmarshalError) + } + + return accessIdentityProviderResponse.Result, nil +} + +// UpdateAccessIdentityProvider updates an existing Access Identity +// Provider. +// +// API reference: https://api.cloudflare.com/#access-identity-providers-create-access-identity-provider +func (api *API) UpdateAccessIdentityProvider(accountID, identityProviderUUID string, identityProviderConfiguration AccessIdentityProvider) (AccessIdentityProvider, error) { + uri := fmt.Sprintf( + "/accounts/%s/access/identity_providers/%s", + accountID, + identityProviderUUID, + ) + + res, err := api.makeRequest("PUT", uri, identityProviderConfiguration) + if err != nil { + return AccessIdentityProvider{}, errors.Wrap(err, errMakeRequestError) + } + + var accessIdentityProviderResponse AccessIdentityProviderListResponse + err = json.Unmarshal(res, &accessIdentityProviderResponse) + if err != nil { + return AccessIdentityProvider{}, errors.Wrap(err, errUnmarshalError) + } + + return accessIdentityProviderResponse.Result, nil +} + +// DeleteAccessIdentityProvider deletes an Access Identity Provider. +// +// API reference: https://api.cloudflare.com/#access-identity-providers-create-access-identity-provider +func (api *API) DeleteAccessIdentityProvider(accountID, identityProviderUUID string) (AccessIdentityProvider, error) { + uri := fmt.Sprintf( + "/accounts/%s/access/identity_providers/%s", + accountID, + identityProviderUUID, + ) + + res, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return AccessIdentityProvider{}, errors.Wrap(err, errMakeRequestError) + } + + var accessIdentityProviderResponse AccessIdentityProviderListResponse + err = json.Unmarshal(res, &accessIdentityProviderResponse) + if err != nil { + return AccessIdentityProvider{}, errors.Wrap(err, errUnmarshalError) + } + + return accessIdentityProviderResponse.Result, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/access_organization.go b/vendor/github.com/cloudflare/cloudflare-go/access_organization.go new file mode 100644 index 000000000000..5bc4a16aa694 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/access_organization.go @@ -0,0 +1,101 @@ +package cloudflare + +import ( + "encoding/json" + "time" + + "github.com/pkg/errors" +) + +// AccessOrganization represents an Access organization. +type AccessOrganization struct { + CreatedAt *time.Time `json:"created_at"` + UpdatedAt *time.Time `json:"updated_at"` + Name string `json:"name"` + AuthDomain string `json:"auth_domain"` + LoginDesign AccessOrganizationLoginDesign `json:"login_design"` +} + +// AccessOrganizationLoginDesign represents the login design options. +type AccessOrganizationLoginDesign struct { + BackgroundColor string `json:"background_color"` + TextColor string `json:"text_color"` + LogoPath string `json:"logo_path"` +} + +// AccessOrganizationListResponse represents the response from the list +// access organization endpoint. +type AccessOrganizationListResponse struct { + Result AccessOrganization `json:"result"` + Response + ResultInfo `json:"result_info"` +} + +// AccessOrganizationDetailResponse is the API response, containing a +// single access organization. +type AccessOrganizationDetailResponse struct { + Success bool `json:"success"` + Errors []string `json:"errors"` + Messages []string `json:"messages"` + Result AccessOrganization `json:"result"` +} + +// AccessOrganization returns the Access organisation details. +// +// API reference: https://api.cloudflare.com/#access-organizations-access-organization-details +func (api *API) AccessOrganization(accountID string) (AccessOrganization, ResultInfo, error) { + uri := "/accounts/" + accountID + "/access/organizations" + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return AccessOrganization{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError) + } + + var accessOrganizationListResponse AccessOrganizationListResponse + err = json.Unmarshal(res, &accessOrganizationListResponse) + if err != nil { + return AccessOrganization{}, ResultInfo{}, errors.Wrap(err, errUnmarshalError) + } + + return accessOrganizationListResponse.Result, accessOrganizationListResponse.ResultInfo, nil +} + +// CreateAccessOrganization creates the Access organisation details. +// +// API reference: https://api.cloudflare.com/#access-organizations-create-access-organization +func (api *API) CreateAccessOrganization(accountID string, accessOrganization AccessOrganization) (AccessOrganization, error) { + uri := "/accounts/" + accountID + "/access/organizations" + + res, err := api.makeRequest("POST", uri, accessOrganization) + if err != nil { + return AccessOrganization{}, errors.Wrap(err, errMakeRequestError) + } + + var accessOrganizationDetailResponse AccessOrganizationDetailResponse + err = json.Unmarshal(res, &accessOrganizationDetailResponse) + if err != nil { + return AccessOrganization{}, errors.Wrap(err, errUnmarshalError) + } + + return accessOrganizationDetailResponse.Result, nil +} + +// UpdateAccessOrganization creates the Access organisation details. +// +// API reference: https://api.cloudflare.com/#access-organizations-update-access-organization +func (api *API) UpdateAccessOrganization(accountID string, accessOrganization AccessOrganization) (AccessOrganization, error) { + uri := "/accounts/" + accountID + "/access/organizations" + + res, err := api.makeRequest("PUT", uri, accessOrganization) + if err != nil { + return AccessOrganization{}, errors.Wrap(err, errMakeRequestError) + } + + var accessOrganizationDetailResponse AccessOrganizationDetailResponse + err = json.Unmarshal(res, &accessOrganizationDetailResponse) + if err != nil { + return AccessOrganization{}, errors.Wrap(err, errUnmarshalError) + } + + return accessOrganizationDetailResponse.Result, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/access_policy.go b/vendor/github.com/cloudflare/cloudflare-go/access_policy.go new file mode 100644 index 000000000000..dbf63e49fa2a --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/access_policy.go @@ -0,0 +1,221 @@ +package cloudflare + +import ( + "encoding/json" + "fmt" + "net/url" + "strconv" + "time" + + "github.com/pkg/errors" +) + +// AccessPolicy defines a policy for allowing or disallowing access to +// one or more Access applications. +type AccessPolicy struct { + ID string `json:"id,omitempty"` + Precedence int `json:"precedence"` + Decision string `json:"decision"` + CreatedAt *time.Time `json:"created_at"` + UpdatedAt *time.Time `json:"updated_at"` + Name string `json:"name"` + + // The include policy works like an OR logical operator. The user must + // satisfy one of the rules. + Include []interface{} `json:"include"` + + // The exclude policy works like a NOT logical operator. The user must + // not satisfy all of the rules in exclude. + Exclude []interface{} `json:"exclude"` + + // The require policy works like a AND logical operator. The user must + // satisfy all of the rules in require. + Require []interface{} `json:"require"` +} + +// AccessPolicyEmail is used for managing access based on the email. +// For example, restrict access to users with the email addresses +// `test@example.com` or `someone@example.com`. +type AccessPolicyEmail struct { + Email struct { + Email string `json:"email"` + } `json:"email"` +} + +// AccessPolicyEmailDomain is used for managing access based on an email +// domain domain such as `example.com` instead of individual addresses. +type AccessPolicyEmailDomain struct { + EmailDomain struct { + Domain string `json:"domain"` + } `json:"email_domain"` +} + +// AccessPolicyIP is used for managing access based in the IP. It +// accepts individual IPs or CIDRs. +type AccessPolicyIP struct { + IP struct { + IP string `json:"ip"` + } `json:"ip"` +} + +// AccessPolicyEveryone is used for managing access to everyone. +type AccessPolicyEveryone struct { + Everyone struct{} `json:"everyone"` +} + +// AccessPolicyAccessGroup is used for managing access based on an +// access group. +type AccessPolicyAccessGroup struct { + Group struct { + ID string `json:"id"` + } `json:"group"` +} + +// AccessPolicyListResponse represents the response from the list +// access polciies endpoint. +type AccessPolicyListResponse struct { + Result []AccessPolicy `json:"result"` + Response + ResultInfo `json:"result_info"` +} + +// AccessPolicyDetailResponse is the API response, containing a single +// access policy. +type AccessPolicyDetailResponse struct { + Success bool `json:"success"` + Errors []string `json:"errors"` + Messages []string `json:"messages"` + Result AccessPolicy `json:"result"` +} + +// AccessPolicies returns all access policies for an access application. +// +// API reference: https://api.cloudflare.com/#access-policy-list-access-policies +func (api *API) AccessPolicies(zoneID, applicationID string, pageOpts PaginationOptions) ([]AccessPolicy, ResultInfo, error) { + v := url.Values{} + if pageOpts.PerPage > 0 { + v.Set("per_page", strconv.Itoa(pageOpts.PerPage)) + } + if pageOpts.Page > 0 { + v.Set("page", strconv.Itoa(pageOpts.Page)) + } + + uri := fmt.Sprintf( + "/zones/%s/access/apps/%s/policies", + zoneID, + applicationID, + ) + + if len(v) > 0 { + uri = uri + "?" + v.Encode() + } + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []AccessPolicy{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError) + } + + var accessPolicyListResponse AccessPolicyListResponse + err = json.Unmarshal(res, &accessPolicyListResponse) + if err != nil { + return []AccessPolicy{}, ResultInfo{}, errors.Wrap(err, errUnmarshalError) + } + + return accessPolicyListResponse.Result, accessPolicyListResponse.ResultInfo, nil +} + +// AccessPolicy returns a single policy based on the policy ID. +// +// API reference: https://api.cloudflare.com/#access-policy-access-policy-details +func (api *API) AccessPolicy(zoneID, applicationID, policyID string) (AccessPolicy, error) { + uri := fmt.Sprintf( + "/zones/%s/access/apps/%s/policies/%s", + zoneID, + applicationID, + policyID, + ) + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return AccessPolicy{}, errors.Wrap(err, errMakeRequestError) + } + + var accessPolicyDetailResponse AccessPolicyDetailResponse + err = json.Unmarshal(res, &accessPolicyDetailResponse) + if err != nil { + return AccessPolicy{}, errors.Wrap(err, errUnmarshalError) + } + + return accessPolicyDetailResponse.Result, nil +} + +// CreateAccessPolicy creates a new access policy. +// +// API reference: https://api.cloudflare.com/#access-policy-create-access-policy +func (api *API) CreateAccessPolicy(zoneID, applicationID string, accessPolicy AccessPolicy) (AccessPolicy, error) { + uri := fmt.Sprintf( + "/zones/%s/access/apps/%s/policies", + zoneID, + applicationID, + ) + + res, err := api.makeRequest("POST", uri, accessPolicy) + if err != nil { + return AccessPolicy{}, errors.Wrap(err, errMakeRequestError) + } + + var accessPolicyDetailResponse AccessPolicyDetailResponse + err = json.Unmarshal(res, &accessPolicyDetailResponse) + if err != nil { + return AccessPolicy{}, errors.Wrap(err, errUnmarshalError) + } + + return accessPolicyDetailResponse.Result, nil +} + +// UpdateAccessPolicy updates an existing access policy. +// +// API reference: https://api.cloudflare.com/#access-policy-update-access-policy +func (api *API) UpdateAccessPolicy(zoneID, applicationID string, accessPolicy AccessPolicy) (AccessPolicy, error) { + if accessPolicy.ID == "" { + return AccessPolicy{}, errors.Errorf("access policy ID cannot be empty") + } + uri := fmt.Sprintf( + "/zones/%s/access/apps/%s/policies/%s", + zoneID, + applicationID, + accessPolicy.ID, + ) + + res, err := api.makeRequest("PUT", uri, accessPolicy) + if err != nil { + return AccessPolicy{}, errors.Wrap(err, errMakeRequestError) + } + + var accessPolicyDetailResponse AccessPolicyDetailResponse + err = json.Unmarshal(res, &accessPolicyDetailResponse) + if err != nil { + return AccessPolicy{}, errors.Wrap(err, errUnmarshalError) + } + + return accessPolicyDetailResponse.Result, nil +} + +// DeleteAccessPolicy deletes an access policy. +// +// API reference: https://api.cloudflare.com/#access-policy-update-access-policy +func (api *API) DeleteAccessPolicy(zoneID, applicationID, accessPolicyID string) error { + uri := fmt.Sprintf( + "/zones/%s/access/apps/%s/policies/%s", + zoneID, + applicationID, + accessPolicyID, + ) + + _, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + + return nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/access_service_tokens.go b/vendor/github.com/cloudflare/cloudflare-go/access_service_tokens.go new file mode 100644 index 000000000000..66a2bb794695 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/access_service_tokens.go @@ -0,0 +1,167 @@ +package cloudflare + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/pkg/errors" +) + +// AccessServiceToken represents an Access Service Token. +type AccessServiceToken struct { + ClientID string `json:"client_id"` + CreatedAt *time.Time `json:"created_at"` + ExpiresAt *time.Time `json:"expires_at"` + ID string `json:"id"` + Name string `json:"name"` + UpdatedAt *time.Time `json:"updated_at"` +} + +// AccessServiceTokenUpdateResponse represents the response from the API +// when a new Service Token is updated. This base struct is also used in the +// Create as they are very similar responses. +type AccessServiceTokenUpdateResponse struct { + CreatedAt *time.Time `json:"created_at"` + UpdatedAt *time.Time `json:"updated_at"` + ID string `json:"id"` + Name string `json:"name"` + ClientID string `json:"client_id"` +} + +// AccessServiceTokenCreateResponse is the same API response as the Update +// operation with the exception that the `ClientSecret` is present in a +// Create operation. +type AccessServiceTokenCreateResponse struct { + CreatedAt *time.Time `json:"created_at"` + UpdatedAt *time.Time `json:"updated_at"` + ID string `json:"id"` + Name string `json:"name"` + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` +} + +// AccessServiceTokensListResponse represents the response from the list +// Access Service Tokens endpoint. +type AccessServiceTokensListResponse struct { + Result []AccessServiceToken `json:"result"` + Response + ResultInfo `json:"result_info"` +} + +// AccessServiceTokensDetailResponse is the API response, containing a single +// Access Service Token. +type AccessServiceTokensDetailResponse struct { + Success bool `json:"success"` + Errors []string `json:"errors"` + Messages []string `json:"messages"` + Result AccessServiceToken `json:"result"` +} + +// AccessServiceTokensCreationDetailResponse is the API response, containing a +// single Access Service Token. +type AccessServiceTokensCreationDetailResponse struct { + Success bool `json:"success"` + Errors []string `json:"errors"` + Messages []string `json:"messages"` + Result AccessServiceTokenCreateResponse `json:"result"` +} + +// AccessServiceTokensUpdateDetailResponse is the API response, containing a +// single Access Service Token. +type AccessServiceTokensUpdateDetailResponse struct { + Success bool `json:"success"` + Errors []string `json:"errors"` + Messages []string `json:"messages"` + Result AccessServiceTokenUpdateResponse `json:"result"` +} + +// AccessServiceTokens returns all Access Service Tokens for an account. +// +// API reference: https://api.cloudflare.com/#access-service-tokens-list-access-service-tokens +func (api *API) AccessServiceTokens(accountID string) ([]AccessServiceToken, ResultInfo, error) { + uri := "/accounts/" + accountID + "/access/service_tokens" + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []AccessServiceToken{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError) + } + + var accessServiceTokensListResponse AccessServiceTokensListResponse + err = json.Unmarshal(res, &accessServiceTokensListResponse) + if err != nil { + return []AccessServiceToken{}, ResultInfo{}, errors.Wrap(err, errUnmarshalError) + } + + return accessServiceTokensListResponse.Result, accessServiceTokensListResponse.ResultInfo, nil +} + +// CreateAccessServiceToken creates a new Access Service Token for an account. +// +// API reference: https://api.cloudflare.com/#access-service-tokens-create-access-service-token +func (api *API) CreateAccessServiceToken(accountID, name string) (AccessServiceTokenCreateResponse, error) { + uri := "/accounts/" + accountID + "/access/service_tokens" + marshalledName, _ := json.Marshal(struct { + Name string `json:"name"` + }{name}) + + res, err := api.makeRequest("POST", uri, marshalledName) + + if err != nil { + return AccessServiceTokenCreateResponse{}, errors.Wrap(err, errMakeRequestError) + } + + var accessServiceTokenCreation AccessServiceTokensCreationDetailResponse + err = json.Unmarshal(res, &accessServiceTokenCreation) + if err != nil { + return AccessServiceTokenCreateResponse{}, errors.Wrap(err, errUnmarshalError) + } + + return accessServiceTokenCreation.Result, nil +} + +// UpdateAccessServiceToken updates an existing Access Service Token for an +// account. +// +// API reference: https://api.cloudflare.com/#access-service-tokens-update-access-service-token +func (api *API) UpdateAccessServiceToken(accountID, uuid, name string) (AccessServiceTokenUpdateResponse, error) { + uri := fmt.Sprintf("/accounts/%s/access/service_tokens/%s", accountID, uuid) + + marshalledName, _ := json.Marshal(struct { + Name string `json:"name"` + }{name}) + + res, err := api.makeRequest("PUT", uri, marshalledName) + if err != nil { + return AccessServiceTokenUpdateResponse{}, errors.Wrap(err, errMakeRequestError) + } + + var accessServiceTokenUpdate AccessServiceTokensUpdateDetailResponse + err = json.Unmarshal(res, &accessServiceTokenUpdate) + if err != nil { + return AccessServiceTokenUpdateResponse{}, errors.Wrap(err, errUnmarshalError) + } + + return accessServiceTokenUpdate.Result, nil +} + +// DeleteAccessServiceToken removes an existing Access Service Token for an +// account. +// +// API reference: https://api.cloudflare.com/#access-service-tokens-delete-access-service-token +func (api *API) DeleteAccessServiceToken(accountID, uuid string) (AccessServiceTokenUpdateResponse, error) { + uri := fmt.Sprintf("/accounts/%s/access/service_tokens/%s", accountID, uuid) + + res, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return AccessServiceTokenUpdateResponse{}, errors.Wrap(err, errMakeRequestError) + } + + var accessServiceTokenUpdate AccessServiceTokensUpdateDetailResponse + err = json.Unmarshal(res, &accessServiceTokenUpdate) + if err != nil { + return AccessServiceTokenUpdateResponse{}, errors.Wrap(err, errUnmarshalError) + } + + return accessServiceTokenUpdate.Result, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/account_members.go b/vendor/github.com/cloudflare/cloudflare-go/account_members.go new file mode 100644 index 000000000000..42166e922f62 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/account_members.go @@ -0,0 +1,186 @@ +package cloudflare + +import ( + "encoding/json" + "fmt" + "net/url" + "strconv" + + "github.com/pkg/errors" +) + +// AccountMember is the definition of a member of an account. +type AccountMember struct { + ID string `json:"id"` + Code string `json:"code"` + User AccountMemberUserDetails `json:"user"` + Status string `json:"status"` + Roles []AccountRole `json:"roles"` +} + +// AccountMemberUserDetails outlines all the personal information about +// a member. +type AccountMemberUserDetails struct { + ID string `json:"id"` + FirstName string `json:"first_name"` + LastName string `json:"last_name"` + Email string `json:"email"` + TwoFactorAuthenticationEnabled bool +} + +// AccountMembersListResponse represents the response from the list +// account members endpoint. +type AccountMembersListResponse struct { + Result []AccountMember `json:"result"` + Response + ResultInfo `json:"result_info"` +} + +// AccountMemberDetailResponse is the API response, containing a single +// account member. +type AccountMemberDetailResponse struct { + Success bool `json:"success"` + Errors []string `json:"errors"` + Messages []string `json:"messages"` + Result AccountMember `json:"result"` +} + +// AccountMemberInvitation represents the invitation for a new member to +// the account. +type AccountMemberInvitation struct { + Email string `json:"email"` + Roles []string `json:"roles"` +} + +// AccountMembers returns all members of an account. +// +// API reference: https://api.cloudflare.com/#accounts-list-accounts +func (api *API) AccountMembers(accountID string, pageOpts PaginationOptions) ([]AccountMember, ResultInfo, error) { + if accountID == "" { + return []AccountMember{}, ResultInfo{}, errors.New(errMissingAccountID) + } + + v := url.Values{} + if pageOpts.PerPage > 0 { + v.Set("per_page", strconv.Itoa(pageOpts.PerPage)) + } + if pageOpts.Page > 0 { + v.Set("page", strconv.Itoa(pageOpts.Page)) + } + + uri := "/accounts/" + accountID + "/members" + if len(v) > 0 { + uri = uri + "?" + v.Encode() + } + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []AccountMember{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError) + } + + var accountMemberListresponse AccountMembersListResponse + err = json.Unmarshal(res, &accountMemberListresponse) + if err != nil { + return []AccountMember{}, ResultInfo{}, errors.Wrap(err, errUnmarshalError) + } + + return accountMemberListresponse.Result, accountMemberListresponse.ResultInfo, nil +} + +// CreateAccountMember invites a new member to join an account. +// +// API reference: https://api.cloudflare.com/#account-members-add-member +func (api *API) CreateAccountMember(accountID string, emailAddress string, roles []string) (AccountMember, error) { + if accountID == "" { + return AccountMember{}, errors.New(errMissingAccountID) + } + + uri := "/accounts/" + accountID + "/members" + + var newMember = AccountMemberInvitation{ + Email: emailAddress, + Roles: roles, + } + res, err := api.makeRequest("POST", uri, newMember) + if err != nil { + return AccountMember{}, errors.Wrap(err, errMakeRequestError) + } + + var accountMemberListResponse AccountMemberDetailResponse + err = json.Unmarshal(res, &accountMemberListResponse) + if err != nil { + return AccountMember{}, errors.Wrap(err, errUnmarshalError) + } + + return accountMemberListResponse.Result, nil +} + +// DeleteAccountMember removes a member from an account. +// +// API reference: https://api.cloudflare.com/#account-members-remove-member +func (api *API) DeleteAccountMember(accountID string, userID string) error { + if accountID == "" { + return errors.New(errMissingAccountID) + } + + uri := fmt.Sprintf("/accounts/%s/members/%s", accountID, userID) + + _, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + + return nil +} + +// UpdateAccountMember modifies an existing account member. +// +// API reference: https://api.cloudflare.com/#account-members-update-member +func (api *API) UpdateAccountMember(accountID string, userID string, member AccountMember) (AccountMember, error) { + if accountID == "" { + return AccountMember{}, errors.New(errMissingAccountID) + } + + uri := fmt.Sprintf("/accounts/%s/members/%s", accountID, userID) + + res, err := api.makeRequest("PUT", uri, member) + if err != nil { + return AccountMember{}, errors.Wrap(err, errMakeRequestError) + } + + var accountMemberListResponse AccountMemberDetailResponse + err = json.Unmarshal(res, &accountMemberListResponse) + if err != nil { + return AccountMember{}, errors.Wrap(err, errUnmarshalError) + } + + return accountMemberListResponse.Result, nil +} + +// AccountMember returns details of a single account member. +// +// API reference: https://api.cloudflare.com/#account-members-member-details +func (api *API) AccountMember(accountID string, memberID string) (AccountMember, error) { + if accountID == "" { + return AccountMember{}, errors.New(errMissingAccountID) + } + + uri := fmt.Sprintf( + "/accounts/%s/members/%s", + accountID, + memberID, + ) + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return AccountMember{}, errors.Wrap(err, errMakeRequestError) + } + + var accountMemberResponse AccountMemberDetailResponse + err = json.Unmarshal(res, &accountMemberResponse) + if err != nil { + return AccountMember{}, errors.Wrap(err, errUnmarshalError) + } + + return accountMemberResponse.Result, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/account_roles.go b/vendor/github.com/cloudflare/cloudflare-go/account_roles.go new file mode 100644 index 000000000000..3704313b5ee9 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/account_roles.go @@ -0,0 +1,80 @@ +package cloudflare + +import ( + "encoding/json" + "fmt" + + "github.com/pkg/errors" +) + +// AccountRole defines the roles that a member can have attached. +type AccountRole struct { + ID string `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + Permissions map[string]AccountRolePermission `json:"permissions"` +} + +// AccountRolePermission is the shared structure for all permissions +// that can be assigned to a member. +type AccountRolePermission struct { + Read bool `json:"read"` + Edit bool `json:"edit"` +} + +// AccountRolesListResponse represents the list response from the +// account roles. +type AccountRolesListResponse struct { + Result []AccountRole `json:"result"` + Response + ResultInfo `json:"result_info"` +} + +// AccountRoleDetailResponse is the API response, containing a single +// account role. +type AccountRoleDetailResponse struct { + Success bool `json:"success"` + Errors []string `json:"errors"` + Messages []string `json:"messages"` + Result AccountRole `json:"result"` +} + +// AccountRoles returns all roles of an account. +// +// API reference: https://api.cloudflare.com/#account-roles-list-roles +func (api *API) AccountRoles(accountID string) ([]AccountRole, error) { + uri := "/accounts/" + accountID + "/roles" + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []AccountRole{}, errors.Wrap(err, errMakeRequestError) + } + + var accountRolesListResponse AccountRolesListResponse + err = json.Unmarshal(res, &accountRolesListResponse) + if err != nil { + return []AccountRole{}, errors.Wrap(err, errUnmarshalError) + } + + return accountRolesListResponse.Result, nil +} + +// AccountRole returns the details of a single account role. +// +// API reference: https://api.cloudflare.com/#account-roles-role-details +func (api *API) AccountRole(accountID string, roleID string) (AccountRole, error) { + uri := fmt.Sprintf("/accounts/%s/roles/%s", accountID, roleID) + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return AccountRole{}, errors.Wrap(err, errMakeRequestError) + } + + var accountRole AccountRoleDetailResponse + err = json.Unmarshal(res, &accountRole) + if err != nil { + return AccountRole{}, errors.Wrap(err, errUnmarshalError) + } + + return accountRole.Result, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/accounts.go b/vendor/github.com/cloudflare/cloudflare-go/accounts.go new file mode 100644 index 000000000000..7d34b7b8fcea --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/accounts.go @@ -0,0 +1,114 @@ +package cloudflare + +import ( + "encoding/json" + "net/url" + "strconv" + + "github.com/pkg/errors" +) + +// AccountSettings outlines the available options for an account. +type AccountSettings struct { + EnforceTwoFactor bool `json:"enforce_twofactor"` +} + +// Account represents the root object that owns resources. +type Account struct { + ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Settings *AccountSettings `json:"settings"` +} + +// AccountResponse represents the response from the accounts endpoint for a +// single account ID. +type AccountResponse struct { + Result Account `json:"result"` + Response + ResultInfo `json:"result_info"` +} + +// AccountListResponse represents the response from the list accounts endpoint. +type AccountListResponse struct { + Result []Account `json:"result"` + Response + ResultInfo `json:"result_info"` +} + +// AccountDetailResponse is the API response, containing a single Account. +type AccountDetailResponse struct { + Success bool `json:"success"` + Errors []string `json:"errors"` + Messages []string `json:"messages"` + Result Account `json:"result"` +} + +// Accounts returns all accounts the logged in user has access to. +// +// API reference: https://api.cloudflare.com/#accounts-list-accounts +func (api *API) Accounts(pageOpts PaginationOptions) ([]Account, ResultInfo, error) { + v := url.Values{} + if pageOpts.PerPage > 0 { + v.Set("per_page", strconv.Itoa(pageOpts.PerPage)) + } + if pageOpts.Page > 0 { + v.Set("page", strconv.Itoa(pageOpts.Page)) + } + + uri := "/accounts" + if len(v) > 0 { + uri = uri + "?" + v.Encode() + } + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []Account{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError) + } + + var accListResponse AccountListResponse + err = json.Unmarshal(res, &accListResponse) + if err != nil { + return []Account{}, ResultInfo{}, errors.Wrap(err, errUnmarshalError) + } + return accListResponse.Result, accListResponse.ResultInfo, nil +} + +// Account returns a single account based on the ID. +// +// API reference: https://api.cloudflare.com/#accounts-account-details +func (api *API) Account(accountID string) (Account, ResultInfo, error) { + uri := "/accounts/" + accountID + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return Account{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError) + } + + var accResponse AccountResponse + err = json.Unmarshal(res, &accResponse) + if err != nil { + return Account{}, ResultInfo{}, errors.Wrap(err, errUnmarshalError) + } + + return accResponse.Result, accResponse.ResultInfo, nil +} + +// UpdateAccount allows management of an account using the account ID. +// +// API reference: https://api.cloudflare.com/#accounts-update-account +func (api *API) UpdateAccount(accountID string, account Account) (Account, error) { + uri := "/accounts/" + accountID + + res, err := api.makeRequest("PUT", uri, account) + if err != nil { + return Account{}, errors.Wrap(err, errMakeRequestError) + } + + var a AccountDetailResponse + err = json.Unmarshal(res, &a) + if err != nil { + return Account{}, errors.Wrap(err, errUnmarshalError) + } + + return a.Result, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/argo.go b/vendor/github.com/cloudflare/cloudflare-go/argo.go new file mode 100644 index 000000000000..320c7fc25c0e --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/argo.go @@ -0,0 +1,120 @@ +package cloudflare + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/pkg/errors" +) + +var validSettingValues = []string{"on", "off"} + +// ArgoFeatureSetting is the structure of the API object for the +// argo smart routing and tiered caching settings. +type ArgoFeatureSetting struct { + Editable bool `json:"editable,omitempty"` + ID string `json:"id,omitempty"` + ModifiedOn time.Time `json:"modified_on,omitempty"` + Value string `json:"value"` +} + +// ArgoDetailsResponse is the API response for the argo smart routing +// and tiered caching response. +type ArgoDetailsResponse struct { + Result ArgoFeatureSetting `json:"result"` + Response +} + +// ArgoSmartRouting returns the current settings for smart routing. +// +// API reference: https://api.cloudflare.com/#argo-smart-routing-get-argo-smart-routing-setting +func (api *API) ArgoSmartRouting(zoneID string) (ArgoFeatureSetting, error) { + uri := "/zones/" + zoneID + "/argo/smart_routing" + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return ArgoFeatureSetting{}, errors.Wrap(err, errMakeRequestError) + } + + var argoDetailsResponse ArgoDetailsResponse + err = json.Unmarshal(res, &argoDetailsResponse) + if err != nil { + return ArgoFeatureSetting{}, errors.Wrap(err, errUnmarshalError) + } + return argoDetailsResponse.Result, nil +} + +// UpdateArgoSmartRouting updates the setting for smart routing. +// +// API reference: https://api.cloudflare.com/#argo-smart-routing-patch-argo-smart-routing-setting +func (api *API) UpdateArgoSmartRouting(zoneID, settingValue string) (ArgoFeatureSetting, error) { + if !contains(validSettingValues, settingValue) { + return ArgoFeatureSetting{}, errors.New(fmt.Sprintf("invalid setting value '%s'. must be 'on' or 'off'", settingValue)) + } + + uri := "/zones/" + zoneID + "/argo/smart_routing" + + res, err := api.makeRequest("PATCH", uri, ArgoFeatureSetting{Value: settingValue}) + if err != nil { + return ArgoFeatureSetting{}, errors.Wrap(err, errMakeRequestError) + } + + var argoDetailsResponse ArgoDetailsResponse + err = json.Unmarshal(res, &argoDetailsResponse) + if err != nil { + return ArgoFeatureSetting{}, errors.Wrap(err, errUnmarshalError) + } + return argoDetailsResponse.Result, nil +} + +// ArgoTieredCaching returns the current settings for tiered caching. +// +// API reference: TBA +func (api *API) ArgoTieredCaching(zoneID string) (ArgoFeatureSetting, error) { + uri := "/zones/" + zoneID + "/argo/tiered_caching" + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return ArgoFeatureSetting{}, errors.Wrap(err, errMakeRequestError) + } + + var argoDetailsResponse ArgoDetailsResponse + err = json.Unmarshal(res, &argoDetailsResponse) + if err != nil { + return ArgoFeatureSetting{}, errors.Wrap(err, errUnmarshalError) + } + return argoDetailsResponse.Result, nil +} + +// UpdateArgoTieredCaching updates the setting for tiered caching. +// +// API reference: TBA +func (api *API) UpdateArgoTieredCaching(zoneID, settingValue string) (ArgoFeatureSetting, error) { + if !contains(validSettingValues, settingValue) { + return ArgoFeatureSetting{}, errors.New(fmt.Sprintf("invalid setting value '%s'. must be 'on' or 'off'", settingValue)) + } + + uri := "/zones/" + zoneID + "/argo/tiered_caching" + + res, err := api.makeRequest("PATCH", uri, ArgoFeatureSetting{Value: settingValue}) + if err != nil { + return ArgoFeatureSetting{}, errors.Wrap(err, errMakeRequestError) + } + + var argoDetailsResponse ArgoDetailsResponse + err = json.Unmarshal(res, &argoDetailsResponse) + if err != nil { + return ArgoFeatureSetting{}, errors.Wrap(err, errUnmarshalError) + } + return argoDetailsResponse.Result, nil +} + +func contains(s []string, e string) bool { + for _, a := range s { + if a == e { + return true + } + } + return false +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/auditlogs.go b/vendor/github.com/cloudflare/cloudflare-go/auditlogs.go new file mode 100644 index 000000000000..8cb8eab69101 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/auditlogs.go @@ -0,0 +1,143 @@ +package cloudflare + +import ( + "encoding/base64" + "encoding/json" + "fmt" + "time" +) + +// AuditLogAction is a member of AuditLog, the action that was taken. +type AuditLogAction struct { + Result bool `json:"result"` + Type string `json:"type"` +} + +// AuditLogActor is a member of AuditLog, who performed the action. +type AuditLogActor struct { + Email string `json:"email"` + ID string `json:"id"` + IP string `json:"ip"` + Type string `json:"type"` +} + +// AuditLogOwner is a member of AuditLog, who owns this audit log. +type AuditLogOwner struct { + ID string `json:"id"` +} + +// AuditLogResource is a member of AuditLog, what was the action performed on. +type AuditLogResource struct { + ID string `json:"id"` + Type string `json:"type"` +} + +// AuditLog is an resource that represents an update in the cloudflare dash +type AuditLog struct { + Action AuditLogAction `json:"action"` + Actor AuditLogActor `json:"actor"` + ID string `json:"id"` + Metadata map[string]interface{} `json:"metadata"` + NewValue string `json:"newValue"` + OldValue string `json:"oldValue"` + Owner AuditLogOwner `json:"owner"` + Resource AuditLogResource `json:"resource"` + When time.Time `json:"when"` +} + +// AuditLogResponse is the response returned from the cloudflare v4 api +type AuditLogResponse struct { + Response Response + Result []AuditLog `json:"result"` + ResultInfo `json:"result_info"` +} + +// AuditLogFilter is an object for filtering the audit log response from the api. +type AuditLogFilter struct { + ID string + ActorIP string + ActorEmail string + Direction string + ZoneName string + Since string + Before string + PerPage int + Page int +} + +// String turns an audit log filter in to an HTTP Query Param +// list. It will not inclue empty members of the struct in the +// query parameters. +func (a AuditLogFilter) String() string { + params := "?" + if a.ID != "" { + params += "&id=" + a.ID + } + if a.ActorIP != "" { + params += "&actor.ip=" + a.ActorIP + } + if a.ActorEmail != "" { + params += "&actor.email=" + a.ActorEmail + } + if a.ZoneName != "" { + params += "&zone.name=" + a.ZoneName + } + if a.Direction != "" { + params += "&direction=" + a.Direction + } + if a.Since != "" { + params += "&since=" + a.Since + } + if a.Before != "" { + params += "&before=" + a.Before + } + if a.PerPage > 0 { + params += "&per_page=" + fmt.Sprintf("%d", a.PerPage) + } + if a.Page > 0 { + params += "&page=" + fmt.Sprintf("%d", a.Page) + } + return params +} + +// GetOrganizationAuditLogs will return the audit logs of a specific +// organization, based on the ID passed in. The audit logs can be +// filtered based on any argument in the AuditLogFilter +// +// API Reference: https://api.cloudflare.com/#audit-logs-list-organization-audit-logs +func (api *API) GetOrganizationAuditLogs(organizationID string, a AuditLogFilter) (AuditLogResponse, error) { + uri := "/organizations/" + organizationID + "/audit_logs" + fmt.Sprintf("%s", a) + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return AuditLogResponse{}, err + } + buf, err := base64.RawStdEncoding.DecodeString(string(res)) + if err != nil { + return AuditLogResponse{}, err + } + return unmarshalReturn(buf) +} + +// unmarshalReturn will unmarshal bytes and return an auditlogresponse +func unmarshalReturn(res []byte) (AuditLogResponse, error) { + var auditResponse AuditLogResponse + err := json.Unmarshal(res, &auditResponse) + if err != nil { + return auditResponse, err + } + return auditResponse, nil +} + +// GetUserAuditLogs will return your user's audit logs. The audit logs can be +// filtered based on any argument in the AuditLogFilter +// +// API Reference: https://api.cloudflare.com/#audit-logs-list-user-audit-logs +func (api *API) GetUserAuditLogs(a AuditLogFilter) (AuditLogResponse, error) { + uri := "/user/audit_logs" + fmt.Sprintf("%s", a) + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return AuditLogResponse{}, err + } + return unmarshalReturn(res) +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/cloudflare.go b/vendor/github.com/cloudflare/cloudflare-go/cloudflare.go new file mode 100644 index 000000000000..498b9f468ddd --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/cloudflare.go @@ -0,0 +1,435 @@ +// Package cloudflare implements the Cloudflare v4 API. +package cloudflare + +import ( + "bytes" + "context" + "encoding/json" + "io" + "io/ioutil" + "log" + "math" + "net/http" + "net/url" + "strconv" + "strings" + "time" + + "github.com/pkg/errors" + "golang.org/x/time/rate" +) + +const apiURL = "https://api.cloudflare.com/client/v4" + +const ( + // AuthKeyEmail specifies that we should authenticate with API key and email address + AuthKeyEmail = 1 << iota + // AuthUserService specifies that we should authenticate with a User-Service key + AuthUserService + // AuthToken specifies that we should authenticate with an API Token + AuthToken +) + +// API holds the configuration for the current API client. A client should not +// be modified concurrently. +type API struct { + APIKey string + APIEmail string + APIUserServiceKey string + APIToken string + BaseURL string + AccountID string + UserAgent string + headers http.Header + httpClient *http.Client + authType int + rateLimiter *rate.Limiter + retryPolicy RetryPolicy + logger Logger +} + +// newClient provides shared logic for New and NewWithUserServiceKey +func newClient(opts ...Option) (*API, error) { + silentLogger := log.New(ioutil.Discard, "", log.LstdFlags) + + api := &API{ + BaseURL: apiURL, + headers: make(http.Header), + rateLimiter: rate.NewLimiter(rate.Limit(4), 1), // 4rps equates to default api limit (1200 req/5 min) + retryPolicy: RetryPolicy{ + MaxRetries: 3, + MinRetryDelay: time.Duration(1) * time.Second, + MaxRetryDelay: time.Duration(30) * time.Second, + }, + logger: silentLogger, + } + + err := api.parseOptions(opts...) + if err != nil { + return nil, errors.Wrap(err, "options parsing failed") + } + + // Fall back to http.DefaultClient if the package user does not provide + // their own. + if api.httpClient == nil { + api.httpClient = http.DefaultClient + } + + return api, nil +} + +// New creates a new Cloudflare v4 API client. +func New(key, email string, opts ...Option) (*API, error) { + if key == "" || email == "" { + return nil, errors.New(errEmptyCredentials) + } + + api, err := newClient(opts...) + if err != nil { + return nil, err + } + + api.APIKey = key + api.APIEmail = email + api.authType = AuthKeyEmail + + return api, nil +} + +// NewWithAPIToken creates a new Cloudflare v4 API client using API Tokens +func NewWithAPIToken(token string, opts ...Option) (*API, error) { + if token == "" { + return nil, errors.New(errEmptyAPIToken) + } + + api, err := newClient(opts...) + if err != nil { + return nil, err + } + + api.APIToken = token + api.authType = AuthToken + + return api, nil +} + +// NewWithUserServiceKey creates a new Cloudflare v4 API client using service key authentication. +func NewWithUserServiceKey(key string, opts ...Option) (*API, error) { + if key == "" { + return nil, errors.New(errEmptyCredentials) + } + + api, err := newClient(opts...) + if err != nil { + return nil, err + } + + api.APIUserServiceKey = key + api.authType = AuthUserService + + return api, nil +} + +// SetAuthType sets the authentication method (AuthKeyEmail, AuthToken, or AuthUserService). +func (api *API) SetAuthType(authType int) { + api.authType = authType +} + +// ZoneIDByName retrieves a zone's ID from the name. +func (api *API) ZoneIDByName(zoneName string) (string, error) { + res, err := api.ListZonesContext(context.TODO(), WithZoneFilter(zoneName)) + if err != nil { + return "", errors.Wrap(err, "ListZonesContext command failed") + } + + if len(res.Result) > 1 && api.AccountID == "" { + return "", errors.New("ambiguous zone name used without an account ID") + } + + for _, zone := range res.Result { + if api.AccountID != "" { + if zone.Name == zoneName && api.AccountID == zone.Account.ID { + return zone.ID, nil + } + } else { + if zone.Name == zoneName { + return zone.ID, nil + } + } + } + + return "", errors.New("Zone could not be found") +} + +// makeRequest makes a HTTP request and returns the body as a byte slice, +// closing it before returning. params will be serialized to JSON. +func (api *API) makeRequest(method, uri string, params interface{}) ([]byte, error) { + return api.makeRequestWithAuthType(context.TODO(), method, uri, params, api.authType) +} + +func (api *API) makeRequestContext(ctx context.Context, method, uri string, params interface{}) ([]byte, error) { + return api.makeRequestWithAuthType(ctx, method, uri, params, api.authType) +} + +func (api *API) makeRequestWithHeaders(method, uri string, params interface{}, headers http.Header) ([]byte, error) { + return api.makeRequestWithAuthTypeAndHeaders(context.TODO(), method, uri, params, api.authType, headers) +} + +func (api *API) makeRequestWithAuthType(ctx context.Context, method, uri string, params interface{}, authType int) ([]byte, error) { + return api.makeRequestWithAuthTypeAndHeaders(ctx, method, uri, params, authType, nil) +} + +func (api *API) makeRequestWithAuthTypeAndHeaders(ctx context.Context, method, uri string, params interface{}, authType int, headers http.Header) ([]byte, error) { + // Replace nil with a JSON object if needed + var jsonBody []byte + var err error + + if params != nil { + if paramBytes, ok := params.([]byte); ok { + jsonBody = paramBytes + } else { + jsonBody, err = json.Marshal(params) + if err != nil { + return nil, errors.Wrap(err, "error marshalling params to JSON") + } + } + } else { + jsonBody = nil + } + + var resp *http.Response + var respErr error + var reqBody io.Reader + var respBody []byte + for i := 0; i <= api.retryPolicy.MaxRetries; i++ { + if jsonBody != nil { + reqBody = bytes.NewReader(jsonBody) + } + if i > 0 { + // expect the backoff introduced here on errored requests to dominate the effect of rate limiting + // don't need a random component here as the rate limiter should do something similar + // nb time duration could truncate an arbitrary float. Since our inputs are all ints, we should be ok + sleepDuration := time.Duration(math.Pow(2, float64(i-1)) * float64(api.retryPolicy.MinRetryDelay)) + + if sleepDuration > api.retryPolicy.MaxRetryDelay { + sleepDuration = api.retryPolicy.MaxRetryDelay + } + // useful to do some simple logging here, maybe introduce levels later + api.logger.Printf("Sleeping %s before retry attempt number %d for request %s %s", sleepDuration.String(), i, method, uri) + time.Sleep(sleepDuration) + + } + err = api.rateLimiter.Wait(context.TODO()) + if err != nil { + return nil, errors.Wrap(err, "Error caused by request rate limiting") + } + resp, respErr = api.request(ctx, method, uri, reqBody, authType, headers) + + // retry if the server is rate limiting us or if it failed + // assumes server operations are rolled back on failure + if respErr != nil || resp.StatusCode == http.StatusTooManyRequests || resp.StatusCode >= 500 { + // if we got a valid http response, try to read body so we can reuse the connection + // see https://golang.org/pkg/net/http/#Client.Do + if respErr == nil { + respBody, err = ioutil.ReadAll(resp.Body) + resp.Body.Close() + + respErr = errors.Wrap(err, "could not read response body") + + api.logger.Printf("Request: %s %s got an error response %d: %s\n", method, uri, resp.StatusCode, + strings.Replace(strings.Replace(string(respBody), "\n", "", -1), "\t", "", -1)) + } else { + api.logger.Printf("Error performing request: %s %s : %s \n", method, uri, respErr.Error()) + } + continue + } else { + respBody, err = ioutil.ReadAll(resp.Body) + defer resp.Body.Close() + if err != nil { + return nil, errors.Wrap(err, "could not read response body") + } + break + } + } + if respErr != nil { + return nil, respErr + } + + switch { + case resp.StatusCode >= http.StatusOK && resp.StatusCode < http.StatusMultipleChoices: + case resp.StatusCode == http.StatusUnauthorized: + return nil, errors.Errorf("HTTP status %d: invalid credentials", resp.StatusCode) + case resp.StatusCode == http.StatusForbidden: + return nil, errors.Errorf("HTTP status %d: insufficient permissions", resp.StatusCode) + case resp.StatusCode == http.StatusServiceUnavailable, + resp.StatusCode == http.StatusBadGateway, + resp.StatusCode == http.StatusGatewayTimeout, + resp.StatusCode == 522, + resp.StatusCode == 523, + resp.StatusCode == 524: + return nil, errors.Errorf("HTTP status %d: service failure", resp.StatusCode) + // This isn't a great solution due to the way the `default` case is + // a catch all and that the `filters/validate-expr` returns a HTTP 400 + // yet the clients need to use the HTTP body as a JSON string. + case resp.StatusCode == 400 && strings.HasSuffix(resp.Request.URL.Path, "/filters/validate-expr"): + return nil, errors.Errorf("%s", respBody) + default: + var s string + if respBody != nil { + s = string(respBody) + } + return nil, errors.Errorf("HTTP status %d: content %q", resp.StatusCode, s) + } + + return respBody, nil +} + +// request makes a HTTP request to the given API endpoint, returning the raw +// *http.Response, or an error if one occurred. The caller is responsible for +// closing the response body. +func (api *API) request(ctx context.Context, method, uri string, reqBody io.Reader, authType int, headers http.Header) (*http.Response, error) { + req, err := http.NewRequest(method, api.BaseURL+uri, reqBody) + if err != nil { + return nil, errors.Wrap(err, "HTTP request creation failed") + } + req.WithContext(ctx) + + combinedHeaders := make(http.Header) + copyHeader(combinedHeaders, api.headers) + copyHeader(combinedHeaders, headers) + req.Header = combinedHeaders + + if authType&AuthKeyEmail != 0 { + req.Header.Set("X-Auth-Key", api.APIKey) + req.Header.Set("X-Auth-Email", api.APIEmail) + } + if authType&AuthUserService != 0 { + req.Header.Set("X-Auth-User-Service-Key", api.APIUserServiceKey) + } + if authType&AuthToken != 0 { + req.Header.Set("Authorization", "Bearer "+api.APIToken) + } + + if api.UserAgent != "" { + req.Header.Set("User-Agent", api.UserAgent) + } + + if req.Header.Get("Content-Type") == "" { + req.Header.Set("Content-Type", "application/json") + } + + resp, err := api.httpClient.Do(req) + if err != nil { + return nil, errors.Wrap(err, "HTTP request failed") + } + + return resp, nil +} + +// Returns the base URL to use for API endpoints that exist for accounts. +// If an account option was used when creating the API instance, returns +// the account URL. +// +// accountBase is the base URL for endpoints referring to the current user. +// It exists as a parameter because it is not consistent across APIs. +func (api *API) userBaseURL(accountBase string) string { + if api.AccountID != "" { + return "/accounts/" + api.AccountID + } + return accountBase +} + +// copyHeader copies all headers for `source` and sets them on `target`. +// based on https://godoc.org/github.com/golang/gddo/httputil/header#Copy +func copyHeader(target, source http.Header) { + for k, vs := range source { + target[k] = vs + } +} + +// ResponseInfo contains a code and message returned by the API as errors or +// informational messages inside the response. +type ResponseInfo struct { + Code int `json:"code"` + Message string `json:"message"` +} + +// Response is a template. There will also be a result struct. There will be a +// unique response type for each response, which will include this type. +type Response struct { + Success bool `json:"success"` + Errors []ResponseInfo `json:"errors"` + Messages []ResponseInfo `json:"messages"` +} + +// ResultInfo contains metadata about the Response. +type ResultInfo struct { + Page int `json:"page"` + PerPage int `json:"per_page"` + TotalPages int `json:"total_pages"` + Count int `json:"count"` + Total int `json:"total_count"` +} + +// RawResponse keeps the result as JSON form +type RawResponse struct { + Response + Result json.RawMessage `json:"result"` +} + +// Raw makes a HTTP request with user provided params and returns the +// result as untouched JSON. +func (api *API) Raw(method, endpoint string, data interface{}) (json.RawMessage, error) { + res, err := api.makeRequest(method, endpoint, data) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + var r RawResponse + if err := json.Unmarshal(res, &r); err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// PaginationOptions can be passed to a list request to configure paging +// These values will be defaulted if omitted, and PerPage has min/max limits set by resource +type PaginationOptions struct { + Page int `json:"page,omitempty"` + PerPage int `json:"per_page,omitempty"` +} + +// RetryPolicy specifies number of retries and min/max retry delays +// This config is used when the client exponentially backs off after errored requests +type RetryPolicy struct { + MaxRetries int + MinRetryDelay time.Duration + MaxRetryDelay time.Duration +} + +// Logger defines the interface this library needs to use logging +// This is a subset of the methods implemented in the log package +type Logger interface { + Printf(format string, v ...interface{}) +} + +// ReqOption is a functional option for configuring API requests +type ReqOption func(opt *reqOption) +type reqOption struct { + params url.Values +} + +// WithZoneFilter applies a filter based on zone name. +func WithZoneFilter(zone string) ReqOption { + return func(opt *reqOption) { + opt.params.Set("name", zone) + } +} + +// WithPagination configures the pagination for a response. +func WithPagination(opts PaginationOptions) ReqOption { + return func(opt *reqOption) { + opt.params.Set("page", strconv.Itoa(opts.Page)) + opt.params.Set("per_page", strconv.Itoa(opts.PerPage)) + } +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/custom_hostname.go b/vendor/github.com/cloudflare/cloudflare-go/custom_hostname.go new file mode 100644 index 000000000000..d982c5b507e2 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/custom_hostname.go @@ -0,0 +1,161 @@ +package cloudflare + +import ( + "encoding/json" + "net/url" + "strconv" + + "github.com/pkg/errors" +) + +// CustomHostnameSSLSettings represents the SSL settings for a custom hostname. +type CustomHostnameSSLSettings struct { + HTTP2 string `json:"http2,omitempty"` + TLS13 string `json:"tls_1_3,omitempty"` + MinTLSVersion string `json:"min_tls_version,omitempty"` + Ciphers []string `json:"ciphers,omitempty"` +} + +// CustomHostnameSSL represents the SSL section in a given custom hostname. +type CustomHostnameSSL struct { + Status string `json:"status,omitempty"` + Method string `json:"method,omitempty"` + Type string `json:"type,omitempty"` + CnameTarget string `json:"cname_target,omitempty"` + CnameName string `json:"cname,omitempty"` + Settings CustomHostnameSSLSettings `json:"settings,omitempty"` +} + +// CustomMetadata defines custom metadata for the hostname. This requires logic to be implemented by Cloudflare to act on the data provided. +type CustomMetadata map[string]interface{} + +// CustomHostname represents a custom hostname in a zone. +type CustomHostname struct { + ID string `json:"id,omitempty"` + Hostname string `json:"hostname,omitempty"` + CustomOriginServer string `json:"custom_origin_server,omitempty"` + SSL CustomHostnameSSL `json:"ssl,omitempty"` + CustomMetadata CustomMetadata `json:"custom_metadata,omitempty"` +} + +// CustomHostnameResponse represents a response from the Custom Hostnames endpoints. +type CustomHostnameResponse struct { + Result CustomHostname `json:"result"` + Response +} + +// CustomHostnameListResponse represents a response from the Custom Hostnames endpoints. +type CustomHostnameListResponse struct { + Result []CustomHostname `json:"result"` + Response + ResultInfo `json:"result_info"` +} + +// UpdateCustomHostnameSSL modifies SSL configuration for the given custom +// hostname in the given zone. +// +// API reference: https://api.cloudflare.com/#custom-hostname-for-a-zone-update-custom-hostname-configuration +func (api *API) UpdateCustomHostnameSSL(zoneID string, customHostnameID string, ssl CustomHostnameSSL) (CustomHostname, error) { + return CustomHostname{}, errors.New("Not implemented") +} + +// DeleteCustomHostname deletes a custom hostname (and any issued SSL +// certificates). +// +// API reference: https://api.cloudflare.com/#custom-hostname-for-a-zone-delete-a-custom-hostname-and-any-issued-ssl-certificates- +func (api *API) DeleteCustomHostname(zoneID string, customHostnameID string) error { + uri := "/zones/" + zoneID + "/custom_hostnames/" + customHostnameID + res, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + + var response *CustomHostnameResponse + err = json.Unmarshal(res, &response) + if err != nil { + return errors.Wrap(err, errUnmarshalError) + } + + return nil +} + +// CreateCustomHostname creates a new custom hostname and requests that an SSL certificate be issued for it. +// +// API reference: https://api.cloudflare.com/#custom-hostname-for-a-zone-create-custom-hostname +func (api *API) CreateCustomHostname(zoneID string, ch CustomHostname) (*CustomHostnameResponse, error) { + uri := "/zones/" + zoneID + "/custom_hostnames" + res, err := api.makeRequest("POST", uri, ch) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + var response *CustomHostnameResponse + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response, nil +} + +// CustomHostnames fetches custom hostnames for the given zone, +// by applying filter.Hostname if not empty and scoping the result to page'th 50 items. +// +// The returned ResultInfo can be used to implement pagination. +// +// API reference: https://api.cloudflare.com/#custom-hostname-for-a-zone-list-custom-hostnames +func (api *API) CustomHostnames(zoneID string, page int, filter CustomHostname) ([]CustomHostname, ResultInfo, error) { + v := url.Values{} + v.Set("per_page", "50") + v.Set("page", strconv.Itoa(page)) + if filter.Hostname != "" { + v.Set("hostname", filter.Hostname) + } + query := "?" + v.Encode() + + uri := "/zones/" + zoneID + "/custom_hostnames" + query + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []CustomHostname{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError) + } + var customHostnameListResponse CustomHostnameListResponse + err = json.Unmarshal(res, &customHostnameListResponse) + if err != nil { + return []CustomHostname{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError) + } + + return customHostnameListResponse.Result, customHostnameListResponse.ResultInfo, nil +} + +// CustomHostname inspects the given custom hostname in the given zone. +// +// API reference: https://api.cloudflare.com/#custom-hostname-for-a-zone-custom-hostname-configuration-details +func (api *API) CustomHostname(zoneID string, customHostnameID string) (CustomHostname, error) { + uri := "/zones/" + zoneID + "/custom_hostnames/" + customHostnameID + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return CustomHostname{}, errors.Wrap(err, errMakeRequestError) + } + + var response CustomHostnameResponse + err = json.Unmarshal(res, &response) + if err != nil { + return CustomHostname{}, errors.Wrap(err, errUnmarshalError) + } + + return response.Result, nil +} + +// CustomHostnameIDByName retrieves the ID for the given hostname in the given zone. +func (api *API) CustomHostnameIDByName(zoneID string, hostname string) (string, error) { + customHostnames, _, err := api.CustomHostnames(zoneID, 1, CustomHostname{Hostname: hostname}) + if err != nil { + return "", errors.Wrap(err, "CustomHostnames command failed") + } + for _, ch := range customHostnames { + if ch.Hostname == hostname { + return ch.ID, nil + } + } + return "", errors.New("CustomHostname could not be found") +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/custom_pages.go b/vendor/github.com/cloudflare/cloudflare-go/custom_pages.go new file mode 100644 index 000000000000..d96788fc8606 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/custom_pages.go @@ -0,0 +1,176 @@ +package cloudflare + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/pkg/errors" +) + +// CustomPage represents a custom page configuration. +type CustomPage struct { + CreatedOn time.Time `json:"created_on"` + ModifiedOn time.Time `json:"modified_on"` + URL interface{} `json:"url"` + State string `json:"state"` + RequiredTokens []string `json:"required_tokens"` + PreviewTarget string `json:"preview_target"` + Description string `json:"description"` + ID string `json:"id"` +} + +// CustomPageResponse represents the response from the custom pages endpoint. +type CustomPageResponse struct { + Response + Result []CustomPage `json:"result"` +} + +// CustomPageDetailResponse represents the response from the custom page endpoint. +type CustomPageDetailResponse struct { + Response + Result CustomPage `json:"result"` +} + +// CustomPageOptions is used to determine whether or not the operation +// should take place on an account or zone level based on which is +// provided to the function. +// +// A non-empty value denotes desired use. +type CustomPageOptions struct { + AccountID string + ZoneID string +} + +// CustomPageParameters is used to update a particular custom page with +// the values provided. +type CustomPageParameters struct { + URL interface{} `json:"url"` + State string `json:"state"` +} + +// CustomPages lists custom pages for a zone or account. +// +// Zone API reference: https://api.cloudflare.com/#custom-pages-for-a-zone-list-available-custom-pages +// Account API reference: https://api.cloudflare.com/#custom-pages-account--list-custom-pages +func (api *API) CustomPages(options *CustomPageOptions) ([]CustomPage, error) { + var ( + pageType, identifier string + ) + + if options.AccountID == "" && options.ZoneID == "" { + return nil, errors.New("either account ID or zone ID must be provided") + } + + if options.AccountID != "" && options.ZoneID != "" { + return nil, errors.New("account ID and zone ID are mutually exclusive") + } + + // Should the account ID be defined, treat this as an account level operation. + if options.AccountID != "" { + pageType = "accounts" + identifier = options.AccountID + } else { + pageType = "zones" + identifier = options.ZoneID + } + + uri := fmt.Sprintf("/%s/%s/custom_pages", pageType, identifier) + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + var customPageResponse CustomPageResponse + err = json.Unmarshal(res, &customPageResponse) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return customPageResponse.Result, nil +} + +// CustomPage lists a single custom page based on the ID. +// +// Zone API reference: https://api.cloudflare.com/#custom-pages-for-a-zone-custom-page-details +// Account API reference: https://api.cloudflare.com/#custom-pages-account--custom-page-details +func (api *API) CustomPage(options *CustomPageOptions, customPageID string) (CustomPage, error) { + var ( + pageType, identifier string + ) + + if options.AccountID == "" && options.ZoneID == "" { + return CustomPage{}, errors.New("either account ID or zone ID must be provided") + } + + if options.AccountID != "" && options.ZoneID != "" { + return CustomPage{}, errors.New("account ID and zone ID are mutually exclusive") + } + + // Should the account ID be defined, treat this as an account level operation. + if options.AccountID != "" { + pageType = "accounts" + identifier = options.AccountID + } else { + pageType = "zones" + identifier = options.ZoneID + } + + uri := fmt.Sprintf("/%s/%s/custom_pages/%s", pageType, identifier, customPageID) + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return CustomPage{}, errors.Wrap(err, errMakeRequestError) + } + + var customPageResponse CustomPageDetailResponse + err = json.Unmarshal(res, &customPageResponse) + if err != nil { + return CustomPage{}, errors.Wrap(err, errUnmarshalError) + } + + return customPageResponse.Result, nil +} + +// UpdateCustomPage updates a single custom page setting. +// +// Zone API reference: https://api.cloudflare.com/#custom-pages-for-a-zone-update-custom-page-url +// Account API reference: https://api.cloudflare.com/#custom-pages-account--update-custom-page +func (api *API) UpdateCustomPage(options *CustomPageOptions, customPageID string, pageParameters CustomPageParameters) (CustomPage, error) { + var ( + pageType, identifier string + ) + + if options.AccountID == "" && options.ZoneID == "" { + return CustomPage{}, errors.New("either account ID or zone ID must be provided") + } + + if options.AccountID != "" && options.ZoneID != "" { + return CustomPage{}, errors.New("account ID and zone ID are mutually exclusive") + } + + // Should the account ID be defined, treat this as an account level operation. + if options.AccountID != "" { + pageType = "accounts" + identifier = options.AccountID + } else { + pageType = "zones" + identifier = options.ZoneID + } + + uri := fmt.Sprintf("/%s/%s/custom_pages/%s", pageType, identifier, customPageID) + + res, err := api.makeRequest("PUT", uri, pageParameters) + if err != nil { + return CustomPage{}, errors.Wrap(err, errMakeRequestError) + } + + var customPageResponse CustomPageDetailResponse + err = json.Unmarshal(res, &customPageResponse) + if err != nil { + return CustomPage{}, errors.Wrap(err, errUnmarshalError) + } + + return customPageResponse.Result, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/dns.go b/vendor/github.com/cloudflare/cloudflare-go/dns.go new file mode 100644 index 000000000000..6bcac2480e92 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/dns.go @@ -0,0 +1,174 @@ +package cloudflare + +import ( + "encoding/json" + "net/url" + "strconv" + "time" + + "github.com/pkg/errors" +) + +// DNSRecord represents a DNS record in a zone. +type DNSRecord struct { + ID string `json:"id,omitempty"` + Type string `json:"type,omitempty"` + Name string `json:"name,omitempty"` + Content string `json:"content,omitempty"` + Proxiable bool `json:"proxiable,omitempty"` + Proxied bool `json:"proxied"` + TTL int `json:"ttl,omitempty"` + Locked bool `json:"locked,omitempty"` + ZoneID string `json:"zone_id,omitempty"` + ZoneName string `json:"zone_name,omitempty"` + CreatedOn time.Time `json:"created_on,omitempty"` + ModifiedOn time.Time `json:"modified_on,omitempty"` + Data interface{} `json:"data,omitempty"` // data returned by: SRV, LOC + Meta interface{} `json:"meta,omitempty"` + Priority int `json:"priority"` +} + +// DNSRecordResponse represents the response from the DNS endpoint. +type DNSRecordResponse struct { + Result DNSRecord `json:"result"` + Response + ResultInfo `json:"result_info"` +} + +// DNSListResponse represents the response from the list DNS records endpoint. +type DNSListResponse struct { + Result []DNSRecord `json:"result"` + Response + ResultInfo `json:"result_info"` +} + +// CreateDNSRecord creates a DNS record for the zone identifier. +// +// API reference: https://api.cloudflare.com/#dns-records-for-a-zone-create-dns-record +func (api *API) CreateDNSRecord(zoneID string, rr DNSRecord) (*DNSRecordResponse, error) { + uri := "/zones/" + zoneID + "/dns_records" + res, err := api.makeRequest("POST", uri, rr) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + var recordResp *DNSRecordResponse + err = json.Unmarshal(res, &recordResp) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return recordResp, nil +} + +// DNSRecords returns a slice of DNS records for the given zone identifier. +// +// This takes a DNSRecord to allow filtering of the results returned. +// +// API reference: https://api.cloudflare.com/#dns-records-for-a-zone-list-dns-records +func (api *API) DNSRecords(zoneID string, rr DNSRecord) ([]DNSRecord, error) { + // Construct a query string + v := url.Values{} + // Request as many records as possible per page - API max is 50 + v.Set("per_page", "50") + if rr.Name != "" { + v.Set("name", rr.Name) + } + if rr.Type != "" { + v.Set("type", rr.Type) + } + if rr.Content != "" { + v.Set("content", rr.Content) + } + + var query string + var records []DNSRecord + page := 1 + + // Loop over makeRequest until what we've fetched all records + for { + v.Set("page", strconv.Itoa(page)) + query = "?" + v.Encode() + uri := "/zones/" + zoneID + "/dns_records" + query + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []DNSRecord{}, errors.Wrap(err, errMakeRequestError) + } + var r DNSListResponse + err = json.Unmarshal(res, &r) + if err != nil { + return []DNSRecord{}, errors.Wrap(err, errUnmarshalError) + } + records = append(records, r.Result...) + if r.ResultInfo.Page >= r.ResultInfo.TotalPages { + break + } + // Loop around and fetch the next page + page++ + } + return records, nil +} + +// DNSRecord returns a single DNS record for the given zone & record +// identifiers. +// +// API reference: https://api.cloudflare.com/#dns-records-for-a-zone-dns-record-details +func (api *API) DNSRecord(zoneID, recordID string) (DNSRecord, error) { + uri := "/zones/" + zoneID + "/dns_records/" + recordID + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return DNSRecord{}, errors.Wrap(err, errMakeRequestError) + } + var r DNSRecordResponse + err = json.Unmarshal(res, &r) + if err != nil { + return DNSRecord{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// UpdateDNSRecord updates a single DNS record for the given zone & record +// identifiers. +// +// API reference: https://api.cloudflare.com/#dns-records-for-a-zone-update-dns-record +func (api *API) UpdateDNSRecord(zoneID, recordID string, rr DNSRecord) error { + rec, err := api.DNSRecord(zoneID, recordID) + if err != nil { + return err + } + // Populate the record name from the existing one if the update didn't + // specify it. + if rr.Name == "" { + rr.Name = rec.Name + } + rr.Type = rec.Type + uri := "/zones/" + zoneID + "/dns_records/" + recordID + res, err := api.makeRequest("PATCH", uri, rr) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + var r DNSRecordResponse + err = json.Unmarshal(res, &r) + if err != nil { + return errors.Wrap(err, errUnmarshalError) + } + return nil +} + +// DeleteDNSRecord deletes a single DNS record for the given zone & record +// identifiers. +// +// API reference: https://api.cloudflare.com/#dns-records-for-a-zone-delete-dns-record +func (api *API) DeleteDNSRecord(zoneID, recordID string) error { + uri := "/zones/" + zoneID + "/dns_records/" + recordID + res, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + var r DNSRecordResponse + err = json.Unmarshal(res, &r) + if err != nil { + return errors.Wrap(err, errUnmarshalError) + } + return nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/duration.go b/vendor/github.com/cloudflare/cloudflare-go/duration.go new file mode 100644 index 000000000000..ba2418acda61 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/duration.go @@ -0,0 +1,40 @@ +package cloudflare + +import ( + "encoding/json" + "time" +) + +// Duration implements json.Marshaler and json.Unmarshaler for time.Duration +// using the fmt.Stringer interface of time.Duration and time.ParseDuration. +type Duration struct { + time.Duration +} + +// MarshalJSON encodes a Duration as a JSON string formatted using String. +func (d Duration) MarshalJSON() ([]byte, error) { + return json.Marshal(d.Duration.String()) +} + +// UnmarshalJSON decodes a Duration from a JSON string parsed using time.ParseDuration. +func (d *Duration) UnmarshalJSON(buf []byte) error { + var str string + + err := json.Unmarshal(buf, &str) + if err != nil { + return err + } + + dur, err := time.ParseDuration(str) + if err != nil { + return err + } + + d.Duration = dur + return nil +} + +var ( + _ = json.Marshaler((*Duration)(nil)) + _ = json.Unmarshaler((*Duration)(nil)) +) diff --git a/vendor/github.com/cloudflare/cloudflare-go/errors.go b/vendor/github.com/cloudflare/cloudflare-go/errors.go new file mode 100644 index 000000000000..21c38b168011 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/errors.go @@ -0,0 +1,50 @@ +package cloudflare + +// Error messages +const ( + errEmptyCredentials = "invalid credentials: key & email must not be empty" + errEmptyAPIToken = "invalid credentials: API Token must not be empty" + errMakeRequestError = "error from makeRequest" + errUnmarshalError = "error unmarshalling the JSON response" + errRequestNotSuccessful = "error reported by API" + errMissingAccountID = "account ID is empty and must be provided" +) + +var _ Error = &UserError{} + +// Error represents an error returned from this library. +type Error interface { + error + // Raised when user credentials or configuration is invalid. + User() bool + // Raised when a parsing error (e.g. JSON) occurs. + Parse() bool + // Raised when a network error occurs. + Network() bool + // Contains the most recent error. +} + +// UserError represents a user-generated error. +type UserError struct { + Err error +} + +// User is a user-caused error. +func (e *UserError) User() bool { + return true +} + +// Network error. +func (e *UserError) Network() bool { + return false +} + +// Parse error. +func (e *UserError) Parse() bool { + return true +} + +// Error wraps the underlying error. +func (e *UserError) Error() string { + return e.Err.Error() +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/filter.go b/vendor/github.com/cloudflare/cloudflare-go/filter.go new file mode 100644 index 000000000000..cf3ef1c20d16 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/filter.go @@ -0,0 +1,241 @@ +package cloudflare + +import ( + "encoding/json" + "fmt" + "net/url" + "strconv" + "strings" + + "github.com/pkg/errors" +) + +// Filter holds the structure of the filter type. +type Filter struct { + ID string `json:"id,omitempty"` + Expression string `json:"expression"` + Paused bool `json:"paused"` + Description string `json:"description"` + + // Property is mentioned in documentation however isn't populated in + // any of the API requests. For now, let's just omit it unless it's + // provided. + Ref string `json:"ref,omitempty"` +} + +// FiltersDetailResponse is the API response that is returned +// for requesting all filters on a zone. +type FiltersDetailResponse struct { + Result []Filter `json:"result"` + ResultInfo `json:"result_info"` + Response +} + +// FilterDetailResponse is the API response that is returned +// for requesting a single filter on a zone. +type FilterDetailResponse struct { + Result Filter `json:"result"` + ResultInfo `json:"result_info"` + Response +} + +// FilterValidateExpression represents the JSON payload for checking +// an expression. +type FilterValidateExpression struct { + Expression string `json:"expression"` +} + +// FilterValidateExpressionResponse represents the API response for +// checking the expression. It conforms to the JSON API approach however +// we don't need all of the fields exposed. +type FilterValidateExpressionResponse struct { + Success bool `json:"success"` + Errors []FilterValidationExpressionMessage `json:"errors"` +} + +// FilterValidationExpressionMessage represents the API error message. +type FilterValidationExpressionMessage struct { + Message string `json:"message"` +} + +// Filter returns a single filter in a zone based on the filter ID. +// +// API reference: https://developers.cloudflare.com/firewall/api/cf-filters/get/#get-by-filter-id +func (api *API) Filter(zoneID, filterID string) (Filter, error) { + uri := fmt.Sprintf("/zones/%s/filters/%s", zoneID, filterID) + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return Filter{}, errors.Wrap(err, errMakeRequestError) + } + + var filterResponse FilterDetailResponse + err = json.Unmarshal(res, &filterResponse) + if err != nil { + return Filter{}, errors.Wrap(err, errUnmarshalError) + } + + return filterResponse.Result, nil +} + +// Filters returns all filters for a zone. +// +// API reference: https://developers.cloudflare.com/firewall/api/cf-filters/get/#get-all-filters +func (api *API) Filters(zoneID string, pageOpts PaginationOptions) ([]Filter, error) { + uri := "/zones/" + zoneID + "/filters" + v := url.Values{} + + if pageOpts.PerPage > 0 { + v.Set("per_page", strconv.Itoa(pageOpts.PerPage)) + } + + if pageOpts.Page > 0 { + v.Set("page", strconv.Itoa(pageOpts.Page)) + } + + if len(v) > 0 { + uri = uri + "?" + v.Encode() + } + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []Filter{}, errors.Wrap(err, errMakeRequestError) + } + + var filtersResponse FiltersDetailResponse + err = json.Unmarshal(res, &filtersResponse) + if err != nil { + return []Filter{}, errors.Wrap(err, errUnmarshalError) + } + + return filtersResponse.Result, nil +} + +// CreateFilters creates new filters. +// +// API reference: https://developers.cloudflare.com/firewall/api/cf-filters/post/ +func (api *API) CreateFilters(zoneID string, filters []Filter) ([]Filter, error) { + uri := "/zones/" + zoneID + "/filters" + + res, err := api.makeRequest("POST", uri, filters) + if err != nil { + return []Filter{}, errors.Wrap(err, errMakeRequestError) + } + + var filtersResponse FiltersDetailResponse + err = json.Unmarshal(res, &filtersResponse) + if err != nil { + return []Filter{}, errors.Wrap(err, errUnmarshalError) + } + + return filtersResponse.Result, nil +} + +// UpdateFilter updates a single filter. +// +// API reference: https://developers.cloudflare.com/firewall/api/cf-filters/put/#update-a-single-filter +func (api *API) UpdateFilter(zoneID string, filter Filter) (Filter, error) { + if filter.ID == "" { + return Filter{}, errors.Errorf("filter ID cannot be empty") + } + + uri := fmt.Sprintf("/zones/%s/filters/%s", zoneID, filter.ID) + + res, err := api.makeRequest("PUT", uri, filter) + if err != nil { + return Filter{}, errors.Wrap(err, errMakeRequestError) + } + + var filterResponse FilterDetailResponse + err = json.Unmarshal(res, &filterResponse) + if err != nil { + return Filter{}, errors.Wrap(err, errUnmarshalError) + } + + return filterResponse.Result, nil +} + +// UpdateFilters updates many filters at once. +// +// API reference: https://developers.cloudflare.com/firewall/api/cf-filters/put/#update-multiple-filters +func (api *API) UpdateFilters(zoneID string, filters []Filter) ([]Filter, error) { + for _, filter := range filters { + if filter.ID == "" { + return []Filter{}, errors.Errorf("filter ID cannot be empty") + } + } + + uri := "/zones/" + zoneID + "/filters" + + res, err := api.makeRequest("PUT", uri, filters) + if err != nil { + return []Filter{}, errors.Wrap(err, errMakeRequestError) + } + + var filtersResponse FiltersDetailResponse + err = json.Unmarshal(res, &filtersResponse) + if err != nil { + return []Filter{}, errors.Wrap(err, errUnmarshalError) + } + + return filtersResponse.Result, nil +} + +// DeleteFilter deletes a single filter. +// +// API reference: https://developers.cloudflare.com/firewall/api/cf-filters/delete/#delete-a-single-filter +func (api *API) DeleteFilter(zoneID, filterID string) error { + if filterID == "" { + return errors.Errorf("filter ID cannot be empty") + } + + uri := fmt.Sprintf("/zones/%s/filters/%s", zoneID, filterID) + + _, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + + return nil +} + +// DeleteFilters deletes multiple filters. +// +// API reference: https://developers.cloudflare.com/firewall/api/cf-filters/delete/#delete-multiple-filters +func (api *API) DeleteFilters(zoneID string, filterIDs []string) error { + ids := strings.Join(filterIDs, ",") + uri := fmt.Sprintf("/zones/%s/filters?id=%s", zoneID, ids) + + _, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + + return nil +} + +// ValidateFilterExpression checks correctness of a filter expression. +// +// API reference: https://developers.cloudflare.com/firewall/api/cf-filters/validation/ +func (api *API) ValidateFilterExpression(expression string) error { + uri := fmt.Sprintf("/filters/validate-expr") + expressionPayload := FilterValidateExpression{Expression: expression} + + _, err := api.makeRequest("POST", uri, expressionPayload) + if err != nil { + var filterValidationResponse FilterValidateExpressionResponse + + jsonErr := json.Unmarshal([]byte(err.Error()), &filterValidationResponse) + if jsonErr != nil { + return errors.Wrap(jsonErr, errUnmarshalError) + } + + if filterValidationResponse.Success != true { + // Unsure why but the API returns `errors` as an array but it only + // ever shows the issue with one problem at a time ¯\_(ツ)_/¯ + return errors.Errorf(filterValidationResponse.Errors[0].Message) + } + } + + return nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/firewall.go b/vendor/github.com/cloudflare/cloudflare-go/firewall.go new file mode 100644 index 000000000000..4b61a7ca5167 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/firewall.go @@ -0,0 +1,280 @@ +package cloudflare + +import ( + "encoding/json" + "net/url" + "strconv" + "time" + + "github.com/pkg/errors" +) + +// AccessRule represents a firewall access rule. +type AccessRule struct { + ID string `json:"id,omitempty"` + Notes string `json:"notes,omitempty"` + AllowedModes []string `json:"allowed_modes,omitempty"` + Mode string `json:"mode,omitempty"` + Configuration AccessRuleConfiguration `json:"configuration,omitempty"` + Scope AccessRuleScope `json:"scope,omitempty"` + CreatedOn time.Time `json:"created_on,omitempty"` + ModifiedOn time.Time `json:"modified_on,omitempty"` +} + +// AccessRuleConfiguration represents the configuration of a firewall +// access rule. +type AccessRuleConfiguration struct { + Target string `json:"target,omitempty"` + Value string `json:"value,omitempty"` +} + +// AccessRuleScope represents the scope of a firewall access rule. +type AccessRuleScope struct { + ID string `json:"id,omitempty"` + Email string `json:"email,omitempty"` + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` +} + +// AccessRuleResponse represents the response from the firewall access +// rule endpoint. +type AccessRuleResponse struct { + Result AccessRule `json:"result"` + Response + ResultInfo `json:"result_info"` +} + +// AccessRuleListResponse represents the response from the list access rules +// endpoint. +type AccessRuleListResponse struct { + Result []AccessRule `json:"result"` + Response + ResultInfo `json:"result_info"` +} + +// ListUserAccessRules returns a slice of access rules for the logged-in user. +// +// This takes an AccessRule to allow filtering of the results returned. +// +// API reference: https://api.cloudflare.com/#user-level-firewall-access-rule-list-access-rules +func (api *API) ListUserAccessRules(accessRule AccessRule, page int) (*AccessRuleListResponse, error) { + return api.listAccessRules("/user", accessRule, page) +} + +// CreateUserAccessRule creates a firewall access rule for the logged-in user. +// +// API reference: https://api.cloudflare.com/#user-level-firewall-access-rule-create-access-rule +func (api *API) CreateUserAccessRule(accessRule AccessRule) (*AccessRuleResponse, error) { + return api.createAccessRule("/user", accessRule) +} + +// UserAccessRule returns the details of a user's account access rule. +// +// API reference: https://api.cloudflare.com/#user-level-firewall-access-rule-list-access-rules +func (api *API) UserAccessRule(accessRuleID string) (*AccessRuleResponse, error) { + return api.retrieveAccessRule("/user", accessRuleID) +} + +// UpdateUserAccessRule updates a single access rule for the logged-in user & +// given access rule identifier. +// +// API reference: https://api.cloudflare.com/#user-level-firewall-access-rule-update-access-rule +func (api *API) UpdateUserAccessRule(accessRuleID string, accessRule AccessRule) (*AccessRuleResponse, error) { + return api.updateAccessRule("/user", accessRuleID, accessRule) +} + +// DeleteUserAccessRule deletes a single access rule for the logged-in user and +// access rule identifiers. +// +// API reference: https://api.cloudflare.com/#user-level-firewall-access-rule-update-access-rule +func (api *API) DeleteUserAccessRule(accessRuleID string) (*AccessRuleResponse, error) { + return api.deleteAccessRule("/user", accessRuleID) +} + +// ListZoneAccessRules returns a slice of access rules for the given zone +// identifier. +// +// This takes an AccessRule to allow filtering of the results returned. +// +// API reference: https://api.cloudflare.com/#firewall-access-rule-for-a-zone-list-access-rules +func (api *API) ListZoneAccessRules(zoneID string, accessRule AccessRule, page int) (*AccessRuleListResponse, error) { + return api.listAccessRules("/zones/"+zoneID, accessRule, page) +} + +// CreateZoneAccessRule creates a firewall access rule for the given zone +// identifier. +// +// API reference: https://api.cloudflare.com/#firewall-access-rule-for-a-zone-create-access-rule +func (api *API) CreateZoneAccessRule(zoneID string, accessRule AccessRule) (*AccessRuleResponse, error) { + return api.createAccessRule("/zones/"+zoneID, accessRule) +} + +// ZoneAccessRule returns the details of a zone's access rule. +// +// API reference: https://api.cloudflare.com/#firewall-access-rule-for-a-zone-list-access-rules +func (api *API) ZoneAccessRule(zoneID string, accessRuleID string) (*AccessRuleResponse, error) { + return api.retrieveAccessRule("/zones/"+zoneID, accessRuleID) +} + +// UpdateZoneAccessRule updates a single access rule for the given zone & +// access rule identifiers. +// +// API reference: https://api.cloudflare.com/#firewall-access-rule-for-a-zone-update-access-rule +func (api *API) UpdateZoneAccessRule(zoneID, accessRuleID string, accessRule AccessRule) (*AccessRuleResponse, error) { + return api.updateAccessRule("/zones/"+zoneID, accessRuleID, accessRule) +} + +// DeleteZoneAccessRule deletes a single access rule for the given zone and +// access rule identifiers. +// +// API reference: https://api.cloudflare.com/#firewall-access-rule-for-a-zone-delete-access-rule +func (api *API) DeleteZoneAccessRule(zoneID, accessRuleID string) (*AccessRuleResponse, error) { + return api.deleteAccessRule("/zones/"+zoneID, accessRuleID) +} + +// ListAccountAccessRules returns a slice of access rules for the given +// account identifier. +// +// This takes an AccessRule to allow filtering of the results returned. +// +// API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-list-access-rules +func (api *API) ListAccountAccessRules(accountID string, accessRule AccessRule, page int) (*AccessRuleListResponse, error) { + return api.listAccessRules("/accounts/"+accountID, accessRule, page) +} + +// CreateAccountAccessRule creates a firewall access rule for the given +// account identifier. +// +// API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-create-access-rule +func (api *API) CreateAccountAccessRule(accountID string, accessRule AccessRule) (*AccessRuleResponse, error) { + return api.createAccessRule("/accounts/"+accountID, accessRule) +} + +// AccountAccessRule returns the details of an account's access rule. +// +// API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-access-rule-details +func (api *API) AccountAccessRule(accountID string, accessRuleID string) (*AccessRuleResponse, error) { + return api.retrieveAccessRule("/accounts/"+accountID, accessRuleID) +} + +// UpdateAccountAccessRule updates a single access rule for the given +// account & access rule identifiers. +// +// API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-update-access-rule +func (api *API) UpdateAccountAccessRule(accountID, accessRuleID string, accessRule AccessRule) (*AccessRuleResponse, error) { + return api.updateAccessRule("/accounts/"+accountID, accessRuleID, accessRule) +} + +// DeleteAccountAccessRule deletes a single access rule for the given +// account and access rule identifiers. +// +// API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-delete-access-rule +func (api *API) DeleteAccountAccessRule(accountID, accessRuleID string) (*AccessRuleResponse, error) { + return api.deleteAccessRule("/accounts/"+accountID, accessRuleID) +} + +func (api *API) listAccessRules(prefix string, accessRule AccessRule, page int) (*AccessRuleListResponse, error) { + // Construct a query string + v := url.Values{} + if page <= 0 { + page = 1 + } + v.Set("page", strconv.Itoa(page)) + // Request as many rules as possible per page - API max is 100 + v.Set("per_page", "100") + if accessRule.Notes != "" { + v.Set("notes", accessRule.Notes) + } + if accessRule.Mode != "" { + v.Set("mode", accessRule.Mode) + } + if accessRule.Scope.Type != "" { + v.Set("scope_type", accessRule.Scope.Type) + } + if accessRule.Configuration.Value != "" { + v.Set("configuration_value", accessRule.Configuration.Value) + } + if accessRule.Configuration.Target != "" { + v.Set("configuration_target", accessRule.Configuration.Target) + } + v.Set("page", strconv.Itoa(page)) + query := "?" + v.Encode() + + uri := prefix + "/firewall/access_rules/rules" + query + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &AccessRuleListResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + return response, nil +} + +func (api *API) createAccessRule(prefix string, accessRule AccessRule) (*AccessRuleResponse, error) { + uri := prefix + "/firewall/access_rules/rules" + res, err := api.makeRequest("POST", uri, accessRule) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &AccessRuleResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response, nil +} + +func (api *API) retrieveAccessRule(prefix, accessRuleID string) (*AccessRuleResponse, error) { + uri := prefix + "/firewall/access_rules/rules/" + accessRuleID + + res, err := api.makeRequest("GET", uri, nil) + + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &AccessRuleResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response, nil +} + +func (api *API) updateAccessRule(prefix, accessRuleID string, accessRule AccessRule) (*AccessRuleResponse, error) { + uri := prefix + "/firewall/access_rules/rules/" + accessRuleID + res, err := api.makeRequest("PATCH", uri, accessRule) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &AccessRuleResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + return response, nil +} + +func (api *API) deleteAccessRule(prefix, accessRuleID string) (*AccessRuleResponse, error) { + uri := prefix + "/firewall/access_rules/rules/" + accessRuleID + res, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &AccessRuleResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/firewall_rules.go b/vendor/github.com/cloudflare/cloudflare-go/firewall_rules.go new file mode 100644 index 000000000000..7a6ce5c70a96 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/firewall_rules.go @@ -0,0 +1,196 @@ +package cloudflare + +import ( + "encoding/json" + "fmt" + "net/url" + "strconv" + "strings" + "time" + + "github.com/pkg/errors" +) + +// FirewallRule is the struct of the firewall rule. +type FirewallRule struct { + ID string `json:"id,omitempty"` + Paused bool `json:"paused"` + Description string `json:"description"` + Action string `json:"action"` + Priority interface{} `json:"priority"` + Filter Filter `json:"filter"` + CreatedOn time.Time `json:"created_on,omitempty"` + ModifiedOn time.Time `json:"modified_on,omitempty"` +} + +// FirewallRulesDetailResponse is the API response for the firewall +// rules. +type FirewallRulesDetailResponse struct { + Result []FirewallRule `json:"result"` + ResultInfo `json:"result_info"` + Response +} + +// FirewallRuleResponse is the API response that is returned +// for requesting a single firewall rule on a zone. +type FirewallRuleResponse struct { + Result FirewallRule `json:"result"` + ResultInfo `json:"result_info"` + Response +} + +// FirewallRules returns all firewall rules. +// +// API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/get/#get-all-rules +func (api *API) FirewallRules(zoneID string, pageOpts PaginationOptions) ([]FirewallRule, error) { + uri := fmt.Sprintf("/zones/%s/firewall/rules", zoneID) + v := url.Values{} + + if pageOpts.PerPage > 0 { + v.Set("per_page", strconv.Itoa(pageOpts.PerPage)) + } + + if pageOpts.Page > 0 { + v.Set("page", strconv.Itoa(pageOpts.Page)) + } + + if len(v) > 0 { + uri = uri + "?" + v.Encode() + } + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []FirewallRule{}, errors.Wrap(err, errMakeRequestError) + } + + var firewallDetailResponse FirewallRulesDetailResponse + err = json.Unmarshal(res, &firewallDetailResponse) + if err != nil { + return []FirewallRule{}, errors.Wrap(err, errUnmarshalError) + } + + return firewallDetailResponse.Result, nil +} + +// FirewallRule returns a single firewall rule based on the ID. +// +// API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/get/#get-by-rule-id +func (api *API) FirewallRule(zoneID, firewallRuleID string) (FirewallRule, error) { + uri := fmt.Sprintf("/zones/%s/firewall/rules/%s", zoneID, firewallRuleID) + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return FirewallRule{}, errors.Wrap(err, errMakeRequestError) + } + + var firewallRuleResponse FirewallRuleResponse + err = json.Unmarshal(res, &firewallRuleResponse) + if err != nil { + return FirewallRule{}, errors.Wrap(err, errUnmarshalError) + } + + return firewallRuleResponse.Result, nil +} + +// CreateFirewallRules creates new firewall rules. +// +// API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/post/ +func (api *API) CreateFirewallRules(zoneID string, firewallRules []FirewallRule) ([]FirewallRule, error) { + uri := fmt.Sprintf("/zones/%s/firewall/rules", zoneID) + + res, err := api.makeRequest("POST", uri, firewallRules) + if err != nil { + return []FirewallRule{}, errors.Wrap(err, errMakeRequestError) + } + + var firewallRulesDetailResponse FirewallRulesDetailResponse + err = json.Unmarshal(res, &firewallRulesDetailResponse) + if err != nil { + return []FirewallRule{}, errors.Wrap(err, errUnmarshalError) + } + + return firewallRulesDetailResponse.Result, nil +} + +// UpdateFirewallRule updates a single firewall rule. +// +// API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/put/#update-a-single-rule +func (api *API) UpdateFirewallRule(zoneID string, firewallRule FirewallRule) (FirewallRule, error) { + if firewallRule.ID == "" { + return FirewallRule{}, errors.Errorf("firewall rule ID cannot be empty") + } + + uri := fmt.Sprintf("/zones/%s/firewall/rules/%s", zoneID, firewallRule.ID) + + res, err := api.makeRequest("PUT", uri, firewallRule) + if err != nil { + return FirewallRule{}, errors.Wrap(err, errMakeRequestError) + } + + var firewallRuleResponse FirewallRuleResponse + err = json.Unmarshal(res, &firewallRuleResponse) + if err != nil { + return FirewallRule{}, errors.Wrap(err, errUnmarshalError) + } + + return firewallRuleResponse.Result, nil +} + +// UpdateFirewallRules updates a single firewall rule. +// +// API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/put/#update-multiple-rules +func (api *API) UpdateFirewallRules(zoneID string, firewallRules []FirewallRule) ([]FirewallRule, error) { + for _, firewallRule := range firewallRules { + if firewallRule.ID == "" { + return []FirewallRule{}, errors.Errorf("firewall ID cannot be empty") + } + } + + uri := fmt.Sprintf("/zones/%s/firewall/rules", zoneID) + + res, err := api.makeRequest("PUT", uri, firewallRules) + if err != nil { + return []FirewallRule{}, errors.Wrap(err, errMakeRequestError) + } + + var firewallRulesDetailResponse FirewallRulesDetailResponse + err = json.Unmarshal(res, &firewallRulesDetailResponse) + if err != nil { + return []FirewallRule{}, errors.Wrap(err, errUnmarshalError) + } + + return firewallRulesDetailResponse.Result, nil +} + +// DeleteFirewallRule updates a single firewall rule. +// +// API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/delete/#delete-a-single-rule +func (api *API) DeleteFirewallRule(zoneID, firewallRuleID string) error { + if firewallRuleID == "" { + return errors.Errorf("firewall rule ID cannot be empty") + } + + uri := fmt.Sprintf("/zones/%s/firewall/rules/%s", zoneID, firewallRuleID) + + _, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + + return nil +} + +// DeleteFirewallRules updates a single firewall rule. +// +// API reference: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/delete/#delete-multiple-rules +func (api *API) DeleteFirewallRules(zoneID string, firewallRuleIDs []string) error { + ids := strings.Join(firewallRuleIDs, ",") + uri := fmt.Sprintf("/zones/%s/firewall/rules?id=%s", zoneID, ids) + + _, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + + return nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/go.mod b/vendor/github.com/cloudflare/cloudflare-go/go.mod new file mode 100644 index 000000000000..77e9223387b7 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/go.mod @@ -0,0 +1,13 @@ +module github.com/cloudflare/cloudflare-go + +go 1.11 + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/mattn/go-runewidth v0.0.4 // indirect + github.com/olekukonko/tablewriter v0.0.1 + github.com/pkg/errors v0.8.1 + github.com/stretchr/testify v1.4.0 + github.com/urfave/cli v1.22.1 + golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 +) diff --git a/vendor/github.com/cloudflare/cloudflare-go/go.sum b/vendor/github.com/cloudflare/cloudflare-go/go.sum new file mode 100644 index 000000000000..65391c2b15b2 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/go.sum @@ -0,0 +1,26 @@ +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/olekukonko/tablewriter v0.0.1 h1:b3iUnf1v+ppJiOfNX4yxxqfWKMQPZR5yoh8urCTFX88= +github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/urfave/cli v1.21.0 h1:wYSSj06510qPIzGSua9ZqsncMmWE3Zr55KBERygyrxE= +github.com/urfave/cli v1.21.0/go.mod h1:lxDj6qX9Q6lWQxIrbrT0nwecwUtRnhVZAJjJZrVUZZQ= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/cloudflare/cloudflare-go/ips.go b/vendor/github.com/cloudflare/cloudflare-go/ips.go new file mode 100644 index 000000000000..72b5fcfbc501 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/ips.go @@ -0,0 +1,44 @@ +package cloudflare + +import ( + "encoding/json" + "io/ioutil" + "net/http" + + "github.com/pkg/errors" +) + +// IPRanges contains lists of IPv4 and IPv6 CIDRs. +type IPRanges struct { + IPv4CIDRs []string `json:"ipv4_cidrs"` + IPv6CIDRs []string `json:"ipv6_cidrs"` +} + +// IPsResponse is the API response containing a list of IPs. +type IPsResponse struct { + Response + Result IPRanges `json:"result"` +} + +// IPs gets a list of Cloudflare's IP ranges. +// +// This does not require logging in to the API. +// +// API reference: https://api.cloudflare.com/#cloudflare-ips +func IPs() (IPRanges, error) { + resp, err := http.Get(apiURL + "/ips") + if err != nil { + return IPRanges{}, errors.Wrap(err, "HTTP request failed") + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return IPRanges{}, errors.Wrap(err, "Response body could not be read") + } + var r IPsResponse + err = json.Unmarshal(body, &r) + if err != nil { + return IPRanges{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/keyless.go b/vendor/github.com/cloudflare/cloudflare-go/keyless.go new file mode 100644 index 000000000000..c5cc83914154 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/keyless.go @@ -0,0 +1,52 @@ +package cloudflare + +import "time" + +// KeylessSSL represents Keyless SSL configuration. +type KeylessSSL struct { + ID string `json:"id"` + Name string `json:"name"` + Host string `json:"host"` + Port int `json:"port"` + Status string `json:"success"` + Enabled bool `json:"enabled"` + Permissions []string `json:"permissions"` + CreatedOn time.Time `json:"created_on"` + ModifiedOn time.Time `json:"modifed_on"` +} + +// KeylessSSLResponse represents the response from the Keyless SSL endpoint. +type KeylessSSLResponse struct { + Response + Result []KeylessSSL `json:"result"` +} + +// CreateKeyless creates a new Keyless SSL configuration for the zone. +// +// API reference: https://api.cloudflare.com/#keyless-ssl-for-a-zone-create-a-keyless-ssl-configuration +func (api *API) CreateKeyless() { +} + +// ListKeyless lists Keyless SSL configurations for a zone. +// +// API reference: https://api.cloudflare.com/#keyless-ssl-for-a-zone-list-keyless-ssls +func (api *API) ListKeyless() { +} + +// Keyless provides the configuration for a given Keyless SSL identifier. +// +// API reference: https://api.cloudflare.com/#keyless-ssl-for-a-zone-keyless-ssl-details +func (api *API) Keyless() { +} + +// UpdateKeyless updates an existing Keyless SSL configuration. +// +// API reference: https://api.cloudflare.com/#keyless-ssl-for-a-zone-update-keyless-configuration +func (api *API) UpdateKeyless() { +} + +// DeleteKeyless deletes an existing Keyless SSL configuration. +// +// API reference: https://api.cloudflare.com/#keyless-ssl-for-a-zone-delete-keyless-configuration +func (api *API) DeleteKeyless() { +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/load_balancing.go b/vendor/github.com/cloudflare/cloudflare-go/load_balancing.go new file mode 100644 index 000000000000..8b2f89a6506a --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/load_balancing.go @@ -0,0 +1,387 @@ +package cloudflare + +import ( + "encoding/json" + "time" + + "github.com/pkg/errors" +) + +// LoadBalancerPool represents a load balancer pool's properties. +type LoadBalancerPool struct { + ID string `json:"id,omitempty"` + CreatedOn *time.Time `json:"created_on,omitempty"` + ModifiedOn *time.Time `json:"modified_on,omitempty"` + Description string `json:"description"` + Name string `json:"name"` + Enabled bool `json:"enabled"` + MinimumOrigins int `json:"minimum_origins,omitempty"` + Monitor string `json:"monitor,omitempty"` + Origins []LoadBalancerOrigin `json:"origins"` + NotificationEmail string `json:"notification_email,omitempty"` + + // CheckRegions defines the geographic region(s) from where to run health-checks from - e.g. "WNAM", "WEU", "SAF", "SAM". + // Providing a null/empty value means "all regions", which may not be available to all plan types. + CheckRegions []string `json:"check_regions"` +} + +// LoadBalancerOrigin represents a Load Balancer origin's properties. +type LoadBalancerOrigin struct { + Name string `json:"name"` + Address string `json:"address"` + Enabled bool `json:"enabled"` + Weight float64 `json:"weight"` +} + +// LoadBalancerMonitor represents a load balancer monitor's properties. +type LoadBalancerMonitor struct { + ID string `json:"id,omitempty"` + CreatedOn *time.Time `json:"created_on,omitempty"` + ModifiedOn *time.Time `json:"modified_on,omitempty"` + Type string `json:"type"` + Description string `json:"description"` + Method string `json:"method"` + Path string `json:"path"` + Header map[string][]string `json:"header"` + Timeout int `json:"timeout"` + Retries int `json:"retries"` + Interval int `json:"interval"` + Port uint16 `json:"port,omitempty"` + ExpectedBody string `json:"expected_body"` + ExpectedCodes string `json:"expected_codes"` + FollowRedirects bool `json:"follow_redirects"` + AllowInsecure bool `json:"allow_insecure"` + ProbeZone string `json:"probe_zone"` +} + +// LoadBalancer represents a load balancer's properties. +type LoadBalancer struct { + ID string `json:"id,omitempty"` + CreatedOn *time.Time `json:"created_on,omitempty"` + ModifiedOn *time.Time `json:"modified_on,omitempty"` + Description string `json:"description"` + Name string `json:"name"` + TTL int `json:"ttl,omitempty"` + FallbackPool string `json:"fallback_pool"` + DefaultPools []string `json:"default_pools"` + RegionPools map[string][]string `json:"region_pools"` + PopPools map[string][]string `json:"pop_pools"` + Proxied bool `json:"proxied"` + Enabled *bool `json:"enabled,omitempty"` + Persistence string `json:"session_affinity,omitempty"` + PersistenceTTL int `json:"session_affinity_ttl,omitempty"` + + // SteeringPolicy controls pool selection logic. + // "off" select pools in DefaultPools order + // "geo" select pools based on RegionPools/PopPools + // "dynamic_latency" select pools based on RTT (requires health checks) + // "random" selects pools in a random order + // "" maps to "geo" if RegionPools or PopPools have entries otherwise "off" + SteeringPolicy string `json:"steering_policy,omitempty"` +} + +// LoadBalancerOriginHealth represents the health of the origin. +type LoadBalancerOriginHealth struct { + Healthy bool `json:"healthy,omitempty"` + RTT Duration `json:"rtt,omitempty"` + FailureReason string `json:"failure_reason,omitempty"` + ResponseCode int `json:"response_code,omitempty"` +} + +// LoadBalancerPoolPopHealth represents the health of the pool for given PoP. +type LoadBalancerPoolPopHealth struct { + Healthy bool `json:"healthy,omitempty"` + Origins []map[string]LoadBalancerOriginHealth `json:"origins,omitempty"` +} + +// LoadBalancerPoolHealth represents the healthchecks from different PoPs for a pool. +type LoadBalancerPoolHealth struct { + ID string `json:"pool_id,omitempty"` + PopHealth map[string]LoadBalancerPoolPopHealth `json:"pop_health,omitempty"` +} + +// loadBalancerPoolResponse represents the response from the load balancer pool endpoints. +type loadBalancerPoolResponse struct { + Response + Result LoadBalancerPool `json:"result"` +} + +// loadBalancerPoolListResponse represents the response from the List Pools endpoint. +type loadBalancerPoolListResponse struct { + Response + Result []LoadBalancerPool `json:"result"` + ResultInfo ResultInfo `json:"result_info"` +} + +// loadBalancerMonitorResponse represents the response from the load balancer monitor endpoints. +type loadBalancerMonitorResponse struct { + Response + Result LoadBalancerMonitor `json:"result"` +} + +// loadBalancerMonitorListResponse represents the response from the List Monitors endpoint. +type loadBalancerMonitorListResponse struct { + Response + Result []LoadBalancerMonitor `json:"result"` + ResultInfo ResultInfo `json:"result_info"` +} + +// loadBalancerResponse represents the response from the load balancer endpoints. +type loadBalancerResponse struct { + Response + Result LoadBalancer `json:"result"` +} + +// loadBalancerListResponse represents the response from the List Load Balancers endpoint. +type loadBalancerListResponse struct { + Response + Result []LoadBalancer `json:"result"` + ResultInfo ResultInfo `json:"result_info"` +} + +// loadBalancerPoolHealthResponse represents the response from the Pool Health Details endpoint. +type loadBalancerPoolHealthResponse struct { + Response + Result LoadBalancerPoolHealth `json:"result"` +} + +// CreateLoadBalancerPool creates a new load balancer pool. +// +// API reference: https://api.cloudflare.com/#load-balancer-pools-create-a-pool +func (api *API) CreateLoadBalancerPool(pool LoadBalancerPool) (LoadBalancerPool, error) { + uri := api.userBaseURL("/user") + "/load_balancers/pools" + res, err := api.makeRequest("POST", uri, pool) + if err != nil { + return LoadBalancerPool{}, errors.Wrap(err, errMakeRequestError) + } + var r loadBalancerPoolResponse + if err := json.Unmarshal(res, &r); err != nil { + return LoadBalancerPool{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// ListLoadBalancerPools lists load balancer pools connected to an account. +// +// API reference: https://api.cloudflare.com/#load-balancer-pools-list-pools +func (api *API) ListLoadBalancerPools() ([]LoadBalancerPool, error) { + uri := api.userBaseURL("/user") + "/load_balancers/pools" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + var r loadBalancerPoolListResponse + if err := json.Unmarshal(res, &r); err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// LoadBalancerPoolDetails returns the details for a load balancer pool. +// +// API reference: https://api.cloudflare.com/#load-balancer-pools-pool-details +func (api *API) LoadBalancerPoolDetails(poolID string) (LoadBalancerPool, error) { + uri := api.userBaseURL("/user") + "/load_balancers/pools/" + poolID + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return LoadBalancerPool{}, errors.Wrap(err, errMakeRequestError) + } + var r loadBalancerPoolResponse + if err := json.Unmarshal(res, &r); err != nil { + return LoadBalancerPool{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// DeleteLoadBalancerPool disables and deletes a load balancer pool. +// +// API reference: https://api.cloudflare.com/#load-balancer-pools-delete-a-pool +func (api *API) DeleteLoadBalancerPool(poolID string) error { + uri := api.userBaseURL("/user") + "/load_balancers/pools/" + poolID + if _, err := api.makeRequest("DELETE", uri, nil); err != nil { + return errors.Wrap(err, errMakeRequestError) + } + return nil +} + +// ModifyLoadBalancerPool modifies a configured load balancer pool. +// +// API reference: https://api.cloudflare.com/#load-balancer-pools-modify-a-pool +func (api *API) ModifyLoadBalancerPool(pool LoadBalancerPool) (LoadBalancerPool, error) { + uri := api.userBaseURL("/user") + "/load_balancers/pools/" + pool.ID + res, err := api.makeRequest("PUT", uri, pool) + if err != nil { + return LoadBalancerPool{}, errors.Wrap(err, errMakeRequestError) + } + var r loadBalancerPoolResponse + if err := json.Unmarshal(res, &r); err != nil { + return LoadBalancerPool{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// CreateLoadBalancerMonitor creates a new load balancer monitor. +// +// API reference: https://api.cloudflare.com/#load-balancer-monitors-create-a-monitor +func (api *API) CreateLoadBalancerMonitor(monitor LoadBalancerMonitor) (LoadBalancerMonitor, error) { + uri := api.userBaseURL("/user") + "/load_balancers/monitors" + res, err := api.makeRequest("POST", uri, monitor) + if err != nil { + return LoadBalancerMonitor{}, errors.Wrap(err, errMakeRequestError) + } + var r loadBalancerMonitorResponse + if err := json.Unmarshal(res, &r); err != nil { + return LoadBalancerMonitor{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// ListLoadBalancerMonitors lists load balancer monitors connected to an account. +// +// API reference: https://api.cloudflare.com/#load-balancer-monitors-list-monitors +func (api *API) ListLoadBalancerMonitors() ([]LoadBalancerMonitor, error) { + uri := api.userBaseURL("/user") + "/load_balancers/monitors" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + var r loadBalancerMonitorListResponse + if err := json.Unmarshal(res, &r); err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// LoadBalancerMonitorDetails returns the details for a load balancer monitor. +// +// API reference: https://api.cloudflare.com/#load-balancer-monitors-monitor-details +func (api *API) LoadBalancerMonitorDetails(monitorID string) (LoadBalancerMonitor, error) { + uri := api.userBaseURL("/user") + "/load_balancers/monitors/" + monitorID + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return LoadBalancerMonitor{}, errors.Wrap(err, errMakeRequestError) + } + var r loadBalancerMonitorResponse + if err := json.Unmarshal(res, &r); err != nil { + return LoadBalancerMonitor{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// DeleteLoadBalancerMonitor disables and deletes a load balancer monitor. +// +// API reference: https://api.cloudflare.com/#load-balancer-monitors-delete-a-monitor +func (api *API) DeleteLoadBalancerMonitor(monitorID string) error { + uri := api.userBaseURL("/user") + "/load_balancers/monitors/" + monitorID + if _, err := api.makeRequest("DELETE", uri, nil); err != nil { + return errors.Wrap(err, errMakeRequestError) + } + return nil +} + +// ModifyLoadBalancerMonitor modifies a configured load balancer monitor. +// +// API reference: https://api.cloudflare.com/#load-balancer-monitors-modify-a-monitor +func (api *API) ModifyLoadBalancerMonitor(monitor LoadBalancerMonitor) (LoadBalancerMonitor, error) { + uri := api.userBaseURL("/user") + "/load_balancers/monitors/" + monitor.ID + res, err := api.makeRequest("PUT", uri, monitor) + if err != nil { + return LoadBalancerMonitor{}, errors.Wrap(err, errMakeRequestError) + } + var r loadBalancerMonitorResponse + if err := json.Unmarshal(res, &r); err != nil { + return LoadBalancerMonitor{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// CreateLoadBalancer creates a new load balancer. +// +// API reference: https://api.cloudflare.com/#load-balancers-create-a-load-balancer +func (api *API) CreateLoadBalancer(zoneID string, lb LoadBalancer) (LoadBalancer, error) { + uri := "/zones/" + zoneID + "/load_balancers" + res, err := api.makeRequest("POST", uri, lb) + if err != nil { + return LoadBalancer{}, errors.Wrap(err, errMakeRequestError) + } + var r loadBalancerResponse + if err := json.Unmarshal(res, &r); err != nil { + return LoadBalancer{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// ListLoadBalancers lists load balancers configured on a zone. +// +// API reference: https://api.cloudflare.com/#load-balancers-list-load-balancers +func (api *API) ListLoadBalancers(zoneID string) ([]LoadBalancer, error) { + uri := "/zones/" + zoneID + "/load_balancers" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + var r loadBalancerListResponse + if err := json.Unmarshal(res, &r); err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// LoadBalancerDetails returns the details for a load balancer. +// +// API reference: https://api.cloudflare.com/#load-balancers-load-balancer-details +func (api *API) LoadBalancerDetails(zoneID, lbID string) (LoadBalancer, error) { + uri := "/zones/" + zoneID + "/load_balancers/" + lbID + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return LoadBalancer{}, errors.Wrap(err, errMakeRequestError) + } + var r loadBalancerResponse + if err := json.Unmarshal(res, &r); err != nil { + return LoadBalancer{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// DeleteLoadBalancer disables and deletes a load balancer. +// +// API reference: https://api.cloudflare.com/#load-balancers-delete-a-load-balancer +func (api *API) DeleteLoadBalancer(zoneID, lbID string) error { + uri := "/zones/" + zoneID + "/load_balancers/" + lbID + if _, err := api.makeRequest("DELETE", uri, nil); err != nil { + return errors.Wrap(err, errMakeRequestError) + } + return nil +} + +// ModifyLoadBalancer modifies a configured load balancer. +// +// API reference: https://api.cloudflare.com/#load-balancers-modify-a-load-balancer +func (api *API) ModifyLoadBalancer(zoneID string, lb LoadBalancer) (LoadBalancer, error) { + uri := "/zones/" + zoneID + "/load_balancers/" + lb.ID + res, err := api.makeRequest("PUT", uri, lb) + if err != nil { + return LoadBalancer{}, errors.Wrap(err, errMakeRequestError) + } + var r loadBalancerResponse + if err := json.Unmarshal(res, &r); err != nil { + return LoadBalancer{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// PoolHealthDetails fetches the latest healtcheck details for a single pool. +// +// API reference: https://api.cloudflare.com/#load-balancer-pools-pool-health-details +func (api *API) PoolHealthDetails(poolID string) (LoadBalancerPoolHealth, error) { + uri := api.userBaseURL("/user") + "/load_balancers/pools/" + poolID + "/health" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return LoadBalancerPoolHealth{}, errors.Wrap(err, errMakeRequestError) + } + var r loadBalancerPoolHealthResponse + if err := json.Unmarshal(res, &r); err != nil { + return LoadBalancerPoolHealth{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/lockdown.go b/vendor/github.com/cloudflare/cloudflare-go/lockdown.go new file mode 100644 index 000000000000..164129bc544f --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/lockdown.go @@ -0,0 +1,151 @@ +package cloudflare + +import ( + "encoding/json" + "net/url" + "strconv" + + "github.com/pkg/errors" +) + +// ZoneLockdown represents a Zone Lockdown rule. A rule only permits access to +// the provided URL pattern(s) from the given IP address(es) or subnet(s). +type ZoneLockdown struct { + ID string `json:"id"` + Description string `json:"description"` + URLs []string `json:"urls"` + Configurations []ZoneLockdownConfig `json:"configurations"` + Paused bool `json:"paused"` + Priority int `json:"priority,omitempty"` +} + +// ZoneLockdownConfig represents a Zone Lockdown config, which comprises +// a Target ("ip" or "ip_range") and a Value (an IP address or IP+mask, +// respectively.) +type ZoneLockdownConfig struct { + Target string `json:"target"` + Value string `json:"value"` +} + +// ZoneLockdownResponse represents a response from the Zone Lockdown endpoint. +type ZoneLockdownResponse struct { + Result ZoneLockdown `json:"result"` + Response + ResultInfo `json:"result_info"` +} + +// ZoneLockdownListResponse represents a response from the List Zone Lockdown +// endpoint. +type ZoneLockdownListResponse struct { + Result []ZoneLockdown `json:"result"` + Response + ResultInfo `json:"result_info"` +} + +// CreateZoneLockdown creates a Zone ZoneLockdown rule for the given zone ID. +// +// API reference: https://api.cloudflare.com/#zone-ZoneLockdown-create-a-ZoneLockdown-rule +func (api *API) CreateZoneLockdown(zoneID string, ld ZoneLockdown) (*ZoneLockdownResponse, error) { + uri := "/zones/" + zoneID + "/firewall/lockdowns" + res, err := api.makeRequest("POST", uri, ld) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &ZoneLockdownResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response, nil +} + +// UpdateZoneLockdown updates a Zone ZoneLockdown rule (based on the ID) for the +// given zone ID. +// +// API reference: https://api.cloudflare.com/#zone-ZoneLockdown-update-ZoneLockdown-rule +func (api *API) UpdateZoneLockdown(zoneID string, id string, ld ZoneLockdown) (*ZoneLockdownResponse, error) { + uri := "/zones/" + zoneID + "/firewall/lockdowns/" + id + res, err := api.makeRequest("PUT", uri, ld) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &ZoneLockdownResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response, nil +} + +// DeleteZoneLockdown deletes a Zone ZoneLockdown rule (based on the ID) for the +// given zone ID. +// +// API reference: https://api.cloudflare.com/#zone-ZoneLockdown-delete-ZoneLockdown-rule +func (api *API) DeleteZoneLockdown(zoneID string, id string) (*ZoneLockdownResponse, error) { + uri := "/zones/" + zoneID + "/firewall/lockdowns/" + id + res, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &ZoneLockdownResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response, nil +} + +// ZoneLockdown retrieves a Zone ZoneLockdown rule (based on the ID) for the +// given zone ID. +// +// API reference: https://api.cloudflare.com/#zone-ZoneLockdown-ZoneLockdown-rule-details +func (api *API) ZoneLockdown(zoneID string, id string) (*ZoneLockdownResponse, error) { + uri := "/zones/" + zoneID + "/firewall/lockdowns/" + id + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &ZoneLockdownResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response, nil +} + +// ListZoneLockdowns retrieves a list of Zone ZoneLockdown rules for a given +// zone ID by page number. +// +// API reference: https://api.cloudflare.com/#zone-ZoneLockdown-list-ZoneLockdown-rules +func (api *API) ListZoneLockdowns(zoneID string, page int) (*ZoneLockdownListResponse, error) { + v := url.Values{} + if page <= 0 { + page = 1 + } + + v.Set("page", strconv.Itoa(page)) + v.Set("per_page", strconv.Itoa(100)) + query := "?" + v.Encode() + + uri := "/zones/" + zoneID + "/firewall/lockdowns" + query + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &ZoneLockdownListResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/logpush.go b/vendor/github.com/cloudflare/cloudflare-go/logpush.go new file mode 100644 index 000000000000..a0134adeddd9 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/logpush.go @@ -0,0 +1,224 @@ +package cloudflare + +import ( + "encoding/json" + "strconv" + "time" + + "github.com/pkg/errors" +) + +// LogpushJob describes a Logpush job. +type LogpushJob struct { + ID int `json:"id,omitempty"` + Enabled bool `json:"enabled"` + Name string `json:"name"` + LogpullOptions string `json:"logpull_options"` + DestinationConf string `json:"destination_conf"` + OwnershipChallenge string `json:"ownership_challenge,omitempty"` + LastComplete *time.Time `json:"last_complete,omitempty"` + LastError *time.Time `json:"last_error,omitempty"` + ErrorMessage string `json:"error_message,omitempty"` +} + +// LogpushJobsResponse is the API response, containing an array of Logpush Jobs. +type LogpushJobsResponse struct { + Response + Result []LogpushJob `json:"result"` +} + +// LogpushJobDetailsResponse is the API response, containing a single Logpush Job. +type LogpushJobDetailsResponse struct { + Response + Result LogpushJob `json:"result"` +} + +// LogpushGetOwnershipChallenge describes a ownership validation. +type LogpushGetOwnershipChallenge struct { + Filename string `json:"filename"` + Valid bool `json:"valid"` + Message string `json:"message"` +} + +// LogpushGetOwnershipChallengeResponse is the API response, containing a ownership challenge. +type LogpushGetOwnershipChallengeResponse struct { + Response + Result LogpushGetOwnershipChallenge `json:"result"` +} + +// LogpushGetOwnershipChallengeRequest is the API request for get ownership challenge. +type LogpushGetOwnershipChallengeRequest struct { + DestinationConf string `json:"destination_conf"` +} + +// LogpushOwnershipChallangeValidationResponse is the API response, +// containing a ownership challenge validation result. +type LogpushOwnershipChallangeValidationResponse struct { + Response + Result struct { + Valid bool `json:"valid"` + } +} + +// LogpushValidateOwnershipChallengeRequest is the API request for validate ownership challenge. +type LogpushValidateOwnershipChallengeRequest struct { + DestinationConf string `json:"destination_conf"` + OwnershipChallenge string `json:"ownership_challenge"` +} + +// LogpushDestinationExistsResponse is the API response, +// containing a destination exists check result. +type LogpushDestinationExistsResponse struct { + Response + Result struct { + Exists bool `json:"exists"` + } +} + +// LogpushDestinationExistsRequest is the API request for check destination exists. +type LogpushDestinationExistsRequest struct { + DestinationConf string `json:"destination_conf"` +} + +// CreateLogpushJob creates a new LogpushJob for a zone. +// +// API reference: https://api.cloudflare.com/#logpush-jobs-create-logpush-job +func (api *API) CreateLogpushJob(zoneID string, job LogpushJob) (*LogpushJob, error) { + uri := "/zones/" + zoneID + "/logpush/jobs" + res, err := api.makeRequest("POST", uri, job) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + var r LogpushJobDetailsResponse + err = json.Unmarshal(res, &r) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + return &r.Result, nil +} + +// LogpushJobs returns all Logpush Jobs for a zone. +// +// API reference: https://api.cloudflare.com/#logpush-jobs-list-logpush-jobs +func (api *API) LogpushJobs(zoneID string) ([]LogpushJob, error) { + uri := "/zones/" + zoneID + "/logpush/jobs" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []LogpushJob{}, errors.Wrap(err, errMakeRequestError) + } + var r LogpushJobsResponse + err = json.Unmarshal(res, &r) + if err != nil { + return []LogpushJob{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// LogpushJob fetches detail about one Logpush Job for a zone. +// +// API reference: https://api.cloudflare.com/#logpush-jobs-logpush-job-details +func (api *API) LogpushJob(zoneID string, jobID int) (LogpushJob, error) { + uri := "/zones/" + zoneID + "/logpush/jobs/" + strconv.Itoa(jobID) + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return LogpushJob{}, errors.Wrap(err, errMakeRequestError) + } + var r LogpushJobDetailsResponse + err = json.Unmarshal(res, &r) + if err != nil { + return LogpushJob{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// UpdateLogpushJob lets you update a Logpush Job. +// +// API reference: https://api.cloudflare.com/#logpush-jobs-update-logpush-job +func (api *API) UpdateLogpushJob(zoneID string, jobID int, job LogpushJob) error { + uri := "/zones/" + zoneID + "/logpush/jobs/" + strconv.Itoa(jobID) + res, err := api.makeRequest("PUT", uri, job) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + var r LogpushJobDetailsResponse + err = json.Unmarshal(res, &r) + if err != nil { + return errors.Wrap(err, errUnmarshalError) + } + return nil +} + +// DeleteLogpushJob deletes a Logpush Job for a zone. +// +// API reference: https://api.cloudflare.com/#logpush-jobs-delete-logpush-job +func (api *API) DeleteLogpushJob(zoneID string, jobID int) error { + uri := "/zones/" + zoneID + "/logpush/jobs/" + strconv.Itoa(jobID) + res, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + var r LogpushJobDetailsResponse + err = json.Unmarshal(res, &r) + if err != nil { + return errors.Wrap(err, errUnmarshalError) + } + return nil +} + +// GetLogpushOwnershipChallenge returns ownership challenge. +// +// API reference: https://api.cloudflare.com/#logpush-jobs-get-ownership-challenge +func (api *API) GetLogpushOwnershipChallenge(zoneID, destinationConf string) (*LogpushGetOwnershipChallenge, error) { + uri := "/zones/" + zoneID + "/logpush/ownership" + res, err := api.makeRequest("POST", uri, LogpushGetOwnershipChallengeRequest{ + DestinationConf: destinationConf, + }) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + var r LogpushGetOwnershipChallengeResponse + err = json.Unmarshal(res, &r) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + return &r.Result, nil +} + +// ValidateLogpushOwnershipChallenge returns ownership challenge validation result. +// +// API reference: https://api.cloudflare.com/#logpush-jobs-validate-ownership-challenge +func (api *API) ValidateLogpushOwnershipChallenge(zoneID, destinationConf, ownershipChallenge string) (bool, error) { + uri := "/zones/" + zoneID + "/logpush/ownership/validate" + res, err := api.makeRequest("POST", uri, LogpushValidateOwnershipChallengeRequest{ + DestinationConf: destinationConf, + OwnershipChallenge: ownershipChallenge, + }) + if err != nil { + return false, errors.Wrap(err, errMakeRequestError) + } + var r LogpushGetOwnershipChallengeResponse + err = json.Unmarshal(res, &r) + if err != nil { + return false, errors.Wrap(err, errUnmarshalError) + } + return r.Result.Valid, nil +} + +// CheckLogpushDestinationExists returns destination exists check result. +// +// API reference: https://api.cloudflare.com/#logpush-jobs-check-destination-exists +func (api *API) CheckLogpushDestinationExists(zoneID, destinationConf string) (bool, error) { + uri := "/zones/" + zoneID + "/logpush/validate/destination/exists" + res, err := api.makeRequest("POST", uri, LogpushDestinationExistsRequest{ + DestinationConf: destinationConf, + }) + if err != nil { + return false, errors.Wrap(err, errMakeRequestError) + } + var r LogpushDestinationExistsResponse + err = json.Unmarshal(res, &r) + if err != nil { + return false, errors.Wrap(err, errUnmarshalError) + } + return r.Result.Exists, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/options.go b/vendor/github.com/cloudflare/cloudflare-go/options.go new file mode 100644 index 000000000000..1bf4f60bd9d9 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/options.go @@ -0,0 +1,101 @@ +package cloudflare + +import ( + "net/http" + + "time" + + "golang.org/x/time/rate" +) + +// Option is a functional option for configuring the API client. +type Option func(*API) error + +// HTTPClient accepts a custom *http.Client for making API calls. +func HTTPClient(client *http.Client) Option { + return func(api *API) error { + api.httpClient = client + return nil + } +} + +// Headers allows you to set custom HTTP headers when making API calls (e.g. for +// satisfying HTTP proxies, or for debugging). +func Headers(headers http.Header) Option { + return func(api *API) error { + api.headers = headers + return nil + } +} + +// UsingAccount allows you to apply account-level changes (Load Balancing, +// Railguns) to an account instead. +func UsingAccount(accountID string) Option { + return func(api *API) error { + api.AccountID = accountID + return nil + } +} + +// UsingRateLimit applies a non-default rate limit to client API requests +// If not specified the default of 4rps will be applied +func UsingRateLimit(rps float64) Option { + return func(api *API) error { + // because ratelimiter doesnt do any windowing + // setting burst makes it difficult to enforce a fixed rate + // so setting it equal to 1 this effectively disables bursting + // this doesn't check for sensible values, ultimately the api will enforce that the value is ok + api.rateLimiter = rate.NewLimiter(rate.Limit(rps), 1) + return nil + } +} + +// UsingRetryPolicy applies a non-default number of retries and min/max retry delays +// This will be used when the client exponentially backs off after errored requests +func UsingRetryPolicy(maxRetries int, minRetryDelaySecs int, maxRetryDelaySecs int) Option { + // seconds is very granular for a minimum delay - but this is only in case of failure + return func(api *API) error { + api.retryPolicy = RetryPolicy{ + MaxRetries: maxRetries, + MinRetryDelay: time.Duration(minRetryDelaySecs) * time.Second, + MaxRetryDelay: time.Duration(maxRetryDelaySecs) * time.Second, + } + return nil + } +} + +// UsingLogger can be set if you want to get log output from this API instance +// By default no log output is emitted +func UsingLogger(logger Logger) Option { + return func(api *API) error { + api.logger = logger + return nil + } +} + +// UserAgent can be set if you want to send a software name and version for HTTP access logs. +// It is recommended to set it in order to help future Customer Support diagnostics +// and prevent collateral damage by sharing generic User-Agent string with abusive users. +// E.g. "my-software/1.2.3". By default generic Go User-Agent is used. +func UserAgent(userAgent string) Option { + return func(api *API) error { + api.UserAgent = userAgent + return nil + } +} + +// parseOptions parses the supplied options functions and returns a configured +// *API instance. +func (api *API) parseOptions(opts ...Option) error { + // Range over each options function and apply it to our API type to + // configure it. Options functions are applied in order, with any + // conflicting options overriding earlier calls. + for _, option := range opts { + err := option(api) + if err != nil { + return err + } + } + + return nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/origin_ca.go b/vendor/github.com/cloudflare/cloudflare-go/origin_ca.go new file mode 100644 index 000000000000..fdd8c4273d71 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/origin_ca.go @@ -0,0 +1,169 @@ +package cloudflare + +import ( + "context" + "encoding/json" + "net/url" + "time" + + "github.com/pkg/errors" +) + +// OriginCACertificate represents a Cloudflare-issued certificate. +// +// API reference: https://api.cloudflare.com/#cloudflare-ca +type OriginCACertificate struct { + ID string `json:"id"` + Certificate string `json:"certificate"` + Hostnames []string `json:"hostnames"` + ExpiresOn time.Time `json:"expires_on"` + RequestType string `json:"request_type"` + RequestValidity int `json:"requested_validity"` + CSR string `json:"csr"` +} + +// OriginCACertificateListOptions represents the parameters used to list Cloudflare-issued certificates. +type OriginCACertificateListOptions struct { + ZoneID string +} + +// OriginCACertificateID represents the ID of the revoked certificate from the Revoke Certificate endpoint. +type OriginCACertificateID struct { + ID string `json:"id"` +} + +// originCACertificateResponse represents the response from the Create Certificate and the Certificate Details endpoints. +type originCACertificateResponse struct { + Response + Result OriginCACertificate `json:"result"` +} + +// originCACertificateResponseList represents the response from the List Certificates endpoint. +type originCACertificateResponseList struct { + Response + Result []OriginCACertificate `json:"result"` + ResultInfo ResultInfo `json:"result_info"` +} + +// originCACertificateResponseRevoke represents the response from the Revoke Certificate endpoint. +type originCACertificateResponseRevoke struct { + Response + Result OriginCACertificateID `json:"result"` +} + +// CreateOriginCertificate creates a Cloudflare-signed certificate. +// +// This function requires api.APIUserServiceKey be set to your Certificates API key. +// +// API reference: https://api.cloudflare.com/#cloudflare-ca-create-certificate +func (api *API) CreateOriginCertificate(certificate OriginCACertificate) (*OriginCACertificate, error) { + uri := "/certificates" + res, err := api.makeRequestWithAuthType(context.TODO(), "POST", uri, certificate, AuthUserService) + + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + var originResponse *originCACertificateResponse + + err = json.Unmarshal(res, &originResponse) + + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + if !originResponse.Success { + return nil, errors.New(errRequestNotSuccessful) + } + + return &originResponse.Result, nil +} + +// OriginCertificates lists all Cloudflare-issued certificates. +// +// This function requires api.APIUserServiceKey be set to your Certificates API key. +// +// API reference: https://api.cloudflare.com/#cloudflare-ca-list-certificates +func (api *API) OriginCertificates(options OriginCACertificateListOptions) ([]OriginCACertificate, error) { + v := url.Values{} + if options.ZoneID != "" { + v.Set("zone_id", options.ZoneID) + } + uri := "/certificates" + "?" + v.Encode() + res, err := api.makeRequestWithAuthType(context.TODO(), "GET", uri, nil, AuthUserService) + + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + var originResponse *originCACertificateResponseList + + err = json.Unmarshal(res, &originResponse) + + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + if !originResponse.Success { + return nil, errors.New(errRequestNotSuccessful) + } + + return originResponse.Result, nil +} + +// OriginCertificate returns the details for a Cloudflare-issued certificate. +// +// This function requires api.APIUserServiceKey be set to your Certificates API key. +// +// API reference: https://api.cloudflare.com/#cloudflare-ca-certificate-details +func (api *API) OriginCertificate(certificateID string) (*OriginCACertificate, error) { + uri := "/certificates/" + certificateID + res, err := api.makeRequestWithAuthType(context.TODO(), "GET", uri, nil, AuthUserService) + + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + var originResponse *originCACertificateResponse + + err = json.Unmarshal(res, &originResponse) + + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + if !originResponse.Success { + return nil, errors.New(errRequestNotSuccessful) + } + + return &originResponse.Result, nil +} + +// RevokeOriginCertificate revokes a created certificate for a zone. +// +// This function requires api.APIUserServiceKey be set to your Certificates API key. +// +// API reference: https://api.cloudflare.com/#cloudflare-ca-revoke-certificate +func (api *API) RevokeOriginCertificate(certificateID string) (*OriginCACertificateID, error) { + uri := "/certificates/" + certificateID + res, err := api.makeRequestWithAuthType(context.TODO(), "DELETE", uri, nil, AuthUserService) + + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + var originResponse *originCACertificateResponseRevoke + + err = json.Unmarshal(res, &originResponse) + + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + if !originResponse.Success { + return nil, errors.New(errRequestNotSuccessful) + } + + return &originResponse.Result, nil + +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/page_rules.go b/vendor/github.com/cloudflare/cloudflare-go/page_rules.go new file mode 100644 index 000000000000..36f62e62f0ae --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/page_rules.go @@ -0,0 +1,235 @@ +package cloudflare + +import ( + "encoding/json" + "time" + + "github.com/pkg/errors" +) + +// PageRuleTarget is the target to evaluate on a request. +// +// Currently Target must always be "url" and Operator must be "matches". Value +// is the URL pattern to match against. +type PageRuleTarget struct { + Target string `json:"target"` + Constraint struct { + Operator string `json:"operator"` + Value string `json:"value"` + } `json:"constraint"` +} + +/* +PageRuleAction is the action to take when the target is matched. + +Valid IDs are: + always_online + always_use_https + automatic_https_rewrites + browser_cache_ttl + browser_check + bypass_cache_on_cookie + cache_by_device_type + cache_deception_armor + cache_level + cache_on_cookie + disable_apps + disable_performance + disable_railgun + disable_security + edge_cache_ttl + email_obfuscation + explicit_cache_control + forwarding_url + host_header_override + ip_geolocation + minify + mirage + opportunistic_encryption + origin_error_page_pass_thru + polish + resolve_override + respect_strong_etag + response_buffering + rocket_loader + security_level + server_side_exclude + sort_query_string_for_cache + ssl + true_client_ip_header + waf +*/ +type PageRuleAction struct { + ID string `json:"id"` + Value interface{} `json:"value"` +} + +// PageRuleActions maps API action IDs to human-readable strings. +var PageRuleActions = map[string]string{ + "always_online": "Always Online", // Value of type string + "always_use_https": "Always Use HTTPS", // Value of type interface{} + "automatic_https_rewrites": "Automatic HTTPS Rewrites", // Value of type string + "browser_cache_ttl": "Browser Cache TTL", // Value of type int + "browser_check": "Browser Integrity Check", // Value of type string + "bypass_cache_on_cookie": "Bypass Cache on Cookie", // Value of type string + "cache_by_device_type": "Cache By Device Type", // Value of type string + "cache_deception_armor": "Cache Deception Armor", // Value of type string + "cache_level": "Cache Level", // Value of type string + "cache_on_cookie": "Cache On Cookie", // Value of type string + "disable_apps": "Disable Apps", // Value of type interface{} + "disable_performance": "Disable Performance", // Value of type interface{} + "disable_railgun": "Disable Railgun", // Value of type string + "disable_security": "Disable Security", // Value of type interface{} + "edge_cache_ttl": "Edge Cache TTL", // Value of type int + "email_obfuscation": "Email Obfuscation", // Value of type string + "explicit_cache_control": "Origin Cache Control", // Value of type string + "forwarding_url": "Forwarding URL", // Value of type map[string]interface + "host_header_override": "Host Header Override", // Value of type string + "ip_geolocation": "IP Geolocation Header", // Value of type string + "minify": "Minify", // Value of type map[string]interface + "mirage": "Mirage", // Value of type string + "opportunistic_encryption": "Opportunistic Encryption", // Value of type string + "origin_error_page_pass_thru": "Origin Error Page Pass-thru", // Value of type string + "polish": "Polish", // Value of type string + "resolve_override": "Resolve Override", // Value of type string + "respect_strong_etag": "Respect Strong ETags", // Value of type string + "response_buffering": "Response Buffering", // Value of type string + "rocket_loader": "Rocker Loader", // Value of type string + "security_level": "Security Level", // Value of type string + "server_side_exclude": "Server Side Excludes", // Value of type string + "sort_query_string_for_cache": "Query String Sort", // Value of type string + "ssl": "SSL", // Value of type string + "true_client_ip_header": "True Client IP Header", // Value of type string + "waf": "Web Application Firewall", // Value of type string +} + +// PageRule describes a Page Rule. +type PageRule struct { + ID string `json:"id,omitempty"` + Targets []PageRuleTarget `json:"targets"` + Actions []PageRuleAction `json:"actions"` + Priority int `json:"priority"` + Status string `json:"status"` // can be: active, paused + ModifiedOn time.Time `json:"modified_on,omitempty"` + CreatedOn time.Time `json:"created_on,omitempty"` +} + +// PageRuleDetailResponse is the API response, containing a single PageRule. +type PageRuleDetailResponse struct { + Success bool `json:"success"` + Errors []string `json:"errors"` + Messages []string `json:"messages"` + Result PageRule `json:"result"` +} + +// PageRulesResponse is the API response, containing an array of PageRules. +type PageRulesResponse struct { + Success bool `json:"success"` + Errors []string `json:"errors"` + Messages []string `json:"messages"` + Result []PageRule `json:"result"` +} + +// CreatePageRule creates a new Page Rule for a zone. +// +// API reference: https://api.cloudflare.com/#page-rules-for-a-zone-create-a-page-rule +func (api *API) CreatePageRule(zoneID string, rule PageRule) (*PageRule, error) { + uri := "/zones/" + zoneID + "/pagerules" + res, err := api.makeRequest("POST", uri, rule) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + var r PageRuleDetailResponse + err = json.Unmarshal(res, &r) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + return &r.Result, nil +} + +// ListPageRules returns all Page Rules for a zone. +// +// API reference: https://api.cloudflare.com/#page-rules-for-a-zone-list-page-rules +func (api *API) ListPageRules(zoneID string) ([]PageRule, error) { + uri := "/zones/" + zoneID + "/pagerules" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []PageRule{}, errors.Wrap(err, errMakeRequestError) + } + var r PageRulesResponse + err = json.Unmarshal(res, &r) + if err != nil { + return []PageRule{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// PageRule fetches detail about one Page Rule for a zone. +// +// API reference: https://api.cloudflare.com/#page-rules-for-a-zone-page-rule-details +func (api *API) PageRule(zoneID, ruleID string) (PageRule, error) { + uri := "/zones/" + zoneID + "/pagerules/" + ruleID + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return PageRule{}, errors.Wrap(err, errMakeRequestError) + } + var r PageRuleDetailResponse + err = json.Unmarshal(res, &r) + if err != nil { + return PageRule{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// ChangePageRule lets you change individual settings for a Page Rule. This is +// in contrast to UpdatePageRule which replaces the entire Page Rule. +// +// API reference: https://api.cloudflare.com/#page-rules-for-a-zone-change-a-page-rule +func (api *API) ChangePageRule(zoneID, ruleID string, rule PageRule) error { + uri := "/zones/" + zoneID + "/pagerules/" + ruleID + res, err := api.makeRequest("PATCH", uri, rule) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + var r PageRuleDetailResponse + err = json.Unmarshal(res, &r) + if err != nil { + return errors.Wrap(err, errUnmarshalError) + } + return nil +} + +// UpdatePageRule lets you replace a Page Rule. This is in contrast to +// ChangePageRule which lets you change individual settings. +// +// API reference: https://api.cloudflare.com/#page-rules-for-a-zone-update-a-page-rule +func (api *API) UpdatePageRule(zoneID, ruleID string, rule PageRule) error { + uri := "/zones/" + zoneID + "/pagerules/" + ruleID + res, err := api.makeRequest("PUT", uri, rule) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + var r PageRuleDetailResponse + err = json.Unmarshal(res, &r) + if err != nil { + return errors.Wrap(err, errUnmarshalError) + } + return nil +} + +// DeletePageRule deletes a Page Rule for a zone. +// +// API reference: https://api.cloudflare.com/#page-rules-for-a-zone-delete-a-page-rule +func (api *API) DeletePageRule(zoneID, ruleID string) error { + uri := "/zones/" + zoneID + "/pagerules/" + ruleID + res, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + var r PageRuleDetailResponse + err = json.Unmarshal(res, &r) + if err != nil { + return errors.Wrap(err, errUnmarshalError) + } + return nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/railgun.go b/vendor/github.com/cloudflare/cloudflare-go/railgun.go new file mode 100644 index 000000000000..72d228691989 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/railgun.go @@ -0,0 +1,297 @@ +package cloudflare + +import ( + "encoding/json" + "net/url" + "time" + + "github.com/pkg/errors" +) + +// Railgun represents a Railgun's properties. +type Railgun struct { + ID string `json:"id"` + Name string `json:"name"` + Status string `json:"status"` + Enabled bool `json:"enabled"` + ZonesConnected int `json:"zones_connected"` + Build string `json:"build"` + Version string `json:"version"` + Revision string `json:"revision"` + ActivationKey string `json:"activation_key"` + ActivatedOn time.Time `json:"activated_on"` + CreatedOn time.Time `json:"created_on"` + ModifiedOn time.Time `json:"modified_on"` + UpgradeInfo struct { + LatestVersion string `json:"latest_version"` + DownloadLink string `json:"download_link"` + } `json:"upgrade_info"` +} + +// RailgunListOptions represents the parameters used to list railguns. +type RailgunListOptions struct { + Direction string +} + +// railgunResponse represents the response from the Create Railgun and the Railgun Details endpoints. +type railgunResponse struct { + Response + Result Railgun `json:"result"` +} + +// railgunsResponse represents the response from the List Railguns endpoint. +type railgunsResponse struct { + Response + Result []Railgun `json:"result"` +} + +// CreateRailgun creates a new Railgun. +// +// API reference: https://api.cloudflare.com/#railgun-create-railgun +func (api *API) CreateRailgun(name string) (Railgun, error) { + uri := api.userBaseURL("") + "/railguns" + params := struct { + Name string `json:"name"` + }{ + Name: name, + } + res, err := api.makeRequest("POST", uri, params) + if err != nil { + return Railgun{}, errors.Wrap(err, errMakeRequestError) + } + var r railgunResponse + if err := json.Unmarshal(res, &r); err != nil { + return Railgun{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// ListRailguns lists Railguns connected to an account. +// +// API reference: https://api.cloudflare.com/#railgun-list-railguns +func (api *API) ListRailguns(options RailgunListOptions) ([]Railgun, error) { + v := url.Values{} + if options.Direction != "" { + v.Set("direction", options.Direction) + } + uri := api.userBaseURL("") + "/railguns" + "?" + v.Encode() + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + var r railgunsResponse + if err := json.Unmarshal(res, &r); err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// RailgunDetails returns the details for a Railgun. +// +// API reference: https://api.cloudflare.com/#railgun-railgun-details +func (api *API) RailgunDetails(railgunID string) (Railgun, error) { + uri := api.userBaseURL("") + "/railguns/" + railgunID + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return Railgun{}, errors.Wrap(err, errMakeRequestError) + } + var r railgunResponse + if err := json.Unmarshal(res, &r); err != nil { + return Railgun{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// RailgunZones returns the zones that are currently using a Railgun. +// +// API reference: https://api.cloudflare.com/#railgun-get-zones-connected-to-a-railgun +func (api *API) RailgunZones(railgunID string) ([]Zone, error) { + uri := api.userBaseURL("") + "/railguns/" + railgunID + "/zones" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + var r ZonesResponse + if err := json.Unmarshal(res, &r); err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// enableRailgun enables (true) or disables (false) a Railgun for all zones connected to it. +// +// API reference: https://api.cloudflare.com/#railgun-enable-or-disable-a-railgun +func (api *API) enableRailgun(railgunID string, enable bool) (Railgun, error) { + uri := api.userBaseURL("") + "/railguns/" + railgunID + params := struct { + Enabled bool `json:"enabled"` + }{ + Enabled: enable, + } + res, err := api.makeRequest("PATCH", uri, params) + if err != nil { + return Railgun{}, errors.Wrap(err, errMakeRequestError) + } + var r railgunResponse + if err := json.Unmarshal(res, &r); err != nil { + return Railgun{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// EnableRailgun enables a Railgun for all zones connected to it. +// +// API reference: https://api.cloudflare.com/#railgun-enable-or-disable-a-railgun +func (api *API) EnableRailgun(railgunID string) (Railgun, error) { + return api.enableRailgun(railgunID, true) +} + +// DisableRailgun enables a Railgun for all zones connected to it. +// +// API reference: https://api.cloudflare.com/#railgun-enable-or-disable-a-railgun +func (api *API) DisableRailgun(railgunID string) (Railgun, error) { + return api.enableRailgun(railgunID, false) +} + +// DeleteRailgun disables and deletes a Railgun. +// +// API reference: https://api.cloudflare.com/#railgun-delete-railgun +func (api *API) DeleteRailgun(railgunID string) error { + uri := api.userBaseURL("") + "/railguns/" + railgunID + if _, err := api.makeRequest("DELETE", uri, nil); err != nil { + return errors.Wrap(err, errMakeRequestError) + } + return nil +} + +// ZoneRailgun represents the status of a Railgun on a zone. +type ZoneRailgun struct { + ID string `json:"id"` + Name string `json:"name"` + Enabled bool `json:"enabled"` + Connected bool `json:"connected"` +} + +// zoneRailgunResponse represents the response from the Zone Railgun Details endpoint. +type zoneRailgunResponse struct { + Response + Result ZoneRailgun `json:"result"` +} + +// zoneRailgunsResponse represents the response from the Zone Railgun endpoint. +type zoneRailgunsResponse struct { + Response + Result []ZoneRailgun `json:"result"` +} + +// RailgunDiagnosis represents the test results from testing railgun connections +// to a zone. +type RailgunDiagnosis struct { + Method string `json:"method"` + HostName string `json:"host_name"` + HTTPStatus int `json:"http_status"` + Railgun string `json:"railgun"` + URL string `json:"url"` + ResponseStatus string `json:"response_status"` + Protocol string `json:"protocol"` + ElapsedTime string `json:"elapsed_time"` + BodySize string `json:"body_size"` + BodyHash string `json:"body_hash"` + MissingHeaders string `json:"missing_headers"` + ConnectionClose bool `json:"connection_close"` + Cloudflare string `json:"cloudflare"` + CFRay string `json:"cf-ray"` + // NOTE: Cloudflare's online API documentation does not yet have definitions + // for the following fields. See: https://api.cloudflare.com/#railgun-connections-for-a-zone-test-railgun-connection/ + CFWANError string `json:"cf-wan-error"` + CFCacheStatus string `json:"cf-cache-status"` +} + +// railgunDiagnosisResponse represents the response from the Test Railgun Connection enpoint. +type railgunDiagnosisResponse struct { + Response + Result RailgunDiagnosis `json:"result"` +} + +// ZoneRailguns returns the available Railguns for a zone. +// +// API reference: https://api.cloudflare.com/#railguns-for-a-zone-get-available-railguns +func (api *API) ZoneRailguns(zoneID string) ([]ZoneRailgun, error) { + uri := "/zones/" + zoneID + "/railguns" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + var r zoneRailgunsResponse + if err := json.Unmarshal(res, &r); err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// ZoneRailgunDetails returns the configuration for a given Railgun. +// +// API reference: https://api.cloudflare.com/#railguns-for-a-zone-get-railgun-details +func (api *API) ZoneRailgunDetails(zoneID, railgunID string) (ZoneRailgun, error) { + uri := "/zones/" + zoneID + "/railguns/" + railgunID + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return ZoneRailgun{}, errors.Wrap(err, errMakeRequestError) + } + var r zoneRailgunResponse + if err := json.Unmarshal(res, &r); err != nil { + return ZoneRailgun{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// TestRailgunConnection tests a Railgun connection for a given zone. +// +// API reference: https://api.cloudflare.com/#railgun-connections-for-a-zone-test-railgun-connection +func (api *API) TestRailgunConnection(zoneID, railgunID string) (RailgunDiagnosis, error) { + uri := "/zones/" + zoneID + "/railguns/" + railgunID + "/diagnose" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return RailgunDiagnosis{}, errors.Wrap(err, errMakeRequestError) + } + var r railgunDiagnosisResponse + if err := json.Unmarshal(res, &r); err != nil { + return RailgunDiagnosis{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// connectZoneRailgun connects (true) or disconnects (false) a Railgun for a given zone. +// +// API reference: https://api.cloudflare.com/#railguns-for-a-zone-connect-or-disconnect-a-railgun +func (api *API) connectZoneRailgun(zoneID, railgunID string, connect bool) (ZoneRailgun, error) { + uri := "/zones/" + zoneID + "/railguns/" + railgunID + params := struct { + Connected bool `json:"connected"` + }{ + Connected: connect, + } + res, err := api.makeRequest("PATCH", uri, params) + if err != nil { + return ZoneRailgun{}, errors.Wrap(err, errMakeRequestError) + } + var r zoneRailgunResponse + if err := json.Unmarshal(res, &r); err != nil { + return ZoneRailgun{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// ConnectZoneRailgun connects a Railgun for a given zone. +// +// API reference: https://api.cloudflare.com/#railguns-for-a-zone-connect-or-disconnect-a-railgun +func (api *API) ConnectZoneRailgun(zoneID, railgunID string) (ZoneRailgun, error) { + return api.connectZoneRailgun(zoneID, railgunID, true) +} + +// DisconnectZoneRailgun disconnects a Railgun for a given zone. +// +// API reference: https://api.cloudflare.com/#railguns-for-a-zone-connect-or-disconnect-a-railgun +func (api *API) DisconnectZoneRailgun(zoneID, railgunID string) (ZoneRailgun, error) { + return api.connectZoneRailgun(zoneID, railgunID, false) +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/rate_limiting.go b/vendor/github.com/cloudflare/cloudflare-go/rate_limiting.go new file mode 100644 index 000000000000..e3eb3e2e7bf6 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/rate_limiting.go @@ -0,0 +1,210 @@ +package cloudflare + +import ( + "encoding/json" + "net/url" + "strconv" + + "github.com/pkg/errors" +) + +// RateLimit is a policy than can be applied to limit traffic within a customer domain +type RateLimit struct { + ID string `json:"id,omitempty"` + Disabled bool `json:"disabled,omitempty"` + Description string `json:"description,omitempty"` + Match RateLimitTrafficMatcher `json:"match"` + Bypass []RateLimitKeyValue `json:"bypass,omitempty"` + Threshold int `json:"threshold"` + Period int `json:"period"` + Action RateLimitAction `json:"action"` + Correlate *RateLimitCorrelate `json:"correlate,omitempty"` +} + +// RateLimitTrafficMatcher contains the rules that will be used to apply a rate limit to traffic +type RateLimitTrafficMatcher struct { + Request RateLimitRequestMatcher `json:"request"` + Response RateLimitResponseMatcher `json:"response"` +} + +// RateLimitRequestMatcher contains the matching rules pertaining to requests +type RateLimitRequestMatcher struct { + Methods []string `json:"methods,omitempty"` + Schemes []string `json:"schemes,omitempty"` + URLPattern string `json:"url,omitempty"` +} + +// RateLimitResponseMatcher contains the matching rules pertaining to responses +type RateLimitResponseMatcher struct { + Statuses []int `json:"status,omitempty"` + OriginTraffic *bool `json:"origin_traffic,omitempty"` // api defaults to true so we need an explicit empty value + Headers []RateLimitResponseMatcherHeader `json:"headers,omitempty"` +} + +// RateLimitResponseMatcherHeader contains the structure of the origin +// HTTP headers used in request matcher checks. +type RateLimitResponseMatcherHeader struct { + Name string `json:"name"` + Op string `json:"op"` + Value string `json:"value"` +} + +// RateLimitKeyValue is k-v formatted as expected in the rate limit description +type RateLimitKeyValue struct { + Name string `json:"name"` + Value string `json:"value"` +} + +// RateLimitAction is the action that will be taken when the rate limit threshold is reached +type RateLimitAction struct { + Mode string `json:"mode"` + Timeout int `json:"timeout"` + Response *RateLimitActionResponse `json:"response"` +} + +// RateLimitActionResponse is the response that will be returned when rate limit action is triggered +type RateLimitActionResponse struct { + ContentType string `json:"content_type"` + Body string `json:"body"` +} + +// RateLimitCorrelate pertainings to NAT support +type RateLimitCorrelate struct { + By string `json:"by"` +} + +type rateLimitResponse struct { + Response + Result RateLimit `json:"result"` +} + +type rateLimitListResponse struct { + Response + Result []RateLimit `json:"result"` + ResultInfo ResultInfo `json:"result_info"` +} + +// CreateRateLimit creates a new rate limit for a zone. +// +// API reference: https://api.cloudflare.com/#rate-limits-for-a-zone-create-a-ratelimit +func (api *API) CreateRateLimit(zoneID string, limit RateLimit) (RateLimit, error) { + uri := "/zones/" + zoneID + "/rate_limits" + res, err := api.makeRequest("POST", uri, limit) + if err != nil { + return RateLimit{}, errors.Wrap(err, errMakeRequestError) + } + var r rateLimitResponse + if err := json.Unmarshal(res, &r); err != nil { + return RateLimit{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// ListRateLimits returns Rate Limits for a zone, paginated according to the provided options +// +// API reference: https://api.cloudflare.com/#rate-limits-for-a-zone-list-rate-limits +func (api *API) ListRateLimits(zoneID string, pageOpts PaginationOptions) ([]RateLimit, ResultInfo, error) { + v := url.Values{} + if pageOpts.PerPage > 0 { + v.Set("per_page", strconv.Itoa(pageOpts.PerPage)) + } + if pageOpts.Page > 0 { + v.Set("page", strconv.Itoa(pageOpts.Page)) + } + + uri := "/zones/" + zoneID + "/rate_limits" + if len(v) > 0 { + uri = uri + "?" + v.Encode() + } + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []RateLimit{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError) + } + + var r rateLimitListResponse + err = json.Unmarshal(res, &r) + if err != nil { + return []RateLimit{}, ResultInfo{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, r.ResultInfo, nil +} + +// ListAllRateLimits returns all Rate Limits for a zone. +// +// API reference: https://api.cloudflare.com/#rate-limits-for-a-zone-list-rate-limits +func (api *API) ListAllRateLimits(zoneID string) ([]RateLimit, error) { + pageOpts := PaginationOptions{ + PerPage: 100, // this is the max page size allowed + Page: 1, + } + + allRateLimits := make([]RateLimit, 0) + for { + rateLimits, resultInfo, err := api.ListRateLimits(zoneID, pageOpts) + if err != nil { + return []RateLimit{}, err + } + allRateLimits = append(allRateLimits, rateLimits...) + // total pages is not returned on this call + // if number of records is less than the max, this must be the last page + // in case TotalCount % PerPage = 0, the last request will return an empty list + if resultInfo.Count < resultInfo.PerPage { + break + } + // continue with the next page + pageOpts.Page = pageOpts.Page + 1 + } + + return allRateLimits, nil +} + +// RateLimit fetches detail about one Rate Limit for a zone. +// +// API reference: https://api.cloudflare.com/#rate-limits-for-a-zone-rate-limit-details +func (api *API) RateLimit(zoneID, limitID string) (RateLimit, error) { + uri := "/zones/" + zoneID + "/rate_limits/" + limitID + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return RateLimit{}, errors.Wrap(err, errMakeRequestError) + } + var r rateLimitResponse + err = json.Unmarshal(res, &r) + if err != nil { + return RateLimit{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// UpdateRateLimit lets you replace a Rate Limit for a zone. +// +// API reference: https://api.cloudflare.com/#rate-limits-for-a-zone-update-rate-limit +func (api *API) UpdateRateLimit(zoneID, limitID string, limit RateLimit) (RateLimit, error) { + uri := "/zones/" + zoneID + "/rate_limits/" + limitID + res, err := api.makeRequest("PUT", uri, limit) + if err != nil { + return RateLimit{}, errors.Wrap(err, errMakeRequestError) + } + var r rateLimitResponse + if err := json.Unmarshal(res, &r); err != nil { + return RateLimit{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// DeleteRateLimit deletes a Rate Limit for a zone. +// +// API reference: https://api.cloudflare.com/#rate-limits-for-a-zone-delete-rate-limit +func (api *API) DeleteRateLimit(zoneID, limitID string) error { + uri := "/zones/" + zoneID + "/rate_limits/" + limitID + res, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + var r rateLimitResponse + err = json.Unmarshal(res, &r) + if err != nil { + return errors.Wrap(err, errUnmarshalError) + } + return nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/registrar.go b/vendor/github.com/cloudflare/cloudflare-go/registrar.go new file mode 100644 index 000000000000..51eacf173a38 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/registrar.go @@ -0,0 +1,175 @@ +package cloudflare + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/pkg/errors" +) + +// RegistrarDomain is the structure of the API response for a new +// Cloudflare Registrar domain. +type RegistrarDomain struct { + ID string `json:"id"` + Available bool `json:"available"` + SupportedTLD bool `json:"supported_tld"` + CanRegister bool `json:"can_register"` + TransferIn RegistrarTransferIn `json:"transfer_in"` + CurrentRegistrar string `json:"current_registrar"` + ExpiresAt time.Time `json:"expires_at"` + RegistryStatuses string `json:"registry_statuses"` + Locked bool `json:"locked"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` + RegistrantContact RegistrantContact `json:"registrant_contact"` +} + +// RegistrarTransferIn contains the structure for a domain transfer in +// request. +type RegistrarTransferIn struct { + UnlockDomain string `json:"unlock_domain"` + DisablePrivacy string `json:"disable_privacy"` + EnterAuthCode string `json:"enter_auth_code"` + ApproveTransfer string `json:"approve_transfer"` + AcceptFoa string `json:"accept_foa"` + CanCancelTransfer bool `json:"can_cancel_transfer"` +} + +// RegistrantContact is the contact details for the domain registration. +type RegistrantContact struct { + ID string `json:"id"` + FirstName string `json:"first_name"` + LastName string `json:"last_name"` + Organization string `json:"organization"` + Address string `json:"address"` + Address2 string `json:"address2"` + City string `json:"city"` + State string `json:"state"` + Zip string `json:"zip"` + Country string `json:"country"` + Phone string `json:"phone"` + Email string `json:"email"` + Fax string `json:"fax"` +} + +// RegistrarDomainConfiguration is the structure for making updates to +// and existing domain. +type RegistrarDomainConfiguration struct { + NameServers []string `json:"name_servers"` + Privacy bool `json:"privacy"` + Locked bool `json:"locked"` + AutoRenew bool `json:"auto_renew"` +} + +// RegistrarDomainDetailResponse is the structure of the detailed +// response from the API for a single domain. +type RegistrarDomainDetailResponse struct { + Response + Result RegistrarDomain `json:"result"` +} + +// RegistrarDomainsDetailResponse is the structure of the detailed +// response from the API. +type RegistrarDomainsDetailResponse struct { + Response + Result []RegistrarDomain `json:"result"` +} + +// RegistrarDomain returns a single domain based on the account ID and +// domain name. +// +// API reference: https://api.cloudflare.com/#registrar-domains-get-domain +func (api *API) RegistrarDomain(accountID, domainName string) (RegistrarDomain, error) { + uri := fmt.Sprintf("/accounts/%s/registrar/domains/%s", accountID, domainName) + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return RegistrarDomain{}, errors.Wrap(err, errMakeRequestError) + } + + var r RegistrarDomainDetailResponse + err = json.Unmarshal(res, &r) + if err != nil { + return RegistrarDomain{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// RegistrarDomains returns all registrar domains based on the account +// ID. +// +// API reference: https://api.cloudflare.com/#registrar-domains-list-domains +func (api *API) RegistrarDomains(accountID string) ([]RegistrarDomain, error) { + uri := "/accounts/" + accountID + "/registrar/domains" + + res, err := api.makeRequest("POST", uri, nil) + if err != nil { + return []RegistrarDomain{}, errors.Wrap(err, errMakeRequestError) + } + + var r RegistrarDomainsDetailResponse + err = json.Unmarshal(res, &r) + if err != nil { + return []RegistrarDomain{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// TransferRegistrarDomain initiates the transfer from another registrar +// to Cloudflare Registrar. +// +// API reference: https://api.cloudflare.com/#registrar-domains-transfer-domain +func (api *API) TransferRegistrarDomain(accountID, domainName string) ([]RegistrarDomain, error) { + uri := fmt.Sprintf("/accounts/%s/registrar/domains/%s/transfer", accountID, domainName) + + res, err := api.makeRequest("POST", uri, nil) + if err != nil { + return []RegistrarDomain{}, errors.Wrap(err, errMakeRequestError) + } + + var r RegistrarDomainsDetailResponse + err = json.Unmarshal(res, &r) + if err != nil { + return []RegistrarDomain{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// CancelRegistrarDomainTransfer cancels a pending domain transfer. +// +// API reference: https://api.cloudflare.com/#registrar-domains-cancel-transfer +func (api *API) CancelRegistrarDomainTransfer(accountID, domainName string) ([]RegistrarDomain, error) { + uri := fmt.Sprintf("/accounts/%s/registrar/domains/%s/cancel_transfer", accountID, domainName) + + res, err := api.makeRequest("POST", uri, nil) + if err != nil { + return []RegistrarDomain{}, errors.Wrap(err, errMakeRequestError) + } + + var r RegistrarDomainsDetailResponse + err = json.Unmarshal(res, &r) + if err != nil { + return []RegistrarDomain{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// UpdateRegistrarDomain updates an existing Registrar Domain configuration. +// +// API reference: https://api.cloudflare.com/#registrar-domains-update-domain +func (api *API) UpdateRegistrarDomain(accountID, domainName string, domainConfiguration RegistrarDomainConfiguration) (RegistrarDomain, error) { + uri := fmt.Sprintf("/accounts/%s/registrar/domains/%s", accountID, domainName) + + res, err := api.makeRequest("PUT", uri, domainConfiguration) + if err != nil { + return RegistrarDomain{}, errors.Wrap(err, errMakeRequestError) + } + + var r RegistrarDomainDetailResponse + err = json.Unmarshal(res, &r) + if err != nil { + return RegistrarDomain{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/renovate.json b/vendor/github.com/cloudflare/cloudflare-go/renovate.json new file mode 100644 index 000000000000..f45d8f110c30 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/renovate.json @@ -0,0 +1,5 @@ +{ + "extends": [ + "config:base" + ] +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/spectrum.go b/vendor/github.com/cloudflare/cloudflare-go/spectrum.go new file mode 100644 index 000000000000..a95a2cd7f9f2 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/spectrum.go @@ -0,0 +1,158 @@ +package cloudflare + +import ( + "encoding/json" + "fmt" + "time" + + "github.com/pkg/errors" +) + +// SpectrumApplication defines a single Spectrum Application. +type SpectrumApplication struct { + ID string `json:"id,omitempty"` + Protocol string `json:"protocol,omitempty"` + IPv4 bool `json:"ipv4,omitempty"` + DNS SpectrumApplicationDNS `json:"dns,omitempty"` + OriginDirect []string `json:"origin_direct,omitempty"` + OriginPort int `json:"origin_port,omitempty"` + OriginDNS *SpectrumApplicationOriginDNS `json:"origin_dns,omitempty"` + IPFirewall bool `json:"ip_firewall,omitempty"` + ProxyProtocol bool `json:"proxy_protocol,omitempty"` + TLS string `json:"tls,omitempty"` + CreatedOn *time.Time `json:"created_on,omitempty"` + ModifiedOn *time.Time `json:"modified_on,omitempty"` +} + +// SpectrumApplicationDNS holds the external DNS configuration for a Spectrum +// Application. +type SpectrumApplicationDNS struct { + Type string `json:"type"` + Name string `json:"name"` +} + +// SpectrumApplicationOriginDNS holds the origin DNS configuration for a Spectrum +// Application. +type SpectrumApplicationOriginDNS struct { + Name string `json:"name"` +} + +// SpectrumApplicationDetailResponse is the structure of the detailed response +// from the API. +type SpectrumApplicationDetailResponse struct { + Response + Result SpectrumApplication `json:"result"` +} + +// SpectrumApplicationsDetailResponse is the structure of the detailed response +// from the API. +type SpectrumApplicationsDetailResponse struct { + Response + Result []SpectrumApplication `json:"result"` +} + +// SpectrumApplications fetches all of the Spectrum applications for a zone. +// +// API reference: https://developers.cloudflare.com/spectrum/api-reference/#list-spectrum-applications +func (api *API) SpectrumApplications(zoneID string) ([]SpectrumApplication, error) { + uri := "/zones/" + zoneID + "/spectrum/apps" + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []SpectrumApplication{}, errors.Wrap(err, errMakeRequestError) + } + + var spectrumApplications SpectrumApplicationsDetailResponse + err = json.Unmarshal(res, &spectrumApplications) + if err != nil { + return []SpectrumApplication{}, errors.Wrap(err, errUnmarshalError) + } + + return spectrumApplications.Result, nil +} + +// SpectrumApplication fetches a single Spectrum application based on the ID. +// +// API reference: https://developers.cloudflare.com/spectrum/api-reference/#list-spectrum-applications +func (api *API) SpectrumApplication(zoneID string, applicationID string) (SpectrumApplication, error) { + uri := fmt.Sprintf( + "/zones/%s/spectrum/apps/%s", + zoneID, + applicationID, + ) + + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return SpectrumApplication{}, errors.Wrap(err, errMakeRequestError) + } + + var spectrumApplication SpectrumApplicationDetailResponse + err = json.Unmarshal(res, &spectrumApplication) + if err != nil { + return SpectrumApplication{}, errors.Wrap(err, errUnmarshalError) + } + + return spectrumApplication.Result, nil +} + +// CreateSpectrumApplication creates a new Spectrum application. +// +// API reference: https://developers.cloudflare.com/spectrum/api-reference/#create-a-spectrum-application +func (api *API) CreateSpectrumApplication(zoneID string, appDetails SpectrumApplication) (SpectrumApplication, error) { + uri := "/zones/" + zoneID + "/spectrum/apps" + + res, err := api.makeRequest("POST", uri, appDetails) + if err != nil { + return SpectrumApplication{}, errors.Wrap(err, errMakeRequestError) + } + + var spectrumApplication SpectrumApplicationDetailResponse + err = json.Unmarshal(res, &spectrumApplication) + if err != nil { + return SpectrumApplication{}, errors.Wrap(err, errUnmarshalError) + } + + return spectrumApplication.Result, nil +} + +// UpdateSpectrumApplication updates an existing Spectrum application. +// +// API reference: https://developers.cloudflare.com/spectrum/api-reference/#update-a-spectrum-application +func (api *API) UpdateSpectrumApplication(zoneID, appID string, appDetails SpectrumApplication) (SpectrumApplication, error) { + uri := fmt.Sprintf( + "/zones/%s/spectrum/apps/%s", + zoneID, + appID, + ) + + res, err := api.makeRequest("PUT", uri, appDetails) + if err != nil { + return SpectrumApplication{}, errors.Wrap(err, errMakeRequestError) + } + + var spectrumApplication SpectrumApplicationDetailResponse + err = json.Unmarshal(res, &spectrumApplication) + if err != nil { + return SpectrumApplication{}, errors.Wrap(err, errUnmarshalError) + } + + return spectrumApplication.Result, nil +} + +// DeleteSpectrumApplication removes a Spectrum application based on the ID. +// +// API reference: https://developers.cloudflare.com/spectrum/api-reference/#delete-a-spectrum-application +func (api *API) DeleteSpectrumApplication(zoneID string, applicationID string) error { + uri := fmt.Sprintf( + "/zones/%s/spectrum/apps/%s", + zoneID, + applicationID, + ) + + _, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + + return nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/ssl.go b/vendor/github.com/cloudflare/cloudflare-go/ssl.go new file mode 100644 index 000000000000..505dfa650e43 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/ssl.go @@ -0,0 +1,157 @@ +package cloudflare + +import ( + "encoding/json" + "time" + + "github.com/pkg/errors" +) + +// ZoneCustomSSL represents custom SSL certificate metadata. +type ZoneCustomSSL struct { + ID string `json:"id"` + Hosts []string `json:"hosts"` + Issuer string `json:"issuer"` + Signature string `json:"signature"` + Status string `json:"status"` + BundleMethod string `json:"bundle_method"` + GeoRestrictions ZoneCustomSSLGeoRestrictions `json:"geo_restrictions"` + ZoneID string `json:"zone_id"` + UploadedOn time.Time `json:"uploaded_on"` + ModifiedOn time.Time `json:"modified_on"` + ExpiresOn time.Time `json:"expires_on"` + Priority int `json:"priority"` + KeylessServer KeylessSSL `json:"keyless_server"` +} + +// ZoneCustomSSLGeoRestrictions represents the parameter to create or update +// geographic restrictions on a custom ssl certificate. +type ZoneCustomSSLGeoRestrictions struct { + Label string `json:"label"` +} + +// zoneCustomSSLResponse represents the response from the zone SSL details endpoint. +type zoneCustomSSLResponse struct { + Response + Result ZoneCustomSSL `json:"result"` +} + +// zoneCustomSSLsResponse represents the response from the zone SSL list endpoint. +type zoneCustomSSLsResponse struct { + Response + Result []ZoneCustomSSL `json:"result"` +} + +// ZoneCustomSSLOptions represents the parameters to create or update an existing +// custom SSL configuration. +type ZoneCustomSSLOptions struct { + Certificate string `json:"certificate"` + PrivateKey string `json:"private_key"` + BundleMethod string `json:"bundle_method,omitempty"` + GeoRestrictions ZoneCustomSSLGeoRestrictions `json:"geo_restrictions,omitempty"` + Type string `json:"type,omitempty"` +} + +// ZoneCustomSSLPriority represents a certificate's ID and priority. It is a +// subset of ZoneCustomSSL used for patch requests. +type ZoneCustomSSLPriority struct { + ID string `json:"ID"` + Priority int `json:"priority"` +} + +// CreateSSL allows you to add a custom SSL certificate to the given zone. +// +// API reference: https://api.cloudflare.com/#custom-ssl-for-a-zone-create-ssl-configuration +func (api *API) CreateSSL(zoneID string, options ZoneCustomSSLOptions) (ZoneCustomSSL, error) { + uri := "/zones/" + zoneID + "/custom_certificates" + res, err := api.makeRequest("POST", uri, options) + if err != nil { + return ZoneCustomSSL{}, errors.Wrap(err, errMakeRequestError) + } + var r zoneCustomSSLResponse + if err := json.Unmarshal(res, &r); err != nil { + return ZoneCustomSSL{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// ListSSL lists the custom certificates for the given zone. +// +// API reference: https://api.cloudflare.com/#custom-ssl-for-a-zone-list-ssl-configurations +func (api *API) ListSSL(zoneID string) ([]ZoneCustomSSL, error) { + uri := "/zones/" + zoneID + "/custom_certificates" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + var r zoneCustomSSLsResponse + if err := json.Unmarshal(res, &r); err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// SSLDetails returns the configuration details for a custom SSL certificate. +// +// API reference: https://api.cloudflare.com/#custom-ssl-for-a-zone-ssl-configuration-details +func (api *API) SSLDetails(zoneID, certificateID string) (ZoneCustomSSL, error) { + uri := "/zones/" + zoneID + "/custom_certificates/" + certificateID + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return ZoneCustomSSL{}, errors.Wrap(err, errMakeRequestError) + } + var r zoneCustomSSLResponse + if err := json.Unmarshal(res, &r); err != nil { + return ZoneCustomSSL{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// UpdateSSL updates (replaces) a custom SSL certificate. +// +// API reference: https://api.cloudflare.com/#custom-ssl-for-a-zone-update-ssl-configuration +func (api *API) UpdateSSL(zoneID, certificateID string, options ZoneCustomSSLOptions) (ZoneCustomSSL, error) { + uri := "/zones/" + zoneID + "/custom_certificates/" + certificateID + res, err := api.makeRequest("PATCH", uri, options) + if err != nil { + return ZoneCustomSSL{}, errors.Wrap(err, errMakeRequestError) + } + var r zoneCustomSSLResponse + if err := json.Unmarshal(res, &r); err != nil { + return ZoneCustomSSL{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// ReprioritizeSSL allows you to change the priority (which is served for a given +// request) of custom SSL certificates associated with the given zone. +// +// API reference: https://api.cloudflare.com/#custom-ssl-for-a-zone-re-prioritize-ssl-certificates +func (api *API) ReprioritizeSSL(zoneID string, p []ZoneCustomSSLPriority) ([]ZoneCustomSSL, error) { + uri := "/zones/" + zoneID + "/custom_certificates/prioritize" + params := struct { + Certificates []ZoneCustomSSLPriority `json:"certificates"` + }{ + Certificates: p, + } + res, err := api.makeRequest("PUT", uri, params) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + var r zoneCustomSSLsResponse + if err := json.Unmarshal(res, &r); err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// DeleteSSL deletes a custom SSL certificate from the given zone. +// +// API reference: https://api.cloudflare.com/#custom-ssl-for-a-zone-delete-an-ssl-certificate +func (api *API) DeleteSSL(zoneID, certificateID string) error { + uri := "/zones/" + zoneID + "/custom_certificates/" + certificateID + if _, err := api.makeRequest("DELETE", uri, nil); err != nil { + return errors.Wrap(err, errMakeRequestError) + } + return nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/universal_ssl.go b/vendor/github.com/cloudflare/cloudflare-go/universal_ssl.go new file mode 100644 index 000000000000..4bf8ffde71e7 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/universal_ssl.go @@ -0,0 +1,88 @@ +package cloudflare + +import ( + "encoding/json" + + "github.com/pkg/errors" +) + +// UniversalSSLSetting represents a universal ssl setting's properties. +type UniversalSSLSetting struct { + Enabled bool `json:"enabled"` +} + +type universalSSLSettingResponse struct { + Response + Result UniversalSSLSetting `json:"result"` +} + +// UniversalSSLVerificationDetails represents a universal ssl verifcation's properties. +type UniversalSSLVerificationDetails struct { + CertificateStatus string `json:"certificate_status"` + VerificationType string `json:"verification_type"` + ValidationMethod string `json:"validation_method"` + CertPackUUID string `json:"cert_pack_uuid"` + VerificationStatus bool `json:"verification_status"` + BrandCheck bool `json:"brand_check"` + VerificationInfo UniversalSSLVerificationInfo `json:"verification_info"` +} + +// UniversalSSLVerificationInfo represents DCV record. +type UniversalSSLVerificationInfo struct { + RecordName string `json:"record_name"` + RecordTarget string `json:"record_target"` +} + +type universalSSLVerificationResponse struct { + Response + Result []UniversalSSLVerificationDetails `json:"result"` +} + +// UniversalSSLSettingDetails returns the details for a universal ssl setting +// +// API reference: https://api.cloudflare.com/#universal-ssl-settings-for-a-zone-universal-ssl-settings-details +func (api *API) UniversalSSLSettingDetails(zoneID string) (UniversalSSLSetting, error) { + uri := "/zones/" + zoneID + "/ssl/universal/settings" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return UniversalSSLSetting{}, errors.Wrap(err, errMakeRequestError) + } + var r universalSSLSettingResponse + if err := json.Unmarshal(res, &r); err != nil { + return UniversalSSLSetting{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// EditUniversalSSLSetting edits the uniersal ssl setting for a zone +// +// API reference: https://api.cloudflare.com/#universal-ssl-settings-for-a-zone-edit-universal-ssl-settings +func (api *API) EditUniversalSSLSetting(zoneID string, setting UniversalSSLSetting) (UniversalSSLSetting, error) { + uri := "/zones/" + zoneID + "/ssl/universal/settings" + res, err := api.makeRequest("PATCH", uri, setting) + if err != nil { + return UniversalSSLSetting{}, errors.Wrap(err, errMakeRequestError) + } + var r universalSSLSettingResponse + if err := json.Unmarshal(res, &r); err != nil { + return UniversalSSLSetting{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil + +} + +// UniversalSSLVerificationDetails returns the details for a universal ssl verifcation +// +// API reference: https://api.cloudflare.com/#ssl-verification-ssl-verification-details +func (api *API) UniversalSSLVerificationDetails(zoneID string) ([]UniversalSSLVerificationDetails, error) { + uri := "/zones/" + zoneID + "/ssl/verification" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []UniversalSSLVerificationDetails{}, errors.Wrap(err, errMakeRequestError) + } + var r universalSSLVerificationResponse + if err := json.Unmarshal(res, &r); err != nil { + return []UniversalSSLVerificationDetails{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/user.go b/vendor/github.com/cloudflare/cloudflare-go/user.go new file mode 100644 index 000000000000..bf2f47a57860 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/user.go @@ -0,0 +1,113 @@ +package cloudflare + +import ( + "encoding/json" + "time" + + "github.com/pkg/errors" +) + +// User describes a user account. +type User struct { + ID string `json:"id,omitempty"` + Email string `json:"email,omitempty"` + FirstName string `json:"first_name,omitempty"` + LastName string `json:"last_name,omitempty"` + Username string `json:"username,omitempty"` + Telephone string `json:"telephone,omitempty"` + Country string `json:"country,omitempty"` + Zipcode string `json:"zipcode,omitempty"` + CreatedOn *time.Time `json:"created_on,omitempty"` + ModifiedOn *time.Time `json:"modified_on,omitempty"` + APIKey string `json:"api_key,omitempty"` + TwoFA bool `json:"two_factor_authentication_enabled,omitempty"` + Betas []string `json:"betas,omitempty"` + Accounts []Account `json:"organizations,omitempty"` +} + +// UserResponse wraps a response containing User accounts. +type UserResponse struct { + Response + Result User `json:"result"` +} + +// userBillingProfileResponse wraps a response containing Billing Profile information. +type userBillingProfileResponse struct { + Response + Result UserBillingProfile +} + +// UserBillingProfile contains Billing Profile information. +type UserBillingProfile struct { + ID string `json:"id,omitempty"` + FirstName string `json:"first_name,omitempty"` + LastName string `json:"last_name,omitempty"` + Address string `json:"address,omitempty"` + Address2 string `json:"address2,omitempty"` + Company string `json:"company,omitempty"` + City string `json:"city,omitempty"` + State string `json:"state,omitempty"` + ZipCode string `json:"zipcode,omitempty"` + Country string `json:"country,omitempty"` + Telephone string `json:"telephone,omitempty"` + CardNumber string `json:"card_number,omitempty"` + CardExpiryYear int `json:"card_expiry_year,omitempty"` + CardExpiryMonth int `json:"card_expiry_month,omitempty"` + VAT string `json:"vat,omitempty"` + CreatedOn *time.Time `json:"created_on,omitempty"` + EditedOn *time.Time `json:"edited_on,omitempty"` +} + +// UserDetails provides information about the logged-in user. +// +// API reference: https://api.cloudflare.com/#user-user-details +func (api *API) UserDetails() (User, error) { + var r UserResponse + res, err := api.makeRequest("GET", "/user", nil) + if err != nil { + return User{}, errors.Wrap(err, errMakeRequestError) + } + + err = json.Unmarshal(res, &r) + if err != nil { + return User{}, errors.Wrap(err, errUnmarshalError) + } + + return r.Result, nil +} + +// UpdateUser updates the properties of the given user. +// +// API reference: https://api.cloudflare.com/#user-update-user +func (api *API) UpdateUser(user *User) (User, error) { + var r UserResponse + res, err := api.makeRequest("PATCH", "/user", user) + if err != nil { + return User{}, errors.Wrap(err, errMakeRequestError) + } + + err = json.Unmarshal(res, &r) + if err != nil { + return User{}, errors.Wrap(err, errUnmarshalError) + } + + return r.Result, nil +} + +// UserBillingProfile returns the billing profile of the user. +// +// API reference: https://api.cloudflare.com/#user-billing-profile +func (api *API) UserBillingProfile() (UserBillingProfile, error) { + var r userBillingProfileResponse + res, err := api.makeRequest("GET", "/user/billing/profile", nil) + if err != nil { + return UserBillingProfile{}, errors.Wrap(err, errMakeRequestError) + } + + err = json.Unmarshal(res, &r) + if err != nil { + return UserBillingProfile{}, errors.Wrap(err, errUnmarshalError) + } + + return r.Result, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/user_agent.go b/vendor/github.com/cloudflare/cloudflare-go/user_agent.go new file mode 100644 index 000000000000..6d75f3a1d73d --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/user_agent.go @@ -0,0 +1,149 @@ +package cloudflare + +import ( + "encoding/json" + "net/url" + "strconv" + + "github.com/pkg/errors" +) + +// UserAgentRule represents a User-Agent Block. These rules can be used to +// challenge, block or whitelist specific User-Agents for a given zone. +type UserAgentRule struct { + ID string `json:"id"` + Description string `json:"description"` + Mode string `json:"mode"` + Configuration UserAgentRuleConfig `json:"configuration"` + Paused bool `json:"paused"` +} + +// UserAgentRuleConfig represents a Zone Lockdown config, which comprises +// a Target ("ip" or "ip_range") and a Value (an IP address or IP+mask, +// respectively.) +type UserAgentRuleConfig ZoneLockdownConfig + +// UserAgentRuleResponse represents a response from the Zone Lockdown endpoint. +type UserAgentRuleResponse struct { + Result UserAgentRule `json:"result"` + Response + ResultInfo `json:"result_info"` +} + +// UserAgentRuleListResponse represents a response from the List Zone Lockdown endpoint. +type UserAgentRuleListResponse struct { + Result []UserAgentRule `json:"result"` + Response + ResultInfo `json:"result_info"` +} + +// CreateUserAgentRule creates a User-Agent Block rule for the given zone ID. +// +// API reference: https://api.cloudflare.com/#user-agent-blocking-rules-create-a-useragent-rule +func (api *API) CreateUserAgentRule(zoneID string, ld UserAgentRule) (*UserAgentRuleResponse, error) { + switch ld.Mode { + case "block", "challenge", "js_challenge", "whitelist": + break + default: + return nil, errors.New(`the User-Agent Block rule mode must be one of "block", "challenge", "js_challenge", "whitelist"`) + } + + uri := "/zones/" + zoneID + "/firewall/ua_rules" + res, err := api.makeRequest("POST", uri, ld) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &UserAgentRuleResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response, nil +} + +// UpdateUserAgentRule updates a User-Agent Block rule (based on the ID) for the given zone ID. +// +// API reference: https://api.cloudflare.com/#user-agent-blocking-rules-update-useragent-rule +func (api *API) UpdateUserAgentRule(zoneID string, id string, ld UserAgentRule) (*UserAgentRuleResponse, error) { + uri := "/zones/" + zoneID + "/firewall/ua_rules/" + id + res, err := api.makeRequest("PUT", uri, ld) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &UserAgentRuleResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response, nil +} + +// DeleteUserAgentRule deletes a User-Agent Block rule (based on the ID) for the given zone ID. +// +// API reference: https://api.cloudflare.com/#user-agent-blocking-rules-delete-useragent-rule +func (api *API) DeleteUserAgentRule(zoneID string, id string) (*UserAgentRuleResponse, error) { + uri := "/zones/" + zoneID + "/firewall/ua_rules/" + id + res, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &UserAgentRuleResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response, nil +} + +// UserAgentRule retrieves a User-Agent Block rule (based on the ID) for the given zone ID. +// +// API reference: https://api.cloudflare.com/#user-agent-blocking-rules-useragent-rule-details +func (api *API) UserAgentRule(zoneID string, id string) (*UserAgentRuleResponse, error) { + uri := "/zones/" + zoneID + "/firewall/ua_rules/" + id + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &UserAgentRuleResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response, nil +} + +// ListUserAgentRules retrieves a list of User-Agent Block rules for a given zone ID by page number. +// +// API reference: https://api.cloudflare.com/#user-agent-blocking-rules-list-useragent-rules +func (api *API) ListUserAgentRules(zoneID string, page int) (*UserAgentRuleListResponse, error) { + v := url.Values{} + if page <= 0 { + page = 1 + } + + v.Set("page", strconv.Itoa(page)) + v.Set("per_page", strconv.Itoa(100)) + query := "?" + v.Encode() + + uri := "/zones/" + zoneID + "/firewall/ua_rules" + query + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &UserAgentRuleListResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/virtualdns.go b/vendor/github.com/cloudflare/cloudflare-go/virtualdns.go new file mode 100644 index 000000000000..f8082e1f02c8 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/virtualdns.go @@ -0,0 +1,192 @@ +package cloudflare + +import ( + "encoding/json" + "net/url" + "strings" + "time" + + "github.com/pkg/errors" +) + +// VirtualDNS represents a Virtual DNS configuration. +type VirtualDNS struct { + ID string `json:"id"` + Name string `json:"name"` + OriginIPs []string `json:"origin_ips"` + VirtualDNSIPs []string `json:"virtual_dns_ips"` + MinimumCacheTTL uint `json:"minimum_cache_ttl"` + MaximumCacheTTL uint `json:"maximum_cache_ttl"` + DeprecateAnyRequests bool `json:"deprecate_any_requests"` + ModifiedOn string `json:"modified_on"` +} + +// VirtualDNSAnalyticsMetrics respresents a group of aggregated Virtual DNS metrics. +type VirtualDNSAnalyticsMetrics struct { + QueryCount *int64 `json:"queryCount"` + UncachedCount *int64 `json:"uncachedCount"` + StaleCount *int64 `json:"staleCount"` + ResponseTimeAvg *float64 `json:"responseTimeAvg"` + ResponseTimeMedian *float64 `json:"responseTimeMedian"` + ResponseTime90th *float64 `json:"responseTime90th"` + ResponseTime99th *float64 `json:"responseTime99th"` +} + +// VirtualDNSAnalytics represents a set of aggregated Virtual DNS metrics. +// TODO: Add the queried data and not only the aggregated values. +type VirtualDNSAnalytics struct { + Totals VirtualDNSAnalyticsMetrics `json:"totals"` + Min VirtualDNSAnalyticsMetrics `json:"min"` + Max VirtualDNSAnalyticsMetrics `json:"max"` +} + +// VirtualDNSUserAnalyticsOptions represents range and dimension selection on analytics endpoint +type VirtualDNSUserAnalyticsOptions struct { + Metrics []string + Since *time.Time + Until *time.Time +} + +// VirtualDNSResponse represents a Virtual DNS response. +type VirtualDNSResponse struct { + Response + Result *VirtualDNS `json:"result"` +} + +// VirtualDNSListResponse represents an array of Virtual DNS responses. +type VirtualDNSListResponse struct { + Response + Result []*VirtualDNS `json:"result"` +} + +// VirtualDNSAnalyticsResponse represents a Virtual DNS analytics response. +type VirtualDNSAnalyticsResponse struct { + Response + Result VirtualDNSAnalytics `json:"result"` +} + +// CreateVirtualDNS creates a new Virtual DNS cluster. +// +// API reference: https://api.cloudflare.com/#virtual-dns-users--create-a-virtual-dns-cluster +func (api *API) CreateVirtualDNS(v *VirtualDNS) (*VirtualDNS, error) { + res, err := api.makeRequest("POST", "/user/virtual_dns", v) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &VirtualDNSResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response.Result, nil +} + +// VirtualDNS fetches a single virtual DNS cluster. +// +// API reference: https://api.cloudflare.com/#virtual-dns-users--get-a-virtual-dns-cluster +func (api *API) VirtualDNS(virtualDNSID string) (*VirtualDNS, error) { + uri := "/user/virtual_dns/" + virtualDNSID + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &VirtualDNSResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response.Result, nil +} + +// ListVirtualDNS lists the virtual DNS clusters associated with an account. +// +// API reference: https://api.cloudflare.com/#virtual-dns-users--get-virtual-dns-clusters +func (api *API) ListVirtualDNS() ([]*VirtualDNS, error) { + res, err := api.makeRequest("GET", "/user/virtual_dns", nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &VirtualDNSListResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response.Result, nil +} + +// UpdateVirtualDNS updates a Virtual DNS cluster. +// +// API reference: https://api.cloudflare.com/#virtual-dns-users--modify-a-virtual-dns-cluster +func (api *API) UpdateVirtualDNS(virtualDNSID string, vv VirtualDNS) error { + uri := "/user/virtual_dns/" + virtualDNSID + res, err := api.makeRequest("PUT", uri, vv) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + + response := &VirtualDNSResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return errors.Wrap(err, errUnmarshalError) + } + + return nil +} + +// DeleteVirtualDNS deletes a Virtual DNS cluster. Note that this cannot be +// undone, and will stop all traffic to that cluster. +// +// API reference: https://api.cloudflare.com/#virtual-dns-users--delete-a-virtual-dns-cluster +func (api *API) DeleteVirtualDNS(virtualDNSID string) error { + uri := "/user/virtual_dns/" + virtualDNSID + res, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return errors.Wrap(err, errMakeRequestError) + } + + response := &VirtualDNSResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return errors.Wrap(err, errUnmarshalError) + } + + return nil +} + +// encode encodes non-nil fields into URL encoded form. +func (o VirtualDNSUserAnalyticsOptions) encode() string { + v := url.Values{} + if o.Since != nil { + v.Set("since", (*o.Since).UTC().Format(time.RFC3339)) + } + if o.Until != nil { + v.Set("until", (*o.Until).UTC().Format(time.RFC3339)) + } + if o.Metrics != nil { + v.Set("metrics", strings.Join(o.Metrics, ",")) + } + return v.Encode() +} + +// VirtualDNSUserAnalytics retrieves analytics report for a specified dimension and time range +func (api *API) VirtualDNSUserAnalytics(virtualDNSID string, o VirtualDNSUserAnalyticsOptions) (VirtualDNSAnalytics, error) { + uri := "/user/virtual_dns/" + virtualDNSID + "/dns_analytics/report?" + o.encode() + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return VirtualDNSAnalytics{}, errors.Wrap(err, errMakeRequestError) + } + + response := VirtualDNSAnalyticsResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return VirtualDNSAnalytics{}, errors.Wrap(err, errUnmarshalError) + } + + return response.Result, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/waf.go b/vendor/github.com/cloudflare/cloudflare-go/waf.go new file mode 100644 index 000000000000..9b67f79a7ad5 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/waf.go @@ -0,0 +1,300 @@ +package cloudflare + +import ( + "encoding/json" + + "github.com/pkg/errors" +) + +// WAFPackage represents a WAF package configuration. +type WAFPackage struct { + ID string `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + ZoneID string `json:"zone_id"` + DetectionMode string `json:"detection_mode"` + Sensitivity string `json:"sensitivity"` + ActionMode string `json:"action_mode"` +} + +// WAFPackagesResponse represents the response from the WAF packages endpoint. +type WAFPackagesResponse struct { + Response + Result []WAFPackage `json:"result"` + ResultInfo ResultInfo `json:"result_info"` +} + +// WAFPackageResponse represents the response from the WAF package endpoint. +type WAFPackageResponse struct { + Response + Result WAFPackage `json:"result"` + ResultInfo ResultInfo `json:"result_info"` +} + +// WAFPackageOptions represents options to edit a WAF package. +type WAFPackageOptions struct { + Sensitivity string `json:"sensitivity,omitempty"` + ActionMode string `json:"action_mode,omitempty"` +} + +// WAFGroup represents a WAF rule group. +type WAFGroup struct { + ID string `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + RulesCount int `json:"rules_count"` + ModifiedRulesCount int `json:"modified_rules_count"` + PackageID string `json:"package_id"` + Mode string `json:"mode"` + AllowedModes []string `json:"allowed_modes"` +} + +// WAFGroupsResponse represents the response from the WAF groups endpoint. +type WAFGroupsResponse struct { + Response + Result []WAFGroup `json:"result"` + ResultInfo ResultInfo `json:"result_info"` +} + +// WAFGroupResponse represents the response from the WAF group endpoint. +type WAFGroupResponse struct { + Response + Result WAFGroup `json:"result"` + ResultInfo ResultInfo `json:"result_info"` +} + +// WAFRule represents a WAF rule. +type WAFRule struct { + ID string `json:"id"` + Description string `json:"description"` + Priority string `json:"priority"` + PackageID string `json:"package_id"` + Group struct { + ID string `json:"id"` + Name string `json:"name"` + } `json:"group"` + Mode string `json:"mode"` + DefaultMode string `json:"default_mode"` + AllowedModes []string `json:"allowed_modes"` +} + +// WAFRulesResponse represents the response from the WAF rules endpoint. +type WAFRulesResponse struct { + Response + Result []WAFRule `json:"result"` + ResultInfo ResultInfo `json:"result_info"` +} + +// WAFRuleResponse represents the response from the WAF rule endpoint. +type WAFRuleResponse struct { + Response + Result WAFRule `json:"result"` + ResultInfo ResultInfo `json:"result_info"` +} + +// WAFRuleOptions is a subset of WAFRule, for editable options. +type WAFRuleOptions struct { + Mode string `json:"mode"` +} + +// ListWAFPackages returns a slice of the WAF packages for the given zone. +// +// API Reference: https://api.cloudflare.com/#waf-rule-packages-list-firewall-packages +func (api *API) ListWAFPackages(zoneID string) ([]WAFPackage, error) { + var p WAFPackagesResponse + var packages []WAFPackage + var res []byte + var err error + uri := "/zones/" + zoneID + "/firewall/waf/packages" + res, err = api.makeRequest("GET", uri, nil) + if err != nil { + return []WAFPackage{}, errors.Wrap(err, errMakeRequestError) + } + err = json.Unmarshal(res, &p) + if err != nil { + return []WAFPackage{}, errors.Wrap(err, errUnmarshalError) + } + if !p.Success { + // TODO: Provide an actual error message instead of always returning nil + return []WAFPackage{}, err + } + for pi := range p.Result { + packages = append(packages, p.Result[pi]) + } + return packages, nil +} + +// WAFPackage returns a WAF package for the given zone. +// +// API Reference: https://api.cloudflare.com/#waf-rule-packages-firewall-package-details +func (api *API) WAFPackage(zoneID, packageID string) (WAFPackage, error) { + uri := "/zones/" + zoneID + "/firewall/waf/packages/" + packageID + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return WAFPackage{}, errors.Wrap(err, errMakeRequestError) + } + + var r WAFPackageResponse + err = json.Unmarshal(res, &r) + if err != nil { + return WAFPackage{}, errors.Wrap(err, errUnmarshalError) + } + + return r.Result, nil +} + +// UpdateWAFPackage lets you update the a WAF Package. +// +// API Reference: https://api.cloudflare.com/#waf-rule-packages-edit-firewall-package +func (api *API) UpdateWAFPackage(zoneID, packageID string, opts WAFPackageOptions) (WAFPackage, error) { + uri := "/zones/" + zoneID + "/firewall/waf/packages/" + packageID + res, err := api.makeRequest("PATCH", uri, opts) + if err != nil { + return WAFPackage{}, errors.Wrap(err, errMakeRequestError) + } + + var r WAFPackageResponse + err = json.Unmarshal(res, &r) + if err != nil { + return WAFPackage{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// ListWAFGroups returns a slice of the WAF groups for the given WAF package. +// +// API Reference: https://api.cloudflare.com/#waf-rule-groups-list-rule-groups +func (api *API) ListWAFGroups(zoneID, packageID string) ([]WAFGroup, error) { + var groups []WAFGroup + var res []byte + var err error + + uri := "/zones/" + zoneID + "/firewall/waf/packages/" + packageID + "/groups" + res, err = api.makeRequest("GET", uri, nil) + if err != nil { + return []WAFGroup{}, errors.Wrap(err, errMakeRequestError) + } + + var r WAFGroupsResponse + err = json.Unmarshal(res, &r) + if err != nil { + return []WAFGroup{}, errors.Wrap(err, errUnmarshalError) + } + + if !r.Success { + // TODO: Provide an actual error message instead of always returning nil + return []WAFGroup{}, err + } + + for gi := range r.Result { + groups = append(groups, r.Result[gi]) + } + return groups, nil +} + +// WAFGroup returns a WAF rule group from the given WAF package. +// +// API Reference: https://api.cloudflare.com/#waf-rule-groups-rule-group-details +func (api *API) WAFGroup(zoneID, packageID, groupID string) (WAFGroup, error) { + uri := "/zones/" + zoneID + "/firewall/waf/packages/" + packageID + "/groups/" + groupID + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return WAFGroup{}, errors.Wrap(err, errMakeRequestError) + } + + var r WAFGroupResponse + err = json.Unmarshal(res, &r) + if err != nil { + return WAFGroup{}, errors.Wrap(err, errUnmarshalError) + } + + return r.Result, nil +} + +// UpdateWAFGroup lets you update the mode of a WAF Group. +// +// API Reference: https://api.cloudflare.com/#waf-rule-groups-edit-rule-group +func (api *API) UpdateWAFGroup(zoneID, packageID, groupID, mode string) (WAFGroup, error) { + opts := WAFRuleOptions{Mode: mode} + uri := "/zones/" + zoneID + "/firewall/waf/packages/" + packageID + "/groups/" + groupID + res, err := api.makeRequest("PATCH", uri, opts) + if err != nil { + return WAFGroup{}, errors.Wrap(err, errMakeRequestError) + } + + var r WAFGroupResponse + err = json.Unmarshal(res, &r) + if err != nil { + return WAFGroup{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// ListWAFRules returns a slice of the WAF rules for the given WAF package. +// +// API Reference: https://api.cloudflare.com/#waf-rules-list-rules +func (api *API) ListWAFRules(zoneID, packageID string) ([]WAFRule, error) { + var rules []WAFRule + var res []byte + var err error + + uri := "/zones/" + zoneID + "/firewall/waf/packages/" + packageID + "/rules" + res, err = api.makeRequest("GET", uri, nil) + if err != nil { + return []WAFRule{}, errors.Wrap(err, errMakeRequestError) + } + + var r WAFRulesResponse + err = json.Unmarshal(res, &r) + if err != nil { + return []WAFRule{}, errors.Wrap(err, errUnmarshalError) + } + + if !r.Success { + // TODO: Provide an actual error message instead of always returning nil + return []WAFRule{}, err + } + + for ri := range r.Result { + rules = append(rules, r.Result[ri]) + } + return rules, nil +} + +// WAFRule returns a WAF rule from the given WAF package. +// +// API Reference: https://api.cloudflare.com/#waf-rules-rule-details +func (api *API) WAFRule(zoneID, packageID, ruleID string) (WAFRule, error) { + uri := "/zones/" + zoneID + "/firewall/waf/packages/" + packageID + "/rules/" + ruleID + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return WAFRule{}, errors.Wrap(err, errMakeRequestError) + } + + var r WAFRuleResponse + err = json.Unmarshal(res, &r) + if err != nil { + return WAFRule{}, errors.Wrap(err, errUnmarshalError) + } + + return r.Result, nil +} + +// UpdateWAFRule lets you update the mode of a WAF Rule. +// +// API Reference: https://api.cloudflare.com/#waf-rules-edit-rule +func (api *API) UpdateWAFRule(zoneID, packageID, ruleID, mode string) (WAFRule, error) { + opts := WAFRuleOptions{Mode: mode} + uri := "/zones/" + zoneID + "/firewall/waf/packages/" + packageID + "/rules/" + ruleID + res, err := api.makeRequest("PATCH", uri, opts) + if err != nil { + return WAFRule{}, errors.Wrap(err, errMakeRequestError) + } + + var r WAFRuleResponse + err = json.Unmarshal(res, &r) + if err != nil { + return WAFRule{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/workers.go b/vendor/github.com/cloudflare/cloudflare-go/workers.go new file mode 100644 index 000000000000..1ab795ec4ef8 --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/workers.go @@ -0,0 +1,314 @@ +package cloudflare + +import ( + "encoding/json" + "net/http" + "time" + + "github.com/pkg/errors" +) + +// WorkerRequestParams provides parameters for worker requests for both enterprise and standard requests +type WorkerRequestParams struct { + ZoneID string + ScriptName string +} + +// WorkerRoute aka filters are patterns used to enable or disable workers that match requests. +// +// API reference: https://api.cloudflare.com/#worker-filters-properties +type WorkerRoute struct { + ID string `json:"id,omitempty"` + Pattern string `json:"pattern"` + Enabled bool `json:"enabled"` + Script string `json:"script,omitempty"` +} + +// WorkerRoutesResponse embeds Response struct and slice of WorkerRoutes +type WorkerRoutesResponse struct { + Response + Routes []WorkerRoute `json:"result"` +} + +// WorkerRouteResponse embeds Response struct and a single WorkerRoute +type WorkerRouteResponse struct { + Response + WorkerRoute `json:"result"` +} + +// WorkerScript Cloudflare Worker struct with metadata +type WorkerScript struct { + WorkerMetaData + Script string `json:"script"` +} + +// WorkerMetaData contains worker script information such as size, creation & modification dates +type WorkerMetaData struct { + ID string `json:"id,omitempty"` + ETAG string `json:"etag,omitempty"` + Size int `json:"size,omitempty"` + CreatedOn time.Time `json:"created_on,omitempty"` + ModifiedOn time.Time `json:"modified_on,omitempty"` +} + +// WorkerListResponse wrapper struct for API response to worker script list API call +type WorkerListResponse struct { + Response + WorkerList []WorkerMetaData `json:"result"` +} + +// WorkerScriptResponse wrapper struct for API response to worker script calls +type WorkerScriptResponse struct { + Response + WorkerScript `json:"result"` +} + +// DeleteWorker deletes worker for a zone. +// +// API reference: https://api.cloudflare.com/#worker-script-delete-worker +func (api *API) DeleteWorker(requestParams *WorkerRequestParams) (WorkerScriptResponse, error) { + // if ScriptName is provided we will treat as org request + if requestParams.ScriptName != "" { + return api.deleteWorkerWithName(requestParams.ScriptName) + } + uri := "/zones/" + requestParams.ZoneID + "/workers/script" + res, err := api.makeRequest("DELETE", uri, nil) + var r WorkerScriptResponse + if err != nil { + return r, errors.Wrap(err, errMakeRequestError) + } + err = json.Unmarshal(res, &r) + if err != nil { + return r, errors.Wrap(err, errUnmarshalError) + } + return r, nil +} + +// DeleteWorkerWithName deletes worker for a zone. +// This is an enterprise only feature https://developers.cloudflare.com/workers/api/config-api-for-enterprise +// account must be specified as api option https://godoc.org/github.com/cloudflare/cloudflare-go#UsingAccount +// +// API reference: https://api.cloudflare.com/#worker-script-delete-worker +func (api *API) deleteWorkerWithName(scriptName string) (WorkerScriptResponse, error) { + if api.AccountID == "" { + return WorkerScriptResponse{}, errors.New("account ID required for enterprise only request") + } + uri := "/accounts/" + api.AccountID + "/workers/scripts/" + scriptName + res, err := api.makeRequest("DELETE", uri, nil) + var r WorkerScriptResponse + if err != nil { + return r, errors.Wrap(err, errMakeRequestError) + } + err = json.Unmarshal(res, &r) + if err != nil { + return r, errors.Wrap(err, errUnmarshalError) + } + return r, nil +} + +// DownloadWorker fetch raw script content for your worker returns []byte containing worker code js +// +// API reference: https://api.cloudflare.com/#worker-script-download-worker +func (api *API) DownloadWorker(requestParams *WorkerRequestParams) (WorkerScriptResponse, error) { + if requestParams.ScriptName != "" { + return api.downloadWorkerWithName(requestParams.ScriptName) + } + uri := "/zones/" + requestParams.ZoneID + "/workers/script" + res, err := api.makeRequest("GET", uri, nil) + var r WorkerScriptResponse + if err != nil { + return r, errors.Wrap(err, errMakeRequestError) + } + r.Script = string(res) + r.Success = true + return r, nil +} + +// DownloadWorkerWithName fetch raw script content for your worker returns string containing worker code js +// This is an enterprise only feature https://developers.cloudflare.com/workers/api/config-api-for-enterprise/ +// +// API reference: https://api.cloudflare.com/#worker-script-download-worker +func (api *API) downloadWorkerWithName(scriptName string) (WorkerScriptResponse, error) { + if api.AccountID == "" { + return WorkerScriptResponse{}, errors.New("account ID required for enterprise only request") + } + uri := "/accounts/" + api.AccountID + "/workers/scripts/" + scriptName + res, err := api.makeRequest("GET", uri, nil) + var r WorkerScriptResponse + if err != nil { + return r, errors.Wrap(err, errMakeRequestError) + } + r.Script = string(res) + r.Success = true + return r, nil +} + +// ListWorkerScripts returns list of worker scripts for given account. +// +// This is an enterprise only feature https://developers.cloudflare.com/workers/api/config-api-for-enterprise +// +// API reference: https://developers.cloudflare.com/workers/api/config-api-for-enterprise/ +func (api *API) ListWorkerScripts() (WorkerListResponse, error) { + if api.AccountID == "" { + return WorkerListResponse{}, errors.New("account ID required for enterprise only request") + } + uri := "/accounts/" + api.AccountID + "/workers/scripts" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return WorkerListResponse{}, errors.Wrap(err, errMakeRequestError) + } + var r WorkerListResponse + err = json.Unmarshal(res, &r) + if err != nil { + return WorkerListResponse{}, errors.Wrap(err, errUnmarshalError) + } + return r, nil +} + +// UploadWorker push raw script content for your worker. +// +// API reference: https://api.cloudflare.com/#worker-script-upload-worker +func (api *API) UploadWorker(requestParams *WorkerRequestParams, data string) (WorkerScriptResponse, error) { + if requestParams.ScriptName != "" { + return api.uploadWorkerWithName(requestParams.ScriptName, data) + } + uri := "/zones/" + requestParams.ZoneID + "/workers/script" + headers := make(http.Header) + headers.Set("Content-Type", "application/javascript") + res, err := api.makeRequestWithHeaders("PUT", uri, []byte(data), headers) + var r WorkerScriptResponse + if err != nil { + return r, errors.Wrap(err, errMakeRequestError) + } + err = json.Unmarshal(res, &r) + if err != nil { + return r, errors.Wrap(err, errUnmarshalError) + } + return r, nil +} + +// UploadWorkerWithName push raw script content for your worker. +// +// This is an enterprise only feature https://developers.cloudflare.com/workers/api/config-api-for-enterprise/ +// +// API reference: https://api.cloudflare.com/#worker-script-upload-worker +func (api *API) uploadWorkerWithName(scriptName string, data string) (WorkerScriptResponse, error) { + if api.AccountID == "" { + return WorkerScriptResponse{}, errors.New("account ID required for enterprise only request") + } + uri := "/accounts/" + api.AccountID + "/workers/scripts/" + scriptName + headers := make(http.Header) + headers.Set("Content-Type", "application/javascript") + res, err := api.makeRequestWithHeaders("PUT", uri, []byte(data), headers) + var r WorkerScriptResponse + if err != nil { + return r, errors.Wrap(err, errMakeRequestError) + } + err = json.Unmarshal(res, &r) + if err != nil { + return r, errors.Wrap(err, errUnmarshalError) + } + return r, nil +} + +// CreateWorkerRoute creates worker route for a zone +// +// API reference: https://api.cloudflare.com/#worker-filters-create-filter +func (api *API) CreateWorkerRoute(zoneID string, route WorkerRoute) (WorkerRouteResponse, error) { + // Check whether a script name is defined in order to determine whether + // to use the single-script or multi-script endpoint. + pathComponent := "filters" + if route.Script != "" { + if api.AccountID == "" { + return WorkerRouteResponse{}, errors.New("account ID required for enterprise only request") + } + pathComponent = "routes" + } + + uri := "/zones/" + zoneID + "/workers/" + pathComponent + res, err := api.makeRequest("POST", uri, route) + if err != nil { + return WorkerRouteResponse{}, errors.Wrap(err, errMakeRequestError) + } + var r WorkerRouteResponse + err = json.Unmarshal(res, &r) + if err != nil { + return WorkerRouteResponse{}, errors.Wrap(err, errUnmarshalError) + } + return r, nil +} + +// DeleteWorkerRoute deletes worker route for a zone +// +// API reference: https://api.cloudflare.com/#worker-filters-delete-filter +func (api *API) DeleteWorkerRoute(zoneID string, routeID string) (WorkerRouteResponse, error) { + // For deleting a route, it doesn't matter whether we use the + // single-script or multi-script endpoint + uri := "/zones/" + zoneID + "/workers/filters/" + routeID + res, err := api.makeRequest("DELETE", uri, nil) + if err != nil { + return WorkerRouteResponse{}, errors.Wrap(err, errMakeRequestError) + } + var r WorkerRouteResponse + err = json.Unmarshal(res, &r) + if err != nil { + return WorkerRouteResponse{}, errors.Wrap(err, errUnmarshalError) + } + return r, nil +} + +// ListWorkerRoutes returns list of worker routes +// +// API reference: https://api.cloudflare.com/#worker-filters-list-filters +func (api *API) ListWorkerRoutes(zoneID string) (WorkerRoutesResponse, error) { + pathComponent := "filters" + if api.AccountID != "" { + pathComponent = "routes" + } + uri := "/zones/" + zoneID + "/workers/" + pathComponent + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return WorkerRoutesResponse{}, errors.Wrap(err, errMakeRequestError) + } + var r WorkerRoutesResponse + err = json.Unmarshal(res, &r) + if err != nil { + return WorkerRoutesResponse{}, errors.Wrap(err, errUnmarshalError) + } + for i := range r.Routes { + route := &r.Routes[i] + // The Enabled flag will not be set in the multi-script API response + // so we manually set it to true if the script name is not empty + // in case any multi-script customers rely on the Enabled field + if route.Script != "" { + route.Enabled = true + } + } + return r, nil +} + +// UpdateWorkerRoute updates worker route for a zone. +// +// API reference: https://api.cloudflare.com/#worker-filters-update-filter +func (api *API) UpdateWorkerRoute(zoneID string, routeID string, route WorkerRoute) (WorkerRouteResponse, error) { + // Check whether a script name is defined in order to determine whether + // to use the single-script or multi-script endpoint. + pathComponent := "filters" + if route.Script != "" { + if api.AccountID == "" { + return WorkerRouteResponse{}, errors.New("account ID required for enterprise only request") + } + pathComponent = "routes" + } + uri := "/zones/" + zoneID + "/workers/" + pathComponent + "/" + routeID + res, err := api.makeRequest("PUT", uri, route) + if err != nil { + return WorkerRouteResponse{}, errors.Wrap(err, errMakeRequestError) + } + var r WorkerRouteResponse + err = json.Unmarshal(res, &r) + if err != nil { + return WorkerRouteResponse{}, errors.Wrap(err, errUnmarshalError) + } + return r, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/workers_kv.go b/vendor/github.com/cloudflare/cloudflare-go/workers_kv.go new file mode 100644 index 000000000000..92197af0861a --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/workers_kv.go @@ -0,0 +1,192 @@ +package cloudflare + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "net/url" + + "github.com/pkg/errors" +) + +// WorkersKVNamespaceRequest provides parameters for creating and updating storage namespaces +type WorkersKVNamespaceRequest struct { + Title string `json:"title"` +} + +// WorkersKVNamespaceResponse is the response received when creating storage namespaces +type WorkersKVNamespaceResponse struct { + Response + Result WorkersKVNamespace `json:"result"` +} + +// WorkersKVNamespace contains the unique identifier and title of a storage namespace +type WorkersKVNamespace struct { + ID string `json:"id"` + Title string `json:"title"` +} + +// ListWorkersKVNamespacesResponse contains a slice of storage namespaces associated with an +// account, pagination information, and an embedded response struct +type ListWorkersKVNamespacesResponse struct { + Response + Result []WorkersKVNamespace `json:"result"` + ResultInfo `json:"result_info"` +} + +// StorageKey is a key name used to identify a storage value +type StorageKey struct { + Name string `json:"name"` +} + +// ListStorageKeysResponse contains a slice of keys belonging to a storage namespace, +// pagination information, and an embedded response struct +type ListStorageKeysResponse struct { + Response + Result []StorageKey `json:"result"` + ResultInfo `json:"result_info"` +} + +// CreateWorkersKVNamespace creates a namespace under the given title. +// A 400 is returned if the account already owns a namespace with this title. +// A namespace must be explicitly deleted to be replaced. +// +// API reference: https://api.cloudflare.com/#workers-kv-namespace-create-a-namespace +func (api *API) CreateWorkersKVNamespace(ctx context.Context, req *WorkersKVNamespaceRequest) (WorkersKVNamespaceResponse, error) { + uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces", api.AccountID) + res, err := api.makeRequestContext(ctx, http.MethodPost, uri, req) + if err != nil { + return WorkersKVNamespaceResponse{}, errors.Wrap(err, errMakeRequestError) + } + + result := WorkersKVNamespaceResponse{} + if err := json.Unmarshal(res, &result); err != nil { + return result, errors.Wrap(err, errUnmarshalError) + } + + return result, err +} + +// ListWorkersKVNamespaces lists storage namespaces +// +// API reference: https://api.cloudflare.com/#workers-kv-namespace-list-namespaces +func (api *API) ListWorkersKVNamespaces(ctx context.Context) (ListWorkersKVNamespacesResponse, error) { + uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces", api.AccountID) + res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil) + if err != nil { + return ListWorkersKVNamespacesResponse{}, errors.Wrap(err, errMakeRequestError) + } + + result := ListWorkersKVNamespacesResponse{} + if err := json.Unmarshal(res, &result); err != nil { + return result, errors.Wrap(err, errUnmarshalError) + } + + return result, err +} + +// DeleteWorkersKVNamespace deletes the namespace corresponding to the given ID +// +// API reference: https://api.cloudflare.com/#workers-kv-namespace-remove-a-namespace +func (api *API) DeleteWorkersKVNamespace(ctx context.Context, namespaceID string) (Response, error) { + uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s", api.AccountID, namespaceID) + res, err := api.makeRequestContext(ctx, http.MethodDelete, uri, nil) + if err != nil { + return Response{}, errors.Wrap(err, errMakeRequestError) + } + + result := Response{} + if err := json.Unmarshal(res, &result); err != nil { + return result, errors.Wrap(err, errUnmarshalError) + } + + return result, err +} + +// UpdateWorkersKVNamespace modifies a namespace's title +// +// API reference: https://api.cloudflare.com/#workers-kv-namespace-rename-a-namespace +func (api *API) UpdateWorkersKVNamespace(ctx context.Context, namespaceID string, req *WorkersKVNamespaceRequest) (Response, error) { + uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s", api.AccountID, namespaceID) + res, err := api.makeRequestContext(ctx, http.MethodPut, uri, req) + if err != nil { + return Response{}, errors.Wrap(err, errMakeRequestError) + } + + result := Response{} + if err := json.Unmarshal(res, &result); err != nil { + return result, errors.Wrap(err, errUnmarshalError) + } + + return result, err +} + +// WriteWorkersKV writes a value identified by a key. +// +// API reference: https://api.cloudflare.com/#workers-kv-namespace-write-key-value-pair +func (api *API) WriteWorkersKV(ctx context.Context, namespaceID, key string, value []byte) (Response, error) { + key = url.PathEscape(key) + uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s/values/%s", api.AccountID, namespaceID, key) + res, err := api.makeRequestWithAuthTypeAndHeaders( + ctx, http.MethodPut, uri, value, api.authType, http.Header{"Content-Type": []string{"application/octet-stream"}}, + ) + if err != nil { + return Response{}, errors.Wrap(err, errMakeRequestError) + } + + result := Response{} + if err := json.Unmarshal(res, &result); err != nil { + return result, errors.Wrap(err, errUnmarshalError) + } + + return result, err +} + +// ReadWorkersKV returns the value associated with the given key in the given namespace +// +// API reference: https://api.cloudflare.com/#workers-kv-namespace-read-key-value-pair +func (api API) ReadWorkersKV(ctx context.Context, namespaceID, key string) ([]byte, error) { + key = url.PathEscape(key) + uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s/values/%s", api.AccountID, namespaceID, key) + res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + return res, nil +} + +// DeleteWorkersKV deletes a key and value for a provided storage namespace +// +// API reference: https://api.cloudflare.com/#workers-kv-namespace-delete-key-value-pair +func (api API) DeleteWorkersKV(ctx context.Context, namespaceID, key string) (Response, error) { + key = url.PathEscape(key) + uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s/values/%s", api.AccountID, namespaceID, key) + res, err := api.makeRequestContext(ctx, http.MethodDelete, uri, nil) + if err != nil { + return Response{}, errors.Wrap(err, errMakeRequestError) + } + + result := Response{} + if err := json.Unmarshal(res, &result); err != nil { + return result, errors.Wrap(err, errUnmarshalError) + } + return result, err +} + +// ListWorkersKVs lists a namespace's keys +// +// API Reference: https://api.cloudflare.com/#workers-kv-namespace-list-a-namespace-s-keys +func (api API) ListWorkersKVs(ctx context.Context, namespaceID string) (ListStorageKeysResponse, error) { + uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s/keys", api.AccountID, namespaceID) + res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil) + if err != nil { + return ListStorageKeysResponse{}, errors.Wrap(err, errMakeRequestError) + } + + result := ListStorageKeysResponse{} + if err := json.Unmarshal(res, &result); err != nil { + return result, errors.Wrap(err, errUnmarshalError) + } + return result, err +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/zone.go b/vendor/github.com/cloudflare/cloudflare-go/zone.go new file mode 100644 index 000000000000..28f54a5da36d --- /dev/null +++ b/vendor/github.com/cloudflare/cloudflare-go/zone.go @@ -0,0 +1,740 @@ +package cloudflare + +import ( + "context" + "encoding/json" + "fmt" + "net/url" + "sync" + "time" + + "github.com/pkg/errors" +) + +// Owner describes the resource owner. +type Owner struct { + ID string `json:"id"` + Email string `json:"email"` + Name string `json:"name"` + OwnerType string `json:"type"` +} + +// Zone describes a Cloudflare zone. +type Zone struct { + ID string `json:"id"` + Name string `json:"name"` + // DevMode contains the time in seconds until development expires (if + // positive) or since it expired (if negative). It will be 0 if never used. + DevMode int `json:"development_mode"` + OriginalNS []string `json:"original_name_servers"` + OriginalRegistrar string `json:"original_registrar"` + OriginalDNSHost string `json:"original_dnshost"` + CreatedOn time.Time `json:"created_on"` + ModifiedOn time.Time `json:"modified_on"` + NameServers []string `json:"name_servers"` + Owner Owner `json:"owner"` + Permissions []string `json:"permissions"` + Plan ZonePlan `json:"plan"` + PlanPending ZonePlan `json:"plan_pending,omitempty"` + Status string `json:"status"` + Paused bool `json:"paused"` + Type string `json:"type"` + Host struct { + Name string + Website string + } `json:"host"` + VanityNS []string `json:"vanity_name_servers"` + Betas []string `json:"betas"` + DeactReason string `json:"deactivation_reason"` + Meta ZoneMeta `json:"meta"` + Account Account `json:"account"` +} + +// ZoneMeta describes metadata about a zone. +type ZoneMeta struct { + // custom_certificate_quota is broken - sometimes it's a string, sometimes a number! + // CustCertQuota int `json:"custom_certificate_quota"` + PageRuleQuota int `json:"page_rule_quota"` + WildcardProxiable bool `json:"wildcard_proxiable"` + PhishingDetected bool `json:"phishing_detected"` +} + +// ZonePlan contains the plan information for a zone. +type ZonePlan struct { + ZonePlanCommon + IsSubscribed bool `json:"is_subscribed"` + CanSubscribe bool `json:"can_subscribe"` + LegacyID string `json:"legacy_id"` + LegacyDiscount bool `json:"legacy_discount"` + ExternallyManaged bool `json:"externally_managed"` +} + +// ZoneRatePlan contains the plan information for a zone. +type ZoneRatePlan struct { + ZonePlanCommon + Components []zoneRatePlanComponents `json:"components,omitempty"` +} + +// ZonePlanCommon contains fields used by various Plan endpoints +type ZonePlanCommon struct { + ID string `json:"id"` + Name string `json:"name,omitempty"` + Price int `json:"price,omitempty"` + Currency string `json:"currency,omitempty"` + Frequency string `json:"frequency,omitempty"` +} + +type zoneRatePlanComponents struct { + Name string `json:"name"` + Default int `json:"Default"` + UnitPrice int `json:"unit_price"` +} + +// ZoneID contains only the zone ID. +type ZoneID struct { + ID string `json:"id"` +} + +// ZoneResponse represents the response from the Zone endpoint containing a single zone. +type ZoneResponse struct { + Response + Result Zone `json:"result"` +} + +// ZonesResponse represents the response from the Zone endpoint containing an array of zones. +type ZonesResponse struct { + Response + Result []Zone `json:"result"` + ResultInfo `json:"result_info"` +} + +// ZoneIDResponse represents the response from the Zone endpoint, containing only a zone ID. +type ZoneIDResponse struct { + Response + Result ZoneID `json:"result"` +} + +// AvailableZoneRatePlansResponse represents the response from the Available Rate Plans endpoint. +type AvailableZoneRatePlansResponse struct { + Response + Result []ZoneRatePlan `json:"result"` + ResultInfo `json:"result_info"` +} + +// AvailableZonePlansResponse represents the response from the Available Plans endpoint. +type AvailableZonePlansResponse struct { + Response + Result []ZonePlan `json:"result"` + ResultInfo +} + +// ZoneRatePlanResponse represents the response from the Plan Details endpoint. +type ZoneRatePlanResponse struct { + Response + Result ZoneRatePlan `json:"result"` +} + +// ZoneSetting contains settings for a zone. +type ZoneSetting struct { + ID string `json:"id"` + Editable bool `json:"editable"` + ModifiedOn string `json:"modified_on"` + Value interface{} `json:"value"` + TimeRemaining int `json:"time_remaining"` +} + +// ZoneSettingResponse represents the response from the Zone Setting endpoint. +type ZoneSettingResponse struct { + Response + Result []ZoneSetting `json:"result"` +} + +// ZoneSSLSetting contains ssl setting for a zone. +type ZoneSSLSetting struct { + ID string `json:"id"` + Editable bool `json:"editable"` + ModifiedOn string `json:"modified_on"` + Value string `json:"value"` + CertificateStatus string `json:"certificate_status"` +} + +// ZoneSSLSettingResponse represents the response from the Zone SSL Setting +// endpoint. +type ZoneSSLSettingResponse struct { + Response + Result ZoneSSLSetting `json:"result"` +} + +// ZoneAnalyticsData contains totals and timeseries analytics data for a zone. +type ZoneAnalyticsData struct { + Totals ZoneAnalytics `json:"totals"` + Timeseries []ZoneAnalytics `json:"timeseries"` +} + +// zoneAnalyticsDataResponse represents the response from the Zone Analytics Dashboard endpoint. +type zoneAnalyticsDataResponse struct { + Response + Result ZoneAnalyticsData `json:"result"` +} + +// ZoneAnalyticsColocation contains analytics data by datacenter. +type ZoneAnalyticsColocation struct { + ColocationID string `json:"colo_id"` + Timeseries []ZoneAnalytics `json:"timeseries"` +} + +// zoneAnalyticsColocationResponse represents the response from the Zone Analytics By Co-location endpoint. +type zoneAnalyticsColocationResponse struct { + Response + Result []ZoneAnalyticsColocation `json:"result"` +} + +// ZoneAnalytics contains analytics data for a zone. +type ZoneAnalytics struct { + Since time.Time `json:"since"` + Until time.Time `json:"until"` + Requests struct { + All int `json:"all"` + Cached int `json:"cached"` + Uncached int `json:"uncached"` + ContentType map[string]int `json:"content_type"` + Country map[string]int `json:"country"` + SSL struct { + Encrypted int `json:"encrypted"` + Unencrypted int `json:"unencrypted"` + } `json:"ssl"` + HTTPStatus map[string]int `json:"http_status"` + } `json:"requests"` + Bandwidth struct { + All int `json:"all"` + Cached int `json:"cached"` + Uncached int `json:"uncached"` + ContentType map[string]int `json:"content_type"` + Country map[string]int `json:"country"` + SSL struct { + Encrypted int `json:"encrypted"` + Unencrypted int `json:"unencrypted"` + } `json:"ssl"` + } `json:"bandwidth"` + Threats struct { + All int `json:"all"` + Country map[string]int `json:"country"` + Type map[string]int `json:"type"` + } `json:"threats"` + Pageviews struct { + All int `json:"all"` + SearchEngines map[string]int `json:"search_engines"` + } `json:"pageviews"` + Uniques struct { + All int `json:"all"` + } +} + +// ZoneAnalyticsOptions represents the optional parameters in Zone Analytics +// endpoint requests. +type ZoneAnalyticsOptions struct { + Since *time.Time + Until *time.Time + Continuous *bool +} + +// PurgeCacheRequest represents the request format made to the purge endpoint. +type PurgeCacheRequest struct { + Everything bool `json:"purge_everything,omitempty"` + // Purge by filepath (exact match). Limit of 30 + Files []string `json:"files,omitempty"` + // Purge by Tag (Enterprise only): + // https://support.cloudflare.com/hc/en-us/articles/206596608-How-to-Purge-Cache-Using-Cache-Tags-Enterprise-only- + Tags []string `json:"tags,omitempty"` + // Purge by hostname - e.g. "assets.example.com" + Hosts []string `json:"hosts,omitempty"` +} + +// PurgeCacheResponse represents the response from the purge endpoint. +type PurgeCacheResponse struct { + Response + Result struct { + ID string `json:"id"` + } `json:"result"` +} + +// newZone describes a new zone. +type newZone struct { + Name string `json:"name"` + JumpStart bool `json:"jump_start"` + Type string `json:"type"` + // We use a pointer to get a nil type when the field is empty. + // This allows us to completely omit this with json.Marshal(). + Account *Account `json:"organization,omitempty"` +} + +// FallbackOrigin describes a fallback origin +type FallbackOrigin struct { + Value string `json:"value"` + ID string `json:"id,omitempty"` +} + +// FallbackOriginResponse represents the response from the fallback_origin endpoint +type FallbackOriginResponse struct { + Response + Result FallbackOrigin `json:"result"` +} + +// CreateZone creates a zone on an account. +// +// Setting jumpstart to true will attempt to automatically scan for existing +// DNS records. Setting this to false will create the zone with no DNS records. +// +// If account is non-empty, it must have at least the ID field populated. +// This will add the new zone to the specified multi-user account. +// +// API reference: https://api.cloudflare.com/#zone-create-a-zone +func (api *API) CreateZone(name string, jumpstart bool, account Account, zoneType string) (Zone, error) { + var newzone newZone + newzone.Name = name + newzone.JumpStart = jumpstart + if account.ID != "" { + newzone.Account = &account + } + + if zoneType == "partial" { + newzone.Type = "partial" + } else { + newzone.Type = "full" + } + + res, err := api.makeRequest("POST", "/zones", newzone) + if err != nil { + return Zone{}, errors.Wrap(err, errMakeRequestError) + } + + var r ZoneResponse + err = json.Unmarshal(res, &r) + if err != nil { + return Zone{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// ZoneActivationCheck initiates another zone activation check for newly-created zones. +// +// API reference: https://api.cloudflare.com/#zone-initiate-another-zone-activation-check +func (api *API) ZoneActivationCheck(zoneID string) (Response, error) { + res, err := api.makeRequest("PUT", "/zones/"+zoneID+"/activation_check", nil) + if err != nil { + return Response{}, errors.Wrap(err, errMakeRequestError) + } + var r Response + err = json.Unmarshal(res, &r) + if err != nil { + return Response{}, errors.Wrap(err, errUnmarshalError) + } + return r, nil +} + +// ListZones lists zones on an account. Optionally takes a list of zone names +// to filter against. +// +// API reference: https://api.cloudflare.com/#zone-list-zones +func (api *API) ListZones(z ...string) ([]Zone, error) { + v := url.Values{} + var res []byte + var r ZonesResponse + var zones []Zone + var err error + if len(z) > 0 { + for _, zone := range z { + v.Set("name", zone) + res, err = api.makeRequest("GET", "/zones?"+v.Encode(), nil) + if err != nil { + return []Zone{}, errors.Wrap(err, errMakeRequestError) + } + err = json.Unmarshal(res, &r) + if err != nil { + return []Zone{}, errors.Wrap(err, errUnmarshalError) + } + if !r.Success { + // TODO: Provide an actual error message instead of always returning nil + return []Zone{}, err + } + for zi := range r.Result { + zones = append(zones, r.Result[zi]) + } + } + } else { + res, err = api.makeRequest("GET", "/zones?per_page=50", nil) + if err != nil { + return []Zone{}, errors.Wrap(err, errMakeRequestError) + } + err = json.Unmarshal(res, &r) + if err != nil { + return []Zone{}, errors.Wrap(err, errUnmarshalError) + } + + totalPageCount := r.TotalPages + var wg sync.WaitGroup + wg.Add(totalPageCount) + errc := make(chan error) + + for i := 1; i <= totalPageCount; i++ { + go func(pageNumber int) error { + res, err = api.makeRequest("GET", fmt.Sprintf("/zones?per_page=50&page=%d", pageNumber), nil) + if err != nil { + errc <- err + } + + err = json.Unmarshal(res, &r) + if err != nil { + errc <- err + } + + for _, zone := range r.Result { + zones = append(zones, zone) + } + + select { + case err := <-errc: + return err + default: + wg.Done() + } + + return nil + }(i) + } + + wg.Wait() + } + + return zones, nil +} + +// ListZonesContext lists zones on an account. Optionally takes a list of ReqOptions. +func (api *API) ListZonesContext(ctx context.Context, opts ...ReqOption) (r ZonesResponse, err error) { + var res []byte + opt := reqOption{ + params: url.Values{}, + } + for _, of := range opts { + of(&opt) + } + + res, err = api.makeRequestContext(ctx, "GET", "/zones?"+opt.params.Encode(), nil) + if err != nil { + return ZonesResponse{}, errors.Wrap(err, errMakeRequestError) + } + err = json.Unmarshal(res, &r) + if err != nil { + return ZonesResponse{}, errors.Wrap(err, errUnmarshalError) + } + + return r, nil +} + +// ZoneDetails fetches information about a zone. +// +// API reference: https://api.cloudflare.com/#zone-zone-details +func (api *API) ZoneDetails(zoneID string) (Zone, error) { + res, err := api.makeRequest("GET", "/zones/"+zoneID, nil) + if err != nil { + return Zone{}, errors.Wrap(err, errMakeRequestError) + } + var r ZoneResponse + err = json.Unmarshal(res, &r) + if err != nil { + return Zone{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// ZoneOptions is a subset of Zone, for editable options. +type ZoneOptions struct { + Paused *bool `json:"paused,omitempty"` + VanityNS []string `json:"vanity_name_servers,omitempty"` + Plan *ZonePlan `json:"plan,omitempty"` +} + +// ZoneSetPaused pauses Cloudflare service for the entire zone, sending all +// traffic direct to the origin. +func (api *API) ZoneSetPaused(zoneID string, paused bool) (Zone, error) { + zoneopts := ZoneOptions{Paused: &paused} + zone, err := api.EditZone(zoneID, zoneopts) + if err != nil { + return Zone{}, err + } + + return zone, nil +} + +// ZoneSetVanityNS sets custom nameservers for the zone. +// These names must be within the same zone. +func (api *API) ZoneSetVanityNS(zoneID string, ns []string) (Zone, error) { + zoneopts := ZoneOptions{VanityNS: ns} + zone, err := api.EditZone(zoneID, zoneopts) + if err != nil { + return Zone{}, err + } + + return zone, nil +} + +// ZoneSetPlan changes the zone plan. +func (api *API) ZoneSetPlan(zoneID string, plan ZonePlan) (Zone, error) { + zoneopts := ZoneOptions{Plan: &plan} + zone, err := api.EditZone(zoneID, zoneopts) + if err != nil { + return Zone{}, err + } + + return zone, nil +} + +// EditZone edits the given zone. +// +// This is usually called by ZoneSetPaused, ZoneSetVanityNS or ZoneSetPlan. +// +// API reference: https://api.cloudflare.com/#zone-edit-zone-properties +func (api *API) EditZone(zoneID string, zoneOpts ZoneOptions) (Zone, error) { + res, err := api.makeRequest("PATCH", "/zones/"+zoneID, zoneOpts) + if err != nil { + return Zone{}, errors.Wrap(err, errMakeRequestError) + } + var r ZoneResponse + err = json.Unmarshal(res, &r) + if err != nil { + return Zone{}, errors.Wrap(err, errUnmarshalError) + } + + return r.Result, nil +} + +// PurgeEverything purges the cache for the given zone. +// +// Note: this will substantially increase load on the origin server for that +// zone if there is a high cached vs. uncached request ratio. +// +// API reference: https://api.cloudflare.com/#zone-purge-all-files +func (api *API) PurgeEverything(zoneID string) (PurgeCacheResponse, error) { + uri := "/zones/" + zoneID + "/purge_cache" + res, err := api.makeRequest("POST", uri, PurgeCacheRequest{true, nil, nil, nil}) + if err != nil { + return PurgeCacheResponse{}, errors.Wrap(err, errMakeRequestError) + } + var r PurgeCacheResponse + err = json.Unmarshal(res, &r) + if err != nil { + return PurgeCacheResponse{}, errors.Wrap(err, errUnmarshalError) + } + return r, nil +} + +// PurgeCache purges the cache using the given PurgeCacheRequest (zone/url/tag). +// +// API reference: https://api.cloudflare.com/#zone-purge-individual-files-by-url-and-cache-tags +func (api *API) PurgeCache(zoneID string, pcr PurgeCacheRequest) (PurgeCacheResponse, error) { + uri := "/zones/" + zoneID + "/purge_cache" + res, err := api.makeRequest("POST", uri, pcr) + if err != nil { + return PurgeCacheResponse{}, errors.Wrap(err, errMakeRequestError) + } + var r PurgeCacheResponse + err = json.Unmarshal(res, &r) + if err != nil { + return PurgeCacheResponse{}, errors.Wrap(err, errUnmarshalError) + } + return r, nil +} + +// DeleteZone deletes the given zone. +// +// API reference: https://api.cloudflare.com/#zone-delete-a-zone +func (api *API) DeleteZone(zoneID string) (ZoneID, error) { + res, err := api.makeRequest("DELETE", "/zones/"+zoneID, nil) + if err != nil { + return ZoneID{}, errors.Wrap(err, errMakeRequestError) + } + var r ZoneIDResponse + err = json.Unmarshal(res, &r) + if err != nil { + return ZoneID{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// AvailableZoneRatePlans returns information about all plans available to the specified zone. +// +// API reference: https://api.cloudflare.com/#zone-plan-available-plans +func (api *API) AvailableZoneRatePlans(zoneID string) ([]ZoneRatePlan, error) { + uri := "/zones/" + zoneID + "/available_rate_plans" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []ZoneRatePlan{}, errors.Wrap(err, errMakeRequestError) + } + var r AvailableZoneRatePlansResponse + err = json.Unmarshal(res, &r) + if err != nil { + return []ZoneRatePlan{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// AvailableZonePlans returns information about all plans available to the specified zone. +// +// API reference: https://api.cloudflare.com/#zone-rate-plan-list-available-plans +func (api *API) AvailableZonePlans(zoneID string) ([]ZonePlan, error) { + uri := "/zones/" + zoneID + "/available_plans" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []ZonePlan{}, errors.Wrap(err, errMakeRequestError) + } + var r AvailableZonePlansResponse + err = json.Unmarshal(res, &r) + if err != nil { + return []ZonePlan{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// encode encodes non-nil fields into URL encoded form. +func (o ZoneAnalyticsOptions) encode() string { + v := url.Values{} + if o.Since != nil { + v.Set("since", (*o.Since).Format(time.RFC3339)) + } + if o.Until != nil { + v.Set("until", (*o.Until).Format(time.RFC3339)) + } + if o.Continuous != nil { + v.Set("continuous", fmt.Sprintf("%t", *o.Continuous)) + } + return v.Encode() +} + +// ZoneAnalyticsDashboard returns zone analytics information. +// +// API reference: https://api.cloudflare.com/#zone-analytics-dashboard +func (api *API) ZoneAnalyticsDashboard(zoneID string, options ZoneAnalyticsOptions) (ZoneAnalyticsData, error) { + uri := "/zones/" + zoneID + "/analytics/dashboard" + "?" + options.encode() + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return ZoneAnalyticsData{}, errors.Wrap(err, errMakeRequestError) + } + var r zoneAnalyticsDataResponse + err = json.Unmarshal(res, &r) + if err != nil { + return ZoneAnalyticsData{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// ZoneAnalyticsByColocation returns zone analytics information by datacenter. +// +// API reference: https://api.cloudflare.com/#zone-analytics-analytics-by-co-locations +func (api *API) ZoneAnalyticsByColocation(zoneID string, options ZoneAnalyticsOptions) ([]ZoneAnalyticsColocation, error) { + uri := "/zones/" + zoneID + "/analytics/colos" + "?" + options.encode() + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + var r zoneAnalyticsColocationResponse + err = json.Unmarshal(res, &r) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// ZoneSettings returns all of the settings for a given zone. +// +// API reference: https://api.cloudflare.com/#zone-settings-get-all-zone-settings +func (api *API) ZoneSettings(zoneID string) (*ZoneSettingResponse, error) { + uri := "/zones/" + zoneID + "/settings" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &ZoneSettingResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response, nil +} + +// UpdateZoneSettings updates the settings for a given zone. +// +// API reference: https://api.cloudflare.com/#zone-settings-edit-zone-settings-info +func (api *API) UpdateZoneSettings(zoneID string, settings []ZoneSetting) (*ZoneSettingResponse, error) { + uri := "/zones/" + zoneID + "/settings" + res, err := api.makeRequest("PATCH", uri, struct { + Items []ZoneSetting `json:"items"` + }{settings}) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &ZoneSettingResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response, nil +} + +// ZoneSSLSettings returns information about SSL setting to the specified zone. +// +// API reference: https://api.cloudflare.com/#zone-settings-get-ssl-setting +func (api *API) ZoneSSLSettings(zoneID string) (ZoneSSLSetting, error) { + uri := "/zones/" + zoneID + "/settings/ssl" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return ZoneSSLSetting{}, errors.Wrap(err, errMakeRequestError) + } + var r ZoneSSLSettingResponse + err = json.Unmarshal(res, &r) + if err != nil { + return ZoneSSLSetting{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// FallbackOrigin returns information about the fallback origin for the specified zone. +// +// API reference: https://developers.cloudflare.com/ssl/ssl-for-saas/api-calls/#fallback-origin-configuration +func (api *API) FallbackOrigin(zoneID string) (FallbackOrigin, error) { + uri := "/zones/" + zoneID + "/fallback_origin" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return FallbackOrigin{}, errors.Wrap(err, errMakeRequestError) + } + + var r FallbackOriginResponse + err = json.Unmarshal(res, &r) + if err != nil { + return FallbackOrigin{}, errors.Wrap(err, errUnmarshalError) + } + + return r.Result, nil +} + +// UpdateFallbackOrigin updates the fallback origin for a given zone. +// +// API reference: https://developers.cloudflare.com/ssl/ssl-for-saas/api-calls/#4-example-patch-to-change-fallback-origin +func (api *API) UpdateFallbackOrigin(zoneID string, fbo FallbackOrigin) (*FallbackOriginResponse, error) { + uri := "/zones/" + zoneID + "/fallback_origin" + res, err := api.makeRequest("PATCH", uri, fbo) + if err != nil { + return nil, errors.Wrap(err, errMakeRequestError) + } + + response := &FallbackOriginResponse{} + err = json.Unmarshal(res, &response) + if err != nil { + return nil, errors.Wrap(err, errUnmarshalError) + } + + return response, nil +} diff --git a/vendor/golang.org/x/time/LICENSE b/vendor/golang.org/x/time/LICENSE new file mode 100644 index 000000000000..6a66aea5eafe --- /dev/null +++ b/vendor/golang.org/x/time/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/time/PATENTS b/vendor/golang.org/x/time/PATENTS new file mode 100644 index 000000000000..733099041f84 --- /dev/null +++ b/vendor/golang.org/x/time/PATENTS @@ -0,0 +1,22 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the Go project. + +Google hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable (except as stated in this section) +patent license to make, have made, use, offer to sell, sell, import, +transfer and otherwise run, modify and propagate the contents of this +implementation of Go, where such license applies only to those patent +claims, both currently owned or controlled by Google and acquired in +the future, licensable by Google that are necessarily infringed by this +implementation of Go. This grant does not include claims that would be +infringed only as a consequence of further modification of this +implementation. If you or your agent or exclusive licensee institute or +order or agree to the institution of patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging +that this implementation of Go or any code incorporated within this +implementation of Go constitutes direct or contributory patent +infringement, or inducement of patent infringement, then any patent +rights granted to you under this License for this implementation of Go +shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/time/rate/rate.go b/vendor/golang.org/x/time/rate/rate.go new file mode 100644 index 000000000000..ae93e2471974 --- /dev/null +++ b/vendor/golang.org/x/time/rate/rate.go @@ -0,0 +1,374 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package rate provides a rate limiter. +package rate + +import ( + "context" + "fmt" + "math" + "sync" + "time" +) + +// Limit defines the maximum frequency of some events. +// Limit is represented as number of events per second. +// A zero Limit allows no events. +type Limit float64 + +// Inf is the infinite rate limit; it allows all events (even if burst is zero). +const Inf = Limit(math.MaxFloat64) + +// Every converts a minimum time interval between events to a Limit. +func Every(interval time.Duration) Limit { + if interval <= 0 { + return Inf + } + return 1 / Limit(interval.Seconds()) +} + +// A Limiter controls how frequently events are allowed to happen. +// It implements a "token bucket" of size b, initially full and refilled +// at rate r tokens per second. +// Informally, in any large enough time interval, the Limiter limits the +// rate to r tokens per second, with a maximum burst size of b events. +// As a special case, if r == Inf (the infinite rate), b is ignored. +// See https://en.wikipedia.org/wiki/Token_bucket for more about token buckets. +// +// The zero value is a valid Limiter, but it will reject all events. +// Use NewLimiter to create non-zero Limiters. +// +// Limiter has three main methods, Allow, Reserve, and Wait. +// Most callers should use Wait. +// +// Each of the three methods consumes a single token. +// They differ in their behavior when no token is available. +// If no token is available, Allow returns false. +// If no token is available, Reserve returns a reservation for a future token +// and the amount of time the caller must wait before using it. +// If no token is available, Wait blocks until one can be obtained +// or its associated context.Context is canceled. +// +// The methods AllowN, ReserveN, and WaitN consume n tokens. +type Limiter struct { + limit Limit + burst int + + mu sync.Mutex + tokens float64 + // last is the last time the limiter's tokens field was updated + last time.Time + // lastEvent is the latest time of a rate-limited event (past or future) + lastEvent time.Time +} + +// Limit returns the maximum overall event rate. +func (lim *Limiter) Limit() Limit { + lim.mu.Lock() + defer lim.mu.Unlock() + return lim.limit +} + +// Burst returns the maximum burst size. Burst is the maximum number of tokens +// that can be consumed in a single call to Allow, Reserve, or Wait, so higher +// Burst values allow more events to happen at once. +// A zero Burst allows no events, unless limit == Inf. +func (lim *Limiter) Burst() int { + return lim.burst +} + +// NewLimiter returns a new Limiter that allows events up to rate r and permits +// bursts of at most b tokens. +func NewLimiter(r Limit, b int) *Limiter { + return &Limiter{ + limit: r, + burst: b, + } +} + +// Allow is shorthand for AllowN(time.Now(), 1). +func (lim *Limiter) Allow() bool { + return lim.AllowN(time.Now(), 1) +} + +// AllowN reports whether n events may happen at time now. +// Use this method if you intend to drop / skip events that exceed the rate limit. +// Otherwise use Reserve or Wait. +func (lim *Limiter) AllowN(now time.Time, n int) bool { + return lim.reserveN(now, n, 0).ok +} + +// A Reservation holds information about events that are permitted by a Limiter to happen after a delay. +// A Reservation may be canceled, which may enable the Limiter to permit additional events. +type Reservation struct { + ok bool + lim *Limiter + tokens int + timeToAct time.Time + // This is the Limit at reservation time, it can change later. + limit Limit +} + +// OK returns whether the limiter can provide the requested number of tokens +// within the maximum wait time. If OK is false, Delay returns InfDuration, and +// Cancel does nothing. +func (r *Reservation) OK() bool { + return r.ok +} + +// Delay is shorthand for DelayFrom(time.Now()). +func (r *Reservation) Delay() time.Duration { + return r.DelayFrom(time.Now()) +} + +// InfDuration is the duration returned by Delay when a Reservation is not OK. +const InfDuration = time.Duration(1<<63 - 1) + +// DelayFrom returns the duration for which the reservation holder must wait +// before taking the reserved action. Zero duration means act immediately. +// InfDuration means the limiter cannot grant the tokens requested in this +// Reservation within the maximum wait time. +func (r *Reservation) DelayFrom(now time.Time) time.Duration { + if !r.ok { + return InfDuration + } + delay := r.timeToAct.Sub(now) + if delay < 0 { + return 0 + } + return delay +} + +// Cancel is shorthand for CancelAt(time.Now()). +func (r *Reservation) Cancel() { + r.CancelAt(time.Now()) + return +} + +// CancelAt indicates that the reservation holder will not perform the reserved action +// and reverses the effects of this Reservation on the rate limit as much as possible, +// considering that other reservations may have already been made. +func (r *Reservation) CancelAt(now time.Time) { + if !r.ok { + return + } + + r.lim.mu.Lock() + defer r.lim.mu.Unlock() + + if r.lim.limit == Inf || r.tokens == 0 || r.timeToAct.Before(now) { + return + } + + // calculate tokens to restore + // The duration between lim.lastEvent and r.timeToAct tells us how many tokens were reserved + // after r was obtained. These tokens should not be restored. + restoreTokens := float64(r.tokens) - r.limit.tokensFromDuration(r.lim.lastEvent.Sub(r.timeToAct)) + if restoreTokens <= 0 { + return + } + // advance time to now + now, _, tokens := r.lim.advance(now) + // calculate new number of tokens + tokens += restoreTokens + if burst := float64(r.lim.burst); tokens > burst { + tokens = burst + } + // update state + r.lim.last = now + r.lim.tokens = tokens + if r.timeToAct == r.lim.lastEvent { + prevEvent := r.timeToAct.Add(r.limit.durationFromTokens(float64(-r.tokens))) + if !prevEvent.Before(now) { + r.lim.lastEvent = prevEvent + } + } + + return +} + +// Reserve is shorthand for ReserveN(time.Now(), 1). +func (lim *Limiter) Reserve() *Reservation { + return lim.ReserveN(time.Now(), 1) +} + +// ReserveN returns a Reservation that indicates how long the caller must wait before n events happen. +// The Limiter takes this Reservation into account when allowing future events. +// ReserveN returns false if n exceeds the Limiter's burst size. +// Usage example: +// r := lim.ReserveN(time.Now(), 1) +// if !r.OK() { +// // Not allowed to act! Did you remember to set lim.burst to be > 0 ? +// return +// } +// time.Sleep(r.Delay()) +// Act() +// Use this method if you wish to wait and slow down in accordance with the rate limit without dropping events. +// If you need to respect a deadline or cancel the delay, use Wait instead. +// To drop or skip events exceeding rate limit, use Allow instead. +func (lim *Limiter) ReserveN(now time.Time, n int) *Reservation { + r := lim.reserveN(now, n, InfDuration) + return &r +} + +// Wait is shorthand for WaitN(ctx, 1). +func (lim *Limiter) Wait(ctx context.Context) (err error) { + return lim.WaitN(ctx, 1) +} + +// WaitN blocks until lim permits n events to happen. +// It returns an error if n exceeds the Limiter's burst size, the Context is +// canceled, or the expected wait time exceeds the Context's Deadline. +// The burst limit is ignored if the rate limit is Inf. +func (lim *Limiter) WaitN(ctx context.Context, n int) (err error) { + if n > lim.burst && lim.limit != Inf { + return fmt.Errorf("rate: Wait(n=%d) exceeds limiter's burst %d", n, lim.burst) + } + // Check if ctx is already cancelled + select { + case <-ctx.Done(): + return ctx.Err() + default: + } + // Determine wait limit + now := time.Now() + waitLimit := InfDuration + if deadline, ok := ctx.Deadline(); ok { + waitLimit = deadline.Sub(now) + } + // Reserve + r := lim.reserveN(now, n, waitLimit) + if !r.ok { + return fmt.Errorf("rate: Wait(n=%d) would exceed context deadline", n) + } + // Wait if necessary + delay := r.DelayFrom(now) + if delay == 0 { + return nil + } + t := time.NewTimer(delay) + defer t.Stop() + select { + case <-t.C: + // We can proceed. + return nil + case <-ctx.Done(): + // Context was canceled before we could proceed. Cancel the + // reservation, which may permit other events to proceed sooner. + r.Cancel() + return ctx.Err() + } +} + +// SetLimit is shorthand for SetLimitAt(time.Now(), newLimit). +func (lim *Limiter) SetLimit(newLimit Limit) { + lim.SetLimitAt(time.Now(), newLimit) +} + +// SetLimitAt sets a new Limit for the limiter. The new Limit, and Burst, may be violated +// or underutilized by those which reserved (using Reserve or Wait) but did not yet act +// before SetLimitAt was called. +func (lim *Limiter) SetLimitAt(now time.Time, newLimit Limit) { + lim.mu.Lock() + defer lim.mu.Unlock() + + now, _, tokens := lim.advance(now) + + lim.last = now + lim.tokens = tokens + lim.limit = newLimit +} + +// reserveN is a helper method for AllowN, ReserveN, and WaitN. +// maxFutureReserve specifies the maximum reservation wait duration allowed. +// reserveN returns Reservation, not *Reservation, to avoid allocation in AllowN and WaitN. +func (lim *Limiter) reserveN(now time.Time, n int, maxFutureReserve time.Duration) Reservation { + lim.mu.Lock() + + if lim.limit == Inf { + lim.mu.Unlock() + return Reservation{ + ok: true, + lim: lim, + tokens: n, + timeToAct: now, + } + } + + now, last, tokens := lim.advance(now) + + // Calculate the remaining number of tokens resulting from the request. + tokens -= float64(n) + + // Calculate the wait duration + var waitDuration time.Duration + if tokens < 0 { + waitDuration = lim.limit.durationFromTokens(-tokens) + } + + // Decide result + ok := n <= lim.burst && waitDuration <= maxFutureReserve + + // Prepare reservation + r := Reservation{ + ok: ok, + lim: lim, + limit: lim.limit, + } + if ok { + r.tokens = n + r.timeToAct = now.Add(waitDuration) + } + + // Update state + if ok { + lim.last = now + lim.tokens = tokens + lim.lastEvent = r.timeToAct + } else { + lim.last = last + } + + lim.mu.Unlock() + return r +} + +// advance calculates and returns an updated state for lim resulting from the passage of time. +// lim is not changed. +func (lim *Limiter) advance(now time.Time) (newNow time.Time, newLast time.Time, newTokens float64) { + last := lim.last + if now.Before(last) { + last = now + } + + // Avoid making delta overflow below when last is very old. + maxElapsed := lim.limit.durationFromTokens(float64(lim.burst) - lim.tokens) + elapsed := now.Sub(last) + if elapsed > maxElapsed { + elapsed = maxElapsed + } + + // Calculate the new number of tokens, due to time that passed. + delta := lim.limit.tokensFromDuration(elapsed) + tokens := lim.tokens + delta + if burst := float64(lim.burst); tokens > burst { + tokens = burst + } + + return now, last, tokens +} + +// durationFromTokens is a unit conversion function from the number of tokens to the duration +// of time it takes to accumulate them at a rate of limit tokens per second. +func (limit Limit) durationFromTokens(tokens float64) time.Duration { + seconds := tokens / float64(limit) + return time.Nanosecond * time.Duration(1e9*seconds) +} + +// tokensFromDuration is a unit conversion function from a time duration to the number of tokens +// which could be accumulated during that duration at a rate of limit tokens per second. +func (limit Limit) tokensFromDuration(d time.Duration) float64 { + return d.Seconds() * float64(limit) +} diff --git a/vendor/vendor.json b/vendor/vendor.json index 06b4a2cf4f0e..c74e962023b0 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -56,6 +56,12 @@ "revision": "165db2f241fd235aec29ba6d9b1ccd5f1c14637c", "revisionTime": "2015-01-22T07:26:53Z" }, + { + "checksumSHA1": "WILMZlCPSNbyMzYRNo/RkDcUH2M=", + "path": "github.com/cloudflare/cloudflare-go", + "revision": "a80f83b9add9d67ca4098ccbf42cd865ebb36ffb", + "revisionTime": "2019-09-16T15:18:08Z" + }, { "checksumSHA1": "dvabztWVQX8f6oMLRyv4dLH+TGY=", "path": "github.com/davecgh/go-spew/spew", @@ -844,6 +850,12 @@ "revision": "31e7599a6c37728c25ca34167be099d072ad335d", "revisionTime": "2019-04-05T05:38:27Z" }, + { + "checksumSHA1": "7Ev/X4Xe8P3961myez/hBKO05ig=", + "path": "golang.org/x/time/rate", + "revision": "9d24e82272b4f38b78bc8cff74fa936d31ccd8ef", + "revisionTime": "2019-02-15T22:48:40Z" + }, { "checksumSHA1": "CEFTYXtWmgSh+3Ik1NmDaJcz4E0=", "path": "gopkg.in/check.v1", From 62391ddbeb55d604a982e1a4ff382e2729f2d96b Mon Sep 17 00:00:00 2001 From: Lucas Hendren Date: Thu, 26 Sep 2019 04:30:33 -0400 Subject: [PATCH 37/50] tests/solidity: add contract to test every opcode (#19283) Fixes #18210 --- tests/solidity/bytecode.js | 6 + tests/solidity/contracts/Migrations.sol | 23 ++ tests/solidity/contracts/OpCodes.sol | 322 ++++++++++++++++++ .../migrations/1_initial_migration.js | 5 + .../migrations/2_opCodes_migration.js | 5 + tests/solidity/test/opCodes.js | 34 ++ tests/solidity/truffle-config.js | 108 ++++++ 7 files changed, 503 insertions(+) create mode 100644 tests/solidity/bytecode.js create mode 100644 tests/solidity/contracts/Migrations.sol create mode 100644 tests/solidity/contracts/OpCodes.sol create mode 100644 tests/solidity/migrations/1_initial_migration.js create mode 100644 tests/solidity/migrations/2_opCodes_migration.js create mode 100644 tests/solidity/test/opCodes.js create mode 100644 tests/solidity/truffle-config.js diff --git a/tests/solidity/bytecode.js b/tests/solidity/bytecode.js new file mode 100644 index 000000000000..8796aabfa32b --- /dev/null +++ b/tests/solidity/bytecode.js @@ -0,0 +1,6 @@ +{ + "linkReferences": {}, + "object": "608060405234801561001057600080fd5b5061001961007a565b604051809103906000f080158015610035573d6000803e3d6000fd5b506000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061008a565b60405161015f8061055c83390190565b6104c3806100996000396000f3fe60806040526004361061005c576000357c01000000000000000000000000000000000000000000000000000000009004806355313dea146100615780636d3d141614610078578063b9d1e5aa1461008f578063f8a8fd6d146100a6575b600080fd5b34801561006d57600080fd5b506100766100bd565b005b34801561008457600080fd5b5061008d6100bf565b005b34801561009b57600080fd5b506100a46100c4565b005b3480156100b257600080fd5b506100bb6100c6565b005b005b600080fd5bfe5b600160021a6002f35b60058110156100e3576001810190506100cf565b5060065b60058111156100fb576001810190506100e7565b5060015b6005811215610113576001810190506100ff565b5060065b600581131561012b57600181019050610117565b5060021561013857600051505b60405160208101602060048337505060405160208101602060048339505060405160208101602060048360003c50503660005b81811015610182576002815260018101905061016b565b505060008020506000602060403e6010608060106040610123612710fa506020610123600af05060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600060405180807f697353616d654164647265737328616464726573732c61646472657373290000815250601e01905060405180910390209050600033905060405182815281600482015281602482015260648101604052602081604483600088611388f1505060405182815281600482015281602482015260648101604052602081604483600088611388f250506040518281528160048201528160248201526064810160405260208160448387611388f4505060006242004290507f50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb206001026040518082815260200191505060405180910390a07f50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb206001027f50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb206001026040518082815260200191505060405180910390a13373ffffffffffffffffffffffffffffffffffffffff166001027f50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb206001027f50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb206001026040518082815260200191505060405180910390a2806001023373ffffffffffffffffffffffffffffffffffffffff166001027f50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb206001027f50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb206001026040518082815260200191505060405180910390a380600102816001023373ffffffffffffffffffffffffffffffffffffffff166001027f50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb206001027f50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb206001026040518082815260200191505060405180910390a46002fffea165627a7a723058200e51baa2b454b47fdf0ef596fa24aff8ed3a3727b7481ebd25349182ce7152a30029608060405234801561001057600080fd5b5061013f806100206000396000f3fe60806040526004361061003b576000357c010000000000000000000000000000000000000000000000000000000090048063161e715014610040575b600080fd5b34801561004c57600080fd5b506100af6004803603604081101561006357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506100c9565b604051808215151515815260200191505060405180910390f35b60008173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610108576001905061010d565b600090505b9291505056fea165627a7a72305820358f67a58c115ea636b0b8e5c4ca7a52b8192d0f3fa98a4434d6ea04596b5d0d0029", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x19 PUSH2 0x7A JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 PUSH1 0x0 CREATE DUP1 ISZERO DUP1 ISZERO PUSH2 0x35 JUMPI RETURNDATASIZE PUSH1 0x0 DUP1 RETURNDATACOPY RETURNDATASIZE PUSH1 0x0 REVERT JUMPDEST POP PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH2 0x8A JUMP JUMPDEST PUSH1 0x40 MLOAD PUSH2 0x15F DUP1 PUSH2 0x55C DUP4 CODECOPY ADD SWAP1 JUMP JUMPDEST PUSH2 0x4C3 DUP1 PUSH2 0x99 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x5C JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV DUP1 PUSH4 0x55313DEA EQ PUSH2 0x61 JUMPI DUP1 PUSH4 0x6D3D1416 EQ PUSH2 0x78 JUMPI DUP1 PUSH4 0xB9D1E5AA EQ PUSH2 0x8F JUMPI DUP1 PUSH4 0xF8A8FD6D EQ PUSH2 0xA6 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x6D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x76 PUSH2 0xBD JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x84 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x8D PUSH2 0xBF JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x9B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xA4 PUSH2 0xC4 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0xB2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xBB PUSH2 0xC6 JUMP JUMPDEST STOP JUMPDEST STOP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST INVALID JUMPDEST PUSH1 0x1 PUSH1 0x2 BYTE PUSH1 0x2 RETURN JUMPDEST PUSH1 0x5 DUP2 LT ISZERO PUSH2 0xE3 JUMPI PUSH1 0x1 DUP2 ADD SWAP1 POP PUSH2 0xCF JUMP JUMPDEST POP PUSH1 0x6 JUMPDEST PUSH1 0x5 DUP2 GT ISZERO PUSH2 0xFB JUMPI PUSH1 0x1 DUP2 ADD SWAP1 POP PUSH2 0xE7 JUMP JUMPDEST POP PUSH1 0x1 JUMPDEST PUSH1 0x5 DUP2 SLT ISZERO PUSH2 0x113 JUMPI PUSH1 0x1 DUP2 ADD SWAP1 POP PUSH2 0xFF JUMP JUMPDEST POP PUSH1 0x6 JUMPDEST PUSH1 0x5 DUP2 SGT ISZERO PUSH2 0x12B JUMPI PUSH1 0x1 DUP2 ADD SWAP1 POP PUSH2 0x117 JUMP JUMPDEST POP PUSH1 0x2 ISZERO PUSH2 0x138 JUMPI PUSH1 0x0 MLOAD POP JUMPDEST PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 ADD PUSH1 0x20 PUSH1 0x4 DUP4 CALLDATACOPY POP POP PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 ADD PUSH1 0x20 PUSH1 0x4 DUP4 CODECOPY POP POP PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 ADD PUSH1 0x20 PUSH1 0x4 DUP4 PUSH1 0x0 EXTCODECOPY POP POP CALLDATASIZE PUSH1 0x0 JUMPDEST DUP2 DUP2 LT ISZERO PUSH2 0x182 JUMPI PUSH1 0x2 DUP2 MSTORE PUSH1 0x1 DUP2 ADD SWAP1 POP PUSH2 0x16B JUMP JUMPDEST POP POP PUSH1 0x0 DUP1 KECCAK256 POP PUSH1 0x0 PUSH1 0x20 PUSH1 0x40 RETURNDATACOPY PUSH1 0x10 PUSH1 0x80 PUSH1 0x10 PUSH1 0x40 PUSH2 0x123 PUSH2 0x2710 STATICCALL POP PUSH1 0x20 PUSH2 0x123 PUSH1 0xA CREATE POP PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP1 PUSH32 0x697353616D654164647265737328616464726573732C61646472657373290000 DUP2 MSTORE POP PUSH1 0x1E ADD SWAP1 POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 KECCAK256 SWAP1 POP PUSH1 0x0 CALLER SWAP1 POP PUSH1 0x40 MLOAD DUP3 DUP2 MSTORE DUP2 PUSH1 0x4 DUP3 ADD MSTORE DUP2 PUSH1 0x24 DUP3 ADD MSTORE PUSH1 0x64 DUP2 ADD PUSH1 0x40 MSTORE PUSH1 0x20 DUP2 PUSH1 0x44 DUP4 PUSH1 0x0 DUP9 PUSH2 0x1388 CALL POP POP PUSH1 0x40 MLOAD DUP3 DUP2 MSTORE DUP2 PUSH1 0x4 DUP3 ADD MSTORE DUP2 PUSH1 0x24 DUP3 ADD MSTORE PUSH1 0x64 DUP2 ADD PUSH1 0x40 MSTORE PUSH1 0x20 DUP2 PUSH1 0x44 DUP4 PUSH1 0x0 DUP9 PUSH2 0x1388 CALLCODE POP POP PUSH1 0x40 MLOAD DUP3 DUP2 MSTORE DUP2 PUSH1 0x4 DUP3 ADD MSTORE DUP2 PUSH1 0x24 DUP3 ADD MSTORE PUSH1 0x64 DUP2 ADD PUSH1 0x40 MSTORE PUSH1 0x20 DUP2 PUSH1 0x44 DUP4 DUP8 PUSH2 0x1388 DELEGATECALL POP POP PUSH1 0x0 PUSH3 0x420042 SWAP1 POP PUSH32 0x50CB9FE53DAA9737B786AB3646F04D0150DC50EF4E75F59509D83667AD5ADB20 PUSH1 0x1 MUL PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG0 PUSH32 0x50CB9FE53DAA9737B786AB3646F04D0150DC50EF4E75F59509D83667AD5ADB20 PUSH1 0x1 MUL PUSH32 0x50CB9FE53DAA9737B786AB3646F04D0150DC50EF4E75F59509D83667AD5ADB20 PUSH1 0x1 MUL PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG1 CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 MUL PUSH32 0x50CB9FE53DAA9737B786AB3646F04D0150DC50EF4E75F59509D83667AD5ADB20 PUSH1 0x1 MUL PUSH32 0x50CB9FE53DAA9737B786AB3646F04D0150DC50EF4E75F59509D83667AD5ADB20 PUSH1 0x1 MUL PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 DUP1 PUSH1 0x1 MUL CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 MUL PUSH32 0x50CB9FE53DAA9737B786AB3646F04D0150DC50EF4E75F59509D83667AD5ADB20 PUSH1 0x1 MUL PUSH32 0x50CB9FE53DAA9737B786AB3646F04D0150DC50EF4E75F59509D83667AD5ADB20 PUSH1 0x1 MUL PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 DUP1 PUSH1 0x1 MUL DUP2 PUSH1 0x1 MUL CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH1 0x1 MUL PUSH32 0x50CB9FE53DAA9737B786AB3646F04D0150DC50EF4E75F59509D83667AD5ADB20 PUSH1 0x1 MUL PUSH32 0x50CB9FE53DAA9737B786AB3646F04D0150DC50EF4E75F59509D83667AD5ADB20 PUSH1 0x1 MUL PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG4 PUSH1 0x2 SELFDESTRUCT INVALID LOG1 PUSH6 0x627A7A723058 KECCAK256 0xe MLOAD 0xba LOG2 0xb4 SLOAD 0xb4 PUSH32 0xDF0EF596FA24AFF8ED3A3727B7481EBD25349182CE7152A30029608060405234 DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x13F DUP1 PUSH2 0x20 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0x3B JUMPI PUSH1 0x0 CALLDATALOAD PUSH29 0x100000000000000000000000000000000000000000000000000000000 SWAP1 DIV DUP1 PUSH4 0x161E7150 EQ PUSH2 0x40 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0xAF PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x40 DUP2 LT ISZERO PUSH2 0x63 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0xC9 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ ISZERO PUSH2 0x108 JUMPI PUSH1 0x1 SWAP1 POP PUSH2 0x10D JUMP JUMPDEST PUSH1 0x0 SWAP1 POP JUMPDEST SWAP3 SWAP2 POP POP JUMP INVALID LOG1 PUSH6 0x627A7A723058 KECCAK256 CALLDATALOAD DUP16 PUSH8 0xA58C115EA636B0B8 0xe5 0xc4 0xca PUSH27 0x52B8192D0F3FA98A4434D6EA04596B5D0D00290000000000000000 ", + "sourceMap": "221:8828:0:-;;;263:110;8:9:-1;5:2;;;30:1;27;20:12;5:2;263:110:0;324:11;;:::i;:::-;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;324:11:0;316:5;;:19;;;;;;;;;;;;;;;;;;221:8828;;;;;;;;;;;;:::o;:::-;;;;;;;" +} diff --git a/tests/solidity/contracts/Migrations.sol b/tests/solidity/contracts/Migrations.sol new file mode 100644 index 000000000000..c378ffb02841 --- /dev/null +++ b/tests/solidity/contracts/Migrations.sol @@ -0,0 +1,23 @@ +pragma solidity >=0.4.21 <0.6.0; + +contract Migrations { + address public owner; + uint public last_completed_migration; + + constructor() public { + owner = msg.sender; + } + + modifier restricted() { + if (msg.sender == owner) _; + } + + function setCompleted(uint completed) public restricted { + last_completed_migration = completed; + } + + function upgrade(address new_address) public restricted { + Migrations upgraded = Migrations(new_address); + upgraded.setCompleted(last_completed_migration); + } +} diff --git a/tests/solidity/contracts/OpCodes.sol b/tests/solidity/contracts/OpCodes.sol new file mode 100644 index 000000000000..9e3a0ebb0202 --- /dev/null +++ b/tests/solidity/contracts/OpCodes.sol @@ -0,0 +1,322 @@ +pragma solidity >=0.4.21 <0.6.0; + +contract Test1 { + function isSameAddress(address a, address b) public returns(bool){ //Simply add the two arguments and return + if (a == b) return true; + return false; + } +} + +contract OpCodes { + + Test1 test1; + + constructor() public { //Constructor function + test1 = new Test1(); //Create new "Test1" function + } + + modifier onlyOwner(address _owner) { + require(msg.sender == _owner); + _; + } + // Add a todo to the list + function test() public { + + //simple_instructions + /*assembly { pop(sub(dup1, mul(dup1, dup1))) }*/ + + //keywords + assembly { pop(address) return(2, byte(2,1)) } + + //label_complex + /*assembly { 7 abc: 8 eq jump(abc) jumpi(eq(7, 8), abc) pop } + assembly { pop(jumpi(eq(7, 8), abc)) jump(abc) }*/ + + //functional + /*assembly { let x := 2 add(7, mul(6, x)) mul(7, 8) add =: x }*/ + + //for_statement + assembly { for { let i := 1 } lt(i, 5) { i := add(i, 1) } {} } + assembly { for { let i := 6 } gt(i, 5) { i := add(i, 1) } {} } + assembly { for { let i := 1 } slt(i, 5) { i := add(i, 1) } {} } + assembly { for { let i := 6 } sgt(i, 5) { i := add(i, 1) } {} } + + //no_opcodes_in_strict + assembly { pop(callvalue()) } + + //no_dup_swap_in_strict + /*assembly { swap1() }*/ + + //print_functional + assembly { let x := mul(sload(0x12), 7) } + + //print_if + assembly { if 2 { pop(mload(0)) }} + + //function_definitions_multiple_args + assembly { function f(a, d){ mstore(a, d) } function g(a, d) -> x, y {}} + + //sstore + assembly { function f(a, d){ sstore(a, d) } function g(a, d) -> x, y {}} + + //mstore8 + assembly { function f(a, d){ mstore8(a, d) } function g(a, d) -> x, y {}} + + //calldatacopy + assembly { + let a := mload(0x40) + let b := add(a, 32) + calldatacopy(a, 4, 32) + /*calldatacopy(b, add(4, 32), 32)*/ + /*result := add(mload(a), mload(b))*/ + } + + //codecopy + assembly { + let a := mload(0x40) + let b := add(a, 32) + codecopy(a, 4, 32) + } + + //codecopy + assembly { + let a := mload(0x40) + let b := add(a, 32) + extcodecopy(0, a, 4, 32) + } + + //for_statement + assembly { let x := calldatasize() for { let i := 0} lt(i, x) { i := add(i, 1) } { mstore(i, 2) } } + + //keccak256 + assembly { pop(keccak256(0,0)) } + + //returndatasize + assembly { let r := returndatasize } + + //returndatacopy + assembly { returndatacopy(64, 32, 0) } + //byzantium vs const Constantinople + //staticcall + assembly { pop(staticcall(10000, 0x123, 64, 0x10, 128, 0x10)) } + + /*//create2 Constantinople + assembly { pop(create2(10, 0x123, 32, 64)) }*/ + + //create Constantinople + assembly { pop(create(10, 0x123, 32)) } + + //shift Constantinople + /*assembly { pop(shl(10, 32)) } + assembly { pop(shr(10, 32)) } + assembly { pop(sar(10, 32)) }*/ + + + //not + assembly { pop( not(0x1f)) } + + //exp + assembly { pop( exp(2, 226)) } + + //mod + assembly { pop( mod(3, 9)) } + + //smod + assembly { pop( smod(3, 9)) } + + //div + assembly { pop( div(4, 2)) } + + //sdiv + assembly { pop( sdiv(4, 2)) } + + //iszero + assembly { pop(iszero(1)) } + + //and + assembly { pop(and(2,3)) } + + //or + assembly { pop(or(3,3)) } + + //xor + assembly { pop(xor(3,3)) } + + //addmod + assembly { pop(addmod(3,3,6)) } + + //mulmod + assembly { pop(mulmod(3,3,3)) } + + //signextend + assembly { pop(signextend(1, 10)) } + + //sha3 + assembly { pop(calldataload(0)) } + + //blockhash + assembly { pop(blockhash(sub(number(), 1))) } + + //balance + assembly { pop(balance(0x0)) } + + //caller + assembly { pop(caller()) } + + //codesize + assembly { pop(codesize()) } + + //extcodesize + assembly { pop(extcodesize(0x1)) } + + //origin + assembly { pop(origin()) } + + //gas + assembly { pop(gas())} + + //msize + assembly { pop(msize())} + + //pc + assembly { pop(pc())} + + //gasprice + assembly { pop(gasprice())} + + //coinbase + assembly { pop(coinbase())} + + //timestamp + assembly { pop(timestamp())} + + //number + assembly { pop(number())} + + //difficulty + assembly { pop(difficulty())} + + //gaslimit + assembly { pop(gaslimit())} + + //call + address contractAddr = address(test1); + bytes4 sig = bytes4(keccak256("isSameAddress(address,address)")); //Function signature + address a = msg.sender; + + assembly { + let x := mload(0x40) //Find empty storage location using "free memory pointer" + mstore(x,sig) //Place signature at begining of empty storage + mstore(add(x,0x04),a) // first address parameter. just after signature + mstore(add(x,0x24),a) // 2nd address parameter - first padded. add 32 bytes (not 20 bytes) + mstore(0x40,add(x,0x64)) // this is missing in other examples. Set free pointer before function call. so it is used by called function. + // new free pointer position after the output values of the called function. + + let success := call( + 5000, //5k gas + contractAddr, //To addr + 0, //No wei passed + x, // Inputs are at location x + 0x44, //Inputs size two padded, so 68 bytes + x, //Store output over input + 0x20) //Output is 32 bytes long + } + + //callcode + assembly { + let x := mload(0x40) //Find empty storage location using "free memory pointer" + mstore(x,sig) //Place signature at begining of empty storage + mstore(add(x,0x04),a) // first address parameter. just after signature + mstore(add(x,0x24),a) // 2nd address parameter - first padded. add 32 bytes (not 20 bytes) + mstore(0x40,add(x,0x64)) // this is missing in other examples. Set free pointer before function call. so it is used by called function. + // new free pointer position after the output values of the called function. + + let success := callcode( + 5000, //5k gas + contractAddr, //To addr + 0, //No wei passed + x, // Inputs are at location x + 0x44, //Inputs size two padded, so 68 bytes + x, //Store output over input + 0x20) //Output is 32 bytes long + } + + //delegatecall + assembly { + let x := mload(0x40) //Find empty storage location using "free memory pointer" + mstore(x,sig) //Place signature at begining of empty storage + mstore(add(x,0x04),a) // first address parameter. just after signature + mstore(add(x,0x24),a) // 2nd address parameter - first padded. add 32 bytes (not 20 bytes) + mstore(0x40,add(x,0x64)) // this is missing in other examples. Set free pointer before function call. so it is used by called function. + // new free pointer position after the output values of the called function. + + let success := delegatecall( + 5000, //5k gas + contractAddr, //To addr + x, // Inputs are at location x + 0x44, //Inputs size two padded, so 68 bytes + x, //Store output over input + 0x20) //Output is 32 bytes long + } + + uint256 _id = 0x420042; + + //log0 + log0( + bytes32(0x50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb20) + ); + + //log1 + log1( + bytes32(0x50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb20), + bytes32(0x50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb20) + ); + + //log2 + log2( + bytes32(0x50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb20), + bytes32(0x50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb20), + bytes32(uint256(msg.sender)) + ); + + //log3 + log3( + bytes32(0x50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb20), + bytes32(0x50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb20), + bytes32(uint256(msg.sender)), + bytes32(_id) + ); + + //log4 + log4( + bytes32(0x50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb20), + bytes32(0x50cb9fe53daa9737b786ab3646f04d0150dc50ef4e75f59509d83667ad5adb20), + bytes32(uint256(msg.sender)), + bytes32(_id), + bytes32(_id) + + ); + + //selfdestruct + assembly { selfdestruct(0x02) } + } + + function test_revert() public { + + //revert + assembly{ revert(0, 0) } + } + + function test_invalid() public { + + //revert + assembly{ invalid() } + } + + function test_stop() public { + + //revert + assembly{ stop() } + } + +} diff --git a/tests/solidity/migrations/1_initial_migration.js b/tests/solidity/migrations/1_initial_migration.js new file mode 100644 index 000000000000..ee2135d2952e --- /dev/null +++ b/tests/solidity/migrations/1_initial_migration.js @@ -0,0 +1,5 @@ +const Migrations = artifacts.require("Migrations"); + +module.exports = function(deployer) { + deployer.deploy(Migrations); +}; diff --git a/tests/solidity/migrations/2_opCodes_migration.js b/tests/solidity/migrations/2_opCodes_migration.js new file mode 100644 index 000000000000..65c6b6dc1434 --- /dev/null +++ b/tests/solidity/migrations/2_opCodes_migration.js @@ -0,0 +1,5 @@ +var OpCodes = artifacts.require("./OpCodes.sol"); + +module.exports = function(deployer) { + deployer.deploy(OpCodes); +}; diff --git a/tests/solidity/test/opCodes.js b/tests/solidity/test/opCodes.js new file mode 100644 index 000000000000..80abacef251f --- /dev/null +++ b/tests/solidity/test/opCodes.js @@ -0,0 +1,34 @@ +const TodoList = artifacts.require('./OpCodes.sol') +const assert = require('assert') +let contractInstance +const Web3 = require('web3'); +const web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545')); +// const web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:9545')); + +contract('OpCodes', (accounts) => { + beforeEach(async () => { + contractInstance = await TodoList.deployed() + }) + it('Should run without errors the majorit of opcodes', async () => { + await contractInstance.test() + await contractInstance.test_stop() + + }) + + it('Should throw invalid op code', async () => { + try{ + await contractInstance.test_invalid() + } + catch(error) { + console.error(error); + } + }) + + it('Should revert', async () => { + try{ + await contractInstance.test_revert() } + catch(error) { + console.error(error); + } + }) +}) diff --git a/tests/solidity/truffle-config.js b/tests/solidity/truffle-config.js new file mode 100644 index 000000000000..c06d8316ff8a --- /dev/null +++ b/tests/solidity/truffle-config.js @@ -0,0 +1,108 @@ +/** + * Use this file to configure your truffle project. It's seeded with some + * common settings for different networks and features like migrations, + * compilation and testing. Uncomment the ones you need or modify + * them to suit your project as necessary. + * + * More information about configuration can be found at: + * + * truffleframework.com/docs/advanced/configuration + * + * To deploy via Infura you'll need a wallet provider (like truffle-hdwallet-provider) + * to sign your transactions before they're sent to a remote public node. Infura API + * keys are available for free at: infura.io/register + * + * You'll also need a mnemonic - the twelve word phrase the wallet uses to generate + * public/private key pairs. If you're publishing your code to GitHub make sure you load this + * phrase from a file you've .gitignored so it doesn't accidentally become public. + * + */ + +// const HDWalletProvider = require('truffle-hdwallet-provider'); +// const infuraKey = "fj4jll3k....."; +// +// const fs = require('fs'); +// const mnemonic = fs.readFileSync(".secret").toString().trim(); + +// module.exports = { +// /** +// * Networks define how you connect to your ethereum client and let you set the +// * defaults web3 uses to send transactions. If you don't specify one truffle +// * will spin up a development blockchain for you on port 9545 when you +// * run `develop` or `test`. You can ask a truffle command to use a specific +// * network from the command line, e.g +// * +// * $ truffle test --network +// */ +// +// networks: { +// // Useful for testing. The `development` name is special - truffle uses it by default +// // if it's defined here and no other network is specified at the command line. +// // You should run a client (like ganache-cli, geth or parity) in a separate terminal +// // tab if you use this network and you must also set the `host`, `port` and `network_id` +// // options below to some value. +// // +// // development: { +// // host: "127.0.0.1", // Localhost (default: none) +// // port: 8545, // Standard Ethereum port (default: none) +// // network_id: "*", // Any network (default: none) +// // }, +// +// // Another network with more advanced options... +// // advanced: { +// // port: 8777, // Custom port +// // network_id: 1342, // Custom network +// // gas: 8500000, // Gas sent with each transaction (default: ~6700000) +// // gasPrice: 20000000000, // 20 gwei (in wei) (default: 100 gwei) +// // from:
, // Account to send txs from (default: accounts[0]) +// // websockets: true // Enable EventEmitter interface for web3 (default: false) +// // }, +// +// // Useful for deploying to a public network. +// // NB: It's important to wrap the provider as a function. +// // ropsten: { +// // provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/${infuraKey}`), +// // network_id: 3, // Ropsten's id +// // gas: 5500000, // Ropsten has a lower block limit than mainnet +// // confirmations: 2, // # of confs to wait between deployments. (default: 0) +// // timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50) +// // skipDryRun: true // Skip dry run before migrations? (default: false for public nets ) +// // }, +// +// // Useful for private networks +// // private: { +// // provider: () => new HDWalletProvider(mnemonic, `https://network.io`), +// // network_id: 2111, // This network is yours, in the cloud. +// // production: true // Treats this network as if it was a public net. (default: false) +// // } +// }, +// +// // Set default mocha options here, use special reporters etc. +// mocha: { +// // timeout: 100000 +// }, +// +// // Configure your compilers +// compilers: { +// solc: { +// // version: "0.5.1", // Fetch exact version from solc-bin (default: truffle's version) +// // docker: true, // Use "0.5.1" you've installed locally with docker (default: false) +// // settings: { // See the solidity docs for advice about optimization and evmVersion +// // optimizer: { +// // enabled: false, +// // runs: 200 +// // }, +// // evmVersion: "byzantium" +// // } +// } +// } +// } +module.exports = { + networks: { + development: { + host: 'localhost', + port: 8545, + network_id: '*' + } + } +} From ad03d9801c40565dd2014d7bc0f0f4a779dcfece Mon Sep 17 00:00:00 2001 From: Ryan Schneider Date: Thu, 26 Sep 2019 01:47:31 -0700 Subject: [PATCH 38/50] internal/ethapi: support block number or hash on state-related methods (#19491) This change adds support for EIP-1898. --- core/blockchain.go | 5 + core/headerchain.go | 4 + eth/api_backend.go | 59 +++++++++ graphql/graphql.go | 248 +++++++++++++++---------------------- internal/ethapi/api.go | 42 ++++--- internal/ethapi/backend.go | 3 + les/api_backend.go | 57 +++++++++ light/lightchain.go | 5 + rpc/types.go | 93 ++++++++++++++ rpc/types_test.go | 58 +++++++++ 10 files changed, 408 insertions(+), 166 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 1bf31b2399d1..2665f73215ba 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -2139,6 +2139,11 @@ func (bc *BlockChain) HasHeader(hash common.Hash, number uint64) bool { return bc.hc.HasHeader(hash, number) } +// GetCanonicalHash returns the canonical hash for a given block number +func (bc *BlockChain) GetCanonicalHash(number uint64) common.Hash { + return bc.hc.GetCanonicalHash(number) +} + // GetBlockHashesFromHash retrieves a number of block hashes starting at a given // hash, fetching towards the genesis block. func (bc *BlockChain) GetBlockHashesFromHash(hash common.Hash, max uint64) []common.Hash { diff --git a/core/headerchain.go b/core/headerchain.go index a2faa3303ae0..4682069cff0c 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -448,6 +448,10 @@ func (hc *HeaderChain) GetHeaderByNumber(number uint64) *types.Header { return hc.GetHeader(hash, number) } +func (hc *HeaderChain) GetCanonicalHash(number uint64) common.Hash { + return rawdb.ReadCanonicalHash(hc.chainDb, number) +} + // CurrentHeader retrieves the current head header of the canonical chain. The // header is retrieved from the HeaderChain's internal cache. func (hc *HeaderChain) CurrentHeader() *types.Header { diff --git a/eth/api_backend.go b/eth/api_backend.go index 69904a70f25d..4b74ccff519d 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -72,6 +72,23 @@ func (b *EthAPIBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumb return b.eth.blockchain.GetHeaderByNumber(uint64(number)), nil } +func (b *EthAPIBackend) HeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Header, error) { + if blockNr, ok := blockNrOrHash.Number(); ok { + return b.HeaderByNumber(ctx, blockNr) + } + if hash, ok := blockNrOrHash.Hash(); ok { + header := b.eth.blockchain.GetHeaderByHash(hash) + if header == nil { + return nil, errors.New("header for hash not found") + } + if blockNrOrHash.RequireCanonical && b.eth.blockchain.GetCanonicalHash(header.Number.Uint64()) != hash { + return nil, errors.New("hash is not currently canonical") + } + return header, nil + } + return nil, errors.New("invalid arguments; neither block nor hash specified") +} + func (b *EthAPIBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) { return b.eth.blockchain.GetHeaderByHash(hash), nil } @@ -93,6 +110,27 @@ func (b *EthAPIBackend) BlockByHash(ctx context.Context, hash common.Hash) (*typ return b.eth.blockchain.GetBlockByHash(hash), nil } +func (b *EthAPIBackend) BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Block, error) { + if blockNr, ok := blockNrOrHash.Number(); ok { + return b.BlockByNumber(ctx, blockNr) + } + if hash, ok := blockNrOrHash.Hash(); ok { + header := b.eth.blockchain.GetHeaderByHash(hash) + if header == nil { + return nil, errors.New("header for hash not found") + } + if blockNrOrHash.RequireCanonical && b.eth.blockchain.GetCanonicalHash(header.Number.Uint64()) != hash { + return nil, errors.New("hash is not currently canonical") + } + block := b.eth.blockchain.GetBlock(hash, header.Number.Uint64()) + if block == nil { + return nil, errors.New("header found, but block body is missing") + } + return block, nil + } + return nil, errors.New("invalid arguments; neither block nor hash specified") +} + func (b *EthAPIBackend) StateAndHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*state.StateDB, *types.Header, error) { // Pending state is only known by the miner if number == rpc.PendingBlockNumber { @@ -111,6 +149,27 @@ func (b *EthAPIBackend) StateAndHeaderByNumber(ctx context.Context, number rpc.B return stateDb, header, err } +func (b *EthAPIBackend) StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *types.Header, error) { + if blockNr, ok := blockNrOrHash.Number(); ok { + return b.StateAndHeaderByNumber(ctx, blockNr) + } + if hash, ok := blockNrOrHash.Hash(); ok { + header, err := b.HeaderByHash(ctx, hash) + if err != nil { + return nil, nil, err + } + if header == nil { + return nil, nil, errors.New("header for hash not found") + } + if blockNrOrHash.RequireCanonical && b.eth.blockchain.GetCanonicalHash(header.Number.Uint64()) != hash { + return nil, nil, errors.New("hash is not currently canonical") + } + stateDb, err := b.eth.BlockChain().StateAt(header.Root) + return stateDb, header, err + } + return nil, nil, errors.New("invalid arguments; neither block nor hash specified") +} + func (b *EthAPIBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) { return b.eth.blockchain.GetReceiptsByHash(hash), nil } diff --git a/graphql/graphql.go b/graphql/graphql.go index df279f42b110..ddd928dff12c 100644 --- a/graphql/graphql.go +++ b/graphql/graphql.go @@ -36,20 +36,19 @@ import ( ) var ( - errOnlyOnMainChain = errors.New("this operation is only available for blocks on the canonical chain") - errBlockInvariant = errors.New("block objects must be instantiated with at least one of num or hash") + errBlockInvariant = errors.New("block objects must be instantiated with at least one of num or hash") ) // Account represents an Ethereum account at a particular block. type Account struct { - backend ethapi.Backend - address common.Address - blockNumber rpc.BlockNumber + backend ethapi.Backend + address common.Address + blockNrOrHash rpc.BlockNumberOrHash } // getState fetches the StateDB object for an account. func (a *Account) getState(ctx context.Context) (*state.StateDB, error) { - state, _, err := a.backend.StateAndHeaderByNumber(ctx, a.blockNumber) + state, _, err := a.backend.StateAndHeaderByNumberOrHash(ctx, a.blockNrOrHash) return state, err } @@ -102,9 +101,9 @@ func (l *Log) Transaction(ctx context.Context) *Transaction { func (l *Log) Account(ctx context.Context, args BlockNumberArgs) *Account { return &Account{ - backend: l.backend, - address: l.log.Address, - blockNumber: args.Number(), + backend: l.backend, + address: l.log.Address, + blockNrOrHash: args.NumberOrLatest(), } } @@ -136,10 +135,10 @@ func (t *Transaction) resolve(ctx context.Context) (*types.Transaction, error) { tx, blockHash, _, index := rawdb.ReadTransaction(t.backend.ChainDb(), t.hash) if tx != nil { t.tx = tx + blockNrOrHash := rpc.BlockNumberOrHashWithHash(blockHash, false) t.block = &Block{ - backend: t.backend, - hash: blockHash, - canonical: unknown, + backend: t.backend, + numberOrHash: &blockNrOrHash, } t.index = index } else { @@ -203,9 +202,9 @@ func (t *Transaction) To(ctx context.Context, args BlockNumberArgs) (*Account, e return nil, nil } return &Account{ - backend: t.backend, - address: *to, - blockNumber: args.Number(), + backend: t.backend, + address: *to, + blockNrOrHash: args.NumberOrLatest(), }, nil } @@ -221,9 +220,9 @@ func (t *Transaction) From(ctx context.Context, args BlockNumberArgs) (*Account, from, _ := types.Sender(signer, tx) return &Account{ - backend: t.backend, - address: from, - blockNumber: args.Number(), + backend: t.backend, + address: from, + blockNrOrHash: args.NumberOrLatest(), }, nil } @@ -293,9 +292,9 @@ func (t *Transaction) CreatedContract(ctx context.Context, args BlockNumberArgs) return nil, err } return &Account{ - backend: t.backend, - address: receipt.ContractAddress, - blockNumber: args.Number(), + backend: t.backend, + address: receipt.ContractAddress, + blockNrOrHash: args.NumberOrLatest(), }, nil } @@ -317,45 +316,16 @@ func (t *Transaction) Logs(ctx context.Context) (*[]*Log, error) { type BlockType int -const ( - unknown BlockType = iota - isCanonical - notCanonical -) - // Block represents an Ethereum block. -// backend, and either num or hash are mandatory. All other fields are lazily fetched +// backend, and numberOrHash are mandatory. All other fields are lazily fetched // when required. type Block struct { - backend ethapi.Backend - num *rpc.BlockNumber - hash common.Hash - header *types.Header - block *types.Block - receipts []*types.Receipt - canonical BlockType // Indicates if this block is on the main chain or not. -} - -func (b *Block) onMainChain(ctx context.Context) error { - if b.canonical == unknown { - header, err := b.resolveHeader(ctx) - if err != nil { - return err - } - canonHeader, err := b.backend.HeaderByNumber(ctx, rpc.BlockNumber(header.Number.Uint64())) - if err != nil { - return err - } - if header.Hash() == canonHeader.Hash() { - b.canonical = isCanonical - } else { - b.canonical = notCanonical - } - } - if b.canonical != isCanonical { - return errOnlyOnMainChain - } - return nil + backend ethapi.Backend + numberOrHash *rpc.BlockNumberOrHash + hash common.Hash + header *types.Header + block *types.Block + receipts []*types.Receipt } // resolve returns the internal Block object representing this block, fetching @@ -364,14 +334,17 @@ func (b *Block) resolve(ctx context.Context) (*types.Block, error) { if b.block != nil { return b.block, nil } - var err error - if b.hash != (common.Hash{}) { - b.block, err = b.backend.BlockByHash(ctx, b.hash) - } else { - b.block, err = b.backend.BlockByNumber(ctx, *b.num) + if b.numberOrHash == nil { + latest := rpc.BlockNumberOrHashWithNumber(rpc.LatestBlockNumber) + b.numberOrHash = &latest } + var err error + b.block, err = b.backend.BlockByNumberOrHash(ctx, *b.numberOrHash) if b.block != nil && b.header == nil { b.header = b.block.Header() + if hash, ok := b.numberOrHash.Hash(); ok { + b.hash = hash + } } return b.block, err } @@ -380,7 +353,7 @@ func (b *Block) resolve(ctx context.Context) (*types.Block, error) { // if necessary. Call this function instead of `resolve` unless you need the // additional data (transactions and uncles). func (b *Block) resolveHeader(ctx context.Context) (*types.Header, error) { - if b.num == nil && b.hash == (common.Hash{}) { + if b.numberOrHash == nil && b.hash == (common.Hash{}) { return nil, errBlockInvariant } var err error @@ -388,7 +361,7 @@ func (b *Block) resolveHeader(ctx context.Context) (*types.Header, error) { if b.hash != (common.Hash{}) { b.header, err = b.backend.HeaderByHash(ctx, b.hash) } else { - b.header, err = b.backend.HeaderByNumber(ctx, *b.num) + b.header, err = b.backend.HeaderByNumberOrHash(ctx, *b.numberOrHash) } } return b.header, err @@ -416,15 +389,12 @@ func (b *Block) resolveReceipts(ctx context.Context) ([]*types.Receipt, error) { } func (b *Block) Number(ctx context.Context) (hexutil.Uint64, error) { - if b.num == nil || *b.num == rpc.LatestBlockNumber { - header, err := b.resolveHeader(ctx) - if err != nil { - return 0, err - } - num := rpc.BlockNumber(header.Number.Uint64()) - b.num = &num + header, err := b.resolveHeader(ctx) + if err != nil { + return 0, err } - return hexutil.Uint64(*b.num), nil + + return hexutil.Uint64(header.Number.Uint64()), nil } func (b *Block) Hash(ctx context.Context) (common.Hash, error) { @@ -456,26 +426,17 @@ func (b *Block) GasUsed(ctx context.Context) (hexutil.Uint64, error) { func (b *Block) Parent(ctx context.Context) (*Block, error) { // If the block header hasn't been fetched, and we'll need it, fetch it. - if b.num == nil && b.hash != (common.Hash{}) && b.header == nil { + if b.numberOrHash == nil && b.header == nil { if _, err := b.resolveHeader(ctx); err != nil { return nil, err } } if b.header != nil && b.header.Number.Uint64() > 0 { - num := rpc.BlockNumber(b.header.Number.Uint64() - 1) + num := rpc.BlockNumberOrHashWithNumber(rpc.BlockNumber(b.header.Number.Uint64() - 1)) return &Block{ - backend: b.backend, - num: &num, - hash: b.header.ParentHash, - canonical: unknown, - }, nil - } - if b.num != nil && *b.num != 0 { - num := *b.num - 1 - return &Block{ - backend: b.backend, - num: &num, - canonical: isCanonical, + backend: b.backend, + numberOrHash: &num, + hash: b.header.ParentHash, }, nil } return nil, nil @@ -561,13 +522,11 @@ func (b *Block) Ommers(ctx context.Context) (*[]*Block, error) { } ret := make([]*Block, 0, len(block.Uncles())) for _, uncle := range block.Uncles() { - blockNumber := rpc.BlockNumber(uncle.Number.Uint64()) + blockNumberOrHash := rpc.BlockNumberOrHashWithHash(uncle.Hash(), false) ret = append(ret, &Block{ - backend: b.backend, - num: &blockNumber, - hash: uncle.Hash(), - header: uncle, - canonical: notCanonical, + backend: b.backend, + numberOrHash: &blockNumberOrHash, + header: uncle, }) } return &ret, nil @@ -603,16 +562,26 @@ func (b *Block) TotalDifficulty(ctx context.Context) (hexutil.Big, error) { // BlockNumberArgs encapsulates arguments to accessors that specify a block number. type BlockNumberArgs struct { + // TODO: Ideally we could use input unions to allow the query to specify the + // block parameter by hash, block number, or tag but input unions aren't part of the + // standard GraphQL schema SDL yet, see: https://github.com/graphql/graphql-spec/issues/488 Block *hexutil.Uint64 } -// Number returns the provided block number, or rpc.LatestBlockNumber if none +// NumberOr returns the provided block number argument, or the "current" block number or hash if none // was provided. -func (a BlockNumberArgs) Number() rpc.BlockNumber { +func (a BlockNumberArgs) NumberOr(current rpc.BlockNumberOrHash) rpc.BlockNumberOrHash { if a.Block != nil { - return rpc.BlockNumber(*a.Block) + blockNr := rpc.BlockNumber(*a.Block) + return rpc.BlockNumberOrHashWithNumber(blockNr) } - return rpc.LatestBlockNumber + return current +} + +// NumberOrLatest returns the provided block number argument, or the "latest" block number if none +// was provided. +func (a BlockNumberArgs) NumberOrLatest() rpc.BlockNumberOrHash { + return a.NumberOr(rpc.BlockNumberOrHashWithNumber(rpc.LatestBlockNumber)) } func (b *Block) Miner(ctx context.Context, args BlockNumberArgs) (*Account, error) { @@ -621,9 +590,9 @@ func (b *Block) Miner(ctx context.Context, args BlockNumberArgs) (*Account, erro return nil, err } return &Account{ - backend: b.backend, - address: header.Coinbase, - blockNumber: args.Number(), + backend: b.backend, + address: header.Coinbase, + blockNrOrHash: args.NumberOrLatest(), }, nil } @@ -683,13 +652,11 @@ func (b *Block) OmmerAt(ctx context.Context, args struct{ Index int32 }) (*Block return nil, nil } uncle := uncles[args.Index] - blockNumber := rpc.BlockNumber(uncle.Number.Uint64()) + blockNumberOrHash := rpc.BlockNumberOrHashWithHash(uncle.Hash(), false) return &Block{ - backend: b.backend, - num: &blockNumber, - hash: uncle.Hash(), - header: uncle, - canonical: notCanonical, + backend: b.backend, + numberOrHash: &blockNumberOrHash, + header: uncle, }, nil } @@ -757,20 +724,16 @@ func (b *Block) Logs(ctx context.Context, args struct{ Filter BlockFilterCriteri func (b *Block) Account(ctx context.Context, args struct { Address common.Address }) (*Account, error) { - err := b.onMainChain(ctx) - if err != nil { - return nil, err - } - if b.num == nil { + if b.numberOrHash == nil { _, err := b.resolveHeader(ctx) if err != nil { return nil, err } } return &Account{ - backend: b.backend, - address: args.Address, - blockNumber: *b.num, + backend: b.backend, + address: args.Address, + blockNrOrHash: *b.numberOrHash, }, nil } @@ -807,17 +770,13 @@ func (c *CallResult) Status() hexutil.Uint64 { func (b *Block) Call(ctx context.Context, args struct { Data ethapi.CallArgs }) (*CallResult, error) { - err := b.onMainChain(ctx) - if err != nil { - return nil, err - } - if b.num == nil { - _, err := b.resolveHeader(ctx) + if b.numberOrHash == nil { + _, err := b.resolve(ctx) if err != nil { return nil, err } } - result, gas, failed, err := ethapi.DoCall(ctx, b.backend, args.Data, *b.num, nil, vm.Config{}, 5*time.Second, b.backend.RPCGasCap()) + result, gas, failed, err := ethapi.DoCall(ctx, b.backend, args.Data, *b.numberOrHash, nil, vm.Config{}, 5*time.Second, b.backend.RPCGasCap()) status := hexutil.Uint64(1) if failed { status = 0 @@ -832,17 +791,13 @@ func (b *Block) Call(ctx context.Context, args struct { func (b *Block) EstimateGas(ctx context.Context, args struct { Data ethapi.CallArgs }) (hexutil.Uint64, error) { - err := b.onMainChain(ctx) - if err != nil { - return hexutil.Uint64(0), err - } - if b.num == nil { + if b.numberOrHash == nil { _, err := b.resolveHeader(ctx) if err != nil { return hexutil.Uint64(0), err } } - gas, err := ethapi.DoEstimateGas(ctx, b.backend, args.Data, *b.num, b.backend.RPCGasCap()) + gas, err := ethapi.DoEstimateGas(ctx, b.backend, args.Data, *b.numberOrHash, b.backend.RPCGasCap()) return gas, err } @@ -875,17 +830,19 @@ func (p *Pending) Transactions(ctx context.Context) (*[]*Transaction, error) { func (p *Pending) Account(ctx context.Context, args struct { Address common.Address }) *Account { + pendingBlockNr := rpc.BlockNumberOrHashWithNumber(rpc.PendingBlockNumber) return &Account{ - backend: p.backend, - address: args.Address, - blockNumber: rpc.PendingBlockNumber, + backend: p.backend, + address: args.Address, + blockNrOrHash: pendingBlockNr, } } func (p *Pending) Call(ctx context.Context, args struct { Data ethapi.CallArgs }) (*CallResult, error) { - result, gas, failed, err := ethapi.DoCall(ctx, p.backend, args.Data, rpc.PendingBlockNumber, nil, vm.Config{}, 5*time.Second, p.backend.RPCGasCap()) + pendingBlockNr := rpc.BlockNumberOrHashWithNumber(rpc.PendingBlockNumber) + result, gas, failed, err := ethapi.DoCall(ctx, p.backend, args.Data, pendingBlockNr, nil, vm.Config{}, 5*time.Second, p.backend.RPCGasCap()) status := hexutil.Uint64(1) if failed { status = 0 @@ -900,7 +857,8 @@ func (p *Pending) Call(ctx context.Context, args struct { func (p *Pending) EstimateGas(ctx context.Context, args struct { Data ethapi.CallArgs }) (hexutil.Uint64, error) { - return ethapi.DoEstimateGas(ctx, p.backend, args.Data, rpc.PendingBlockNumber, p.backend.RPCGasCap()) + pendingBlockNr := rpc.BlockNumberOrHashWithNumber(rpc.PendingBlockNumber) + return ethapi.DoEstimateGas(ctx, p.backend, args.Data, pendingBlockNr, p.backend.RPCGasCap()) } // Resolver is the top-level object in the GraphQL hierarchy. @@ -914,24 +872,23 @@ func (r *Resolver) Block(ctx context.Context, args struct { }) (*Block, error) { var block *Block if args.Number != nil { - num := rpc.BlockNumber(uint64(*args.Number)) + number := rpc.BlockNumber(uint64(*args.Number)) + numberOrHash := rpc.BlockNumberOrHashWithNumber(number) block = &Block{ - backend: r.backend, - num: &num, - canonical: isCanonical, + backend: r.backend, + numberOrHash: &numberOrHash, } } else if args.Hash != nil { + numberOrHash := rpc.BlockNumberOrHashWithHash(*args.Hash, false) block = &Block{ - backend: r.backend, - hash: *args.Hash, - canonical: unknown, + backend: r.backend, + numberOrHash: &numberOrHash, } } else { - num := rpc.LatestBlockNumber + numberOrHash := rpc.BlockNumberOrHashWithNumber(rpc.LatestBlockNumber) block = &Block{ - backend: r.backend, - num: &num, - canonical: isCanonical, + backend: r.backend, + numberOrHash: &numberOrHash, } } // Resolve the header, return nil if it doesn't exist. @@ -963,11 +920,10 @@ func (r *Resolver) Blocks(ctx context.Context, args struct { } ret := make([]*Block, 0, to-from+1) for i := from; i <= to; i++ { - num := i + numberOrHash := rpc.BlockNumberOrHashWithNumber(i) ret = append(ret, &Block{ - backend: r.backend, - num: &num, - canonical: isCanonical, + backend: r.backend, + numberOrHash: &numberOrHash, }) } return ret, nil diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 354614d0adb8..ea7bb7fc86a9 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -530,8 +530,8 @@ func (s *PublicBlockChainAPI) BlockNumber() hexutil.Uint64 { // GetBalance returns the amount of wei for the given address in the state of the // given block number. The rpc.LatestBlockNumber and rpc.PendingBlockNumber meta // block numbers are also allowed. -func (s *PublicBlockChainAPI) GetBalance(ctx context.Context, address common.Address, blockNr rpc.BlockNumber) (*hexutil.Big, error) { - state, _, err := s.b.StateAndHeaderByNumber(ctx, blockNr) +func (s *PublicBlockChainAPI) GetBalance(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Big, error) { + state, _, err := s.b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash) if state == nil || err != nil { return nil, err } @@ -555,8 +555,8 @@ type StorageResult struct { } // GetProof returns the Merkle-proof for a given account and optionally some storage keys. -func (s *PublicBlockChainAPI) GetProof(ctx context.Context, address common.Address, storageKeys []string, blockNr rpc.BlockNumber) (*AccountResult, error) { - state, _, err := s.b.StateAndHeaderByNumber(ctx, blockNr) +func (s *PublicBlockChainAPI) GetProof(ctx context.Context, address common.Address, storageKeys []string, blockNrOrHash rpc.BlockNumberOrHash) (*AccountResult, error) { + state, _, err := s.b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash) if state == nil || err != nil { return nil, err } @@ -712,8 +712,8 @@ func (s *PublicBlockChainAPI) GetUncleCountByBlockHash(ctx context.Context, bloc } // GetCode returns the code stored at the given address in the state for the given block number. -func (s *PublicBlockChainAPI) GetCode(ctx context.Context, address common.Address, blockNr rpc.BlockNumber) (hexutil.Bytes, error) { - state, _, err := s.b.StateAndHeaderByNumber(ctx, blockNr) +func (s *PublicBlockChainAPI) GetCode(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error) { + state, _, err := s.b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash) if state == nil || err != nil { return nil, err } @@ -724,8 +724,8 @@ func (s *PublicBlockChainAPI) GetCode(ctx context.Context, address common.Addres // GetStorageAt returns the storage from the state at the given address, key and // block number. The rpc.LatestBlockNumber and rpc.PendingBlockNumber meta block // numbers are also allowed. -func (s *PublicBlockChainAPI) GetStorageAt(ctx context.Context, address common.Address, key string, blockNr rpc.BlockNumber) (hexutil.Bytes, error) { - state, _, err := s.b.StateAndHeaderByNumber(ctx, blockNr) +func (s *PublicBlockChainAPI) GetStorageAt(ctx context.Context, address common.Address, key string, blockNrOrHash rpc.BlockNumberOrHash) (hexutil.Bytes, error) { + state, _, err := s.b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash) if state == nil || err != nil { return nil, err } @@ -757,10 +757,10 @@ type account struct { StateDiff *map[common.Hash]common.Hash `json:"stateDiff"` } -func DoCall(ctx context.Context, b Backend, args CallArgs, blockNr rpc.BlockNumber, overrides map[common.Address]account, vmCfg vm.Config, timeout time.Duration, globalGasCap *big.Int) ([]byte, uint64, bool, error) { +func DoCall(ctx context.Context, b Backend, args CallArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides map[common.Address]account, vmCfg vm.Config, timeout time.Duration, globalGasCap *big.Int) ([]byte, uint64, bool, error) { defer func(start time.Time) { log.Debug("Executing EVM call finished", "runtime", time.Since(start)) }(time.Now()) - state, header, err := b.StateAndHeaderByNumber(ctx, blockNr) + state, header, err := b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash) if state == nil || err != nil { return nil, 0, false, err } @@ -874,16 +874,16 @@ func DoCall(ctx context.Context, b Backend, args CallArgs, blockNr rpc.BlockNumb // // Note, this function doesn't make and changes in the state/blockchain and is // useful to execute and retrieve values. -func (s *PublicBlockChainAPI) Call(ctx context.Context, args CallArgs, blockNr rpc.BlockNumber, overrides *map[common.Address]account) (hexutil.Bytes, error) { +func (s *PublicBlockChainAPI) Call(ctx context.Context, args CallArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *map[common.Address]account) (hexutil.Bytes, error) { var accounts map[common.Address]account if overrides != nil { accounts = *overrides } - result, _, _, err := DoCall(ctx, s.b, args, blockNr, accounts, vm.Config{}, 5*time.Second, s.b.RPCGasCap()) + result, _, _, err := DoCall(ctx, s.b, args, blockNrOrHash, accounts, vm.Config{}, 5*time.Second, s.b.RPCGasCap()) return (hexutil.Bytes)(result), err } -func DoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNr rpc.BlockNumber, gasCap *big.Int) (hexutil.Uint64, error) { +func DoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNrOrHash rpc.BlockNumberOrHash, gasCap *big.Int) (hexutil.Uint64, error) { // Binary search the gas requirement, as it may be higher than the amount used var ( lo uint64 = params.TxGas - 1 @@ -894,7 +894,7 @@ func DoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNr rpc.Bl hi = uint64(*args.Gas) } else { // Retrieve the block to act as the gas ceiling - block, err := b.BlockByNumber(ctx, blockNr) + block, err := b.BlockByNumberOrHash(ctx, blockNrOrHash) if err != nil { return 0, err } @@ -910,7 +910,7 @@ func DoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNr rpc.Bl executable := func(gas uint64) bool { args.Gas = (*hexutil.Uint64)(&gas) - _, _, failed, err := DoCall(ctx, b, args, rpc.PendingBlockNumber, nil, vm.Config{}, 0, gasCap) + _, _, failed, err := DoCall(ctx, b, args, blockNrOrHash, nil, vm.Config{}, 0, gasCap) if err != nil || failed { return false } @@ -937,7 +937,8 @@ func DoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNr rpc.Bl // EstimateGas returns an estimate of the amount of gas needed to execute the // given transaction against the current pending block. func (s *PublicBlockChainAPI) EstimateGas(ctx context.Context, args CallArgs) (hexutil.Uint64, error) { - return DoEstimateGas(ctx, s.b, args, rpc.PendingBlockNumber, s.b.RPCGasCap()) + blockNrOrHash := rpc.BlockNumberOrHashWithNumber(rpc.PendingBlockNumber) + return DoEstimateGas(ctx, s.b, args, blockNrOrHash, s.b.RPCGasCap()) } // ExecutionResult groups all structured logs emitted by the EVM @@ -1224,9 +1225,9 @@ func (s *PublicTransactionPoolAPI) GetRawTransactionByBlockHashAndIndex(ctx cont } // GetTransactionCount returns the number of transactions the given address has sent for the given block number -func (s *PublicTransactionPoolAPI) GetTransactionCount(ctx context.Context, address common.Address, blockNr rpc.BlockNumber) (*hexutil.Uint64, error) { +func (s *PublicTransactionPoolAPI) GetTransactionCount(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Uint64, error) { // Ask transaction pool for the nonce which includes pending transactions - if blockNr == rpc.PendingBlockNumber { + if blockNr, ok := blockNrOrHash.Number(); ok && blockNr == rpc.PendingBlockNumber { nonce, err := s.b.GetPoolNonce(ctx, address) if err != nil { return nil, err @@ -1234,7 +1235,7 @@ func (s *PublicTransactionPoolAPI) GetTransactionCount(ctx context.Context, addr return (*hexutil.Uint64)(&nonce), nil } // Resolve block number and use its state to ask for the nonce - state, _, err := s.b.StateAndHeaderByNumber(ctx, blockNr) + state, _, err := s.b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash) if state == nil || err != nil { return nil, err } @@ -1405,7 +1406,8 @@ func (args *SendTxArgs) setDefaults(ctx context.Context, b Backend) error { Value: args.Value, Data: input, } - estimated, err := DoEstimateGas(ctx, b, callArgs, rpc.PendingBlockNumber, b.RPCGasCap()) + pendingBlockNr := rpc.BlockNumberOrHashWithNumber(rpc.PendingBlockNumber) + estimated, err := DoEstimateGas(ctx, b, callArgs, pendingBlockNr, b.RPCGasCap()) if err != nil { return err } diff --git a/internal/ethapi/backend.go b/internal/ethapi/backend.go index 06c6db33b150..73b6c89ceaaf 100644 --- a/internal/ethapi/backend.go +++ b/internal/ethapi/backend.go @@ -52,9 +52,12 @@ type Backend interface { SetHead(number uint64) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) + HeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Header, error) BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) + BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Block, error) StateAndHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*state.StateDB, *types.Header, error) + StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *types.Header, error) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) GetTd(hash common.Hash) *big.Int GetEVM(ctx context.Context, msg core.Message, state *state.StateDB, header *types.Header) (*vm.EVM, func() error, error) diff --git a/les/api_backend.go b/les/api_backend.go index 5cd432dcf87f..e01e1be98bd2 100644 --- a/les/api_backend.go +++ b/les/api_backend.go @@ -65,6 +65,26 @@ func (b *LesApiBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumb return b.eth.blockchain.GetHeaderByNumberOdr(ctx, uint64(number)) } +func (b *LesApiBackend) HeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Header, error) { + if blockNr, ok := blockNrOrHash.Number(); ok { + return b.HeaderByNumber(ctx, blockNr) + } + if hash, ok := blockNrOrHash.Hash(); ok { + header, err := b.HeaderByHash(ctx, hash) + if err != nil { + return nil, err + } + if header == nil { + return nil, errors.New("header for hash not found") + } + if blockNrOrHash.RequireCanonical && b.eth.blockchain.GetCanonicalHash(header.Number.Uint64()) != hash { + return nil, errors.New("hash is not currently canonical") + } + return header, nil + } + return nil, errors.New("invalid arguments; neither block nor hash specified") +} + func (b *LesApiBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) { return b.eth.blockchain.GetHeaderByHash(hash), nil } @@ -81,6 +101,26 @@ func (b *LesApiBackend) BlockByHash(ctx context.Context, hash common.Hash) (*typ return b.eth.blockchain.GetBlockByHash(ctx, hash) } +func (b *LesApiBackend) BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Block, error) { + if blockNr, ok := blockNrOrHash.Number(); ok { + return b.BlockByNumber(ctx, blockNr) + } + if hash, ok := blockNrOrHash.Hash(); ok { + block, err := b.BlockByHash(ctx, hash) + if err != nil { + return nil, err + } + if block == nil { + return nil, errors.New("header found, but block body is missing") + } + if blockNrOrHash.RequireCanonical && b.eth.blockchain.GetCanonicalHash(block.NumberU64()) != hash { + return nil, errors.New("hash is not currently canonical") + } + return block, nil + } + return nil, errors.New("invalid arguments; neither block nor hash specified") +} + func (b *LesApiBackend) StateAndHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*state.StateDB, *types.Header, error) { header, err := b.HeaderByNumber(ctx, number) if err != nil { @@ -92,6 +132,23 @@ func (b *LesApiBackend) StateAndHeaderByNumber(ctx context.Context, number rpc.B return light.NewState(ctx, header, b.eth.odr), header, nil } +func (b *LesApiBackend) StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *types.Header, error) { + if blockNr, ok := blockNrOrHash.Number(); ok { + return b.StateAndHeaderByNumber(ctx, blockNr) + } + if hash, ok := blockNrOrHash.Hash(); ok { + header := b.eth.blockchain.GetHeaderByHash(hash) + if header == nil { + return nil, nil, errors.New("header for hash not found") + } + if blockNrOrHash.RequireCanonical && b.eth.blockchain.GetCanonicalHash(header.Number.Uint64()) != hash { + return nil, nil, errors.New("hash is not currently canonical") + } + return light.NewState(ctx, header, b.eth.odr), header, nil + } + return nil, nil, errors.New("invalid arguments; neither block nor hash specified") +} + func (b *LesApiBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) { if number := rawdb.ReadHeaderNumber(b.eth.chainDb, hash); number != nil { return light.GetBlockReceipts(ctx, b.eth.odr, hash, *number) diff --git a/light/lightchain.go b/light/lightchain.go index 9529c2e1b90a..02b90138a2d5 100644 --- a/light/lightchain.go +++ b/light/lightchain.go @@ -426,6 +426,11 @@ func (lc *LightChain) HasHeader(hash common.Hash, number uint64) bool { return lc.hc.HasHeader(hash, number) } +// GetCanonicalHash returns the canonical hash for a given block number +func (bc *LightChain) GetCanonicalHash(number uint64) common.Hash { + return bc.hc.GetCanonicalHash(number) +} + // GetBlockHashesFromHash retrieves a number of block hashes starting at a given // hash, fetching towards the genesis block. func (lc *LightChain) GetBlockHashesFromHash(hash common.Hash, max uint64) []common.Hash { diff --git a/rpc/types.go b/rpc/types.go index f31f09a774a0..e6b9f2a300d2 100644 --- a/rpc/types.go +++ b/rpc/types.go @@ -18,10 +18,12 @@ package rpc import ( "context" + "encoding/json" "fmt" "math" "strings" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ) @@ -105,3 +107,94 @@ func (bn *BlockNumber) UnmarshalJSON(data []byte) error { func (bn BlockNumber) Int64() int64 { return (int64)(bn) } + +type BlockNumberOrHash struct { + BlockNumber *BlockNumber `json:"blockNumber,omitempty"` + BlockHash *common.Hash `json:"blockHash,omitempty"` + RequireCanonical bool `json:"requireCanonical,omitempty"` +} + +func (bnh *BlockNumberOrHash) UnmarshalJSON(data []byte) error { + type erased BlockNumberOrHash + e := erased{} + err := json.Unmarshal(data, &e) + if err == nil { + if e.BlockNumber != nil && e.BlockHash != nil { + return fmt.Errorf("cannot specify both BlockHash and BlockNumber, choose one or the other") + } + bnh.BlockNumber = e.BlockNumber + bnh.BlockHash = e.BlockHash + bnh.RequireCanonical = e.RequireCanonical + return nil + } + var input string + err = json.Unmarshal(data, &input) + if err != nil { + return err + } + switch input { + case "earliest": + bn := EarliestBlockNumber + bnh.BlockNumber = &bn + return nil + case "latest": + bn := LatestBlockNumber + bnh.BlockNumber = &bn + return nil + case "pending": + bn := PendingBlockNumber + bnh.BlockNumber = &bn + return nil + default: + if len(input) == 66 { + hash := common.Hash{} + err := hash.UnmarshalText([]byte(input)) + if err != nil { + return err + } + bnh.BlockHash = &hash + return nil + } else { + blckNum, err := hexutil.DecodeUint64(input) + if err != nil { + return err + } + if blckNum > math.MaxInt64 { + return fmt.Errorf("blocknumber too high") + } + bn := BlockNumber(blckNum) + bnh.BlockNumber = &bn + return nil + } + } +} + +func (bnh *BlockNumberOrHash) Number() (BlockNumber, bool) { + if bnh.BlockNumber != nil { + return *bnh.BlockNumber, true + } + return BlockNumber(0), false +} + +func (bnh *BlockNumberOrHash) Hash() (common.Hash, bool) { + if bnh.BlockHash != nil { + return *bnh.BlockHash, true + } + return common.Hash{}, false +} + +func BlockNumberOrHashWithNumber(blockNr BlockNumber) BlockNumberOrHash { + return BlockNumberOrHash{ + BlockNumber: &blockNr, + BlockHash: nil, + RequireCanonical: false, + } +} + +func BlockNumberOrHashWithHash(hash common.Hash, canonical bool) BlockNumberOrHash { + return BlockNumberOrHash{ + BlockNumber: nil, + BlockHash: &hash, + RequireCanonical: canonical, + } +} diff --git a/rpc/types_test.go b/rpc/types_test.go index 68b6d3c54f6a..89b0c9171a14 100644 --- a/rpc/types_test.go +++ b/rpc/types_test.go @@ -20,6 +20,7 @@ import ( "encoding/json" "testing" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" ) @@ -64,3 +65,60 @@ func TestBlockNumberJSONUnmarshal(t *testing.T) { } } } + +func TestBlockNumberOrHash_UnmarshalJSON(t *testing.T) { + tests := []struct { + input string + mustFail bool + expected BlockNumberOrHash + }{ + 0: {`"0x"`, true, BlockNumberOrHash{}}, + 1: {`"0x0"`, false, BlockNumberOrHashWithNumber(0)}, + 2: {`"0X1"`, false, BlockNumberOrHashWithNumber(1)}, + 3: {`"0x00"`, true, BlockNumberOrHash{}}, + 4: {`"0x01"`, true, BlockNumberOrHash{}}, + 5: {`"0x1"`, false, BlockNumberOrHashWithNumber(1)}, + 6: {`"0x12"`, false, BlockNumberOrHashWithNumber(18)}, + 7: {`"0x7fffffffffffffff"`, false, BlockNumberOrHashWithNumber(math.MaxInt64)}, + 8: {`"0x8000000000000000"`, true, BlockNumberOrHash{}}, + 9: {"0", true, BlockNumberOrHash{}}, + 10: {`"ff"`, true, BlockNumberOrHash{}}, + 11: {`"pending"`, false, BlockNumberOrHashWithNumber(PendingBlockNumber)}, + 12: {`"latest"`, false, BlockNumberOrHashWithNumber(LatestBlockNumber)}, + 13: {`"earliest"`, false, BlockNumberOrHashWithNumber(EarliestBlockNumber)}, + 14: {`someString`, true, BlockNumberOrHash{}}, + 15: {`""`, true, BlockNumberOrHash{}}, + 16: {``, true, BlockNumberOrHash{}}, + 17: {`"0x0000000000000000000000000000000000000000000000000000000000000000"`, false, BlockNumberOrHashWithHash(common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000"), false)}, + 18: {`{"blockHash":"0x0000000000000000000000000000000000000000000000000000000000000000"}`, false, BlockNumberOrHashWithHash(common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000"), false)}, + 19: {`{"blockHash":"0x0000000000000000000000000000000000000000000000000000000000000000","requireCanonical":false}`, false, BlockNumberOrHashWithHash(common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000"), false)}, + 20: {`{"blockHash":"0x0000000000000000000000000000000000000000000000000000000000000000","requireCanonical":true}`, false, BlockNumberOrHashWithHash(common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000"), true)}, + 21: {`{"blockNumber":"0x1"}`, false, BlockNumberOrHashWithNumber(1)}, + 22: {`{"blockNumber":"pending"}`, false, BlockNumberOrHashWithNumber(PendingBlockNumber)}, + 23: {`{"blockNumber":"latest"}`, false, BlockNumberOrHashWithNumber(LatestBlockNumber)}, + 24: {`{"blockNumber":"earliest"}`, false, BlockNumberOrHashWithNumber(EarliestBlockNumber)}, + 25: {`{"blockNumber":"0x1", "blockHash":"0x0000000000000000000000000000000000000000000000000000000000000000"}`, true, BlockNumberOrHash{}}, + } + + for i, test := range tests { + var bnh BlockNumberOrHash + err := json.Unmarshal([]byte(test.input), &bnh) + if test.mustFail && err == nil { + t.Errorf("Test %d should fail", i) + continue + } + if !test.mustFail && err != nil { + t.Errorf("Test %d should pass but got err: %v", i, err) + continue + } + hash, hashOk := bnh.Hash() + expectedHash, expectedHashOk := test.expected.Hash() + num, numOk := bnh.Number() + expectedNum, expectedNumOk := test.expected.Number() + if bnh.RequireCanonical != test.expected.RequireCanonical || + hash != expectedHash || hashOk != expectedHashOk || + num != expectedNum || numOk != expectedNumOk { + t.Errorf("Test %d got unexpected value, want %v, got %v", i, test.expected, bnh) + } + } +} From 1a6ef5ae58ab7900139ef60da78cd1746b5bfa57 Mon Sep 17 00:00:00 2001 From: ywzqwwt <39263032+ywzqwwt@users.noreply.github.com> Date: Thu, 26 Sep 2019 16:57:51 +0800 Subject: [PATCH 39/50] core/blockchain: remove block from futureBlocks on error (#19763) --- core/blockchain.go | 1 + 1 file changed, 1 insertion(+) diff --git a/core/blockchain.go b/core/blockchain.go index 2665f73215ba..8b713d9e09a7 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1549,6 +1549,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, [] // Some other error occurred, abort case err != nil: + bc.futureBlocks.Remove(block.Hash()) stats.ignored += len(it.chain) bc.reportBlock(block, nil, err) return it.index, events, coalescedLogs, err From 2133f18f15a301a0b06eb50abf4b9b8f3033fe2b Mon Sep 17 00:00:00 2001 From: zcheng9 Date: Thu, 26 Sep 2019 17:09:59 +0800 Subject: [PATCH 40/50] core/state: fix database leak and copy tests (#19306) --- core/state/statedb_test.go | 78 ++++++++++++++++++++++++++++---------- 1 file changed, 59 insertions(+), 19 deletions(-) diff --git a/core/state/statedb_test.go b/core/state/statedb_test.go index 5f58a234cac9..bfb081191374 100644 --- a/core/state/statedb_test.go +++ b/core/state/statedb_test.go @@ -25,10 +25,11 @@ import ( "math/rand" "reflect" "strings" + "sync" "testing" "testing/quick" - check "gopkg.in/check.v1" + "gopkg.in/check.v1" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/rawdb" @@ -53,8 +54,13 @@ func TestUpdateLeaks(t *testing.T) { if i%3 == 0 { state.SetCode(addr, []byte{i, i, i, i, i}) } - state.IntermediateRoot(false) } + + root := state.IntermediateRoot(false) + if err := state.Database().TrieDB().Commit(root, false); err != nil { + t.Errorf("can not commit trie %v to persistent database", root.Hex()) + } + // Ensure that no data was leaked into the database it := db.NewIterator() for it.Next() { @@ -98,27 +104,45 @@ func TestIntermediateLeaks(t *testing.T) { } // Commit and cross check the databases. - if _, err := transState.Commit(false); err != nil { + transRoot, err := transState.Commit(false) + if err != nil { t.Fatalf("failed to commit transition state: %v", err) } - if _, err := finalState.Commit(false); err != nil { + if err = transState.Database().TrieDB().Commit(transRoot, false); err != nil { + t.Errorf("can not commit trie %v to persistent database", transRoot.Hex()) + } + + finalRoot, err := finalState.Commit(false) + if err != nil { t.Fatalf("failed to commit final state: %v", err) } + if err = finalState.Database().TrieDB().Commit(finalRoot, false); err != nil { + t.Errorf("can not commit trie %v to persistent database", finalRoot.Hex()) + } + it := finalDb.NewIterator() for it.Next() { - key := it.Key() - if _, err := transDb.Get(key); err != nil { - t.Errorf("entry missing from the transition database: %x -> %x", key, it.Value()) + key, fvalue := it.Key(), it.Value() + tvalue, err := transDb.Get(key) + if err != nil { + t.Errorf("entry missing from the transition database: %x -> %x", key, fvalue) + } + if !bytes.Equal(fvalue, tvalue) { + t.Errorf("the value associate key %x is mismatch,: %x in transition database ,%x in final database", key, tvalue, fvalue) } } it.Release() it = transDb.NewIterator() for it.Next() { - key := it.Key() - if _, err := finalDb.Get(key); err != nil { + key, tvalue := it.Key(), it.Value() + fvalue, err := finalDb.Get(key) + if err != nil { t.Errorf("extra entry in the transition database: %x -> %x", key, it.Value()) } + if !bytes.Equal(fvalue, tvalue) { + t.Errorf("the value associate key %x is mismatch,: %x in transition database ,%x in final database", key, tvalue, fvalue) + } } } @@ -136,32 +160,45 @@ func TestCopy(t *testing.T) { } orig.Finalise(false) - // Copy the state, modify both in-memory + // Copy the state copy := orig.Copy() + // Copy the copy state + ccopy := copy.Copy() + + // modify all in memory for i := byte(0); i < 255; i++ { origObj := orig.GetOrNewStateObject(common.BytesToAddress([]byte{i})) copyObj := copy.GetOrNewStateObject(common.BytesToAddress([]byte{i})) + ccopyObj := ccopy.GetOrNewStateObject(common.BytesToAddress([]byte{i})) origObj.AddBalance(big.NewInt(2 * int64(i))) copyObj.AddBalance(big.NewInt(3 * int64(i))) + ccopyObj.AddBalance(big.NewInt(4 * int64(i))) orig.updateStateObject(origObj) copy.updateStateObject(copyObj) + ccopy.updateStateObject(copyObj) } - // Finalise the changes on both concurrently - done := make(chan struct{}) - go func() { - orig.Finalise(true) - close(done) - }() - copy.Finalise(true) - <-done - // Verify that the two states have been updated independently + // Finalise the changes on all concurrently + finalise := func(wg *sync.WaitGroup, db *StateDB) { + defer wg.Done() + db.Finalise(true) + } + + var wg sync.WaitGroup + wg.Add(3) + go finalise(&wg, orig) + go finalise(&wg, copy) + go finalise(&wg, ccopy) + wg.Wait() + + // Verify that the three states have been updated independently for i := byte(0); i < 255; i++ { origObj := orig.GetOrNewStateObject(common.BytesToAddress([]byte{i})) copyObj := copy.GetOrNewStateObject(common.BytesToAddress([]byte{i})) + ccopyObj := ccopy.GetOrNewStateObject(common.BytesToAddress([]byte{i})) if want := big.NewInt(3 * int64(i)); origObj.Balance().Cmp(want) != 0 { t.Errorf("orig obj %d: balance mismatch: have %v, want %v", i, origObj.Balance(), want) @@ -169,6 +206,9 @@ func TestCopy(t *testing.T) { if want := big.NewInt(4 * int64(i)); copyObj.Balance().Cmp(want) != 0 { t.Errorf("copy obj %d: balance mismatch: have %v, want %v", i, copyObj.Balance(), want) } + if want := big.NewInt(5 * int64(i)); ccopyObj.Balance().Cmp(want) != 0 { + t.Errorf("copy obj %d: balance mismatch: have %v, want %v", i, ccopyObj.Balance(), want) + } } } From ead711779d6e2e1d4593d7dcede8ae6454a3b961 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Thu, 26 Sep 2019 11:10:35 +0200 Subject: [PATCH 41/50] core: initialize current block/fastblock atomics to nil, fix #19286 (#19352) --- core/blockchain.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/blockchain.go b/core/blockchain.go index 8b713d9e09a7..9fb02b1482d1 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -228,10 +228,16 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *par if bc.genesisBlock == nil { return nil, ErrNoGenesis } + + var nilBlock *types.Block + bc.currentBlock.Store(nilBlock) + bc.currentFastBlock.Store(nilBlock) + // Initialize the chain with ancient data if it isn't empty. if bc.empty() { rawdb.InitDatabaseFromFreezer(bc.db) } + if err := bc.loadLastState(); err != nil { return nil, err } From df89233b5780d3b42945070e9bae616a76a83866 Mon Sep 17 00:00:00 2001 From: gary rong Date: Thu, 26 Sep 2019 22:44:00 +0800 Subject: [PATCH 42/50] ethdb/leveldb: disable seek compaction (#20130) * vendor: update leveldb * ethdb/leveldb: disable seek compaction and add metrics * vendor: udpate latest levledb * ethdb/leveldb: fix typo --- ethdb/leveldb/leveldb.go | 48 ++++++++++++--- .../syndtr/goleveldb/leveldb/batch.go | 5 ++ .../github.com/syndtr/goleveldb/leveldb/db.go | 22 +++++-- .../syndtr/goleveldb/leveldb/db_compaction.go | 11 ++++ .../syndtr/goleveldb/leveldb/db_iter.go | 43 ++++++++------ .../goleveldb/leveldb/db_transaction.go | 14 +++-- .../syndtr/goleveldb/leveldb/filter/bloom.go | 2 +- .../syndtr/goleveldb/leveldb/memdb/memdb.go | 4 ++ .../syndtr/goleveldb/leveldb/opt/options.go | 21 ++++++- .../goleveldb/leveldb/session_compaction.go | 26 ++++++++- .../syndtr/goleveldb/leveldb/session_util.go | 4 +- .../syndtr/goleveldb/leveldb/table.go | 2 + .../syndtr/goleveldb/leveldb/table/reader.go | 4 ++ .../syndtr/goleveldb/leveldb/version.go | 3 +- vendor/vendor.json | 58 +++++++++---------- 15 files changed, 197 insertions(+), 70 deletions(-) diff --git a/ethdb/leveldb/leveldb.go b/ethdb/leveldb/leveldb.go index aba6593c7a06..378d4c3cd236 100644 --- a/ethdb/leveldb/leveldb.go +++ b/ethdb/leveldb/leveldb.go @@ -62,14 +62,18 @@ type Database struct { fn string // filename for reporting db *leveldb.DB // LevelDB instance - compTimeMeter metrics.Meter // Meter for measuring the total time spent in database compaction - compReadMeter metrics.Meter // Meter for measuring the data read during compaction - compWriteMeter metrics.Meter // Meter for measuring the data written during compaction - writeDelayNMeter metrics.Meter // Meter for measuring the write delay number due to database compaction - writeDelayMeter metrics.Meter // Meter for measuring the write delay duration due to database compaction - diskSizeGauge metrics.Gauge // Gauge for tracking the size of all the levels in the database - diskReadMeter metrics.Meter // Meter for measuring the effective amount of data read - diskWriteMeter metrics.Meter // Meter for measuring the effective amount of data written + compTimeMeter metrics.Meter // Meter for measuring the total time spent in database compaction + compReadMeter metrics.Meter // Meter for measuring the data read during compaction + compWriteMeter metrics.Meter // Meter for measuring the data written during compaction + writeDelayNMeter metrics.Meter // Meter for measuring the write delay number due to database compaction + writeDelayMeter metrics.Meter // Meter for measuring the write delay duration due to database compaction + diskSizeGauge metrics.Gauge // Gauge for tracking the size of all the levels in the database + diskReadMeter metrics.Meter // Meter for measuring the effective amount of data read + diskWriteMeter metrics.Meter // Meter for measuring the effective amount of data written + memCompGauge metrics.Gauge // Gauge for tracking the number of memory compaction + level0CompGauge metrics.Gauge // Gauge for tracking the number of table compaction in level0 + nonlevel0CompGauge metrics.Gauge // Gauge for tracking the number of table compaction in non0 level + seekCompGauge metrics.Gauge // Gauge for tracking the number of table compaction caused by read opt quitLock sync.Mutex // Mutex protecting the quit channel access quitChan chan chan error // Quit channel to stop the metrics collection before closing the database @@ -96,6 +100,7 @@ func New(file string, cache int, handles int, namespace string) (*Database, erro BlockCacheCapacity: cache / 2 * opt.MiB, WriteBuffer: cache / 4 * opt.MiB, // Two of these are used internally Filter: filter.NewBloomFilter(10), + DisableSeeksCompaction: true, }) if _, corrupted := err.(*errors.ErrCorrupted); corrupted { db, err = leveldb.RecoverFile(file, nil) @@ -118,6 +123,10 @@ func New(file string, cache int, handles int, namespace string) (*Database, erro ldb.diskWriteMeter = metrics.NewRegisteredMeter(namespace+"disk/write", nil) ldb.writeDelayMeter = metrics.NewRegisteredMeter(namespace+"compact/writedelay/duration", nil) ldb.writeDelayNMeter = metrics.NewRegisteredMeter(namespace+"compact/writedelay/counter", nil) + ldb.memCompGauge = metrics.NewRegisteredGauge(namespace+"compact/memory", nil) + ldb.level0CompGauge = metrics.NewRegisteredGauge(namespace+"compact/level0", nil) + ldb.nonlevel0CompGauge = metrics.NewRegisteredGauge(namespace+"compact/nonlevel0", nil) + ldb.seekCompGauge = metrics.NewRegisteredGauge(namespace+"compact/seek", nil) // Start up the metrics gathering and return go ldb.meter(metricsGatheringInterval) @@ -375,6 +384,29 @@ func (db *Database) meter(refresh time.Duration) { } iostats[0], iostats[1] = nRead, nWrite + compCount, err := db.db.GetProperty("leveldb.compcount") + if err != nil { + db.log.Error("Failed to read database iostats", "err", err) + merr = err + continue + } + + var ( + memComp uint32 + level0Comp uint32 + nonLevel0Comp uint32 + seekComp uint32 + ) + if n, err := fmt.Sscanf(compCount, "MemComp:%d Level0Comp:%d NonLevel0Comp:%d SeekComp:%d", &memComp, &level0Comp, &nonLevel0Comp, &seekComp); n != 4 || err != nil { + db.log.Error("Compaction count statistic not found") + merr = err + continue + } + db.memCompGauge.Update(int64(memComp)) + db.level0CompGauge.Update(int64(level0Comp)) + db.nonlevel0CompGauge.Update(int64(nonLevel0Comp)) + db.seekCompGauge.Update(int64(seekComp)) + // Sleep a bit, then repeat the stats collection select { case errc = <-db.quitChan: diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/batch.go b/vendor/github.com/syndtr/goleveldb/leveldb/batch.go index 225920002df2..823be93f93c3 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/batch.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/batch.go @@ -238,6 +238,11 @@ func newBatch() interface{} { return &Batch{} } +// MakeBatch returns empty batch with preallocated buffer. +func MakeBatch(n int) *Batch { + return &Batch{data: make([]byte, 0, n)} +} + func decodeBatch(data []byte, fn func(i int, index batchIndex) error) error { var index batchIndex for i, o := 0, 0; o < len(data); i++ { diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/db.go b/vendor/github.com/syndtr/goleveldb/leveldb/db.go index 0de5ffe8d7a1..74e9826956db 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/db.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/db.go @@ -38,6 +38,12 @@ type DB struct { inWritePaused int32 // The indicator whether write operation is paused by compaction aliveSnaps, aliveIters int32 + // Compaction statistic + memComp uint32 // The cumulative number of memory compaction + level0Comp uint32 // The cumulative number of level0 compaction + nonLevel0Comp uint32 // The cumulative number of non-level0 compaction + seekComp uint32 // The cumulative number of seek compaction + // Session. s *session @@ -978,6 +984,8 @@ func (db *DB) GetProperty(name string) (value string, err error) { value += fmt.Sprintf(" Total | %10d | %13.5f | %13.5f | %13.5f | %13.5f\n", totalTables, float64(totalSize)/1048576.0, totalDuration.Seconds(), float64(totalRead)/1048576.0, float64(totalWrite)/1048576.0) + case p == "compcount": + value = fmt.Sprintf("MemComp:%d Level0Comp:%d NonLevel0Comp:%d SeekComp:%d", atomic.LoadUint32(&db.memComp), atomic.LoadUint32(&db.level0Comp), atomic.LoadUint32(&db.nonLevel0Comp), atomic.LoadUint32(&db.seekComp)) case p == "iostats": value = fmt.Sprintf("Read(MB):%.5f Write(MB):%.5f", float64(db.s.stor.reads())/1048576.0, @@ -1034,6 +1042,11 @@ type DBStats struct { LevelRead Sizes LevelWrite Sizes LevelDurations []time.Duration + + MemComp uint32 + Level0Comp uint32 + NonLevel0Comp uint32 + SeekComp uint32 } // Stats populates s with database statistics. @@ -1070,16 +1083,17 @@ func (db *DB) Stats(s *DBStats) error { for level, tables := range v.levels { duration, read, write := db.compStats.getStat(level) - if len(tables) == 0 && duration == 0 { - continue - } + s.LevelDurations = append(s.LevelDurations, duration) s.LevelRead = append(s.LevelRead, read) s.LevelWrite = append(s.LevelWrite, write) s.LevelSizes = append(s.LevelSizes, tables.size()) s.LevelTablesCounts = append(s.LevelTablesCounts, len(tables)) } - + s.MemComp = atomic.LoadUint32(&db.memComp) + s.Level0Comp = atomic.LoadUint32(&db.level0Comp) + s.NonLevel0Comp = atomic.LoadUint32(&db.nonLevel0Comp) + s.SeekComp = atomic.LoadUint32(&db.seekComp) return nil } diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/db_compaction.go b/vendor/github.com/syndtr/goleveldb/leveldb/db_compaction.go index 56f3632a7d29..6b70eb2c9d3c 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/db_compaction.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/db_compaction.go @@ -8,6 +8,7 @@ package leveldb import ( "sync" + "sync/atomic" "time" "github.com/syndtr/goleveldb/leveldb/errors" @@ -324,10 +325,12 @@ func (db *DB) memCompaction() { db.logf("memdb@flush committed F·%d T·%v", len(rec.addedTables), stats.duration) + // Save compaction stats for _, r := range rec.addedTables { stats.write += r.size } db.compStats.addStat(flushLevel, stats) + atomic.AddUint32(&db.memComp, 1) // Drop frozen memdb. db.dropFrozenMem() @@ -588,6 +591,14 @@ func (db *DB) tableCompaction(c *compaction, noTrivial bool) { for i := range stats { db.compStats.addStat(c.sourceLevel+1, &stats[i]) } + switch c.typ { + case level0Compaction: + atomic.AddUint32(&db.level0Comp, 1) + case nonLevel0Compaction: + atomic.AddUint32(&db.nonLevel0Comp, 1) + case seekCompaction: + atomic.AddUint32(&db.seekComp, 1) + } } func (db *DB) tableRangeCompaction(level int, umin, umax []byte) error { diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/db_iter.go b/vendor/github.com/syndtr/goleveldb/leveldb/db_iter.go index 03c24cdab50d..e6e8ca59d088 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/db_iter.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/db_iter.go @@ -78,13 +78,17 @@ func (db *DB) newIterator(auxm *memDB, auxt tFiles, seq uint64, slice *util.Rang } rawIter := db.newRawIterator(auxm, auxt, islice, ro) iter := &dbIter{ - db: db, - icmp: db.s.icmp, - iter: rawIter, - seq: seq, - strict: opt.GetStrict(db.s.o.Options, ro, opt.StrictReader), - key: make([]byte, 0), - value: make([]byte, 0), + db: db, + icmp: db.s.icmp, + iter: rawIter, + seq: seq, + strict: opt.GetStrict(db.s.o.Options, ro, opt.StrictReader), + disableSampling: db.s.o.GetDisableSeeksCompaction() || db.s.o.GetIteratorSamplingRate() <= 0, + key: make([]byte, 0), + value: make([]byte, 0), + } + if !iter.disableSampling { + iter.samplingGap = db.iterSamplingRate() } atomic.AddInt32(&db.aliveIters, 1) runtime.SetFinalizer(iter, (*dbIter).Release) @@ -107,13 +111,14 @@ const ( // dbIter represent an interator states over a database session. type dbIter struct { - db *DB - icmp *iComparer - iter iterator.Iterator - seq uint64 - strict bool - - smaplingGap int + db *DB + icmp *iComparer + iter iterator.Iterator + seq uint64 + strict bool + disableSampling bool + + samplingGap int dir dir key []byte value []byte @@ -122,10 +127,14 @@ type dbIter struct { } func (i *dbIter) sampleSeek() { + if i.disableSampling { + return + } + ikey := i.iter.Key() - i.smaplingGap -= len(ikey) + len(i.iter.Value()) - for i.smaplingGap < 0 { - i.smaplingGap += i.db.iterSamplingRate() + i.samplingGap -= len(ikey) + len(i.iter.Value()) + for i.samplingGap < 0 { + i.samplingGap += i.db.iterSamplingRate() i.db.sampleSeek(ikey) } } diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/db_transaction.go b/vendor/github.com/syndtr/goleveldb/leveldb/db_transaction.go index f145b64fbbce..21d1e512f342 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/db_transaction.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/db_transaction.go @@ -69,6 +69,9 @@ func (tr *Transaction) Has(key []byte, ro *opt.ReadOptions) (bool, error) { // DB. And a nil Range.Limit is treated as a key after all keys in // the DB. // +// The returned iterator has locks on its own resources, so it can live beyond +// the lifetime of the transaction who creates them. +// // WARNING: Any slice returned by interator (e.g. slice returned by calling // Iterator.Key() or Iterator.Key() methods), its content should not be modified // unless noted otherwise. @@ -252,13 +255,14 @@ func (tr *Transaction) discard() { // Discard transaction. for _, t := range tr.tables { tr.db.logf("transaction@discard @%d", t.fd.Num) - if err1 := tr.db.s.stor.Remove(t.fd); err1 == nil { - tr.db.s.reuseFileNum(t.fd.Num) - } + // Iterator may still use the table, so we use tOps.remove here. + tr.db.s.tops.remove(t.fd) } } // Discard discards the transaction. +// This method is noop if transaction is already closed (either committed or +// discarded) // // Other methods should not be called after transaction has been discarded. func (tr *Transaction) Discard() { @@ -282,8 +286,10 @@ func (db *DB) waitCompaction() error { // until in-flight transaction is committed or discarded. // The returned transaction handle is safe for concurrent use. // -// Transaction is expensive and can overwhelm compaction, especially if +// Transaction is very expensive and can overwhelm compaction, especially if // transaction size is small. Use with caution. +// The rule of thumb is if you need to merge at least same amount of +// `Options.WriteBuffer` worth of data then use transaction, otherwise don't. // // The transaction must be closed once done, either by committing or discarding // the transaction. diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/filter/bloom.go b/vendor/github.com/syndtr/goleveldb/leveldb/filter/bloom.go index bab0e99705f5..56ccbfbecab5 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/filter/bloom.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/filter/bloom.go @@ -16,7 +16,7 @@ func bloomHash(key []byte) uint32 { type bloomFilter int -// The bloom filter serializes its parameters and is backward compatible +// Name: The bloom filter serializes its parameters and is backward compatible // with respect to them. Therefor, its parameters are not added to its // name. func (bloomFilter) Name() string { diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb.go b/vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb.go index b661c08a93e2..824e47f5f402 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb.go @@ -397,6 +397,10 @@ func (p *DB) Find(key []byte) (rkey, value []byte, err error) { // DB. And a nil Range.Limit is treated as a key after all keys in // the DB. // +// WARNING: Any slice returned by interator (e.g. slice returned by calling +// Iterator.Key() or Iterator.Key() methods), its content should not be modified +// unless noted otherwise. +// // The iterator must be released after use, by calling Release method. // // Also read Iterator documentation of the leveldb/iterator package. diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/opt/options.go b/vendor/github.com/syndtr/goleveldb/leveldb/opt/options.go index 528b16423321..c02c1e978848 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/opt/options.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/opt/options.go @@ -278,6 +278,14 @@ type Options struct { // The default is false. DisableLargeBatchTransaction bool + // DisableSeeksCompaction allows disabling 'seeks triggered compaction'. + // The purpose of 'seeks triggered compaction' is to optimize database so + // that 'level seeks' can be minimized, however this might generate many + // small compaction which may not preferable. + // + // The default is false. + DisableSeeksCompaction bool + // ErrorIfExist defines whether an error should returned if the DB already // exist. // @@ -309,6 +317,8 @@ type Options struct { // IteratorSamplingRate defines approximate gap (in bytes) between read // sampling of an iterator. The samples will be used to determine when // compaction should be triggered. + // Use negative value to disable iterator sampling. + // The iterator sampling is disabled if DisableSeeksCompaction is true. // // The default is 1MiB. IteratorSamplingRate int @@ -526,6 +536,13 @@ func (o *Options) GetDisableLargeBatchTransaction() bool { return o.DisableLargeBatchTransaction } +func (o *Options) GetDisableSeeksCompaction() bool { + if o == nil { + return false + } + return o.DisableSeeksCompaction +} + func (o *Options) GetErrorIfExist() bool { if o == nil { return false @@ -548,8 +565,10 @@ func (o *Options) GetFilter() filter.Filter { } func (o *Options) GetIteratorSamplingRate() int { - if o == nil || o.IteratorSamplingRate <= 0 { + if o == nil || o.IteratorSamplingRate == 0 { return DefaultIteratorSamplingRate + } else if o.IteratorSamplingRate < 0 { + return 0 } return o.IteratorSamplingRate } diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/session_compaction.go b/vendor/github.com/syndtr/goleveldb/leveldb/session_compaction.go index f6030022de98..4c1d336bef79 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/session_compaction.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/session_compaction.go @@ -14,6 +14,13 @@ import ( "github.com/syndtr/goleveldb/leveldb/opt" ) +const ( + undefinedCompaction = iota + level0Compaction + nonLevel0Compaction + seekCompaction +) + func (s *session) pickMemdbLevel(umin, umax []byte, maxLevel int) int { v := s.version() defer v.release() @@ -50,6 +57,7 @@ func (s *session) pickCompaction() *compaction { var sourceLevel int var t0 tFiles + var typ int if v.cScore >= 1 { sourceLevel = v.cLevel cptr := s.getCompPtr(sourceLevel) @@ -63,18 +71,24 @@ func (s *session) pickCompaction() *compaction { if len(t0) == 0 { t0 = append(t0, tables[0]) } + if sourceLevel == 0 { + typ = level0Compaction + } else { + typ = nonLevel0Compaction + } } else { if p := atomic.LoadPointer(&v.cSeek); p != nil { ts := (*tSet)(p) sourceLevel = ts.level t0 = append(t0, ts.table) + typ = seekCompaction } else { v.release() return nil } } - return newCompaction(s, v, sourceLevel, t0) + return newCompaction(s, v, sourceLevel, t0, typ) } // Create compaction from given level and range; need external synchronization. @@ -109,13 +123,18 @@ func (s *session) getCompactionRange(sourceLevel int, umin, umax []byte, noLimit } } - return newCompaction(s, v, sourceLevel, t0) + typ := level0Compaction + if sourceLevel != 0 { + typ = nonLevel0Compaction + } + return newCompaction(s, v, sourceLevel, t0, typ) } -func newCompaction(s *session, v *version, sourceLevel int, t0 tFiles) *compaction { +func newCompaction(s *session, v *version, sourceLevel int, t0 tFiles, typ int) *compaction { c := &compaction{ s: s, v: v, + typ: typ, sourceLevel: sourceLevel, levels: [2]tFiles{t0, nil}, maxGPOverlaps: int64(s.o.GetCompactionGPOverlaps(sourceLevel)), @@ -131,6 +150,7 @@ type compaction struct { s *session v *version + typ int sourceLevel int levels [2]tFiles maxGPOverlaps int64 diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/session_util.go b/vendor/github.com/syndtr/goleveldb/leveldb/session_util.go index 67a6df979023..fc56b631f0fb 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/session_util.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/session_util.go @@ -308,7 +308,7 @@ func (s *session) setNextFileNum(num int64) { func (s *session) markFileNum(num int64) { nextFileNum := num + 1 for { - old, x := s.stNextFileNum, nextFileNum + old, x := atomic.LoadInt64(&s.stNextFileNum), nextFileNum if old > x { x = old } @@ -326,7 +326,7 @@ func (s *session) allocFileNum() int64 { // Reuse given file number. func (s *session) reuseFileNum(num int64) { for { - old, x := s.stNextFileNum, num + old, x := atomic.LoadInt64(&s.stNextFileNum), num if old != x+1 { x = old } diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/table.go b/vendor/github.com/syndtr/goleveldb/leveldb/table.go index 5ad1f805439d..b7759b2f5c23 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/table.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/table.go @@ -493,6 +493,8 @@ func (t *tOps) remove(fd storage.FileDesc) { if t.evictRemoved && t.bcache != nil { t.bcache.EvictNS(uint64(fd.Num)) } + // Try to reuse file num, useful for discarded transaction. + t.s.reuseFileNum(fd.Num) }) } diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/table/reader.go b/vendor/github.com/syndtr/goleveldb/leveldb/table/reader.go index 16cfbaa0068a..496feb6fb458 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/table/reader.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/table/reader.go @@ -787,6 +787,10 @@ func (r *Reader) getDataIterErr(dataBH blockHandle, slice *util.Range, verifyChe // table. And a nil Range.Limit is treated as a key after all keys in // the table. // +// WARNING: Any slice returned by interator (e.g. slice returned by calling +// Iterator.Key() or Iterator.Key() methods), its content should not be modified +// unless noted otherwise. +// // The returned iterator is not safe for concurrent use and should be released // after use. // diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/version.go b/vendor/github.com/syndtr/goleveldb/leveldb/version.go index 2664560e1ce2..9535e3591450 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/version.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/version.go @@ -144,6 +144,7 @@ func (v *version) get(aux tFiles, ikey internalKey, ro *opt.ReadOptions, noValue } ukey := ikey.ukey() + sampleSeeks := !v.s.o.GetDisableSeeksCompaction() var ( tset *tSet @@ -161,7 +162,7 @@ func (v *version) get(aux tFiles, ikey internalKey, ro *opt.ReadOptions, noValue // Since entries never hop across level, finding key/value // in smaller level make later levels irrelevant. v.walkOverlapping(aux, ikey, func(level int, t *tFile) bool { - if level >= 0 && !tseek { + if sampleSeeks && level >= 0 && !tseek { if tset == nil { tset = &tSet{level, t} } else { diff --git a/vendor/vendor.json b/vendor/vendor.json index c74e962023b0..572d37401fb4 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -455,76 +455,76 @@ "revisionTime": "2017-07-05T02:17:15Z" }, { - "checksumSHA1": "4NTmfUj7H5J59M2wCnp3/8FWt1I=", + "checksumSHA1": "Bl4KYAyUkgJSjcdEyv3VhHQ8PVs=", "path": "github.com/syndtr/goleveldb/leveldb", - "revision": "c3a204f8e96543bb0cc090385c001078f184fc46", - "revisionTime": "2019-03-18T03:00:20Z" + "revision": "758128399b1df3a87e92df6c26c1d2063da8fabe", + "revisionTime": "2019-09-23T12:57:48Z" }, { "checksumSHA1": "mPNraL2edpk/2FYq26rSXfMHbJg=", "path": "github.com/syndtr/goleveldb/leveldb/cache", - "revision": "b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae", - "revisionTime": "2018-11-28T10:09:59Z" + "revision": "758128399b1df3a87e92df6c26c1d2063da8fabe", + "revisionTime": "2019-09-23T12:57:48Z" }, { "checksumSHA1": "UA+PKDKWlDnE2OZblh23W6wZwbY=", "path": "github.com/syndtr/goleveldb/leveldb/comparer", - "revision": "b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae", - "revisionTime": "2018-11-28T10:09:59Z" + "revision": "758128399b1df3a87e92df6c26c1d2063da8fabe", + "revisionTime": "2019-09-23T12:57:48Z" }, { "checksumSHA1": "1DRAxdlWzS4U0xKN/yQ/fdNN7f0=", "path": "github.com/syndtr/goleveldb/leveldb/errors", - "revision": "b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae", - "revisionTime": "2018-11-28T10:09:59Z" + "revision": "758128399b1df3a87e92df6c26c1d2063da8fabe", + "revisionTime": "2019-09-23T12:57:48Z" }, { - "checksumSHA1": "eqKeD6DS7eNCtxVYZEHHRKkyZrw=", + "checksumSHA1": "iBorxU3FBbau81WSyVa8KwcutzA=", "path": "github.com/syndtr/goleveldb/leveldb/filter", - "revision": "b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae", - "revisionTime": "2018-11-28T10:09:59Z" + "revision": "758128399b1df3a87e92df6c26c1d2063da8fabe", + "revisionTime": "2019-09-23T12:57:48Z" }, { "checksumSHA1": "hPyFsMiqZ1OB7MX+6wIAA6nsdtc=", "path": "github.com/syndtr/goleveldb/leveldb/iterator", - "revision": "b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae", - "revisionTime": "2018-11-28T10:09:59Z" + "revision": "758128399b1df3a87e92df6c26c1d2063da8fabe", + "revisionTime": "2019-09-23T12:57:48Z" }, { "checksumSHA1": "gJY7bRpELtO0PJpZXgPQ2BYFJ88=", "path": "github.com/syndtr/goleveldb/leveldb/journal", - "revision": "b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae", - "revisionTime": "2018-11-28T10:09:59Z" + "revision": "758128399b1df3a87e92df6c26c1d2063da8fabe", + "revisionTime": "2019-09-23T12:57:48Z" }, { - "checksumSHA1": "MtYY1b2234y/MlS+djL8tXVAcQs=", + "checksumSHA1": "2ncG38FDk2thSlrHd7JFmiuvnxA=", "path": "github.com/syndtr/goleveldb/leveldb/memdb", - "revision": "b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae", - "revisionTime": "2018-11-28T10:09:59Z" + "revision": "758128399b1df3a87e92df6c26c1d2063da8fabe", + "revisionTime": "2019-09-23T12:57:48Z" }, { - "checksumSHA1": "o2TorI3z+vc+EBMJ8XeFoUmXBtU=", + "checksumSHA1": "LC+WnyNq4O2J9SHuVfWL19wZH48=", "path": "github.com/syndtr/goleveldb/leveldb/opt", - "revision": "b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae", - "revisionTime": "2018-11-28T10:09:59Z" + "revision": "758128399b1df3a87e92df6c26c1d2063da8fabe", + "revisionTime": "2019-09-23T12:57:48Z" }, { "checksumSHA1": "ZnyuciM+R19NG8L5YS3TIJdo1e8=", "path": "github.com/syndtr/goleveldb/leveldb/storage", - "revision": "b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae", - "revisionTime": "2018-11-28T10:09:59Z" + "revision": "758128399b1df3a87e92df6c26c1d2063da8fabe", + "revisionTime": "2019-09-23T12:57:48Z" }, { - "checksumSHA1": "gWFPMz8OQeul0t54RM66yMTX49g=", + "checksumSHA1": "DS0i9KReIeZn3T1Bpu31xPMtzio=", "path": "github.com/syndtr/goleveldb/leveldb/table", - "revision": "b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae", - "revisionTime": "2018-11-28T10:09:59Z" + "revision": "758128399b1df3a87e92df6c26c1d2063da8fabe", + "revisionTime": "2019-09-23T12:57:48Z" }, { "checksumSHA1": "V/Dh7NV0/fy/5jX1KaAjmGcNbzI=", "path": "github.com/syndtr/goleveldb/leveldb/util", - "revision": "b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae", - "revisionTime": "2018-11-28T10:09:59Z" + "revision": "758128399b1df3a87e92df6c26c1d2063da8fabe", + "revisionTime": "2019-09-23T12:57:48Z" }, { "checksumSHA1": "SsMMqb3xn7hg1ZX5ugwZz5rzpx0=", From a2a60869c8f6e44b7b44ee53b3a490e686ab0267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Fri, 27 Sep 2019 17:41:47 +0300 Subject: [PATCH 43/50] p2p: measure subprotocol bandwidth usage --- p2p/message.go | 6 +++++- p2p/peer.go | 8 ++++++++ p2p/rlpx.go | 6 ++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/p2p/message.go b/p2p/message.go index b987732225fb..10b55a939c9b 100644 --- a/p2p/message.go +++ b/p2p/message.go @@ -39,9 +39,13 @@ import ( // separate Msg with a bytes.Reader as Payload for each send. type Msg struct { Code uint64 - Size uint32 // size of the paylod + Size uint32 // Size of the raw payload Payload io.Reader ReceivedAt time.Time + + meterCap Cap // Protocol name and version for egress metering + meterCode uint64 // Message within protocol for egress metering + meterSize uint32 // Compressed message size for ingress metering } // Decode parses the RLP content of a message into diff --git a/p2p/peer.go b/p2p/peer.go index 372ba8d0274f..9a9788bc1759 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -28,6 +28,7 @@ import ( "github.com/ethereum/go-ethereum/common/mclock" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/enr" "github.com/ethereum/go-ethereum/rlp" @@ -300,6 +301,9 @@ func (p *Peer) handle(msg Msg) error { if err != nil { return fmt.Errorf("msg code out of range: %v", msg.Code) } + if metrics.Enabled { + metrics.GetOrRegisterMeter(fmt.Sprintf("%s/%s/%d/%#02x", MetricsInboundTraffic, proto.Name, proto.Version, msg.Code-proto.offset), nil).Mark(int64(msg.meterSize)) + } select { case proto.in <- msg: return nil @@ -398,7 +402,11 @@ func (rw *protoRW) WriteMsg(msg Msg) (err error) { if msg.Code >= rw.Length { return newPeerError(errInvalidMsgCode, "not handled") } + msg.meterCap = rw.cap() + msg.meterCode = msg.Code + msg.Code += rw.offset + select { case <-rw.wstart: err = rw.w.WriteMsg(msg) diff --git a/p2p/rlpx.go b/p2p/rlpx.go index 52e1eb8a4aa8..115021fa9477 100644 --- a/p2p/rlpx.go +++ b/p2p/rlpx.go @@ -38,6 +38,7 @@ import ( "github.com/ethereum/go-ethereum/common/bitutil" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" + "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/rlp" "github.com/golang/snappy" "golang.org/x/crypto/sha3" @@ -602,6 +603,10 @@ func (rw *rlpxFrameRW) WriteMsg(msg Msg) error { msg.Payload = bytes.NewReader(payload) msg.Size = uint32(len(payload)) } + msg.meterSize = msg.Size + if metrics.Enabled && msg.meterCap.Name != "" { // don't meter non-subprotocol messages + metrics.GetOrRegisterMeter(fmt.Sprintf("%s/%s/%d/%#02x", MetricsOutboundTraffic, msg.meterCap.Name, msg.meterCap.Version, msg.meterCode), nil).Mark(int64(msg.meterSize)) + } // write header headbuf := make([]byte, 32) fsize := uint32(len(ptype)) + msg.Size @@ -686,6 +691,7 @@ func (rw *rlpxFrameRW) ReadMsg() (msg Msg, err error) { return msg, err } msg.Size = uint32(content.Len()) + msg.meterSize = msg.Size msg.Payload = content // if snappy is enabled, verify and decompress message From b2f696e0258ca57adc8f3568eaadd487bd622eb1 Mon Sep 17 00:00:00 2001 From: kikilass <36239971+kikilass@users.noreply.github.com> Date: Tue, 1 Oct 2019 01:27:20 +0530 Subject: [PATCH 44/50] github: Added capital P (#20139) --- .github/ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 7d80659b0d2e..4e638166ff71 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,6 +1,6 @@ Hi there, -please note that this is an issue tracker reserved for bug reports and feature requests. +Please note that this is an issue tracker reserved for bug reports and feature requests. For general questions please use the gitter channel or the Ethereum stack exchange at https://ethereum.stackexchange.com. From 7f5f62aaa082a270860c5206383fa671e960571d Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Wed, 2 Oct 2019 10:33:51 +0200 Subject: [PATCH 45/50] tests: update test suite for istanbul (#20082) * update tests for istanbul * tests: updated blockchaintests, see https://github.com/ethereum/tests/issues/637 * tests: update again, hopefully fixed this time * tests: skip time consuming, run legacy tests * tests: update again * build: disable long-running tests on travis * tests: fix formatting nits * tests: I hate github's editor --- build/ci.go | 2 +- tests/block_test.go | 23 +++++++++++++---------- tests/init_test.go | 1 + tests/state_test.go | 20 ++++++++++++++++++-- tests/testdata | 2 +- 5 files changed, 34 insertions(+), 14 deletions(-) diff --git a/build/ci.go b/build/ci.go index 002f6bb15297..347cf95e6861 100644 --- a/build/ci.go +++ b/build/ci.go @@ -315,7 +315,7 @@ func doTest(cmdline []string) { // Test a single package at a time. CI builders are slow // and some tests run into timeouts under load. gotest := goTool("test", buildFlags(env)...) - gotest.Args = append(gotest.Args, "-p", "1", "-timeout", "5m") + gotest.Args = append(gotest.Args, "-p", "1", "-timeout", "5m", "--short") if *coverage { gotest.Args = append(gotest.Args, "-covermode=atomic", "-cover") } diff --git a/tests/block_test.go b/tests/block_test.go index 33eaed1e1a2a..3a55e4c34fba 100644 --- a/tests/block_test.go +++ b/tests/block_test.go @@ -25,17 +25,9 @@ func TestBlockchain(t *testing.T) { bt := new(testMatcher) // General state tests are 'exported' as blockchain tests, but we can run them natively. - bt.skipLoad(`^ValidBlocks/bcStateTests/`) - // Skip random failures due to selfish mining test. + bt.skipLoad(`^GeneralStateTests/`) + // Skip random failures due to selfish mining test bt.skipLoad(`.*bcForgedTest/bcForkUncle\.json`) - bt.skipLoad(`.*bcMultiChainTest/(ChainAtoChainB_blockorder|CallContractFromNotBestBlock)`) - bt.skipLoad(`.*bcTotalDifficultyTest/(lotsOfLeafs|lotsOfBranches|sideChainWithMoreTransactions)`) - - // These are not formatted like the rest -- due to the large postState, the postState - // was replaced by a hash, instead of a genesisAlloc map - // See https://github.com/ethereum/tests/pull/616 - bt.skipLoad(`.*bcExploitTest/ShanghaiLove.json`) - bt.skipLoad(`.*bcExploitTest/SuicideIssue.json`) // Slow tests bt.slow(`.*bcExploitTest/DelegateCallSpam.json`) @@ -45,9 +37,20 @@ func TestBlockchain(t *testing.T) { bt.slow(`.*/bcGasPricerTest/RPC_API_Test.json`) bt.slow(`.*/bcWalletTest/`) + // Very slow test + bt.skipLoad(`.*/stTimeConsuming/.*`) + + // test takes a lot for time and goes easily OOM because of sha3 calculation on a huge range, + // using 4.6 TGas + bt.skipLoad(`.*randomStatetest94.json.*`) + bt.walk(t, blockTestDir, func(t *testing.T, name string, test *BlockTest) { if err := bt.checkFailure(t, name, test.Run()); err != nil { t.Error(err) } }) + + // There is also a LegacyTests folder, containing blockchain tests generated + // prior to Istanbul. However, they are all derived from GeneralStateTests, + // which run natively, so there's no reason to run them here. } diff --git a/tests/init_test.go b/tests/init_test.go index d715de02fbe0..622318adb988 100644 --- a/tests/init_test.go +++ b/tests/init_test.go @@ -49,6 +49,7 @@ var ( baseDir = filepath.Join(".", "testdata") blockTestDir = filepath.Join(baseDir, "BlockchainTests") stateTestDir = filepath.Join(baseDir, "GeneralStateTests") + legacyStateTestDir = filepath.Join(baseDir, "LegacyTests", "Constantinople", "GeneralStateTests") transactionTestDir = filepath.Join(baseDir, "TransactionTests") vmTestDir = filepath.Join(baseDir, "VMTests") rlpTestDir = filepath.Join(baseDir, "RLPTests") diff --git a/tests/state_test.go b/tests/state_test.go index d25b157275b4..c6a6947bcea3 100644 --- a/tests/state_test.go +++ b/tests/state_test.go @@ -40,9 +40,11 @@ func TestState(t *testing.T) { st.slow(`^stStaticCall/static_Call1MB`) st.slow(`^stSystemOperationsTest/CallRecursiveBomb`) st.slow(`^stTransactionTest/Opcodes_TransactionInit`) + + // Very time consuming + st.skipLoad(`^stTimeConsuming/`) + // Broken tests: - st.skipLoad(`^stTransactionTest/OverflowGasRequire\.json`) // gasLimit > 256 bits - st.skipLoad(`^stTransactionTest/zeroSigTransa[^/]*\.json`) // EIP-86 is not supported yet // Expected failures: //st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Byzantium/0`, "bug in test") //st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Byzantium/3`, "bug in test") @@ -64,6 +66,20 @@ func TestState(t *testing.T) { }) } }) + // For Istanbul, older tests were moved into LegacyTests + st.walk(t, legacyStateTestDir, func(t *testing.T, name string, test *StateTest) { + for _, subtest := range test.Subtests() { + subtest := subtest + key := fmt.Sprintf("%s/%d", subtest.Fork, subtest.Index) + name := name + "/" + key + t.Run(key, func(t *testing.T) { + withTrace(t, test.gasLimit(subtest), func(vmconfig vm.Config) error { + _, err := test.Run(subtest, vmconfig) + return st.checkFailure(t, name, err) + }) + }) + } + }) } // Transactions with gasLimit above this value will not get a VM trace on failure. diff --git a/tests/testdata b/tests/testdata index 553c0ea76c73..b5eb9900ee21 160000 --- a/tests/testdata +++ b/tests/testdata @@ -1 +1 @@ -Subproject commit 553c0ea76c739dbb97a8af9fb81c51510bf7493d +Subproject commit b5eb9900ee2147b40d3e681fe86efa4fd693959a From c713ea7c222c81d650908dcc3d69dbaf0fe63557 Mon Sep 17 00:00:00 2001 From: Darrel Herbst Date: Wed, 2 Oct 2019 05:32:02 -0400 Subject: [PATCH 46/50] cmd/bootnode: fix exit behavior with -genkey (#20110) --- cmd/bootnode/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/bootnode/main.go b/cmd/bootnode/main.go index 2f9bba111769..f6e2a14c3bd2 100644 --- a/cmd/bootnode/main.go +++ b/cmd/bootnode/main.go @@ -70,7 +70,9 @@ func main() { if err = crypto.SaveECDSA(*genKey, nodeKey); err != nil { utils.Fatalf("%v", err) } - return + if !*writeAddr { + return + } case *nodeKeyFile == "" && *nodeKeyHex == "": utils.Fatalf("Use -nodekey or -nodekeyhex to specify a private key") case *nodeKeyFile != "" && *nodeKeyHex != "": From 6e730915bd6382006970431fe6ca0290b79be0e0 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 2 Oct 2019 13:14:27 +0200 Subject: [PATCH 47/50] les: add empty "les" ENR entry for servers (#20145) --- les/enr_entry.go | 32 ++++++++++++++++++++++++++++++++ les/server.go | 8 +++++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 les/enr_entry.go diff --git a/les/enr_entry.go b/les/enr_entry.go new file mode 100644 index 000000000000..c2a92dd999fa --- /dev/null +++ b/les/enr_entry.go @@ -0,0 +1,32 @@ +// Copyright 2019 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + +package les + +import ( + "github.com/ethereum/go-ethereum/rlp" +) + +// lesEntry is the "les" ENR entry. This is set for LES servers only. +type lesEntry struct { + // Ignore additional fields (for forward compatibility). + Rest []rlp.RawValue `rlp:"tail"` +} + +// ENRKey implements enr.Entry. +func (e lesEntry) ENRKey() string { + return "les" +} diff --git a/les/server.go b/les/server.go index 592858cb91e4..7e11833fb664 100644 --- a/les/server.go +++ b/les/server.go @@ -30,6 +30,7 @@ import ( "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/discv5" "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enr" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" ) @@ -136,12 +137,17 @@ func (s *LesServer) APIs() []rpc.API { } func (s *LesServer) Protocols() []p2p.Protocol { - return s.makeProtocols(ServerProtocolVersions, s.handler.runPeer, func(id enode.ID) interface{} { + ps := s.makeProtocols(ServerProtocolVersions, s.handler.runPeer, func(id enode.ID) interface{} { if p := s.peers.Peer(peerIdToString(id)); p != nil { return p.Info() } return nil }) + // Add "les" ENR entries. + for i := range ps { + ps[i].Attributes = []enr.Entry{&lesEntry{}} + } + return ps } // Start starts the LES server From bd05968077f27f7eb083404dd8448157996a8788 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 3 Oct 2019 11:29:20 +0200 Subject: [PATCH 48/50] params: release Geth v1.9.6 stable --- params/version.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/params/version.go b/params/version.go index 51033baa5c61..193f75771368 100644 --- a/params/version.go +++ b/params/version.go @@ -21,10 +21,10 @@ import ( ) const ( - VersionMajor = 1 // Major version component of the current release - VersionMinor = 9 // Minor version component of the current release - VersionPatch = 6 // Patch version component of the current release - VersionMeta = "unstable" // Version metadata to append to the version string + VersionMajor = 1 // Major version component of the current release + VersionMinor = 9 // Minor version component of the current release + VersionPatch = 6 // Patch version component of the current release + VersionMeta = "stable" // Version metadata to append to the version string ) // Version holds the textual version string. From 86f4f689ff97bd56a5ec45b434b4bf86f9bfd3d9 Mon Sep 17 00:00:00 2001 From: hackyminer Date: Wed, 30 Oct 2019 22:17:24 +0900 Subject: [PATCH 49/50] Revert importpath to merge go-ethereum 1.9.6 --- accounts/abi/abi.go | 2 +- accounts/abi/abi_test.go | 4 +- accounts/abi/bind/auth.go | 12 ++-- accounts/abi/bind/backend.go | 6 +- accounts/abi/bind/backends/simulated.go | 32 +++++----- accounts/abi/bind/backends/simulated_test.go | 14 ++--- accounts/abi/bind/base.go | 12 ++-- accounts/abi/bind/base_test.go | 16 ++--- accounts/abi/bind/bind.go | 4 +- accounts/abi/bind/bind_test.go | 2 +- accounts/abi/bind/template.go | 14 ++--- accounts/abi/bind/topics.go | 6 +- accounts/abi/bind/topics_test.go | 4 +- accounts/abi/bind/util.go | 6 +- accounts/abi/bind/util_test.go | 12 ++-- accounts/abi/event.go | 4 +- accounts/abi/event_test.go | 4 +- accounts/abi/method.go | 2 +- accounts/abi/numbers.go | 4 +- accounts/abi/pack.go | 4 +- accounts/abi/pack_test.go | 2 +- accounts/abi/type_test.go | 2 +- accounts/abi/unpack.go | 2 +- accounts/abi/unpack_test.go | 2 +- accounts/accounts.go | 8 +-- accounts/accounts_test.go | 2 +- accounts/external/backend.go | 20 +++--- accounts/keystore/account_cache.go | 6 +- accounts/keystore/account_cache_test.go | 4 +- accounts/keystore/file_cache.go | 2 +- accounts/keystore/key.go | 6 +- accounts/keystore/keystore.go | 10 +-- accounts/keystore/keystore_test.go | 6 +- accounts/keystore/passphrase.go | 8 +-- accounts/keystore/passphrase_test.go | 2 +- accounts/keystore/plain.go | 2 +- accounts/keystore/plain_test.go | 4 +- accounts/keystore/presale.go | 4 +- accounts/keystore/wallet.go | 8 +-- accounts/keystore/watch.go | 2 +- accounts/manager.go | 4 +- accounts/scwallet/hub.go | 8 +-- accounts/scwallet/securechannel.go | 2 +- accounts/scwallet/wallet.go | 12 ++-- accounts/usbwallet/hub.go | 6 +- accounts/usbwallet/ledger.go | 14 ++--- accounts/usbwallet/trezor.go | 12 ++-- accounts/usbwallet/wallet.go | 12 ++-- build/ci.go | 4 +- cmd/abigen/main.go | 10 +-- cmd/bootnode/main.go | 16 ++--- cmd/checkpoint-admin/common.go | 18 +++--- cmd/checkpoint-admin/exec.go | 22 +++---- cmd/checkpoint-admin/main.go | 6 +- cmd/checkpoint-admin/status.go | 4 +- cmd/clef/main.go | 36 +++++------ cmd/devp2p/discv4cmd.go | 8 +-- cmd/devp2p/enrcmd.go | 6 +- cmd/devp2p/main.go | 4 +- cmd/ethkey/changepassword.go | 4 +- cmd/ethkey/generate.go | 6 +- cmd/ethkey/inspect.go | 6 +- cmd/ethkey/main.go | 2 +- cmd/ethkey/message.go | 8 +-- cmd/ethkey/run_test.go | 2 +- cmd/ethkey/utils.go | 6 +- cmd/evm/compiler.go | 2 +- cmd/evm/disasm.go | 2 +- cmd/evm/internal/compiler/compiler.go | 2 +- cmd/evm/main.go | 2 +- cmd/evm/runner.go | 20 +++--- cmd/evm/staterunner.go | 8 +-- cmd/faucet/faucet.go | 34 +++++----- cmd/geth/accountcmd.go | 12 ++-- cmd/geth/chaincmd.go | 22 +++---- cmd/geth/config.go | 12 ++-- cmd/geth/consolecmd.go | 8 +-- cmd/geth/consolecmd_test.go | 2 +- cmd/geth/dao_test.go | 6 +- cmd/geth/main.go | 26 ++++---- cmd/geth/misccmd.go | 8 +-- cmd/geth/retesteth.go | 40 ++++++------ cmd/geth/retesteth_copypaste.go | 6 +- cmd/geth/run_test.go | 2 +- cmd/geth/usage.go | 4 +- cmd/p2psim/main.go | 12 ++-- cmd/puppeth/genesis.go | 12 ++-- cmd/puppeth/genesis_test.go | 2 +- cmd/puppeth/module.go | 2 +- cmd/puppeth/module_dashboard.go | 2 +- cmd/puppeth/module_ethstats.go | 2 +- cmd/puppeth/module_explorer.go | 2 +- cmd/puppeth/module_faucet.go | 4 +- cmd/puppeth/module_nginx.go | 2 +- cmd/puppeth/module_node.go | 4 +- cmd/puppeth/module_wallet.go | 2 +- cmd/puppeth/puppeth.go | 2 +- cmd/puppeth/ssh.go | 2 +- cmd/puppeth/wizard.go | 6 +- cmd/puppeth/wizard_dashboard.go | 2 +- cmd/puppeth/wizard_ethstats.go | 2 +- cmd/puppeth/wizard_explorer.go | 2 +- cmd/puppeth/wizard_faucet.go | 4 +- cmd/puppeth/wizard_genesis.go | 8 +-- cmd/puppeth/wizard_intro.go | 2 +- cmd/puppeth/wizard_netstats.go | 4 +- cmd/puppeth/wizard_network.go | 2 +- cmd/puppeth/wizard_nginx.go | 2 +- cmd/puppeth/wizard_node.go | 6 +- cmd/puppeth/wizard_wallet.go | 2 +- cmd/rlpdump/main.go | 2 +- cmd/utils/cmd.go | 20 +++--- cmd/utils/customflags.go | 2 +- cmd/utils/flags.go | 62 +++++++++---------- cmd/wnode/main.go | 20 +++--- common/bitutil/compress_test.go | 2 +- common/hexutil/json_example_test.go | 2 +- common/math/big_test.go | 2 +- common/prque/lazyqueue.go | 2 +- common/prque/lazyqueue_test.go | 2 +- common/types.go | 2 +- consensus/clique/api.go | 8 +-- consensus/clique/clique.go | 26 ++++---- consensus/clique/clique_test.go | 14 ++--- consensus/clique/snapshot.go | 10 +-- consensus/clique/snapshot_test.go | 14 ++--- consensus/consensus.go | 10 +-- consensus/ethash/algorithm.go | 8 +-- consensus/ethash/algorithm_test.go | 6 +- consensus/ethash/api.go | 6 +- consensus/ethash/consensus.go | 16 ++--- consensus/ethash/consensus_test.go | 6 +- consensus/ethash/ethash.go | 12 ++-- consensus/ethash/ethash_test.go | 6 +- consensus/ethash/sealer.go | 10 +-- consensus/ethash/sealer_test.go | 4 +- consensus/misc/dao.go | 6 +- consensus/misc/forks.go | 6 +- console/bridge.go | 8 +-- console/console.go | 6 +- console/console_test.go | 14 ++--- contracts/checkpointoracle/contract/oracle.go | 12 ++-- contracts/checkpointoracle/oracle.go | 8 +-- contracts/checkpointoracle/oracle_test.go | 14 ++--- core/asm/asm.go | 2 +- core/asm/compiler.go | 4 +- core/bench_test.go | 18 +++--- core/block_validator.go | 8 +-- core/block_validator_test.go | 10 +-- core/blockchain.go | 30 ++++----- core/blockchain_insert.go | 8 +-- core/blockchain_test.go | 20 +++--- core/blocks.go | 2 +- core/bloombits/generator.go | 2 +- core/bloombits/generator_test.go | 2 +- core/bloombits/matcher.go | 4 +- core/bloombits/matcher_test.go | 2 +- core/chain_indexer.go | 12 ++-- core/chain_indexer_test.go | 6 +- core/chain_makers.go | 16 ++--- core/chain_makers_test.go | 12 ++-- core/dao_test.go | 8 +-- core/events.go | 4 +- core/evm.go | 8 +-- core/forkid/forkid.go | 8 +-- core/forkid/forkid_test.go | 6 +- core/gen_genesis.go | 8 +-- core/gen_genesis_account.go | 6 +- core/genesis.go | 22 +++---- core/genesis_test.go | 12 ++-- core/headerchain.go | 14 ++--- core/helper_test.go | 8 +-- core/mkalloc.go | 4 +- core/rawdb/accessors_chain.go | 12 ++-- core/rawdb/accessors_chain_test.go | 8 +-- core/rawdb/accessors_indexes.go | 12 ++-- core/rawdb/accessors_indexes_test.go | 8 +-- core/rawdb/accessors_metadata.go | 10 +-- core/rawdb/database.go | 10 +-- core/rawdb/freezer.go | 10 +-- core/rawdb/freezer_reinit.go | 10 +-- core/rawdb/freezer_table.go | 6 +- core/rawdb/freezer_table_test.go | 2 +- core/rawdb/schema.go | 4 +- core/rawdb/table.go | 2 +- core/state/database.go | 6 +- core/state/dump.go | 10 +-- core/state/iterator.go | 6 +- core/state/iterator_test.go | 4 +- core/state/journal.go | 2 +- core/state/state_object.go | 8 +-- core/state/state_test.go | 8 +-- core/state/statedb.go | 14 ++--- core/state/statedb_test.go | 6 +- core/state/sync.go | 8 +-- core/state/sync_test.go | 12 ++-- core/state_prefetcher.go | 12 ++-- core/state_processor.go | 16 ++--- core/state_transition.go | 8 +-- core/tx_cacher.go | 2 +- core/tx_journal.go | 8 +-- core/tx_list.go | 6 +- core/tx_list_test.go | 4 +- core/tx_noncer.go | 4 +- core/tx_pool.go | 16 ++--- core/tx_pool_test.go | 14 ++--- core/types.go | 6 +- core/types/block.go | 6 +- core/types/block_test.go | 4 +- core/types/bloom9.go | 4 +- core/types/bloom9_test.go | 2 +- core/types/derive_sha.go | 6 +- core/types/gen_header_json.go | 4 +- core/types/gen_log_json.go | 4 +- core/types/gen_receipt_json.go | 4 +- core/types/gen_tx_json.go | 4 +- core/types/log.go | 6 +- core/types/log_test.go | 4 +- core/types/receipt.go | 10 +-- core/types/receipt_test.go | 8 +-- core/types/transaction.go | 8 +-- core/types/transaction_signing.go | 6 +- core/types/transaction_signing_test.go | 6 +- core/types/transaction_test.go | 6 +- core/vm/analysis_test.go | 2 +- core/vm/common.go | 4 +- core/vm/contract.go | 2 +- core/vm/contracts.go | 12 ++-- core/vm/contracts_test.go | 2 +- core/vm/eips.go | 2 +- core/vm/evm.go | 6 +- core/vm/gas_table.go | 6 +- core/vm/gas_table_test.go | 10 +-- core/vm/gen_structlog.go | 6 +- core/vm/instructions.go | 8 +-- core/vm/instructions_test.go | 6 +- core/vm/interface.go | 4 +- core/vm/interpreter.go | 6 +- core/vm/jump_table.go | 2 +- core/vm/logger.go | 8 +-- core/vm/logger_json.go | 4 +- core/vm/logger_test.go | 6 +- core/vm/memory.go | 2 +- core/vm/runtime/env.go | 6 +- core/vm/runtime/runtime.go | 12 ++-- core/vm/runtime/runtime_example_test.go | 4 +- core/vm/runtime/runtime_test.go | 12 ++-- core/vm/stack_table.go | 2 +- crypto/bn256/bn256_fast.go | 2 +- crypto/bn256/bn256_fuzz.go | 4 +- crypto/bn256/bn256_slow.go | 2 +- crypto/crypto.go | 6 +- crypto/crypto_test.go | 4 +- crypto/ecies/ecies_test.go | 2 +- crypto/ecies/params.go | 2 +- crypto/signature_cgo.go | 4 +- crypto/signature_test.go | 6 +- dashboard/cpu.go | 2 +- dashboard/dashboard.go | 8 +-- dashboard/log.go | 2 +- dashboard/peers.go | 6 +- dashboard/system.go | 4 +- eth/api.go | 20 +++--- eth/api_backend.go | 30 ++++----- eth/api_test.go | 8 +-- eth/api_tracer.go | 26 ++++---- eth/backend.go | 52 ++++++++-------- eth/bloombits.go | 14 ++--- eth/config.go | 14 ++--- eth/downloader/api.go | 6 +- eth/downloader/downloader.go | 20 +++--- eth/downloader/downloader_test.go | 14 ++--- eth/downloader/events.go | 2 +- eth/downloader/fakepeer.go | 10 +-- eth/downloader/metrics.go | 2 +- eth/downloader/peer.go | 6 +- eth/downloader/queue.go | 10 +-- eth/downloader/statesync.go | 12 ++-- eth/downloader/testchain_test.go | 14 ++--- eth/downloader/types.go | 2 +- eth/enr_entry.go | 8 +-- eth/fetcher/fetcher.go | 10 +-- eth/fetcher/fetcher_test.go | 14 ++--- eth/fetcher/metrics.go | 2 +- eth/filters/api.go | 14 ++--- eth/filters/api_test.go | 4 +- eth/filters/bench_test.go | 16 ++--- eth/filters/filter.go | 14 ++--- eth/filters/filter_system.go | 16 ++--- eth/filters/filter_system_test.go | 22 +++---- eth/filters/filter_test.go | 16 ++--- eth/gasprice/gasprice.go | 10 +-- eth/gen_config.go | 14 ++--- eth/handler.go | 28 ++++----- eth/handler_test.go | 24 +++---- eth/helper_test.go | 26 ++++---- eth/metrics.go | 4 +- eth/peer.go | 8 +-- eth/protocol.go | 10 +-- eth/protocol_test.go | 12 ++-- eth/sync.go | 10 +-- eth/sync_test.go | 6 +- eth/tracers/tracer.go | 10 +-- eth/tracers/tracer_test.go | 8 +-- eth/tracers/tracers.go | 2 +- eth/tracers/tracers_test.go | 22 +++---- ethclient/ethclient.go | 12 ++-- ethclient/ethclient_test.go | 20 +++--- ethclient/signer.go | 4 +- ethdb/dbtest/testsuite.go | 2 +- ethdb/leveldb/leveldb.go | 8 +-- ethdb/leveldb/leveldb_test.go | 4 +- ethdb/memorydb/memorydb.go | 4 +- ethdb/memorydb/memorydb_test.go | 4 +- ethstats/ethstats.go | 22 +++---- event/example_feed_test.go | 2 +- event/example_scope_test.go | 2 +- event/example_subscription_test.go | 2 +- event/subscription.go | 2 +- graphql/graphql.go | 22 +++---- graphql/service.go | 8 +-- interfaces.go | 4 +- internal/debug/api.go | 2 +- internal/debug/flags.go | 6 +- internal/debug/trace.go | 2 +- internal/ethapi/addrlock.go | 2 +- internal/ethapi/api.go | 36 +++++------ internal/ethapi/backend.go | 24 +++---- internal/guide/guide_test.go | 4 +- internal/jsre/jsre.go | 4 +- internal/testlog/testlog.go | 2 +- les/api.go | 2 +- les/api_backend.go | 32 +++++----- les/api_test.go | 24 +++---- les/balance.go | 2 +- les/benchmark.go | 22 +++---- les/bloombits.go | 4 +- les/checkpointoracle.go | 12 ++-- les/client.go | 46 +++++++------- les/client_handler.go | 16 ++--- les/clientpool.go | 12 ++-- les/clientpool_test.go | 6 +- les/commons.go | 22 +++---- les/costtracker.go | 10 +-- les/distributor.go | 2 +- les/distributor_test.go | 2 +- les/fetcher.go | 14 ++--- les/flowcontrol/control.go | 4 +- les/flowcontrol/logger.go | 2 +- les/flowcontrol/manager.go | 4 +- les/flowcontrol/manager_test.go | 2 +- les/handler_test.go | 26 ++++---- les/metrics.go | 4 +- les/odr.go | 10 +-- les/odr_requests.go | 18 +++--- les/odr_test.go | 22 +++---- les/peer.go | 22 +++---- les/peer_test.go | 18 +++--- les/protocol.go | 8 +-- les/request_test.go | 10 +-- les/retrieve.go | 4 +- les/server.go | 24 +++---- les/server_handler.go | 26 ++++---- les/serverpool.go | 16 ++--- les/servingqueue.go | 4 +- les/sync.go | 10 +-- les/sync_test.go | 10 +-- les/test_helper.go | 36 +++++------ les/txrelay.go | 6 +- les/ulc.go | 4 +- les/ulc_test.go | 6 +- light/lightchain.go | 22 +++---- light/lightchain_test.go | 14 ++--- light/nodeset.go | 8 +-- light/odr.go | 10 +-- light/odr_test.go | 26 ++++---- light/odr_util.go | 12 ++-- light/postprocess.go | 20 +++--- light/trie.go | 12 ++-- light/trie_test.go | 14 ++--- light/txpool.go | 20 +++--- light/txpool_test.go | 14 ++--- metrics/cpu_syscall.go | 2 +- metrics/exp/exp.go | 4 +- metrics/influxdb/influxdb.go | 4 +- metrics/librato/librato.go | 2 +- metrics/metrics.go | 2 +- metrics/prometheus/collector.go | 2 +- metrics/prometheus/prometheus.go | 4 +- miner/miner.go | 20 +++--- miner/stress_clique.go | 26 ++++---- miner/stress_ethash.go | 28 ++++----- miner/unconfirmed.go | 6 +- miner/unconfirmed_test.go | 4 +- miner/worker.go | 18 +++--- miner/worker_test.go | 24 +++---- mobile/accounts.go | 8 +-- mobile/android_test.go | 2 +- mobile/big.go | 2 +- mobile/bind.go | 12 ++-- mobile/common.go | 4 +- mobile/discover.go | 2 +- mobile/ethclient.go | 4 +- mobile/ethereum.go | 4 +- mobile/geth.go | 24 +++---- mobile/init.go | 2 +- mobile/interface.go | 2 +- mobile/interface_test.go | 2 +- mobile/logger.go | 2 +- mobile/p2p.go | 2 +- mobile/params.go | 6 +- mobile/primitives.go | 2 +- mobile/shhclient.go | 4 +- mobile/types.go | 8 +-- mobile/vm.go | 2 +- node/api.go | 10 +-- node/config.go | 22 +++---- node/config_test.go | 4 +- node/defaults.go | 6 +- node/node.go | 16 ++--- node/node_example_test.go | 6 +- node/node_test.go | 6 +- node/service.go | 12 ++-- node/utils_test.go | 4 +- p2p/dial.go | 6 +- p2p/dial_test.go | 10 +-- p2p/discover/common.go | 6 +- p2p/discover/node.go | 6 +- p2p/discover/ntp.go | 2 +- p2p/discover/table.go | 8 +-- p2p/discover/table_test.go | 8 +-- p2p/discover/table_util_test.go | 8 +-- p2p/discover/v4_udp.go | 12 ++-- p2p/discover/v4_udp_lookup_test.go | 4 +- p2p/discover/v4_udp_test.go | 14 ++--- p2p/discv5/database.go | 6 +- p2p/discv5/metrics.go | 2 +- p2p/discv5/net.go | 12 ++-- p2p/discv5/net_test.go | 4 +- p2p/discv5/node.go | 4 +- p2p/discv5/node_test.go | 4 +- p2p/discv5/ntp.go | 2 +- p2p/discv5/sim_test.go | 2 +- p2p/discv5/table.go | 2 +- p2p/discv5/table_test.go | 4 +- p2p/discv5/ticket.go | 8 +-- p2p/discv5/topic.go | 4 +- p2p/discv5/topic_test.go | 4 +- p2p/discv5/udp.go | 12 ++-- p2p/discv5/udp_test.go | 6 +- p2p/enode/idscheme.go | 8 +-- p2p/enode/idscheme_test.go | 6 +- p2p/enode/localnode.go | 6 +- p2p/enode/localnode_test.go | 4 +- p2p/enode/node.go | 4 +- p2p/enode/node_test.go | 4 +- p2p/enode/nodedb.go | 2 +- p2p/enode/urlv4.go | 6 +- p2p/enode/urlv4_test.go | 4 +- p2p/enr/enr.go | 2 +- p2p/enr/enr_test.go | 2 +- p2p/enr/entries.go | 2 +- p2p/message.go | 6 +- p2p/metrics.go | 8 +-- p2p/nat/nat.go | 2 +- p2p/netutil/iptrack.go | 2 +- p2p/netutil/iptrack_test.go | 2 +- p2p/peer.go | 12 ++-- p2p/peer_test.go | 2 +- p2p/protocol.go | 4 +- p2p/rlpx.go | 8 +-- p2p/rlpx_test.go | 8 +-- p2p/server.go | 22 +++---- p2p/server_test.go | 10 +-- p2p/simulations/adapters/exec.go | 10 +-- p2p/simulations/adapters/inproc.go | 14 ++--- p2p/simulations/adapters/inproc_test.go | 2 +- p2p/simulations/adapters/types.go | 14 ++--- p2p/simulations/connect.go | 2 +- p2p/simulations/connect_test.go | 6 +- p2p/simulations/examples/ping-pong.go | 14 ++--- p2p/simulations/http.go | 10 +-- p2p/simulations/http_test.go | 14 ++--- p2p/simulations/mocker.go | 6 +- p2p/simulations/mocker_test.go | 2 +- p2p/simulations/network.go | 10 +-- p2p/simulations/network_test.go | 8 +-- p2p/simulations/simulation.go | 2 +- p2p/simulations/test.go | 8 +-- p2p/testing/peerpool.go | 4 +- p2p/testing/protocolsession.go | 8 +-- p2p/testing/protocoltester.go | 16 ++--- params/config.go | 4 +- params/dao.go | 2 +- rpc/client.go | 2 +- rpc/client_example_test.go | 2 +- rpc/client_test.go | 2 +- rpc/endpoints.go | 2 +- rpc/handler.go | 2 +- rpc/http.go | 2 +- rpc/ipc.go | 4 +- rpc/ipc_unix.go | 2 +- rpc/server.go | 2 +- rpc/service.go | 2 +- rpc/types.go | 2 +- rpc/types_test.go | 2 +- rpc/websocket.go | 2 +- signer/core/api.go | 20 +++--- signer/core/api_test.go | 20 +++--- signer/core/auditlog.go | 8 +-- signer/core/cliui.go | 6 +- signer/core/signed_data.go | 18 +++--- signer/core/signed_data_test.go | 12 ++-- signer/core/stdioui.go | 6 +- signer/core/types.go | 6 +- signer/core/uiapi.go | 10 +-- signer/fourbyte/abi.go | 4 +- signer/fourbyte/abi_test.go | 4 +- signer/fourbyte/fourbyte_test.go | 4 +- signer/fourbyte/validation.go | 4 +- signer/fourbyte/validation_test.go | 6 +- signer/rules/rules.go | 10 +-- signer/rules/rules_test.go | 14 ++--- signer/storage/aes_gcm_storage.go | 2 +- signer/storage/aes_gcm_storage_test.go | 4 +- tests/block_test_util.go | 24 +++---- tests/difficulty_test.go | 4 +- tests/difficulty_test_util.go | 10 +-- tests/gen_btheader.go | 8 +-- tests/gen_difficultytest.go | 4 +- tests/gen_stenv.go | 4 +- tests/gen_sttransaction.go | 4 +- tests/gen_vmexec.go | 6 +- tests/init.go | 2 +- tests/init_test.go | 2 +- tests/rlp_test_util.go | 2 +- tests/state_test.go | 4 +- tests/state_test_util.go | 24 +++---- tests/transaction_test.go | 2 +- tests/transaction_test_util.go | 12 ++-- tests/vm_test.go | 2 +- tests/vm_test_util.go | 18 +++--- trie/database.go | 10 +-- trie/database_test.go | 4 +- trie/errors.go | 2 +- trie/hasher.go | 4 +- trie/iterator.go | 4 +- trie/iterator_test.go | 4 +- trie/node.go | 4 +- trie/proof.go | 8 +-- trie/proof_test.go | 6 +- trie/secure_trie.go | 4 +- trie/secure_trie_test.go | 6 +- trie/sync.go | 6 +- trie/sync_bloom.go | 8 +-- trie/sync_test.go | 4 +- trie/trie.go | 6 +- trie/trie_test.go | 12 ++-- whisper/mailserver/mailserver.go | 10 +-- whisper/mailserver/server_test.go | 6 +- whisper/shhclient/client.go | 8 +-- whisper/whisperv6/api.go | 12 ++-- whisper/whisperv6/benchmarks_test.go | 2 +- whisper/whisperv6/doc.go | 2 +- whisper/whisperv6/envelope.go | 8 +-- whisper/whisperv6/envelope_test.go | 2 +- whisper/whisperv6/filter.go | 6 +- whisper/whisperv6/filter_test.go | 4 +- whisper/whisperv6/gen_criteria_json.go | 2 +- whisper/whisperv6/gen_message_json.go | 2 +- whisper/whisperv6/gen_newmessage_json.go | 2 +- whisper/whisperv6/message.go | 8 +-- whisper/whisperv6/message_test.go | 6 +- whisper/whisperv6/peer.go | 8 +-- whisper/whisperv6/peer_test.go | 14 ++--- whisper/whisperv6/topic.go | 4 +- whisper/whisperv6/whisper.go | 12 ++-- whisper/whisperv6/whisper_test.go | 2 +- 578 files changed, 2391 insertions(+), 2391 deletions(-) diff --git a/accounts/abi/abi.go b/accounts/abi/abi.go index e145cbdd7982..7831a5ed334a 100644 --- a/accounts/abi/abi.go +++ b/accounts/abi/abi.go @@ -22,7 +22,7 @@ import ( "fmt" "io" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) // The ABI holds information about a contract's context and available diff --git a/accounts/abi/abi_test.go b/accounts/abi/abi_test.go index 6526d1fe90d1..7a795e0524f4 100644 --- a/accounts/abi/abi_test.go +++ b/accounts/abi/abi_test.go @@ -25,8 +25,8 @@ import ( "strings" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" ) const jsondata = ` diff --git a/accounts/abi/bind/auth.go b/accounts/abi/bind/auth.go index 3e9b5b9ddb54..e51f0bd8ead5 100644 --- a/accounts/abi/bind/auth.go +++ b/accounts/abi/bind/auth.go @@ -22,12 +22,12 @@ import ( "io" "io/ioutil" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/accounts/external" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/accounts/external" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" ) // NewTransactor is a utility method to easily create a transaction signer from diff --git a/accounts/abi/bind/backend.go b/accounts/abi/bind/backend.go index 687a34edb44f..ca60cc1b4320 100644 --- a/accounts/abi/bind/backend.go +++ b/accounts/abi/bind/backend.go @@ -21,9 +21,9 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" ) var ( diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index a076e03c785c..e30572e0a111 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.go @@ -24,22 +24,22 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/bloombits" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/eth/filters" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/bloombits" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/eth/filters" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rpc" ) // This nil assignment ensures compile time that SimulatedBackend implements bind.ContractBackend. diff --git a/accounts/abi/bind/backends/simulated_test.go b/accounts/abi/bind/backends/simulated_test.go index dc04ac6435fc..7e0a68c08349 100644 --- a/accounts/abi/bind/backends/simulated_test.go +++ b/accounts/abi/bind/backends/simulated_test.go @@ -21,13 +21,13 @@ import ( "math/big" "testing" - ethereum "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind/backends" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" ) func TestSimulatedBackend(t *testing.T) { diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go index 710a17b2b95a..f74a0af21173 100644 --- a/accounts/abi/bind/base.go +++ b/accounts/abi/bind/base.go @@ -22,12 +22,12 @@ import ( "fmt" "math/big" - "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/accounts/abi" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/event" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/event" ) // SignerFn is a signer function callback when a contract requires a method to diff --git a/accounts/abi/bind/base_test.go b/accounts/abi/bind/base_test.go index c5740f42c1ea..3ae685e00f0a 100644 --- a/accounts/abi/bind/base_test.go +++ b/accounts/abi/bind/base_test.go @@ -23,14 +23,14 @@ import ( "strings" "testing" - "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/accounts/abi" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/rlp" ) type mockCaller struct { diff --git a/accounts/abi/bind/bind.go b/accounts/abi/bind/bind.go index bca11136fa1e..dc51e2a7ec07 100644 --- a/accounts/abi/bind/bind.go +++ b/accounts/abi/bind/bind.go @@ -30,8 +30,8 @@ import ( "text/template" "unicode" - "github.com/ethersocial/go-ethersocial/accounts/abi" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/log" ) // Lang is a target programming language selector to generate bindings for. diff --git a/accounts/abi/bind/bind_test.go b/accounts/abi/bind/bind_test.go index 28dd635e319f..92741b99df00 100644 --- a/accounts/abi/bind/bind_test.go +++ b/accounts/abi/bind/bind_test.go @@ -26,7 +26,7 @@ import ( "strings" "testing" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) var bindTests = []struct { diff --git a/accounts/abi/bind/template.go b/accounts/abi/bind/template.go index 9293becf8a4c..4ec65474b050 100644 --- a/accounts/abi/bind/template.go +++ b/accounts/abi/bind/template.go @@ -16,7 +16,7 @@ package bind -import "github.com/ethersocial/go-ethersocial/accounts/abi" +import "github.com/ethereum/go-ethereum/accounts/abi" // tmplData is the data structure required to fill the binding template. type tmplData struct { @@ -88,12 +88,12 @@ import ( "math/big" "strings" - ethereum "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/accounts/abi" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/event" + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/accounts/abi/bind/topics.go b/accounts/abi/bind/topics.go index c836ce126f94..c7657b4a41a2 100644 --- a/accounts/abi/bind/topics.go +++ b/accounts/abi/bind/topics.go @@ -23,9 +23,9 @@ import ( "math/big" "reflect" - "github.com/ethersocial/go-ethersocial/accounts/abi" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" ) // makeTopics converts a filter query argument list into a filter topic set. diff --git a/accounts/abi/bind/topics_test.go b/accounts/abi/bind/topics_test.go index c64f61fb6cc1..ac865e5b4de8 100644 --- a/accounts/abi/bind/topics_test.go +++ b/accounts/abi/bind/topics_test.go @@ -20,8 +20,8 @@ import ( "reflect" "testing" - "github.com/ethersocial/go-ethersocial/accounts/abi" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" ) func TestMakeTopics(t *testing.T) { diff --git a/accounts/abi/bind/util.go b/accounts/abi/bind/util.go index 7ccd28df18f6..d129993ca12f 100644 --- a/accounts/abi/bind/util.go +++ b/accounts/abi/bind/util.go @@ -21,9 +21,9 @@ import ( "fmt" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" ) // WaitMined waits for tx to be mined on the blockchain. diff --git a/accounts/abi/bind/util_test.go b/accounts/abi/bind/util_test.go index 4071ee80c2f6..e0141f46e06f 100644 --- a/accounts/abi/bind/util_test.go +++ b/accounts/abi/bind/util_test.go @@ -22,12 +22,12 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind/backends" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" ) var testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") diff --git a/accounts/abi/event.go b/accounts/abi/event.go index c275b2cc52f4..f1474813afe4 100644 --- a/accounts/abi/event.go +++ b/accounts/abi/event.go @@ -20,8 +20,8 @@ import ( "fmt" "strings" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" ) // Event is an event potentially triggered by the EVM's LOG mechanism. The Event diff --git a/accounts/abi/event_test.go b/accounts/abi/event_test.go index 53dc167782b1..792e26762e89 100644 --- a/accounts/abi/event_test.go +++ b/accounts/abi/event_test.go @@ -25,8 +25,8 @@ import ( "strings" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/accounts/abi/method.go b/accounts/abi/method.go index 61a32c98fc37..7da2e18fc61a 100644 --- a/accounts/abi/method.go +++ b/accounts/abi/method.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/crypto" ) // Method represents a callable given a `Name` and whether the method is a constant. diff --git a/accounts/abi/numbers.go b/accounts/abi/numbers.go index a686fb30833c..4d706846dacd 100644 --- a/accounts/abi/numbers.go +++ b/accounts/abi/numbers.go @@ -20,8 +20,8 @@ import ( "math/big" "reflect" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" ) var ( diff --git a/accounts/abi/pack.go b/accounts/abi/pack.go index 5a013e84979c..36c58265bd4b 100644 --- a/accounts/abi/pack.go +++ b/accounts/abi/pack.go @@ -20,8 +20,8 @@ import ( "math/big" "reflect" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" ) // packBytesSlice packs the given bytes as [L, V] as the canonical representation diff --git a/accounts/abi/pack_test.go b/accounts/abi/pack_test.go index 0dd2744bd07f..f43e3905684c 100644 --- a/accounts/abi/pack_test.go +++ b/accounts/abi/pack_test.go @@ -24,7 +24,7 @@ import ( "strings" "testing" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) func TestPack(t *testing.T) { diff --git a/accounts/abi/type_test.go b/accounts/abi/type_test.go index d6d7a3c6872d..5023456aec1b 100644 --- a/accounts/abi/type_test.go +++ b/accounts/abi/type_test.go @@ -22,7 +22,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) // typeWithoutStringer is a alias for the Type type which simply doesn't implement diff --git a/accounts/abi/unpack.go b/accounts/abi/unpack.go index 060076a14b9f..b2e61d06c416 100644 --- a/accounts/abi/unpack.go +++ b/accounts/abi/unpack.go @@ -22,7 +22,7 @@ import ( "math/big" "reflect" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) var ( diff --git a/accounts/abi/unpack_test.go b/accounts/abi/unpack_test.go index 04a5faff5060..c85b86d8c004 100644 --- a/accounts/abi/unpack_test.go +++ b/accounts/abi/unpack_test.go @@ -26,7 +26,7 @@ import ( "strings" "testing" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" ) diff --git a/accounts/accounts.go b/accounts/accounts.go index c17f817e3f2f..bf5190ad98f7 100644 --- a/accounts/accounts.go +++ b/accounts/accounts.go @@ -21,10 +21,10 @@ import ( "fmt" "math/big" - ethereum "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/event" + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" "golang.org/x/crypto/sha3" ) diff --git a/accounts/accounts_test.go b/accounts/accounts_test.go index b05094895321..e8274f9f0408 100644 --- a/accounts/accounts_test.go +++ b/accounts/accounts_test.go @@ -20,7 +20,7 @@ import ( "bytes" "testing" - "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethereum/go-ethereum/common/hexutil" ) func TestTextHash(t *testing.T) { diff --git a/accounts/external/backend.go b/accounts/external/backend.go index 57127b68d9ec..6089ca984446 100644 --- a/accounts/external/backend.go +++ b/accounts/external/backend.go @@ -21,16 +21,16 @@ import ( "math/big" "sync" - "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/internal/ethapi" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/rpc" - "github.com/ethersocial/go-ethersocial/signer/core" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/internal/ethapi" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rpc" + "github.com/ethereum/go-ethereum/signer/core" ) type ExternalBackend struct { diff --git a/accounts/keystore/account_cache.go b/accounts/keystore/account_cache.go index d13801ed2acd..8f660e282f57 100644 --- a/accounts/keystore/account_cache.go +++ b/accounts/keystore/account_cache.go @@ -28,9 +28,9 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" ) // Minimum amount of time between cache reloads. This limit applies if the platform does diff --git a/accounts/keystore/account_cache_test.go b/accounts/keystore/account_cache_test.go index b3f0d9622743..fe9233c046e7 100644 --- a/accounts/keystore/account_cache_test.go +++ b/accounts/keystore/account_cache_test.go @@ -29,8 +29,8 @@ import ( "github.com/cespare/cp" "github.com/davecgh/go-spew/spew" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" ) var ( diff --git a/accounts/keystore/file_cache.go b/accounts/keystore/file_cache.go index be77faa607ce..73ff6ae9ee6f 100644 --- a/accounts/keystore/file_cache.go +++ b/accounts/keystore/file_cache.go @@ -25,7 +25,7 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // fileCache is a cache of files seen during scan of keystore. diff --git a/accounts/keystore/key.go b/accounts/keystore/key.go index 6f2fbb85d025..84d8df0c5aab 100644 --- a/accounts/keystore/key.go +++ b/accounts/keystore/key.go @@ -29,9 +29,9 @@ import ( "strings" "time" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" "github.com/pborman/uuid" ) diff --git a/accounts/keystore/keystore.go b/accounts/keystore/keystore.go index 6783aa774bc6..5b55175b1f3e 100644 --- a/accounts/keystore/keystore.go +++ b/accounts/keystore/keystore.go @@ -33,11 +33,11 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/event" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/event" ) var ( diff --git a/accounts/keystore/keystore_test.go b/accounts/keystore/keystore_test.go index 807faf3054c3..a691c5062706 100644 --- a/accounts/keystore/keystore_test.go +++ b/accounts/keystore/keystore_test.go @@ -26,9 +26,9 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/event" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/event" ) var testSigData = make([]byte, 32) diff --git a/accounts/keystore/passphrase.go b/accounts/keystore/passphrase.go index d43dd2e2175c..1ced41e9975b 100644 --- a/accounts/keystore/passphrase.go +++ b/accounts/keystore/passphrase.go @@ -38,10 +38,10 @@ import ( "os" "path/filepath" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/crypto" "github.com/pborman/uuid" "golang.org/x/crypto/pbkdf2" "golang.org/x/crypto/scrypt" diff --git a/accounts/keystore/passphrase_test.go b/accounts/keystore/passphrase_test.go index 0f21871591a6..630682cebdb1 100644 --- a/accounts/keystore/passphrase_test.go +++ b/accounts/keystore/passphrase_test.go @@ -20,7 +20,7 @@ import ( "io/ioutil" "testing" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) const ( diff --git a/accounts/keystore/plain.go b/accounts/keystore/plain.go index 728710cebc18..f62a133ce169 100644 --- a/accounts/keystore/plain.go +++ b/accounts/keystore/plain.go @@ -22,7 +22,7 @@ import ( "os" "path/filepath" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) type keyStorePlain struct { diff --git a/accounts/keystore/plain_test.go b/accounts/keystore/plain_test.go index 0dc91a597908..b831925838a4 100644 --- a/accounts/keystore/plain_test.go +++ b/accounts/keystore/plain_test.go @@ -27,8 +27,8 @@ import ( "strings" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" ) func tmpKeyStoreIface(t *testing.T, encrypted bool) (dir string, ks keyStore) { diff --git a/accounts/keystore/presale.go b/accounts/keystore/presale.go index 2f391d3b3f8d..03055245f5e7 100644 --- a/accounts/keystore/presale.go +++ b/accounts/keystore/presale.go @@ -25,8 +25,8 @@ import ( "errors" "fmt" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/crypto" "github.com/pborman/uuid" "golang.org/x/crypto/pbkdf2" ) diff --git a/accounts/keystore/wallet.go b/accounts/keystore/wallet.go index eb7e8f338592..498067d49730 100644 --- a/accounts/keystore/wallet.go +++ b/accounts/keystore/wallet.go @@ -19,10 +19,10 @@ package keystore import ( "math/big" - ethereum "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" ) // keystoreWallet implements the accounts.Wallet interface for the original diff --git a/accounts/keystore/watch.go b/accounts/keystore/watch.go index ee0bebe938ac..d6ef53327d43 100644 --- a/accounts/keystore/watch.go +++ b/accounts/keystore/watch.go @@ -21,7 +21,7 @@ package keystore import ( "time" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" "github.com/rjeczalik/notify" ) diff --git a/accounts/manager.go b/accounts/manager.go index 98863c72eb97..731d12ea30a9 100644 --- a/accounts/manager.go +++ b/accounts/manager.go @@ -21,8 +21,8 @@ import ( "sort" "sync" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/event" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/event" ) // Config contains the settings of the global account manager. diff --git a/accounts/scwallet/hub.go b/accounts/scwallet/hub.go index c02d122cadfa..5f939c658627 100644 --- a/accounts/scwallet/hub.go +++ b/accounts/scwallet/hub.go @@ -41,10 +41,10 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" pcsc "github.com/gballet/go-libpcsclite" ) diff --git a/accounts/scwallet/securechannel.go b/accounts/scwallet/securechannel.go index cffc94da6721..fad876a019c0 100644 --- a/accounts/scwallet/securechannel.go +++ b/accounts/scwallet/securechannel.go @@ -25,7 +25,7 @@ import ( "crypto/sha512" "fmt" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/crypto" pcsc "github.com/gballet/go-libpcsclite" "github.com/wsddn/go-ecdh" "golang.org/x/crypto/pbkdf2" diff --git a/accounts/scwallet/wallet.go b/accounts/scwallet/wallet.go index 8cc44d5e43b2..57b597706254 100644 --- a/accounts/scwallet/wallet.go +++ b/accounts/scwallet/wallet.go @@ -33,12 +33,12 @@ import ( "sync" "time" - ethereum "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" pcsc "github.com/gballet/go-libpcsclite" "github.com/status-im/keycard-go/derivationpath" ) diff --git a/accounts/usbwallet/hub.go b/accounts/usbwallet/hub.go index 1c6909ba0876..23be98a08483 100644 --- a/accounts/usbwallet/hub.go +++ b/accounts/usbwallet/hub.go @@ -23,9 +23,9 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" "github.com/karalabe/usb" ) diff --git a/accounts/usbwallet/ledger.go b/accounts/usbwallet/ledger.go index 9ef14d882cb4..17ca9223ffe5 100644 --- a/accounts/usbwallet/ledger.go +++ b/accounts/usbwallet/ledger.go @@ -28,13 +28,13 @@ import ( "io" "math/big" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" ) // ledgerOpcode is an enumeration encoding the supported Ledger opcodes. diff --git a/accounts/usbwallet/trezor.go b/accounts/usbwallet/trezor.go index 596dff09b98d..1892097baf65 100644 --- a/accounts/usbwallet/trezor.go +++ b/accounts/usbwallet/trezor.go @@ -27,12 +27,12 @@ import ( "io" "math/big" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/accounts/usbwallet/trezor" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/accounts/usbwallet/trezor" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" "github.com/golang/protobuf/proto" ) diff --git a/accounts/usbwallet/wallet.go b/accounts/usbwallet/wallet.go index 01f298400de8..ee539d96535d 100644 --- a/accounts/usbwallet/wallet.go +++ b/accounts/usbwallet/wallet.go @@ -25,12 +25,12 @@ import ( "sync" "time" - ethereum "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" "github.com/karalabe/usb" ) diff --git a/build/ci.go b/build/ci.go index 5631fa748924..ced325982117 100644 --- a/build/ci.go +++ b/build/ci.go @@ -58,8 +58,8 @@ import ( "strings" "time" - "github.com/ethersocial/go-ethersocial/internal/build" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/internal/build" + "github.com/ethereum/go-ethereum/params" ) var ( diff --git a/cmd/abigen/main.go b/cmd/abigen/main.go index 46bb68e6f3b1..769811500896 100644 --- a/cmd/abigen/main.go +++ b/cmd/abigen/main.go @@ -23,11 +23,11 @@ import ( "os" "strings" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/common/compiler" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/common/compiler" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/bootnode/main.go b/cmd/bootnode/main.go index 63244456a04f..286796301a8b 100644 --- a/cmd/bootnode/main.go +++ b/cmd/bootnode/main.go @@ -24,14 +24,14 @@ import ( "net" "os" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/discover" - "github.com/ethersocial/go-ethersocial/p2p/discv5" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/nat" - "github.com/ethersocial/go-ethersocial/p2p/netutil" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/discover" + "github.com/ethereum/go-ethereum/p2p/discv5" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/nat" + "github.com/ethereum/go-ethereum/p2p/netutil" ) func main() { diff --git a/cmd/checkpoint-admin/common.go b/cmd/checkpoint-admin/common.go index f5de8f5a76ff..05a45dfbf997 100644 --- a/cmd/checkpoint-admin/common.go +++ b/cmd/checkpoint-admin/common.go @@ -19,15 +19,15 @@ package main import ( "strconv" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind" - "github.com/ethersocial/go-ethersocial/accounts/external" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/contracts/checkpointoracle" - "github.com/ethersocial/go-ethersocial/ethclient" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/external" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/contracts/checkpointoracle" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rpc" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/checkpoint-admin/exec.go b/cmd/checkpoint-admin/exec.go index da4b4d18e030..352a96d9e6f0 100644 --- a/cmd/checkpoint-admin/exec.go +++ b/cmd/checkpoint-admin/exec.go @@ -25,17 +25,17 @@ import ( "strings" "time" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/contracts/checkpointoracle" - "github.com/ethersocial/go-ethersocial/contracts/checkpointoracle/contract" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethclient" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/contracts/checkpointoracle" + "github.com/ethereum/go-ethereum/contracts/checkpointoracle/contract" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rpc" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/checkpoint-admin/main.go b/cmd/checkpoint-admin/main.go index 53099f97a00c..d4ed07e99cd6 100644 --- a/cmd/checkpoint-admin/main.go +++ b/cmd/checkpoint-admin/main.go @@ -22,9 +22,9 @@ import ( "fmt" "os" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/common/fdlimit" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/common/fdlimit" + "github.com/ethereum/go-ethereum/log" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/checkpoint-admin/status.go b/cmd/checkpoint-admin/status.go index 1207ff68bd97..f613501eb35d 100644 --- a/cmd/checkpoint-admin/status.go +++ b/cmd/checkpoint-admin/status.go @@ -19,8 +19,8 @@ package main import ( "fmt" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/common" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/clef/main.go b/cmd/clef/main.go index 372e9d5099bf..9721287447ed 100644 --- a/cmd/clef/main.go +++ b/cmd/clef/main.go @@ -35,24 +35,24 @@ import ( "strings" "time" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/console" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/internal/ethapi" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/rpc" - "github.com/ethersocial/go-ethersocial/signer/core" - "github.com/ethersocial/go-ethersocial/signer/fourbyte" - "github.com/ethersocial/go-ethersocial/signer/rules" - "github.com/ethersocial/go-ethersocial/signer/storage" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/console" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/internal/ethapi" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/rpc" + "github.com/ethereum/go-ethereum/signer/core" + "github.com/ethereum/go-ethereum/signer/fourbyte" + "github.com/ethereum/go-ethereum/signer/rules" + "github.com/ethereum/go-ethereum/signer/storage" colorable "github.com/mattn/go-colorable" "github.com/mattn/go-isatty" "gopkg.in/urfave/cli.v1" diff --git a/cmd/devp2p/discv4cmd.go b/cmd/devp2p/discv4cmd.go index 159a09a2184b..1e56687a6c78 100644 --- a/cmd/devp2p/discv4cmd.go +++ b/cmd/devp2p/discv4cmd.go @@ -23,10 +23,10 @@ import ( "strings" "time" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/p2p/discover" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/p2p/discover" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/params" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/devp2p/enrcmd.go b/cmd/devp2p/enrcmd.go index 8ba888c1b5b6..15d77dd011a8 100644 --- a/cmd/devp2p/enrcmd.go +++ b/cmd/devp2p/enrcmd.go @@ -27,9 +27,9 @@ import ( "strconv" "strings" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/enr" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethereum/go-ethereum/rlp" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/devp2p/main.go b/cmd/devp2p/main.go index 978d10566949..4532ab968372 100644 --- a/cmd/devp2p/main.go +++ b/cmd/devp2p/main.go @@ -21,8 +21,8 @@ import ( "os" "path/filepath" - "github.com/ethersocial/go-ethersocial/internal/debug" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/internal/debug" + "github.com/ethereum/go-ethereum/params" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/ethkey/changepassword.go b/cmd/ethkey/changepassword.go index b4374ce34b9c..5689c26618fd 100644 --- a/cmd/ethkey/changepassword.go +++ b/cmd/ethkey/changepassword.go @@ -21,8 +21,8 @@ import ( "io/ioutil" "strings" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/cmd/utils" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/ethkey/generate.go b/cmd/ethkey/generate.go index 7e6f7a97b027..fe9a0c15192e 100644 --- a/cmd/ethkey/generate.go +++ b/cmd/ethkey/generate.go @@ -23,9 +23,9 @@ import ( "os" "path/filepath" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/crypto" "github.com/pborman/uuid" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/ethkey/inspect.go b/cmd/ethkey/inspect.go index 20b6c913839a..ba03d4d93692 100644 --- a/cmd/ethkey/inspect.go +++ b/cmd/ethkey/inspect.go @@ -21,9 +21,9 @@ import ( "fmt" "io/ioutil" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/crypto" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/ethkey/main.go b/cmd/ethkey/main.go index 1d04df173781..5b545d5f946b 100644 --- a/cmd/ethkey/main.go +++ b/cmd/ethkey/main.go @@ -20,7 +20,7 @@ import ( "fmt" "os" - "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethereum/go-ethereum/cmd/utils" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/ethkey/message.go b/cmd/ethkey/message.go index 619c02f0dd2f..5caea69ff653 100644 --- a/cmd/ethkey/message.go +++ b/cmd/ethkey/message.go @@ -21,10 +21,10 @@ import ( "fmt" "io/ioutil" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/ethkey/run_test.go b/cmd/ethkey/run_test.go index 4b4a4a8d0692..6006f6b5bb70 100644 --- a/cmd/ethkey/run_test.go +++ b/cmd/ethkey/run_test.go @@ -22,7 +22,7 @@ import ( "testing" "github.com/docker/docker/pkg/reexec" - "github.com/ethersocial/go-ethersocial/internal/cmdtest" + "github.com/ethereum/go-ethereum/internal/cmdtest" ) type testEthkey struct { diff --git a/cmd/ethkey/utils.go b/cmd/ethkey/utils.go index 2cca24f30ab4..c6cf5c25a3ba 100644 --- a/cmd/ethkey/utils.go +++ b/cmd/ethkey/utils.go @@ -22,9 +22,9 @@ import ( "io/ioutil" "strings" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/console" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/console" + "github.com/ethereum/go-ethereum/crypto" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/compiler.go b/cmd/evm/compiler.go index db8f0a3d3f83..c019a2fe70b7 100644 --- a/cmd/evm/compiler.go +++ b/cmd/evm/compiler.go @@ -21,7 +21,7 @@ import ( "fmt" "io/ioutil" - "github.com/ethersocial/go-ethersocial/cmd/evm/internal/compiler" + "github.com/ethereum/go-ethereum/cmd/evm/internal/compiler" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/disasm.go b/cmd/evm/disasm.go index cb271a0aac01..69f611e39b11 100644 --- a/cmd/evm/disasm.go +++ b/cmd/evm/disasm.go @@ -22,7 +22,7 @@ import ( "io/ioutil" "strings" - "github.com/ethersocial/go-ethersocial/core/asm" + "github.com/ethereum/go-ethereum/core/asm" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/internal/compiler/compiler.go b/cmd/evm/internal/compiler/compiler.go index cc22c5ab3d80..54981b669768 100644 --- a/cmd/evm/internal/compiler/compiler.go +++ b/cmd/evm/internal/compiler/compiler.go @@ -20,7 +20,7 @@ import ( "errors" "fmt" - "github.com/ethersocial/go-ethersocial/core/asm" + "github.com/ethereum/go-ethereum/core/asm" ) func Compile(fn string, src []byte, debug bool) (string, error) { diff --git a/cmd/evm/main.go b/cmd/evm/main.go index 7fbf3cabe56c..a5159c6b7ee4 100644 --- a/cmd/evm/main.go +++ b/cmd/evm/main.go @@ -22,7 +22,7 @@ import ( "math/big" "os" - "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethereum/go-ethereum/cmd/utils" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/runner.go b/cmd/evm/runner.go index 5dfed86db7ac..318aa222a33a 100644 --- a/cmd/evm/runner.go +++ b/cmd/evm/runner.go @@ -26,16 +26,16 @@ import ( "runtime/pprof" "time" - "github.com/ethersocial/go-ethersocial/cmd/evm/internal/compiler" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/core/vm/runtime" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/cmd/evm/internal/compiler" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/core/vm/runtime" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/staterunner.go b/cmd/evm/staterunner.go index 743f3486af94..cef2aedb5e68 100644 --- a/cmd/evm/staterunner.go +++ b/cmd/evm/staterunner.go @@ -23,10 +23,10 @@ import ( "io/ioutil" "os" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/tests" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/tests" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index c54b54ab9c38..12cd249d8f53 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -41,23 +41,23 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/ethclient" - "github.com/ethersocial/go-ethersocial/ethstats" - "github.com/ethersocial/go-ethersocial/les" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/discv5" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/nat" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/ethstats" + "github.com/ethereum/go-ethereum/les" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/discv5" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/nat" + "github.com/ethereum/go-ethereum/params" "golang.org/x/net/websocket" ) diff --git a/cmd/geth/accountcmd.go b/cmd/geth/accountcmd.go index a191e9d12089..bf0e58318763 100644 --- a/cmd/geth/accountcmd.go +++ b/cmd/geth/accountcmd.go @@ -20,12 +20,12 @@ import ( "fmt" "io/ioutil" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/console" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/console" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 428288439f68..cfd4be0a5100 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -26,17 +26,17 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/console" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/console" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/trie" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/geth/config.go b/cmd/geth/config.go index ceac284f5fe4..a6731b088bfb 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -29,12 +29,12 @@ import ( cli "gopkg.in/urfave/cli.v1" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/dashboard" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/params" - whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/dashboard" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/params" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" "github.com/naoina/toml" ) diff --git a/cmd/geth/consolecmd.go b/cmd/geth/consolecmd.go index 00e79bf5e35e..d5740c164e2d 100644 --- a/cmd/geth/consolecmd.go +++ b/cmd/geth/consolecmd.go @@ -24,10 +24,10 @@ import ( "strings" "syscall" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/console" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/console" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/rpc" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/geth/consolecmd_test.go b/cmd/geth/consolecmd_test.go index f4df509fb068..f9c1c483562e 100644 --- a/cmd/geth/consolecmd_test.go +++ b/cmd/geth/consolecmd_test.go @@ -27,7 +27,7 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/params" ) const ( diff --git a/cmd/geth/dao_test.go b/cmd/geth/dao_test.go index 62dd0cda0dc9..711cc6633387 100644 --- a/cmd/geth/dao_test.go +++ b/cmd/geth/dao_test.go @@ -23,9 +23,9 @@ import ( "path/filepath" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/params" ) // Genesis block for nodes which don't care about the DAO fork (i.e. not configured) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 5ac704cd863a..1c9d06e0d718 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -29,19 +29,19 @@ import ( "time" "github.com/elastic/gosigar" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/console" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/ethclient" - "github.com/ethersocial/go-ethersocial/internal/debug" - "github.com/ethersocial/go-ethersocial/les" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethersocial/go-ethersocial/node" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/console" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/internal/debug" + "github.com/ethereum/go-ethereum/les" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/node" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/geth/misccmd.go b/cmd/geth/misccmd.go index d73cd482a680..39ca47872bad 100644 --- a/cmd/geth/misccmd.go +++ b/cmd/geth/misccmd.go @@ -23,10 +23,10 @@ import ( "strconv" "strings" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/params" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/geth/retesteth.go b/cmd/geth/retesteth.go index fbaf30de0d2f..9469c9f5f6a6 100644 --- a/cmd/geth/retesteth.go +++ b/cmd/geth/retesteth.go @@ -26,26 +26,26 @@ import ( "strings" "time" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/consensus/misc" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/rpc" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/consensus/misc" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/rpc" + "github.com/ethereum/go-ethereum/trie" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/geth/retesteth_copypaste.go b/cmd/geth/retesteth_copypaste.go index 472504dfe07b..e2795af7f968 100644 --- a/cmd/geth/retesteth_copypaste.go +++ b/cmd/geth/retesteth_copypaste.go @@ -19,9 +19,9 @@ package main import ( "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" ) // RPCTransaction represents a transaction that will serialize to the RPC representation of a transaction diff --git a/cmd/geth/run_test.go b/cmd/geth/run_test.go index b9aabfd3311f..da82facac36e 100644 --- a/cmd/geth/run_test.go +++ b/cmd/geth/run_test.go @@ -23,7 +23,7 @@ import ( "testing" "github.com/docker/docker/pkg/reexec" - "github.com/ethersocial/go-ethersocial/internal/cmdtest" + "github.com/ethereum/go-ethereum/internal/cmdtest" ) func tmpdir(t *testing.T) string { diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index fb53ddda3650..8012c517c904 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -24,8 +24,8 @@ import ( "strings" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/internal/debug" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/internal/debug" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/p2psim/main.go b/cmd/p2psim/main.go index b3f3eb5b15a1..f2c1bf970350 100644 --- a/cmd/p2psim/main.go +++ b/cmd/p2psim/main.go @@ -45,12 +45,12 @@ import ( "strings" "text/tabwriter" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/simulations" - "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/simulations" + "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + "github.com/ethereum/go-ethereum/rpc" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/puppeth/genesis.go b/cmd/puppeth/genesis.go index 031273a9a567..ae7675cd9bc9 100644 --- a/cmd/puppeth/genesis.go +++ b/cmd/puppeth/genesis.go @@ -23,12 +23,12 @@ import ( "math/big" "strings" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - math2 "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + math2 "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/params" ) // alethGenesisSpec represents the genesis specification format used by the diff --git a/cmd/puppeth/genesis_test.go b/cmd/puppeth/genesis_test.go index b1826037e85c..f128da24f90e 100644 --- a/cmd/puppeth/genesis_test.go +++ b/cmd/puppeth/genesis_test.go @@ -24,7 +24,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethersocial/go-ethersocial/core" + "github.com/ethereum/go-ethereum/core" ) // Tests the go-ethereum to Aleth chainspec conversion for the Stureby testnet. diff --git a/cmd/puppeth/module.go b/cmd/puppeth/module.go index 88a30d8059de..b6a029a01a48 100644 --- a/cmd/puppeth/module.go +++ b/cmd/puppeth/module.go @@ -25,7 +25,7 @@ import ( "strings" "time" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) var ( diff --git a/cmd/puppeth/module_dashboard.go b/cmd/puppeth/module_dashboard.go index 357c8625798b..9a77587b4a85 100644 --- a/cmd/puppeth/module_dashboard.go +++ b/cmd/puppeth/module_dashboard.go @@ -26,7 +26,7 @@ import ( "strconv" "strings" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // dashboardContent is the actual dashboard HTML content to serve up when users diff --git a/cmd/puppeth/module_ethstats.go b/cmd/puppeth/module_ethstats.go index d1a6be8b6f0c..58ecb83951e0 100644 --- a/cmd/puppeth/module_ethstats.go +++ b/cmd/puppeth/module_ethstats.go @@ -25,7 +25,7 @@ import ( "strings" "text/template" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // ethstatsDockerfile is the Dockerfile required to build an ethstats backend diff --git a/cmd/puppeth/module_explorer.go b/cmd/puppeth/module_explorer.go index 73086802605e..50b6d214bfe9 100644 --- a/cmd/puppeth/module_explorer.go +++ b/cmd/puppeth/module_explorer.go @@ -25,7 +25,7 @@ import ( "strconv" "strings" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // explorerDockerfile is the Dockerfile required to run a block explorer. diff --git a/cmd/puppeth/module_faucet.go b/cmd/puppeth/module_faucet.go index ab1566bd4450..017eae1a439a 100644 --- a/cmd/puppeth/module_faucet.go +++ b/cmd/puppeth/module_faucet.go @@ -26,8 +26,8 @@ import ( "strconv" "strings" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" ) // faucetDockerfile is the Dockerfile required to build a faucet container to diff --git a/cmd/puppeth/module_nginx.go b/cmd/puppeth/module_nginx.go index 2a4bb156e196..1b1ae61ff598 100644 --- a/cmd/puppeth/module_nginx.go +++ b/cmd/puppeth/module_nginx.go @@ -24,7 +24,7 @@ import ( "path/filepath" "strconv" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // nginxDockerfile is theis the Dockerfile required to build an nginx reverse- diff --git a/cmd/puppeth/module_node.go b/cmd/puppeth/module_node.go index 81fbe14e506c..77b3346784e7 100644 --- a/cmd/puppeth/module_node.go +++ b/cmd/puppeth/module_node.go @@ -26,8 +26,8 @@ import ( "strings" "text/template" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" ) // nodeDockerfile is the Dockerfile required to run an Ethereum node. diff --git a/cmd/puppeth/module_wallet.go b/cmd/puppeth/module_wallet.go index 0ecd908f242a..851627c048ce 100644 --- a/cmd/puppeth/module_wallet.go +++ b/cmd/puppeth/module_wallet.go @@ -25,7 +25,7 @@ import ( "strconv" "strings" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // walletDockerfile is the Dockerfile required to run a web wallet. diff --git a/cmd/puppeth/puppeth.go b/cmd/puppeth/puppeth.go index 04a255f443d4..c3de5f936024 100644 --- a/cmd/puppeth/puppeth.go +++ b/cmd/puppeth/puppeth.go @@ -23,7 +23,7 @@ import ( "strings" "time" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/puppeth/ssh.go b/cmd/puppeth/ssh.go index a576e8c436fe..c507596065ba 100644 --- a/cmd/puppeth/ssh.go +++ b/cmd/puppeth/ssh.go @@ -28,7 +28,7 @@ import ( "path/filepath" "strings" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/terminal" ) diff --git a/cmd/puppeth/wizard.go b/cmd/puppeth/wizard.go index bac1144be3d9..83536506c4cb 100644 --- a/cmd/puppeth/wizard.go +++ b/cmd/puppeth/wizard.go @@ -31,9 +31,9 @@ import ( "strings" "sync" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/log" "golang.org/x/crypto/ssh/terminal" ) diff --git a/cmd/puppeth/wizard_dashboard.go b/cmd/puppeth/wizard_dashboard.go index aa04b52a7053..b699d7617d00 100644 --- a/cmd/puppeth/wizard_dashboard.go +++ b/cmd/puppeth/wizard_dashboard.go @@ -19,7 +19,7 @@ package main import ( "fmt" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // deployDashboard queries the user for various input on deploying a web-service diff --git a/cmd/puppeth/wizard_ethstats.go b/cmd/puppeth/wizard_ethstats.go index bb1bbf87ef7c..58ff3efbe986 100644 --- a/cmd/puppeth/wizard_ethstats.go +++ b/cmd/puppeth/wizard_ethstats.go @@ -20,7 +20,7 @@ import ( "fmt" "sort" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // deployEthstats queries the user for various input on deploying an ethstats diff --git a/cmd/puppeth/wizard_explorer.go b/cmd/puppeth/wizard_explorer.go index 996f2c3bc40f..1a5828d2e1ff 100644 --- a/cmd/puppeth/wizard_explorer.go +++ b/cmd/puppeth/wizard_explorer.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // deployExplorer creates a new block explorer based on some user input. diff --git a/cmd/puppeth/wizard_faucet.go b/cmd/puppeth/wizard_faucet.go index 8c4fa6424d4f..5c8a35754e76 100644 --- a/cmd/puppeth/wizard_faucet.go +++ b/cmd/puppeth/wizard_faucet.go @@ -20,8 +20,8 @@ import ( "encoding/json" "fmt" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/log" ) // deployFaucet queries the user for various input on deploying a faucet, after diff --git a/cmd/puppeth/wizard_genesis.go b/cmd/puppeth/wizard_genesis.go index e1b278cd3108..499f320f6432 100644 --- a/cmd/puppeth/wizard_genesis.go +++ b/cmd/puppeth/wizard_genesis.go @@ -29,10 +29,10 @@ import ( "path/filepath" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" ) // makeGenesis creates a new genesis struct based on some user input. diff --git a/cmd/puppeth/wizard_intro.go b/cmd/puppeth/wizard_intro.go index 25644451f9e3..75fb04b76f70 100644 --- a/cmd/puppeth/wizard_intro.go +++ b/cmd/puppeth/wizard_intro.go @@ -26,7 +26,7 @@ import ( "strings" "sync" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // makeWizard creates and returns a new puppeth wizard. diff --git a/cmd/puppeth/wizard_netstats.go b/cmd/puppeth/wizard_netstats.go index aaf3fd8fed9c..99ca11bb1776 100644 --- a/cmd/puppeth/wizard_netstats.go +++ b/cmd/puppeth/wizard_netstats.go @@ -23,8 +23,8 @@ import ( "strings" "sync" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/log" "github.com/olekukonko/tablewriter" ) diff --git a/cmd/puppeth/wizard_network.go b/cmd/puppeth/wizard_network.go index bc44f182d400..97302c0df8bb 100644 --- a/cmd/puppeth/wizard_network.go +++ b/cmd/puppeth/wizard_network.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // manageServers displays a list of servers the user can disconnect from, and an diff --git a/cmd/puppeth/wizard_nginx.go b/cmd/puppeth/wizard_nginx.go index 8933e061b777..8397b7fd57ff 100644 --- a/cmd/puppeth/wizard_nginx.go +++ b/cmd/puppeth/wizard_nginx.go @@ -19,7 +19,7 @@ package main import ( "fmt" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // ensureVirtualHost checks whether a reverse-proxy is running on the specified diff --git a/cmd/puppeth/wizard_node.go b/cmd/puppeth/wizard_node.go index 02c6d2adcee7..0d009252073f 100644 --- a/cmd/puppeth/wizard_node.go +++ b/cmd/puppeth/wizard_node.go @@ -21,9 +21,9 @@ import ( "fmt" "time" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" ) // deployNode creates a new node configuration based on some user input. diff --git a/cmd/puppeth/wizard_wallet.go b/cmd/puppeth/wizard_wallet.go index 4f673d4eacfd..194e4d1840a7 100644 --- a/cmd/puppeth/wizard_wallet.go +++ b/cmd/puppeth/wizard_wallet.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // deployWallet creates a new web wallet based on some user input. diff --git a/cmd/rlpdump/main.go b/cmd/rlpdump/main.go index 8c616fbfccfb..d0f993c5b88d 100644 --- a/cmd/rlpdump/main.go +++ b/cmd/rlpdump/main.go @@ -26,7 +26,7 @@ import ( "os" "strings" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/rlp" ) var ( diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go index 8e027de5ec60..a3ee45ba7f06 100644 --- a/cmd/utils/cmd.go +++ b/cmd/utils/cmd.go @@ -27,16 +27,16 @@ import ( "strings" "syscall" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/internal/debug" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/internal/debug" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/rlp" ) const ( diff --git a/cmd/utils/customflags.go b/cmd/utils/customflags.go index cc32d8f400b8..66ebf9ab0467 100644 --- a/cmd/utils/customflags.go +++ b/cmd/utils/customflags.go @@ -26,7 +26,7 @@ import ( "path" "strings" - "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethereum/go-ethereum/common/math" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 21730f1caffd..992e59fb50c2 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -32,37 +32,37 @@ import ( "text/template" "time" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/fdlimit" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/consensus/clique" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/dashboard" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/eth/gasprice" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/ethstats" - "github.com/ethersocial/go-ethersocial/graphql" - "github.com/ethersocial/go-ethersocial/les" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethersocial/go-ethersocial/metrics/influxdb" - "github.com/ethersocial/go-ethersocial/miner" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/discv5" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/nat" - "github.com/ethersocial/go-ethersocial/p2p/netutil" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rpc" - whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/fdlimit" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/consensus/clique" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/dashboard" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/eth/gasprice" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/ethstats" + "github.com/ethereum/go-ethereum/graphql" + "github.com/ethereum/go-ethereum/les" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/metrics/influxdb" + "github.com/ethereum/go-ethereum/miner" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/discv5" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/nat" + "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rpc" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" pcsclite "github.com/gballet/go-libpcsclite" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/wnode/main.go b/cmd/wnode/main.go index 6def4fe08894..2cf0fc1ea4f1 100644 --- a/cmd/wnode/main.go +++ b/cmd/wnode/main.go @@ -35,16 +35,16 @@ import ( "strings" "time" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/console" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/nat" - "github.com/ethersocial/go-ethersocial/whisper/mailserver" - whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/console" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/nat" + "github.com/ethereum/go-ethereum/whisper/mailserver" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" "golang.org/x/crypto/pbkdf2" ) diff --git a/common/bitutil/compress_test.go b/common/bitutil/compress_test.go index 285430f67bab..13a13011dcb8 100644 --- a/common/bitutil/compress_test.go +++ b/common/bitutil/compress_test.go @@ -21,7 +21,7 @@ import ( "math/rand" "testing" - "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethereum/go-ethereum/common/hexutil" ) // Tests that data bitset encoding and decoding works and is bijective. diff --git a/common/hexutil/json_example_test.go b/common/hexutil/json_example_test.go index 7406c9fe1390..80180d918686 100644 --- a/common/hexutil/json_example_test.go +++ b/common/hexutil/json_example_test.go @@ -20,7 +20,7 @@ import ( "encoding/json" "fmt" - "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethereum/go-ethereum/common/hexutil" ) type MyType [5]byte diff --git a/common/math/big_test.go b/common/math/big_test.go index be2df8de1958..be9810dc8cf5 100644 --- a/common/math/big_test.go +++ b/common/math/big_test.go @@ -22,7 +22,7 @@ import ( "math/big" "testing" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) func TestHexOrDecimal256(t *testing.T) { diff --git a/common/prque/lazyqueue.go b/common/prque/lazyqueue.go index a6d54d62adb5..92ddd77f677a 100644 --- a/common/prque/lazyqueue.go +++ b/common/prque/lazyqueue.go @@ -20,7 +20,7 @@ import ( "container/heap" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethereum/go-ethereum/common/mclock" ) // LazyQueue is a priority queue data structure where priorities can change over diff --git a/common/prque/lazyqueue_test.go b/common/prque/lazyqueue_test.go index c9f735355549..0bd4fc65972e 100644 --- a/common/prque/lazyqueue_test.go +++ b/common/prque/lazyqueue_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethereum/go-ethereum/common/mclock" ) const ( diff --git a/common/types.go b/common/types.go index cd4ea03c0c69..5cba4e9f3d1f 100644 --- a/common/types.go +++ b/common/types.go @@ -26,7 +26,7 @@ import ( "reflect" "strings" - "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethereum/go-ethereum/common/hexutil" "golang.org/x/crypto/sha3" ) diff --git a/consensus/clique/api.go b/consensus/clique/api.go index 9c6711e2508d..6bcf987af55e 100644 --- a/consensus/clique/api.go +++ b/consensus/clique/api.go @@ -17,10 +17,10 @@ package clique import ( - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/rpc" ) // API is a user facing RPC API to allow controlling the signer and voting diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index 18ad55468486..02b6da35b29b 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -26,19 +26,19 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/consensus/misc" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/consensus/misc" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/rpc" lru "github.com/hashicorp/golang-lru" "golang.org/x/crypto/sha3" ) diff --git a/consensus/clique/clique_test.go b/consensus/clique/clique_test.go index b94ccda5dc97..710f44805555 100644 --- a/consensus/clique/clique_test.go +++ b/consensus/clique/clique_test.go @@ -20,13 +20,13 @@ import ( "math/big" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" ) // This test case is a repro of an annoying bug that took us forever to catch. diff --git a/consensus/clique/snapshot.go b/consensus/clique/snapshot.go index f9438ee12d0d..4ee731a90821 100644 --- a/consensus/clique/snapshot.go +++ b/consensus/clique/snapshot.go @@ -22,11 +22,11 @@ import ( "sort" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" lru "github.com/hashicorp/golang-lru" ) diff --git a/consensus/clique/snapshot_test.go b/consensus/clique/snapshot_test.go index 3f2d02160692..fc08722efd63 100644 --- a/consensus/clique/snapshot_test.go +++ b/consensus/clique/snapshot_test.go @@ -22,13 +22,13 @@ import ( "sort" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" ) // testerAccountPool is a pool to maintain currently active tester accounts, diff --git a/consensus/consensus.go b/consensus/consensus.go index 1a3488d6683f..f753af550ca0 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -20,11 +20,11 @@ package consensus import ( "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rpc" ) // ChainReader defines a small collection of methods needed to access the local diff --git a/consensus/ethash/algorithm.go b/consensus/ethash/algorithm.go index 6b702a5b79a6..d6c871092ed3 100644 --- a/consensus/ethash/algorithm.go +++ b/consensus/ethash/algorithm.go @@ -27,10 +27,10 @@ import ( "time" "unsafe" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/bitutil" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/bitutil" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" "golang.org/x/crypto/sha3" ) diff --git a/consensus/ethash/algorithm_test.go b/consensus/ethash/algorithm_test.go index d67df5000fa4..cf8552f3ab74 100644 --- a/consensus/ethash/algorithm_test.go +++ b/consensus/ethash/algorithm_test.go @@ -26,9 +26,9 @@ import ( "sync" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" ) // prepare converts an ethash cache or dataset from a byte stream into the internal diff --git a/consensus/ethash/api.go b/consensus/ethash/api.go index 15fc363f55da..4d8eed416116 100644 --- a/consensus/ethash/api.go +++ b/consensus/ethash/api.go @@ -19,9 +19,9 @@ package ethash import ( "errors" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" ) var errEthashStopped = errors.New("ethash stopped") diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index 7ccf7ff4fb10..9754bae58c72 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -25,14 +25,14 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/consensus/misc" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/consensus/misc" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" "golang.org/x/crypto/sha3" ) diff --git a/consensus/ethash/consensus_test.go b/consensus/ethash/consensus_test.go index c0136570f975..675737d9e1aa 100644 --- a/consensus/ethash/consensus_test.go +++ b/consensus/ethash/consensus_test.go @@ -23,9 +23,9 @@ import ( "path/filepath" "testing" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/params" ) type diffTest struct { diff --git a/consensus/ethash/ethash.go b/consensus/ethash/ethash.go index 67ed88315b52..78892e1da85d 100644 --- a/consensus/ethash/ethash.go +++ b/consensus/ethash/ethash.go @@ -34,12 +34,12 @@ import ( "unsafe" mmap "github.com/edsrzf/mmap-go" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/rpc" "github.com/hashicorp/golang-lru/simplelru" ) diff --git a/consensus/ethash/ethash_test.go b/consensus/ethash/ethash_test.go index f104957c444b..90cb6470f735 100644 --- a/consensus/ethash/ethash_test.go +++ b/consensus/ethash/ethash_test.go @@ -25,9 +25,9 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" ) // Tests that ethash works correctly in test mode. diff --git a/consensus/ethash/sealer.go b/consensus/ethash/sealer.go index 1058c4e1e381..43db1fcb7fd7 100644 --- a/consensus/ethash/sealer.go +++ b/consensus/ethash/sealer.go @@ -29,11 +29,11 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" ) const ( diff --git a/consensus/ethash/sealer_test.go b/consensus/ethash/sealer_test.go index 38882c62039e..82f08d673c89 100644 --- a/consensus/ethash/sealer_test.go +++ b/consensus/ethash/sealer_test.go @@ -25,8 +25,8 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" ) // Tests whether remote HTTP servers are correctly notified of new work. diff --git a/consensus/misc/dao.go b/consensus/misc/dao.go index b0dc019d6b3e..9b22bd7a52ab 100644 --- a/consensus/misc/dao.go +++ b/consensus/misc/dao.go @@ -21,9 +21,9 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/params" ) var ( diff --git a/consensus/misc/forks.go b/consensus/misc/forks.go index 373e1596fbe8..4a5e7c37e03c 100644 --- a/consensus/misc/forks.go +++ b/consensus/misc/forks.go @@ -19,9 +19,9 @@ package misc import ( "fmt" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/params" ) // VerifyForkHashes verifies that blocks conforming to network hard-forks do have diff --git a/console/bridge.go b/console/bridge.go index 604adb7bb244..c7a67a68503d 100644 --- a/console/bridge.go +++ b/console/bridge.go @@ -23,10 +23,10 @@ import ( "strings" "time" - "github.com/ethersocial/go-ethersocial/accounts/scwallet" - "github.com/ethersocial/go-ethersocial/accounts/usbwallet" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/accounts/scwallet" + "github.com/ethereum/go-ethereum/accounts/usbwallet" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rpc" "github.com/robertkrimen/otto" ) diff --git a/console/console.go b/console/console.go index 133c0ac0d3a6..5326ed2c8791 100644 --- a/console/console.go +++ b/console/console.go @@ -28,9 +28,9 @@ import ( "strings" "syscall" - "github.com/ethersocial/go-ethersocial/internal/jsre" - "github.com/ethersocial/go-ethersocial/internal/web3ext" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/internal/jsre" + "github.com/ethereum/go-ethereum/internal/web3ext" + "github.com/ethereum/go-ethereum/rpc" "github.com/mattn/go-colorable" "github.com/peterh/liner" "github.com/robertkrimen/otto" diff --git a/console/console_test.go b/console/console_test.go index c95c06d6d287..89dd7cd838a8 100644 --- a/console/console_test.go +++ b/console/console_test.go @@ -26,13 +26,13 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/internal/jsre" - "github.com/ethersocial/go-ethersocial/miner" - "github.com/ethersocial/go-ethersocial/node" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/internal/jsre" + "github.com/ethereum/go-ethereum/miner" + "github.com/ethereum/go-ethereum/node" ) const ( diff --git a/contracts/checkpointoracle/contract/oracle.go b/contracts/checkpointoracle/contract/oracle.go index 4559afa23694..3bb351792f7a 100644 --- a/contracts/checkpointoracle/contract/oracle.go +++ b/contracts/checkpointoracle/contract/oracle.go @@ -7,12 +7,12 @@ import ( "math/big" "strings" - ethereum "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/accounts/abi" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/event" + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/contracts/checkpointoracle/oracle.go b/contracts/checkpointoracle/oracle.go index b0ae9277d512..2d725397bdf0 100644 --- a/contracts/checkpointoracle/oracle.go +++ b/contracts/checkpointoracle/oracle.go @@ -23,10 +23,10 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/contracts/checkpointoracle/contract" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/contracts/checkpointoracle/contract" + "github.com/ethereum/go-ethereum/core/types" ) // CheckpointOracle is a Go wrapper around an on-chain light client checkpoint oracle. diff --git a/contracts/checkpointoracle/oracle_test.go b/contracts/checkpointoracle/oracle_test.go index fbc9f7acd501..817954d11abe 100644 --- a/contracts/checkpointoracle/oracle_test.go +++ b/contracts/checkpointoracle/oracle_test.go @@ -27,13 +27,13 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind/backends" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/contracts/checkpointoracle/contract" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/contracts/checkpointoracle/contract" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" ) var ( diff --git a/core/asm/asm.go b/core/asm/asm.go index dcad38633e99..4257198cc779 100644 --- a/core/asm/asm.go +++ b/core/asm/asm.go @@ -21,7 +21,7 @@ import ( "encoding/hex" "fmt" - "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethereum/go-ethereum/core/vm" ) // Iterator for disassembled EVM instructions diff --git a/core/asm/compiler.go b/core/asm/compiler.go index 40533fc24b02..c7a544070136 100644 --- a/core/asm/compiler.go +++ b/core/asm/compiler.go @@ -22,8 +22,8 @@ import ( "os" "strings" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core/vm" ) // Compiler contains information about the parsed source diff --git a/core/bench_test.go b/core/bench_test.go index 9439e2874bb9..d7a5e11c2f15 100644 --- a/core/bench_test.go +++ b/core/bench_test.go @@ -23,15 +23,15 @@ import ( "os" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/params" ) func BenchmarkInsertChain_empty_memdb(b *testing.B) { diff --git a/core/block_validator.go b/core/block_validator.go index 31b0b646d22b..b36ca56d7f7a 100644 --- a/core/block_validator.go +++ b/core/block_validator.go @@ -19,10 +19,10 @@ package core import ( "fmt" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/params" ) // BlockValidator is responsible for validating block headers, uncles and diff --git a/core/block_validator_test.go b/core/block_validator_test.go index b2c734979f98..06e2ba1a4fd9 100644 --- a/core/block_validator_test.go +++ b/core/block_validator_test.go @@ -21,11 +21,11 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/params" ) // Tests that simple header verification works, for both good and bad blocks. diff --git a/core/blockchain.go b/core/blockchain.go index 0a6f57d1e469..7c91991a6b04 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -27,21 +27,21 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/common/prque" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/common/prque" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/trie" "github.com/hashicorp/golang-lru" ) diff --git a/core/blockchain_insert.go b/core/blockchain_insert.go index a1b269276346..5685b0a4bdd9 100644 --- a/core/blockchain_insert.go +++ b/core/blockchain_insert.go @@ -19,10 +19,10 @@ package core import ( "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" ) // insertStats tracks and reports on block insertion. diff --git a/core/blockchain_test.go b/core/blockchain_test.go index 4e9fce3d22fa..db624c4dc0c7 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -26,16 +26,16 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/params" ) // So we can deterministically seed different blockchains diff --git a/core/blocks.go b/core/blocks.go index f9570a07d900..f20ba4aaf295 100644 --- a/core/blocks.go +++ b/core/blocks.go @@ -16,7 +16,7 @@ package core -import "github.com/ethersocial/go-ethersocial/common" +import "github.com/ethereum/go-ethereum/common" // BadHashes represent a set of manually tracked bad hashes (usually hard forks) var BadHashes = map[common.Hash]bool{ diff --git a/core/bloombits/generator.go b/core/bloombits/generator.go index ba20634c668c..ae07481ada50 100644 --- a/core/bloombits/generator.go +++ b/core/bloombits/generator.go @@ -19,7 +19,7 @@ package bloombits import ( "errors" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/core/types" ) var ( diff --git a/core/bloombits/generator_test.go b/core/bloombits/generator_test.go index 64b897a0f509..f9bcef96e0b5 100644 --- a/core/bloombits/generator_test.go +++ b/core/bloombits/generator_test.go @@ -21,7 +21,7 @@ import ( "math/rand" "testing" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/core/types" ) // Tests that batched bloom bits are correctly rotated from the input bloom diff --git a/core/bloombits/matcher.go b/core/bloombits/matcher.go index 1f41fd38607d..3ec0d5ae94e5 100644 --- a/core/bloombits/matcher.go +++ b/core/bloombits/matcher.go @@ -26,8 +26,8 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common/bitutil" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/common/bitutil" + "github.com/ethereum/go-ethereum/crypto" ) // bloomIndexes represents the bit indexes inside the bloom filter that belong diff --git a/core/bloombits/matcher_test.go b/core/bloombits/matcher_test.go index 248c981179ae..91143e525e7f 100644 --- a/core/bloombits/matcher_test.go +++ b/core/bloombits/matcher_test.go @@ -23,7 +23,7 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) const testSectionSize = 4096 diff --git a/core/chain_indexer.go b/core/chain_indexer.go index c6fcbda6c4ce..c0c2c4f7f945 100644 --- a/core/chain_indexer.go +++ b/core/chain_indexer.go @@ -24,12 +24,12 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" ) // ChainIndexerBackend defines the methods needed to process chain segments in diff --git a/core/chain_indexer_test.go b/core/chain_indexer_test.go index 35083ca29927..abf5b3cc1400 100644 --- a/core/chain_indexer_test.go +++ b/core/chain_indexer_test.go @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" ) // Runs multiple tests with randomized parameters. diff --git a/core/chain_makers.go b/core/chain_makers.go index 58c7fa76b398..17f4042116fa 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -20,14 +20,14 @@ import ( "fmt" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/consensus/misc" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/consensus/misc" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/params" ) // BlockGen creates blocks for testing. diff --git a/core/chain_makers_test.go b/core/chain_makers_test.go index 1afea2d62efa..32e3888d55ce 100644 --- a/core/chain_makers_test.go +++ b/core/chain_makers_test.go @@ -20,12 +20,12 @@ import ( "fmt" "math/big" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" ) func ExampleGenerateChain() { diff --git a/core/dao_test.go b/core/dao_test.go index e77205aa9bff..4e8dba9e8488 100644 --- a/core/dao_test.go +++ b/core/dao_test.go @@ -20,10 +20,10 @@ import ( "math/big" "testing" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/params" ) // Tests that DAO-fork enabled clients can properly filter out fork-commencing diff --git a/core/events.go b/core/events.go index 00ca2a17a806..710bdb589485 100644 --- a/core/events.go +++ b/core/events.go @@ -17,8 +17,8 @@ package core import ( - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" ) // NewTxsEvent is posted when a batch of transactions enter the transaction pool. diff --git a/core/evm.go b/core/evm.go index 076782213529..b654bbd4796f 100644 --- a/core/evm.go +++ b/core/evm.go @@ -19,10 +19,10 @@ package core import ( "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" ) // ChainContext supports retrieving headers and consensus parameters from the diff --git a/core/forkid/forkid.go b/core/forkid/forkid.go index 8d4cbf54fb99..8c1700879a5e 100644 --- a/core/forkid/forkid.go +++ b/core/forkid/forkid.go @@ -26,10 +26,10 @@ import ( "reflect" "strings" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" ) var ( diff --git a/core/forkid/forkid_test.go b/core/forkid/forkid_test.go index 220f23b16f28..b33f85bec7ab 100644 --- a/core/forkid/forkid_test.go +++ b/core/forkid/forkid_test.go @@ -21,9 +21,9 @@ import ( "math" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" ) // TestCreation tests that different genesis and fork rule combinations result in diff --git a/core/gen_genesis.go b/core/gen_genesis.go index 1fcc11ec6b0e..bb8ea1d6a239 100644 --- a/core/gen_genesis.go +++ b/core/gen_genesis.go @@ -7,10 +7,10 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/params" ) var _ = (*genesisSpecMarshaling)(nil) diff --git a/core/gen_genesis_account.go b/core/gen_genesis_account.go index 4f8df2c4f5d4..64fb9b9248f9 100644 --- a/core/gen_genesis_account.go +++ b/core/gen_genesis_account.go @@ -7,9 +7,9 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" ) var _ = (*genesisAccountMarshaling)(nil) diff --git a/core/genesis.go b/core/genesis.go index 53d8ce13d206..46777ec87da3 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -25,17 +25,17 @@ import ( "math/big" "strings" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" ) //go:generate gencodec -type Genesis -field-override genesisSpecMarshaling -out gen_genesis.go diff --git a/core/genesis_test.go b/core/genesis_test.go index b087d24e6c9b..cc174bfbbdd0 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -22,12 +22,12 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/params" ) func TestDefaultGenesisBlock(t *testing.T) { diff --git a/core/headerchain.go b/core/headerchain.go index 05357d8beb88..034858f651cf 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -26,13 +26,13 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" lru "github.com/hashicorp/golang-lru" ) diff --git a/core/helper_test.go b/core/helper_test.go index d04295393a22..e61c92dcdd23 100644 --- a/core/helper_test.go +++ b/core/helper_test.go @@ -19,10 +19,10 @@ package core import ( "container/list" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" ) // Implement our EthTest Manager diff --git a/core/mkalloc.go b/core/mkalloc.go index 7bda60c8abc2..5118a4fcb327 100644 --- a/core/mkalloc.go +++ b/core/mkalloc.go @@ -34,8 +34,8 @@ import ( "sort" "strconv" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/rlp" ) type allocItem struct{ Addr, Balance *big.Int } diff --git a/core/rawdb/accessors_chain.go b/core/rawdb/accessors_chain.go index 37f344500848..fab7ca56c3a5 100644 --- a/core/rawdb/accessors_chain.go +++ b/core/rawdb/accessors_chain.go @@ -21,12 +21,12 @@ import ( "encoding/binary" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" ) // ReadCanonicalHash retrieves the hash assigned to a canonical block number. diff --git a/core/rawdb/accessors_chain_test.go b/core/rawdb/accessors_chain_test.go index 07322db4d793..8c8affffd9e8 100644 --- a/core/rawdb/accessors_chain_test.go +++ b/core/rawdb/accessors_chain_test.go @@ -23,10 +23,10 @@ import ( "math/big" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" "golang.org/x/crypto/sha3" ) diff --git a/core/rawdb/accessors_indexes.go b/core/rawdb/accessors_indexes.go index 6b04eab54422..38f8fe10ea94 100644 --- a/core/rawdb/accessors_indexes.go +++ b/core/rawdb/accessors_indexes.go @@ -19,12 +19,12 @@ package rawdb import ( "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" ) // ReadTxLookupEntry retrieves the positional metadata associated with a transaction diff --git a/core/rawdb/accessors_indexes_test.go b/core/rawdb/accessors_indexes_test.go index 422703ea6706..c09bff010127 100644 --- a/core/rawdb/accessors_indexes_test.go +++ b/core/rawdb/accessors_indexes_test.go @@ -20,10 +20,10 @@ import ( "math/big" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/rlp" ) // Tests that positional lookup metadata can be stored and retrieved. diff --git a/core/rawdb/accessors_metadata.go b/core/rawdb/accessors_metadata.go index 5d4337af5fe1..f8d09fbddf2d 100644 --- a/core/rawdb/accessors_metadata.go +++ b/core/rawdb/accessors_metadata.go @@ -19,11 +19,11 @@ package rawdb import ( "encoding/json" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" ) // ReadDatabaseVersion retrieves the version number of the database. diff --git a/core/rawdb/database.go b/core/rawdb/database.go index 19ad166cf8b0..353b7dce623d 100644 --- a/core/rawdb/database.go +++ b/core/rawdb/database.go @@ -23,11 +23,11 @@ import ( "os" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/ethdb/leveldb" - "github.com/ethersocial/go-ethersocial/ethdb/memorydb" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/ethdb/leveldb" + "github.com/ethereum/go-ethereum/ethdb/memorydb" + "github.com/ethereum/go-ethereum/log" "github.com/olekukonko/tablewriter" ) diff --git a/core/rawdb/freezer.go b/core/rawdb/freezer.go index ede22b11b034..41677fbba220 100644 --- a/core/rawdb/freezer.go +++ b/core/rawdb/freezer.go @@ -25,11 +25,11 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/params" "github.com/prometheus/tsdb/fileutil" ) diff --git a/core/rawdb/freezer_reinit.go b/core/rawdb/freezer_reinit.go index 77c1761f5329..ea4dd33d1d6b 100644 --- a/core/rawdb/freezer_reinit.go +++ b/core/rawdb/freezer_reinit.go @@ -22,11 +22,11 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/prque" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/prque" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" ) // InitDatabaseFromFreezer reinitializes an empty database from a previous batch diff --git a/core/rawdb/freezer_table.go b/core/rawdb/freezer_table.go index f07136ef2568..61804f1f2bcf 100644 --- a/core/rawdb/freezer_table.go +++ b/core/rawdb/freezer_table.go @@ -26,9 +26,9 @@ import ( "sync" "sync/atomic" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" "github.com/golang/snappy" ) diff --git a/core/rawdb/freezer_table_test.go b/core/rawdb/freezer_table_test.go index 10a068d59867..61ba7a17e28b 100644 --- a/core/rawdb/freezer_table_test.go +++ b/core/rawdb/freezer_table_test.go @@ -25,7 +25,7 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethereum/go-ethereum/metrics" ) func init() { diff --git a/core/rawdb/schema.go b/core/rawdb/schema.go index 1ee7be22f84a..a44a2c99f94f 100644 --- a/core/rawdb/schema.go +++ b/core/rawdb/schema.go @@ -20,8 +20,8 @@ package rawdb import ( "encoding/binary" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/metrics" ) // The fields below define the low level database schema prefixing. diff --git a/core/rawdb/table.go b/core/rawdb/table.go index 586f0c486f4a..6610b7f5a256 100644 --- a/core/rawdb/table.go +++ b/core/rawdb/table.go @@ -17,7 +17,7 @@ package rawdb import ( - "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethereum/go-ethereum/ethdb" ) // table is a wrapper around a database that prefixes each key access with a pre- diff --git a/core/state/database.go b/core/state/database.go index f2404fbaae44..ecc2c134da6c 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -19,9 +19,9 @@ package state import ( "fmt" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/trie" lru "github.com/hashicorp/golang-lru" ) diff --git a/core/state/dump.go b/core/state/dump.go index b272be3891c6..7912fd5f9a08 100644 --- a/core/state/dump.go +++ b/core/state/dump.go @@ -20,11 +20,11 @@ import ( "encoding/json" "fmt" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/trie" ) // DumpAccount represents an account in the state diff --git a/core/state/iterator.go b/core/state/iterator.go index 0301bc4c009f..6a5c73d3d13c 100644 --- a/core/state/iterator.go +++ b/core/state/iterator.go @@ -20,9 +20,9 @@ import ( "bytes" "fmt" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/trie" ) // NodeIterator is an iterator to traverse the entire state trie post-order, diff --git a/core/state/iterator_test.go b/core/state/iterator_test.go index 9175e2a5ac2d..69f51c4c7d8a 100644 --- a/core/state/iterator_test.go +++ b/core/state/iterator_test.go @@ -20,8 +20,8 @@ import ( "bytes" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethdb" ) // Tests that the node iterator indeed walks over the entire database contents. diff --git a/core/state/journal.go b/core/state/journal.go index 6e07b5d68550..a03ca57dbc64 100644 --- a/core/state/journal.go +++ b/core/state/journal.go @@ -19,7 +19,7 @@ package state import ( "math/big" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) // journalEntry is a modification entry in the state change journal that can be diff --git a/core/state/state_object.go b/core/state/state_object.go index 6fbde05bfe2b..45ae95a2a92c 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -23,10 +23,10 @@ import ( "math/big" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/rlp" ) var emptyCodeHash = crypto.Keccak256(nil) diff --git a/core/state/state_test.go b/core/state/state_test.go index df8392cd0a28..d6ff714ee49c 100644 --- a/core/state/state_test.go +++ b/core/state/state_test.go @@ -21,10 +21,10 @@ import ( "math/big" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" checker "gopkg.in/check.v1" ) diff --git a/core/state/statedb.go b/core/state/statedb.go index 3d1c15923a1a..b07f08fd2121 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -24,13 +24,13 @@ import ( "sort" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/trie" ) type revision struct { diff --git a/core/state/statedb_test.go b/core/state/statedb_test.go index b24f8bdc19d3..bf073bc94827 100644 --- a/core/state/statedb_test.go +++ b/core/state/statedb_test.go @@ -30,9 +30,9 @@ import ( check "gopkg.in/check.v1" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" ) // Tests that updating a state trie does not leak any database writes prior to diff --git a/core/state/sync.go b/core/state/sync.go index 88888c729c00..ef7930527366 100644 --- a/core/state/sync.go +++ b/core/state/sync.go @@ -19,10 +19,10 @@ package state import ( "bytes" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/trie" ) // NewStateSync create a new state trie download scheduler. diff --git a/core/state/sync_test.go b/core/state/sync_test.go index 17b3066b03dd..de098dce0fea 100644 --- a/core/state/sync_test.go +++ b/core/state/sync_test.go @@ -21,12 +21,12 @@ import ( "math/big" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/ethdb/memorydb" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/ethdb/memorydb" + "github.com/ethereum/go-ethereum/trie" ) // testAccount is the data associated with an account used by the state tests. diff --git a/core/state_prefetcher.go b/core/state_prefetcher.go index db9c0fd8117c..cb85a05b578e 100644 --- a/core/state_prefetcher.go +++ b/core/state_prefetcher.go @@ -19,12 +19,12 @@ package core import ( "sync/atomic" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/params" ) // statePrefetcher is a basic Prefetcher, which blindly executes a block on top diff --git a/core/state_processor.go b/core/state_processor.go index f7b9df9671b2..bed6a073063d 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -17,14 +17,14 @@ package core import ( - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/consensus/misc" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/consensus/misc" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" ) // StateProcessor is a basic Processor, which takes care of transitioning diff --git a/core/state_transition.go b/core/state_transition.go index 146fe4de60d2..bef6e9b0eb2f 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -21,10 +21,10 @@ import ( "math" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" ) var ( diff --git a/core/tx_cacher.go b/core/tx_cacher.go index 8c90db4867f0..b1e5d676a2b1 100644 --- a/core/tx_cacher.go +++ b/core/tx_cacher.go @@ -19,7 +19,7 @@ package core import ( "runtime" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/core/types" ) // senderCacher is a concurrent transaction sender recoverer and cacher. diff --git a/core/tx_journal.go b/core/tx_journal.go index f80709f36c47..41b5156d4ad2 100644 --- a/core/tx_journal.go +++ b/core/tx_journal.go @@ -21,10 +21,10 @@ import ( "io" "os" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" ) // errNoActiveJournal is returned if a transaction is attempted to be inserted diff --git a/core/tx_list.go b/core/tx_list.go index f963fd926929..75bfdaedac1a 100644 --- a/core/tx_list.go +++ b/core/tx_list.go @@ -22,9 +22,9 @@ import ( "math/big" "sort" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" ) // nonceHeap is a heap.Interface implementation over 64bit unsigned integers for diff --git a/core/tx_list_test.go b/core/tx_list_test.go index 86f92c85523e..d579f501afa8 100644 --- a/core/tx_list_test.go +++ b/core/tx_list_test.go @@ -20,8 +20,8 @@ import ( "math/rand" "testing" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" ) // Tests that transactions can be added to strict lists and list contents and diff --git a/core/tx_noncer.go b/core/tx_noncer.go index 49e41ff4731c..aa87c643aee2 100644 --- a/core/tx_noncer.go +++ b/core/tx_noncer.go @@ -19,8 +19,8 @@ package core import ( "sync" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/state" ) // txNoncer is a tiny virtual state database to manage the executable nonces of diff --git a/core/tx_pool.go b/core/tx_pool.go index 5d6c9fb1d80d..a49b42261421 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -25,14 +25,14 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/prque" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/prque" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/params" ) const ( diff --git a/core/tx_pool_test.go b/core/tx_pool_test.go index 107ebb5e514f..388668ed8b0b 100644 --- a/core/tx_pool_test.go +++ b/core/tx_pool_test.go @@ -26,13 +26,13 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/params" ) // testTxPoolConfig is a transaction pool configuration without stateful disk diff --git a/core/types.go b/core/types.go index 0029b88427fd..4c5b74a49865 100644 --- a/core/types.go +++ b/core/types.go @@ -17,9 +17,9 @@ package core import ( - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" ) // Validator is an interface which defines the standard for block validation. It diff --git a/core/types/block.go b/core/types/block.go index 2eac1758cdb0..b0ec7fc77d68 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -27,9 +27,9 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/rlp" "golang.org/x/crypto/sha3" ) diff --git a/core/types/block_test.go b/core/types/block_test.go index 7a60c2f7e7de..ff0a641e5ceb 100644 --- a/core/types/block_test.go +++ b/core/types/block_test.go @@ -22,8 +22,8 @@ import ( "reflect" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/rlp" ) // from bcValidBlockTest.json, "SimpleTx" diff --git a/core/types/bloom9.go b/core/types/bloom9.go index aca78863bbe8..d045c9e6678e 100644 --- a/core/types/bloom9.go +++ b/core/types/bloom9.go @@ -20,8 +20,8 @@ import ( "fmt" "math/big" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/crypto" ) type bytesBacked interface { diff --git a/core/types/bloom9_test.go b/core/types/bloom9_test.go index 926b1658ac82..a28ac0e7afba 100644 --- a/core/types/bloom9_test.go +++ b/core/types/bloom9_test.go @@ -54,7 +54,7 @@ func TestBloom(t *testing.T) { import ( "testing" - "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethereum/go-ethereum/core/state" ) func TestBloom9(t *testing.T) { diff --git a/core/types/derive_sha.go b/core/types/derive_sha.go index 42b1a24ee79e..00c42c5bc622 100644 --- a/core/types/derive_sha.go +++ b/core/types/derive_sha.go @@ -19,9 +19,9 @@ package types import ( "bytes" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/trie" ) type DerivableList interface { diff --git a/core/types/gen_header_json.go b/core/types/gen_header_json.go index 882dfd96c6e0..4212b8d94d25 100644 --- a/core/types/gen_header_json.go +++ b/core/types/gen_header_json.go @@ -7,8 +7,8 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" ) var _ = (*headerMarshaling)(nil) diff --git a/core/types/gen_log_json.go b/core/types/gen_log_json.go index 5eabbda5a30e..6e94339478f0 100644 --- a/core/types/gen_log_json.go +++ b/core/types/gen_log_json.go @@ -6,8 +6,8 @@ import ( "encoding/json" "errors" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" ) var _ = (*logMarshaling)(nil) diff --git a/core/types/gen_receipt_json.go b/core/types/gen_receipt_json.go index 0ceda3ebad73..790ed65b5817 100644 --- a/core/types/gen_receipt_json.go +++ b/core/types/gen_receipt_json.go @@ -7,8 +7,8 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" ) var _ = (*receiptMarshaling)(nil) diff --git a/core/types/gen_tx_json.go b/core/types/gen_tx_json.go index 8f5bb1e0f81f..e676058ecc4b 100644 --- a/core/types/gen_tx_json.go +++ b/core/types/gen_tx_json.go @@ -7,8 +7,8 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" ) var _ = (*txdataMarshaling)(nil) diff --git a/core/types/log.go b/core/types/log.go index 2d657c2d5114..006f62bbf6f6 100644 --- a/core/types/log.go +++ b/core/types/log.go @@ -19,9 +19,9 @@ package types import ( "io" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/rlp" ) //go:generate gencodec -type Log -field-override logMarshaling -out gen_log_json.go diff --git a/core/types/log_test.go b/core/types/log_test.go index 4bbb2693eb89..0e56acfe4aa3 100644 --- a/core/types/log_test.go +++ b/core/types/log_test.go @@ -23,8 +23,8 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" ) var unmarshalLogTests = map[string]struct { diff --git a/core/types/receipt.go b/core/types/receipt.go index 99c24754307f..a96c7525ef3b 100644 --- a/core/types/receipt.go +++ b/core/types/receipt.go @@ -24,11 +24,11 @@ import ( "math/big" "unsafe" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" ) //go:generate gencodec -type Receipt -field-override receiptMarshaling -out gen_receipt_json.go diff --git a/core/types/receipt_test.go b/core/types/receipt_test.go index 115008c23095..806b3dd2ab88 100644 --- a/core/types/receipt_test.go +++ b/core/types/receipt_test.go @@ -23,10 +23,10 @@ import ( "reflect" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" ) func TestLegacyReceiptDecoding(t *testing.T) { diff --git a/core/types/transaction.go b/core/types/transaction.go index a95f307fa005..3eb8df0ac7c7 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -23,10 +23,10 @@ import ( "math/big" "sync/atomic" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/rlp" ) //go:generate gencodec -type txdata -field-override txdataMarshaling -out gen_tx_json.go diff --git a/core/types/transaction_signing.go b/core/types/transaction_signing.go index 9b7c9d1b7303..842fedbd03d6 100644 --- a/core/types/transaction_signing.go +++ b/core/types/transaction_signing.go @@ -22,9 +22,9 @@ import ( "fmt" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" ) var ( diff --git a/core/types/transaction_signing_test.go b/core/types/transaction_signing_test.go index c5405502c967..689fc38a9b66 100644 --- a/core/types/transaction_signing_test.go +++ b/core/types/transaction_signing_test.go @@ -20,9 +20,9 @@ import ( "math/big" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/rlp" ) func TestEIP155Signing(t *testing.T) { diff --git a/core/types/transaction_test.go b/core/types/transaction_test.go index 56946ff30541..7a1b6cd4d4b7 100644 --- a/core/types/transaction_test.go +++ b/core/types/transaction_test.go @@ -23,9 +23,9 @@ import ( "math/big" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/rlp" ) // The values in those tests are from the Transaction Tests diff --git a/core/vm/analysis_test.go b/core/vm/analysis_test.go index c089f1418589..fd2d744d87f4 100644 --- a/core/vm/analysis_test.go +++ b/core/vm/analysis_test.go @@ -19,7 +19,7 @@ package vm import ( "testing" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/crypto" ) func TestJumpDestAnalysis(t *testing.T) { diff --git a/core/vm/common.go b/core/vm/common.go index 52a5b2852a1d..d592a9410dd0 100644 --- a/core/vm/common.go +++ b/core/vm/common.go @@ -19,8 +19,8 @@ package vm import ( "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" ) // calcMemSize64 calculates the required memory size, and returns diff --git a/core/vm/contract.go b/core/vm/contract.go index 4ee3df333140..375e24bc1974 100644 --- a/core/vm/contract.go +++ b/core/vm/contract.go @@ -19,7 +19,7 @@ package vm import ( "math/big" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) // ContractRef is a reference to the contract's backing object diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 2f61fa20463a..875054f89a70 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -22,12 +22,12 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/crypto/blake2b" - "github.com/ethersocial/go-ethersocial/crypto/bn256" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/crypto/blake2b" + "github.com/ethereum/go-ethereum/crypto/bn256" + "github.com/ethereum/go-ethereum/params" "golang.org/x/crypto/ripemd160" ) diff --git a/core/vm/contracts_test.go b/core/vm/contracts_test.go index 3703792da5d6..ae95b4462fef 100644 --- a/core/vm/contracts_test.go +++ b/core/vm/contracts_test.go @@ -22,7 +22,7 @@ import ( "reflect" "testing" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) // precompiledTest defines the input/output pairs for precompiled contract tests. diff --git a/core/vm/eips.go b/core/vm/eips.go index 71b7ce15b03d..075f5b760669 100644 --- a/core/vm/eips.go +++ b/core/vm/eips.go @@ -19,7 +19,7 @@ package vm import ( "fmt" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/params" ) // EnableEIP enables the given EIP on the config. diff --git a/core/vm/evm.go b/core/vm/evm.go index 767c996c911c..751c1fdc1f41 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -21,9 +21,9 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" ) // emptyCodeHash is used by create to ensure deployment is disallowed to already diff --git a/core/vm/gas_table.go b/core/vm/gas_table.go index 4806c5e2708b..1d3c4f1003e0 100644 --- a/core/vm/gas_table.go +++ b/core/vm/gas_table.go @@ -19,9 +19,9 @@ package vm import ( "errors" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/params" ) // memoryGasCost calculates the quadratic gas for memory expansion. It does so diff --git a/core/vm/gas_table_test.go b/core/vm/gas_table_test.go index 054b598ea389..5d443de0eae6 100644 --- a/core/vm/gas_table_test.go +++ b/core/vm/gas_table_test.go @@ -21,11 +21,11 @@ import ( "math/big" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/params" ) func TestMemoryGasCost(t *testing.T) { diff --git a/core/vm/gen_structlog.go b/core/vm/gen_structlog.go index 407326a0724a..726012e59ecf 100644 --- a/core/vm/gen_structlog.go +++ b/core/vm/gen_structlog.go @@ -6,9 +6,9 @@ import ( "encoding/json" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" ) var _ = (*structLogMarshaling)(nil) diff --git a/core/vm/instructions.go b/core/vm/instructions.go index b1c824a964c3..7b6909c9279a 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -20,10 +20,10 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/params" "golang.org/x/crypto/sha3" ) diff --git a/core/vm/instructions_test.go b/core/vm/instructions_test.go index 73ee20691f15..50d0a9ddae30 100644 --- a/core/vm/instructions_test.go +++ b/core/vm/instructions_test.go @@ -24,9 +24,9 @@ import ( "math/big" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" ) type TwoOperandTestcase struct { diff --git a/core/vm/interface.go b/core/vm/interface.go index 8860fdf016b7..dd401466adfa 100644 --- a/core/vm/interface.go +++ b/core/vm/interface.go @@ -19,8 +19,8 @@ package vm import ( "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" ) // StateDB is an EVM database for full state querying. diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index ec335eb188d8..fe06492de3f2 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -21,9 +21,9 @@ import ( "hash" "sync/atomic" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/log" ) // Config are the configuration options for the Interpreter diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index cb207409e34e..b26b55284c58 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -19,7 +19,7 @@ package vm import ( "errors" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/params" ) type ( diff --git a/core/vm/logger.go b/core/vm/logger.go index 7c4da75ce29d..262ee5cc3e83 100644 --- a/core/vm/logger.go +++ b/core/vm/logger.go @@ -23,10 +23,10 @@ import ( "math/big" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core/types" ) // Storage represents a contract's storage. diff --git a/core/vm/logger_json.go b/core/vm/logger_json.go index 8f3e4be88d90..04a83d0660fc 100644 --- a/core/vm/logger_json.go +++ b/core/vm/logger_json.go @@ -22,8 +22,8 @@ import ( "math/big" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" ) type JSONLogger struct { diff --git a/core/vm/logger_test.go b/core/vm/logger_test.go index f6d812a45e01..2ea7535a794d 100644 --- a/core/vm/logger_test.go +++ b/core/vm/logger_test.go @@ -20,9 +20,9 @@ import ( "math/big" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/params" ) type dummyContractRef struct { diff --git a/core/vm/memory.go b/core/vm/memory.go index e7a9042f961e..7e6f0eb940dc 100644 --- a/core/vm/memory.go +++ b/core/vm/memory.go @@ -20,7 +20,7 @@ import ( "fmt" "math/big" - "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethereum/go-ethereum/common/math" ) // Memory implements a simple memory model for the ethereum virtual machine. diff --git a/core/vm/runtime/env.go b/core/vm/runtime/env.go index 97b1e57ca447..31c9b9cf9da0 100644 --- a/core/vm/runtime/env.go +++ b/core/vm/runtime/env.go @@ -17,9 +17,9 @@ package runtime import ( - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/vm" ) func NewEnv(cfg *Config) *vm.EVM { diff --git a/core/vm/runtime/runtime.go b/core/vm/runtime/runtime.go index 2894faf33422..db1f6f38222b 100644 --- a/core/vm/runtime/runtime.go +++ b/core/vm/runtime/runtime.go @@ -21,12 +21,12 @@ import ( "math/big" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" ) // Config is a basic type specifying certain configuration flags for running diff --git a/core/vm/runtime/runtime_example_test.go b/core/vm/runtime/runtime_example_test.go index c634cfd44c9e..b7d0ddc384ea 100644 --- a/core/vm/runtime/runtime_example_test.go +++ b/core/vm/runtime/runtime_example_test.go @@ -19,8 +19,8 @@ package runtime_test import ( "fmt" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/vm/runtime" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/vm/runtime" ) func ExampleExecute() { diff --git a/core/vm/runtime/runtime_test.go b/core/vm/runtime/runtime_test.go index 28e816fbb8de..15f545ddcafb 100644 --- a/core/vm/runtime/runtime_test.go +++ b/core/vm/runtime/runtime_test.go @@ -21,12 +21,12 @@ import ( "strings" "testing" - "github.com/ethersocial/go-ethersocial/accounts/abi" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/params" ) func TestDefaults(t *testing.T) { diff --git a/core/vm/stack_table.go b/core/vm/stack_table.go index 8a9cb92d180c..10c12901afdb 100644 --- a/core/vm/stack_table.go +++ b/core/vm/stack_table.go @@ -17,7 +17,7 @@ package vm import ( - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/params" ) func minSwapStack(n int) int { diff --git a/crypto/bn256/bn256_fast.go b/crypto/bn256/bn256_fast.go index ac6eaaf98181..5c081493b0fb 100644 --- a/crypto/bn256/bn256_fast.go +++ b/crypto/bn256/bn256_fast.go @@ -7,7 +7,7 @@ // Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve. package bn256 -import "github.com/ethersocial/go-ethersocial/crypto/bn256/cloudflare" +import "github.com/ethereum/go-ethereum/crypto/bn256/cloudflare" // G1 is an abstract cyclic group. The zero value is suitable for use as the // output of an operation, but cannot be used as an input. diff --git a/crypto/bn256/bn256_fuzz.go b/crypto/bn256/bn256_fuzz.go index 16e3de72f817..6aa142117045 100644 --- a/crypto/bn256/bn256_fuzz.go +++ b/crypto/bn256/bn256_fuzz.go @@ -10,8 +10,8 @@ import ( "bytes" "math/big" - cloudflare "github.com/ethersocial/go-ethersocial/crypto/bn256/cloudflare" - google "github.com/ethersocial/go-ethersocial/crypto/bn256/google" + cloudflare "github.com/ethereum/go-ethereum/crypto/bn256/cloudflare" + google "github.com/ethereum/go-ethereum/crypto/bn256/google" ) // FuzzAdd fuzzez bn256 addition between the Google and Cloudflare libraries. diff --git a/crypto/bn256/bn256_slow.go b/crypto/bn256/bn256_slow.go index 81d60659ef75..47df49d41763 100644 --- a/crypto/bn256/bn256_slow.go +++ b/crypto/bn256/bn256_slow.go @@ -7,7 +7,7 @@ // Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve. package bn256 -import "github.com/ethersocial/go-ethersocial/crypto/bn256/google" +import "github.com/ethereum/go-ethereum/crypto/bn256/google" // G1 is an abstract cyclic group. The zero value is suitable for use as the // output of an operation, but cannot be used as an input. diff --git a/crypto/crypto.go b/crypto/crypto.go index 8c3617fb0a0c..2869b4c19165 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -28,9 +28,9 @@ import ( "math/big" "os" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/rlp" "golang.org/x/crypto/sha3" ) diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go index 9c568799fd08..177c19c0cfca 100644 --- a/crypto/crypto_test.go +++ b/crypto/crypto_test.go @@ -26,8 +26,8 @@ import ( "reflect" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" ) var testAddrHex = "970e8128ab834e8eac17ab8e3812f010678cf791" diff --git a/crypto/ecies/ecies_test.go b/crypto/ecies/ecies_test.go index 838e3a6a2578..2836b8126070 100644 --- a/crypto/ecies/ecies_test.go +++ b/crypto/ecies/ecies_test.go @@ -40,7 +40,7 @@ import ( "math/big" "testing" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/crypto" ) var dumpEnc bool diff --git a/crypto/ecies/params.go b/crypto/ecies/params.go index 3f7488b90ee4..6312daf5a1c1 100644 --- a/crypto/ecies/params.go +++ b/crypto/ecies/params.go @@ -42,7 +42,7 @@ import ( "fmt" "hash" - ethcrypto "github.com/ethersocial/go-ethersocial/crypto" + ethcrypto "github.com/ethereum/go-ethereum/crypto" ) var ( diff --git a/crypto/signature_cgo.go b/crypto/signature_cgo.go index 3a0b5d651b12..1fe84509e76f 100644 --- a/crypto/signature_cgo.go +++ b/crypto/signature_cgo.go @@ -23,8 +23,8 @@ import ( "crypto/elliptic" "fmt" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/crypto/secp256k1" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/crypto/secp256k1" ) // Ecrecover returns the uncompressed public key that created the given signature. diff --git a/crypto/signature_test.go b/crypto/signature_test.go index f439401b2bdc..aecff76bfbda 100644 --- a/crypto/signature_test.go +++ b/crypto/signature_test.go @@ -22,9 +22,9 @@ import ( "reflect" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" ) var ( diff --git a/dashboard/cpu.go b/dashboard/cpu.go index 9e72cb44a368..c89879028d5e 100644 --- a/dashboard/cpu.go +++ b/dashboard/cpu.go @@ -21,7 +21,7 @@ package dashboard import ( "syscall" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // getProcessCPUTime retrieves the process' CPU time since program startup. diff --git a/dashboard/dashboard.go b/dashboard/dashboard.go index bedc3a1e10a6..d69a750f101e 100644 --- a/dashboard/dashboard.go +++ b/dashboard/dashboard.go @@ -35,10 +35,10 @@ import ( "io" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rpc" + "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/mohae/deepcopy" "golang.org/x/net/websocket" ) diff --git a/dashboard/log.go b/dashboard/log.go index d582c95056ad..be7732695c39 100644 --- a/dashboard/log.go +++ b/dashboard/log.go @@ -26,7 +26,7 @@ import ( "sort" "time" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" "github.com/mohae/deepcopy" "github.com/rjeczalik/notify" ) diff --git a/dashboard/peers.go b/dashboard/peers.go index 1533e31b6cc2..334302cc120e 100644 --- a/dashboard/peers.go +++ b/dashboard/peers.go @@ -21,10 +21,10 @@ import ( "strings" "time" - "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethereum/go-ethereum/metrics" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p" ) const ( diff --git a/dashboard/system.go b/dashboard/system.go index d113a8a9f713..5b90a17ef849 100644 --- a/dashboard/system.go +++ b/dashboard/system.go @@ -21,8 +21,8 @@ import ( "time" "github.com/elastic/gosigar" - "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/p2p" ) // meterCollector returns a function, which retrieves the count of a specific meter. diff --git a/eth/api.go b/eth/api.go index ef8398e2cf34..f8c51c09bd68 100644 --- a/eth/api.go +++ b/eth/api.go @@ -28,16 +28,16 @@ import ( "strings" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/internal/ethapi" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/rpc" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/internal/ethapi" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/rpc" + "github.com/ethereum/go-ethereum/trie" ) // PublicEthereumAPI provides an API to access Ethereum full node-related diff --git a/eth/api_backend.go b/eth/api_backend.go index d761e437a946..69904a70f25d 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -21,21 +21,21 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/bloombits" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/eth/gasprice" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/bloombits" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/eth/gasprice" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rpc" ) // EthAPIBackend implements ethapi.Backend for full nodes diff --git a/eth/api_test.go b/eth/api_test.go index b035f7367d40..1e7c489c3295 100644 --- a/eth/api_test.go +++ b/eth/api_test.go @@ -25,10 +25,10 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/crypto" ) var dumper = spew.ConfigState{Indent: " "} diff --git a/eth/api_tracer.go b/eth/api_tracer.go index dbbf96937ce8..ce211cbd99ef 100644 --- a/eth/api_tracer.go +++ b/eth/api_tracer.go @@ -28,19 +28,19 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/eth/tracers" - "github.com/ethersocial/go-ethersocial/internal/ethapi" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/rpc" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/eth/tracers" + "github.com/ethereum/go-ethereum/internal/ethapi" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/rpc" + "github.com/ethereum/go-ethereum/trie" ) const ( diff --git a/eth/backend.go b/eth/backend.go index a00f3a7832fb..ce37541f4d1f 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -25,32 +25,32 @@ import ( "sync" "sync/atomic" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/consensus/clique" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/bloombits" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/eth/filters" - "github.com/ethersocial/go-ethersocial/eth/gasprice" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/internal/ethapi" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/miner" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enr" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/consensus/clique" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/bloombits" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/eth/filters" + "github.com/ethereum/go-ethereum/eth/gasprice" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/internal/ethapi" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/miner" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/rpc" ) type LesServer interface { diff --git a/eth/bloombits.go b/eth/bloombits.go index 2342a5de7be4..9a31997d6002 100644 --- a/eth/bloombits.go +++ b/eth/bloombits.go @@ -20,13 +20,13 @@ import ( "context" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/bitutil" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/bloombits" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/bitutil" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/bloombits" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" ) const ( diff --git a/eth/config.go b/eth/config.go index 896d4e3eec8a..864990067f7c 100644 --- a/eth/config.go +++ b/eth/config.go @@ -24,13 +24,13 @@ import ( "runtime" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/eth/gasprice" - "github.com/ethersocial/go-ethersocial/miner" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/eth/gasprice" + "github.com/ethereum/go-ethereum/miner" + "github.com/ethereum/go-ethereum/params" ) // DefaultConfig contains default settings for use on the Ethereum main net. diff --git a/eth/downloader/api.go b/eth/downloader/api.go index a4733eba3856..57ff3d71afa8 100644 --- a/eth/downloader/api.go +++ b/eth/downloader/api.go @@ -20,9 +20,9 @@ import ( "context" "sync" - ethereum "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/rpc" + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/rpc" ) // PublicDownloaderAPI provides an API which gives information about the current synchronisation status. diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index f630b42ced49..edd0eb4d9538 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -25,16 +25,16 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/trie" ) var ( diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go index bf2205532c67..b23043b1c003 100644 --- a/eth/downloader/downloader_test.go +++ b/eth/downloader/downloader_test.go @@ -26,13 +26,13 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/trie" ) // Reduce some of the parameters to make the tester faster. diff --git a/eth/downloader/events.go b/eth/downloader/events.go index b04057f177da..25255a3a72e5 100644 --- a/eth/downloader/events.go +++ b/eth/downloader/events.go @@ -16,7 +16,7 @@ package downloader -import "github.com/ethersocial/go-ethersocial/core/types" +import "github.com/ethereum/go-ethereum/core/types" type DoneEvent struct { Latest *types.Header diff --git a/eth/downloader/fakepeer.go b/eth/downloader/fakepeer.go index 23c359731f49..3ec90bc9ef08 100644 --- a/eth/downloader/fakepeer.go +++ b/eth/downloader/fakepeer.go @@ -19,11 +19,11 @@ package downloader import ( "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" ) // FakePeer is a mock downloader peer that operates on a local database instance diff --git a/eth/downloader/metrics.go b/eth/downloader/metrics.go index cfd4556c75e4..d4eb33794628 100644 --- a/eth/downloader/metrics.go +++ b/eth/downloader/metrics.go @@ -19,7 +19,7 @@ package downloader import ( - "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethereum/go-ethereum/metrics" ) var ( diff --git a/eth/downloader/peer.go b/eth/downloader/peer.go index 275c74d264b6..60f86d0e14cf 100644 --- a/eth/downloader/peer.go +++ b/eth/downloader/peer.go @@ -29,9 +29,9 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" ) const ( diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index a30ef4c24b28..7c339538110a 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -25,11 +25,11 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/prque" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/prque" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" ) var ( diff --git a/eth/downloader/statesync.go b/eth/downloader/statesync.go index 4bd45d2617d7..b422557d58c8 100644 --- a/eth/downloader/statesync.go +++ b/eth/downloader/statesync.go @@ -22,12 +22,12 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/trie" "golang.org/x/crypto/sha3" ) diff --git a/eth/downloader/testchain_test.go b/eth/downloader/testchain_test.go index 28aade044cff..f410152f5b00 100644 --- a/eth/downloader/testchain_test.go +++ b/eth/downloader/testchain_test.go @@ -21,13 +21,13 @@ import ( "math/big" "sync" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" ) // Test chain parameters. diff --git a/eth/downloader/types.go b/eth/downloader/types.go index c0e6d07a6032..ff70bfa0e3cc 100644 --- a/eth/downloader/types.go +++ b/eth/downloader/types.go @@ -19,7 +19,7 @@ package downloader import ( "fmt" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/core/types" ) // peerDropFn is a callback type for dropping a peer detected as malicious. diff --git a/eth/enr_entry.go b/eth/enr_entry.go index fec8fd87cd15..d9e7b95784a2 100644 --- a/eth/enr_entry.go +++ b/eth/enr_entry.go @@ -17,10 +17,10 @@ package eth import ( - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/forkid" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/forkid" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/rlp" ) // ethEntry is the "eth" ENR entry which advertises eth protocol diff --git a/eth/fetcher/fetcher.go b/eth/fetcher/fetcher.go index 7e3dbb8dde51..28c532d9bdad 100644 --- a/eth/fetcher/fetcher.go +++ b/eth/fetcher/fetcher.go @@ -22,11 +22,11 @@ import ( "math/rand" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/prque" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/prque" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" ) const ( diff --git a/eth/fetcher/fetcher_test.go b/eth/fetcher/fetcher_test.go index a7029e9e8f4c..83172c5348f4 100644 --- a/eth/fetcher/fetcher_test.go +++ b/eth/fetcher/fetcher_test.go @@ -24,13 +24,13 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" ) var ( diff --git a/eth/fetcher/metrics.go b/eth/fetcher/metrics.go index 02fee0d86c93..d68d12f000f7 100644 --- a/eth/fetcher/metrics.go +++ b/eth/fetcher/metrics.go @@ -19,7 +19,7 @@ package fetcher import ( - "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethereum/go-ethereum/metrics" ) var ( diff --git a/eth/filters/api.go b/eth/filters/api.go index bf97f43930ac..5ed80a887563 100644 --- a/eth/filters/api.go +++ b/eth/filters/api.go @@ -25,13 +25,13 @@ import ( "sync" "time" - ethereum "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/rpc" + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/rpc" ) var ( diff --git a/eth/filters/api_test.go b/eth/filters/api_test.go index 3b790cee2b1d..02229a7549a7 100644 --- a/eth/filters/api_test.go +++ b/eth/filters/api_test.go @@ -21,8 +21,8 @@ import ( "fmt" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/rpc" ) func TestUnmarshalJSONNewFilterArgs(t *testing.T) { diff --git a/eth/filters/bench_test.go b/eth/filters/bench_test.go index fd43ff53a6c0..fc7e6f5273ce 100644 --- a/eth/filters/bench_test.go +++ b/eth/filters/bench_test.go @@ -22,14 +22,14 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/bitutil" - "github.com/ethersocial/go-ethersocial/core/bloombits" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/node" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/bitutil" + "github.com/ethereum/go-ethereum/core/bloombits" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/node" ) func BenchmarkBloomBits512(b *testing.B) { diff --git a/eth/filters/filter.go b/eth/filters/filter.go index 860c77763c11..071613ad7a15 100644 --- a/eth/filters/filter.go +++ b/eth/filters/filter.go @@ -21,13 +21,13 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/bloombits" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/bloombits" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/rpc" ) type Backend interface { diff --git a/eth/filters/filter_system.go b/eth/filters/filter_system.go index 4e7789784011..70139c1a96ec 100644 --- a/eth/filters/filter_system.go +++ b/eth/filters/filter_system.go @@ -25,14 +25,14 @@ import ( "sync" "time" - ethereum "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/rpc" + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rpc" ) // Type determines the kind of filter and is used to put the filter in to diff --git a/eth/filters/filter_system_test.go b/eth/filters/filter_system_test.go index ea3602b382c6..93cb43123f70 100644 --- a/eth/filters/filter_system_test.go +++ b/eth/filters/filter_system_test.go @@ -25,17 +25,17 @@ import ( "testing" "time" - ethereum "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/bloombits" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rpc" + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/bloombits" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rpc" ) type testBackend struct { diff --git a/eth/filters/filter_test.go b/eth/filters/filter_test.go index 2610da136cac..eafa19cdfa22 100644 --- a/eth/filters/filter_test.go +++ b/eth/filters/filter_test.go @@ -23,14 +23,14 @@ import ( "os" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/params" ) func makeReceipt(addr common.Address) *types.Receipt { diff --git a/eth/gasprice/gasprice.go b/eth/gasprice/gasprice.go index 3428d0b38593..3b8db78a1cc7 100644 --- a/eth/gasprice/gasprice.go +++ b/eth/gasprice/gasprice.go @@ -22,11 +22,11 @@ import ( "sort" "sync" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/internal/ethapi" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/internal/ethapi" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rpc" ) var maxPrice = big.NewInt(500 * params.GWei) diff --git a/eth/gen_config.go b/eth/gen_config.go index 946e63b67096..bc4b55b120fa 100644 --- a/eth/gen_config.go +++ b/eth/gen_config.go @@ -6,13 +6,13 @@ import ( "math/big" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/eth/gasprice" - "github.com/ethersocial/go-ethersocial/miner" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/eth/gasprice" + "github.com/ethereum/go-ethereum/miner" + "github.com/ethereum/go-ethereum/params" ) // MarshalTOML marshals as TOML. diff --git a/eth/handler.go b/eth/handler.go index a36ee26f89e3..4ce2d1c82f94 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -26,20 +26,20 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/eth/fetcher" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/eth/fetcher" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/trie" ) const ( diff --git a/eth/handler_test.go b/eth/handler_test.go index 50535d2cb3ab..0f1672fd4498 100644 --- a/eth/handler_test.go +++ b/eth/handler_test.go @@ -24,18 +24,18 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/params" ) // Tests that block headers can be retrieved from a remote chain based on user queries. diff --git a/eth/helper_test.go b/eth/helper_test.go index a7d21db4baea..1482e99c4e10 100644 --- a/eth/helper_test.go +++ b/eth/helper_test.go @@ -27,19 +27,19 @@ import ( "sync" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/params" ) var ( diff --git a/eth/metrics.go b/eth/metrics.go index ccd195525156..0533a2a8757c 100644 --- a/eth/metrics.go +++ b/eth/metrics.go @@ -17,8 +17,8 @@ package eth import ( - "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/p2p" ) var ( diff --git a/eth/peer.go b/eth/peer.go index 43bccaae5b95..814c787b8c2b 100644 --- a/eth/peer.go +++ b/eth/peer.go @@ -24,10 +24,10 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/rlp" ) var ( diff --git a/eth/protocol.go b/eth/protocol.go index 6d5bf62d2f41..de0c979d89b8 100644 --- a/eth/protocol.go +++ b/eth/protocol.go @@ -21,11 +21,11 @@ import ( "io" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/rlp" ) // Constants to match up protocol versions and messages diff --git a/eth/protocol_test.go b/eth/protocol_test.go index 5098790cb797..e817d673a6f0 100644 --- a/eth/protocol_test.go +++ b/eth/protocol_test.go @@ -22,12 +22,12 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/rlp" ) func init() { diff --git a/eth/sync.go b/eth/sync.go index 15e3b32fccee..9e180ee200f7 100644 --- a/eth/sync.go +++ b/eth/sync.go @@ -21,11 +21,11 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enode" ) const ( diff --git a/eth/sync_test.go b/eth/sync_test.go index 73c75bcafc67..e4c99ff5873f 100644 --- a/eth/sync_test.go +++ b/eth/sync_test.go @@ -21,9 +21,9 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" ) // Tests that fast sync gets disabled as soon as a real block is successfully diff --git a/eth/tracers/tracer.go b/eth/tracers/tracer.go index 8af2539df90b..c0729fb1d8a0 100644 --- a/eth/tracers/tracer.go +++ b/eth/tracers/tracer.go @@ -25,11 +25,11 @@ import ( "time" "unsafe" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" duktape "gopkg.in/olebedev/go-duktape.v3" ) diff --git a/eth/tracers/tracer_test.go b/eth/tracers/tracer_test.go index 52cfb2fb8e4f..a45a121159d8 100644 --- a/eth/tracers/tracer_test.go +++ b/eth/tracers/tracer_test.go @@ -24,10 +24,10 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/params" ) type account struct{} diff --git a/eth/tracers/tracers.go b/eth/tracers/tracers.go index 8a2c64635e48..4e1ef23ad2f8 100644 --- a/eth/tracers/tracers.go +++ b/eth/tracers/tracers.go @@ -21,7 +21,7 @@ import ( "strings" "unicode" - "github.com/ethersocial/go-ethersocial/eth/tracers/internal/tracers" + "github.com/ethereum/go-ethereum/eth/tracers/internal/tracers" ) // all contains all the built in JavaScript tracers by name. diff --git a/eth/tracers/tracers_test.go b/eth/tracers/tracers_test.go index 02ab9220462c..69eb80a5c53a 100644 --- a/eth/tracers/tracers_test.go +++ b/eth/tracers/tracers_test.go @@ -27,17 +27,17 @@ import ( "strings" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/tests" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/tests" ) // To generate a new callTracer test, copy paste the makeTest method below into diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go index f0c92977ce73..0a6f73ab5165 100644 --- a/ethclient/ethclient.go +++ b/ethclient/ethclient.go @@ -24,12 +24,12 @@ import ( "fmt" "math/big" - "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/rpc" ) // Client defines typed wrappers for the Ethereum RPC API. diff --git a/ethclient/ethclient_test.go b/ethclient/ethclient_test.go index cd3da8b84459..3576d4870e66 100644 --- a/ethclient/ethclient_test.go +++ b/ethclient/ethclient_test.go @@ -25,16 +25,16 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/params" ) // Verify that Client implements the ethereum interfaces. diff --git a/ethclient/signer.go b/ethclient/signer.go index a57dccdc0abc..74a93f1e2fd6 100644 --- a/ethclient/signer.go +++ b/ethclient/signer.go @@ -20,8 +20,8 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" ) // senderFromServer is a types.Signer that remembers the sender address returned by the RPC diff --git a/ethdb/dbtest/testsuite.go b/ethdb/dbtest/testsuite.go index 5ef431231f58..dce2ba2a1f74 100644 --- a/ethdb/dbtest/testsuite.go +++ b/ethdb/dbtest/testsuite.go @@ -22,7 +22,7 @@ import ( "sort" "testing" - "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethereum/go-ethereum/ethdb" ) // TestDatabaseSuite runs a suite of tests against a KeyValueStore database diff --git a/ethdb/leveldb/leveldb.go b/ethdb/leveldb/leveldb.go index 8c3d9d22af3f..aba6593c7a06 100644 --- a/ethdb/leveldb/leveldb.go +++ b/ethdb/leveldb/leveldb.go @@ -26,10 +26,10 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/filter" diff --git a/ethdb/leveldb/leveldb_test.go b/ethdb/leveldb/leveldb_test.go index 58160bd98654..421d9b4693f4 100644 --- a/ethdb/leveldb/leveldb_test.go +++ b/ethdb/leveldb/leveldb_test.go @@ -19,8 +19,8 @@ package leveldb import ( "testing" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/ethdb/dbtest" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/ethdb/dbtest" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/storage" ) diff --git a/ethdb/memorydb/memorydb.go b/ethdb/memorydb/memorydb.go index 1f51a36636b2..346edc438160 100644 --- a/ethdb/memorydb/memorydb.go +++ b/ethdb/memorydb/memorydb.go @@ -23,8 +23,8 @@ import ( "strings" "sync" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethdb" ) var ( diff --git a/ethdb/memorydb/memorydb_test.go b/ethdb/memorydb/memorydb_test.go index 0bb9b863fb0b..dba18ad3062b 100644 --- a/ethdb/memorydb/memorydb_test.go +++ b/ethdb/memorydb/memorydb_test.go @@ -19,8 +19,8 @@ package memorydb import ( "testing" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/ethdb/dbtest" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/ethdb/dbtest" ) func TestMemoryDB(t *testing.T) { diff --git a/ethstats/ethstats.go b/ethstats/ethstats.go index 9b537f0e8129..f9284722cf83 100644 --- a/ethstats/ethstats.go +++ b/ethstats/ethstats.go @@ -30,17 +30,17 @@ import ( "strings" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/les" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/les" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/rpc" "github.com/gorilla/websocket" ) diff --git a/event/example_feed_test.go b/event/example_feed_test.go index 539f84589a89..9b5ad50df546 100644 --- a/event/example_feed_test.go +++ b/event/example_feed_test.go @@ -19,7 +19,7 @@ package event_test import ( "fmt" - "github.com/ethersocial/go-ethersocial/event" + "github.com/ethereum/go-ethereum/event" ) func ExampleFeed_acknowledgedEvents() { diff --git a/event/example_scope_test.go b/event/example_scope_test.go index f6206170cfcb..825a8deeacba 100644 --- a/event/example_scope_test.go +++ b/event/example_scope_test.go @@ -20,7 +20,7 @@ import ( "fmt" "sync" - "github.com/ethersocial/go-ethersocial/event" + "github.com/ethereum/go-ethereum/event" ) // This example demonstrates how SubscriptionScope can be used to control the lifetime of diff --git a/event/example_subscription_test.go b/event/example_subscription_test.go index 326e65f139b6..5c76b55d98e8 100644 --- a/event/example_subscription_test.go +++ b/event/example_subscription_test.go @@ -19,7 +19,7 @@ package event_test import ( "fmt" - "github.com/ethersocial/go-ethersocial/event" + "github.com/ethereum/go-ethereum/event" ) func ExampleNewSubscription() { diff --git a/event/subscription.go b/event/subscription.go index 56e761cbdaf3..d03f465075bf 100644 --- a/event/subscription.go +++ b/event/subscription.go @@ -21,7 +21,7 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethereum/go-ethereum/common/mclock" ) // Subscription represents a stream of events. The carrier of the events is typically a diff --git a/graphql/graphql.go b/graphql/graphql.go index 046d03a0ac61..df279f42b110 100644 --- a/graphql/graphql.go +++ b/graphql/graphql.go @@ -22,17 +22,17 @@ import ( "errors" "time" - "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/eth/filters" - "github.com/ethersocial/go-ethersocial/internal/ethapi" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/eth/filters" + "github.com/ethereum/go-ethereum/internal/ethapi" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/rpc" ) var ( diff --git a/graphql/service.go b/graphql/service.go index 03fcdd412eed..f64075680634 100644 --- a/graphql/service.go +++ b/graphql/service.go @@ -21,10 +21,10 @@ import ( "net" "net/http" - "github.com/ethersocial/go-ethersocial/internal/ethapi" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/internal/ethapi" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/rpc" "github.com/graph-gophers/graphql-go" "github.com/graph-gophers/graphql-go/relay" ) diff --git a/interfaces.go b/interfaces.go index 9c5bf83ef624..1ff31f96b6a6 100644 --- a/interfaces.go +++ b/interfaces.go @@ -22,8 +22,8 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" ) // NotFound is returned by API methods if the requested item does not exist. diff --git a/internal/debug/api.go b/internal/debug/api.go index d241eb6c369b..86a4218f6a57 100644 --- a/internal/debug/api.go +++ b/internal/debug/api.go @@ -34,7 +34,7 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // Handler is the global debugging handler. diff --git a/internal/debug/flags.go b/internal/debug/flags.go index d3b5995563c7..46c8fe9f80de 100644 --- a/internal/debug/flags.go +++ b/internal/debug/flags.go @@ -24,9 +24,9 @@ import ( "os" "runtime" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethersocial/go-ethersocial/metrics/exp" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/metrics/exp" "github.com/fjl/memsize/memsizeui" colorable "github.com/mattn/go-colorable" "github.com/mattn/go-isatty" diff --git a/internal/debug/trace.go b/internal/debug/trace.go index 5994d5f88257..cab5deaafd6c 100644 --- a/internal/debug/trace.go +++ b/internal/debug/trace.go @@ -23,7 +23,7 @@ import ( "os" "runtime/trace" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // StartGoTrace turns on tracing, writing to the given file. diff --git a/internal/ethapi/addrlock.go b/internal/ethapi/addrlock.go index 0b7a3f181b4e..61ddff688ccc 100644 --- a/internal/ethapi/addrlock.go +++ b/internal/ethapi/addrlock.go @@ -19,7 +19,7 @@ package ethapi import ( "sync" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) type AddrLocker struct { diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 773b25a401c8..354614d0adb8 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -26,24 +26,24 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/accounts/scwallet" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/consensus/clique" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/accounts/scwallet" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/consensus/clique" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/rpc" "github.com/tyler-smith/go-bip39" ) diff --git a/internal/ethapi/backend.go b/internal/ethapi/backend.go index 0a6516d4290f..06c6db33b150 100644 --- a/internal/ethapi/backend.go +++ b/internal/ethapi/backend.go @@ -21,18 +21,18 @@ import ( "context" "math/big" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/bloombits" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/bloombits" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rpc" ) // Backend interface provides the common API services (that are provided by diff --git a/internal/guide/guide_test.go b/internal/guide/guide_test.go index 684cd7b408a1..9c7ad16d182d 100644 --- a/internal/guide/guide_test.go +++ b/internal/guide/guide_test.go @@ -30,8 +30,8 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/core/types" ) // Tests that the account management snippets work correctly. diff --git a/internal/jsre/jsre.go b/internal/jsre/jsre.go index 04e8f07a3411..1b3528a03617 100644 --- a/internal/jsre/jsre.go +++ b/internal/jsre/jsre.go @@ -26,8 +26,8 @@ import ( "math/rand" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/internal/jsre/deps" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/internal/jsre/deps" "github.com/robertkrimen/otto" ) diff --git a/internal/testlog/testlog.go b/internal/testlog/testlog.go index ba5c05576e7b..c5a6114d16aa 100644 --- a/internal/testlog/testlog.go +++ b/internal/testlog/testlog.go @@ -20,7 +20,7 @@ package testlog import ( "testing" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // Logger returns a logger which logs to the unit test log of t. diff --git a/les/api.go b/les/api.go index e38a12b50844..bbef771f0445 100644 --- a/les/api.go +++ b/les/api.go @@ -19,7 +19,7 @@ package les import ( "errors" - "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethereum/go-ethereum/common/hexutil" ) var ( diff --git a/les/api_backend.go b/les/api_backend.go index 99e28b639758..5cd432dcf87f 100644 --- a/les/api_backend.go +++ b/les/api_backend.go @@ -21,22 +21,22 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/bloombits" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/eth/gasprice" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/light" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/bloombits" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/eth/gasprice" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/light" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rpc" ) type LesApiBackend struct { diff --git a/les/api_test.go b/les/api_test.go index df257f783b59..7d3b4ce5daf9 100644 --- a/les/api_test.go +++ b/les/api_test.go @@ -28,18 +28,18 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/les/flowcontrol" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/simulations" - "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/les/flowcontrol" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/simulations" + "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + "github.com/ethereum/go-ethereum/rpc" "github.com/mattn/go-colorable" ) diff --git a/les/balance.go b/les/balance.go index 7cf3c5d244f1..4f08a304ebea 100644 --- a/les/balance.go +++ b/les/balance.go @@ -20,7 +20,7 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethereum/go-ethereum/common/mclock" ) const ( diff --git a/les/benchmark.go b/les/benchmark.go index 09a2f5520dcf..42eeef10f3b8 100644 --- a/les/benchmark.go +++ b/les/benchmark.go @@ -24,17 +24,17 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/les/flowcontrol" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/les/flowcontrol" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" ) // requestBenchmark is an interface for different randomized request generators diff --git a/les/bloombits.go b/les/bloombits.go index c53a9a83c149..a98524ce2e69 100644 --- a/les/bloombits.go +++ b/les/bloombits.go @@ -19,8 +19,8 @@ package les import ( "time" - "github.com/ethersocial/go-ethersocial/common/bitutil" - "github.com/ethersocial/go-ethersocial/light" + "github.com/ethereum/go-ethereum/common/bitutil" + "github.com/ethereum/go-ethereum/light" ) const ( diff --git a/les/checkpointoracle.go b/les/checkpointoracle.go index 7ffd0850a6ee..4695fbc16ced 100644 --- a/les/checkpointoracle.go +++ b/les/checkpointoracle.go @@ -20,12 +20,12 @@ import ( "encoding/binary" "sync/atomic" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/contracts/checkpointoracle" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/contracts/checkpointoracle" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" ) // checkpointOracle is responsible for offering the latest stable checkpoint diff --git a/les/client.go b/les/client.go index cd530b701ab0..b367681f3768 100644 --- a/les/client.go +++ b/les/client.go @@ -20,29 +20,29 @@ package les import ( "fmt" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/bloombits" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/eth/filters" - "github.com/ethersocial/go-ethersocial/eth/gasprice" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/internal/ethapi" - "github.com/ethersocial/go-ethersocial/light" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/bloombits" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/eth/filters" + "github.com/ethereum/go-ethereum/eth/gasprice" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/internal/ethapi" + "github.com/ethereum/go-ethereum/light" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rpc" ) type LightEthereum struct { diff --git a/les/client_handler.go b/les/client_handler.go index f6bf807f5220..aff05ddbc9d5 100644 --- a/les/client_handler.go +++ b/les/client_handler.go @@ -21,14 +21,14 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/light" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/light" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/params" ) // clientHandler is responsible for receiving and processing all incoming server diff --git a/les/clientpool.go b/les/clientpool.go index 04b06cf1e230..cff5f41edd5a 100644 --- a/les/clientpool.go +++ b/les/clientpool.go @@ -22,12 +22,12 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/common/prque" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/common/prque" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/rlp" ) const ( diff --git a/les/clientpool_test.go b/les/clientpool_test.go index 6c18c908f530..225f828ec623 100644 --- a/les/clientpool_test.go +++ b/les/clientpool_test.go @@ -22,9 +22,9 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/p2p/enode" ) func TestClientPoolL10C100Free(t *testing.T) { diff --git a/les/commons.go b/les/commons.go index 015d9d333c06..ad3c5aef3d75 100644 --- a/les/commons.go +++ b/les/commons.go @@ -21,17 +21,17 @@ import ( "math/big" "sync" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/light" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/discv5" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/light" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/discv5" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/params" ) func errResp(code errCode, format string, v ...interface{}) error { diff --git a/les/costtracker.go b/les/costtracker.go index ed4559b0dabc..d1f5b54ca5d0 100644 --- a/les/costtracker.go +++ b/les/costtracker.go @@ -23,11 +23,11 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/les/flowcontrol" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/les/flowcontrol" + "github.com/ethereum/go-ethereum/log" ) const makeCostStats = false // make request cost statistics during operation diff --git a/les/distributor.go b/les/distributor.go index d246d21686ea..62abef47dc9a 100644 --- a/les/distributor.go +++ b/les/distributor.go @@ -21,7 +21,7 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethereum/go-ethereum/common/mclock" ) // requestDistributor implements a mechanism that distributes requests to diff --git a/les/distributor_test.go b/les/distributor_test.go index 81ca5ef87a17..00d43e1d6bd3 100644 --- a/les/distributor_test.go +++ b/les/distributor_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethereum/go-ethereum/common/mclock" ) type testDistReq struct { diff --git a/les/fetcher.go b/les/fetcher.go index a6771cf636cf..df76c56d703d 100644 --- a/les/fetcher.go +++ b/les/fetcher.go @@ -21,13 +21,13 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/light" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/light" + "github.com/ethereum/go-ethereum/log" ) const ( diff --git a/les/flowcontrol/control.go b/les/flowcontrol/control.go index daf171446f97..490013677c63 100644 --- a/les/flowcontrol/control.go +++ b/les/flowcontrol/control.go @@ -22,8 +22,8 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/log" ) const ( diff --git a/les/flowcontrol/logger.go b/les/flowcontrol/logger.go index a89e727ea055..428d7fbf22c9 100644 --- a/les/flowcontrol/logger.go +++ b/les/flowcontrol/logger.go @@ -20,7 +20,7 @@ import ( "fmt" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethereum/go-ethereum/common/mclock" ) // logger collects events in string format and discards events older than the diff --git a/les/flowcontrol/manager.go b/les/flowcontrol/manager.go index 0a6ba1d09f04..d6d0b1adde5a 100644 --- a/les/flowcontrol/manager.go +++ b/les/flowcontrol/manager.go @@ -22,8 +22,8 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/common/prque" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/common/prque" ) // cmNodeFields are ClientNode fields used by the client manager diff --git a/les/flowcontrol/manager_test.go b/les/flowcontrol/manager_test.go index 1447d3c5a896..9d2f88763614 100644 --- a/les/flowcontrol/manager_test.go +++ b/les/flowcontrol/manager_test.go @@ -21,7 +21,7 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethereum/go-ethereum/common/mclock" ) type testNode struct { diff --git a/les/handler_test.go b/les/handler_test.go index 361e32d7bfc5..aad8d18e45c0 100644 --- a/les/handler_test.go +++ b/les/handler_test.go @@ -23,19 +23,19 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/light" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/light" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/trie" ) func expectResponse(r p2p.MsgReader, msgcode, reqID, bv uint64, data interface{}) error { diff --git a/les/metrics.go b/les/metrics.go index 337774cc0c04..797631b8ef7d 100644 --- a/les/metrics.go +++ b/les/metrics.go @@ -17,8 +17,8 @@ package les import ( - "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/p2p" ) var ( diff --git a/les/odr.go b/les/odr.go index ecb9042e130e..136ecf4df4c6 100644 --- a/les/odr.go +++ b/les/odr.go @@ -20,11 +20,11 @@ import ( "context" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/light" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/light" + "github.com/ethereum/go-ethereum/log" ) // LesOdr implements light.OdrBackend diff --git a/les/odr_requests.go b/les/odr_requests.go index 67dde1e6967b..3c4dd7090fc0 100644 --- a/les/odr_requests.go +++ b/les/odr_requests.go @@ -21,15 +21,15 @@ import ( "errors" "fmt" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/light" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/light" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/trie" ) var ( diff --git a/les/odr_test.go b/les/odr_test.go index d12bf4a22501..97217e94886a 100644 --- a/les/odr_test.go +++ b/les/odr_test.go @@ -23,17 +23,17 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/light" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/light" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" ) type odrTestFn func(ctx context.Context, db ethdb.Database, config *params.ChainConfig, bc *core.BlockChain, lc *light.LightChain, bhash common.Hash) []byte diff --git a/les/peer.go b/les/peer.go index 63c724d022d0..ab5b30a6571a 100644 --- a/les/peer.go +++ b/les/peer.go @@ -26,17 +26,17 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/les/flowcontrol" - "github.com/ethersocial/go-ethersocial/light" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/les/flowcontrol" + "github.com/ethereum/go-ethereum/light" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" ) var ( diff --git a/les/peer_test.go b/les/peer_test.go index 37efdd05691e..db74a052c14c 100644 --- a/les/peer_test.go +++ b/les/peer_test.go @@ -21,15 +21,15 @@ import ( "net" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/les/flowcontrol" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/les/flowcontrol" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/rlp" ) const protocolVersion = lpv2 diff --git a/les/protocol.go b/les/protocol.go index 0b7edae73287..5fdf32b74a6a 100644 --- a/les/protocol.go +++ b/les/protocol.go @@ -23,10 +23,10 @@ import ( "io" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/rlp" ) // Constants to match up protocol versions and messages diff --git a/les/request_test.go b/les/request_test.go index 14076669d738..69b57ca31705 100644 --- a/les/request_test.go +++ b/les/request_test.go @@ -21,11 +21,11 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/light" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/light" ) var testBankSecureTrieKey = secAddr(bankAddr) diff --git a/les/retrieve.go b/les/retrieve.go index 8bf2ec99f414..d17a02e1ae89 100644 --- a/les/retrieve.go +++ b/les/retrieve.go @@ -24,8 +24,8 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/light" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/light" ) var ( diff --git a/les/server.go b/les/server.go index 742f116adb53..8e790323f6d7 100644 --- a/les/server.go +++ b/les/server.go @@ -20,18 +20,18 @@ import ( "crypto/ecdsa" "time" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/les/flowcontrol" - "github.com/ethersocial/go-ethersocial/light" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/discv5" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/les/flowcontrol" + "github.com/ethereum/go-ethereum/light" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/discv5" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rpc" ) type LesServer struct { diff --git a/les/server_handler.go b/les/server_handler.go index 759d7528faec..79c0a08a91f6 100644 --- a/les/server_handler.go +++ b/les/server_handler.go @@ -24,19 +24,19 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/light" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/light" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/trie" ) const ( diff --git a/les/serverpool.go b/les/serverpool.go index b41cd56a153a..37621dc63481 100644 --- a/les/serverpool.go +++ b/les/serverpool.go @@ -27,14 +27,14 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/discv5" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/discv5" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/rlp" ) const ( diff --git a/les/servingqueue.go b/les/servingqueue.go index 360efa458198..8842cf9e9d55 100644 --- a/les/servingqueue.go +++ b/les/servingqueue.go @@ -21,8 +21,8 @@ import ( "sync" "sync/atomic" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/common/prque" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/common/prque" ) // servingQueue allows running tasks in a limited number of threads and puts the diff --git a/les/sync.go b/les/sync.go index 0e3eb5f04d89..693394464c12 100644 --- a/les/sync.go +++ b/les/sync.go @@ -21,11 +21,11 @@ import ( "errors" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/light" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/light" + "github.com/ethereum/go-ethereum/log" ) var errInvalidCheckpoint = errors.New("invalid advertised checkpoint") diff --git a/les/sync_test.go b/les/sync_test.go index d71eb153c4a9..63833c1ab434 100644 --- a/les/sync_test.go +++ b/les/sync_test.go @@ -22,11 +22,11 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/light" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/light" + "github.com/ethereum/go-ethereum/params" ) // Test light syncing which will download all headers from genesis. diff --git a/les/test_helper.go b/les/test_helper.go index c57620518161..79cf323d62db 100644 --- a/les/test_helper.go +++ b/les/test_helper.go @@ -26,24 +26,24 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind/backends" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/contracts/checkpointoracle/contract" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/les/flowcontrol" - "github.com/ethersocial/go-ethersocial/light" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/contracts/checkpointoracle/contract" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/les/flowcontrol" + "github.com/ethereum/go-ethereum/light" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/params" ) var ( diff --git a/les/txrelay.go b/les/txrelay.go index 3d24603de2e8..49195161b71c 100644 --- a/les/txrelay.go +++ b/les/txrelay.go @@ -20,9 +20,9 @@ import ( "context" "sync" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/rlp" ) type ltrInfo struct { diff --git a/les/ulc.go b/les/ulc.go index 117c0b655200..b97217e79663 100644 --- a/les/ulc.go +++ b/les/ulc.go @@ -19,8 +19,8 @@ package les import ( "errors" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enode" ) type ulc struct { diff --git a/les/ulc_test.go b/les/ulc_test.go index bddcc3f53c38..9112bf928c18 100644 --- a/les/ulc_test.go +++ b/les/ulc_test.go @@ -23,9 +23,9 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" ) func TestULCAnnounceThresholdLes2(t *testing.T) { testULCAnnounceThreshold(t, 2) } diff --git a/light/lightchain.go b/light/lightchain.go index 64ad4a4cdd06..7f64d1c28bbe 100644 --- a/light/lightchain.go +++ b/light/lightchain.go @@ -26,17 +26,17 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" lru "github.com/hashicorp/golang-lru" ) diff --git a/light/lightchain_test.go b/light/lightchain_test.go index f825b7608df8..70d2e70c189d 100644 --- a/light/lightchain_test.go +++ b/light/lightchain_test.go @@ -21,13 +21,13 @@ import ( "math/big" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/params" ) // So we can deterministically seed different blockchains diff --git a/light/nodeset.go b/light/nodeset.go index 5657f1f94d96..3662596785c7 100644 --- a/light/nodeset.go +++ b/light/nodeset.go @@ -20,10 +20,10 @@ import ( "errors" "sync" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/rlp" ) // NodeSet stores a set of trie nodes. It implements trie.Database and can also diff --git a/light/odr.go b/light/odr.go index 033e2edbf8fc..907712ede74f 100644 --- a/light/odr.go +++ b/light/odr.go @@ -21,11 +21,11 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" ) // NoOdr is the default context passed to an ODR capable function when the ODR diff --git a/light/odr_test.go b/light/odr_test.go index a6089472c09d..debd5544c312 100644 --- a/light/odr_test.go +++ b/light/odr_test.go @@ -24,19 +24,19 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/trie" ) var ( diff --git a/light/odr_util.go b/light/odr_util.go index 0ba20e72e2c2..2c820d40c783 100644 --- a/light/odr_util.go +++ b/light/odr_util.go @@ -20,12 +20,12 @@ import ( "bytes" "context" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/rlp" ) var sha3Nil = crypto.Keccak256Hash(nil) diff --git a/light/postprocess.go b/light/postprocess.go index b14d9203d1ce..083dcfceb202 100644 --- a/light/postprocess.go +++ b/light/postprocess.go @@ -24,16 +24,16 @@ import ( "math/big" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/bitutil" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/bitutil" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/trie" ) // IndexerConfig includes a set of configs for chain indexers. diff --git a/light/trie.go b/light/trie.go index f4b0f7ab3c17..e512bf6f9562 100644 --- a/light/trie.go +++ b/light/trie.go @@ -21,12 +21,12 @@ import ( "errors" "fmt" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/trie" ) func NewState(ctx context.Context, head *types.Header, odr OdrBackend) *state.StateDB { diff --git a/light/trie_test.go b/light/trie_test.go index 93b88c761cb4..4919f89641eb 100644 --- a/light/trie_test.go +++ b/light/trie_test.go @@ -23,13 +23,13 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/trie" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/trie" ) func TestNodeIterator(t *testing.T) { diff --git a/light/txpool.go b/light/txpool.go index 6a7138bc56e9..11a0e76ae01e 100644 --- a/light/txpool.go +++ b/light/txpool.go @@ -23,16 +23,16 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" ) const ( diff --git a/light/txpool_test.go b/light/txpool_test.go index 354328a8b8aa..0996bd7c9cc0 100644 --- a/light/txpool_test.go +++ b/light/txpool_test.go @@ -23,13 +23,13 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/params" ) type testTxRelay struct { diff --git a/metrics/cpu_syscall.go b/metrics/cpu_syscall.go index bfa94135037a..e245453e824f 100644 --- a/metrics/cpu_syscall.go +++ b/metrics/cpu_syscall.go @@ -21,7 +21,7 @@ package metrics import ( "syscall" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // getProcessCPUTime retrieves the process' CPU time since program startup. diff --git a/metrics/exp/exp.go b/metrics/exp/exp.go index a8640d382015..55820f1aab2f 100644 --- a/metrics/exp/exp.go +++ b/metrics/exp/exp.go @@ -8,8 +8,8 @@ import ( "net/http" "sync" - "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethersocial/go-ethersocial/metrics/prometheus" + "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/metrics/prometheus" ) type exp struct { diff --git a/metrics/influxdb/influxdb.go b/metrics/influxdb/influxdb.go index 14b1105b53d4..6619915fdba3 100644 --- a/metrics/influxdb/influxdb.go +++ b/metrics/influxdb/influxdb.go @@ -5,8 +5,8 @@ import ( uurl "net/url" "time" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" "github.com/influxdata/influxdb/client" ) diff --git a/metrics/librato/librato.go b/metrics/librato/librato.go index ba45b92a0c60..2138e01ae88b 100644 --- a/metrics/librato/librato.go +++ b/metrics/librato/librato.go @@ -7,7 +7,7 @@ import ( "regexp" "time" - "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethereum/go-ethereum/metrics" ) // a regexp for extracting the unit from time.Duration.String diff --git a/metrics/metrics.go b/metrics/metrics.go index 3c613fd85dac..8ab4e28f2c79 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // Enabled is checked by the constructor functions for all of the diff --git a/metrics/prometheus/collector.go b/metrics/prometheus/collector.go index 2979b579d28e..8350fa2aaf31 100644 --- a/metrics/prometheus/collector.go +++ b/metrics/prometheus/collector.go @@ -22,7 +22,7 @@ import ( "strconv" "strings" - "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethereum/go-ethereum/metrics" ) var ( diff --git a/metrics/prometheus/prometheus.go b/metrics/prometheus/prometheus.go index 4482fc2b6788..9ad5ec7e9929 100644 --- a/metrics/prometheus/prometheus.go +++ b/metrics/prometheus/prometheus.go @@ -22,8 +22,8 @@ import ( "net/http" "sort" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" ) // Handler returns an HTTP handler which dump metrics in Prometheus format. diff --git a/miner/miner.go b/miner/miner.go index aac5dfaac2ae..ab97b0c03855 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -23,16 +23,16 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" ) // Backend wraps all methods required for mining. diff --git a/miner/stress_clique.go b/miner/stress_clique.go index 767a649eac3b..7f5db2e520b0 100644 --- a/miner/stress_clique.go +++ b/miner/stress_clique.go @@ -28,19 +28,19 @@ import ( "os" "time" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/fdlimit" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/fdlimit" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/params" ) func main() { diff --git a/miner/stress_ethash.go b/miner/stress_ethash.go index c3af10659608..7d4a7d24f7dd 100644 --- a/miner/stress_ethash.go +++ b/miner/stress_ethash.go @@ -28,20 +28,20 @@ import ( "path/filepath" "time" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/fdlimit" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/fdlimit" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/params" ) func main() { diff --git a/miner/unconfirmed.go b/miner/unconfirmed.go index d1ae97b47315..3a176e8bd6f6 100644 --- a/miner/unconfirmed.go +++ b/miner/unconfirmed.go @@ -20,9 +20,9 @@ import ( "container/ring" "sync" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/log" ) // chainRetriever is used by the unconfirmed block set to verify whether a previously diff --git a/miner/unconfirmed_test.go b/miner/unconfirmed_test.go index e511ca01504f..42e77f3e648c 100644 --- a/miner/unconfirmed_test.go +++ b/miner/unconfirmed_test.go @@ -19,8 +19,8 @@ package miner import ( "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" ) // noopChainRetriever is an implementation of headerRetriever that always diff --git a/miner/worker.go b/miner/worker.go index 2f827d887d17..4a9528c39565 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -25,15 +25,15 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/consensus/misc" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/consensus/misc" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" ) const ( diff --git a/miner/worker_test.go b/miner/worker_test.go index d0c54439540a..1604e988dd9f 100644 --- a/miner/worker_test.go +++ b/miner/worker_test.go @@ -21,18 +21,18 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/consensus/clique" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/consensus/clique" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/params" ) var ( diff --git a/mobile/accounts.go b/mobile/accounts.go index 0270786f48d5..4d979bffff5d 100644 --- a/mobile/accounts.go +++ b/mobile/accounts.go @@ -23,10 +23,10 @@ import ( "errors" "time" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" ) const ( diff --git a/mobile/android_test.go b/mobile/android_test.go index 34a19f65566d..d0ea58a8d19f 100644 --- a/mobile/android_test.go +++ b/mobile/android_test.go @@ -25,7 +25,7 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/internal/build" + "github.com/ethereum/go-ethereum/internal/build" ) // androidTestClass is a Java class to do some lightweight tests against the Android diff --git a/mobile/big.go b/mobile/big.go index 1a661247ca03..86ea93245aab 100644 --- a/mobile/big.go +++ b/mobile/big.go @@ -22,7 +22,7 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) // A BigInt represents a signed multi-precision integer. diff --git a/mobile/bind.go b/mobile/bind.go index c9c696033479..90ecdf82c414 100644 --- a/mobile/bind.go +++ b/mobile/bind.go @@ -23,12 +23,12 @@ import ( "math/big" "strings" - "github.com/ethersocial/go-ethersocial/accounts/abi" - "github.com/ethersocial/go-ethersocial/accounts/abi/bind" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" ) // Signer is an interface defining the callback when a contract requires a diff --git a/mobile/common.go b/mobile/common.go index ab5ad8030402..d7e0457261a0 100644 --- a/mobile/common.go +++ b/mobile/common.go @@ -24,8 +24,8 @@ import ( "fmt" "strings" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" ) // Hash represents the 32 byte Keccak256 hash of arbitrary data. diff --git a/mobile/discover.go b/mobile/discover.go index dc1d020e16a3..451265c2a155 100644 --- a/mobile/discover.go +++ b/mobile/discover.go @@ -22,7 +22,7 @@ package geth import ( "errors" - "github.com/ethersocial/go-ethersocial/p2p/discv5" + "github.com/ethereum/go-ethereum/p2p/discv5" ) // Enode represents a host on the network. diff --git a/mobile/ethclient.go b/mobile/ethclient.go index 36c85eca9c18..662125c4adeb 100644 --- a/mobile/ethclient.go +++ b/mobile/ethclient.go @@ -21,8 +21,8 @@ package geth import ( "math/big" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/ethclient" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" ) // EthereumClient provides access to the Ethereum APIs. diff --git a/mobile/ethereum.go b/mobile/ethereum.go index 9745cdcb8ab2..59da85239744 100644 --- a/mobile/ethereum.go +++ b/mobile/ethereum.go @@ -21,8 +21,8 @@ package geth import ( "errors" - ethereum "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/common" + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" ) // Subscription represents an event subscription where events are diff --git a/mobile/geth.go b/mobile/geth.go index 37d0df88a252..edcbfdbdbe55 100644 --- a/mobile/geth.go +++ b/mobile/geth.go @@ -24,18 +24,18 @@ import ( "fmt" "path/filepath" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/eth" - "github.com/ethersocial/go-ethersocial/eth/downloader" - "github.com/ethersocial/go-ethersocial/ethclient" - "github.com/ethersocial/go-ethersocial/ethstats" - "github.com/ethersocial/go-ethersocial/internal/debug" - "github.com/ethersocial/go-ethersocial/les" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/nat" - "github.com/ethersocial/go-ethersocial/params" - whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/eth/downloader" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/ethstats" + "github.com/ethereum/go-ethereum/internal/debug" + "github.com/ethereum/go-ethereum/les" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/nat" + "github.com/ethereum/go-ethereum/params" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" ) // NodeConfig represents the collection of configuration values to fine tune the Geth diff --git a/mobile/init.go b/mobile/init.go index 337686463b43..2025d85edc92 100644 --- a/mobile/init.go +++ b/mobile/init.go @@ -22,7 +22,7 @@ import ( "os" "runtime" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) func init() { diff --git a/mobile/interface.go b/mobile/interface.go index 4d13b256e02c..d5200d5b1b82 100644 --- a/mobile/interface.go +++ b/mobile/interface.go @@ -22,7 +22,7 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) // Interface represents a wrapped version of Go's interface{}, with the capacity diff --git a/mobile/interface_test.go b/mobile/interface_test.go index 34b06321e9ad..4bd1af47aa1d 100644 --- a/mobile/interface_test.go +++ b/mobile/interface_test.go @@ -22,7 +22,7 @@ import ( "reflect" "testing" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) func TestInterfaceGetSet(t *testing.T) { diff --git a/mobile/logger.go b/mobile/logger.go index b7bd6048f07b..7078c4fd2c83 100644 --- a/mobile/logger.go +++ b/mobile/logger.go @@ -19,7 +19,7 @@ package geth import ( "os" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // SetVerbosity sets the global verbosity level (between 0 and 6 - see logger/verbosity.go). diff --git a/mobile/p2p.go b/mobile/p2p.go index 238494d1de24..a80d9fff2e15 100644 --- a/mobile/p2p.go +++ b/mobile/p2p.go @@ -21,7 +21,7 @@ package geth import ( "errors" - "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethereum/go-ethereum/p2p" ) // NodeInfo represents pi short summary of the information known about the host. diff --git a/mobile/params.go b/mobile/params.go index 9cd49d80c93d..45fe870ee3dc 100644 --- a/mobile/params.go +++ b/mobile/params.go @@ -21,9 +21,9 @@ package geth import ( "encoding/json" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/p2p/discv5" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/p2p/discv5" + "github.com/ethereum/go-ethereum/params" ) // MainnetGenesis returns the JSON spec to use for the main Ethereum network. It diff --git a/mobile/primitives.go b/mobile/primitives.go index d2c0944019c7..7e1ab26ef039 100644 --- a/mobile/primitives.go +++ b/mobile/primitives.go @@ -22,7 +22,7 @@ import ( "errors" "fmt" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) // Strings represents s slice of strs. diff --git a/mobile/shhclient.go b/mobile/shhclient.go index 17b3ff51b65e..90a8b83c39f9 100644 --- a/mobile/shhclient.go +++ b/mobile/shhclient.go @@ -19,8 +19,8 @@ package geth import ( - "github.com/ethersocial/go-ethersocial/whisper/shhclient" - whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" + "github.com/ethereum/go-ethereum/whisper/shhclient" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" ) // WhisperClient provides access to the Ethereum APIs. diff --git a/mobile/types.go b/mobile/types.go index b2df92d2c76c..b9c44c25d7a9 100644 --- a/mobile/types.go +++ b/mobile/types.go @@ -23,10 +23,10 @@ import ( "errors" "fmt" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/rlp" - whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/rlp" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" ) // A Nonce is a 64-bit hash which proves (combined with the mix-hash) that diff --git a/mobile/vm.go b/mobile/vm.go index d2136a11b889..72093e3d5b90 100644 --- a/mobile/vm.go +++ b/mobile/vm.go @@ -21,7 +21,7 @@ package geth import ( "errors" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/core/types" ) // Log represents a contract log event. These events are generated by the LOG diff --git a/node/api.go b/node/api.go index adb1c310fd71..66cd1dde3354 100644 --- a/node/api.go +++ b/node/api.go @@ -21,11 +21,11 @@ import ( "fmt" "strings" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/rpc" ) // PrivateAdminAPI is the collection of administrative API methods exposed only diff --git a/node/config.go b/node/config.go index 53321605f631..0b492d3df9be 100644 --- a/node/config.go +++ b/node/config.go @@ -26,17 +26,17 @@ import ( "strings" "sync" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/accounts/external" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/accounts/scwallet" - "github.com/ethersocial/go-ethersocial/accounts/usbwallet" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/accounts/external" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/accounts/scwallet" + "github.com/ethereum/go-ethereum/accounts/usbwallet" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/rpc" ) const ( diff --git a/node/config_test.go b/node/config_test.go index 7b5cefb11661..00c24a239123 100644 --- a/node/config_test.go +++ b/node/config_test.go @@ -24,8 +24,8 @@ import ( "runtime" "testing" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/p2p" ) // Tests that datadirs can be successfully created, be them manually configured diff --git a/node/defaults.go b/node/defaults.go index 545145b04332..6386f79123d6 100644 --- a/node/defaults.go +++ b/node/defaults.go @@ -22,9 +22,9 @@ import ( "path/filepath" "runtime" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/nat" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/nat" + "github.com/ethereum/go-ethereum/rpc" ) const ( diff --git a/node/node.go b/node/node.go index d2b16ca931e4..c9c27d826239 100644 --- a/node/node.go +++ b/node/node.go @@ -26,14 +26,14 @@ import ( "strings" "sync" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/internal/debug" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/internal/debug" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/rpc" "github.com/prometheus/tsdb/fileutil" ) diff --git a/node/node_example_test.go b/node/node_example_test.go index ffc3b1b46124..57b18855f1ed 100644 --- a/node/node_example_test.go +++ b/node/node_example_test.go @@ -20,9 +20,9 @@ import ( "fmt" "log" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/rpc" ) // SampleService is a trivial network service that can be attached to a node for diff --git a/node/node_test.go b/node/node_test.go index 7092a2087685..c464771cd807 100644 --- a/node/node_test.go +++ b/node/node_test.go @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/rpc" ) var ( diff --git a/node/service.go b/node/service.go index b945e44e18fc..4dea00995c44 100644 --- a/node/service.go +++ b/node/service.go @@ -20,12 +20,12 @@ import ( "path/filepath" "reflect" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/rpc" ) // ServiceContext is a collection of service independent options inherited from diff --git a/node/utils_test.go b/node/utils_test.go index ec85d0af8895..9801b1ed4565 100644 --- a/node/utils_test.go +++ b/node/utils_test.go @@ -22,8 +22,8 @@ package node import ( "reflect" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/rpc" ) // NoopService is a trivial implementation of the Service interface. diff --git a/p2p/dial.go b/p2p/dial.go index 84af217510a4..8dee5063f1d5 100644 --- a/p2p/dial.go +++ b/p2p/dial.go @@ -22,9 +22,9 @@ import ( "net" "time" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/netutil" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/netutil" ) const ( diff --git a/p2p/dial_test.go b/p2p/dial_test.go index 198d5f9e864d..de8fc4a6e3e6 100644 --- a/p2p/dial_test.go +++ b/p2p/dial_test.go @@ -25,11 +25,11 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethersocial/go-ethersocial/internal/testlog" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/enr" - "github.com/ethersocial/go-ethersocial/p2p/netutil" + "github.com/ethereum/go-ethereum/internal/testlog" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethereum/go-ethereum/p2p/netutil" ) func init() { diff --git a/p2p/discover/common.go b/p2p/discover/common.go index 2180d9620d7f..3c080359fdf8 100644 --- a/p2p/discover/common.go +++ b/p2p/discover/common.go @@ -20,9 +20,9 @@ import ( "crypto/ecdsa" "net" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/netutil" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/netutil" ) type UDPConn interface { diff --git a/p2p/discover/node.go b/p2p/discover/node.go index 1ce16457a3c5..a7d9ce7368c0 100644 --- a/p2p/discover/node.go +++ b/p2p/discover/node.go @@ -23,9 +23,9 @@ import ( "net" "time" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/p2p/enode" ) // node represents a host on the network. diff --git a/p2p/discover/ntp.go b/p2p/discover/ntp.go index 2ace062d5c6f..1bb52399fbc5 100644 --- a/p2p/discover/ntp.go +++ b/p2p/discover/ntp.go @@ -25,7 +25,7 @@ import ( "sort" "time" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) const ( diff --git a/p2p/discover/table.go b/p2p/discover/table.go index 5dce82b8567e..e5a5793e358f 100644 --- a/p2p/discover/table.go +++ b/p2p/discover/table.go @@ -32,10 +32,10 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/netutil" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/netutil" ) const ( diff --git a/p2p/discover/table_test.go b/p2p/discover/table_test.go index 8ce0ce4c640c..895c284b270b 100644 --- a/p2p/discover/table_test.go +++ b/p2p/discover/table_test.go @@ -27,10 +27,10 @@ import ( "testing/quick" "time" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/enr" - "github.com/ethersocial/go-ethersocial/p2p/netutil" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethereum/go-ethereum/p2p/netutil" ) func TestTable_pingReplace(t *testing.T) { diff --git a/p2p/discover/table_util_test.go b/p2p/discover/table_util_test.go index 792c47c7132d..2292055e160d 100644 --- a/p2p/discover/table_util_test.go +++ b/p2p/discover/table_util_test.go @@ -25,10 +25,10 @@ import ( "sort" "sync" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enr" ) var nullNode *enode.Node diff --git a/p2p/discover/v4_udp.go b/p2p/discover/v4_udp.go index 58b51267c23d..a8f7101b0594 100644 --- a/p2p/discover/v4_udp.go +++ b/p2p/discover/v4_udp.go @@ -28,12 +28,12 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/enr" - "github.com/ethersocial/go-ethersocial/p2p/netutil" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/ethereum/go-ethereum/rlp" ) // Errors diff --git a/p2p/discover/v4_udp_lookup_test.go b/p2p/discover/v4_udp_lookup_test.go index 06e37745c170..bc1cdfb089ab 100644 --- a/p2p/discover/v4_udp_lookup_test.go +++ b/p2p/discover/v4_udp_lookup_test.go @@ -24,8 +24,8 @@ import ( "sort" "testing" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/p2p/enode" ) func TestUDPv4_Lookup(t *testing.T) { diff --git a/p2p/discover/v4_udp_test.go b/p2p/discover/v4_udp_test.go index df861bb8e223..2e50906e0b13 100644 --- a/p2p/discover/v4_udp_test.go +++ b/p2p/discover/v4_udp_test.go @@ -32,13 +32,13 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/internal/testlog" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/enr" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/internal/testlog" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethereum/go-ethereum/rlp" ) func init() { diff --git a/p2p/discv5/database.go b/p2p/discv5/database.go index e3524e6c2760..3c2d5744c383 100644 --- a/p2p/discv5/database.go +++ b/p2p/discv5/database.go @@ -28,9 +28,9 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/iterator" diff --git a/p2p/discv5/metrics.go b/p2p/discv5/metrics.go index a64b3491a5d5..e68d53c13c63 100644 --- a/p2p/discv5/metrics.go +++ b/p2p/discv5/metrics.go @@ -16,7 +16,7 @@ package discv5 -import "github.com/ethersocial/go-ethersocial/metrics" +import "github.com/ethereum/go-ethereum/metrics" var ( ingressTrafficMeter = metrics.NewRegisteredMeter("discv5/InboundTraffic", nil) diff --git a/p2p/discv5/net.go b/p2p/discv5/net.go index 130684c2bc88..de7d8de6aa40 100644 --- a/p2p/discv5/net.go +++ b/p2p/discv5/net.go @@ -24,12 +24,12 @@ import ( "net" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/netutil" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/ethereum/go-ethereum/rlp" "golang.org/x/crypto/sha3" ) diff --git a/p2p/discv5/net_test.go b/p2p/discv5/net_test.go index ede9cb64dcab..1a8137673d38 100644 --- a/p2p/discv5/net_test.go +++ b/p2p/discv5/net_test.go @@ -22,8 +22,8 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" ) func TestNetwork_Lookup(t *testing.T) { diff --git a/p2p/discv5/node.go b/p2p/discv5/node.go index 49a6ecbbb2a3..57ecd9a571ad 100644 --- a/p2p/discv5/node.go +++ b/p2p/discv5/node.go @@ -30,8 +30,8 @@ import ( "strconv" "strings" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" ) // Node represents a host on the network. diff --git a/p2p/discv5/node_test.go b/p2p/discv5/node_test.go index 2e3004a56461..841f9f6279c0 100644 --- a/p2p/discv5/node_test.go +++ b/p2p/discv5/node_test.go @@ -27,8 +27,8 @@ import ( "testing/quick" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" ) func ExampleNewNode() { diff --git a/p2p/discv5/ntp.go b/p2p/discv5/ntp.go index a8d923fd068a..4fb5f657ae0a 100644 --- a/p2p/discv5/ntp.go +++ b/p2p/discv5/ntp.go @@ -26,7 +26,7 @@ import ( "strings" "time" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) const ( diff --git a/p2p/discv5/sim_test.go b/p2p/discv5/sim_test.go index 22e0fe1fe25c..fba96023340f 100644 --- a/p2p/discv5/sim_test.go +++ b/p2p/discv5/sim_test.go @@ -28,7 +28,7 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) // In this test, nodes try to randomly resolve each other. diff --git a/p2p/discv5/table.go b/p2p/discv5/table.go index b9ffad94bedd..4f4b2426f411 100644 --- a/p2p/discv5/table.go +++ b/p2p/discv5/table.go @@ -29,7 +29,7 @@ import ( "net" "sort" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) const ( diff --git a/p2p/discv5/table_test.go b/p2p/discv5/table_test.go index 789a57de29a4..a29943dab9b3 100644 --- a/p2p/discv5/table_test.go +++ b/p2p/discv5/table_test.go @@ -27,8 +27,8 @@ import ( "testing/quick" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" ) type nullTransport struct{} diff --git a/p2p/discv5/ticket.go b/p2p/discv5/ticket.go index 9f1b4c6f9c4c..ae4b18e7cd45 100644 --- a/p2p/discv5/ticket.go +++ b/p2p/discv5/ticket.go @@ -25,10 +25,10 @@ import ( "sort" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" ) const ( diff --git a/p2p/discv5/topic.go b/p2p/discv5/topic.go index de367b311704..609a41297f85 100644 --- a/p2p/discv5/topic.go +++ b/p2p/discv5/topic.go @@ -23,8 +23,8 @@ import ( "math/rand" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/log" ) const ( diff --git a/p2p/discv5/topic_test.go b/p2p/discv5/topic_test.go index 123aa47c2919..ba79993f29e9 100644 --- a/p2p/discv5/topic_test.go +++ b/p2p/discv5/topic_test.go @@ -21,8 +21,8 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/mclock" ) func TestTopicRadius(t *testing.T) { diff --git a/p2p/discv5/udp.go b/p2p/discv5/udp.go index f697129c3d90..ff5ed983bab0 100644 --- a/p2p/discv5/udp.go +++ b/p2p/discv5/udp.go @@ -24,12 +24,12 @@ import ( "net" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/nat" - "github.com/ethersocial/go-ethersocial/p2p/netutil" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/nat" + "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/ethereum/go-ethereum/rlp" ) const Version = 4 diff --git a/p2p/discv5/udp_test.go b/p2p/discv5/udp_test.go index 6607d79ae9aa..c628485bf97a 100644 --- a/p2p/discv5/udp_test.go +++ b/p2p/discv5/udp_test.go @@ -26,9 +26,9 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/rlp" ) func init() { diff --git a/p2p/enode/idscheme.go b/p2p/enode/idscheme.go index 885b19683e5b..c1834f06995c 100644 --- a/p2p/enode/idscheme.go +++ b/p2p/enode/idscheme.go @@ -21,10 +21,10 @@ import ( "fmt" "io" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/p2p/enr" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethereum/go-ethereum/rlp" "golang.org/x/crypto/sha3" ) diff --git a/p2p/enode/idscheme_test.go b/p2p/enode/idscheme_test.go index a13985650f2f..0910e6e83f61 100644 --- a/p2p/enode/idscheme_test.go +++ b/p2p/enode/idscheme_test.go @@ -23,9 +23,9 @@ import ( "math/big" "testing" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/p2p/enr" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethereum/go-ethereum/rlp" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/p2p/enode/localnode.go b/p2p/enode/localnode.go index 7c5a1ab6bb47..d8aa02a77e26 100644 --- a/p2p/enode/localnode.go +++ b/p2p/enode/localnode.go @@ -26,9 +26,9 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/enr" - "github.com/ethersocial/go-ethersocial/p2p/netutil" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethereum/go-ethereum/p2p/netutil" ) const ( diff --git a/p2p/enode/localnode_test.go b/p2p/enode/localnode_test.go index 3b5626b404a1..00746a8d277a 100644 --- a/p2p/enode/localnode_test.go +++ b/p2p/enode/localnode_test.go @@ -21,8 +21,8 @@ import ( "net" "testing" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/p2p/enr" "github.com/stretchr/testify/assert" ) diff --git a/p2p/enode/node.go b/p2p/enode/node.go index aac7265abe47..9eb2544ffe14 100644 --- a/p2p/enode/node.go +++ b/p2p/enode/node.go @@ -27,8 +27,8 @@ import ( "net" "strings" - "github.com/ethersocial/go-ethersocial/p2p/enr" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethereum/go-ethereum/rlp" ) var errMissingPrefix = errors.New("missing 'enr:' prefix for base64-encoded record") diff --git a/p2p/enode/node_test.go b/p2p/enode/node_test.go index 64bada44ce13..d15859c477a5 100644 --- a/p2p/enode/node_test.go +++ b/p2p/enode/node_test.go @@ -24,8 +24,8 @@ import ( "testing" "testing/quick" - "github.com/ethersocial/go-ethersocial/p2p/enr" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethereum/go-ethereum/rlp" "github.com/stretchr/testify/assert" ) diff --git a/p2p/enode/nodedb.go b/p2p/enode/nodedb.go index 63f42bc61b45..44332640c75d 100644 --- a/p2p/enode/nodedb.go +++ b/p2p/enode/nodedb.go @@ -26,7 +26,7 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/rlp" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/iterator" diff --git a/p2p/enode/urlv4.go b/p2p/enode/urlv4.go index c13124cd91fb..a9a3d1374e51 100644 --- a/p2p/enode/urlv4.go +++ b/p2p/enode/urlv4.go @@ -26,9 +26,9 @@ import ( "regexp" "strconv" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/p2p/enr" ) var incompleteNodeURL = regexp.MustCompile("(?i)^(?:enode://)?([0-9a-f]+)$") diff --git a/p2p/enode/urlv4_test.go b/p2p/enode/urlv4_test.go index aff57e84b13b..41a88eec61fb 100644 --- a/p2p/enode/urlv4_test.go +++ b/p2p/enode/urlv4_test.go @@ -23,8 +23,8 @@ import ( "strings" "testing" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/p2p/enr" ) var parseNodeTests = []struct { diff --git a/p2p/enr/enr.go b/p2p/enr/enr.go index 321c5b1f8713..c36ae9e3edea 100644 --- a/p2p/enr/enr.go +++ b/p2p/enr/enr.go @@ -40,7 +40,7 @@ import ( "io" "sort" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/rlp" ) const SizeLimit = 300 // maximum encoded size of a node record in bytes diff --git a/p2p/enr/enr_test.go b/p2p/enr/enr_test.go index 0bdc58cbddc7..5b47eba0472d 100644 --- a/p2p/enr/enr_test.go +++ b/p2p/enr/enr_test.go @@ -24,7 +24,7 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/rlp" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/p2p/enr/entries.go b/p2p/enr/entries.go index d58f2af0f451..f2118401afb8 100644 --- a/p2p/enr/entries.go +++ b/p2p/enr/entries.go @@ -21,7 +21,7 @@ import ( "io" "net" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/rlp" ) // Entry is implemented by known node record entry types. diff --git a/p2p/message.go b/p2p/message.go index 63c25d75ddbb..b987732225fb 100644 --- a/p2p/message.go +++ b/p2p/message.go @@ -25,9 +25,9 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/rlp" ) // Msg defines the structure of a p2p message. diff --git a/p2p/metrics.go b/p2p/metrics.go index 54e9d501158f..c04e5ab4c3ad 100644 --- a/p2p/metrics.go +++ b/p2p/metrics.go @@ -25,10 +25,10 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/p2p/enode" ) const ( diff --git a/p2p/nat/nat.go b/p2p/nat/nat.go index b85c56fdab31..8fad921c48d2 100644 --- a/p2p/nat/nat.go +++ b/p2p/nat/nat.go @@ -25,7 +25,7 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" "github.com/jackpal/go-nat-pmp" ) diff --git a/p2p/netutil/iptrack.go b/p2p/netutil/iptrack.go index a0357cabea01..b9cbd5e1caa9 100644 --- a/p2p/netutil/iptrack.go +++ b/p2p/netutil/iptrack.go @@ -19,7 +19,7 @@ package netutil import ( "time" - "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethereum/go-ethereum/common/mclock" ) // IPTracker predicts the external endpoint, i.e. IP address and port, of the local host diff --git a/p2p/netutil/iptrack_test.go b/p2p/netutil/iptrack_test.go index 560f692368f6..a9a2998a6528 100644 --- a/p2p/netutil/iptrack_test.go +++ b/p2p/netutil/iptrack_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethereum/go-ethereum/common/mclock" ) const ( diff --git a/p2p/peer.go b/p2p/peer.go index 5578335b4164..372ba8d0274f 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -25,12 +25,12 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/enr" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethereum/go-ethereum/rlp" ) var ( diff --git a/p2p/peer_test.go b/p2p/peer_test.go index 15725068ca4e..984cc411adb4 100644 --- a/p2p/peer_test.go +++ b/p2p/peer_test.go @@ -25,7 +25,7 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) var discard = Protocol{ diff --git a/p2p/protocol.go b/p2p/protocol.go index 397b29953e73..9ce4c20203c7 100644 --- a/p2p/protocol.go +++ b/p2p/protocol.go @@ -19,8 +19,8 @@ package p2p import ( "fmt" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enr" ) // Protocol represents a P2P subprotocol implementation. diff --git a/p2p/rlpx.go b/p2p/rlpx.go index cb1596ff10ea..52e1eb8a4aa8 100644 --- a/p2p/rlpx.go +++ b/p2p/rlpx.go @@ -35,10 +35,10 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common/bitutil" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/crypto/ecies" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common/bitutil" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/crypto/ecies" + "github.com/ethereum/go-ethereum/rlp" "github.com/golang/snappy" "golang.org/x/crypto/sha3" ) diff --git a/p2p/rlpx_test.go b/p2p/rlpx_test.go index 0dd8c0b184d2..e62196ff049e 100644 --- a/p2p/rlpx_test.go +++ b/p2p/rlpx_test.go @@ -32,10 +32,10 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/crypto/ecies" - "github.com/ethersocial/go-ethersocial/p2p/simulations/pipes" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/crypto/ecies" + "github.com/ethereum/go-ethereum/p2p/simulations/pipes" + "github.com/ethereum/go-ethereum/rlp" "golang.org/x/crypto/sha3" ) diff --git a/p2p/server.go b/p2p/server.go index 5cb89dd832b4..692c9eb7d91d 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -29,17 +29,17 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/mclock" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/discover" - "github.com/ethersocial/go-ethersocial/p2p/discv5" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/enr" - "github.com/ethersocial/go-ethersocial/p2p/nat" - "github.com/ethersocial/go-ethersocial/p2p/netutil" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/discover" + "github.com/ethereum/go-ethereum/p2p/discv5" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethereum/go-ethereum/p2p/nat" + "github.com/ethereum/go-ethereum/p2p/netutil" ) const ( diff --git a/p2p/server_test.go b/p2p/server_test.go index 77c519e496f4..e8bc627e1d30 100644 --- a/p2p/server_test.go +++ b/p2p/server_test.go @@ -26,11 +26,11 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/internal/testlog" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/internal/testlog" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enr" "golang.org/x/crypto/sha3" ) diff --git a/p2p/simulations/adapters/exec.go b/p2p/simulations/adapters/exec.go index 3e731e0559a2..5eb0a31566c6 100644 --- a/p2p/simulations/adapters/exec.go +++ b/p2p/simulations/adapters/exec.go @@ -36,11 +36,11 @@ import ( "time" "github.com/docker/docker/pkg/reexec" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/rpc" "golang.org/x/net/websocket" ) diff --git a/p2p/simulations/adapters/inproc.go b/p2p/simulations/adapters/inproc.go index 6ab527e63933..c1cf23a175c6 100644 --- a/p2p/simulations/adapters/inproc.go +++ b/p2p/simulations/adapters/inproc.go @@ -23,13 +23,13 @@ import ( "net" "sync" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/simulations/pipes" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/simulations/pipes" + "github.com/ethereum/go-ethereum/rpc" ) // SimAdapter is a NodeAdapter which creates in-memory simulation nodes and diff --git a/p2p/simulations/adapters/inproc_test.go b/p2p/simulations/adapters/inproc_test.go index b1dc22359c12..bd2c70b05ecc 100644 --- a/p2p/simulations/adapters/inproc_test.go +++ b/p2p/simulations/adapters/inproc_test.go @@ -23,7 +23,7 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/p2p/simulations/pipes" + "github.com/ethereum/go-ethereum/p2p/simulations/pipes" ) func TestTCPPipe(t *testing.T) { diff --git a/p2p/simulations/adapters/types.go b/p2p/simulations/adapters/types.go index 3b1ecf8492aa..f65ce7b6050f 100644 --- a/p2p/simulations/adapters/types.go +++ b/p2p/simulations/adapters/types.go @@ -26,13 +26,13 @@ import ( "strconv" "github.com/docker/docker/pkg/reexec" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/enr" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethereum/go-ethereum/rpc" ) // Node represents a node in a simulation network which is created by a diff --git a/p2p/simulations/connect.go b/p2p/simulations/connect.go index 858e23904422..ede96b34c133 100644 --- a/p2p/simulations/connect.go +++ b/p2p/simulations/connect.go @@ -20,7 +20,7 @@ import ( "errors" "strings" - "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enode" ) var ( diff --git a/p2p/simulations/connect_test.go b/p2p/simulations/connect_test.go index 069e14ec0c43..32d18347d83a 100644 --- a/p2p/simulations/connect_test.go +++ b/p2p/simulations/connect_test.go @@ -19,9 +19,9 @@ package simulations import ( "testing" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/simulations/adapters" ) func newTestNetwork(t *testing.T, nodeCount int) (*Network, []enode.ID) { diff --git a/p2p/simulations/examples/ping-pong.go b/p2p/simulations/examples/ping-pong.go index ba2908dbcae8..cde2f3a677e2 100644 --- a/p2p/simulations/examples/ping-pong.go +++ b/p2p/simulations/examples/ping-pong.go @@ -25,13 +25,13 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/simulations" - "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/simulations" + "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + "github.com/ethereum/go-ethereum/rpc" ) var adapterType = flag.String("adapter", "sim", `node adapter to use (one of "sim", "exec" or "docker")`) diff --git a/p2p/simulations/http.go b/p2p/simulations/http.go index 1dbb8da6aabb..1f44cc66753a 100644 --- a/p2p/simulations/http.go +++ b/p2p/simulations/http.go @@ -29,11 +29,11 @@ import ( "strings" "sync" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + "github.com/ethereum/go-ethereum/rpc" "github.com/julienschmidt/httprouter" "golang.org/x/net/websocket" ) diff --git a/p2p/simulations/http_test.go b/p2p/simulations/http_test.go index e8022f0374bd..ed43c0ed76a2 100644 --- a/p2p/simulations/http_test.go +++ b/p2p/simulations/http_test.go @@ -28,13 +28,13 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + "github.com/ethereum/go-ethereum/rpc" "github.com/mattn/go-colorable" ) diff --git a/p2p/simulations/mocker.go b/p2p/simulations/mocker.go index 09b6f44b298a..8ce777a0103f 100644 --- a/p2p/simulations/mocker.go +++ b/p2p/simulations/mocker.go @@ -24,9 +24,9 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/simulations/adapters" ) //a map of mocker names to its function diff --git a/p2p/simulations/mocker_test.go b/p2p/simulations/mocker_test.go index 6194f61acaea..069040257ed0 100644 --- a/p2p/simulations/mocker_test.go +++ b/p2p/simulations/mocker_test.go @@ -27,7 +27,7 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enode" ) func TestMocker(t *testing.T) { diff --git a/p2p/simulations/network.go b/p2p/simulations/network.go index 85e2987de68d..f03c953e8953 100644 --- a/p2p/simulations/network.go +++ b/p2p/simulations/network.go @@ -27,11 +27,11 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/event" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" + "github.com/ethereum/go-ethereum/event" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/simulations/adapters" ) var DialBanTimeout = 200 * time.Millisecond diff --git a/p2p/simulations/network_test.go b/p2p/simulations/network_test.go index 3166c6637c99..01cd1000de47 100644 --- a/p2p/simulations/network_test.go +++ b/p2p/simulations/network_test.go @@ -26,10 +26,10 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/simulations/adapters" ) // Tests that a created snapshot with a minimal service only contains the expected connections diff --git a/p2p/simulations/simulation.go b/p2p/simulations/simulation.go index d2e4f37b0087..ae62c42b9c2d 100644 --- a/p2p/simulations/simulation.go +++ b/p2p/simulations/simulation.go @@ -20,7 +20,7 @@ import ( "context" "time" - "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enode" ) // Simulation provides a framework for running actions in a simulated network diff --git a/p2p/simulations/test.go b/p2p/simulations/test.go index f3bf74f500e9..687be6d0b8e3 100644 --- a/p2p/simulations/test.go +++ b/p2p/simulations/test.go @@ -19,10 +19,10 @@ package simulations import ( "testing" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/enr" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethereum/go-ethereum/rpc" ) // NoopService is the service that does not do anything diff --git a/p2p/testing/peerpool.go b/p2p/testing/peerpool.go index 7d9a09c801ba..91b9704c79f4 100644 --- a/p2p/testing/peerpool.go +++ b/p2p/testing/peerpool.go @@ -20,8 +20,8 @@ import ( "fmt" "sync" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enode" ) type TestPeer interface { diff --git a/p2p/testing/protocolsession.go b/p2p/testing/protocolsession.go index b941e265fe0b..e3a3915a81e1 100644 --- a/p2p/testing/protocolsession.go +++ b/p2p/testing/protocolsession.go @@ -22,10 +22,10 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/simulations/adapters" ) var errTimedOut = errors.New("timed out") diff --git a/p2p/testing/protocoltester.go b/p2p/testing/protocoltester.go index 164594fccbeb..b80abcc264f5 100644 --- a/p2p/testing/protocoltester.go +++ b/p2p/testing/protocoltester.go @@ -32,14 +32,14 @@ import ( "strings" "sync" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/node" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/simulations" - "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/node" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/simulations" + "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/rpc" ) // ProtocolTester is the tester environment used for unit testing protocol diff --git a/params/config.go b/params/config.go index 667b1fbf8e0e..7b367806d7b9 100644 --- a/params/config.go +++ b/params/config.go @@ -21,8 +21,8 @@ import ( "fmt" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" ) // Genesis hashes to enforce below configs on. diff --git a/params/dao.go b/params/dao.go index 3a7fade7429c..da3c8dfc992b 100644 --- a/params/dao.go +++ b/params/dao.go @@ -19,7 +19,7 @@ package params import ( "math/big" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) // DAOForkBlockExtra is the block header extra-data field to set for the DAO fork diff --git a/rpc/client.go b/rpc/client.go index 4d58f02922e1..4b65d0042186 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -28,7 +28,7 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) var ( diff --git a/rpc/client_example_test.go b/rpc/client_example_test.go index 510c0878d708..3bb8717b8061 100644 --- a/rpc/client_example_test.go +++ b/rpc/client_example_test.go @@ -22,7 +22,7 @@ import ( "math/big" "time" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/rpc" ) // In this example, our client wishes to track the latest 'block number' diff --git a/rpc/client_test.go b/rpc/client_test.go index 3918e77c8a63..315bd6d7d14d 100644 --- a/rpc/client_test.go +++ b/rpc/client_test.go @@ -31,7 +31,7 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) func TestClientRequest(t *testing.T) { diff --git a/rpc/endpoints.go b/rpc/endpoints.go index 0c59a3a5b684..8ca6d4eb0c6d 100644 --- a/rpc/endpoints.go +++ b/rpc/endpoints.go @@ -19,7 +19,7 @@ package rpc import ( "net" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // StartHTTPEndpoint starts the HTTP RPC endpoint, configured with cors/vhosts/modules diff --git a/rpc/handler.go b/rpc/handler.go index abb9c7ceed24..8a4e480ee2c7 100644 --- a/rpc/handler.go +++ b/rpc/handler.go @@ -25,7 +25,7 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // handler handles JSON-RPC messages. There is one handler per connection. Note that diff --git a/rpc/http.go b/rpc/http.go index 50d95a7f1741..2c0cb5edbe60 100644 --- a/rpc/http.go +++ b/rpc/http.go @@ -31,7 +31,7 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" "github.com/rs/cors" ) diff --git a/rpc/ipc.go b/rpc/ipc.go index c6435db6f083..ad8ce03098f7 100644 --- a/rpc/ipc.go +++ b/rpc/ipc.go @@ -20,8 +20,8 @@ import ( "context" "net" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/netutil" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/netutil" ) // ServeListener accepts connections on l, serving JSON-RPC on them. diff --git a/rpc/ipc_unix.go b/rpc/ipc_unix.go index b2f2d03f68e7..f4690cc0abb9 100644 --- a/rpc/ipc_unix.go +++ b/rpc/ipc_unix.go @@ -25,7 +25,7 @@ import ( "os" "path/filepath" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) // ipcListen will create a Unix socket on the given endpoint. diff --git a/rpc/server.go b/rpc/server.go index 12a3d61e59f6..5a92847f20e4 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -22,7 +22,7 @@ import ( "sync/atomic" mapset "github.com/deckarep/golang-set" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) const MetadataApi = "rpc" diff --git a/rpc/service.go b/rpc/service.go index cdead51e8fc9..81e65f810b71 100644 --- a/rpc/service.go +++ b/rpc/service.go @@ -27,7 +27,7 @@ import ( "unicode" "unicode/utf8" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) var ( diff --git a/rpc/types.go b/rpc/types.go index 736cc2ce45d6..f31f09a774a0 100644 --- a/rpc/types.go +++ b/rpc/types.go @@ -22,7 +22,7 @@ import ( "math" "strings" - "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethereum/go-ethereum/common/hexutil" ) // API describes the set of methods offered over the RPC interface diff --git a/rpc/types_test.go b/rpc/types_test.go index acdd0361df99..68b6d3c54f6a 100644 --- a/rpc/types_test.go +++ b/rpc/types_test.go @@ -20,7 +20,7 @@ import ( "encoding/json" "testing" - "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethereum/go-ethereum/common/math" ) func TestBlockNumberJSONUnmarshal(t *testing.T) { diff --git a/rpc/websocket.go b/rpc/websocket.go index cc4118b4dbf9..1632d6af412a 100644 --- a/rpc/websocket.go +++ b/rpc/websocket.go @@ -27,7 +27,7 @@ import ( "sync" mapset "github.com/deckarep/golang-set" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" "github.com/gorilla/websocket" ) diff --git a/signer/core/api.go b/signer/core/api.go index 097b9e72a8f2..244767acaf1b 100644 --- a/signer/core/api.go +++ b/signer/core/api.go @@ -25,16 +25,16 @@ import ( "os" "reflect" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/accounts/scwallet" - "github.com/ethersocial/go-ethersocial/accounts/usbwallet" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/internal/ethapi" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/signer/storage" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/accounts/scwallet" + "github.com/ethereum/go-ethereum/accounts/usbwallet" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/internal/ethapi" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/signer/storage" ) const ( diff --git a/signer/core/api_test.go b/signer/core/api_test.go index 816f009049c9..30948f99bfc5 100644 --- a/signer/core/api_test.go +++ b/signer/core/api_test.go @@ -27,16 +27,16 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/internal/ethapi" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/signer/core" - "github.com/ethersocial/go-ethersocial/signer/fourbyte" - "github.com/ethersocial/go-ethersocial/signer/storage" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/internal/ethapi" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/signer/core" + "github.com/ethereum/go-ethereum/signer/fourbyte" + "github.com/ethereum/go-ethereum/signer/storage" ) //Used for testing diff --git a/signer/core/auditlog.go b/signer/core/auditlog.go index 2a800c590a78..1092e7a92340 100644 --- a/signer/core/auditlog.go +++ b/signer/core/auditlog.go @@ -19,10 +19,10 @@ package core import ( "context" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/internal/ethapi" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/internal/ethapi" + "github.com/ethereum/go-ethereum/log" ) type AuditLogger struct { diff --git a/signer/core/cliui.go b/signer/core/cliui.go index c06d594759f9..1502238bf790 100644 --- a/signer/core/cliui.go +++ b/signer/core/cliui.go @@ -24,9 +24,9 @@ import ( "strings" "sync" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/internal/ethapi" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/internal/ethapi" + "github.com/ethereum/go-ethereum/log" "golang.org/x/crypto/ssh/terminal" ) diff --git a/signer/core/signed_data.go b/signer/core/signed_data.go index 1ed8fcfd9deb..f512be7ceaec 100644 --- a/signer/core/signed_data.go +++ b/signer/core/signed_data.go @@ -30,15 +30,15 @@ import ( "strings" "unicode" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/accounts/abi" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/consensus/clique" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/consensus/clique" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/rlp" ) type SigFormat struct { diff --git a/signer/core/signed_data_test.go b/signer/core/signed_data_test.go index d7e5ba4062b4..6b0da4553034 100644 --- a/signer/core/signed_data_test.go +++ b/signer/core/signed_data_test.go @@ -25,12 +25,12 @@ import ( "strings" "testing" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/signer/core" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/signer/core" ) var typesStandard = core.Types{ diff --git a/signer/core/stdioui.go b/signer/core/stdioui.go index 9aa0f84e94d3..9ffe1398d43d 100644 --- a/signer/core/stdioui.go +++ b/signer/core/stdioui.go @@ -20,9 +20,9 @@ import ( "context" "sync" - "github.com/ethersocial/go-ethersocial/internal/ethapi" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/internal/ethapi" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rpc" ) type StdIOUI struct { diff --git a/signer/core/types.go b/signer/core/types.go index 7be48607cda1..f147f06cd1ae 100644 --- a/signer/core/types.go +++ b/signer/core/types.go @@ -22,9 +22,9 @@ import ( "math/big" "strings" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" ) type ValidationInfo struct { diff --git a/signer/core/uiapi.go b/signer/core/uiapi.go index 1bd31edeb587..7c2d233f89c6 100644 --- a/signer/core/uiapi.go +++ b/signer/core/uiapi.go @@ -24,11 +24,11 @@ import ( "io/ioutil" "math/big" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/accounts/keystore" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/crypto" ) // SignerUIAPI implements methods Clef provides for a UI to query, in the bidirectional communication diff --git a/signer/fourbyte/abi.go b/signer/fourbyte/abi.go index 0b654309e5a8..585eae1cd848 100644 --- a/signer/fourbyte/abi.go +++ b/signer/fourbyte/abi.go @@ -23,8 +23,8 @@ import ( "regexp" "strings" - "github.com/ethersocial/go-ethersocial/accounts/abi" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" ) // decodedCallData is an internal type to represent a method call parsed according diff --git a/signer/fourbyte/abi_test.go b/signer/fourbyte/abi_test.go index b64911650965..314c12735b8c 100644 --- a/signer/fourbyte/abi_test.go +++ b/signer/fourbyte/abi_test.go @@ -22,8 +22,8 @@ import ( "strings" "testing" - "github.com/ethersocial/go-ethersocial/accounts/abi" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" ) func verify(t *testing.T, jsondata, calldata string, exp []interface{}) { diff --git a/signer/fourbyte/fourbyte_test.go b/signer/fourbyte/fourbyte_test.go index 56702a1eff88..cdbd7ef73d5e 100644 --- a/signer/fourbyte/fourbyte_test.go +++ b/signer/fourbyte/fourbyte_test.go @@ -22,8 +22,8 @@ import ( "strings" "testing" - "github.com/ethersocial/go-ethersocial/accounts/abi" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" ) // Tests that all the selectors contained in the 4byte database are valid. diff --git a/signer/fourbyte/validation.go b/signer/fourbyte/validation.go index 8d87b7cdab28..4d042d240f67 100644 --- a/signer/fourbyte/validation.go +++ b/signer/fourbyte/validation.go @@ -22,8 +22,8 @@ import ( "fmt" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/signer/core" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/signer/core" ) // ValidateTransaction does a number of checks on the supplied transaction, and diff --git a/signer/fourbyte/validation_test.go b/signer/fourbyte/validation_test.go index c3f7303d9ccf..0e98cd88e4b4 100644 --- a/signer/fourbyte/validation_test.go +++ b/signer/fourbyte/validation_test.go @@ -20,9 +20,9 @@ import ( "math/big" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/signer/core" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/signer/core" ) func mixAddr(a string) (*common.MixedcaseAddress, error) { diff --git a/signer/rules/rules.go b/signer/rules/rules.go index 5c6b97f988cd..39538d18b903 100644 --- a/signer/rules/rules.go +++ b/signer/rules/rules.go @@ -22,11 +22,11 @@ import ( "os" "strings" - "github.com/ethersocial/go-ethersocial/internal/ethapi" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/signer/core" - "github.com/ethersocial/go-ethersocial/signer/rules/deps" - "github.com/ethersocial/go-ethersocial/signer/storage" + "github.com/ethereum/go-ethereum/internal/ethapi" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/signer/core" + "github.com/ethereum/go-ethereum/signer/rules/deps" + "github.com/ethereum/go-ethereum/signer/storage" "github.com/robertkrimen/otto" ) diff --git a/signer/rules/rules_test.go b/signer/rules/rules_test.go index a85ea748b774..c030ed47ceb1 100644 --- a/signer/rules/rules_test.go +++ b/signer/rules/rules_test.go @@ -22,13 +22,13 @@ import ( "strings" "testing" - "github.com/ethersocial/go-ethersocial/accounts" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/internal/ethapi" - "github.com/ethersocial/go-ethersocial/signer/core" - "github.com/ethersocial/go-ethersocial/signer/storage" + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/internal/ethapi" + "github.com/ethereum/go-ethereum/signer/core" + "github.com/ethereum/go-ethereum/signer/storage" ) const JS = ` diff --git a/signer/storage/aes_gcm_storage.go b/signer/storage/aes_gcm_storage.go index 345bf92ef91a..8c5e147ac6d2 100644 --- a/signer/storage/aes_gcm_storage.go +++ b/signer/storage/aes_gcm_storage.go @@ -25,7 +25,7 @@ import ( "io/ioutil" "os" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/log" ) type storedCredential struct { diff --git a/signer/storage/aes_gcm_storage_test.go b/signer/storage/aes_gcm_storage_test.go index 62b8dc40ac2a..664ef1299405 100644 --- a/signer/storage/aes_gcm_storage_test.go +++ b/signer/storage/aes_gcm_storage_test.go @@ -23,8 +23,8 @@ import ( "io/ioutil" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" "github.com/mattn/go-colorable" ) diff --git a/tests/block_test_util.go b/tests/block_test_util.go index 0318208cf2d7..81dd7b1d042a 100644 --- a/tests/block_test_util.go +++ b/tests/block_test_util.go @@ -24,18 +24,18 @@ import ( "fmt" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/consensus" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/consensus" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" ) // A BlockTest checks handling of entire blocks. diff --git a/tests/difficulty_test.go b/tests/difficulty_test.go index 58196c948b7a..fde9db3ad4d3 100644 --- a/tests/difficulty_test.go +++ b/tests/difficulty_test.go @@ -20,8 +20,8 @@ import ( "math/big" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/params" ) var ( diff --git a/tests/difficulty_test_util.go b/tests/difficulty_test_util.go index 899ab822cd4b..fe6e90b027f2 100644 --- a/tests/difficulty_test_util.go +++ b/tests/difficulty_test_util.go @@ -20,11 +20,11 @@ import ( "fmt" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/consensus/ethash" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/consensus/ethash" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/params" ) //go:generate gencodec -type DifficultyTest -field-override difficultyTestMarshaling -out gen_difficultytest.go diff --git a/tests/gen_btheader.go b/tests/gen_btheader.go index 6d8750e8156b..f2e086a7b3be 100644 --- a/tests/gen_btheader.go +++ b/tests/gen_btheader.go @@ -6,10 +6,10 @@ import ( "encoding/json" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core/types" ) var _ = (*btHeaderMarshaling)(nil) diff --git a/tests/gen_difficultytest.go b/tests/gen_difficultytest.go index 9afb123805da..cd15ae31b5d3 100644 --- a/tests/gen_difficultytest.go +++ b/tests/gen_difficultytest.go @@ -6,8 +6,8 @@ import ( "encoding/json" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" ) var _ = (*difficultyTestMarshaling)(nil) diff --git a/tests/gen_stenv.go b/tests/gen_stenv.go index 672422aa3698..1d4baf2fd79c 100644 --- a/tests/gen_stenv.go +++ b/tests/gen_stenv.go @@ -7,8 +7,8 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/math" ) var _ = (*stEnvMarshaling)(nil) diff --git a/tests/gen_sttransaction.go b/tests/gen_sttransaction.go index 09bbc6a1b97b..451ffcbf43a1 100644 --- a/tests/gen_sttransaction.go +++ b/tests/gen_sttransaction.go @@ -6,8 +6,8 @@ import ( "encoding/json" "math/big" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" ) var _ = (*stTransactionMarshaling)(nil) diff --git a/tests/gen_vmexec.go b/tests/gen_vmexec.go index 3eccf389e6b3..a5f01cf45695 100644 --- a/tests/gen_vmexec.go +++ b/tests/gen_vmexec.go @@ -7,9 +7,9 @@ import ( "errors" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" ) var _ = (*vmExecMarshaling)(nil) diff --git a/tests/init.go b/tests/init.go index 84b4eafe6e5a..a18e12bdd2d0 100644 --- a/tests/init.go +++ b/tests/init.go @@ -20,7 +20,7 @@ import ( "fmt" "math/big" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/params" ) // Forks table defines supported forks and their chain config. diff --git a/tests/init_test.go b/tests/init_test.go index 02d4bf4b0412..053cbd6fcd39 100644 --- a/tests/init_test.go +++ b/tests/init_test.go @@ -30,7 +30,7 @@ import ( "strings" "testing" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/params" ) var ( diff --git a/tests/rlp_test_util.go b/tests/rlp_test_util.go index 420b65af262d..9069ec55a15d 100644 --- a/tests/rlp_test_util.go +++ b/tests/rlp_test_util.go @@ -24,7 +24,7 @@ import ( "math/big" "strings" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/rlp" ) // RLPTest is the JSON structure of a single RLP test. diff --git a/tests/state_test.go b/tests/state_test.go index 803df5ff8cae..0cf124d727f4 100644 --- a/tests/state_test.go +++ b/tests/state_test.go @@ -24,8 +24,8 @@ import ( "reflect" "testing" - "github.com/ethersocial/go-ethersocial/cmd/utils" - "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethereum/go-ethereum/core/vm" ) func TestState(t *testing.T) { diff --git a/tests/state_test_util.go b/tests/state_test_util.go index d9c19f833945..c6341e5248eb 100644 --- a/tests/state_test_util.go +++ b/tests/state_test_util.go @@ -24,18 +24,18 @@ import ( "strconv" "strings" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" "golang.org/x/crypto/sha3" ) diff --git a/tests/transaction_test.go b/tests/transaction_test.go index 88349cf0c9dc..0e3670d04bf7 100644 --- a/tests/transaction_test.go +++ b/tests/transaction_test.go @@ -19,7 +19,7 @@ package tests import ( "testing" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/params" ) func TestTransaction(t *testing.T) { diff --git a/tests/transaction_test_util.go b/tests/transaction_test_util.go index 23bec21c6e48..85bf1fb0bd0d 100644 --- a/tests/transaction_test_util.go +++ b/tests/transaction_test_util.go @@ -19,12 +19,12 @@ package tests import ( "fmt" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/types" - "github.com/ethersocial/go-ethersocial/params" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/params" + "github.com/ethereum/go-ethereum/rlp" ) // TransactionTest checks RLP decoding and sender derivation of transactions. diff --git a/tests/vm_test.go b/tests/vm_test.go index 2df10991ecdb..441483dffa4c 100644 --- a/tests/vm_test.go +++ b/tests/vm_test.go @@ -19,7 +19,7 @@ package tests import ( "testing" - "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethereum/go-ethereum/core/vm" ) func TestVM(t *testing.T) { diff --git a/tests/vm_test_util.go b/tests/vm_test_util.go index df2b8c93e8aa..91566c47e347 100644 --- a/tests/vm_test_util.go +++ b/tests/vm_test_util.go @@ -22,15 +22,15 @@ import ( "fmt" "math/big" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/common/math" - "github.com/ethersocial/go-ethersocial/core" - "github.com/ethersocial/go-ethersocial/core/rawdb" - "github.com/ethersocial/go-ethersocial/core/state" - "github.com/ethersocial/go-ethersocial/core/vm" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/params" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/params" ) // VMTest checks EVM execution without block or transaction context. diff --git a/trie/database.go b/trie/database.go index c32555cf2505..d8a0fa9c5342 100644 --- a/trie/database.go +++ b/trie/database.go @@ -26,11 +26,11 @@ import ( "time" "github.com/allegro/bigcache" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" + "github.com/ethereum/go-ethereum/rlp" ) var ( diff --git a/trie/database_test.go b/trie/database_test.go index c922838667a8..81c469500f98 100644 --- a/trie/database_test.go +++ b/trie/database_test.go @@ -19,8 +19,8 @@ package trie import ( "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/ethdb/memorydb" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethdb/memorydb" ) // Tests that the trie database returns a missing trie node error if attempting diff --git a/trie/errors.go b/trie/errors.go index 6636732c57aa..567b80078c06 100644 --- a/trie/errors.go +++ b/trie/errors.go @@ -19,7 +19,7 @@ package trie import ( "fmt" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" ) // MissingNodeError is returned by the trie functions (TryGet, TryUpdate, TryDelete) diff --git a/trie/hasher.go b/trie/hasher.go index e763d0b6d821..54f6a9de2b6a 100644 --- a/trie/hasher.go +++ b/trie/hasher.go @@ -20,8 +20,8 @@ import ( "hash" "sync" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/rlp" "golang.org/x/crypto/sha3" ) diff --git a/trie/iterator.go b/trie/iterator.go index 540fbb95d590..8e84dee3b617 100644 --- a/trie/iterator.go +++ b/trie/iterator.go @@ -21,8 +21,8 @@ import ( "container/heap" "errors" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/rlp" ) // Iterator is a key-value trie iterator that traverses a Trie. diff --git a/trie/iterator_test.go b/trie/iterator_test.go index d6a6244617f8..88b8103fb3f2 100644 --- a/trie/iterator_test.go +++ b/trie/iterator_test.go @@ -22,8 +22,8 @@ import ( "math/rand" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/ethdb/memorydb" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethdb/memorydb" ) func TestIterator(t *testing.T) { diff --git a/trie/node.go b/trie/node.go index 19ad96d521cb..f4055e779a1b 100644 --- a/trie/node.go +++ b/trie/node.go @@ -21,8 +21,8 @@ import ( "io" "strings" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/rlp" ) var indices = []string{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "[17]"} diff --git a/trie/proof.go b/trie/proof.go index 8a7e668fcd07..9985e730dd37 100644 --- a/trie/proof.go +++ b/trie/proof.go @@ -20,10 +20,10 @@ import ( "bytes" "fmt" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" ) // Prove constructs a merkle proof for key. The result contains all encoded nodes diff --git a/trie/proof_test.go b/trie/proof_test.go index c44316870938..c488f342c872 100644 --- a/trie/proof_test.go +++ b/trie/proof_test.go @@ -23,9 +23,9 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb/memorydb" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb/memorydb" ) func init() { diff --git a/trie/secure_trie.go b/trie/secure_trie.go index 9531babe2178..fbc591ed108a 100644 --- a/trie/secure_trie.go +++ b/trie/secure_trie.go @@ -19,8 +19,8 @@ package trie import ( "fmt" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" ) // SecureTrie wraps a trie with key hashing. In a secure trie, all diff --git a/trie/secure_trie_test.go b/trie/secure_trie_test.go index 20c5ccf6a87d..fb6c38ee222b 100644 --- a/trie/secure_trie_test.go +++ b/trie/secure_trie_test.go @@ -22,9 +22,9 @@ import ( "sync" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb/memorydb" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb/memorydb" ) func newEmptySecure() *SecureTrie { diff --git a/trie/sync.go b/trie/sync.go index ecb11851fc1a..6f40b45a1ebb 100644 --- a/trie/sync.go +++ b/trie/sync.go @@ -20,9 +20,9 @@ import ( "errors" "fmt" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/prque" - "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/prque" + "github.com/ethereum/go-ethereum/ethdb" ) // ErrNotRequested is returned by the trie sync when it's requested to process a diff --git a/trie/sync_bloom.go b/trie/sync_bloom.go index b10a2912d5e3..2182d1c43772 100644 --- a/trie/sync_bloom.go +++ b/trie/sync_bloom.go @@ -24,10 +24,10 @@ import ( "sync/atomic" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" "github.com/steakknife/bloomfilter" ) diff --git a/trie/sync_test.go b/trie/sync_test.go index 769b0b237a5e..0621bb43570e 100644 --- a/trie/sync_test.go +++ b/trie/sync_test.go @@ -20,8 +20,8 @@ import ( "bytes" "testing" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/ethdb/memorydb" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethdb/memorydb" ) // makeTestTrie create a sample test trie to test node-wise reconstruction. diff --git a/trie/trie.go b/trie/trie.go index b5f870836934..920e331fd62f 100644 --- a/trie/trie.go +++ b/trie/trie.go @@ -21,9 +21,9 @@ import ( "bytes" "fmt" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" ) var ( diff --git a/trie/trie_test.go b/trie/trie_test.go index 8225add8b53f..2a9d53d0ad6b 100644 --- a/trie/trie_test.go +++ b/trie/trie_test.go @@ -29,12 +29,12 @@ import ( "testing/quick" "github.com/davecgh/go-spew/spew" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/ethdb" - "github.com/ethersocial/go-ethersocial/ethdb/leveldb" - "github.com/ethersocial/go-ethersocial/ethdb/memorydb" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/ethdb/leveldb" + "github.com/ethereum/go-ethereum/ethdb/memorydb" + "github.com/ethereum/go-ethereum/rlp" ) func init() { diff --git a/whisper/mailserver/mailserver.go b/whisper/mailserver/mailserver.go index 6dd478823d83..d7af4baae3f9 100644 --- a/whisper/mailserver/mailserver.go +++ b/whisper/mailserver/mailserver.go @@ -21,11 +21,11 @@ import ( "encoding/binary" "fmt" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/rlp" - whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/opt" "github.com/syndtr/goleveldb/leveldb/util" diff --git a/whisper/mailserver/server_test.go b/whisper/mailserver/server_test.go index 8b2385852c27..4f80e550aa22 100644 --- a/whisper/mailserver/server_test.go +++ b/whisper/mailserver/server_test.go @@ -25,9 +25,9 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" ) const powRequirement = 0.00001 diff --git a/whisper/shhclient/client.go b/whisper/shhclient/client.go index 41118b66bea0..a814154e4795 100644 --- a/whisper/shhclient/client.go +++ b/whisper/shhclient/client.go @@ -19,10 +19,10 @@ package shhclient import ( "context" - "github.com/ethersocial/go-ethersocial" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/rpc" - whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/rpc" + whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" ) // Client defines typed wrappers for the Whisper v6 RPC API. diff --git a/whisper/whisperv6/api.go b/whisper/whisperv6/api.go index 80b80a11ad4e..d6d4c8d3ded6 100644 --- a/whisper/whisperv6/api.go +++ b/whisper/whisperv6/api.go @@ -24,12 +24,12 @@ import ( "sync" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/rpc" ) // List of errors diff --git a/whisper/whisperv6/benchmarks_test.go b/whisper/whisperv6/benchmarks_test.go index 02d6e60db586..0473179da5a5 100644 --- a/whisper/whisperv6/benchmarks_test.go +++ b/whisper/whisperv6/benchmarks_test.go @@ -20,7 +20,7 @@ import ( "crypto/sha256" "testing" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/crypto" "golang.org/x/crypto/pbkdf2" ) diff --git a/whisper/whisperv6/doc.go b/whisper/whisperv6/doc.go index bc292923caea..44c0c3271c7f 100644 --- a/whisper/whisperv6/doc.go +++ b/whisper/whisperv6/doc.go @@ -35,7 +35,7 @@ package whisperv6 import ( "time" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/crypto" ) // Whisper protocol parameters diff --git a/whisper/whisperv6/envelope.go b/whisper/whisperv6/envelope.go index a4c83bdd3bde..5b6925edb3b5 100644 --- a/whisper/whisperv6/envelope.go +++ b/whisper/whisperv6/envelope.go @@ -26,10 +26,10 @@ import ( "math/big" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/crypto/ecies" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/crypto/ecies" + "github.com/ethereum/go-ethereum/rlp" ) // Envelope represents a clear-text data packet to transmit through the Whisper diff --git a/whisper/whisperv6/envelope_test.go b/whisper/whisperv6/envelope_test.go index 3e4fd637f766..c0bb4373b884 100644 --- a/whisper/whisperv6/envelope_test.go +++ b/whisper/whisperv6/envelope_test.go @@ -22,7 +22,7 @@ import ( mrand "math/rand" "testing" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/crypto" ) func TestPoWCalculationsWithNoLeadingZeros(t *testing.T) { diff --git a/whisper/whisperv6/filter.go b/whisper/whisperv6/filter.go index aa8c28a873c3..6a5b79674b5c 100644 --- a/whisper/whisperv6/filter.go +++ b/whisper/whisperv6/filter.go @@ -21,9 +21,9 @@ import ( "fmt" "sync" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" ) // Filter represents a Whisper message filter diff --git a/whisper/whisperv6/filter_test.go b/whisper/whisperv6/filter_test.go index b6da48774342..5ce99d9f6ce9 100644 --- a/whisper/whisperv6/filter_test.go +++ b/whisper/whisperv6/filter_test.go @@ -22,8 +22,8 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" ) var seed int64 diff --git a/whisper/whisperv6/gen_criteria_json.go b/whisper/whisperv6/gen_criteria_json.go index 29108d0baded..1a428d6df730 100644 --- a/whisper/whisperv6/gen_criteria_json.go +++ b/whisper/whisperv6/gen_criteria_json.go @@ -5,7 +5,7 @@ package whisperv6 import ( "encoding/json" - "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethereum/go-ethereum/common/hexutil" ) var _ = (*criteriaOverride)(nil) diff --git a/whisper/whisperv6/gen_message_json.go b/whisper/whisperv6/gen_message_json.go index 2669353c6717..6218f5df6ed9 100644 --- a/whisper/whisperv6/gen_message_json.go +++ b/whisper/whisperv6/gen_message_json.go @@ -5,7 +5,7 @@ package whisperv6 import ( "encoding/json" - "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethereum/go-ethereum/common/hexutil" ) var _ = (*messageOverride)(nil) diff --git a/whisper/whisperv6/gen_newmessage_json.go b/whisper/whisperv6/gen_newmessage_json.go index 345d71f7b2ef..75a1279ae3ac 100644 --- a/whisper/whisperv6/gen_newmessage_json.go +++ b/whisper/whisperv6/gen_newmessage_json.go @@ -5,7 +5,7 @@ package whisperv6 import ( "encoding/json" - "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethereum/go-ethereum/common/hexutil" ) var _ = (*newMessageOverride)(nil) diff --git a/whisper/whisperv6/message.go b/whisper/whisperv6/message.go index a75d4fac8201..2d4e86244109 100644 --- a/whisper/whisperv6/message.go +++ b/whisper/whisperv6/message.go @@ -28,10 +28,10 @@ import ( mrand "math/rand" "strconv" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/crypto/ecies" - "github.com/ethersocial/go-ethersocial/log" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/crypto/ecies" + "github.com/ethereum/go-ethereum/log" ) // MessageParams specifies the exact way a message should be wrapped diff --git a/whisper/whisperv6/message_test.go b/whisper/whisperv6/message_test.go index 8cd5e522c9ba..0a5c1c85333a 100644 --- a/whisper/whisperv6/message_test.go +++ b/whisper/whisperv6/message_test.go @@ -23,9 +23,9 @@ import ( mrand "math/rand" "testing" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/rlp" ) func generateMessageParams() (*MessageParams, error) { diff --git a/whisper/whisperv6/peer.go b/whisper/whisperv6/peer.go index d045e17aa645..4451f149582b 100644 --- a/whisper/whisperv6/peer.go +++ b/whisper/whisperv6/peer.go @@ -23,10 +23,10 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/rlp" ) // Peer represents a whisper protocol peer connection. diff --git a/whisper/whisperv6/peer_test.go b/whisper/whisperv6/peer_test.go index 59b80bcc78c8..c5b044e1a638 100644 --- a/whisper/whisperv6/peer_test.go +++ b/whisper/whisperv6/peer_test.go @@ -28,13 +28,13 @@ import ( "net" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/p2p/enode" - "github.com/ethersocial/go-ethersocial/p2p/nat" - "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethereum/go-ethereum/p2p/nat" + "github.com/ethereum/go-ethereum/rlp" ) var keys = []string{ diff --git a/whisper/whisperv6/topic.go b/whisper/whisperv6/topic.go index b3e5a8116823..4dd8f283c357 100644 --- a/whisper/whisperv6/topic.go +++ b/whisper/whisperv6/topic.go @@ -19,8 +19,8 @@ package whisperv6 import ( - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" ) // TopicType represents a cryptographically secure, probabilistic partial diff --git a/whisper/whisperv6/whisper.go b/whisper/whisperv6/whisper.go index 5a8668e84444..eb713f84ee5c 100644 --- a/whisper/whisperv6/whisper.go +++ b/whisper/whisperv6/whisper.go @@ -27,12 +27,12 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethersocial/go-ethersocial/common" - "github.com/ethersocial/go-ethersocial/crypto" - "github.com/ethersocial/go-ethersocial/log" - "github.com/ethersocial/go-ethersocial/p2p" - "github.com/ethersocial/go-ethersocial/rlp" - "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/p2p" + "github.com/ethereum/go-ethereum/rlp" + "github.com/ethereum/go-ethereum/rpc" "github.com/syndtr/goleveldb/leveldb/errors" "golang.org/x/crypto/pbkdf2" "golang.org/x/sync/syncmap" diff --git a/whisper/whisperv6/whisper_test.go b/whisper/whisperv6/whisper_test.go index fd9d551ea2b6..39c2abf041d5 100644 --- a/whisper/whisperv6/whisper_test.go +++ b/whisper/whisperv6/whisper_test.go @@ -24,7 +24,7 @@ import ( "testing" "time" - "github.com/ethersocial/go-ethersocial/common" + "github.com/ethereum/go-ethereum/common" "golang.org/x/crypto/pbkdf2" ) From 838df3e8166f0e1705c17cdd1b38142e80303545 Mon Sep 17 00:00:00 2001 From: hackyminer Date: Wed, 30 Oct 2019 22:44:16 +0900 Subject: [PATCH 50/50] Gesn 0.4.1 unstable * fix import path after merge 1.9.6 branch --- accounts/abi/abi.go | 2 +- accounts/abi/abi_test.go | 4 +- accounts/abi/bind/auth.go | 12 ++-- accounts/abi/bind/backend.go | 6 +- accounts/abi/bind/backends/simulated.go | 32 +++++----- accounts/abi/bind/backends/simulated_test.go | 14 ++--- accounts/abi/bind/base.go | 12 ++-- accounts/abi/bind/base_test.go | 16 ++--- accounts/abi/bind/bind.go | 4 +- accounts/abi/bind/bind_test.go | 2 +- accounts/abi/bind/template.go | 14 ++--- accounts/abi/bind/topics.go | 6 +- accounts/abi/bind/topics_test.go | 4 +- accounts/abi/bind/util.go | 6 +- accounts/abi/bind/util_test.go | 12 ++-- accounts/abi/event.go | 4 +- accounts/abi/event_test.go | 4 +- accounts/abi/method.go | 2 +- accounts/abi/numbers.go | 4 +- accounts/abi/pack.go | 4 +- accounts/abi/pack_test.go | 2 +- accounts/abi/type_test.go | 2 +- accounts/abi/unpack.go | 2 +- accounts/abi/unpack_test.go | 2 +- accounts/accounts.go | 8 +-- accounts/accounts_test.go | 2 +- accounts/external/backend.go | 20 +++--- accounts/keystore/account_cache.go | 6 +- accounts/keystore/account_cache_test.go | 4 +- accounts/keystore/file_cache.go | 2 +- accounts/keystore/key.go | 6 +- accounts/keystore/keystore.go | 10 +-- accounts/keystore/keystore_test.go | 6 +- accounts/keystore/passphrase.go | 8 +-- accounts/keystore/passphrase_test.go | 2 +- accounts/keystore/plain.go | 2 +- accounts/keystore/plain_test.go | 4 +- accounts/keystore/presale.go | 4 +- accounts/keystore/wallet.go | 8 +-- accounts/keystore/watch.go | 2 +- accounts/manager.go | 4 +- accounts/scwallet/hub.go | 8 +-- accounts/scwallet/securechannel.go | 2 +- accounts/scwallet/wallet.go | 12 ++-- accounts/usbwallet/hub.go | 6 +- accounts/usbwallet/ledger.go | 14 ++--- accounts/usbwallet/trezor.go | 12 ++-- accounts/usbwallet/wallet.go | 12 ++-- build/ci.go | 4 +- cmd/abigen/main.go | 10 +-- cmd/bootnode/main.go | 16 ++--- cmd/checkpoint-admin/common.go | 18 +++--- cmd/checkpoint-admin/exec.go | 22 +++---- cmd/checkpoint-admin/main.go | 6 +- cmd/checkpoint-admin/status.go | 4 +- cmd/clef/main.go | 36 +++++------ cmd/devp2p/discv4cmd.go | 10 +-- cmd/devp2p/dns_cloudflare.go | 4 +- cmd/devp2p/dnscmd.go | 10 +-- cmd/devp2p/enrcmd.go | 6 +- cmd/devp2p/main.go | 6 +- cmd/devp2p/nodeset.go | 4 +- cmd/ethkey/changepassword.go | 4 +- cmd/ethkey/generate.go | 6 +- cmd/ethkey/inspect.go | 6 +- cmd/ethkey/main.go | 2 +- cmd/ethkey/message.go | 8 +-- cmd/ethkey/run_test.go | 2 +- cmd/ethkey/utils.go | 6 +- cmd/evm/compiler.go | 2 +- cmd/evm/disasm.go | 2 +- cmd/evm/internal/compiler/compiler.go | 2 +- cmd/evm/main.go | 2 +- cmd/evm/runner.go | 20 +++--- cmd/evm/staterunner.go | 8 +-- cmd/faucet/faucet.go | 34 +++++----- cmd/geth/accountcmd.go | 12 ++-- cmd/geth/chaincmd.go | 22 +++---- cmd/geth/config.go | 12 ++-- cmd/geth/consolecmd.go | 8 +-- cmd/geth/consolecmd_test.go | 2 +- cmd/geth/dao_test.go | 6 +- cmd/geth/main.go | 26 ++++---- cmd/geth/misccmd.go | 8 +-- cmd/geth/retesteth.go | 40 ++++++------ cmd/geth/retesteth_copypaste.go | 6 +- cmd/geth/run_test.go | 4 +- cmd/geth/usage.go | 4 +- cmd/p2psim/main.go | 12 ++-- cmd/puppeth/genesis.go | 12 ++-- cmd/puppeth/genesis_test.go | 2 +- cmd/puppeth/module.go | 2 +- cmd/puppeth/module_dashboard.go | 2 +- cmd/puppeth/module_ethstats.go | 2 +- cmd/puppeth/module_explorer.go | 2 +- cmd/puppeth/module_faucet.go | 4 +- cmd/puppeth/module_nginx.go | 2 +- cmd/puppeth/module_node.go | 4 +- cmd/puppeth/module_wallet.go | 2 +- cmd/puppeth/puppeth.go | 2 +- cmd/puppeth/ssh.go | 2 +- cmd/puppeth/wizard.go | 6 +- cmd/puppeth/wizard_dashboard.go | 2 +- cmd/puppeth/wizard_ethstats.go | 2 +- cmd/puppeth/wizard_explorer.go | 2 +- cmd/puppeth/wizard_faucet.go | 4 +- cmd/puppeth/wizard_genesis.go | 8 +-- cmd/puppeth/wizard_intro.go | 2 +- cmd/puppeth/wizard_netstats.go | 4 +- cmd/puppeth/wizard_network.go | 2 +- cmd/puppeth/wizard_nginx.go | 2 +- cmd/puppeth/wizard_node.go | 6 +- cmd/puppeth/wizard_wallet.go | 2 +- cmd/rlpdump/main.go | 2 +- cmd/utils/cmd.go | 20 +++--- cmd/utils/customflags.go | 2 +- cmd/utils/flags.go | 62 +++++++++---------- cmd/wnode/main.go | 20 +++--- common/bitutil/compress_test.go | 2 +- common/hexutil/json_example_test.go | 2 +- common/math/big_test.go | 2 +- common/prque/lazyqueue.go | 2 +- common/prque/lazyqueue_test.go | 2 +- common/types.go | 2 +- consensus/clique/api.go | 8 +-- consensus/clique/clique.go | 26 ++++---- consensus/clique/clique_test.go | 14 ++--- consensus/clique/snapshot.go | 10 +-- consensus/clique/snapshot_test.go | 14 ++--- consensus/consensus.go | 10 +-- consensus/ethash/algorithm.go | 8 +-- consensus/ethash/algorithm_test.go | 6 +- consensus/ethash/api.go | 6 +- consensus/ethash/consensus.go | 16 ++--- consensus/ethash/consensus_test.go | 6 +- consensus/ethash/ethash.go | 12 ++-- consensus/ethash/ethash_test.go | 6 +- consensus/ethash/sealer.go | 10 +-- consensus/ethash/sealer_test.go | 4 +- consensus/misc/dao.go | 6 +- consensus/misc/forks.go | 6 +- console/bridge.go | 8 +-- console/console.go | 6 +- console/console_test.go | 14 ++--- contracts/checkpointoracle/contract/oracle.go | 12 ++-- contracts/checkpointoracle/oracle.go | 8 +-- contracts/checkpointoracle/oracle_test.go | 14 ++--- core/asm/asm.go | 2 +- core/asm/compiler.go | 4 +- core/bench_test.go | 18 +++--- core/block_validator.go | 8 +-- core/block_validator_test.go | 10 +-- core/blockchain.go | 30 ++++----- core/blockchain_insert.go | 8 +-- core/blockchain_test.go | 20 +++--- core/blocks.go | 2 +- core/bloombits/generator.go | 2 +- core/bloombits/generator_test.go | 2 +- core/bloombits/matcher.go | 4 +- core/bloombits/matcher_test.go | 2 +- core/chain_indexer.go | 12 ++-- core/chain_indexer_test.go | 6 +- core/chain_makers.go | 16 ++--- core/chain_makers_test.go | 12 ++-- core/dao_test.go | 8 +-- core/events.go | 4 +- core/evm.go | 8 +-- core/forkid/forkid.go | 8 +-- core/forkid/forkid_test.go | 6 +- core/gen_genesis.go | 8 +-- core/gen_genesis_account.go | 6 +- core/genesis.go | 22 +++---- core/genesis_test.go | 12 ++-- core/headerchain.go | 14 ++--- core/helper_test.go | 8 +-- core/mkalloc.go | 4 +- core/rawdb/accessors_chain.go | 12 ++-- core/rawdb/accessors_chain_test.go | 8 +-- core/rawdb/accessors_indexes.go | 12 ++-- core/rawdb/accessors_indexes_test.go | 8 +-- core/rawdb/accessors_metadata.go | 10 +-- core/rawdb/database.go | 10 +-- core/rawdb/freezer.go | 10 +-- core/rawdb/freezer_reinit.go | 10 +-- core/rawdb/freezer_table.go | 6 +- core/rawdb/freezer_table_test.go | 2 +- core/rawdb/schema.go | 4 +- core/rawdb/table.go | 2 +- core/state/database.go | 6 +- core/state/dump.go | 10 +-- core/state/iterator.go | 6 +- core/state/iterator_test.go | 4 +- core/state/journal.go | 2 +- core/state/state_object.go | 8 +-- core/state/state_object_test.go | 2 +- core/state/state_test.go | 8 +-- core/state/statedb.go | 14 ++--- core/state/statedb_test.go | 6 +- core/state/sync.go | 8 +-- core/state/sync_test.go | 12 ++-- core/state_prefetcher.go | 12 ++-- core/state_processor.go | 16 ++--- core/state_transition.go | 8 +-- core/tx_cacher.go | 2 +- core/tx_journal.go | 8 +-- core/tx_list.go | 6 +- core/tx_list_test.go | 4 +- core/tx_noncer.go | 4 +- core/tx_pool.go | 16 ++--- core/tx_pool_test.go | 14 ++--- core/types.go | 6 +- core/types/block.go | 6 +- core/types/block_test.go | 4 +- core/types/bloom9.go | 4 +- core/types/bloom9_test.go | 2 +- core/types/derive_sha.go | 6 +- core/types/gen_header_json.go | 4 +- core/types/gen_log_json.go | 4 +- core/types/gen_receipt_json.go | 4 +- core/types/gen_tx_json.go | 4 +- core/types/log.go | 6 +- core/types/log_test.go | 4 +- core/types/receipt.go | 10 +-- core/types/receipt_test.go | 8 +-- core/types/transaction.go | 8 +-- core/types/transaction_signing.go | 6 +- core/types/transaction_signing_test.go | 6 +- core/types/transaction_test.go | 6 +- core/vm/analysis_test.go | 2 +- core/vm/common.go | 4 +- core/vm/contract.go | 2 +- core/vm/contracts.go | 12 ++-- core/vm/contracts_test.go | 2 +- core/vm/eips.go | 2 +- core/vm/evm.go | 6 +- core/vm/gas_table.go | 6 +- core/vm/gas_table_test.go | 10 +-- core/vm/gen_structlog.go | 6 +- core/vm/instructions.go | 8 +-- core/vm/instructions_test.go | 6 +- core/vm/interface.go | 4 +- core/vm/interpreter.go | 6 +- core/vm/jump_table.go | 2 +- core/vm/logger.go | 8 +-- core/vm/logger_json.go | 4 +- core/vm/logger_test.go | 6 +- core/vm/memory.go | 2 +- core/vm/runtime/env.go | 6 +- core/vm/runtime/runtime.go | 12 ++-- core/vm/runtime/runtime_example_test.go | 4 +- core/vm/runtime/runtime_test.go | 12 ++-- core/vm/stack_table.go | 2 +- crypto/bn256/bn256_fast.go | 2 +- crypto/bn256/bn256_fuzz.go | 4 +- crypto/bn256/bn256_slow.go | 2 +- crypto/crypto.go | 6 +- crypto/crypto_test.go | 4 +- crypto/ecies/ecies_test.go | 2 +- crypto/ecies/params.go | 2 +- crypto/signature_cgo.go | 4 +- crypto/signature_test.go | 6 +- dashboard/cpu.go | 2 +- dashboard/dashboard.go | 8 +-- dashboard/log.go | 2 +- dashboard/peers.go | 6 +- dashboard/system.go | 4 +- eth/api.go | 20 +++--- eth/api_backend.go | 30 ++++----- eth/api_test.go | 8 +-- eth/api_tracer.go | 26 ++++---- eth/backend.go | 52 ++++++++-------- eth/bloombits.go | 14 ++--- eth/config.go | 14 ++--- eth/downloader/api.go | 6 +- eth/downloader/downloader.go | 20 +++--- eth/downloader/downloader_test.go | 14 ++--- eth/downloader/events.go | 2 +- eth/downloader/fakepeer.go | 10 +-- eth/downloader/metrics.go | 2 +- eth/downloader/peer.go | 6 +- eth/downloader/queue.go | 10 +-- eth/downloader/statesync.go | 12 ++-- eth/downloader/testchain_test.go | 14 ++--- eth/downloader/types.go | 2 +- eth/enr_entry.go | 8 +-- eth/fetcher/fetcher.go | 10 +-- eth/fetcher/fetcher_test.go | 14 ++--- eth/fetcher/metrics.go | 2 +- eth/filters/api.go | 14 ++--- eth/filters/api_test.go | 4 +- eth/filters/bench_test.go | 16 ++--- eth/filters/filter.go | 14 ++--- eth/filters/filter_system.go | 16 ++--- eth/filters/filter_system_test.go | 22 +++---- eth/filters/filter_test.go | 16 ++--- eth/gasprice/gasprice.go | 10 +-- eth/gen_config.go | 14 ++--- eth/handler.go | 28 ++++----- eth/handler_test.go | 24 +++---- eth/helper_test.go | 26 ++++---- eth/metrics.go | 4 +- eth/peer.go | 8 +-- eth/protocol.go | 10 +-- eth/protocol_test.go | 12 ++-- eth/sync.go | 10 +-- eth/sync_test.go | 6 +- eth/tracers/tracer.go | 10 +-- eth/tracers/tracer_test.go | 8 +-- eth/tracers/tracers.go | 2 +- eth/tracers/tracers_test.go | 22 +++---- ethclient/ethclient.go | 12 ++-- ethclient/ethclient_test.go | 20 +++--- ethclient/signer.go | 4 +- ethdb/dbtest/testsuite.go | 2 +- ethdb/leveldb/leveldb.go | 8 +-- ethdb/leveldb/leveldb_test.go | 4 +- ethdb/memorydb/memorydb.go | 4 +- ethdb/memorydb/memorydb_test.go | 4 +- ethstats/ethstats.go | 22 +++---- event/example_feed_test.go | 2 +- event/example_scope_test.go | 2 +- event/example_subscription_test.go | 2 +- event/subscription.go | 2 +- graphql/graphql.go | 22 +++---- graphql/service.go | 8 +-- interfaces.go | 4 +- internal/debug/api.go | 2 +- internal/debug/flags.go | 6 +- internal/debug/trace.go | 2 +- internal/ethapi/addrlock.go | 2 +- internal/ethapi/api.go | 36 +++++------ internal/ethapi/backend.go | 24 +++---- internal/guide/guide_test.go | 4 +- internal/jsre/jsre.go | 4 +- internal/testlog/testlog.go | 2 +- les/api.go | 2 +- les/api_backend.go | 32 +++++----- les/api_test.go | 24 +++---- les/balance.go | 2 +- les/benchmark.go | 22 +++---- les/bloombits.go | 4 +- les/checkpointoracle.go | 12 ++-- les/client.go | 46 +++++++------- les/client_handler.go | 16 ++--- les/clientpool.go | 12 ++-- les/clientpool_test.go | 6 +- les/commons.go | 22 +++---- les/costtracker.go | 12 ++-- les/distributor.go | 2 +- les/distributor_test.go | 2 +- les/enr_entry.go | 2 +- les/fetcher.go | 14 ++--- les/flowcontrol/control.go | 4 +- les/flowcontrol/logger.go | 2 +- les/flowcontrol/manager.go | 4 +- les/flowcontrol/manager_test.go | 2 +- les/handler_test.go | 26 ++++---- les/metrics.go | 4 +- les/odr.go | 10 +-- les/odr_requests.go | 18 +++--- les/odr_test.go | 22 +++---- les/peer.go | 22 +++---- les/peer_test.go | 18 +++--- les/protocol.go | 8 +-- les/request_test.go | 10 +-- les/retrieve.go | 4 +- les/server.go | 26 ++++---- les/server_handler.go | 26 ++++---- les/serverpool.go | 16 ++--- les/servingqueue.go | 4 +- les/sync.go | 10 +-- les/sync_test.go | 10 +-- les/test_helper.go | 36 +++++------ les/txrelay.go | 6 +- les/ulc.go | 4 +- les/ulc_test.go | 6 +- light/lightchain.go | 22 +++---- light/lightchain_test.go | 14 ++--- light/nodeset.go | 8 +-- light/odr.go | 10 +-- light/odr_test.go | 26 ++++---- light/odr_util.go | 12 ++-- light/postprocess.go | 20 +++--- light/trie.go | 12 ++-- light/trie_test.go | 14 ++--- light/txpool.go | 20 +++--- light/txpool_test.go | 14 ++--- metrics/cpu_syscall.go | 2 +- metrics/exp/exp.go | 4 +- metrics/influxdb/influxdb.go | 4 +- metrics/librato/librato.go | 2 +- metrics/metrics.go | 2 +- metrics/prometheus/collector.go | 2 +- metrics/prometheus/prometheus.go | 4 +- miner/miner.go | 20 +++--- miner/stress_clique.go | 26 ++++---- miner/stress_ethash.go | 28 ++++----- miner/unconfirmed.go | 6 +- miner/unconfirmed_test.go | 4 +- miner/worker.go | 18 +++--- miner/worker_test.go | 24 +++---- mobile/accounts.go | 8 +-- mobile/android_test.go | 2 +- mobile/big.go | 2 +- mobile/bind.go | 12 ++-- mobile/common.go | 4 +- mobile/discover.go | 2 +- mobile/ethclient.go | 4 +- mobile/ethereum.go | 4 +- mobile/geth.go | 24 +++---- mobile/init.go | 2 +- mobile/interface.go | 2 +- mobile/interface_test.go | 2 +- mobile/logger.go | 2 +- mobile/p2p.go | 2 +- mobile/params.go | 6 +- mobile/primitives.go | 2 +- mobile/shhclient.go | 4 +- mobile/types.go | 8 +-- mobile/vm.go | 2 +- node/api.go | 10 +-- node/config.go | 22 +++---- node/config_test.go | 4 +- node/defaults.go | 6 +- node/node.go | 16 ++--- node/node_example_test.go | 6 +- node/node_test.go | 6 +- node/service.go | 12 ++-- node/utils_test.go | 4 +- p2p/dial.go | 6 +- p2p/dial_test.go | 10 +-- p2p/discover/common.go | 6 +- p2p/discover/node.go | 6 +- p2p/discover/ntp.go | 2 +- p2p/discover/table.go | 8 +-- p2p/discover/table_test.go | 8 +-- p2p/discover/table_util_test.go | 8 +-- p2p/discover/v4_udp.go | 12 ++-- p2p/discover/v4_udp_lookup_test.go | 4 +- p2p/discover/v4_udp_test.go | 14 ++--- p2p/discv5/database.go | 6 +- p2p/discv5/metrics.go | 2 +- p2p/discv5/net.go | 12 ++-- p2p/discv5/net_test.go | 4 +- p2p/discv5/node.go | 4 +- p2p/discv5/node_test.go | 4 +- p2p/discv5/ntp.go | 2 +- p2p/discv5/sim_test.go | 2 +- p2p/discv5/table.go | 2 +- p2p/discv5/table_test.go | 4 +- p2p/discv5/ticket.go | 8 +-- p2p/discv5/topic.go | 4 +- p2p/discv5/topic_test.go | 4 +- p2p/discv5/udp.go | 12 ++-- p2p/discv5/udp_test.go | 6 +- p2p/dnsdisc/client.go | 10 +-- p2p/dnsdisc/client_test.go | 12 ++-- p2p/dnsdisc/sync.go | 4 +- p2p/dnsdisc/tree.go | 8 +-- p2p/dnsdisc/tree_test.go | 4 +- p2p/enode/idscheme.go | 8 +-- p2p/enode/idscheme_test.go | 6 +- p2p/enode/localnode.go | 6 +- p2p/enode/localnode_test.go | 4 +- p2p/enode/node.go | 4 +- p2p/enode/node_test.go | 4 +- p2p/enode/nodedb.go | 2 +- p2p/enode/urlv4.go | 6 +- p2p/enode/urlv4_test.go | 4 +- p2p/enr/enr.go | 2 +- p2p/enr/enr_test.go | 2 +- p2p/enr/entries.go | 2 +- p2p/message.go | 6 +- p2p/metrics.go | 8 +-- p2p/nat/nat.go | 2 +- p2p/netutil/iptrack.go | 2 +- p2p/netutil/iptrack_test.go | 2 +- p2p/peer.go | 14 ++--- p2p/peer_test.go | 2 +- p2p/protocol.go | 4 +- p2p/rlpx.go | 10 +-- p2p/rlpx_test.go | 8 +-- p2p/server.go | 22 +++---- p2p/server_test.go | 10 +-- p2p/simulations/adapters/exec.go | 10 +-- p2p/simulations/adapters/inproc.go | 14 ++--- p2p/simulations/adapters/inproc_test.go | 2 +- p2p/simulations/adapters/types.go | 14 ++--- p2p/simulations/connect.go | 2 +- p2p/simulations/connect_test.go | 6 +- p2p/simulations/examples/ping-pong.go | 14 ++--- p2p/simulations/http.go | 10 +-- p2p/simulations/http_test.go | 14 ++--- p2p/simulations/mocker.go | 6 +- p2p/simulations/mocker_test.go | 2 +- p2p/simulations/network.go | 10 +-- p2p/simulations/network_test.go | 8 +-- p2p/simulations/simulation.go | 2 +- p2p/simulations/test.go | 8 +-- p2p/testing/peerpool.go | 4 +- p2p/testing/protocolsession.go | 8 +-- p2p/testing/protocoltester.go | 16 ++--- params/config.go | 4 +- params/dao.go | 2 +- rpc/client.go | 2 +- rpc/client_example_test.go | 2 +- rpc/client_test.go | 2 +- rpc/endpoints.go | 2 +- rpc/handler.go | 2 +- rpc/http.go | 2 +- rpc/ipc.go | 4 +- rpc/ipc_unix.go | 2 +- rpc/server.go | 2 +- rpc/service.go | 2 +- rpc/types.go | 4 +- rpc/types_test.go | 4 +- rpc/websocket.go | 2 +- signer/core/api.go | 20 +++--- signer/core/api_test.go | 20 +++--- signer/core/auditlog.go | 8 +-- signer/core/cliui.go | 6 +- signer/core/signed_data.go | 18 +++--- signer/core/signed_data_test.go | 12 ++-- signer/core/stdioui.go | 6 +- signer/core/types.go | 6 +- signer/core/uiapi.go | 10 +-- signer/fourbyte/abi.go | 4 +- signer/fourbyte/abi_test.go | 4 +- signer/fourbyte/fourbyte_test.go | 4 +- signer/fourbyte/validation.go | 4 +- signer/fourbyte/validation_test.go | 6 +- signer/rules/rules.go | 10 +-- signer/rules/rules_test.go | 14 ++--- signer/storage/aes_gcm_storage.go | 2 +- signer/storage/aes_gcm_storage_test.go | 4 +- tests/block_test_util.go | 24 +++---- tests/difficulty_test.go | 4 +- tests/difficulty_test_util.go | 10 +-- tests/gen_btheader.go | 8 +-- tests/gen_difficultytest.go | 4 +- tests/gen_stenv.go | 4 +- tests/gen_sttransaction.go | 4 +- tests/gen_vmexec.go | 6 +- tests/init.go | 2 +- tests/init_test.go | 2 +- tests/rlp_test_util.go | 2 +- tests/state_test.go | 2 +- tests/state_test_util.go | 24 +++---- tests/transaction_test.go | 2 +- tests/transaction_test_util.go | 12 ++-- tests/vm_test.go | 2 +- tests/vm_test_util.go | 18 +++--- trie/database.go | 10 +-- trie/database_test.go | 4 +- trie/errors.go | 2 +- trie/hasher.go | 4 +- trie/iterator.go | 4 +- trie/iterator_test.go | 4 +- trie/node.go | 4 +- trie/proof.go | 8 +-- trie/proof_test.go | 6 +- trie/secure_trie.go | 4 +- trie/secure_trie_test.go | 6 +- trie/sync.go | 6 +- trie/sync_bloom.go | 8 +-- trie/sync_test.go | 4 +- trie/trie.go | 6 +- trie/trie_test.go | 12 ++-- whisper/mailserver/mailserver.go | 10 +-- whisper/mailserver/server_test.go | 6 +- whisper/shhclient/client.go | 8 +-- whisper/whisperv6/api.go | 12 ++-- whisper/whisperv6/benchmarks_test.go | 2 +- whisper/whisperv6/doc.go | 2 +- whisper/whisperv6/envelope.go | 8 +-- whisper/whisperv6/envelope_test.go | 2 +- whisper/whisperv6/filter.go | 6 +- whisper/whisperv6/filter_test.go | 4 +- whisper/whisperv6/gen_criteria_json.go | 2 +- whisper/whisperv6/gen_message_json.go | 2 +- whisper/whisperv6/gen_newmessage_json.go | 2 +- whisper/whisperv6/message.go | 8 +-- whisper/whisperv6/message_test.go | 6 +- whisper/whisperv6/peer.go | 8 +-- whisper/whisperv6/peer_test.go | 14 ++--- whisper/whisperv6/topic.go | 4 +- whisper/whisperv6/whisper.go | 12 ++-- whisper/whisperv6/whisper_test.go | 2 +- 588 files changed, 2429 insertions(+), 2429 deletions(-) diff --git a/accounts/abi/abi.go b/accounts/abi/abi.go index 7831a5ed334a..e145cbdd7982 100644 --- a/accounts/abi/abi.go +++ b/accounts/abi/abi.go @@ -22,7 +22,7 @@ import ( "fmt" "io" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) // The ABI holds information about a contract's context and available diff --git a/accounts/abi/abi_test.go b/accounts/abi/abi_test.go index 7a795e0524f4..6526d1fe90d1 100644 --- a/accounts/abi/abi_test.go +++ b/accounts/abi/abi_test.go @@ -25,8 +25,8 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" ) const jsondata = ` diff --git a/accounts/abi/bind/auth.go b/accounts/abi/bind/auth.go index e51f0bd8ead5..3e9b5b9ddb54 100644 --- a/accounts/abi/bind/auth.go +++ b/accounts/abi/bind/auth.go @@ -22,12 +22,12 @@ import ( "io" "io/ioutil" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/external" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/accounts/external" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" ) // NewTransactor is a utility method to easily create a transaction signer from diff --git a/accounts/abi/bind/backend.go b/accounts/abi/bind/backend.go index ca60cc1b4320..687a34edb44f 100644 --- a/accounts/abi/bind/backend.go +++ b/accounts/abi/bind/backend.go @@ -21,9 +21,9 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" ) var ( diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index e30572e0a111..a076e03c785c 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.go @@ -24,22 +24,22 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/filters" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/bloombits" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/eth/filters" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rpc" ) // This nil assignment ensures compile time that SimulatedBackend implements bind.ContractBackend. diff --git a/accounts/abi/bind/backends/simulated_test.go b/accounts/abi/bind/backends/simulated_test.go index 7e0a68c08349..dc04ac6435fc 100644 --- a/accounts/abi/bind/backends/simulated_test.go +++ b/accounts/abi/bind/backends/simulated_test.go @@ -21,13 +21,13 @@ import ( "math/big" "testing" - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" + ethereum "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind/backends" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" ) func TestSimulatedBackend(t *testing.T) { diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go index f74a0af21173..710a17b2b95a 100644 --- a/accounts/abi/bind/base.go +++ b/accounts/abi/bind/base.go @@ -22,12 +22,12 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/event" + "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/accounts/abi" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/event" ) // SignerFn is a signer function callback when a contract requires a method to diff --git a/accounts/abi/bind/base_test.go b/accounts/abi/bind/base_test.go index 3ae685e00f0a..c5740f42c1ea 100644 --- a/accounts/abi/bind/base_test.go +++ b/accounts/abi/bind/base_test.go @@ -23,14 +23,14 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/accounts/abi" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/rlp" ) type mockCaller struct { diff --git a/accounts/abi/bind/bind.go b/accounts/abi/bind/bind.go index dc51e2a7ec07..bca11136fa1e 100644 --- a/accounts/abi/bind/bind.go +++ b/accounts/abi/bind/bind.go @@ -30,8 +30,8 @@ import ( "text/template" "unicode" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/accounts/abi" + "github.com/ethersocial/go-ethersocial/log" ) // Lang is a target programming language selector to generate bindings for. diff --git a/accounts/abi/bind/bind_test.go b/accounts/abi/bind/bind_test.go index 92741b99df00..28dd635e319f 100644 --- a/accounts/abi/bind/bind_test.go +++ b/accounts/abi/bind/bind_test.go @@ -26,7 +26,7 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) var bindTests = []struct { diff --git a/accounts/abi/bind/template.go b/accounts/abi/bind/template.go index 4ec65474b050..9293becf8a4c 100644 --- a/accounts/abi/bind/template.go +++ b/accounts/abi/bind/template.go @@ -16,7 +16,7 @@ package bind -import "github.com/ethereum/go-ethereum/accounts/abi" +import "github.com/ethersocial/go-ethersocial/accounts/abi" // tmplData is the data structure required to fill the binding template. type tmplData struct { @@ -88,12 +88,12 @@ import ( "math/big" "strings" - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" + ethereum "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/accounts/abi" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/event" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/accounts/abi/bind/topics.go b/accounts/abi/bind/topics.go index c7657b4a41a2..c836ce126f94 100644 --- a/accounts/abi/bind/topics.go +++ b/accounts/abi/bind/topics.go @@ -23,9 +23,9 @@ import ( "math/big" "reflect" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/accounts/abi" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" ) // makeTopics converts a filter query argument list into a filter topic set. diff --git a/accounts/abi/bind/topics_test.go b/accounts/abi/bind/topics_test.go index ac865e5b4de8..c64f61fb6cc1 100644 --- a/accounts/abi/bind/topics_test.go +++ b/accounts/abi/bind/topics_test.go @@ -20,8 +20,8 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/accounts/abi" + "github.com/ethersocial/go-ethersocial/common" ) func TestMakeTopics(t *testing.T) { diff --git a/accounts/abi/bind/util.go b/accounts/abi/bind/util.go index d129993ca12f..7ccd28df18f6 100644 --- a/accounts/abi/bind/util.go +++ b/accounts/abi/bind/util.go @@ -21,9 +21,9 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/log" ) // WaitMined waits for tx to be mined on the blockchain. diff --git a/accounts/abi/bind/util_test.go b/accounts/abi/bind/util_test.go index e0141f46e06f..4071ee80c2f6 100644 --- a/accounts/abi/bind/util_test.go +++ b/accounts/abi/bind/util_test.go @@ -22,12 +22,12 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind/backends" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" ) var testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") diff --git a/accounts/abi/event.go b/accounts/abi/event.go index f1474813afe4..c275b2cc52f4 100644 --- a/accounts/abi/event.go +++ b/accounts/abi/event.go @@ -20,8 +20,8 @@ import ( "fmt" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" ) // Event is an event potentially triggered by the EVM's LOG mechanism. The Event diff --git a/accounts/abi/event_test.go b/accounts/abi/event_test.go index 792e26762e89..53dc167782b1 100644 --- a/accounts/abi/event_test.go +++ b/accounts/abi/event_test.go @@ -25,8 +25,8 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/accounts/abi/method.go b/accounts/abi/method.go index 7da2e18fc61a..61a32c98fc37 100644 --- a/accounts/abi/method.go +++ b/accounts/abi/method.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/crypto" ) // Method represents a callable given a `Name` and whether the method is a constant. diff --git a/accounts/abi/numbers.go b/accounts/abi/numbers.go index 4d706846dacd..a686fb30833c 100644 --- a/accounts/abi/numbers.go +++ b/accounts/abi/numbers.go @@ -20,8 +20,8 @@ import ( "math/big" "reflect" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" ) var ( diff --git a/accounts/abi/pack.go b/accounts/abi/pack.go index 36c58265bd4b..5a013e84979c 100644 --- a/accounts/abi/pack.go +++ b/accounts/abi/pack.go @@ -20,8 +20,8 @@ import ( "math/big" "reflect" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" ) // packBytesSlice packs the given bytes as [L, V] as the canonical representation diff --git a/accounts/abi/pack_test.go b/accounts/abi/pack_test.go index f43e3905684c..0dd2744bd07f 100644 --- a/accounts/abi/pack_test.go +++ b/accounts/abi/pack_test.go @@ -24,7 +24,7 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) func TestPack(t *testing.T) { diff --git a/accounts/abi/type_test.go b/accounts/abi/type_test.go index 5023456aec1b..d6d7a3c6872d 100644 --- a/accounts/abi/type_test.go +++ b/accounts/abi/type_test.go @@ -22,7 +22,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) // typeWithoutStringer is a alias for the Type type which simply doesn't implement diff --git a/accounts/abi/unpack.go b/accounts/abi/unpack.go index b2e61d06c416..060076a14b9f 100644 --- a/accounts/abi/unpack.go +++ b/accounts/abi/unpack.go @@ -22,7 +22,7 @@ import ( "math/big" "reflect" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) var ( diff --git a/accounts/abi/unpack_test.go b/accounts/abi/unpack_test.go index c85b86d8c004..04a5faff5060 100644 --- a/accounts/abi/unpack_test.go +++ b/accounts/abi/unpack_test.go @@ -26,7 +26,7 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" "github.com/stretchr/testify/require" ) diff --git a/accounts/accounts.go b/accounts/accounts.go index bf5190ad98f7..c17f817e3f2f 100644 --- a/accounts/accounts.go +++ b/accounts/accounts.go @@ -21,10 +21,10 @@ import ( "fmt" "math/big" - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" + ethereum "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/event" "golang.org/x/crypto/sha3" ) diff --git a/accounts/accounts_test.go b/accounts/accounts_test.go index e8274f9f0408..b05094895321 100644 --- a/accounts/accounts_test.go +++ b/accounts/accounts_test.go @@ -20,7 +20,7 @@ import ( "bytes" "testing" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/hexutil" ) func TestTextHash(t *testing.T) { diff --git a/accounts/external/backend.go b/accounts/external/backend.go index 6089ca984446..57127b68d9ec 100644 --- a/accounts/external/backend.go +++ b/accounts/external/backend.go @@ -21,16 +21,16 @@ import ( "math/big" "sync" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rpc" - "github.com/ethereum/go-ethereum/signer/core" + "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/internal/ethapi" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethersocial/go-ethersocial/signer/core" ) type ExternalBackend struct { diff --git a/accounts/keystore/account_cache.go b/accounts/keystore/account_cache.go index 8f660e282f57..d13801ed2acd 100644 --- a/accounts/keystore/account_cache.go +++ b/accounts/keystore/account_cache.go @@ -28,9 +28,9 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/log" ) // Minimum amount of time between cache reloads. This limit applies if the platform does diff --git a/accounts/keystore/account_cache_test.go b/accounts/keystore/account_cache_test.go index fe9233c046e7..b3f0d9622743 100644 --- a/accounts/keystore/account_cache_test.go +++ b/accounts/keystore/account_cache_test.go @@ -29,8 +29,8 @@ import ( "github.com/cespare/cp" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/common" ) var ( diff --git a/accounts/keystore/file_cache.go b/accounts/keystore/file_cache.go index 73ff6ae9ee6f..be77faa607ce 100644 --- a/accounts/keystore/file_cache.go +++ b/accounts/keystore/file_cache.go @@ -25,7 +25,7 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // fileCache is a cache of files seen during scan of keystore. diff --git a/accounts/keystore/key.go b/accounts/keystore/key.go index 84d8df0c5aab..6f2fbb85d025 100644 --- a/accounts/keystore/key.go +++ b/accounts/keystore/key.go @@ -29,9 +29,9 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" "github.com/pborman/uuid" ) diff --git a/accounts/keystore/keystore.go b/accounts/keystore/keystore.go index 5b55175b1f3e..6783aa774bc6 100644 --- a/accounts/keystore/keystore.go +++ b/accounts/keystore/keystore.go @@ -33,11 +33,11 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/event" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/event" ) var ( diff --git a/accounts/keystore/keystore_test.go b/accounts/keystore/keystore_test.go index a691c5062706..807faf3054c3 100644 --- a/accounts/keystore/keystore_test.go +++ b/accounts/keystore/keystore_test.go @@ -26,9 +26,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/event" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/event" ) var testSigData = make([]byte, 32) diff --git a/accounts/keystore/passphrase.go b/accounts/keystore/passphrase.go index 1ced41e9975b..d43dd2e2175c 100644 --- a/accounts/keystore/passphrase.go +++ b/accounts/keystore/passphrase.go @@ -38,10 +38,10 @@ import ( "os" "path/filepath" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/crypto" "github.com/pborman/uuid" "golang.org/x/crypto/pbkdf2" "golang.org/x/crypto/scrypt" diff --git a/accounts/keystore/passphrase_test.go b/accounts/keystore/passphrase_test.go index 630682cebdb1..0f21871591a6 100644 --- a/accounts/keystore/passphrase_test.go +++ b/accounts/keystore/passphrase_test.go @@ -20,7 +20,7 @@ import ( "io/ioutil" "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) const ( diff --git a/accounts/keystore/plain.go b/accounts/keystore/plain.go index f62a133ce169..728710cebc18 100644 --- a/accounts/keystore/plain.go +++ b/accounts/keystore/plain.go @@ -22,7 +22,7 @@ import ( "os" "path/filepath" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) type keyStorePlain struct { diff --git a/accounts/keystore/plain_test.go b/accounts/keystore/plain_test.go index b831925838a4..0dc91a597908 100644 --- a/accounts/keystore/plain_test.go +++ b/accounts/keystore/plain_test.go @@ -27,8 +27,8 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" ) func tmpKeyStoreIface(t *testing.T, encrypted bool) (dir string, ks keyStore) { diff --git a/accounts/keystore/presale.go b/accounts/keystore/presale.go index 03055245f5e7..2f391d3b3f8d 100644 --- a/accounts/keystore/presale.go +++ b/accounts/keystore/presale.go @@ -25,8 +25,8 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/crypto" "github.com/pborman/uuid" "golang.org/x/crypto/pbkdf2" ) diff --git a/accounts/keystore/wallet.go b/accounts/keystore/wallet.go index 498067d49730..eb7e8f338592 100644 --- a/accounts/keystore/wallet.go +++ b/accounts/keystore/wallet.go @@ -19,10 +19,10 @@ package keystore import ( "math/big" - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" + ethereum "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" ) // keystoreWallet implements the accounts.Wallet interface for the original diff --git a/accounts/keystore/watch.go b/accounts/keystore/watch.go index d6ef53327d43..ee0bebe938ac 100644 --- a/accounts/keystore/watch.go +++ b/accounts/keystore/watch.go @@ -21,7 +21,7 @@ package keystore import ( "time" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" "github.com/rjeczalik/notify" ) diff --git a/accounts/manager.go b/accounts/manager.go index 731d12ea30a9..98863c72eb97 100644 --- a/accounts/manager.go +++ b/accounts/manager.go @@ -21,8 +21,8 @@ import ( "sort" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/event" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/event" ) // Config contains the settings of the global account manager. diff --git a/accounts/scwallet/hub.go b/accounts/scwallet/hub.go index 5f939c658627..c02d122cadfa 100644 --- a/accounts/scwallet/hub.go +++ b/accounts/scwallet/hub.go @@ -41,10 +41,10 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" pcsc "github.com/gballet/go-libpcsclite" ) diff --git a/accounts/scwallet/securechannel.go b/accounts/scwallet/securechannel.go index fad876a019c0..cffc94da6721 100644 --- a/accounts/scwallet/securechannel.go +++ b/accounts/scwallet/securechannel.go @@ -25,7 +25,7 @@ import ( "crypto/sha512" "fmt" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/crypto" pcsc "github.com/gballet/go-libpcsclite" "github.com/wsddn/go-ecdh" "golang.org/x/crypto/pbkdf2" diff --git a/accounts/scwallet/wallet.go b/accounts/scwallet/wallet.go index 57b597706254..8cc44d5e43b2 100644 --- a/accounts/scwallet/wallet.go +++ b/accounts/scwallet/wallet.go @@ -33,12 +33,12 @@ import ( "sync" "time" - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" + ethereum "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" pcsc "github.com/gballet/go-libpcsclite" "github.com/status-im/keycard-go/derivationpath" ) diff --git a/accounts/usbwallet/hub.go b/accounts/usbwallet/hub.go index 23be98a08483..1c6909ba0876 100644 --- a/accounts/usbwallet/hub.go +++ b/accounts/usbwallet/hub.go @@ -23,9 +23,9 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" "github.com/karalabe/usb" ) diff --git a/accounts/usbwallet/ledger.go b/accounts/usbwallet/ledger.go index 17ca9223ffe5..9ef14d882cb4 100644 --- a/accounts/usbwallet/ledger.go +++ b/accounts/usbwallet/ledger.go @@ -28,13 +28,13 @@ import ( "io" "math/big" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/rlp" ) // ledgerOpcode is an enumeration encoding the supported Ledger opcodes. diff --git a/accounts/usbwallet/trezor.go b/accounts/usbwallet/trezor.go index 1892097baf65..596dff09b98d 100644 --- a/accounts/usbwallet/trezor.go +++ b/accounts/usbwallet/trezor.go @@ -27,12 +27,12 @@ import ( "io" "math/big" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/usbwallet/trezor" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/accounts/usbwallet/trezor" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/log" "github.com/golang/protobuf/proto" ) diff --git a/accounts/usbwallet/wallet.go b/accounts/usbwallet/wallet.go index ee539d96535d..01f298400de8 100644 --- a/accounts/usbwallet/wallet.go +++ b/accounts/usbwallet/wallet.go @@ -25,12 +25,12 @@ import ( "sync" "time" - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" + ethereum "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" "github.com/karalabe/usb" ) diff --git a/build/ci.go b/build/ci.go index f60284a94e14..ba25f670aba6 100644 --- a/build/ci.go +++ b/build/ci.go @@ -58,8 +58,8 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/internal/build" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/internal/build" + "github.com/ethersocial/go-ethersocial/params" ) var ( diff --git a/cmd/abigen/main.go b/cmd/abigen/main.go index 769811500896..46bb68e6f3b1 100644 --- a/cmd/abigen/main.go +++ b/cmd/abigen/main.go @@ -23,11 +23,11 @@ import ( "os" "strings" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common/compiler" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/common/compiler" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/bootnode/main.go b/cmd/bootnode/main.go index 4c3751e70fd9..fdde7e575f79 100644 --- a/cmd/bootnode/main.go +++ b/cmd/bootnode/main.go @@ -24,14 +24,14 @@ import ( "net" "os" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/discover" - "github.com/ethereum/go-ethereum/p2p/discv5" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/nat" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/discover" + "github.com/ethersocial/go-ethersocial/p2p/discv5" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/nat" + "github.com/ethersocial/go-ethersocial/p2p/netutil" ) func main() { diff --git a/cmd/checkpoint-admin/common.go b/cmd/checkpoint-admin/common.go index 05a45dfbf997..f5de8f5a76ff 100644 --- a/cmd/checkpoint-admin/common.go +++ b/cmd/checkpoint-admin/common.go @@ -19,15 +19,15 @@ package main import ( "strconv" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/accounts/external" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/contracts/checkpointoracle" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind" + "github.com/ethersocial/go-ethersocial/accounts/external" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/contracts/checkpointoracle" + "github.com/ethersocial/go-ethersocial/ethclient" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rpc" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/checkpoint-admin/exec.go b/cmd/checkpoint-admin/exec.go index 352a96d9e6f0..da4b4d18e030 100644 --- a/cmd/checkpoint-admin/exec.go +++ b/cmd/checkpoint-admin/exec.go @@ -25,17 +25,17 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/contracts/checkpointoracle" - "github.com/ethereum/go-ethereum/contracts/checkpointoracle/contract" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/contracts/checkpointoracle" + "github.com/ethersocial/go-ethersocial/contracts/checkpointoracle/contract" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethclient" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rpc" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/checkpoint-admin/main.go b/cmd/checkpoint-admin/main.go index d4ed07e99cd6..53099f97a00c 100644 --- a/cmd/checkpoint-admin/main.go +++ b/cmd/checkpoint-admin/main.go @@ -22,9 +22,9 @@ import ( "fmt" "os" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common/fdlimit" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/common/fdlimit" + "github.com/ethersocial/go-ethersocial/log" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/checkpoint-admin/status.go b/cmd/checkpoint-admin/status.go index f613501eb35d..1207ff68bd97 100644 --- a/cmd/checkpoint-admin/status.go +++ b/cmd/checkpoint-admin/status.go @@ -19,8 +19,8 @@ package main import ( "fmt" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/common" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/clef/main.go b/cmd/clef/main.go index 9721287447ed..372e9d5099bf 100644 --- a/cmd/clef/main.go +++ b/cmd/clef/main.go @@ -35,24 +35,24 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/console" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" - "github.com/ethereum/go-ethereum/signer/core" - "github.com/ethereum/go-ethereum/signer/fourbyte" - "github.com/ethereum/go-ethereum/signer/rules" - "github.com/ethereum/go-ethereum/signer/storage" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/console" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/internal/ethapi" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethersocial/go-ethersocial/signer/core" + "github.com/ethersocial/go-ethersocial/signer/fourbyte" + "github.com/ethersocial/go-ethersocial/signer/rules" + "github.com/ethersocial/go-ethersocial/signer/storage" colorable "github.com/mattn/go-colorable" "github.com/mattn/go-isatty" "gopkg.in/urfave/cli.v1" diff --git a/cmd/devp2p/discv4cmd.go b/cmd/devp2p/discv4cmd.go index ab5b874029df..bfdb67b14627 100644 --- a/cmd/devp2p/discv4cmd.go +++ b/cmd/devp2p/discv4cmd.go @@ -22,11 +22,11 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/discover" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/p2p/discover" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/params" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/devp2p/dns_cloudflare.go b/cmd/devp2p/dns_cloudflare.go index 83279168ccae..6a30d9945a68 100644 --- a/cmd/devp2p/dns_cloudflare.go +++ b/cmd/devp2p/dns_cloudflare.go @@ -21,8 +21,8 @@ import ( "strings" "github.com/cloudflare/cloudflare-go" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/dnsdisc" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/dnsdisc" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/devp2p/dnscmd.go b/cmd/devp2p/dnscmd.go index 74d70d3aaaf9..ee8c0bc2ffbb 100644 --- a/cmd/devp2p/dnscmd.go +++ b/cmd/devp2p/dnscmd.go @@ -25,11 +25,11 @@ import ( "path/filepath" "time" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/console" - "github.com/ethereum/go-ethereum/p2p/dnsdisc" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/console" + "github.com/ethersocial/go-ethersocial/p2p/dnsdisc" + "github.com/ethersocial/go-ethersocial/p2p/enode" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/devp2p/enrcmd.go b/cmd/devp2p/enrcmd.go index 15d77dd011a8..8ba888c1b5b6 100644 --- a/cmd/devp2p/enrcmd.go +++ b/cmd/devp2p/enrcmd.go @@ -27,9 +27,9 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethersocial/go-ethersocial/rlp" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/devp2p/main.go b/cmd/devp2p/main.go index c88fe6f6123e..20e6eebbb4d0 100644 --- a/cmd/devp2p/main.go +++ b/cmd/devp2p/main.go @@ -22,9 +22,9 @@ import ( "path/filepath" "sort" - "github.com/ethereum/go-ethereum/internal/debug" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/internal/debug" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/params" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/devp2p/nodeset.go b/cmd/devp2p/nodeset.go index a4a05016e92e..e9c50631a723 100644 --- a/cmd/devp2p/nodeset.go +++ b/cmd/devp2p/nodeset.go @@ -23,8 +23,8 @@ import ( "io/ioutil" "sort" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/p2p/enode" ) const jsonIndent = " " diff --git a/cmd/ethkey/changepassword.go b/cmd/ethkey/changepassword.go index 5689c26618fd..b4374ce34b9c 100644 --- a/cmd/ethkey/changepassword.go +++ b/cmd/ethkey/changepassword.go @@ -21,8 +21,8 @@ import ( "io/ioutil" "strings" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/cmd/utils" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/ethkey/generate.go b/cmd/ethkey/generate.go index fe9a0c15192e..7e6f7a97b027 100644 --- a/cmd/ethkey/generate.go +++ b/cmd/ethkey/generate.go @@ -23,9 +23,9 @@ import ( "os" "path/filepath" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/crypto" "github.com/pborman/uuid" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/ethkey/inspect.go b/cmd/ethkey/inspect.go index ba03d4d93692..20b6c913839a 100644 --- a/cmd/ethkey/inspect.go +++ b/cmd/ethkey/inspect.go @@ -21,9 +21,9 @@ import ( "fmt" "io/ioutil" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/crypto" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/ethkey/main.go b/cmd/ethkey/main.go index 5b545d5f946b..1d04df173781 100644 --- a/cmd/ethkey/main.go +++ b/cmd/ethkey/main.go @@ -20,7 +20,7 @@ import ( "fmt" "os" - "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethersocial/go-ethersocial/cmd/utils" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/ethkey/message.go b/cmd/ethkey/message.go index 5caea69ff653..619c02f0dd2f 100644 --- a/cmd/ethkey/message.go +++ b/cmd/ethkey/message.go @@ -21,10 +21,10 @@ import ( "fmt" "io/ioutil" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/ethkey/run_test.go b/cmd/ethkey/run_test.go index 6006f6b5bb70..4b4a4a8d0692 100644 --- a/cmd/ethkey/run_test.go +++ b/cmd/ethkey/run_test.go @@ -22,7 +22,7 @@ import ( "testing" "github.com/docker/docker/pkg/reexec" - "github.com/ethereum/go-ethereum/internal/cmdtest" + "github.com/ethersocial/go-ethersocial/internal/cmdtest" ) type testEthkey struct { diff --git a/cmd/ethkey/utils.go b/cmd/ethkey/utils.go index c6cf5c25a3ba..2cca24f30ab4 100644 --- a/cmd/ethkey/utils.go +++ b/cmd/ethkey/utils.go @@ -22,9 +22,9 @@ import ( "io/ioutil" "strings" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/console" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/console" + "github.com/ethersocial/go-ethersocial/crypto" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/compiler.go b/cmd/evm/compiler.go index c019a2fe70b7..db8f0a3d3f83 100644 --- a/cmd/evm/compiler.go +++ b/cmd/evm/compiler.go @@ -21,7 +21,7 @@ import ( "fmt" "io/ioutil" - "github.com/ethereum/go-ethereum/cmd/evm/internal/compiler" + "github.com/ethersocial/go-ethersocial/cmd/evm/internal/compiler" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/disasm.go b/cmd/evm/disasm.go index 69f611e39b11..cb271a0aac01 100644 --- a/cmd/evm/disasm.go +++ b/cmd/evm/disasm.go @@ -22,7 +22,7 @@ import ( "io/ioutil" "strings" - "github.com/ethereum/go-ethereum/core/asm" + "github.com/ethersocial/go-ethersocial/core/asm" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/internal/compiler/compiler.go b/cmd/evm/internal/compiler/compiler.go index 54981b669768..cc22c5ab3d80 100644 --- a/cmd/evm/internal/compiler/compiler.go +++ b/cmd/evm/internal/compiler/compiler.go @@ -20,7 +20,7 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/core/asm" + "github.com/ethersocial/go-ethersocial/core/asm" ) func Compile(fn string, src []byte, debug bool) (string, error) { diff --git a/cmd/evm/main.go b/cmd/evm/main.go index a5159c6b7ee4..7fbf3cabe56c 100644 --- a/cmd/evm/main.go +++ b/cmd/evm/main.go @@ -22,7 +22,7 @@ import ( "math/big" "os" - "github.com/ethereum/go-ethereum/cmd/utils" + "github.com/ethersocial/go-ethersocial/cmd/utils" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/runner.go b/cmd/evm/runner.go index 3e8ecf6c3c5c..88f2c9fb6dce 100644 --- a/cmd/evm/runner.go +++ b/cmd/evm/runner.go @@ -26,16 +26,16 @@ import ( "runtime/pprof" "time" - "github.com/ethereum/go-ethereum/cmd/evm/internal/compiler" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/core/vm/runtime" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/cmd/evm/internal/compiler" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/core/vm/runtime" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/evm/staterunner.go b/cmd/evm/staterunner.go index cef2aedb5e68..743f3486af94 100644 --- a/cmd/evm/staterunner.go +++ b/cmd/evm/staterunner.go @@ -23,10 +23,10 @@ import ( "io/ioutil" "os" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/tests" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/tests" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index 12cd249d8f53..c54b54ab9c38 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -41,23 +41,23 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/ethstats" - "github.com/ethereum/go-ethereum/les" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/discv5" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/nat" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/ethclient" + "github.com/ethersocial/go-ethersocial/ethstats" + "github.com/ethersocial/go-ethersocial/les" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/discv5" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/nat" + "github.com/ethersocial/go-ethersocial/params" "golang.org/x/net/websocket" ) diff --git a/cmd/geth/accountcmd.go b/cmd/geth/accountcmd.go index bf0e58318763..a191e9d12089 100644 --- a/cmd/geth/accountcmd.go +++ b/cmd/geth/accountcmd.go @@ -20,12 +20,12 @@ import ( "fmt" "io/ioutil" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/console" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/console" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index cfd4be0a5100..428288439f68 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -26,17 +26,17 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/console" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/console" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/trie" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/geth/config.go b/cmd/geth/config.go index a6731b088bfb..ceac284f5fe4 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -29,12 +29,12 @@ import ( cli "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/dashboard" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/params" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/dashboard" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/params" + whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" "github.com/naoina/toml" ) diff --git a/cmd/geth/consolecmd.go b/cmd/geth/consolecmd.go index d5740c164e2d..00e79bf5e35e 100644 --- a/cmd/geth/consolecmd.go +++ b/cmd/geth/consolecmd.go @@ -24,10 +24,10 @@ import ( "strings" "syscall" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/console" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/console" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/rpc" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/geth/consolecmd_test.go b/cmd/geth/consolecmd_test.go index b45042f53f83..55c6b5593237 100644 --- a/cmd/geth/consolecmd_test.go +++ b/cmd/geth/consolecmd_test.go @@ -27,7 +27,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/params" ) const ( diff --git a/cmd/geth/dao_test.go b/cmd/geth/dao_test.go index 711cc6633387..62dd0cda0dc9 100644 --- a/cmd/geth/dao_test.go +++ b/cmd/geth/dao_test.go @@ -23,9 +23,9 @@ import ( "path/filepath" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/params" ) // Genesis block for nodes which don't care about the DAO fork (i.e. not configured) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 1c9d06e0d718..5ac704cd863a 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -29,19 +29,19 @@ import ( "time" "github.com/elastic/gosigar" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/console" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/internal/debug" - "github.com/ethereum/go-ethereum/les" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/node" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/console" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/ethclient" + "github.com/ethersocial/go-ethersocial/internal/debug" + "github.com/ethersocial/go-ethersocial/les" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/node" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/geth/misccmd.go b/cmd/geth/misccmd.go index 39ca47872bad..d73cd482a680 100644 --- a/cmd/geth/misccmd.go +++ b/cmd/geth/misccmd.go @@ -23,10 +23,10 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/params" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/geth/retesteth.go b/cmd/geth/retesteth.go index b6aa3706b2b3..044d089b467c 100644 --- a/cmd/geth/retesteth.go +++ b/cmd/geth/retesteth.go @@ -26,26 +26,26 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/consensus/misc" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethersocial/go-ethersocial/trie" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/geth/retesteth_copypaste.go b/cmd/geth/retesteth_copypaste.go index e2795af7f968..472504dfe07b 100644 --- a/cmd/geth/retesteth_copypaste.go +++ b/cmd/geth/retesteth_copypaste.go @@ -19,9 +19,9 @@ package main import ( "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core/types" ) // RPCTransaction represents a transaction that will serialize to the RPC representation of a transaction diff --git a/cmd/geth/run_test.go b/cmd/geth/run_test.go index f7b735b84c14..059e90cc8598 100644 --- a/cmd/geth/run_test.go +++ b/cmd/geth/run_test.go @@ -25,8 +25,8 @@ import ( "time" "github.com/docker/docker/pkg/reexec" - "github.com/ethereum/go-ethereum/internal/cmdtest" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/internal/cmdtest" + "github.com/ethersocial/go-ethersocial/rpc" ) func tmpdir(t *testing.T) string { diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index 8012c517c904..fb53ddda3650 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -24,8 +24,8 @@ import ( "strings" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/internal/debug" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/internal/debug" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/p2psim/main.go b/cmd/p2psim/main.go index f2c1bf970350..b3f3eb5b15a1 100644 --- a/cmd/p2psim/main.go +++ b/cmd/p2psim/main.go @@ -45,12 +45,12 @@ import ( "strings" "text/tabwriter" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/simulations" + "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" + "github.com/ethersocial/go-ethersocial/rpc" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/puppeth/genesis.go b/cmd/puppeth/genesis.go index ae7675cd9bc9..031273a9a567 100644 --- a/cmd/puppeth/genesis.go +++ b/cmd/puppeth/genesis.go @@ -23,12 +23,12 @@ import ( "math/big" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - math2 "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + math2 "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/params" ) // alethGenesisSpec represents the genesis specification format used by the diff --git a/cmd/puppeth/genesis_test.go b/cmd/puppeth/genesis_test.go index f128da24f90e..b1826037e85c 100644 --- a/cmd/puppeth/genesis_test.go +++ b/cmd/puppeth/genesis_test.go @@ -24,7 +24,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/core" + "github.com/ethersocial/go-ethersocial/core" ) // Tests the go-ethereum to Aleth chainspec conversion for the Stureby testnet. diff --git a/cmd/puppeth/module.go b/cmd/puppeth/module.go index b6a029a01a48..88a30d8059de 100644 --- a/cmd/puppeth/module.go +++ b/cmd/puppeth/module.go @@ -25,7 +25,7 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) var ( diff --git a/cmd/puppeth/module_dashboard.go b/cmd/puppeth/module_dashboard.go index 9a77587b4a85..357c8625798b 100644 --- a/cmd/puppeth/module_dashboard.go +++ b/cmd/puppeth/module_dashboard.go @@ -26,7 +26,7 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // dashboardContent is the actual dashboard HTML content to serve up when users diff --git a/cmd/puppeth/module_ethstats.go b/cmd/puppeth/module_ethstats.go index 58ecb83951e0..d1a6be8b6f0c 100644 --- a/cmd/puppeth/module_ethstats.go +++ b/cmd/puppeth/module_ethstats.go @@ -25,7 +25,7 @@ import ( "strings" "text/template" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // ethstatsDockerfile is the Dockerfile required to build an ethstats backend diff --git a/cmd/puppeth/module_explorer.go b/cmd/puppeth/module_explorer.go index 50b6d214bfe9..73086802605e 100644 --- a/cmd/puppeth/module_explorer.go +++ b/cmd/puppeth/module_explorer.go @@ -25,7 +25,7 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // explorerDockerfile is the Dockerfile required to run a block explorer. diff --git a/cmd/puppeth/module_faucet.go b/cmd/puppeth/module_faucet.go index 017eae1a439a..ab1566bd4450 100644 --- a/cmd/puppeth/module_faucet.go +++ b/cmd/puppeth/module_faucet.go @@ -26,8 +26,8 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/log" ) // faucetDockerfile is the Dockerfile required to build a faucet container to diff --git a/cmd/puppeth/module_nginx.go b/cmd/puppeth/module_nginx.go index 1b1ae61ff598..2a4bb156e196 100644 --- a/cmd/puppeth/module_nginx.go +++ b/cmd/puppeth/module_nginx.go @@ -24,7 +24,7 @@ import ( "path/filepath" "strconv" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // nginxDockerfile is theis the Dockerfile required to build an nginx reverse- diff --git a/cmd/puppeth/module_node.go b/cmd/puppeth/module_node.go index 77b3346784e7..81fbe14e506c 100644 --- a/cmd/puppeth/module_node.go +++ b/cmd/puppeth/module_node.go @@ -26,8 +26,8 @@ import ( "strings" "text/template" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/log" ) // nodeDockerfile is the Dockerfile required to run an Ethereum node. diff --git a/cmd/puppeth/module_wallet.go b/cmd/puppeth/module_wallet.go index 851627c048ce..0ecd908f242a 100644 --- a/cmd/puppeth/module_wallet.go +++ b/cmd/puppeth/module_wallet.go @@ -25,7 +25,7 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // walletDockerfile is the Dockerfile required to run a web wallet. diff --git a/cmd/puppeth/puppeth.go b/cmd/puppeth/puppeth.go index c3de5f936024..04a255f443d4 100644 --- a/cmd/puppeth/puppeth.go +++ b/cmd/puppeth/puppeth.go @@ -23,7 +23,7 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/puppeth/ssh.go b/cmd/puppeth/ssh.go index c507596065ba..a576e8c436fe 100644 --- a/cmd/puppeth/ssh.go +++ b/cmd/puppeth/ssh.go @@ -28,7 +28,7 @@ import ( "path/filepath" "strings" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/terminal" ) diff --git a/cmd/puppeth/wizard.go b/cmd/puppeth/wizard.go index 83536506c4cb..bac1144be3d9 100644 --- a/cmd/puppeth/wizard.go +++ b/cmd/puppeth/wizard.go @@ -31,9 +31,9 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/log" "golang.org/x/crypto/ssh/terminal" ) diff --git a/cmd/puppeth/wizard_dashboard.go b/cmd/puppeth/wizard_dashboard.go index b699d7617d00..aa04b52a7053 100644 --- a/cmd/puppeth/wizard_dashboard.go +++ b/cmd/puppeth/wizard_dashboard.go @@ -19,7 +19,7 @@ package main import ( "fmt" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // deployDashboard queries the user for various input on deploying a web-service diff --git a/cmd/puppeth/wizard_ethstats.go b/cmd/puppeth/wizard_ethstats.go index 58ff3efbe986..bb1bbf87ef7c 100644 --- a/cmd/puppeth/wizard_ethstats.go +++ b/cmd/puppeth/wizard_ethstats.go @@ -20,7 +20,7 @@ import ( "fmt" "sort" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // deployEthstats queries the user for various input on deploying an ethstats diff --git a/cmd/puppeth/wizard_explorer.go b/cmd/puppeth/wizard_explorer.go index 1a5828d2e1ff..996f2c3bc40f 100644 --- a/cmd/puppeth/wizard_explorer.go +++ b/cmd/puppeth/wizard_explorer.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // deployExplorer creates a new block explorer based on some user input. diff --git a/cmd/puppeth/wizard_faucet.go b/cmd/puppeth/wizard_faucet.go index 5c8a35754e76..8c4fa6424d4f 100644 --- a/cmd/puppeth/wizard_faucet.go +++ b/cmd/puppeth/wizard_faucet.go @@ -20,8 +20,8 @@ import ( "encoding/json" "fmt" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/log" ) // deployFaucet queries the user for various input on deploying a faucet, after diff --git a/cmd/puppeth/wizard_genesis.go b/cmd/puppeth/wizard_genesis.go index 499f320f6432..e1b278cd3108 100644 --- a/cmd/puppeth/wizard_genesis.go +++ b/cmd/puppeth/wizard_genesis.go @@ -29,10 +29,10 @@ import ( "path/filepath" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" ) // makeGenesis creates a new genesis struct based on some user input. diff --git a/cmd/puppeth/wizard_intro.go b/cmd/puppeth/wizard_intro.go index 75fb04b76f70..25644451f9e3 100644 --- a/cmd/puppeth/wizard_intro.go +++ b/cmd/puppeth/wizard_intro.go @@ -26,7 +26,7 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // makeWizard creates and returns a new puppeth wizard. diff --git a/cmd/puppeth/wizard_netstats.go b/cmd/puppeth/wizard_netstats.go index 99ca11bb1776..aaf3fd8fed9c 100644 --- a/cmd/puppeth/wizard_netstats.go +++ b/cmd/puppeth/wizard_netstats.go @@ -23,8 +23,8 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/log" "github.com/olekukonko/tablewriter" ) diff --git a/cmd/puppeth/wizard_network.go b/cmd/puppeth/wizard_network.go index 97302c0df8bb..bc44f182d400 100644 --- a/cmd/puppeth/wizard_network.go +++ b/cmd/puppeth/wizard_network.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // manageServers displays a list of servers the user can disconnect from, and an diff --git a/cmd/puppeth/wizard_nginx.go b/cmd/puppeth/wizard_nginx.go index 8397b7fd57ff..8933e061b777 100644 --- a/cmd/puppeth/wizard_nginx.go +++ b/cmd/puppeth/wizard_nginx.go @@ -19,7 +19,7 @@ package main import ( "fmt" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // ensureVirtualHost checks whether a reverse-proxy is running on the specified diff --git a/cmd/puppeth/wizard_node.go b/cmd/puppeth/wizard_node.go index 0d009252073f..02c6d2adcee7 100644 --- a/cmd/puppeth/wizard_node.go +++ b/cmd/puppeth/wizard_node.go @@ -21,9 +21,9 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/log" ) // deployNode creates a new node configuration based on some user input. diff --git a/cmd/puppeth/wizard_wallet.go b/cmd/puppeth/wizard_wallet.go index 194e4d1840a7..4f673d4eacfd 100644 --- a/cmd/puppeth/wizard_wallet.go +++ b/cmd/puppeth/wizard_wallet.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // deployWallet creates a new web wallet based on some user input. diff --git a/cmd/rlpdump/main.go b/cmd/rlpdump/main.go index d0f993c5b88d..8c616fbfccfb 100644 --- a/cmd/rlpdump/main.go +++ b/cmd/rlpdump/main.go @@ -26,7 +26,7 @@ import ( "os" "strings" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/rlp" ) var ( diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go index a3ee45ba7f06..8e027de5ec60 100644 --- a/cmd/utils/cmd.go +++ b/cmd/utils/cmd.go @@ -27,16 +27,16 @@ import ( "strings" "syscall" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/internal/debug" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/internal/debug" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/rlp" ) const ( diff --git a/cmd/utils/customflags.go b/cmd/utils/customflags.go index 66ebf9ab0467..cc32d8f400b8 100644 --- a/cmd/utils/customflags.go +++ b/cmd/utils/customflags.go @@ -26,7 +26,7 @@ import ( "path" "strings" - "github.com/ethereum/go-ethereum/common/math" + "github.com/ethersocial/go-ethersocial/common/math" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 992e59fb50c2..21730f1caffd 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -32,37 +32,37 @@ import ( "text/template" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/fdlimit" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/clique" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/dashboard" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/gasprice" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethstats" - "github.com/ethereum/go-ethereum/graphql" - "github.com/ethereum/go-ethereum/les" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/metrics/influxdb" - "github.com/ethereum/go-ethereum/miner" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/discv5" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/nat" - "github.com/ethereum/go-ethereum/p2p/netutil" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/fdlimit" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/consensus/clique" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/dashboard" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/eth/gasprice" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/ethstats" + "github.com/ethersocial/go-ethersocial/graphql" + "github.com/ethersocial/go-ethersocial/les" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/metrics/influxdb" + "github.com/ethersocial/go-ethersocial/miner" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/discv5" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/nat" + "github.com/ethersocial/go-ethersocial/p2p/netutil" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rpc" + whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" pcsclite "github.com/gballet/go-libpcsclite" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/wnode/main.go b/cmd/wnode/main.go index 2cf0fc1ea4f1..6def4fe08894 100644 --- a/cmd/wnode/main.go +++ b/cmd/wnode/main.go @@ -35,16 +35,16 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/console" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/nat" - "github.com/ethereum/go-ethereum/whisper/mailserver" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" + "github.com/ethersocial/go-ethersocial/cmd/utils" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/console" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/nat" + "github.com/ethersocial/go-ethersocial/whisper/mailserver" + whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" "golang.org/x/crypto/pbkdf2" ) diff --git a/common/bitutil/compress_test.go b/common/bitutil/compress_test.go index 13a13011dcb8..285430f67bab 100644 --- a/common/bitutil/compress_test.go +++ b/common/bitutil/compress_test.go @@ -21,7 +21,7 @@ import ( "math/rand" "testing" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/hexutil" ) // Tests that data bitset encoding and decoding works and is bijective. diff --git a/common/hexutil/json_example_test.go b/common/hexutil/json_example_test.go index 80180d918686..7406c9fe1390 100644 --- a/common/hexutil/json_example_test.go +++ b/common/hexutil/json_example_test.go @@ -20,7 +20,7 @@ import ( "encoding/json" "fmt" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/hexutil" ) type MyType [5]byte diff --git a/common/math/big_test.go b/common/math/big_test.go index be9810dc8cf5..be2df8de1958 100644 --- a/common/math/big_test.go +++ b/common/math/big_test.go @@ -22,7 +22,7 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) func TestHexOrDecimal256(t *testing.T) { diff --git a/common/prque/lazyqueue.go b/common/prque/lazyqueue.go index 92ddd77f677a..a6d54d62adb5 100644 --- a/common/prque/lazyqueue.go +++ b/common/prque/lazyqueue.go @@ -20,7 +20,7 @@ import ( "container/heap" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethersocial/go-ethersocial/common/mclock" ) // LazyQueue is a priority queue data structure where priorities can change over diff --git a/common/prque/lazyqueue_test.go b/common/prque/lazyqueue_test.go index 0bd4fc65972e..c9f735355549 100644 --- a/common/prque/lazyqueue_test.go +++ b/common/prque/lazyqueue_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethersocial/go-ethersocial/common/mclock" ) const ( diff --git a/common/types.go b/common/types.go index 8ca51a05f8c1..e750deec8018 100644 --- a/common/types.go +++ b/common/types.go @@ -26,7 +26,7 @@ import ( "reflect" "strings" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/hexutil" "golang.org/x/crypto/sha3" ) diff --git a/consensus/clique/api.go b/consensus/clique/api.go index 6bcf987af55e..9c6711e2508d 100644 --- a/consensus/clique/api.go +++ b/consensus/clique/api.go @@ -17,10 +17,10 @@ package clique import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/rpc" ) // API is a user facing RPC API to allow controlling the signer and voting diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index 02b6da35b29b..18ad55468486 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -26,19 +26,19 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/consensus/misc" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/rpc" lru "github.com/hashicorp/golang-lru" "golang.org/x/crypto/sha3" ) diff --git a/consensus/clique/clique_test.go b/consensus/clique/clique_test.go index 710f44805555..b94ccda5dc97 100644 --- a/consensus/clique/clique_test.go +++ b/consensus/clique/clique_test.go @@ -20,13 +20,13 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/params" ) // This test case is a repro of an annoying bug that took us forever to catch. diff --git a/consensus/clique/snapshot.go b/consensus/clique/snapshot.go index 4ee731a90821..f9438ee12d0d 100644 --- a/consensus/clique/snapshot.go +++ b/consensus/clique/snapshot.go @@ -22,11 +22,11 @@ import ( "sort" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" lru "github.com/hashicorp/golang-lru" ) diff --git a/consensus/clique/snapshot_test.go b/consensus/clique/snapshot_test.go index fc08722efd63..3f2d02160692 100644 --- a/consensus/clique/snapshot_test.go +++ b/consensus/clique/snapshot_test.go @@ -22,13 +22,13 @@ import ( "sort" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/params" ) // testerAccountPool is a pool to maintain currently active tester accounts, diff --git a/consensus/consensus.go b/consensus/consensus.go index f753af550ca0..1a3488d6683f 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -20,11 +20,11 @@ package consensus import ( "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rpc" ) // ChainReader defines a small collection of methods needed to access the local diff --git a/consensus/ethash/algorithm.go b/consensus/ethash/algorithm.go index d6c871092ed3..6b702a5b79a6 100644 --- a/consensus/ethash/algorithm.go +++ b/consensus/ethash/algorithm.go @@ -27,10 +27,10 @@ import ( "time" "unsafe" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/bitutil" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/bitutil" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" "golang.org/x/crypto/sha3" ) diff --git a/consensus/ethash/algorithm_test.go b/consensus/ethash/algorithm_test.go index cf8552f3ab74..d67df5000fa4 100644 --- a/consensus/ethash/algorithm_test.go +++ b/consensus/ethash/algorithm_test.go @@ -26,9 +26,9 @@ import ( "sync" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core/types" ) // prepare converts an ethash cache or dataset from a byte stream into the internal diff --git a/consensus/ethash/api.go b/consensus/ethash/api.go index 4d8eed416116..15fc363f55da 100644 --- a/consensus/ethash/api.go +++ b/consensus/ethash/api.go @@ -19,9 +19,9 @@ package ethash import ( "errors" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core/types" ) var errEthashStopped = errors.New("ethash stopped") diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index 9754bae58c72..7ccf7ff4fb10 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -25,14 +25,14 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/consensus/misc" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" "golang.org/x/crypto/sha3" ) diff --git a/consensus/ethash/consensus_test.go b/consensus/ethash/consensus_test.go index 675737d9e1aa..c0136570f975 100644 --- a/consensus/ethash/consensus_test.go +++ b/consensus/ethash/consensus_test.go @@ -23,9 +23,9 @@ import ( "path/filepath" "testing" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/params" ) type diffTest struct { diff --git a/consensus/ethash/ethash.go b/consensus/ethash/ethash.go index 78892e1da85d..67ed88315b52 100644 --- a/consensus/ethash/ethash.go +++ b/consensus/ethash/ethash.go @@ -34,12 +34,12 @@ import ( "unsafe" mmap "github.com/edsrzf/mmap-go" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/rpc" "github.com/hashicorp/golang-lru/simplelru" ) diff --git a/consensus/ethash/ethash_test.go b/consensus/ethash/ethash_test.go index 90cb6470f735..f104957c444b 100644 --- a/consensus/ethash/ethash_test.go +++ b/consensus/ethash/ethash_test.go @@ -25,9 +25,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core/types" ) // Tests that ethash works correctly in test mode. diff --git a/consensus/ethash/sealer.go b/consensus/ethash/sealer.go index 43db1fcb7fd7..1058c4e1e381 100644 --- a/consensus/ethash/sealer.go +++ b/consensus/ethash/sealer.go @@ -29,11 +29,11 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/log" ) const ( diff --git a/consensus/ethash/sealer_test.go b/consensus/ethash/sealer_test.go index 82f08d673c89..38882c62039e 100644 --- a/consensus/ethash/sealer_test.go +++ b/consensus/ethash/sealer_test.go @@ -25,8 +25,8 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" ) // Tests whether remote HTTP servers are correctly notified of new work. diff --git a/consensus/misc/dao.go b/consensus/misc/dao.go index 9b22bd7a52ab..b0dc019d6b3e 100644 --- a/consensus/misc/dao.go +++ b/consensus/misc/dao.go @@ -21,9 +21,9 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/params" ) var ( diff --git a/consensus/misc/forks.go b/consensus/misc/forks.go index 4a5e7c37e03c..373e1596fbe8 100644 --- a/consensus/misc/forks.go +++ b/consensus/misc/forks.go @@ -19,9 +19,9 @@ package misc import ( "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/params" ) // VerifyForkHashes verifies that blocks conforming to network hard-forks do have diff --git a/console/bridge.go b/console/bridge.go index c7a67a68503d..604adb7bb244 100644 --- a/console/bridge.go +++ b/console/bridge.go @@ -23,10 +23,10 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/accounts/scwallet" - "github.com/ethereum/go-ethereum/accounts/usbwallet" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/accounts/scwallet" + "github.com/ethersocial/go-ethersocial/accounts/usbwallet" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/rpc" "github.com/robertkrimen/otto" ) diff --git a/console/console.go b/console/console.go index 5326ed2c8791..133c0ac0d3a6 100644 --- a/console/console.go +++ b/console/console.go @@ -28,9 +28,9 @@ import ( "strings" "syscall" - "github.com/ethereum/go-ethereum/internal/jsre" - "github.com/ethereum/go-ethereum/internal/web3ext" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/internal/jsre" + "github.com/ethersocial/go-ethersocial/internal/web3ext" + "github.com/ethersocial/go-ethersocial/rpc" "github.com/mattn/go-colorable" "github.com/peterh/liner" "github.com/robertkrimen/otto" diff --git a/console/console_test.go b/console/console_test.go index 89dd7cd838a8..c95c06d6d287 100644 --- a/console/console_test.go +++ b/console/console_test.go @@ -26,13 +26,13 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/internal/jsre" - "github.com/ethereum/go-ethereum/miner" - "github.com/ethereum/go-ethereum/node" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/internal/jsre" + "github.com/ethersocial/go-ethersocial/miner" + "github.com/ethersocial/go-ethersocial/node" ) const ( diff --git a/contracts/checkpointoracle/contract/oracle.go b/contracts/checkpointoracle/contract/oracle.go index 3bb351792f7a..4559afa23694 100644 --- a/contracts/checkpointoracle/contract/oracle.go +++ b/contracts/checkpointoracle/contract/oracle.go @@ -7,12 +7,12 @@ import ( "math/big" "strings" - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" + ethereum "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/accounts/abi" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/event" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/contracts/checkpointoracle/oracle.go b/contracts/checkpointoracle/oracle.go index 2d725397bdf0..b0ae9277d512 100644 --- a/contracts/checkpointoracle/oracle.go +++ b/contracts/checkpointoracle/oracle.go @@ -23,10 +23,10 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/contracts/checkpointoracle/contract" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/contracts/checkpointoracle/contract" + "github.com/ethersocial/go-ethersocial/core/types" ) // CheckpointOracle is a Go wrapper around an on-chain light client checkpoint oracle. diff --git a/contracts/checkpointoracle/oracle_test.go b/contracts/checkpointoracle/oracle_test.go index 817954d11abe..fbc9f7acd501 100644 --- a/contracts/checkpointoracle/oracle_test.go +++ b/contracts/checkpointoracle/oracle_test.go @@ -27,13 +27,13 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/contracts/checkpointoracle/contract" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind/backends" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/contracts/checkpointoracle/contract" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/params" ) var ( diff --git a/core/asm/asm.go b/core/asm/asm.go index 4257198cc779..dcad38633e99 100644 --- a/core/asm/asm.go +++ b/core/asm/asm.go @@ -21,7 +21,7 @@ import ( "encoding/hex" "fmt" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethersocial/go-ethersocial/core/vm" ) // Iterator for disassembled EVM instructions diff --git a/core/asm/compiler.go b/core/asm/compiler.go index c7a544070136..40533fc24b02 100644 --- a/core/asm/compiler.go +++ b/core/asm/compiler.go @@ -22,8 +22,8 @@ import ( "os" "strings" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/core/vm" ) // Compiler contains information about the parsed source diff --git a/core/bench_test.go b/core/bench_test.go index d7a5e11c2f15..9439e2874bb9 100644 --- a/core/bench_test.go +++ b/core/bench_test.go @@ -23,15 +23,15 @@ import ( "os" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/params" ) func BenchmarkInsertChain_empty_memdb(b *testing.B) { diff --git a/core/block_validator.go b/core/block_validator.go index b36ca56d7f7a..31b0b646d22b 100644 --- a/core/block_validator.go +++ b/core/block_validator.go @@ -19,10 +19,10 @@ package core import ( "fmt" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/params" ) // BlockValidator is responsible for validating block headers, uncles and diff --git a/core/block_validator_test.go b/core/block_validator_test.go index 06e2ba1a4fd9..b2c734979f98 100644 --- a/core/block_validator_test.go +++ b/core/block_validator_test.go @@ -21,11 +21,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/params" ) // Tests that simple header verification works, for both good and bad blocks. diff --git a/core/blockchain.go b/core/blockchain.go index f97cfb8c0d82..7f0549856d2f 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -27,21 +27,21 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/common/prque" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/common/prque" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/trie" "github.com/hashicorp/golang-lru" ) diff --git a/core/blockchain_insert.go b/core/blockchain_insert.go index 5685b0a4bdd9..a1b269276346 100644 --- a/core/blockchain_insert.go +++ b/core/blockchain_insert.go @@ -19,10 +19,10 @@ package core import ( "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/log" ) // insertStats tracks and reports on block insertion. diff --git a/core/blockchain_test.go b/core/blockchain_test.go index a0fa50678382..6062e1746262 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -26,16 +26,16 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/params" ) // So we can deterministically seed different blockchains diff --git a/core/blocks.go b/core/blocks.go index f20ba4aaf295..f9570a07d900 100644 --- a/core/blocks.go +++ b/core/blocks.go @@ -16,7 +16,7 @@ package core -import "github.com/ethereum/go-ethereum/common" +import "github.com/ethersocial/go-ethersocial/common" // BadHashes represent a set of manually tracked bad hashes (usually hard forks) var BadHashes = map[common.Hash]bool{ diff --git a/core/bloombits/generator.go b/core/bloombits/generator.go index ae07481ada50..ba20634c668c 100644 --- a/core/bloombits/generator.go +++ b/core/bloombits/generator.go @@ -19,7 +19,7 @@ package bloombits import ( "errors" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/core/types" ) var ( diff --git a/core/bloombits/generator_test.go b/core/bloombits/generator_test.go index f9bcef96e0b5..64b897a0f509 100644 --- a/core/bloombits/generator_test.go +++ b/core/bloombits/generator_test.go @@ -21,7 +21,7 @@ import ( "math/rand" "testing" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/core/types" ) // Tests that batched bloom bits are correctly rotated from the input bloom diff --git a/core/bloombits/matcher.go b/core/bloombits/matcher.go index 3ec0d5ae94e5..1f41fd38607d 100644 --- a/core/bloombits/matcher.go +++ b/core/bloombits/matcher.go @@ -26,8 +26,8 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common/bitutil" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/common/bitutil" + "github.com/ethersocial/go-ethersocial/crypto" ) // bloomIndexes represents the bit indexes inside the bloom filter that belong diff --git a/core/bloombits/matcher_test.go b/core/bloombits/matcher_test.go index 91143e525e7f..248c981179ae 100644 --- a/core/bloombits/matcher_test.go +++ b/core/bloombits/matcher_test.go @@ -23,7 +23,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) const testSectionSize = 4096 diff --git a/core/chain_indexer.go b/core/chain_indexer.go index c0c2c4f7f945..c6fcbda6c4ce 100644 --- a/core/chain_indexer.go +++ b/core/chain_indexer.go @@ -24,12 +24,12 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" ) // ChainIndexerBackend defines the methods needed to process chain segments in diff --git a/core/chain_indexer_test.go b/core/chain_indexer_test.go index abf5b3cc1400..35083ca29927 100644 --- a/core/chain_indexer_test.go +++ b/core/chain_indexer_test.go @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" ) // Runs multiple tests with randomized parameters. diff --git a/core/chain_makers.go b/core/chain_makers.go index 0b0fcdb4aa39..8901761857d0 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -20,14 +20,14 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/consensus/misc" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/params" ) // BlockGen creates blocks for testing. diff --git a/core/chain_makers_test.go b/core/chain_makers_test.go index 32e3888d55ce..1afea2d62efa 100644 --- a/core/chain_makers_test.go +++ b/core/chain_makers_test.go @@ -20,12 +20,12 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/params" ) func ExampleGenerateChain() { diff --git a/core/dao_test.go b/core/dao_test.go index 4e8dba9e8488..e77205aa9bff 100644 --- a/core/dao_test.go +++ b/core/dao_test.go @@ -20,10 +20,10 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/params" ) // Tests that DAO-fork enabled clients can properly filter out fork-commencing diff --git a/core/events.go b/core/events.go index 710bdb589485..00ca2a17a806 100644 --- a/core/events.go +++ b/core/events.go @@ -17,8 +17,8 @@ package core import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" ) // NewTxsEvent is posted when a batch of transactions enter the transaction pool. diff --git a/core/evm.go b/core/evm.go index b654bbd4796f..076782213529 100644 --- a/core/evm.go +++ b/core/evm.go @@ -19,10 +19,10 @@ package core import ( "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" ) // ChainContext supports retrieving headers and consensus parameters from the diff --git a/core/forkid/forkid.go b/core/forkid/forkid.go index 8c1700879a5e..8d4cbf54fb99 100644 --- a/core/forkid/forkid.go +++ b/core/forkid/forkid.go @@ -26,10 +26,10 @@ import ( "reflect" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" ) var ( diff --git a/core/forkid/forkid_test.go b/core/forkid/forkid_test.go index 3048940236e4..2995b7b5a3d8 100644 --- a/core/forkid/forkid_test.go +++ b/core/forkid/forkid_test.go @@ -21,9 +21,9 @@ import ( "math" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" ) // TestCreation tests that different genesis and fork rule combinations result in diff --git a/core/gen_genesis.go b/core/gen_genesis.go index bb8ea1d6a239..1fcc11ec6b0e 100644 --- a/core/gen_genesis.go +++ b/core/gen_genesis.go @@ -7,10 +7,10 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/params" ) var _ = (*genesisSpecMarshaling)(nil) diff --git a/core/gen_genesis_account.go b/core/gen_genesis_account.go index 64fb9b9248f9..4f8df2c4f5d4 100644 --- a/core/gen_genesis_account.go +++ b/core/gen_genesis_account.go @@ -7,9 +7,9 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/math" ) var _ = (*genesisAccountMarshaling)(nil) diff --git a/core/genesis.go b/core/genesis.go index 46777ec87da3..53d8ce13d206 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -25,17 +25,17 @@ import ( "math/big" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" ) //go:generate gencodec -type Genesis -field-override genesisSpecMarshaling -out gen_genesis.go diff --git a/core/genesis_test.go b/core/genesis_test.go index cc174bfbbdd0..b087d24e6c9b 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -22,12 +22,12 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/params" ) func TestDefaultGenesisBlock(t *testing.T) { diff --git a/core/headerchain.go b/core/headerchain.go index 4682069cff0c..b256fe671a7b 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -26,13 +26,13 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" lru "github.com/hashicorp/golang-lru" ) diff --git a/core/helper_test.go b/core/helper_test.go index e61c92dcdd23..d04295393a22 100644 --- a/core/helper_test.go +++ b/core/helper_test.go @@ -19,10 +19,10 @@ package core import ( "container/list" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" ) // Implement our EthTest Manager diff --git a/core/mkalloc.go b/core/mkalloc.go index 5118a4fcb327..7bda60c8abc2 100644 --- a/core/mkalloc.go +++ b/core/mkalloc.go @@ -34,8 +34,8 @@ import ( "sort" "strconv" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/rlp" ) type allocItem struct{ Addr, Balance *big.Int } diff --git a/core/rawdb/accessors_chain.go b/core/rawdb/accessors_chain.go index fab7ca56c3a5..37f344500848 100644 --- a/core/rawdb/accessors_chain.go +++ b/core/rawdb/accessors_chain.go @@ -21,12 +21,12 @@ import ( "encoding/binary" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" ) // ReadCanonicalHash retrieves the hash assigned to a canonical block number. diff --git a/core/rawdb/accessors_chain_test.go b/core/rawdb/accessors_chain_test.go index 8c8affffd9e8..07322db4d793 100644 --- a/core/rawdb/accessors_chain_test.go +++ b/core/rawdb/accessors_chain_test.go @@ -23,10 +23,10 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" "golang.org/x/crypto/sha3" ) diff --git a/core/rawdb/accessors_indexes.go b/core/rawdb/accessors_indexes.go index 38f8fe10ea94..6b04eab54422 100644 --- a/core/rawdb/accessors_indexes.go +++ b/core/rawdb/accessors_indexes.go @@ -19,12 +19,12 @@ package rawdb import ( "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" ) // ReadTxLookupEntry retrieves the positional metadata associated with a transaction diff --git a/core/rawdb/accessors_indexes_test.go b/core/rawdb/accessors_indexes_test.go index c09bff010127..422703ea6706 100644 --- a/core/rawdb/accessors_indexes_test.go +++ b/core/rawdb/accessors_indexes_test.go @@ -20,10 +20,10 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/rlp" ) // Tests that positional lookup metadata can be stored and retrieved. diff --git a/core/rawdb/accessors_metadata.go b/core/rawdb/accessors_metadata.go index f8d09fbddf2d..5d4337af5fe1 100644 --- a/core/rawdb/accessors_metadata.go +++ b/core/rawdb/accessors_metadata.go @@ -19,11 +19,11 @@ package rawdb import ( "encoding/json" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" ) // ReadDatabaseVersion retrieves the version number of the database. diff --git a/core/rawdb/database.go b/core/rawdb/database.go index 353b7dce623d..19ad166cf8b0 100644 --- a/core/rawdb/database.go +++ b/core/rawdb/database.go @@ -23,11 +23,11 @@ import ( "os" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethdb/leveldb" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/ethdb/leveldb" + "github.com/ethersocial/go-ethersocial/ethdb/memorydb" + "github.com/ethersocial/go-ethersocial/log" "github.com/olekukonko/tablewriter" ) diff --git a/core/rawdb/freezer.go b/core/rawdb/freezer.go index 5497c59d4908..c09fee773b53 100644 --- a/core/rawdb/freezer.go +++ b/core/rawdb/freezer.go @@ -25,11 +25,11 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/params" "github.com/prometheus/tsdb/fileutil" ) diff --git a/core/rawdb/freezer_reinit.go b/core/rawdb/freezer_reinit.go index ea4dd33d1d6b..77c1761f5329 100644 --- a/core/rawdb/freezer_reinit.go +++ b/core/rawdb/freezer_reinit.go @@ -22,11 +22,11 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/prque" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/prque" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" ) // InitDatabaseFromFreezer reinitializes an empty database from a previous batch diff --git a/core/rawdb/freezer_table.go b/core/rawdb/freezer_table.go index 9fb341f02558..0cf36e9fb7c0 100644 --- a/core/rawdb/freezer_table.go +++ b/core/rawdb/freezer_table.go @@ -26,9 +26,9 @@ import ( "sync" "sync/atomic" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" "github.com/golang/snappy" ) diff --git a/core/rawdb/freezer_table_test.go b/core/rawdb/freezer_table_test.go index 7de10815176c..b9b6bc3cf39b 100644 --- a/core/rawdb/freezer_table_test.go +++ b/core/rawdb/freezer_table_test.go @@ -25,7 +25,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/metrics" + "github.com/ethersocial/go-ethersocial/metrics" ) func init() { diff --git a/core/rawdb/schema.go b/core/rawdb/schema.go index a44a2c99f94f..1ee7be22f84a 100644 --- a/core/rawdb/schema.go +++ b/core/rawdb/schema.go @@ -20,8 +20,8 @@ package rawdb import ( "encoding/binary" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/metrics" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/metrics" ) // The fields below define the low level database schema prefixing. diff --git a/core/rawdb/table.go b/core/rawdb/table.go index 6610b7f5a256..586f0c486f4a 100644 --- a/core/rawdb/table.go +++ b/core/rawdb/table.go @@ -17,7 +17,7 @@ package rawdb import ( - "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethersocial/go-ethersocial/ethdb" ) // table is a wrapper around a database that prefixes each key access with a pre- diff --git a/core/state/database.go b/core/state/database.go index ecc2c134da6c..f2404fbaae44 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -19,9 +19,9 @@ package state import ( "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/trie" lru "github.com/hashicorp/golang-lru" ) diff --git a/core/state/dump.go b/core/state/dump.go index 7912fd5f9a08..b272be3891c6 100644 --- a/core/state/dump.go +++ b/core/state/dump.go @@ -20,11 +20,11 @@ import ( "encoding/json" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/trie" ) // DumpAccount represents an account in the state diff --git a/core/state/iterator.go b/core/state/iterator.go index 6a5c73d3d13c..0301bc4c009f 100644 --- a/core/state/iterator.go +++ b/core/state/iterator.go @@ -20,9 +20,9 @@ import ( "bytes" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/trie" ) // NodeIterator is an iterator to traverse the entire state trie post-order, diff --git a/core/state/iterator_test.go b/core/state/iterator_test.go index 69f51c4c7d8a..9175e2a5ac2d 100644 --- a/core/state/iterator_test.go +++ b/core/state/iterator_test.go @@ -20,8 +20,8 @@ import ( "bytes" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/ethdb" ) // Tests that the node iterator indeed walks over the entire database contents. diff --git a/core/state/journal.go b/core/state/journal.go index a03ca57dbc64..6e07b5d68550 100644 --- a/core/state/journal.go +++ b/core/state/journal.go @@ -19,7 +19,7 @@ package state import ( "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) // journalEntry is a modification entry in the state change journal that can be diff --git a/core/state/state_object.go b/core/state/state_object.go index 8680de021f42..1ccb4f309d84 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -23,10 +23,10 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/rlp" ) var emptyCodeHash = crypto.Keccak256(nil) diff --git a/core/state/state_object_test.go b/core/state/state_object_test.go index e86d3b994371..87bdb1e1e4b3 100644 --- a/core/state/state_object_test.go +++ b/core/state/state_object_test.go @@ -23,7 +23,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) func BenchmarkCutOriginal(b *testing.B) { diff --git a/core/state/state_test.go b/core/state/state_test.go index d6ff714ee49c..df8392cd0a28 100644 --- a/core/state/state_test.go +++ b/core/state/state_test.go @@ -21,10 +21,10 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb" checker "gopkg.in/check.v1" ) diff --git a/core/state/statedb.go b/core/state/statedb.go index 4b4f374c9245..222f468631c2 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -24,13 +24,13 @@ import ( "sort" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/trie" ) type revision struct { diff --git a/core/state/statedb_test.go b/core/state/statedb_test.go index bfb081191374..6fd7c31c399e 100644 --- a/core/state/statedb_test.go +++ b/core/state/statedb_test.go @@ -31,9 +31,9 @@ import ( "gopkg.in/check.v1" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" ) // Tests that updating a state trie does not leak any database writes prior to diff --git a/core/state/sync.go b/core/state/sync.go index ef7930527366..88888c729c00 100644 --- a/core/state/sync.go +++ b/core/state/sync.go @@ -19,10 +19,10 @@ package state import ( "bytes" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/trie" ) // NewStateSync create a new state trie download scheduler. diff --git a/core/state/sync_test.go b/core/state/sync_test.go index de098dce0fea..17b3066b03dd 100644 --- a/core/state/sync_test.go +++ b/core/state/sync_test.go @@ -21,12 +21,12 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/ethdb/memorydb" + "github.com/ethersocial/go-ethersocial/trie" ) // testAccount is the data associated with an account used by the state tests. diff --git a/core/state_prefetcher.go b/core/state_prefetcher.go index cb85a05b578e..db9c0fd8117c 100644 --- a/core/state_prefetcher.go +++ b/core/state_prefetcher.go @@ -19,12 +19,12 @@ package core import ( "sync/atomic" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/params" ) // statePrefetcher is a basic Prefetcher, which blindly executes a block on top diff --git a/core/state_processor.go b/core/state_processor.go index cfe17d587b46..70904ade8c11 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -17,14 +17,14 @@ package core import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/consensus/misc" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/params" ) // StateProcessor is a basic Processor, which takes care of transitioning diff --git a/core/state_transition.go b/core/state_transition.go index bef6e9b0eb2f..146fe4de60d2 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -21,10 +21,10 @@ import ( "math" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" ) var ( diff --git a/core/tx_cacher.go b/core/tx_cacher.go index b1e5d676a2b1..8c90db4867f0 100644 --- a/core/tx_cacher.go +++ b/core/tx_cacher.go @@ -19,7 +19,7 @@ package core import ( "runtime" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/core/types" ) // senderCacher is a concurrent transaction sender recoverer and cacher. diff --git a/core/tx_journal.go b/core/tx_journal.go index 41b5156d4ad2..f80709f36c47 100644 --- a/core/tx_journal.go +++ b/core/tx_journal.go @@ -21,10 +21,10 @@ import ( "io" "os" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/rlp" ) // errNoActiveJournal is returned if a transaction is attempted to be inserted diff --git a/core/tx_list.go b/core/tx_list.go index 75bfdaedac1a..f963fd926929 100644 --- a/core/tx_list.go +++ b/core/tx_list.go @@ -22,9 +22,9 @@ import ( "math/big" "sort" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/log" ) // nonceHeap is a heap.Interface implementation over 64bit unsigned integers for diff --git a/core/tx_list_test.go b/core/tx_list_test.go index d579f501afa8..86f92c85523e 100644 --- a/core/tx_list_test.go +++ b/core/tx_list_test.go @@ -20,8 +20,8 @@ import ( "math/rand" "testing" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" ) // Tests that transactions can be added to strict lists and list contents and diff --git a/core/tx_noncer.go b/core/tx_noncer.go index aa87c643aee2..49e41ff4731c 100644 --- a/core/tx_noncer.go +++ b/core/tx_noncer.go @@ -19,8 +19,8 @@ package core import ( "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/state" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/state" ) // txNoncer is a tiny virtual state database to manage the executable nonces of diff --git a/core/tx_pool.go b/core/tx_pool.go index f7032dbd1e8a..a9f88b04264f 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -25,14 +25,14 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/prque" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/prque" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/params" ) const ( diff --git a/core/tx_pool_test.go b/core/tx_pool_test.go index 0f1e7ac8f8fd..5cf52ed2a59c 100644 --- a/core/tx_pool_test.go +++ b/core/tx_pool_test.go @@ -26,13 +26,13 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/params" ) // testTxPoolConfig is a transaction pool configuration without stateful disk diff --git a/core/types.go b/core/types.go index 4c5b74a49865..0029b88427fd 100644 --- a/core/types.go +++ b/core/types.go @@ -17,9 +17,9 @@ package core import ( - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" ) // Validator is an interface which defines the standard for block validation. It diff --git a/core/types/block.go b/core/types/block.go index b0ec7fc77d68..2eac1758cdb0 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -27,9 +27,9 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/rlp" "golang.org/x/crypto/sha3" ) diff --git a/core/types/block_test.go b/core/types/block_test.go index ff0a641e5ceb..7a60c2f7e7de 100644 --- a/core/types/block_test.go +++ b/core/types/block_test.go @@ -22,8 +22,8 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/rlp" ) // from bcValidBlockTest.json, "SimpleTx" diff --git a/core/types/bloom9.go b/core/types/bloom9.go index d045c9e6678e..aca78863bbe8 100644 --- a/core/types/bloom9.go +++ b/core/types/bloom9.go @@ -20,8 +20,8 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/crypto" ) type bytesBacked interface { diff --git a/core/types/bloom9_test.go b/core/types/bloom9_test.go index a28ac0e7afba..926b1658ac82 100644 --- a/core/types/bloom9_test.go +++ b/core/types/bloom9_test.go @@ -54,7 +54,7 @@ func TestBloom(t *testing.T) { import ( "testing" - "github.com/ethereum/go-ethereum/core/state" + "github.com/ethersocial/go-ethersocial/core/state" ) func TestBloom9(t *testing.T) { diff --git a/core/types/derive_sha.go b/core/types/derive_sha.go index 00c42c5bc622..42b1a24ee79e 100644 --- a/core/types/derive_sha.go +++ b/core/types/derive_sha.go @@ -19,9 +19,9 @@ package types import ( "bytes" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/trie" ) type DerivableList interface { diff --git a/core/types/gen_header_json.go b/core/types/gen_header_json.go index 4212b8d94d25..882dfd96c6e0 100644 --- a/core/types/gen_header_json.go +++ b/core/types/gen_header_json.go @@ -7,8 +7,8 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" ) var _ = (*headerMarshaling)(nil) diff --git a/core/types/gen_log_json.go b/core/types/gen_log_json.go index 6e94339478f0..5eabbda5a30e 100644 --- a/core/types/gen_log_json.go +++ b/core/types/gen_log_json.go @@ -6,8 +6,8 @@ import ( "encoding/json" "errors" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" ) var _ = (*logMarshaling)(nil) diff --git a/core/types/gen_receipt_json.go b/core/types/gen_receipt_json.go index 790ed65b5817..0ceda3ebad73 100644 --- a/core/types/gen_receipt_json.go +++ b/core/types/gen_receipt_json.go @@ -7,8 +7,8 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" ) var _ = (*receiptMarshaling)(nil) diff --git a/core/types/gen_tx_json.go b/core/types/gen_tx_json.go index e676058ecc4b..8f5bb1e0f81f 100644 --- a/core/types/gen_tx_json.go +++ b/core/types/gen_tx_json.go @@ -7,8 +7,8 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" ) var _ = (*txdataMarshaling)(nil) diff --git a/core/types/log.go b/core/types/log.go index 006f62bbf6f6..2d657c2d5114 100644 --- a/core/types/log.go +++ b/core/types/log.go @@ -19,9 +19,9 @@ package types import ( "io" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/rlp" ) //go:generate gencodec -type Log -field-override logMarshaling -out gen_log_json.go diff --git a/core/types/log_test.go b/core/types/log_test.go index 0e56acfe4aa3..4bbb2693eb89 100644 --- a/core/types/log_test.go +++ b/core/types/log_test.go @@ -23,8 +23,8 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" ) var unmarshalLogTests = map[string]struct { diff --git a/core/types/receipt.go b/core/types/receipt.go index a96c7525ef3b..99c24754307f 100644 --- a/core/types/receipt.go +++ b/core/types/receipt.go @@ -24,11 +24,11 @@ import ( "math/big" "unsafe" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" ) //go:generate gencodec -type Receipt -field-override receiptMarshaling -out gen_receipt_json.go diff --git a/core/types/receipt_test.go b/core/types/receipt_test.go index 806b3dd2ab88..115008c23095 100644 --- a/core/types/receipt_test.go +++ b/core/types/receipt_test.go @@ -23,10 +23,10 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" ) func TestLegacyReceiptDecoding(t *testing.T) { diff --git a/core/types/transaction.go b/core/types/transaction.go index 3eb8df0ac7c7..a95f307fa005 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -23,10 +23,10 @@ import ( "math/big" "sync/atomic" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/rlp" ) //go:generate gencodec -type txdata -field-override txdataMarshaling -out gen_tx_json.go diff --git a/core/types/transaction_signing.go b/core/types/transaction_signing.go index 842fedbd03d6..9b7c9d1b7303 100644 --- a/core/types/transaction_signing.go +++ b/core/types/transaction_signing.go @@ -22,9 +22,9 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/params" ) var ( diff --git a/core/types/transaction_signing_test.go b/core/types/transaction_signing_test.go index 689fc38a9b66..c5405502c967 100644 --- a/core/types/transaction_signing_test.go +++ b/core/types/transaction_signing_test.go @@ -20,9 +20,9 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/rlp" ) func TestEIP155Signing(t *testing.T) { diff --git a/core/types/transaction_test.go b/core/types/transaction_test.go index 7a1b6cd4d4b7..56946ff30541 100644 --- a/core/types/transaction_test.go +++ b/core/types/transaction_test.go @@ -23,9 +23,9 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/rlp" ) // The values in those tests are from the Transaction Tests diff --git a/core/vm/analysis_test.go b/core/vm/analysis_test.go index fd2d744d87f4..c089f1418589 100644 --- a/core/vm/analysis_test.go +++ b/core/vm/analysis_test.go @@ -19,7 +19,7 @@ package vm import ( "testing" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/crypto" ) func TestJumpDestAnalysis(t *testing.T) { diff --git a/core/vm/common.go b/core/vm/common.go index d592a9410dd0..52a5b2852a1d 100644 --- a/core/vm/common.go +++ b/core/vm/common.go @@ -19,8 +19,8 @@ package vm import ( "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" ) // calcMemSize64 calculates the required memory size, and returns diff --git a/core/vm/contract.go b/core/vm/contract.go index 375e24bc1974..4ee3df333140 100644 --- a/core/vm/contract.go +++ b/core/vm/contract.go @@ -19,7 +19,7 @@ package vm import ( "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) // ContractRef is a reference to the contract's backing object diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 875054f89a70..2f61fa20463a 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -22,12 +22,12 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/crypto/blake2b" - "github.com/ethereum/go-ethereum/crypto/bn256" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/crypto/blake2b" + "github.com/ethersocial/go-ethersocial/crypto/bn256" + "github.com/ethersocial/go-ethersocial/params" "golang.org/x/crypto/ripemd160" ) diff --git a/core/vm/contracts_test.go b/core/vm/contracts_test.go index ae95b4462fef..3703792da5d6 100644 --- a/core/vm/contracts_test.go +++ b/core/vm/contracts_test.go @@ -22,7 +22,7 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) // precompiledTest defines the input/output pairs for precompiled contract tests. diff --git a/core/vm/eips.go b/core/vm/eips.go index 075f5b760669..71b7ce15b03d 100644 --- a/core/vm/eips.go +++ b/core/vm/eips.go @@ -19,7 +19,7 @@ package vm import ( "fmt" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/params" ) // EnableEIP enables the given EIP on the config. diff --git a/core/vm/evm.go b/core/vm/evm.go index 751c1fdc1f41..767c996c911c 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -21,9 +21,9 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/params" ) // emptyCodeHash is used by create to ensure deployment is disallowed to already diff --git a/core/vm/gas_table.go b/core/vm/gas_table.go index 1d3c4f1003e0..4806c5e2708b 100644 --- a/core/vm/gas_table.go +++ b/core/vm/gas_table.go @@ -19,9 +19,9 @@ package vm import ( "errors" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/params" ) // memoryGasCost calculates the quadratic gas for memory expansion. It does so diff --git a/core/vm/gas_table_test.go b/core/vm/gas_table_test.go index 5d443de0eae6..054b598ea389 100644 --- a/core/vm/gas_table_test.go +++ b/core/vm/gas_table_test.go @@ -21,11 +21,11 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/params" ) func TestMemoryGasCost(t *testing.T) { diff --git a/core/vm/gen_structlog.go b/core/vm/gen_structlog.go index 726012e59ecf..407326a0724a 100644 --- a/core/vm/gen_structlog.go +++ b/core/vm/gen_structlog.go @@ -6,9 +6,9 @@ import ( "encoding/json" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/math" ) var _ = (*structLogMarshaling)(nil) diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 7b6909c9279a..b1c824a964c3 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -20,10 +20,10 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/params" "golang.org/x/crypto/sha3" ) diff --git a/core/vm/instructions_test.go b/core/vm/instructions_test.go index 50d0a9ddae30..73ee20691f15 100644 --- a/core/vm/instructions_test.go +++ b/core/vm/instructions_test.go @@ -24,9 +24,9 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/params" ) type TwoOperandTestcase struct { diff --git a/core/vm/interface.go b/core/vm/interface.go index dd401466adfa..8860fdf016b7 100644 --- a/core/vm/interface.go +++ b/core/vm/interface.go @@ -19,8 +19,8 @@ package vm import ( "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" ) // StateDB is an EVM database for full state querying. diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index fe06492de3f2..ec335eb188d8 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -21,9 +21,9 @@ import ( "hash" "sync/atomic" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/log" ) // Config are the configuration options for the Interpreter diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index b26b55284c58..cb207409e34e 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -19,7 +19,7 @@ package vm import ( "errors" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/params" ) type ( diff --git a/core/vm/logger.go b/core/vm/logger.go index 262ee5cc3e83..7c4da75ce29d 100644 --- a/core/vm/logger.go +++ b/core/vm/logger.go @@ -23,10 +23,10 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/core/types" ) // Storage represents a contract's storage. diff --git a/core/vm/logger_json.go b/core/vm/logger_json.go index 04a83d0660fc..8f3e4be88d90 100644 --- a/core/vm/logger_json.go +++ b/core/vm/logger_json.go @@ -22,8 +22,8 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" ) type JSONLogger struct { diff --git a/core/vm/logger_test.go b/core/vm/logger_test.go index 2ea7535a794d..f6d812a45e01 100644 --- a/core/vm/logger_test.go +++ b/core/vm/logger_test.go @@ -20,9 +20,9 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/params" ) type dummyContractRef struct { diff --git a/core/vm/memory.go b/core/vm/memory.go index 7e6f0eb940dc..e7a9042f961e 100644 --- a/core/vm/memory.go +++ b/core/vm/memory.go @@ -20,7 +20,7 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common/math" + "github.com/ethersocial/go-ethersocial/common/math" ) // Memory implements a simple memory model for the ethereum virtual machine. diff --git a/core/vm/runtime/env.go b/core/vm/runtime/env.go index 31c9b9cf9da0..97b1e57ca447 100644 --- a/core/vm/runtime/env.go +++ b/core/vm/runtime/env.go @@ -17,9 +17,9 @@ package runtime import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/vm" ) func NewEnv(cfg *Config) *vm.EVM { diff --git a/core/vm/runtime/runtime.go b/core/vm/runtime/runtime.go index db1f6f38222b..2894faf33422 100644 --- a/core/vm/runtime/runtime.go +++ b/core/vm/runtime/runtime.go @@ -21,12 +21,12 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/params" ) // Config is a basic type specifying certain configuration flags for running diff --git a/core/vm/runtime/runtime_example_test.go b/core/vm/runtime/runtime_example_test.go index b7d0ddc384ea..c634cfd44c9e 100644 --- a/core/vm/runtime/runtime_example_test.go +++ b/core/vm/runtime/runtime_example_test.go @@ -19,8 +19,8 @@ package runtime_test import ( "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/vm/runtime" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/vm/runtime" ) func ExampleExecute() { diff --git a/core/vm/runtime/runtime_test.go b/core/vm/runtime/runtime_test.go index 15f545ddcafb..28e816fbb8de 100644 --- a/core/vm/runtime/runtime_test.go +++ b/core/vm/runtime/runtime_test.go @@ -21,12 +21,12 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/accounts/abi" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/params" ) func TestDefaults(t *testing.T) { diff --git a/core/vm/stack_table.go b/core/vm/stack_table.go index 10c12901afdb..8a9cb92d180c 100644 --- a/core/vm/stack_table.go +++ b/core/vm/stack_table.go @@ -17,7 +17,7 @@ package vm import ( - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/params" ) func minSwapStack(n int) int { diff --git a/crypto/bn256/bn256_fast.go b/crypto/bn256/bn256_fast.go index 5c081493b0fb..ac6eaaf98181 100644 --- a/crypto/bn256/bn256_fast.go +++ b/crypto/bn256/bn256_fast.go @@ -7,7 +7,7 @@ // Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve. package bn256 -import "github.com/ethereum/go-ethereum/crypto/bn256/cloudflare" +import "github.com/ethersocial/go-ethersocial/crypto/bn256/cloudflare" // G1 is an abstract cyclic group. The zero value is suitable for use as the // output of an operation, but cannot be used as an input. diff --git a/crypto/bn256/bn256_fuzz.go b/crypto/bn256/bn256_fuzz.go index 6aa142117045..16e3de72f817 100644 --- a/crypto/bn256/bn256_fuzz.go +++ b/crypto/bn256/bn256_fuzz.go @@ -10,8 +10,8 @@ import ( "bytes" "math/big" - cloudflare "github.com/ethereum/go-ethereum/crypto/bn256/cloudflare" - google "github.com/ethereum/go-ethereum/crypto/bn256/google" + cloudflare "github.com/ethersocial/go-ethersocial/crypto/bn256/cloudflare" + google "github.com/ethersocial/go-ethersocial/crypto/bn256/google" ) // FuzzAdd fuzzez bn256 addition between the Google and Cloudflare libraries. diff --git a/crypto/bn256/bn256_slow.go b/crypto/bn256/bn256_slow.go index 47df49d41763..81d60659ef75 100644 --- a/crypto/bn256/bn256_slow.go +++ b/crypto/bn256/bn256_slow.go @@ -7,7 +7,7 @@ // Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve. package bn256 -import "github.com/ethereum/go-ethereum/crypto/bn256/google" +import "github.com/ethersocial/go-ethersocial/crypto/bn256/google" // G1 is an abstract cyclic group. The zero value is suitable for use as the // output of an operation, but cannot be used as an input. diff --git a/crypto/crypto.go b/crypto/crypto.go index 2869b4c19165..8c3617fb0a0c 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -28,9 +28,9 @@ import ( "math/big" "os" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/rlp" "golang.org/x/crypto/sha3" ) diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go index 177c19c0cfca..9c568799fd08 100644 --- a/crypto/crypto_test.go +++ b/crypto/crypto_test.go @@ -26,8 +26,8 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" ) var testAddrHex = "970e8128ab834e8eac17ab8e3812f010678cf791" diff --git a/crypto/ecies/ecies_test.go b/crypto/ecies/ecies_test.go index 2def505d0c0b..c6a6f5b2409a 100644 --- a/crypto/ecies/ecies_test.go +++ b/crypto/ecies/ecies_test.go @@ -39,7 +39,7 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/crypto" ) // Ensure the KDF generates appropriately sized keys. diff --git a/crypto/ecies/params.go b/crypto/ecies/params.go index 6312daf5a1c1..3f7488b90ee4 100644 --- a/crypto/ecies/params.go +++ b/crypto/ecies/params.go @@ -42,7 +42,7 @@ import ( "fmt" "hash" - ethcrypto "github.com/ethereum/go-ethereum/crypto" + ethcrypto "github.com/ethersocial/go-ethersocial/crypto" ) var ( diff --git a/crypto/signature_cgo.go b/crypto/signature_cgo.go index 1fe84509e76f..3a0b5d651b12 100644 --- a/crypto/signature_cgo.go +++ b/crypto/signature_cgo.go @@ -23,8 +23,8 @@ import ( "crypto/elliptic" "fmt" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto/secp256k1" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/crypto/secp256k1" ) // Ecrecover returns the uncompressed public key that created the given signature. diff --git a/crypto/signature_test.go b/crypto/signature_test.go index aecff76bfbda..f439401b2bdc 100644 --- a/crypto/signature_test.go +++ b/crypto/signature_test.go @@ -22,9 +22,9 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/math" ) var ( diff --git a/dashboard/cpu.go b/dashboard/cpu.go index c89879028d5e..9e72cb44a368 100644 --- a/dashboard/cpu.go +++ b/dashboard/cpu.go @@ -21,7 +21,7 @@ package dashboard import ( "syscall" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // getProcessCPUTime retrieves the process' CPU time since program startup. diff --git a/dashboard/dashboard.go b/dashboard/dashboard.go index b576293bc92b..5098d35c1592 100644 --- a/dashboard/dashboard.go +++ b/dashboard/dashboard.go @@ -35,10 +35,10 @@ import ( "io" - "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/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rpc" "github.com/mohae/deepcopy" "golang.org/x/net/websocket" ) diff --git a/dashboard/log.go b/dashboard/log.go index be7732695c39..d582c95056ad 100644 --- a/dashboard/log.go +++ b/dashboard/log.go @@ -26,7 +26,7 @@ import ( "sort" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" "github.com/mohae/deepcopy" "github.com/rjeczalik/notify" ) diff --git a/dashboard/peers.go b/dashboard/peers.go index 334302cc120e..1533e31b6cc2 100644 --- a/dashboard/peers.go +++ b/dashboard/peers.go @@ -21,10 +21,10 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/metrics" + "github.com/ethersocial/go-ethersocial/metrics" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p" ) const ( diff --git a/dashboard/system.go b/dashboard/system.go index 5b90a17ef849..d113a8a9f713 100644 --- a/dashboard/system.go +++ b/dashboard/system.go @@ -21,8 +21,8 @@ import ( "time" "github.com/elastic/gosigar" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/p2p" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/p2p" ) // meterCollector returns a function, which retrieves the count of a specific meter. diff --git a/eth/api.go b/eth/api.go index f8c51c09bd68..ef8398e2cf34 100644 --- a/eth/api.go +++ b/eth/api.go @@ -28,16 +28,16 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/internal/ethapi" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethersocial/go-ethersocial/trie" ) // PublicEthereumAPI provides an API to access Ethereum full node-related diff --git a/eth/api_backend.go b/eth/api_backend.go index 4b74ccff519d..1c1b8116ea59 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -21,21 +21,21 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/gasprice" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/bloombits" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/eth/gasprice" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rpc" ) // EthAPIBackend implements ethapi.Backend for full nodes diff --git a/eth/api_test.go b/eth/api_test.go index 1e7c489c3295..b035f7367d40 100644 --- a/eth/api_test.go +++ b/eth/api_test.go @@ -25,10 +25,10 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/crypto" ) var dumper = spew.ConfigState{Indent: " "} diff --git a/eth/api_tracer.go b/eth/api_tracer.go index ce211cbd99ef..dbbf96937ce8 100644 --- a/eth/api_tracer.go +++ b/eth/api_tracer.go @@ -28,19 +28,19 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/tracers" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/eth/tracers" + "github.com/ethersocial/go-ethersocial/internal/ethapi" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/rpc" + "github.com/ethersocial/go-ethersocial/trie" ) const ( diff --git a/eth/backend.go b/eth/backend.go index 83e05e96a88e..216558b64bd1 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -25,32 +25,32 @@ import ( "sync" "sync/atomic" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/clique" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/filters" - "github.com/ethereum/go-ethereum/eth/gasprice" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/miner" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/consensus/clique" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/bloombits" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/eth/filters" + "github.com/ethersocial/go-ethersocial/eth/gasprice" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/internal/ethapi" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/miner" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/rpc" ) type LesServer interface { diff --git a/eth/bloombits.go b/eth/bloombits.go index 9a31997d6002..2342a5de7be4 100644 --- a/eth/bloombits.go +++ b/eth/bloombits.go @@ -20,13 +20,13 @@ import ( "context" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/bitutil" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/bitutil" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/bloombits" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" ) const ( diff --git a/eth/config.go b/eth/config.go index 864990067f7c..896d4e3eec8a 100644 --- a/eth/config.go +++ b/eth/config.go @@ -24,13 +24,13 @@ import ( "runtime" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/gasprice" - "github.com/ethereum/go-ethereum/miner" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/eth/gasprice" + "github.com/ethersocial/go-ethersocial/miner" + "github.com/ethersocial/go-ethersocial/params" ) // DefaultConfig contains default settings for use on the Ethereum main net. diff --git a/eth/downloader/api.go b/eth/downloader/api.go index 57ff3d71afa8..a4733eba3856 100644 --- a/eth/downloader/api.go +++ b/eth/downloader/api.go @@ -20,9 +20,9 @@ import ( "context" "sync" - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/rpc" + ethereum "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/rpc" ) // PublicDownloaderAPI provides an API which gives information about the current synchronisation status. diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index edd0eb4d9538..f630b42ced49 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -25,16 +25,16 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/trie" ) var ( diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go index b23043b1c003..bf2205532c67 100644 --- a/eth/downloader/downloader_test.go +++ b/eth/downloader/downloader_test.go @@ -26,13 +26,13 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/trie" ) // Reduce some of the parameters to make the tester faster. diff --git a/eth/downloader/events.go b/eth/downloader/events.go index 25255a3a72e5..b04057f177da 100644 --- a/eth/downloader/events.go +++ b/eth/downloader/events.go @@ -16,7 +16,7 @@ package downloader -import "github.com/ethereum/go-ethereum/core/types" +import "github.com/ethersocial/go-ethersocial/core/types" type DoneEvent struct { Latest *types.Header diff --git a/eth/downloader/fakepeer.go b/eth/downloader/fakepeer.go index 3ec90bc9ef08..23c359731f49 100644 --- a/eth/downloader/fakepeer.go +++ b/eth/downloader/fakepeer.go @@ -19,11 +19,11 @@ package downloader import ( "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" ) // FakePeer is a mock downloader peer that operates on a local database instance diff --git a/eth/downloader/metrics.go b/eth/downloader/metrics.go index d4eb33794628..cfd4556c75e4 100644 --- a/eth/downloader/metrics.go +++ b/eth/downloader/metrics.go @@ -19,7 +19,7 @@ package downloader import ( - "github.com/ethereum/go-ethereum/metrics" + "github.com/ethersocial/go-ethersocial/metrics" ) var ( diff --git a/eth/downloader/peer.go b/eth/downloader/peer.go index 60f86d0e14cf..275c74d264b6 100644 --- a/eth/downloader/peer.go +++ b/eth/downloader/peer.go @@ -29,9 +29,9 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" ) const ( diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index 7c339538110a..a30ef4c24b28 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -25,11 +25,11 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/prque" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/prque" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" ) var ( diff --git a/eth/downloader/statesync.go b/eth/downloader/statesync.go index b422557d58c8..4bd45d2617d7 100644 --- a/eth/downloader/statesync.go +++ b/eth/downloader/statesync.go @@ -22,12 +22,12 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/trie" "golang.org/x/crypto/sha3" ) diff --git a/eth/downloader/testchain_test.go b/eth/downloader/testchain_test.go index f410152f5b00..28aade044cff 100644 --- a/eth/downloader/testchain_test.go +++ b/eth/downloader/testchain_test.go @@ -21,13 +21,13 @@ import ( "math/big" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/params" ) // Test chain parameters. diff --git a/eth/downloader/types.go b/eth/downloader/types.go index ff70bfa0e3cc..c0e6d07a6032 100644 --- a/eth/downloader/types.go +++ b/eth/downloader/types.go @@ -19,7 +19,7 @@ package downloader import ( "fmt" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/core/types" ) // peerDropFn is a callback type for dropping a peer detected as malicious. diff --git a/eth/enr_entry.go b/eth/enr_entry.go index d9e7b95784a2..fec8fd87cd15 100644 --- a/eth/enr_entry.go +++ b/eth/enr_entry.go @@ -17,10 +17,10 @@ package eth import ( - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/forkid" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/forkid" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/rlp" ) // ethEntry is the "eth" ENR entry which advertises eth protocol diff --git a/eth/fetcher/fetcher.go b/eth/fetcher/fetcher.go index 28c532d9bdad..7e3dbb8dde51 100644 --- a/eth/fetcher/fetcher.go +++ b/eth/fetcher/fetcher.go @@ -22,11 +22,11 @@ import ( "math/rand" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/prque" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/prque" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/log" ) const ( diff --git a/eth/fetcher/fetcher_test.go b/eth/fetcher/fetcher_test.go index 83172c5348f4..a7029e9e8f4c 100644 --- a/eth/fetcher/fetcher_test.go +++ b/eth/fetcher/fetcher_test.go @@ -24,13 +24,13 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/params" ) var ( diff --git a/eth/fetcher/metrics.go b/eth/fetcher/metrics.go index d68d12f000f7..02fee0d86c93 100644 --- a/eth/fetcher/metrics.go +++ b/eth/fetcher/metrics.go @@ -19,7 +19,7 @@ package fetcher import ( - "github.com/ethereum/go-ethereum/metrics" + "github.com/ethersocial/go-ethersocial/metrics" ) var ( diff --git a/eth/filters/api.go b/eth/filters/api.go index 5ed80a887563..bf97f43930ac 100644 --- a/eth/filters/api.go +++ b/eth/filters/api.go @@ -25,13 +25,13 @@ import ( "sync" "time" - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/rpc" + ethereum "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/rpc" ) var ( diff --git a/eth/filters/api_test.go b/eth/filters/api_test.go index 02229a7549a7..3b790cee2b1d 100644 --- a/eth/filters/api_test.go +++ b/eth/filters/api_test.go @@ -21,8 +21,8 @@ import ( "fmt" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/rpc" ) func TestUnmarshalJSONNewFilterArgs(t *testing.T) { diff --git a/eth/filters/bench_test.go b/eth/filters/bench_test.go index fc7e6f5273ce..fd43ff53a6c0 100644 --- a/eth/filters/bench_test.go +++ b/eth/filters/bench_test.go @@ -22,14 +22,14 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/bitutil" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/node" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/bitutil" + "github.com/ethersocial/go-ethersocial/core/bloombits" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/node" ) func BenchmarkBloomBits512(b *testing.B) { diff --git a/eth/filters/filter.go b/eth/filters/filter.go index 071613ad7a15..860c77763c11 100644 --- a/eth/filters/filter.go +++ b/eth/filters/filter.go @@ -21,13 +21,13 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/bloombits" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/rpc" ) type Backend interface { diff --git a/eth/filters/filter_system.go b/eth/filters/filter_system.go index 70139c1a96ec..4e7789784011 100644 --- a/eth/filters/filter_system.go +++ b/eth/filters/filter_system.go @@ -25,14 +25,14 @@ import ( "sync" "time" - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rpc" + ethereum "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/rpc" ) // Type determines the kind of filter and is used to put the filter in to diff --git a/eth/filters/filter_system_test.go b/eth/filters/filter_system_test.go index 93cb43123f70..ea3602b382c6 100644 --- a/eth/filters/filter_system_test.go +++ b/eth/filters/filter_system_test.go @@ -25,17 +25,17 @@ import ( "testing" "time" - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + ethereum "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/bloombits" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rpc" ) type testBackend struct { diff --git a/eth/filters/filter_test.go b/eth/filters/filter_test.go index eafa19cdfa22..2610da136cac 100644 --- a/eth/filters/filter_test.go +++ b/eth/filters/filter_test.go @@ -23,14 +23,14 @@ import ( "os" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/params" ) func makeReceipt(addr common.Address) *types.Receipt { diff --git a/eth/gasprice/gasprice.go b/eth/gasprice/gasprice.go index 3b8db78a1cc7..3428d0b38593 100644 --- a/eth/gasprice/gasprice.go +++ b/eth/gasprice/gasprice.go @@ -22,11 +22,11 @@ import ( "sort" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/internal/ethapi" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rpc" ) var maxPrice = big.NewInt(500 * params.GWei) diff --git a/eth/gen_config.go b/eth/gen_config.go index bc4b55b120fa..946e63b67096 100644 --- a/eth/gen_config.go +++ b/eth/gen_config.go @@ -6,13 +6,13 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/gasprice" - "github.com/ethereum/go-ethereum/miner" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/eth/gasprice" + "github.com/ethersocial/go-ethersocial/miner" + "github.com/ethersocial/go-ethersocial/params" ) // MarshalTOML marshals as TOML. diff --git a/eth/handler.go b/eth/handler.go index 4ce2d1c82f94..a36ee26f89e3 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -26,20 +26,20 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/fetcher" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/eth/fetcher" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/trie" ) const ( diff --git a/eth/handler_test.go b/eth/handler_test.go index 0f1672fd4498..50535d2cb3ab 100644 --- a/eth/handler_test.go +++ b/eth/handler_test.go @@ -24,18 +24,18 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/params" ) // Tests that block headers can be retrieved from a remote chain based on user queries. diff --git a/eth/helper_test.go b/eth/helper_test.go index 1482e99c4e10..a7d21db4baea 100644 --- a/eth/helper_test.go +++ b/eth/helper_test.go @@ -27,19 +27,19 @@ import ( "sync" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/params" ) var ( diff --git a/eth/metrics.go b/eth/metrics.go index 0533a2a8757c..ccd195525156 100644 --- a/eth/metrics.go +++ b/eth/metrics.go @@ -17,8 +17,8 @@ package eth import ( - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/p2p" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/p2p" ) var ( diff --git a/eth/peer.go b/eth/peer.go index 814c787b8c2b..43bccaae5b95 100644 --- a/eth/peer.go +++ b/eth/peer.go @@ -24,10 +24,10 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/rlp" ) var ( diff --git a/eth/protocol.go b/eth/protocol.go index de0c979d89b8..6d5bf62d2f41 100644 --- a/eth/protocol.go +++ b/eth/protocol.go @@ -21,11 +21,11 @@ import ( "io" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/rlp" ) // Constants to match up protocol versions and messages diff --git a/eth/protocol_test.go b/eth/protocol_test.go index e817d673a6f0..5098790cb797 100644 --- a/eth/protocol_test.go +++ b/eth/protocol_test.go @@ -22,12 +22,12 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/rlp" ) func init() { diff --git a/eth/sync.go b/eth/sync.go index 9e180ee200f7..15e3b32fccee 100644 --- a/eth/sync.go +++ b/eth/sync.go @@ -21,11 +21,11 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/enode" ) const ( diff --git a/eth/sync_test.go b/eth/sync_test.go index e4c99ff5873f..73c75bcafc67 100644 --- a/eth/sync_test.go +++ b/eth/sync_test.go @@ -21,9 +21,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" ) // Tests that fast sync gets disabled as soon as a real block is successfully diff --git a/eth/tracers/tracer.go b/eth/tracers/tracer.go index c0729fb1d8a0..8af2539df90b 100644 --- a/eth/tracers/tracer.go +++ b/eth/tracers/tracer.go @@ -25,11 +25,11 @@ import ( "time" "unsafe" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" duktape "gopkg.in/olebedev/go-duktape.v3" ) diff --git a/eth/tracers/tracer_test.go b/eth/tracers/tracer_test.go index a45a121159d8..52cfb2fb8e4f 100644 --- a/eth/tracers/tracer_test.go +++ b/eth/tracers/tracer_test.go @@ -24,10 +24,10 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/params" ) type account struct{} diff --git a/eth/tracers/tracers.go b/eth/tracers/tracers.go index 4e1ef23ad2f8..8a2c64635e48 100644 --- a/eth/tracers/tracers.go +++ b/eth/tracers/tracers.go @@ -21,7 +21,7 @@ import ( "strings" "unicode" - "github.com/ethereum/go-ethereum/eth/tracers/internal/tracers" + "github.com/ethersocial/go-ethersocial/eth/tracers/internal/tracers" ) // all contains all the built in JavaScript tracers by name. diff --git a/eth/tracers/tracers_test.go b/eth/tracers/tracers_test.go index 69eb80a5c53a..02ab9220462c 100644 --- a/eth/tracers/tracers_test.go +++ b/eth/tracers/tracers_test.go @@ -27,17 +27,17 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/tests" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/tests" ) // To generate a new callTracer test, copy paste the makeTest method below into diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go index 0a6f73ab5165..f0c92977ce73 100644 --- a/ethclient/ethclient.go +++ b/ethclient/ethclient.go @@ -24,12 +24,12 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/rpc" ) // Client defines typed wrappers for the Ethereum RPC API. diff --git a/ethclient/ethclient_test.go b/ethclient/ethclient_test.go index 3576d4870e66..cd3da8b84459 100644 --- a/ethclient/ethclient_test.go +++ b/ethclient/ethclient_test.go @@ -25,16 +25,16 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/params" ) // Verify that Client implements the ethereum interfaces. diff --git a/ethclient/signer.go b/ethclient/signer.go index 74a93f1e2fd6..a57dccdc0abc 100644 --- a/ethclient/signer.go +++ b/ethclient/signer.go @@ -20,8 +20,8 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" ) // senderFromServer is a types.Signer that remembers the sender address returned by the RPC diff --git a/ethdb/dbtest/testsuite.go b/ethdb/dbtest/testsuite.go index dce2ba2a1f74..5ef431231f58 100644 --- a/ethdb/dbtest/testsuite.go +++ b/ethdb/dbtest/testsuite.go @@ -22,7 +22,7 @@ import ( "sort" "testing" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethersocial/go-ethersocial/ethdb" ) // TestDatabaseSuite runs a suite of tests against a KeyValueStore database diff --git a/ethdb/leveldb/leveldb.go b/ethdb/leveldb/leveldb.go index 378d4c3cd236..51cf1421dfff 100644 --- a/ethdb/leveldb/leveldb.go +++ b/ethdb/leveldb/leveldb.go @@ -26,10 +26,10 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/filter" diff --git a/ethdb/leveldb/leveldb_test.go b/ethdb/leveldb/leveldb_test.go index 421d9b4693f4..58160bd98654 100644 --- a/ethdb/leveldb/leveldb_test.go +++ b/ethdb/leveldb/leveldb_test.go @@ -19,8 +19,8 @@ package leveldb import ( "testing" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethdb/dbtest" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/ethdb/dbtest" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/storage" ) diff --git a/ethdb/memorydb/memorydb.go b/ethdb/memorydb/memorydb.go index 346edc438160..1f51a36636b2 100644 --- a/ethdb/memorydb/memorydb.go +++ b/ethdb/memorydb/memorydb.go @@ -23,8 +23,8 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/ethdb" ) var ( diff --git a/ethdb/memorydb/memorydb_test.go b/ethdb/memorydb/memorydb_test.go index dba18ad3062b..0bb9b863fb0b 100644 --- a/ethdb/memorydb/memorydb_test.go +++ b/ethdb/memorydb/memorydb_test.go @@ -19,8 +19,8 @@ package memorydb import ( "testing" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethdb/dbtest" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/ethdb/dbtest" ) func TestMemoryDB(t *testing.T) { diff --git a/ethstats/ethstats.go b/ethstats/ethstats.go index f9284722cf83..9b537f0e8129 100644 --- a/ethstats/ethstats.go +++ b/ethstats/ethstats.go @@ -30,17 +30,17 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/les" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/les" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/rpc" "github.com/gorilla/websocket" ) diff --git a/event/example_feed_test.go b/event/example_feed_test.go index 9b5ad50df546..539f84589a89 100644 --- a/event/example_feed_test.go +++ b/event/example_feed_test.go @@ -19,7 +19,7 @@ package event_test import ( "fmt" - "github.com/ethereum/go-ethereum/event" + "github.com/ethersocial/go-ethersocial/event" ) func ExampleFeed_acknowledgedEvents() { diff --git a/event/example_scope_test.go b/event/example_scope_test.go index 825a8deeacba..f6206170cfcb 100644 --- a/event/example_scope_test.go +++ b/event/example_scope_test.go @@ -20,7 +20,7 @@ import ( "fmt" "sync" - "github.com/ethereum/go-ethereum/event" + "github.com/ethersocial/go-ethersocial/event" ) // This example demonstrates how SubscriptionScope can be used to control the lifetime of diff --git a/event/example_subscription_test.go b/event/example_subscription_test.go index 5c76b55d98e8..326e65f139b6 100644 --- a/event/example_subscription_test.go +++ b/event/example_subscription_test.go @@ -19,7 +19,7 @@ package event_test import ( "fmt" - "github.com/ethereum/go-ethereum/event" + "github.com/ethersocial/go-ethersocial/event" ) func ExampleNewSubscription() { diff --git a/event/subscription.go b/event/subscription.go index d03f465075bf..56e761cbdaf3 100644 --- a/event/subscription.go +++ b/event/subscription.go @@ -21,7 +21,7 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethersocial/go-ethersocial/common/mclock" ) // Subscription represents a stream of events. The carrier of the events is typically a diff --git a/graphql/graphql.go b/graphql/graphql.go index ddd928dff12c..cf03e460f324 100644 --- a/graphql/graphql.go +++ b/graphql/graphql.go @@ -22,17 +22,17 @@ import ( "errors" "time" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/filters" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/eth/filters" + "github.com/ethersocial/go-ethersocial/internal/ethapi" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/rpc" ) var ( diff --git a/graphql/service.go b/graphql/service.go index f64075680634..03fcdd412eed 100644 --- a/graphql/service.go +++ b/graphql/service.go @@ -21,10 +21,10 @@ import ( "net" "net/http" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/internal/ethapi" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/rpc" "github.com/graph-gophers/graphql-go" "github.com/graph-gophers/graphql-go/relay" ) diff --git a/interfaces.go b/interfaces.go index 1ff31f96b6a6..9c5bf83ef624 100644 --- a/interfaces.go +++ b/interfaces.go @@ -22,8 +22,8 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" ) // NotFound is returned by API methods if the requested item does not exist. diff --git a/internal/debug/api.go b/internal/debug/api.go index 86a4218f6a57..d241eb6c369b 100644 --- a/internal/debug/api.go +++ b/internal/debug/api.go @@ -34,7 +34,7 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // Handler is the global debugging handler. diff --git a/internal/debug/flags.go b/internal/debug/flags.go index 46c8fe9f80de..d3b5995563c7 100644 --- a/internal/debug/flags.go +++ b/internal/debug/flags.go @@ -24,9 +24,9 @@ import ( "os" "runtime" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/metrics/exp" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/metrics/exp" "github.com/fjl/memsize/memsizeui" colorable "github.com/mattn/go-colorable" "github.com/mattn/go-isatty" diff --git a/internal/debug/trace.go b/internal/debug/trace.go index cab5deaafd6c..5994d5f88257 100644 --- a/internal/debug/trace.go +++ b/internal/debug/trace.go @@ -23,7 +23,7 @@ import ( "os" "runtime/trace" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // StartGoTrace turns on tracing, writing to the given file. diff --git a/internal/ethapi/addrlock.go b/internal/ethapi/addrlock.go index 61ddff688ccc..0b7a3f181b4e 100644 --- a/internal/ethapi/addrlock.go +++ b/internal/ethapi/addrlock.go @@ -19,7 +19,7 @@ package ethapi import ( "sync" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) type AddrLocker struct { diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index ea7bb7fc86a9..1c867e228dab 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -26,24 +26,24 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/accounts/scwallet" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus/clique" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/accounts/scwallet" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/consensus/clique" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/rpc" "github.com/tyler-smith/go-bip39" ) diff --git a/internal/ethapi/backend.go b/internal/ethapi/backend.go index 73b6c89ceaaf..1b85770d491e 100644 --- a/internal/ethapi/backend.go +++ b/internal/ethapi/backend.go @@ -21,18 +21,18 @@ import ( "context" "math/big" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/bloombits" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rpc" ) // Backend interface provides the common API services (that are provided by diff --git a/internal/guide/guide_test.go b/internal/guide/guide_test.go index 9c7ad16d182d..684cd7b408a1 100644 --- a/internal/guide/guide_test.go +++ b/internal/guide/guide_test.go @@ -30,8 +30,8 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/core/types" ) // Tests that the account management snippets work correctly. diff --git a/internal/jsre/jsre.go b/internal/jsre/jsre.go index 1b3528a03617..04e8f07a3411 100644 --- a/internal/jsre/jsre.go +++ b/internal/jsre/jsre.go @@ -26,8 +26,8 @@ import ( "math/rand" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/internal/jsre/deps" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/internal/jsre/deps" "github.com/robertkrimen/otto" ) diff --git a/internal/testlog/testlog.go b/internal/testlog/testlog.go index c5a6114d16aa..ba5c05576e7b 100644 --- a/internal/testlog/testlog.go +++ b/internal/testlog/testlog.go @@ -20,7 +20,7 @@ package testlog import ( "testing" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // Logger returns a logger which logs to the unit test log of t. diff --git a/les/api.go b/les/api.go index bbef771f0445..e38a12b50844 100644 --- a/les/api.go +++ b/les/api.go @@ -19,7 +19,7 @@ package les import ( "errors" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/hexutil" ) var ( diff --git a/les/api_backend.go b/les/api_backend.go index e01e1be98bd2..5eac35bca84c 100644 --- a/les/api_backend.go +++ b/les/api_backend.go @@ -21,22 +21,22 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/gasprice" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/bloombits" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/eth/gasprice" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/light" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rpc" ) type LesApiBackend struct { diff --git a/les/api_test.go b/les/api_test.go index 660af8eeecb9..c8b47de4c41c 100644 --- a/les/api_test.go +++ b/les/api_test.go @@ -28,18 +28,18 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/les/flowcontrol" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/les/flowcontrol" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/simulations" + "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" + "github.com/ethersocial/go-ethersocial/rpc" "github.com/mattn/go-colorable" ) diff --git a/les/balance.go b/les/balance.go index a36a997cf3ad..aefdf3c7319d 100644 --- a/les/balance.go +++ b/les/balance.go @@ -20,7 +20,7 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethersocial/go-ethersocial/common/mclock" ) const ( diff --git a/les/benchmark.go b/les/benchmark.go index 42eeef10f3b8..09a2f5520dcf 100644 --- a/les/benchmark.go +++ b/les/benchmark.go @@ -24,17 +24,17 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/les/flowcontrol" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/les/flowcontrol" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" ) // requestBenchmark is an interface for different randomized request generators diff --git a/les/bloombits.go b/les/bloombits.go index a98524ce2e69..c53a9a83c149 100644 --- a/les/bloombits.go +++ b/les/bloombits.go @@ -19,8 +19,8 @@ package les import ( "time" - "github.com/ethereum/go-ethereum/common/bitutil" - "github.com/ethereum/go-ethereum/light" + "github.com/ethersocial/go-ethersocial/common/bitutil" + "github.com/ethersocial/go-ethersocial/light" ) const ( diff --git a/les/checkpointoracle.go b/les/checkpointoracle.go index 5494e3d6d9d5..02510c17313c 100644 --- a/les/checkpointoracle.go +++ b/les/checkpointoracle.go @@ -20,12 +20,12 @@ import ( "encoding/binary" "sync/atomic" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/contracts/checkpointoracle" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/contracts/checkpointoracle" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" ) // checkpointOracle is responsible for offering the latest stable checkpoint diff --git a/les/client.go b/les/client.go index b367681f3768..cd530b701ab0 100644 --- a/les/client.go +++ b/les/client.go @@ -20,29 +20,29 @@ package les import ( "fmt" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/bloombits" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/eth/filters" - "github.com/ethereum/go-ethereum/eth/gasprice" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/bloombits" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/eth/filters" + "github.com/ethersocial/go-ethersocial/eth/gasprice" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/internal/ethapi" + "github.com/ethersocial/go-ethersocial/light" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rpc" ) type LightEthereum struct { diff --git a/les/client_handler.go b/les/client_handler.go index 7fdb1657194c..d754382c5cf2 100644 --- a/les/client_handler.go +++ b/les/client_handler.go @@ -21,14 +21,14 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/light" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/params" ) // clientHandler is responsible for receiving and processing all incoming server diff --git a/les/clientpool.go b/les/clientpool.go index 6773aab551f8..efba2bf6b0e4 100644 --- a/les/clientpool.go +++ b/les/clientpool.go @@ -22,12 +22,12 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/common/prque" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/common/prque" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/rlp" ) const ( diff --git a/les/clientpool_test.go b/les/clientpool_test.go index 225f828ec623..6c18c908f530 100644 --- a/les/clientpool_test.go +++ b/les/clientpool_test.go @@ -22,9 +22,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/p2p/enode" ) func TestClientPoolL10C100Free(t *testing.T) { diff --git a/les/commons.go b/les/commons.go index ad3c5aef3d75..015d9d333c06 100644 --- a/les/commons.go +++ b/les/commons.go @@ -21,17 +21,17 @@ import ( "math/big" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/discv5" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/light" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/discv5" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/params" ) func errResp(code errCode, format string, v ...interface{}) error { diff --git a/les/costtracker.go b/les/costtracker.go index 81da04566007..eaead0d398aa 100644 --- a/les/costtracker.go +++ b/les/costtracker.go @@ -23,12 +23,12 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/les/flowcontrol" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/les/flowcontrol" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" ) const makeCostStats = false // make request cost statistics during operation diff --git a/les/distributor.go b/les/distributor.go index 62abef47dc9a..d246d21686ea 100644 --- a/les/distributor.go +++ b/les/distributor.go @@ -21,7 +21,7 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethersocial/go-ethersocial/common/mclock" ) // requestDistributor implements a mechanism that distributes requests to diff --git a/les/distributor_test.go b/les/distributor_test.go index 00d43e1d6bd3..81ca5ef87a17 100644 --- a/les/distributor_test.go +++ b/les/distributor_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethersocial/go-ethersocial/common/mclock" ) type testDistReq struct { diff --git a/les/enr_entry.go b/les/enr_entry.go index c2a92dd999fa..632b6fad755c 100644 --- a/les/enr_entry.go +++ b/les/enr_entry.go @@ -17,7 +17,7 @@ package les import ( - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/rlp" ) // lesEntry is the "les" ENR entry. This is set for LES servers only. diff --git a/les/fetcher.go b/les/fetcher.go index df76c56d703d..a6771cf636cf 100644 --- a/les/fetcher.go +++ b/les/fetcher.go @@ -21,13 +21,13 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/light" + "github.com/ethersocial/go-ethersocial/log" ) const ( diff --git a/les/flowcontrol/control.go b/les/flowcontrol/control.go index 490013677c63..daf171446f97 100644 --- a/les/flowcontrol/control.go +++ b/les/flowcontrol/control.go @@ -22,8 +22,8 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/log" ) const ( diff --git a/les/flowcontrol/logger.go b/les/flowcontrol/logger.go index 428d7fbf22c9..a89e727ea055 100644 --- a/les/flowcontrol/logger.go +++ b/les/flowcontrol/logger.go @@ -20,7 +20,7 @@ import ( "fmt" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethersocial/go-ethersocial/common/mclock" ) // logger collects events in string format and discards events older than the diff --git a/les/flowcontrol/manager.go b/les/flowcontrol/manager.go index d6d0b1adde5a..0a6ba1d09f04 100644 --- a/les/flowcontrol/manager.go +++ b/les/flowcontrol/manager.go @@ -22,8 +22,8 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/common/prque" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/common/prque" ) // cmNodeFields are ClientNode fields used by the client manager diff --git a/les/flowcontrol/manager_test.go b/les/flowcontrol/manager_test.go index 9d2f88763614..1447d3c5a896 100644 --- a/les/flowcontrol/manager_test.go +++ b/les/flowcontrol/manager_test.go @@ -21,7 +21,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethersocial/go-ethersocial/common/mclock" ) type testNode struct { diff --git a/les/handler_test.go b/les/handler_test.go index aad8d18e45c0..361e32d7bfc5 100644 --- a/les/handler_test.go +++ b/les/handler_test.go @@ -23,19 +23,19 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/light" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/trie" ) func expectResponse(r p2p.MsgReader, msgcode, reqID, bv uint64, data interface{}) error { diff --git a/les/metrics.go b/les/metrics.go index 9ef8c365180c..c28cccd31d1a 100644 --- a/les/metrics.go +++ b/les/metrics.go @@ -17,8 +17,8 @@ package les import ( - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/p2p" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/p2p" ) var ( diff --git a/les/odr.go b/les/odr.go index 136ecf4df4c6..ecb9042e130e 100644 --- a/les/odr.go +++ b/les/odr.go @@ -20,11 +20,11 @@ import ( "context" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/light" + "github.com/ethersocial/go-ethersocial/log" ) // LesOdr implements light.OdrBackend diff --git a/les/odr_requests.go b/les/odr_requests.go index 3c4dd7090fc0..67dde1e6967b 100644 --- a/les/odr_requests.go +++ b/les/odr_requests.go @@ -21,15 +21,15 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/light" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/trie" ) var ( diff --git a/les/odr_test.go b/les/odr_test.go index 97217e94886a..d12bf4a22501 100644 --- a/les/odr_test.go +++ b/les/odr_test.go @@ -23,17 +23,17 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/light" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" ) type odrTestFn func(ctx context.Context, db ethdb.Database, config *params.ChainConfig, bc *core.BlockChain, lc *light.LightChain, bhash common.Hash) []byte diff --git a/les/peer.go b/les/peer.go index ab5b30a6571a..63c724d022d0 100644 --- a/les/peer.go +++ b/les/peer.go @@ -26,17 +26,17 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/les/flowcontrol" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/les/flowcontrol" + "github.com/ethersocial/go-ethersocial/light" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" ) var ( diff --git a/les/peer_test.go b/les/peer_test.go index db74a052c14c..37efdd05691e 100644 --- a/les/peer_test.go +++ b/les/peer_test.go @@ -21,15 +21,15 @@ import ( "net" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/les/flowcontrol" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/les/flowcontrol" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/rlp" ) const protocolVersion = lpv2 diff --git a/les/protocol.go b/les/protocol.go index 5fdf32b74a6a..0b7edae73287 100644 --- a/les/protocol.go +++ b/les/protocol.go @@ -23,10 +23,10 @@ import ( "io" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/rlp" ) // Constants to match up protocol versions and messages diff --git a/les/request_test.go b/les/request_test.go index 69b57ca31705..14076669d738 100644 --- a/les/request_test.go +++ b/les/request_test.go @@ -21,11 +21,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/light" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/light" ) var testBankSecureTrieKey = secAddr(bankAddr) diff --git a/les/retrieve.go b/les/retrieve.go index d17a02e1ae89..8bf2ec99f414 100644 --- a/les/retrieve.go +++ b/les/retrieve.go @@ -24,8 +24,8 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/light" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/light" ) var ( diff --git a/les/server.go b/les/server.go index 7e11833fb664..96b6f416db00 100644 --- a/les/server.go +++ b/les/server.go @@ -20,19 +20,19 @@ import ( "crypto/ecdsa" "time" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/les/flowcontrol" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/discv5" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/les/flowcontrol" + "github.com/ethersocial/go-ethersocial/light" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/discv5" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rpc" ) type LesServer struct { diff --git a/les/server_handler.go b/les/server_handler.go index 16249ef1ba27..ec4e99c59ee5 100644 --- a/les/server_handler.go +++ b/les/server_handler.go @@ -24,19 +24,19 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/light" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/trie" ) const ( diff --git a/les/serverpool.go b/les/serverpool.go index 37621dc63481..b41cd56a153a 100644 --- a/les/serverpool.go +++ b/les/serverpool.go @@ -27,14 +27,14 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/discv5" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/discv5" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/rlp" ) const ( diff --git a/les/servingqueue.go b/les/servingqueue.go index 8842cf9e9d55..360efa458198 100644 --- a/les/servingqueue.go +++ b/les/servingqueue.go @@ -21,8 +21,8 @@ import ( "sync" "sync/atomic" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/common/prque" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/common/prque" ) // servingQueue allows running tasks in a limited number of threads and puts the diff --git a/les/sync.go b/les/sync.go index 1214fefcaf13..6dc7a2be27ce 100644 --- a/les/sync.go +++ b/les/sync.go @@ -21,11 +21,11 @@ import ( "errors" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/light" + "github.com/ethersocial/go-ethersocial/log" ) var errInvalidCheckpoint = errors.New("invalid advertised checkpoint") diff --git a/les/sync_test.go b/les/sync_test.go index b02c3582f09d..020566b6df83 100644 --- a/les/sync_test.go +++ b/les/sync_test.go @@ -22,11 +22,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/light" + "github.com/ethersocial/go-ethersocial/params" ) // Test light syncing which will download all headers from genesis. diff --git a/les/test_helper.go b/les/test_helper.go index 79cf323d62db..c57620518161 100644 --- a/les/test_helper.go +++ b/les/test_helper.go @@ -26,24 +26,24 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/contracts/checkpointoracle/contract" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/les/flowcontrol" - "github.com/ethereum/go-ethereum/light" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind/backends" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/contracts/checkpointoracle/contract" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/les/flowcontrol" + "github.com/ethersocial/go-ethersocial/light" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/params" ) var ( diff --git a/les/txrelay.go b/les/txrelay.go index 49195161b71c..3d24603de2e8 100644 --- a/les/txrelay.go +++ b/les/txrelay.go @@ -20,9 +20,9 @@ import ( "context" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/rlp" ) type ltrInfo struct { diff --git a/les/ulc.go b/les/ulc.go index b97217e79663..117c0b655200 100644 --- a/les/ulc.go +++ b/les/ulc.go @@ -19,8 +19,8 @@ package les import ( "errors" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/enode" ) type ulc struct { diff --git a/les/ulc_test.go b/les/ulc_test.go index 9112bf928c18..bddcc3f53c38 100644 --- a/les/ulc_test.go +++ b/les/ulc_test.go @@ -23,9 +23,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" ) func TestULCAnnounceThresholdLes2(t *testing.T) { testULCAnnounceThreshold(t, 2) } diff --git a/light/lightchain.go b/light/lightchain.go index 02b90138a2d5..3cbe9f6d6eb7 100644 --- a/light/lightchain.go +++ b/light/lightchain.go @@ -26,17 +26,17 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" lru "github.com/hashicorp/golang-lru" ) diff --git a/light/lightchain_test.go b/light/lightchain_test.go index 70d2e70c189d..f825b7608df8 100644 --- a/light/lightchain_test.go +++ b/light/lightchain_test.go @@ -21,13 +21,13 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/params" ) // So we can deterministically seed different blockchains diff --git a/light/nodeset.go b/light/nodeset.go index 3662596785c7..5657f1f94d96 100644 --- a/light/nodeset.go +++ b/light/nodeset.go @@ -20,10 +20,10 @@ import ( "errors" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/rlp" ) // NodeSet stores a set of trie nodes. It implements trie.Database and can also diff --git a/light/odr.go b/light/odr.go index 907712ede74f..033e2edbf8fc 100644 --- a/light/odr.go +++ b/light/odr.go @@ -21,11 +21,11 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" ) // NoOdr is the default context passed to an ODR capable function when the ODR diff --git a/light/odr_test.go b/light/odr_test.go index debd5544c312..a6089472c09d 100644 --- a/light/odr_test.go +++ b/light/odr_test.go @@ -24,19 +24,19 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/trie" ) var ( diff --git a/light/odr_util.go b/light/odr_util.go index 2c820d40c783..0ba20e72e2c2 100644 --- a/light/odr_util.go +++ b/light/odr_util.go @@ -20,12 +20,12 @@ import ( "bytes" "context" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/rlp" ) var sha3Nil = crypto.Keccak256Hash(nil) diff --git a/light/postprocess.go b/light/postprocess.go index 083dcfceb202..b14d9203d1ce 100644 --- a/light/postprocess.go +++ b/light/postprocess.go @@ -24,16 +24,16 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/bitutil" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/bitutil" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/trie" ) // IndexerConfig includes a set of configs for chain indexers. diff --git a/light/trie.go b/light/trie.go index e512bf6f9562..f4b0f7ab3c17 100644 --- a/light/trie.go +++ b/light/trie.go @@ -21,12 +21,12 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/trie" ) func NewState(ctx context.Context, head *types.Header, odr OdrBackend) *state.StateDB { diff --git a/light/trie_test.go b/light/trie_test.go index 4919f89641eb..93b88c761cb4 100644 --- a/light/trie_test.go +++ b/light/trie_test.go @@ -23,13 +23,13 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/trie" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/trie" ) func TestNodeIterator(t *testing.T) { diff --git a/light/txpool.go b/light/txpool.go index 11a0e76ae01e..6a7138bc56e9 100644 --- a/light/txpool.go +++ b/light/txpool.go @@ -23,16 +23,16 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" ) const ( diff --git a/light/txpool_test.go b/light/txpool_test.go index 0996bd7c9cc0..354328a8b8aa 100644 --- a/light/txpool_test.go +++ b/light/txpool_test.go @@ -23,13 +23,13 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/params" ) type testTxRelay struct { diff --git a/metrics/cpu_syscall.go b/metrics/cpu_syscall.go index e245453e824f..bfa94135037a 100644 --- a/metrics/cpu_syscall.go +++ b/metrics/cpu_syscall.go @@ -21,7 +21,7 @@ package metrics import ( "syscall" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // getProcessCPUTime retrieves the process' CPU time since program startup. diff --git a/metrics/exp/exp.go b/metrics/exp/exp.go index 55820f1aab2f..a8640d382015 100644 --- a/metrics/exp/exp.go +++ b/metrics/exp/exp.go @@ -8,8 +8,8 @@ import ( "net/http" "sync" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/metrics/prometheus" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/metrics/prometheus" ) type exp struct { diff --git a/metrics/influxdb/influxdb.go b/metrics/influxdb/influxdb.go index 6619915fdba3..14b1105b53d4 100644 --- a/metrics/influxdb/influxdb.go +++ b/metrics/influxdb/influxdb.go @@ -5,8 +5,8 @@ import ( uurl "net/url" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" "github.com/influxdata/influxdb/client" ) diff --git a/metrics/librato/librato.go b/metrics/librato/librato.go index 2138e01ae88b..ba45b92a0c60 100644 --- a/metrics/librato/librato.go +++ b/metrics/librato/librato.go @@ -7,7 +7,7 @@ import ( "regexp" "time" - "github.com/ethereum/go-ethereum/metrics" + "github.com/ethersocial/go-ethersocial/metrics" ) // a regexp for extracting the unit from time.Duration.String diff --git a/metrics/metrics.go b/metrics/metrics.go index 8ab4e28f2c79..3c613fd85dac 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // Enabled is checked by the constructor functions for all of the diff --git a/metrics/prometheus/collector.go b/metrics/prometheus/collector.go index 8350fa2aaf31..2979b579d28e 100644 --- a/metrics/prometheus/collector.go +++ b/metrics/prometheus/collector.go @@ -22,7 +22,7 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/metrics" + "github.com/ethersocial/go-ethersocial/metrics" ) var ( diff --git a/metrics/prometheus/prometheus.go b/metrics/prometheus/prometheus.go index 9ad5ec7e9929..4482fc2b6788 100644 --- a/metrics/prometheus/prometheus.go +++ b/metrics/prometheus/prometheus.go @@ -22,8 +22,8 @@ import ( "net/http" "sort" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" ) // Handler returns an HTTP handler which dump metrics in Prometheus format. diff --git a/miner/miner.go b/miner/miner.go index ab97b0c03855..aac5dfaac2ae 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -23,16 +23,16 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" ) // Backend wraps all methods required for mining. diff --git a/miner/stress_clique.go b/miner/stress_clique.go index 7f5db2e520b0..767a649eac3b 100644 --- a/miner/stress_clique.go +++ b/miner/stress_clique.go @@ -28,19 +28,19 @@ import ( "os" "time" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/fdlimit" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/fdlimit" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/params" ) func main() { diff --git a/miner/stress_ethash.go b/miner/stress_ethash.go index 7d4a7d24f7dd..c3af10659608 100644 --- a/miner/stress_ethash.go +++ b/miner/stress_ethash.go @@ -28,20 +28,20 @@ import ( "path/filepath" "time" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/fdlimit" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/fdlimit" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/params" ) func main() { diff --git a/miner/unconfirmed.go b/miner/unconfirmed.go index 3a176e8bd6f6..d1ae97b47315 100644 --- a/miner/unconfirmed.go +++ b/miner/unconfirmed.go @@ -20,9 +20,9 @@ import ( "container/ring" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/log" ) // chainRetriever is used by the unconfirmed block set to verify whether a previously diff --git a/miner/unconfirmed_test.go b/miner/unconfirmed_test.go index 42e77f3e648c..e511ca01504f 100644 --- a/miner/unconfirmed_test.go +++ b/miner/unconfirmed_test.go @@ -19,8 +19,8 @@ package miner import ( "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" ) // noopChainRetriever is an implementation of headerRetriever that always diff --git a/miner/worker.go b/miner/worker.go index 183499ec308d..ce5839f9873c 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -25,15 +25,15 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/misc" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/consensus/misc" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/params" ) const ( diff --git a/miner/worker_test.go b/miner/worker_test.go index 1604e988dd9f..d0c54439540a 100644 --- a/miner/worker_test.go +++ b/miner/worker_test.go @@ -21,18 +21,18 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/clique" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/consensus/clique" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/params" ) var ( diff --git a/mobile/accounts.go b/mobile/accounts.go index 4d979bffff5d..0270786f48d5 100644 --- a/mobile/accounts.go +++ b/mobile/accounts.go @@ -23,10 +23,10 @@ import ( "errors" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" ) const ( diff --git a/mobile/android_test.go b/mobile/android_test.go index d0ea58a8d19f..34a19f65566d 100644 --- a/mobile/android_test.go +++ b/mobile/android_test.go @@ -25,7 +25,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/internal/build" + "github.com/ethersocial/go-ethersocial/internal/build" ) // androidTestClass is a Java class to do some lightweight tests against the Android diff --git a/mobile/big.go b/mobile/big.go index 86ea93245aab..1a661247ca03 100644 --- a/mobile/big.go +++ b/mobile/big.go @@ -22,7 +22,7 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) // A BigInt represents a signed multi-precision integer. diff --git a/mobile/bind.go b/mobile/bind.go index 90ecdf82c414..c9c696033479 100644 --- a/mobile/bind.go +++ b/mobile/bind.go @@ -23,12 +23,12 @@ import ( "math/big" "strings" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/accounts/abi" + "github.com/ethersocial/go-ethersocial/accounts/abi/bind" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" ) // Signer is an interface defining the callback when a contract requires a diff --git a/mobile/common.go b/mobile/common.go index d7e0457261a0..ab5ad8030402 100644 --- a/mobile/common.go +++ b/mobile/common.go @@ -24,8 +24,8 @@ import ( "fmt" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" ) // Hash represents the 32 byte Keccak256 hash of arbitrary data. diff --git a/mobile/discover.go b/mobile/discover.go index 451265c2a155..dc1d020e16a3 100644 --- a/mobile/discover.go +++ b/mobile/discover.go @@ -22,7 +22,7 @@ package geth import ( "errors" - "github.com/ethereum/go-ethereum/p2p/discv5" + "github.com/ethersocial/go-ethersocial/p2p/discv5" ) // Enode represents a host on the network. diff --git a/mobile/ethclient.go b/mobile/ethclient.go index 662125c4adeb..36c85eca9c18 100644 --- a/mobile/ethclient.go +++ b/mobile/ethclient.go @@ -21,8 +21,8 @@ package geth import ( "math/big" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/ethclient" ) // EthereumClient provides access to the Ethereum APIs. diff --git a/mobile/ethereum.go b/mobile/ethereum.go index 59da85239744..9745cdcb8ab2 100644 --- a/mobile/ethereum.go +++ b/mobile/ethereum.go @@ -21,8 +21,8 @@ package geth import ( "errors" - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" + ethereum "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/common" ) // Subscription represents an event subscription where events are diff --git a/mobile/geth.go b/mobile/geth.go index edcbfdbdbe55..37d0df88a252 100644 --- a/mobile/geth.go +++ b/mobile/geth.go @@ -24,18 +24,18 @@ import ( "fmt" "path/filepath" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/eth" - "github.com/ethereum/go-ethereum/eth/downloader" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/ethstats" - "github.com/ethereum/go-ethereum/internal/debug" - "github.com/ethereum/go-ethereum/les" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/nat" - "github.com/ethereum/go-ethereum/params" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/eth" + "github.com/ethersocial/go-ethersocial/eth/downloader" + "github.com/ethersocial/go-ethersocial/ethclient" + "github.com/ethersocial/go-ethersocial/ethstats" + "github.com/ethersocial/go-ethersocial/internal/debug" + "github.com/ethersocial/go-ethersocial/les" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/nat" + "github.com/ethersocial/go-ethersocial/params" + whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" ) // NodeConfig represents the collection of configuration values to fine tune the Geth diff --git a/mobile/init.go b/mobile/init.go index 2025d85edc92..337686463b43 100644 --- a/mobile/init.go +++ b/mobile/init.go @@ -22,7 +22,7 @@ import ( "os" "runtime" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) func init() { diff --git a/mobile/interface.go b/mobile/interface.go index d5200d5b1b82..4d13b256e02c 100644 --- a/mobile/interface.go +++ b/mobile/interface.go @@ -22,7 +22,7 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) // Interface represents a wrapped version of Go's interface{}, with the capacity diff --git a/mobile/interface_test.go b/mobile/interface_test.go index 4bd1af47aa1d..34b06321e9ad 100644 --- a/mobile/interface_test.go +++ b/mobile/interface_test.go @@ -22,7 +22,7 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) func TestInterfaceGetSet(t *testing.T) { diff --git a/mobile/logger.go b/mobile/logger.go index 7078c4fd2c83..b7bd6048f07b 100644 --- a/mobile/logger.go +++ b/mobile/logger.go @@ -19,7 +19,7 @@ package geth import ( "os" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // SetVerbosity sets the global verbosity level (between 0 and 6 - see logger/verbosity.go). diff --git a/mobile/p2p.go b/mobile/p2p.go index a80d9fff2e15..238494d1de24 100644 --- a/mobile/p2p.go +++ b/mobile/p2p.go @@ -21,7 +21,7 @@ package geth import ( "errors" - "github.com/ethereum/go-ethereum/p2p" + "github.com/ethersocial/go-ethersocial/p2p" ) // NodeInfo represents pi short summary of the information known about the host. diff --git a/mobile/params.go b/mobile/params.go index 45fe870ee3dc..9cd49d80c93d 100644 --- a/mobile/params.go +++ b/mobile/params.go @@ -21,9 +21,9 @@ package geth import ( "encoding/json" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/p2p/discv5" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/p2p/discv5" + "github.com/ethersocial/go-ethersocial/params" ) // MainnetGenesis returns the JSON spec to use for the main Ethereum network. It diff --git a/mobile/primitives.go b/mobile/primitives.go index 7e1ab26ef039..d2c0944019c7 100644 --- a/mobile/primitives.go +++ b/mobile/primitives.go @@ -22,7 +22,7 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) // Strings represents s slice of strs. diff --git a/mobile/shhclient.go b/mobile/shhclient.go index 90a8b83c39f9..17b3ff51b65e 100644 --- a/mobile/shhclient.go +++ b/mobile/shhclient.go @@ -19,8 +19,8 @@ package geth import ( - "github.com/ethereum/go-ethereum/whisper/shhclient" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" + "github.com/ethersocial/go-ethersocial/whisper/shhclient" + whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" ) // WhisperClient provides access to the Ethereum APIs. diff --git a/mobile/types.go b/mobile/types.go index b9c44c25d7a9..b2df92d2c76c 100644 --- a/mobile/types.go +++ b/mobile/types.go @@ -23,10 +23,10 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/rlp" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/rlp" + whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" ) // A Nonce is a 64-bit hash which proves (combined with the mix-hash) that diff --git a/mobile/vm.go b/mobile/vm.go index 72093e3d5b90..d2136a11b889 100644 --- a/mobile/vm.go +++ b/mobile/vm.go @@ -21,7 +21,7 @@ package geth import ( "errors" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/core/types" ) // Log represents a contract log event. These events are generated by the LOG diff --git a/node/api.go b/node/api.go index 66cd1dde3354..adb1c310fd71 100644 --- a/node/api.go +++ b/node/api.go @@ -21,11 +21,11 @@ import ( "fmt" "strings" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/rpc" ) // PrivateAdminAPI is the collection of administrative API methods exposed only diff --git a/node/config.go b/node/config.go index 0b492d3df9be..53321605f631 100644 --- a/node/config.go +++ b/node/config.go @@ -26,17 +26,17 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/external" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/accounts/scwallet" - "github.com/ethereum/go-ethereum/accounts/usbwallet" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/accounts/external" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/accounts/scwallet" + "github.com/ethersocial/go-ethersocial/accounts/usbwallet" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/rpc" ) const ( diff --git a/node/config_test.go b/node/config_test.go index 00c24a239123..7b5cefb11661 100644 --- a/node/config_test.go +++ b/node/config_test.go @@ -24,8 +24,8 @@ import ( "runtime" "testing" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/p2p" ) // Tests that datadirs can be successfully created, be them manually configured diff --git a/node/defaults.go b/node/defaults.go index 6386f79123d6..545145b04332 100644 --- a/node/defaults.go +++ b/node/defaults.go @@ -22,9 +22,9 @@ import ( "path/filepath" "runtime" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/nat" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/nat" + "github.com/ethersocial/go-ethersocial/rpc" ) const ( diff --git a/node/node.go b/node/node.go index c9c27d826239..d2b16ca931e4 100644 --- a/node/node.go +++ b/node/node.go @@ -26,14 +26,14 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/internal/debug" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/internal/debug" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/rpc" "github.com/prometheus/tsdb/fileutil" ) diff --git a/node/node_example_test.go b/node/node_example_test.go index 57b18855f1ed..ffc3b1b46124 100644 --- a/node/node_example_test.go +++ b/node/node_example_test.go @@ -20,9 +20,9 @@ import ( "fmt" "log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/rpc" ) // SampleService is a trivial network service that can be attached to a node for diff --git a/node/node_test.go b/node/node_test.go index c464771cd807..7092a2087685 100644 --- a/node/node_test.go +++ b/node/node_test.go @@ -24,9 +24,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/rpc" ) var ( diff --git a/node/service.go b/node/service.go index 4dea00995c44..b945e44e18fc 100644 --- a/node/service.go +++ b/node/service.go @@ -20,12 +20,12 @@ import ( "path/filepath" "reflect" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/rpc" ) // ServiceContext is a collection of service independent options inherited from diff --git a/node/utils_test.go b/node/utils_test.go index 9801b1ed4565..ec85d0af8895 100644 --- a/node/utils_test.go +++ b/node/utils_test.go @@ -22,8 +22,8 @@ package node import ( "reflect" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/rpc" ) // NoopService is a trivial implementation of the Service interface. diff --git a/p2p/dial.go b/p2p/dial.go index 8dee5063f1d5..84af217510a4 100644 --- a/p2p/dial.go +++ b/p2p/dial.go @@ -22,9 +22,9 @@ import ( "net" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/netutil" ) const ( diff --git a/p2p/dial_test.go b/p2p/dial_test.go index de8fc4a6e3e6..198d5f9e864d 100644 --- a/p2p/dial_test.go +++ b/p2p/dial_test.go @@ -25,11 +25,11 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/internal/testlog" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/ethersocial/go-ethersocial/internal/testlog" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethersocial/go-ethersocial/p2p/netutil" ) func init() { diff --git a/p2p/discover/common.go b/p2p/discover/common.go index 3c080359fdf8..2180d9620d7f 100644 --- a/p2p/discover/common.go +++ b/p2p/discover/common.go @@ -20,9 +20,9 @@ import ( "crypto/ecdsa" "net" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/netutil" ) type UDPConn interface { diff --git a/p2p/discover/node.go b/p2p/discover/node.go index a7d9ce7368c0..1ce16457a3c5 100644 --- a/p2p/discover/node.go +++ b/p2p/discover/node.go @@ -23,9 +23,9 @@ import ( "net" "time" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/p2p/enode" ) // node represents a host on the network. diff --git a/p2p/discover/ntp.go b/p2p/discover/ntp.go index 1bb52399fbc5..2ace062d5c6f 100644 --- a/p2p/discover/ntp.go +++ b/p2p/discover/ntp.go @@ -25,7 +25,7 @@ import ( "sort" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) const ( diff --git a/p2p/discover/table.go b/p2p/discover/table.go index e5a5793e358f..5dce82b8567e 100644 --- a/p2p/discover/table.go +++ b/p2p/discover/table.go @@ -32,10 +32,10 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/netutil" ) const ( diff --git a/p2p/discover/table_test.go b/p2p/discover/table_test.go index 895c284b270b..8ce0ce4c640c 100644 --- a/p2p/discover/table_test.go +++ b/p2p/discover/table_test.go @@ -27,10 +27,10 @@ import ( "testing/quick" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethersocial/go-ethersocial/p2p/netutil" ) func TestTable_pingReplace(t *testing.T) { diff --git a/p2p/discover/table_util_test.go b/p2p/discover/table_util_test.go index 2292055e160d..792c47c7132d 100644 --- a/p2p/discover/table_util_test.go +++ b/p2p/discover/table_util_test.go @@ -25,10 +25,10 @@ import ( "sort" "sync" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enr" ) var nullNode *enode.Node diff --git a/p2p/discover/v4_udp.go b/p2p/discover/v4_udp.go index a8f7101b0594..58b51267c23d 100644 --- a/p2p/discover/v4_udp.go +++ b/p2p/discover/v4_udp.go @@ -28,12 +28,12 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/netutil" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethersocial/go-ethersocial/p2p/netutil" + "github.com/ethersocial/go-ethersocial/rlp" ) // Errors diff --git a/p2p/discover/v4_udp_lookup_test.go b/p2p/discover/v4_udp_lookup_test.go index bc1cdfb089ab..06e37745c170 100644 --- a/p2p/discover/v4_udp_lookup_test.go +++ b/p2p/discover/v4_udp_lookup_test.go @@ -24,8 +24,8 @@ import ( "sort" "testing" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/p2p/enode" ) func TestUDPv4_Lookup(t *testing.T) { diff --git a/p2p/discover/v4_udp_test.go b/p2p/discover/v4_udp_test.go index 2e50906e0b13..df861bb8e223 100644 --- a/p2p/discover/v4_udp_test.go +++ b/p2p/discover/v4_udp_test.go @@ -32,13 +32,13 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/internal/testlog" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/internal/testlog" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethersocial/go-ethersocial/rlp" ) func init() { diff --git a/p2p/discv5/database.go b/p2p/discv5/database.go index 3c2d5744c383..e3524e6c2760 100644 --- a/p2p/discv5/database.go +++ b/p2p/discv5/database.go @@ -28,9 +28,9 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/rlp" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/iterator" diff --git a/p2p/discv5/metrics.go b/p2p/discv5/metrics.go index e68d53c13c63..a64b3491a5d5 100644 --- a/p2p/discv5/metrics.go +++ b/p2p/discv5/metrics.go @@ -16,7 +16,7 @@ package discv5 -import "github.com/ethereum/go-ethereum/metrics" +import "github.com/ethersocial/go-ethersocial/metrics" var ( ingressTrafficMeter = metrics.NewRegisteredMeter("discv5/InboundTraffic", nil) diff --git a/p2p/discv5/net.go b/p2p/discv5/net.go index de7d8de6aa40..130684c2bc88 100644 --- a/p2p/discv5/net.go +++ b/p2p/discv5/net.go @@ -24,12 +24,12 @@ import ( "net" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/netutil" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/netutil" + "github.com/ethersocial/go-ethersocial/rlp" "golang.org/x/crypto/sha3" ) diff --git a/p2p/discv5/net_test.go b/p2p/discv5/net_test.go index 1a8137673d38..ede9cb64dcab 100644 --- a/p2p/discv5/net_test.go +++ b/p2p/discv5/net_test.go @@ -22,8 +22,8 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" ) func TestNetwork_Lookup(t *testing.T) { diff --git a/p2p/discv5/node.go b/p2p/discv5/node.go index 57ecd9a571ad..49a6ecbbb2a3 100644 --- a/p2p/discv5/node.go +++ b/p2p/discv5/node.go @@ -30,8 +30,8 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" ) // Node represents a host on the network. diff --git a/p2p/discv5/node_test.go b/p2p/discv5/node_test.go index 841f9f6279c0..2e3004a56461 100644 --- a/p2p/discv5/node_test.go +++ b/p2p/discv5/node_test.go @@ -27,8 +27,8 @@ import ( "testing/quick" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" ) func ExampleNewNode() { diff --git a/p2p/discv5/ntp.go b/p2p/discv5/ntp.go index 4fb5f657ae0a..a8d923fd068a 100644 --- a/p2p/discv5/ntp.go +++ b/p2p/discv5/ntp.go @@ -26,7 +26,7 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) const ( diff --git a/p2p/discv5/sim_test.go b/p2p/discv5/sim_test.go index fba96023340f..22e0fe1fe25c 100644 --- a/p2p/discv5/sim_test.go +++ b/p2p/discv5/sim_test.go @@ -28,7 +28,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) // In this test, nodes try to randomly resolve each other. diff --git a/p2p/discv5/table.go b/p2p/discv5/table.go index 4f4b2426f411..b9ffad94bedd 100644 --- a/p2p/discv5/table.go +++ b/p2p/discv5/table.go @@ -29,7 +29,7 @@ import ( "net" "sort" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) const ( diff --git a/p2p/discv5/table_test.go b/p2p/discv5/table_test.go index a29943dab9b3..789a57de29a4 100644 --- a/p2p/discv5/table_test.go +++ b/p2p/discv5/table_test.go @@ -27,8 +27,8 @@ import ( "testing/quick" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" ) type nullTransport struct{} diff --git a/p2p/discv5/ticket.go b/p2p/discv5/ticket.go index ae4b18e7cd45..9f1b4c6f9c4c 100644 --- a/p2p/discv5/ticket.go +++ b/p2p/discv5/ticket.go @@ -25,10 +25,10 @@ import ( "sort" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" ) const ( diff --git a/p2p/discv5/topic.go b/p2p/discv5/topic.go index 609a41297f85..de367b311704 100644 --- a/p2p/discv5/topic.go +++ b/p2p/discv5/topic.go @@ -23,8 +23,8 @@ import ( "math/rand" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/log" ) const ( diff --git a/p2p/discv5/topic_test.go b/p2p/discv5/topic_test.go index ba79993f29e9..123aa47c2919 100644 --- a/p2p/discv5/topic_test.go +++ b/p2p/discv5/topic_test.go @@ -21,8 +21,8 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/mclock" ) func TestTopicRadius(t *testing.T) { diff --git a/p2p/discv5/udp.go b/p2p/discv5/udp.go index ff5ed983bab0..f697129c3d90 100644 --- a/p2p/discv5/udp.go +++ b/p2p/discv5/udp.go @@ -24,12 +24,12 @@ import ( "net" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/nat" - "github.com/ethereum/go-ethereum/p2p/netutil" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/nat" + "github.com/ethersocial/go-ethersocial/p2p/netutil" + "github.com/ethersocial/go-ethersocial/rlp" ) const Version = 4 diff --git a/p2p/discv5/udp_test.go b/p2p/discv5/udp_test.go index c628485bf97a..6607d79ae9aa 100644 --- a/p2p/discv5/udp_test.go +++ b/p2p/discv5/udp_test.go @@ -26,9 +26,9 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/rlp" ) func init() { diff --git a/p2p/dnsdisc/client.go b/p2p/dnsdisc/client.go index d4ed08ecb7b2..e003caf7181c 100644 --- a/p2p/dnsdisc/client.go +++ b/p2p/dnsdisc/client.go @@ -25,11 +25,11 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enr" lru "github.com/hashicorp/golang-lru" ) diff --git a/p2p/dnsdisc/client_test.go b/p2p/dnsdisc/client_test.go index 7e3a0f4826a5..4ce8ca5eeeea 100644 --- a/p2p/dnsdisc/client_test.go +++ b/p2p/dnsdisc/client_test.go @@ -25,12 +25,12 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/internal/testlog" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/internal/testlog" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enr" ) const ( diff --git a/p2p/dnsdisc/sync.go b/p2p/dnsdisc/sync.go index bd5c8d023f15..fb812a3b843e 100644 --- a/p2p/dnsdisc/sync.go +++ b/p2p/dnsdisc/sync.go @@ -22,8 +22,8 @@ import ( "math/rand" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/p2p/enode" ) // clientTree is a full tree being synced. diff --git a/p2p/dnsdisc/tree.go b/p2p/dnsdisc/tree.go index 855d4968c518..2e2ae26a89e7 100644 --- a/p2p/dnsdisc/tree.go +++ b/p2p/dnsdisc/tree.go @@ -26,10 +26,10 @@ import ( "sort" "strings" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethersocial/go-ethersocial/rlp" "golang.org/x/crypto/sha3" ) diff --git a/p2p/dnsdisc/tree_test.go b/p2p/dnsdisc/tree_test.go index e2fe962452e0..72a73f92b21a 100644 --- a/p2p/dnsdisc/tree_test.go +++ b/p2p/dnsdisc/tree_test.go @@ -21,8 +21,8 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/p2p/enode" ) func TestParseRoot(t *testing.T) { diff --git a/p2p/enode/idscheme.go b/p2p/enode/idscheme.go index c1834f06995c..885b19683e5b 100644 --- a/p2p/enode/idscheme.go +++ b/p2p/enode/idscheme.go @@ -21,10 +21,10 @@ import ( "fmt" "io" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethersocial/go-ethersocial/rlp" "golang.org/x/crypto/sha3" ) diff --git a/p2p/enode/idscheme_test.go b/p2p/enode/idscheme_test.go index 0910e6e83f61..a13985650f2f 100644 --- a/p2p/enode/idscheme_test.go +++ b/p2p/enode/idscheme_test.go @@ -23,9 +23,9 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethersocial/go-ethersocial/rlp" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/p2p/enode/localnode.go b/p2p/enode/localnode.go index d8aa02a77e26..7c5a1ab6bb47 100644 --- a/p2p/enode/localnode.go +++ b/p2p/enode/localnode.go @@ -26,9 +26,9 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethersocial/go-ethersocial/p2p/netutil" ) const ( diff --git a/p2p/enode/localnode_test.go b/p2p/enode/localnode_test.go index 00746a8d277a..3b5626b404a1 100644 --- a/p2p/enode/localnode_test.go +++ b/p2p/enode/localnode_test.go @@ -21,8 +21,8 @@ import ( "net" "testing" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/p2p/enr" "github.com/stretchr/testify/assert" ) diff --git a/p2p/enode/node.go b/p2p/enode/node.go index 9eb2544ffe14..aac7265abe47 100644 --- a/p2p/enode/node.go +++ b/p2p/enode/node.go @@ -27,8 +27,8 @@ import ( "net" "strings" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethersocial/go-ethersocial/rlp" ) var errMissingPrefix = errors.New("missing 'enr:' prefix for base64-encoded record") diff --git a/p2p/enode/node_test.go b/p2p/enode/node_test.go index d15859c477a5..64bada44ce13 100644 --- a/p2p/enode/node_test.go +++ b/p2p/enode/node_test.go @@ -24,8 +24,8 @@ import ( "testing" "testing/quick" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethersocial/go-ethersocial/rlp" "github.com/stretchr/testify/assert" ) diff --git a/p2p/enode/nodedb.go b/p2p/enode/nodedb.go index 44332640c75d..63f42bc61b45 100644 --- a/p2p/enode/nodedb.go +++ b/p2p/enode/nodedb.go @@ -26,7 +26,7 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/rlp" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/iterator" diff --git a/p2p/enode/urlv4.go b/p2p/enode/urlv4.go index a9a3d1374e51..c13124cd91fb 100644 --- a/p2p/enode/urlv4.go +++ b/p2p/enode/urlv4.go @@ -26,9 +26,9 @@ import ( "regexp" "strconv" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/p2p/enr" ) var incompleteNodeURL = regexp.MustCompile("(?i)^(?:enode://)?([0-9a-f]+)$") diff --git a/p2p/enode/urlv4_test.go b/p2p/enode/urlv4_test.go index 41a88eec61fb..aff57e84b13b 100644 --- a/p2p/enode/urlv4_test.go +++ b/p2p/enode/urlv4_test.go @@ -23,8 +23,8 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/p2p/enr" ) var parseNodeTests = []struct { diff --git a/p2p/enr/enr.go b/p2p/enr/enr.go index c36ae9e3edea..321c5b1f8713 100644 --- a/p2p/enr/enr.go +++ b/p2p/enr/enr.go @@ -40,7 +40,7 @@ import ( "io" "sort" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/rlp" ) const SizeLimit = 300 // maximum encoded size of a node record in bytes diff --git a/p2p/enr/enr_test.go b/p2p/enr/enr_test.go index 5b47eba0472d..0bdc58cbddc7 100644 --- a/p2p/enr/enr_test.go +++ b/p2p/enr/enr_test.go @@ -24,7 +24,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/rlp" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/p2p/enr/entries.go b/p2p/enr/entries.go index f2118401afb8..d58f2af0f451 100644 --- a/p2p/enr/entries.go +++ b/p2p/enr/entries.go @@ -21,7 +21,7 @@ import ( "io" "net" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/rlp" ) // Entry is implemented by known node record entry types. diff --git a/p2p/message.go b/p2p/message.go index 10b55a939c9b..92c8f270a2fb 100644 --- a/p2p/message.go +++ b/p2p/message.go @@ -25,9 +25,9 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/rlp" ) // Msg defines the structure of a p2p message. diff --git a/p2p/metrics.go b/p2p/metrics.go index 8b29efdcdbd6..ee8a542643b8 100644 --- a/p2p/metrics.go +++ b/p2p/metrics.go @@ -25,10 +25,10 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/p2p/enode" ) const ( diff --git a/p2p/nat/nat.go b/p2p/nat/nat.go index 8fad921c48d2..b85c56fdab31 100644 --- a/p2p/nat/nat.go +++ b/p2p/nat/nat.go @@ -25,7 +25,7 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" "github.com/jackpal/go-nat-pmp" ) diff --git a/p2p/netutil/iptrack.go b/p2p/netutil/iptrack.go index b9cbd5e1caa9..a0357cabea01 100644 --- a/p2p/netutil/iptrack.go +++ b/p2p/netutil/iptrack.go @@ -19,7 +19,7 @@ package netutil import ( "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethersocial/go-ethersocial/common/mclock" ) // IPTracker predicts the external endpoint, i.e. IP address and port, of the local host diff --git a/p2p/netutil/iptrack_test.go b/p2p/netutil/iptrack_test.go index a9a2998a6528..560f692368f6 100644 --- a/p2p/netutil/iptrack_test.go +++ b/p2p/netutil/iptrack_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common/mclock" + "github.com/ethersocial/go-ethersocial/common/mclock" ) const ( diff --git a/p2p/peer.go b/p2p/peer.go index 9a9788bc1759..20d5094215d5 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -25,13 +25,13 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethersocial/go-ethersocial/rlp" ) var ( diff --git a/p2p/peer_test.go b/p2p/peer_test.go index 984cc411adb4..15725068ca4e 100644 --- a/p2p/peer_test.go +++ b/p2p/peer_test.go @@ -25,7 +25,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) var discard = Protocol{ diff --git a/p2p/protocol.go b/p2p/protocol.go index 9ce4c20203c7..397b29953e73 100644 --- a/p2p/protocol.go +++ b/p2p/protocol.go @@ -19,8 +19,8 @@ package p2p import ( "fmt" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enr" ) // Protocol represents a P2P subprotocol implementation. diff --git a/p2p/rlpx.go b/p2p/rlpx.go index 115021fa9477..8b272f34ae04 100644 --- a/p2p/rlpx.go +++ b/p2p/rlpx.go @@ -35,11 +35,11 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common/bitutil" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/crypto/ecies" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common/bitutil" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/crypto/ecies" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/rlp" "github.com/golang/snappy" "golang.org/x/crypto/sha3" ) diff --git a/p2p/rlpx_test.go b/p2p/rlpx_test.go index e62196ff049e..0dd8c0b184d2 100644 --- a/p2p/rlpx_test.go +++ b/p2p/rlpx_test.go @@ -32,10 +32,10 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/crypto/ecies" - "github.com/ethereum/go-ethereum/p2p/simulations/pipes" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/crypto/ecies" + "github.com/ethersocial/go-ethersocial/p2p/simulations/pipes" + "github.com/ethersocial/go-ethersocial/rlp" "golang.org/x/crypto/sha3" ) diff --git a/p2p/server.go b/p2p/server.go index 692c9eb7d91d..5cb89dd832b4 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -29,17 +29,17 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/mclock" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/discover" - "github.com/ethereum/go-ethereum/p2p/discv5" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/p2p/nat" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/mclock" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/discover" + "github.com/ethersocial/go-ethersocial/p2p/discv5" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethersocial/go-ethersocial/p2p/nat" + "github.com/ethersocial/go-ethersocial/p2p/netutil" ) const ( diff --git a/p2p/server_test.go b/p2p/server_test.go index e8bc627e1d30..77c519e496f4 100644 --- a/p2p/server_test.go +++ b/p2p/server_test.go @@ -26,11 +26,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/internal/testlog" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/internal/testlog" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enr" "golang.org/x/crypto/sha3" ) diff --git a/p2p/simulations/adapters/exec.go b/p2p/simulations/adapters/exec.go index 5eb0a31566c6..3e731e0559a2 100644 --- a/p2p/simulations/adapters/exec.go +++ b/p2p/simulations/adapters/exec.go @@ -36,11 +36,11 @@ import ( "time" "github.com/docker/docker/pkg/reexec" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/rpc" "golang.org/x/net/websocket" ) diff --git a/p2p/simulations/adapters/inproc.go b/p2p/simulations/adapters/inproc.go index c1cf23a175c6..6ab527e63933 100644 --- a/p2p/simulations/adapters/inproc.go +++ b/p2p/simulations/adapters/inproc.go @@ -23,13 +23,13 @@ import ( "net" "sync" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations/pipes" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/simulations/pipes" + "github.com/ethersocial/go-ethersocial/rpc" ) // SimAdapter is a NodeAdapter which creates in-memory simulation nodes and diff --git a/p2p/simulations/adapters/inproc_test.go b/p2p/simulations/adapters/inproc_test.go index bd2c70b05ecc..b1dc22359c12 100644 --- a/p2p/simulations/adapters/inproc_test.go +++ b/p2p/simulations/adapters/inproc_test.go @@ -23,7 +23,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/p2p/simulations/pipes" + "github.com/ethersocial/go-ethersocial/p2p/simulations/pipes" ) func TestTCPPipe(t *testing.T) { diff --git a/p2p/simulations/adapters/types.go b/p2p/simulations/adapters/types.go index f65ce7b6050f..3b1ecf8492aa 100644 --- a/p2p/simulations/adapters/types.go +++ b/p2p/simulations/adapters/types.go @@ -26,13 +26,13 @@ import ( "strconv" "github.com/docker/docker/pkg/reexec" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethersocial/go-ethersocial/rpc" ) // Node represents a node in a simulation network which is created by a diff --git a/p2p/simulations/connect.go b/p2p/simulations/connect.go index ede96b34c133..858e23904422 100644 --- a/p2p/simulations/connect.go +++ b/p2p/simulations/connect.go @@ -20,7 +20,7 @@ import ( "errors" "strings" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enode" ) var ( diff --git a/p2p/simulations/connect_test.go b/p2p/simulations/connect_test.go index 32d18347d83a..069e14ec0c43 100644 --- a/p2p/simulations/connect_test.go +++ b/p2p/simulations/connect_test.go @@ -19,9 +19,9 @@ package simulations import ( "testing" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" ) func newTestNetwork(t *testing.T, nodeCount int) (*Network, []enode.ID) { diff --git a/p2p/simulations/examples/ping-pong.go b/p2p/simulations/examples/ping-pong.go index cde2f3a677e2..ba2908dbcae8 100644 --- a/p2p/simulations/examples/ping-pong.go +++ b/p2p/simulations/examples/ping-pong.go @@ -25,13 +25,13 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/simulations" + "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" + "github.com/ethersocial/go-ethersocial/rpc" ) var adapterType = flag.String("adapter", "sim", `node adapter to use (one of "sim", "exec" or "docker")`) diff --git a/p2p/simulations/http.go b/p2p/simulations/http.go index 1f44cc66753a..1dbb8da6aabb 100644 --- a/p2p/simulations/http.go +++ b/p2p/simulations/http.go @@ -29,11 +29,11 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" + "github.com/ethersocial/go-ethersocial/rpc" "github.com/julienschmidt/httprouter" "golang.org/x/net/websocket" ) diff --git a/p2p/simulations/http_test.go b/p2p/simulations/http_test.go index 84f6ce2a517c..e84e2ddc37c7 100644 --- a/p2p/simulations/http_test.go +++ b/p2p/simulations/http_test.go @@ -29,13 +29,13 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" + "github.com/ethersocial/go-ethersocial/rpc" "github.com/mattn/go-colorable" ) diff --git a/p2p/simulations/mocker.go b/p2p/simulations/mocker.go index 8ce777a0103f..09b6f44b298a 100644 --- a/p2p/simulations/mocker.go +++ b/p2p/simulations/mocker.go @@ -24,9 +24,9 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" ) //a map of mocker names to its function diff --git a/p2p/simulations/mocker_test.go b/p2p/simulations/mocker_test.go index 069040257ed0..6194f61acaea 100644 --- a/p2p/simulations/mocker_test.go +++ b/p2p/simulations/mocker_test.go @@ -27,7 +27,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enode" ) func TestMocker(t *testing.T) { diff --git a/p2p/simulations/network.go b/p2p/simulations/network.go index f03c953e8953..85e2987de68d 100644 --- a/p2p/simulations/network.go +++ b/p2p/simulations/network.go @@ -27,11 +27,11 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/event" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + "github.com/ethersocial/go-ethersocial/event" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" ) var DialBanTimeout = 200 * time.Millisecond diff --git a/p2p/simulations/network_test.go b/p2p/simulations/network_test.go index 01cd1000de47..3166c6637c99 100644 --- a/p2p/simulations/network_test.go +++ b/p2p/simulations/network_test.go @@ -26,10 +26,10 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" ) // Tests that a created snapshot with a minimal service only contains the expected connections diff --git a/p2p/simulations/simulation.go b/p2p/simulations/simulation.go index ae62c42b9c2d..d2e4f37b0087 100644 --- a/p2p/simulations/simulation.go +++ b/p2p/simulations/simulation.go @@ -20,7 +20,7 @@ import ( "context" "time" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enode" ) // Simulation provides a framework for running actions in a simulated network diff --git a/p2p/simulations/test.go b/p2p/simulations/test.go index 687be6d0b8e3..f3bf74f500e9 100644 --- a/p2p/simulations/test.go +++ b/p2p/simulations/test.go @@ -19,10 +19,10 @@ package simulations import ( "testing" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/enr" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/enr" + "github.com/ethersocial/go-ethersocial/rpc" ) // NoopService is the service that does not do anything diff --git a/p2p/testing/peerpool.go b/p2p/testing/peerpool.go index 91b9704c79f4..7d9a09c801ba 100644 --- a/p2p/testing/peerpool.go +++ b/p2p/testing/peerpool.go @@ -20,8 +20,8 @@ import ( "fmt" "sync" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/enode" ) type TestPeer interface { diff --git a/p2p/testing/protocolsession.go b/p2p/testing/protocolsession.go index e3a3915a81e1..b941e265fe0b 100644 --- a/p2p/testing/protocolsession.go +++ b/p2p/testing/protocolsession.go @@ -22,10 +22,10 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" ) var errTimedOut = errors.New("timed out") diff --git a/p2p/testing/protocoltester.go b/p2p/testing/protocoltester.go index b80abcc264f5..164594fccbeb 100644 --- a/p2p/testing/protocoltester.go +++ b/p2p/testing/protocoltester.go @@ -32,14 +32,14 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/node" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/simulations" - "github.com/ethereum/go-ethereum/p2p/simulations/adapters" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/node" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/simulations" + "github.com/ethersocial/go-ethersocial/p2p/simulations/adapters" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/rpc" ) // ProtocolTester is the tester environment used for unit testing protocol diff --git a/params/config.go b/params/config.go index 109f80ce638b..355fbe8fd3a7 100644 --- a/params/config.go +++ b/params/config.go @@ -21,8 +21,8 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" ) // Genesis hashes to enforce below configs on. diff --git a/params/dao.go b/params/dao.go index da3c8dfc992b..3a7fade7429c 100644 --- a/params/dao.go +++ b/params/dao.go @@ -19,7 +19,7 @@ package params import ( "math/big" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) // DAOForkBlockExtra is the block header extra-data field to set for the DAO fork diff --git a/rpc/client.go b/rpc/client.go index 4b65d0042186..4d58f02922e1 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -28,7 +28,7 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) var ( diff --git a/rpc/client_example_test.go b/rpc/client_example_test.go index 3bb8717b8061..510c0878d708 100644 --- a/rpc/client_example_test.go +++ b/rpc/client_example_test.go @@ -22,7 +22,7 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/rpc" ) // In this example, our client wishes to track the latest 'block number' diff --git a/rpc/client_test.go b/rpc/client_test.go index 315bd6d7d14d..3918e77c8a63 100644 --- a/rpc/client_test.go +++ b/rpc/client_test.go @@ -31,7 +31,7 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) func TestClientRequest(t *testing.T) { diff --git a/rpc/endpoints.go b/rpc/endpoints.go index 8ca6d4eb0c6d..0c59a3a5b684 100644 --- a/rpc/endpoints.go +++ b/rpc/endpoints.go @@ -19,7 +19,7 @@ package rpc import ( "net" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // StartHTTPEndpoint starts the HTTP RPC endpoint, configured with cors/vhosts/modules diff --git a/rpc/handler.go b/rpc/handler.go index 8a4e480ee2c7..abb9c7ceed24 100644 --- a/rpc/handler.go +++ b/rpc/handler.go @@ -25,7 +25,7 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // handler handles JSON-RPC messages. There is one handler per connection. Note that diff --git a/rpc/http.go b/rpc/http.go index 2c0cb5edbe60..50d95a7f1741 100644 --- a/rpc/http.go +++ b/rpc/http.go @@ -31,7 +31,7 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" "github.com/rs/cors" ) diff --git a/rpc/ipc.go b/rpc/ipc.go index ad8ce03098f7..c6435db6f083 100644 --- a/rpc/ipc.go +++ b/rpc/ipc.go @@ -20,8 +20,8 @@ import ( "context" "net" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/netutil" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/netutil" ) // ServeListener accepts connections on l, serving JSON-RPC on them. diff --git a/rpc/ipc_unix.go b/rpc/ipc_unix.go index f4690cc0abb9..b2f2d03f68e7 100644 --- a/rpc/ipc_unix.go +++ b/rpc/ipc_unix.go @@ -25,7 +25,7 @@ import ( "os" "path/filepath" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) // ipcListen will create a Unix socket on the given endpoint. diff --git a/rpc/server.go b/rpc/server.go index 5a92847f20e4..12a3d61e59f6 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -22,7 +22,7 @@ import ( "sync/atomic" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) const MetadataApi = "rpc" diff --git a/rpc/service.go b/rpc/service.go index 81e65f810b71..cdead51e8fc9 100644 --- a/rpc/service.go +++ b/rpc/service.go @@ -27,7 +27,7 @@ import ( "unicode" "unicode/utf8" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) var ( diff --git a/rpc/types.go b/rpc/types.go index e6b9f2a300d2..af003a811d6d 100644 --- a/rpc/types.go +++ b/rpc/types.go @@ -23,8 +23,8 @@ import ( "math" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" ) // API describes the set of methods offered over the RPC interface diff --git a/rpc/types_test.go b/rpc/types_test.go index 89b0c9171a14..5bc00932a063 100644 --- a/rpc/types_test.go +++ b/rpc/types_test.go @@ -20,8 +20,8 @@ import ( "encoding/json" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" ) func TestBlockNumberJSONUnmarshal(t *testing.T) { diff --git a/rpc/websocket.go b/rpc/websocket.go index 1632d6af412a..cc4118b4dbf9 100644 --- a/rpc/websocket.go +++ b/rpc/websocket.go @@ -27,7 +27,7 @@ import ( "sync" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" "github.com/gorilla/websocket" ) diff --git a/signer/core/api.go b/signer/core/api.go index 244767acaf1b..097b9e72a8f2 100644 --- a/signer/core/api.go +++ b/signer/core/api.go @@ -25,16 +25,16 @@ import ( "os" "reflect" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/accounts/scwallet" - "github.com/ethereum/go-ethereum/accounts/usbwallet" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/signer/storage" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/accounts/scwallet" + "github.com/ethersocial/go-ethersocial/accounts/usbwallet" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/internal/ethapi" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/signer/storage" ) const ( diff --git a/signer/core/api_test.go b/signer/core/api_test.go index 30948f99bfc5..816f009049c9 100644 --- a/signer/core/api_test.go +++ b/signer/core/api_test.go @@ -27,16 +27,16 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/signer/core" - "github.com/ethereum/go-ethereum/signer/fourbyte" - "github.com/ethereum/go-ethereum/signer/storage" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/internal/ethapi" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/signer/core" + "github.com/ethersocial/go-ethersocial/signer/fourbyte" + "github.com/ethersocial/go-ethersocial/signer/storage" ) //Used for testing diff --git a/signer/core/auditlog.go b/signer/core/auditlog.go index 1092e7a92340..2a800c590a78 100644 --- a/signer/core/auditlog.go +++ b/signer/core/auditlog.go @@ -19,10 +19,10 @@ package core import ( "context" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/internal/ethapi" + "github.com/ethersocial/go-ethersocial/log" ) type AuditLogger struct { diff --git a/signer/core/cliui.go b/signer/core/cliui.go index 1502238bf790..c06d594759f9 100644 --- a/signer/core/cliui.go +++ b/signer/core/cliui.go @@ -24,9 +24,9 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/internal/ethapi" + "github.com/ethersocial/go-ethersocial/log" "golang.org/x/crypto/ssh/terminal" ) diff --git a/signer/core/signed_data.go b/signer/core/signed_data.go index f512be7ceaec..1ed8fcfd9deb 100644 --- a/signer/core/signed_data.go +++ b/signer/core/signed_data.go @@ -30,15 +30,15 @@ import ( "strings" "unicode" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus/clique" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/accounts/abi" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/consensus/clique" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/rlp" ) type SigFormat struct { diff --git a/signer/core/signed_data_test.go b/signer/core/signed_data_test.go index 6b0da4553034..d7e5ba4062b4 100644 --- a/signer/core/signed_data_test.go +++ b/signer/core/signed_data_test.go @@ -25,12 +25,12 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/signer/core" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/signer/core" ) var typesStandard = core.Types{ diff --git a/signer/core/stdioui.go b/signer/core/stdioui.go index 9ffe1398d43d..9aa0f84e94d3 100644 --- a/signer/core/stdioui.go +++ b/signer/core/stdioui.go @@ -20,9 +20,9 @@ import ( "context" "sync" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/internal/ethapi" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/rpc" ) type StdIOUI struct { diff --git a/signer/core/types.go b/signer/core/types.go index f147f06cd1ae..7be48607cda1 100644 --- a/signer/core/types.go +++ b/signer/core/types.go @@ -22,9 +22,9 @@ import ( "math/big" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core/types" ) type ValidationInfo struct { diff --git a/signer/core/uiapi.go b/signer/core/uiapi.go index 7c2d233f89c6..1bd31edeb587 100644 --- a/signer/core/uiapi.go +++ b/signer/core/uiapi.go @@ -24,11 +24,11 @@ import ( "io/ioutil" "math/big" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/accounts/keystore" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/crypto" ) // SignerUIAPI implements methods Clef provides for a UI to query, in the bidirectional communication diff --git a/signer/fourbyte/abi.go b/signer/fourbyte/abi.go index 585eae1cd848..0b654309e5a8 100644 --- a/signer/fourbyte/abi.go +++ b/signer/fourbyte/abi.go @@ -23,8 +23,8 @@ import ( "regexp" "strings" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/accounts/abi" + "github.com/ethersocial/go-ethersocial/common" ) // decodedCallData is an internal type to represent a method call parsed according diff --git a/signer/fourbyte/abi_test.go b/signer/fourbyte/abi_test.go index 314c12735b8c..b64911650965 100644 --- a/signer/fourbyte/abi_test.go +++ b/signer/fourbyte/abi_test.go @@ -22,8 +22,8 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/accounts/abi" + "github.com/ethersocial/go-ethersocial/common" ) func verify(t *testing.T, jsondata, calldata string, exp []interface{}) { diff --git a/signer/fourbyte/fourbyte_test.go b/signer/fourbyte/fourbyte_test.go index cdbd7ef73d5e..56702a1eff88 100644 --- a/signer/fourbyte/fourbyte_test.go +++ b/signer/fourbyte/fourbyte_test.go @@ -22,8 +22,8 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/accounts/abi" + "github.com/ethersocial/go-ethersocial/common" ) // Tests that all the selectors contained in the 4byte database are valid. diff --git a/signer/fourbyte/validation.go b/signer/fourbyte/validation.go index 4d042d240f67..8d87b7cdab28 100644 --- a/signer/fourbyte/validation.go +++ b/signer/fourbyte/validation.go @@ -22,8 +22,8 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/signer/core" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/signer/core" ) // ValidateTransaction does a number of checks on the supplied transaction, and diff --git a/signer/fourbyte/validation_test.go b/signer/fourbyte/validation_test.go index 0e98cd88e4b4..c3f7303d9ccf 100644 --- a/signer/fourbyte/validation_test.go +++ b/signer/fourbyte/validation_test.go @@ -20,9 +20,9 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/signer/core" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/signer/core" ) func mixAddr(a string) (*common.MixedcaseAddress, error) { diff --git a/signer/rules/rules.go b/signer/rules/rules.go index 39538d18b903..5c6b97f988cd 100644 --- a/signer/rules/rules.go +++ b/signer/rules/rules.go @@ -22,11 +22,11 @@ import ( "os" "strings" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/signer/core" - "github.com/ethereum/go-ethereum/signer/rules/deps" - "github.com/ethereum/go-ethereum/signer/storage" + "github.com/ethersocial/go-ethersocial/internal/ethapi" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/signer/core" + "github.com/ethersocial/go-ethersocial/signer/rules/deps" + "github.com/ethersocial/go-ethersocial/signer/storage" "github.com/robertkrimen/otto" ) diff --git a/signer/rules/rules_test.go b/signer/rules/rules_test.go index c030ed47ceb1..a85ea748b774 100644 --- a/signer/rules/rules_test.go +++ b/signer/rules/rules_test.go @@ -22,13 +22,13 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/internal/ethapi" - "github.com/ethereum/go-ethereum/signer/core" - "github.com/ethereum/go-ethereum/signer/storage" + "github.com/ethersocial/go-ethersocial/accounts" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/internal/ethapi" + "github.com/ethersocial/go-ethersocial/signer/core" + "github.com/ethersocial/go-ethersocial/signer/storage" ) const JS = ` diff --git a/signer/storage/aes_gcm_storage.go b/signer/storage/aes_gcm_storage.go index 8c5e147ac6d2..345bf92ef91a 100644 --- a/signer/storage/aes_gcm_storage.go +++ b/signer/storage/aes_gcm_storage.go @@ -25,7 +25,7 @@ import ( "io/ioutil" "os" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/log" ) type storedCredential struct { diff --git a/signer/storage/aes_gcm_storage_test.go b/signer/storage/aes_gcm_storage_test.go index 664ef1299405..62b8dc40ac2a 100644 --- a/signer/storage/aes_gcm_storage_test.go +++ b/signer/storage/aes_gcm_storage_test.go @@ -23,8 +23,8 @@ import ( "io/ioutil" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/log" "github.com/mattn/go-colorable" ) diff --git a/tests/block_test_util.go b/tests/block_test_util.go index 81dd7b1d042a..0318208cf2d7 100644 --- a/tests/block_test_util.go +++ b/tests/block_test_util.go @@ -24,18 +24,18 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/consensus" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" ) // A BlockTest checks handling of entire blocks. diff --git a/tests/difficulty_test.go b/tests/difficulty_test.go index fde9db3ad4d3..58196c948b7a 100644 --- a/tests/difficulty_test.go +++ b/tests/difficulty_test.go @@ -20,8 +20,8 @@ import ( "math/big" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/params" ) var ( diff --git a/tests/difficulty_test_util.go b/tests/difficulty_test_util.go index fe6e90b027f2..899ab822cd4b 100644 --- a/tests/difficulty_test_util.go +++ b/tests/difficulty_test_util.go @@ -20,11 +20,11 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/consensus/ethash" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/consensus/ethash" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/params" ) //go:generate gencodec -type DifficultyTest -field-override difficultyTestMarshaling -out gen_difficultytest.go diff --git a/tests/gen_btheader.go b/tests/gen_btheader.go index f2e086a7b3be..6d8750e8156b 100644 --- a/tests/gen_btheader.go +++ b/tests/gen_btheader.go @@ -6,10 +6,10 @@ import ( "encoding/json" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core/types" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/core/types" ) var _ = (*btHeaderMarshaling)(nil) diff --git a/tests/gen_difficultytest.go b/tests/gen_difficultytest.go index cd15ae31b5d3..9afb123805da 100644 --- a/tests/gen_difficultytest.go +++ b/tests/gen_difficultytest.go @@ -6,8 +6,8 @@ import ( "encoding/json" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" ) var _ = (*difficultyTestMarshaling)(nil) diff --git a/tests/gen_stenv.go b/tests/gen_stenv.go index 1d4baf2fd79c..672422aa3698 100644 --- a/tests/gen_stenv.go +++ b/tests/gen_stenv.go @@ -7,8 +7,8 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/math" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/math" ) var _ = (*stEnvMarshaling)(nil) diff --git a/tests/gen_sttransaction.go b/tests/gen_sttransaction.go index 451ffcbf43a1..09bbc6a1b97b 100644 --- a/tests/gen_sttransaction.go +++ b/tests/gen_sttransaction.go @@ -6,8 +6,8 @@ import ( "encoding/json" "math/big" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/math" ) var _ = (*stTransactionMarshaling)(nil) diff --git a/tests/gen_vmexec.go b/tests/gen_vmexec.go index a5f01cf45695..3eccf389e6b3 100644 --- a/tests/gen_vmexec.go +++ b/tests/gen_vmexec.go @@ -7,9 +7,9 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/math" ) var _ = (*vmExecMarshaling)(nil) diff --git a/tests/init.go b/tests/init.go index a18e12bdd2d0..84b4eafe6e5a 100644 --- a/tests/init.go +++ b/tests/init.go @@ -20,7 +20,7 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/params" ) // Forks table defines supported forks and their chain config. diff --git a/tests/init_test.go b/tests/init_test.go index 622318adb988..56b4471e4025 100644 --- a/tests/init_test.go +++ b/tests/init_test.go @@ -31,7 +31,7 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/params" ) // Command line flags to configure the interpreters. diff --git a/tests/rlp_test_util.go b/tests/rlp_test_util.go index 9069ec55a15d..420b65af262d 100644 --- a/tests/rlp_test_util.go +++ b/tests/rlp_test_util.go @@ -24,7 +24,7 @@ import ( "math/big" "strings" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/rlp" ) // RLPTest is the JSON structure of a single RLP test. diff --git a/tests/state_test.go b/tests/state_test.go index c6a6947bcea3..a0e93a602788 100644 --- a/tests/state_test.go +++ b/tests/state_test.go @@ -23,7 +23,7 @@ import ( "reflect" "testing" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethersocial/go-ethersocial/core/vm" ) func TestState(t *testing.T) { diff --git a/tests/state_test_util.go b/tests/state_test_util.go index 59ebcb6e1ec2..d5353042bc9f 100644 --- a/tests/state_test_util.go +++ b/tests/state_test_util.go @@ -24,18 +24,18 @@ import ( "strconv" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" "golang.org/x/crypto/sha3" ) diff --git a/tests/transaction_test.go b/tests/transaction_test.go index 0e3670d04bf7..88349cf0c9dc 100644 --- a/tests/transaction_test.go +++ b/tests/transaction_test.go @@ -19,7 +19,7 @@ package tests import ( "testing" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/params" ) func TestTransaction(t *testing.T) { diff --git a/tests/transaction_test_util.go b/tests/transaction_test_util.go index 85bf1fb0bd0d..23bec21c6e48 100644 --- a/tests/transaction_test_util.go +++ b/tests/transaction_test_util.go @@ -19,12 +19,12 @@ package tests import ( "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/types" + "github.com/ethersocial/go-ethersocial/params" + "github.com/ethersocial/go-ethersocial/rlp" ) // TransactionTest checks RLP decoding and sender derivation of transactions. diff --git a/tests/vm_test.go b/tests/vm_test.go index 441483dffa4c..2df10991ecdb 100644 --- a/tests/vm_test.go +++ b/tests/vm_test.go @@ -19,7 +19,7 @@ package tests import ( "testing" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethersocial/go-ethersocial/core/vm" ) func TestVM(t *testing.T) { diff --git a/tests/vm_test_util.go b/tests/vm_test_util.go index 91566c47e347..df2b8c93e8aa 100644 --- a/tests/vm_test_util.go +++ b/tests/vm_test_util.go @@ -22,15 +22,15 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/common/math" - "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/rawdb" - "github.com/ethereum/go-ethereum/core/state" - "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/math" + "github.com/ethersocial/go-ethersocial/core" + "github.com/ethersocial/go-ethersocial/core/rawdb" + "github.com/ethersocial/go-ethersocial/core/state" + "github.com/ethersocial/go-ethersocial/core/vm" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/params" ) // VMTest checks EVM execution without block or transaction context. diff --git a/trie/database.go b/trie/database.go index d8a0fa9c5342..c32555cf2505 100644 --- a/trie/database.go +++ b/trie/database.go @@ -26,11 +26,11 @@ import ( "time" "github.com/allegro/bigcache" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" + "github.com/ethersocial/go-ethersocial/rlp" ) var ( diff --git a/trie/database_test.go b/trie/database_test.go index 81c469500f98..c922838667a8 100644 --- a/trie/database_test.go +++ b/trie/database_test.go @@ -19,8 +19,8 @@ package trie import ( "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb/memorydb" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/ethdb/memorydb" ) // Tests that the trie database returns a missing trie node error if attempting diff --git a/trie/errors.go b/trie/errors.go index 567b80078c06..6636732c57aa 100644 --- a/trie/errors.go +++ b/trie/errors.go @@ -19,7 +19,7 @@ package trie import ( "fmt" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" ) // MissingNodeError is returned by the trie functions (TryGet, TryUpdate, TryDelete) diff --git a/trie/hasher.go b/trie/hasher.go index 54f6a9de2b6a..e763d0b6d821 100644 --- a/trie/hasher.go +++ b/trie/hasher.go @@ -20,8 +20,8 @@ import ( "hash" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/rlp" "golang.org/x/crypto/sha3" ) diff --git a/trie/iterator.go b/trie/iterator.go index 8e84dee3b617..540fbb95d590 100644 --- a/trie/iterator.go +++ b/trie/iterator.go @@ -21,8 +21,8 @@ import ( "container/heap" "errors" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/rlp" ) // Iterator is a key-value trie iterator that traverses a Trie. diff --git a/trie/iterator_test.go b/trie/iterator_test.go index 88b8103fb3f2..d6a6244617f8 100644 --- a/trie/iterator_test.go +++ b/trie/iterator_test.go @@ -22,8 +22,8 @@ import ( "math/rand" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb/memorydb" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/ethdb/memorydb" ) func TestIterator(t *testing.T) { diff --git a/trie/node.go b/trie/node.go index f4055e779a1b..19ad96d521cb 100644 --- a/trie/node.go +++ b/trie/node.go @@ -21,8 +21,8 @@ import ( "io" "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/rlp" ) var indices = []string{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "[17]"} diff --git a/trie/proof.go b/trie/proof.go index 9985e730dd37..8a7e668fcd07 100644 --- a/trie/proof.go +++ b/trie/proof.go @@ -20,10 +20,10 @@ import ( "bytes" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/rlp" ) // Prove constructs a merkle proof for key. The result contains all encoded nodes diff --git a/trie/proof_test.go b/trie/proof_test.go index c488f342c872..c44316870938 100644 --- a/trie/proof_test.go +++ b/trie/proof_test.go @@ -23,9 +23,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb/memorydb" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb/memorydb" ) func init() { diff --git a/trie/secure_trie.go b/trie/secure_trie.go index fbc591ed108a..9531babe2178 100644 --- a/trie/secure_trie.go +++ b/trie/secure_trie.go @@ -19,8 +19,8 @@ package trie import ( "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/log" ) // SecureTrie wraps a trie with key hashing. In a secure trie, all diff --git a/trie/secure_trie_test.go b/trie/secure_trie_test.go index fb6c38ee222b..20c5ccf6a87d 100644 --- a/trie/secure_trie_test.go +++ b/trie/secure_trie_test.go @@ -22,9 +22,9 @@ import ( "sync" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb/memorydb" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb/memorydb" ) func newEmptySecure() *SecureTrie { diff --git a/trie/sync.go b/trie/sync.go index 6f40b45a1ebb..ecb11851fc1a 100644 --- a/trie/sync.go +++ b/trie/sync.go @@ -20,9 +20,9 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/prque" - "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/prque" + "github.com/ethersocial/go-ethersocial/ethdb" ) // ErrNotRequested is returned by the trie sync when it's requested to process a diff --git a/trie/sync_bloom.go b/trie/sync_bloom.go index 2182d1c43772..b10a2912d5e3 100644 --- a/trie/sync_bloom.go +++ b/trie/sync_bloom.go @@ -24,10 +24,10 @@ import ( "sync/atomic" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/metrics" "github.com/steakknife/bloomfilter" ) diff --git a/trie/sync_test.go b/trie/sync_test.go index 0621bb43570e..769b0b237a5e 100644 --- a/trie/sync_test.go +++ b/trie/sync_test.go @@ -20,8 +20,8 @@ import ( "bytes" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethdb/memorydb" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/ethdb/memorydb" ) // makeTestTrie create a sample test trie to test node-wise reconstruction. diff --git a/trie/trie.go b/trie/trie.go index 920e331fd62f..b5f870836934 100644 --- a/trie/trie.go +++ b/trie/trie.go @@ -21,9 +21,9 @@ import ( "bytes" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" ) var ( diff --git a/trie/trie_test.go b/trie/trie_test.go index 2a9d53d0ad6b..8225add8b53f 100644 --- a/trie/trie_test.go +++ b/trie/trie_test.go @@ -29,12 +29,12 @@ import ( "testing/quick" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethdb" - "github.com/ethereum/go-ethereum/ethdb/leveldb" - "github.com/ethereum/go-ethereum/ethdb/memorydb" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/ethdb" + "github.com/ethersocial/go-ethersocial/ethdb/leveldb" + "github.com/ethersocial/go-ethersocial/ethdb/memorydb" + "github.com/ethersocial/go-ethersocial/rlp" ) func init() { diff --git a/whisper/mailserver/mailserver.go b/whisper/mailserver/mailserver.go index d7af4baae3f9..6dd478823d83 100644 --- a/whisper/mailserver/mailserver.go +++ b/whisper/mailserver/mailserver.go @@ -21,11 +21,11 @@ import ( "encoding/binary" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/rlp" + whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/opt" "github.com/syndtr/goleveldb/leveldb/util" diff --git a/whisper/mailserver/server_test.go b/whisper/mailserver/server_test.go index 4f80e550aa22..8b2385852c27 100644 --- a/whisper/mailserver/server_test.go +++ b/whisper/mailserver/server_test.go @@ -25,9 +25,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" ) const powRequirement = 0.00001 diff --git a/whisper/shhclient/client.go b/whisper/shhclient/client.go index a814154e4795..41118b66bea0 100644 --- a/whisper/shhclient/client.go +++ b/whisper/shhclient/client.go @@ -19,10 +19,10 @@ package shhclient import ( "context" - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/rpc" - whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" + "github.com/ethersocial/go-ethersocial" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/rpc" + whisper "github.com/ethersocial/go-ethersocial/whisper/whisperv6" ) // Client defines typed wrappers for the Whisper v6 RPC API. diff --git a/whisper/whisperv6/api.go b/whisper/whisperv6/api.go index d6d4c8d3ded6..80b80a11ad4e 100644 --- a/whisper/whisperv6/api.go +++ b/whisper/whisperv6/api.go @@ -24,12 +24,12 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/rpc" ) // List of errors diff --git a/whisper/whisperv6/benchmarks_test.go b/whisper/whisperv6/benchmarks_test.go index 0473179da5a5..02d6e60db586 100644 --- a/whisper/whisperv6/benchmarks_test.go +++ b/whisper/whisperv6/benchmarks_test.go @@ -20,7 +20,7 @@ import ( "crypto/sha256" "testing" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/crypto" "golang.org/x/crypto/pbkdf2" ) diff --git a/whisper/whisperv6/doc.go b/whisper/whisperv6/doc.go index 44c0c3271c7f..bc292923caea 100644 --- a/whisper/whisperv6/doc.go +++ b/whisper/whisperv6/doc.go @@ -35,7 +35,7 @@ package whisperv6 import ( "time" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/crypto" ) // Whisper protocol parameters diff --git a/whisper/whisperv6/envelope.go b/whisper/whisperv6/envelope.go index 5b6925edb3b5..a4c83bdd3bde 100644 --- a/whisper/whisperv6/envelope.go +++ b/whisper/whisperv6/envelope.go @@ -26,10 +26,10 @@ import ( "math/big" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/crypto/ecies" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/crypto/ecies" + "github.com/ethersocial/go-ethersocial/rlp" ) // Envelope represents a clear-text data packet to transmit through the Whisper diff --git a/whisper/whisperv6/envelope_test.go b/whisper/whisperv6/envelope_test.go index c0bb4373b884..3e4fd637f766 100644 --- a/whisper/whisperv6/envelope_test.go +++ b/whisper/whisperv6/envelope_test.go @@ -22,7 +22,7 @@ import ( mrand "math/rand" "testing" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/crypto" ) func TestPoWCalculationsWithNoLeadingZeros(t *testing.T) { diff --git a/whisper/whisperv6/filter.go b/whisper/whisperv6/filter.go index 6a5b79674b5c..aa8c28a873c3 100644 --- a/whisper/whisperv6/filter.go +++ b/whisper/whisperv6/filter.go @@ -21,9 +21,9 @@ import ( "fmt" "sync" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" ) // Filter represents a Whisper message filter diff --git a/whisper/whisperv6/filter_test.go b/whisper/whisperv6/filter_test.go index 5ce99d9f6ce9..b6da48774342 100644 --- a/whisper/whisperv6/filter_test.go +++ b/whisper/whisperv6/filter_test.go @@ -22,8 +22,8 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" ) var seed int64 diff --git a/whisper/whisperv6/gen_criteria_json.go b/whisper/whisperv6/gen_criteria_json.go index 1a428d6df730..29108d0baded 100644 --- a/whisper/whisperv6/gen_criteria_json.go +++ b/whisper/whisperv6/gen_criteria_json.go @@ -5,7 +5,7 @@ package whisperv6 import ( "encoding/json" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/hexutil" ) var _ = (*criteriaOverride)(nil) diff --git a/whisper/whisperv6/gen_message_json.go b/whisper/whisperv6/gen_message_json.go index 6218f5df6ed9..2669353c6717 100644 --- a/whisper/whisperv6/gen_message_json.go +++ b/whisper/whisperv6/gen_message_json.go @@ -5,7 +5,7 @@ package whisperv6 import ( "encoding/json" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/hexutil" ) var _ = (*messageOverride)(nil) diff --git a/whisper/whisperv6/gen_newmessage_json.go b/whisper/whisperv6/gen_newmessage_json.go index 75a1279ae3ac..345d71f7b2ef 100644 --- a/whisper/whisperv6/gen_newmessage_json.go +++ b/whisper/whisperv6/gen_newmessage_json.go @@ -5,7 +5,7 @@ package whisperv6 import ( "encoding/json" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethersocial/go-ethersocial/common/hexutil" ) var _ = (*newMessageOverride)(nil) diff --git a/whisper/whisperv6/message.go b/whisper/whisperv6/message.go index 2d4e86244109..a75d4fac8201 100644 --- a/whisper/whisperv6/message.go +++ b/whisper/whisperv6/message.go @@ -28,10 +28,10 @@ import ( mrand "math/rand" "strconv" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/crypto/ecies" - "github.com/ethereum/go-ethereum/log" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/crypto/ecies" + "github.com/ethersocial/go-ethersocial/log" ) // MessageParams specifies the exact way a message should be wrapped diff --git a/whisper/whisperv6/message_test.go b/whisper/whisperv6/message_test.go index 0a5c1c85333a..8cd5e522c9ba 100644 --- a/whisper/whisperv6/message_test.go +++ b/whisper/whisperv6/message_test.go @@ -23,9 +23,9 @@ import ( mrand "math/rand" "testing" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/rlp" ) func generateMessageParams() (*MessageParams, error) { diff --git a/whisper/whisperv6/peer.go b/whisper/whisperv6/peer.go index 4451f149582b..d045e17aa645 100644 --- a/whisper/whisperv6/peer.go +++ b/whisper/whisperv6/peer.go @@ -23,10 +23,10 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/rlp" ) // Peer represents a whisper protocol peer connection. diff --git a/whisper/whisperv6/peer_test.go b/whisper/whisperv6/peer_test.go index c5b044e1a638..59b80bcc78c8 100644 --- a/whisper/whisperv6/peer_test.go +++ b/whisper/whisperv6/peer_test.go @@ -28,13 +28,13 @@ import ( "net" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/enode" - "github.com/ethereum/go-ethereum/p2p/nat" - "github.com/ethereum/go-ethereum/rlp" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/p2p/enode" + "github.com/ethersocial/go-ethersocial/p2p/nat" + "github.com/ethersocial/go-ethersocial/rlp" ) var keys = []string{ diff --git a/whisper/whisperv6/topic.go b/whisper/whisperv6/topic.go index 4dd8f283c357..b3e5a8116823 100644 --- a/whisper/whisperv6/topic.go +++ b/whisper/whisperv6/topic.go @@ -19,8 +19,8 @@ package whisperv6 import ( - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/common/hexutil" ) // TopicType represents a cryptographically secure, probabilistic partial diff --git a/whisper/whisperv6/whisper.go b/whisper/whisperv6/whisper.go index eb713f84ee5c..5a8668e84444 100644 --- a/whisper/whisperv6/whisper.go +++ b/whisper/whisperv6/whisper.go @@ -27,12 +27,12 @@ import ( "time" mapset "github.com/deckarep/golang-set" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/rlp" - "github.com/ethereum/go-ethereum/rpc" + "github.com/ethersocial/go-ethersocial/common" + "github.com/ethersocial/go-ethersocial/crypto" + "github.com/ethersocial/go-ethersocial/log" + "github.com/ethersocial/go-ethersocial/p2p" + "github.com/ethersocial/go-ethersocial/rlp" + "github.com/ethersocial/go-ethersocial/rpc" "github.com/syndtr/goleveldb/leveldb/errors" "golang.org/x/crypto/pbkdf2" "golang.org/x/sync/syncmap" diff --git a/whisper/whisperv6/whisper_test.go b/whisper/whisperv6/whisper_test.go index 39c2abf041d5..fd9d551ea2b6 100644 --- a/whisper/whisperv6/whisper_test.go +++ b/whisper/whisperv6/whisper_test.go @@ -24,7 +24,7 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" + "github.com/ethersocial/go-ethersocial/common" "golang.org/x/crypto/pbkdf2" )