Commit Graph

433 Commits

Author SHA1 Message Date
Trung Nguyen 3034c75403
fix linting issues (#995) 2020-05-11 16:15:27 -04:00
Sai V c215989c10
Quorum geth upgrade to 1.9.7 (#960)
Co-authored-by: amalraj.manigmail.com <amalraj.manigmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Co-authored-by: Flash Sheridan <flash@pobox.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Nguyen Kien Trung <trung.n.k@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Rob Mulholand <rmulholand@8thlight.com>
Co-authored-by: Felföldi Zsolt <zsfelfoldi@gmail.com>
Co-authored-by: soc1c <soc1c@users.noreply.github.com>
Co-authored-by: Rafael Matias <rafael@skyle.net>
Co-authored-by: gary rong <garyrong0905@gmail.com>
Co-authored-by: Lucas Hendren <lhendre2@gmail.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: ywzqwwt <39263032+ywzqwwt@users.noreply.github.com>
Co-authored-by: zcheng9 <zcheng9@hawk.iit.edu>
Co-authored-by: zzy96 <zhou0250@e.ntu.edu.sg>
Co-authored-by: kikilass <36239971+kikilass@users.noreply.github.com>
Co-authored-by: Darrel Herbst <dherbst@gmail.com>
Co-authored-by: Ross <9055337+Chadsr@users.noreply.github.com>
Co-authored-by: Jeffery Robert Walsh <rlxrlps@gmail.com>
Co-authored-by: Marius Kjærstad <sandakersmann@users.noreply.github.com>
Co-authored-by: Piotr Dyraga <piotr.dyraga@keep.network>
Co-authored-by: Guillaume Ballet <gballet@gmail.com>
Co-authored-by: Michael Forney <mforney@mforney.org>
Co-authored-by: Samuel Marks <807580+SamuelMarks@users.noreply.github.com>
2020-04-29 10:50:56 -04:00
Zhou Zhiyao 29d53fb649
Fix DNS issue in 2.4.0 (#937)
* Fix DNS issue in v2.4.0 as well as code refactoring
2020-02-10 16:04:16 -05:00
Trung Nguyen 151cf6e18c p2p: fix connection leakage when peer is not authorized to connect (#897)
* p2p: fix connection leakage when peer is not authorized to connect
2019-12-03 15:36:31 -05:00
Zhou Zhiyao 0c43425d2f restrict removed raft node in p2p connection (#884) 2019-11-29 10:55:31 -05:00
Peter Fox e3089e30be DNS support for static nodes (#885)
* Update raft to accept a hostname instead of only an IP address
* Add a switch to enable DNS changes in raft to ensure default behavior is backwards-compatible with older versions.
* Allow P2P layer to use the FQDN
2019-11-29 09:42:02 -05:00
Jitendra Bhurat e1e3e4a781 Optimize travis and fix flaky tests (#873) 2019-11-06 12:05:14 -05:00
Trung Nguyen a5c8e7af32
permission: minor fixes and update with master 2019-09-04 14:39:53 -04:00
Nguyen Kien Trung 664c2ab20a p2p/enode, p2p/discv5: fix URL parsing test for go 1.11.13 (#810) 2019-08-27 15:17:59 -04:00
vsmk98 e47629dfcb permission: code change based on review feedback 2019-05-15 17:26:31 +08:00
vsmk98 e5b14b0a71 permission: code clean up. removal of unnecessary code. 2019-05-15 15:59:46 +08:00
amalraj.manigmail.com 3371aa0ac9 integrate permission contracts with geth - network boot from permission config.json and handle update node approved event, account added event 2019-03-26 23:20:06 +08:00
amalraj.manigmail.com a8c050df22 Merge remote-tracking branch 'remotes/quoeng/feature/permissioning-1.8.12' into feature/permissioning-1.8.18
# Conflicts:
#	cmd/bootnode/main.go
#	internal/web3ext/web3ext.go
#	p2p/discover/udp.go
#	p2p/discover/udp_test.go
#	p2p/permissions.go
#	p2p/server.go

poc to pass permission contract via command line
2019-03-08 17:09:24 +08:00
amalraj.manigmail.com d5e4ae7b87 Merge remote-tracking branch 'remotes/quoeng/feature/permissioning-1.8.12' into feature/permissioning-1.8.18
# Conflicts:
#	cmd/bootnode/main.go
#	internal/web3ext/web3ext.go
#	p2p/discover/udp.go
#	p2p/discover/udp_test.go
#	p2p/permissions.go
#	p2p/server.go
2019-03-08 12:53:46 +08:00
amalraj.manigmail.com eb06642fc2 update comments 2019-02-26 16:33:29 +08:00
amalraj.manigmail.com 32729b9f28 remove TODO related to review 2019-02-25 16:30:54 +08:00
amalraj.manigmail.com 6bdd01fc0b raft: change RAFTPORT to RaftPort 2019-02-25 15:01:53 +08:00
vsmk98 564d35f94a changes to error handling and fixing code review comments 2019-02-14 10:24:32 +08:00
vsmk98 05b17e3ab4 removed debug log statements 2019-02-13 09:51:22 +08:00
amalraj.manigmail.com 73667e7942 merge 1.8.18 with quorum/master
refactor raft & istanbul based on upstream changes
fix unit test cases
2019-02-08 17:29:01 +08:00
amalraj.manigmail.com 4dbd95947d Merge branch 'goeth-1.8.18' into geth-upgrade-1.8.18
# Conflicts:
#	.github/CONTRIBUTING.md
#	.travis.yml
#	core/blockchain.go
#	core/vm/evm.go
#	core/vm/logger_test.go
#	eth/handler_test.go
#	eth/tracers/tracer_test.go
#	internal/ethapi/api.go
#	internal/web3ext/web3ext.go
#	p2p/discover/node.go
#	p2p/server.go
#	swarm/network/simulations/discovery/discovery_test.go
2019-01-29 19:08:50 +08:00
amalraj.manigmail.com bc529a509d Merge branch 'goeth-1.8.18' into geth-upgrade-1.8.18
# Conflicts:
#	.github/CONTRIBUTING.md
#	.travis.yml
#	core/blockchain.go
#	core/vm/evm.go
#	core/vm/logger_test.go
#	eth/handler_test.go
#	eth/tracers/tracer_test.go
#	internal/ethapi/api.go
#	internal/web3ext/web3ext.go
#	p2p/discover/node.go
#	p2p/server.go
#	swarm/network/simulations/discovery/discovery_test.go
2019-01-29 19:08:14 +08:00
vsmk98 061c9b85ce merge with master 2019-01-14 13:53:05 +08:00
amalraj.manigmail.com 519337a9d0 Merge remote-tracking branch 'quorum/master' into geth-upgrade-1.8.16 2018-11-29 16:57:27 +08:00
amalraj.manigmail.com 66d46778e6 Merge remote-tracking branch 'quorum/master' into geth-upgrade-1.8.12
# Conflicts:
#	core/tx_pool_test.go
#	miner/worker.go
2018-11-26 15:17:57 +08:00
vsmk98 844fb584d2 changed to update permissioned-nodes.json, added additional check in api.go 2018-11-20 15:43:56 +08:00
lash 201a0bf181 p2p/simulations, swarm/network: Custom services in snapshot (#17991)
* p2p/simulations: Add custom services to simnodes + remove sim down conn objs

* p2p/simulation, swarm/network: Add selective services to discovery sim

* p2p/simulations, swarm/network: Remove useless comments

* p2p/simulations, swarm/network: Clean up mess from rebase

* p2p/simulation: Add sleep to prevent connect flakiness in http test

* p2p/simulations: added concurrent goroutines to prevent sleeps on simulation connect/disconnect

* p2p/simulations, swarm/network/simulations: address pr comments

* reinstated dummy service

* fixed http snapshot test
2018-11-12 14:57:17 +01:00
Kurkó Mihály f574c4e74b metrics, p2p: add ephemeral registry (#18067)
* metrics, p2p: add ephemeral registry

* metrics: fix linter issue
2018-11-09 10:20:51 +01:00
Corey Lin 212bf266c5 eth, p2p: fix comment typos (#18014) 2018-11-08 12:25:14 +01:00
Liang Ma c71e4fc4d5 p2p: fix comment typo (#18027) 2018-11-08 12:22:28 +01:00
Kurkó Mihály 503993c819 p2p: use enode.ID type in metered connection (#17933)
Change the type of the metered connection's id field from string to enode.ID.
2018-11-08 12:11:20 +01:00
Corey Lin 0fe0b8f7b9 p2p/protocols: use keyed fields for struct instantiation (#18017) 2018-11-07 13:22:31 +02:00
vsmk98 e949a737ab additional changes for permissions 2018-11-02 18:42:14 +08:00
vsmk98 10c926ab75 Removed dependency on permissioned-nodes.json. 2018-10-26 05:38:56 +00:00
holisticode 8ed4739176 p2p accounting (#17951)
* p2p/protocols: introduced protocol accounting

* p2p/protocols: added TestExchange simulation

* p2p/protocols: add accounting simulation

* p2p/protocols: remove unnecessary tests

* p2p/protocols: comments for accounting simulation

* p2p/protocols: addressed PR comments

* p2p/protocols: finalized accounting implementation

* p2p/protocols: removed unused code

* p2p/protocols: addressed @nonsense PR comments
2018-10-26 00:26:31 +02:00
Vinod Damle 2f14958559 p2p: remove spurious log for denied node permissioning
connection is only denied after cycling through entire list, remove
confusing and erroneous log in the loop
2018-10-17 11:53:13 -04:00
Kurkó Mihály 16e4d0e005 p2p: meter peer traffic, emit metered peer events (#17695)
This change extends the peer metrics collection:

- traces the life-cycle of the peers
- meters the peer traffic separately for every peer
- creates event feed for the peer events
- emits the peer events
2018-10-16 00:40:51 +02:00
Felix Lange 6f607de5d5
p2p, p2p/discover: add signed ENR generation (#17753)
This PR adds enode.LocalNode and integrates it into the p2p
subsystem. This new object is the keeper of the local node
record. For now, a new version of the record is produced every
time the client restarts. We'll make it smarter to avoid that in
the future.

There are a couple of other changes in this commit: discovery now
waits for all of its goroutines at shutdown and the p2p server
now closes the node database after discovery has shut down. This
fixes a leveldb crash in tests. p2p server startup is faster
because it doesn't need to wait for the external IP query
anymore.
2018-10-12 11:47:24 +02:00
vsmk98 d6352b30c3 Merge of 1812 with permissions changes and fix of conflicts 2018-10-12 04:24:36 +00:00
Felix Lange dcae0d348b
p2p/simulations: fix a deadlock and clean up adapters (#17891)
This fixes a rare deadlock with the inproc adapter:

- A node is stopped, which acquires Network.lock.
- The protocol code being simulated (swarm/network in my case)
  waits for its goroutines to shut down.
- One of those goroutines calls into the simulation to add a peer,
  which waits for Network.lock.

The fix for the deadlock is really simple, just release the lock
before stopping the simulation node.

Other changes in this PR clean up the exec adapter so it reports
node startup errors better and remove the docker adapter because
it just adds overhead.

In the exec adapter, node information is now posted to a one-shot
server. This avoids log parsing and allows reporting startup
errors to the simulation host.

A small change in package node was needed because simulation
nodes use port zero. Node.{HTTP,WS}Endpoint now return the live
endpoints after startup by checking the TCP listener.
2018-10-11 20:32:14 +02:00
amalraj.manigmail.com fcfc7b6d45 merge with quorum upstream master 2018-10-09 16:01:11 +08:00
holisticode 11d0ff6578 Fix retrieval tests and simulation backends (#17723)
* swarm/network/stream: introduced visualized snapshot sync test

* swarm/network/stream: non-existing hash visualization sim

* swarm/network/stream: fixed retrieval tests; new backend for visualization

* swarm/network/stream: cleanup of visualized_snapshot_sync_sim_test.go

* swarm/network/stream: rebased PR on master

* swarm/network/stream: fixed loop logic in retrieval tests

* swarm/network/stream: fixed iterations for snapshot tests

* swarm/network/stream: address PR comments

* swarm/network/stream: addressed PR comments
2018-10-08 20:28:44 +02:00
Felix Lange 1895059119 p2p: add enode URL to PeerInfo (#17838) 2018-10-04 18:13:21 +03:00
amalraj.manigmail.com 47571689ee Merge remote-tracking branch 'remotes/goeth/release/1.8' into geth-upgrade-1.8.15_new
# Conflicts:
#	.travis.yml
#	README.md
#	cmd/utils/flags.go
#	consensus/consensus.go
#	consensus/ethash/consensus.go
#	consensus/ethash/ethash.go
#	core/blockchain.go
#	core/genesis_test.go
#	core/state/state_object.go
#	core/state_processor.go
#	core/vm/errors.go
#	core/vm/evm.go
#	core/vm/gas_table.go
#	core/vm/instructions_test.go
#	core/vm/interface.go
#	eth/api_tracer.go
#	eth/backend.go
#	eth/config.go
#	eth/filters/filter.go
#	les/backend.go
#	les/helper_test.go
#	miner/worker.go
#	params/config.go
#	params/version.go
2018-10-04 16:19:02 +08:00
Poh Zi How 05f6cf9bb2 look up IP if host is FQDN (#544)
Fixes #147
2018-10-02 16:38:20 -04:00
Liang ZOU 6663e5da10 all: fix various comment typos (#17748) 2018-09-25 12:26:35 +02:00
Felix Lange 30cd5c1854
all: new p2p node representation (#17643)
Package p2p/enode provides a generalized representation of p2p nodes
which can contain arbitrary information in key/value pairs. It is also
the new home for the node database. The "v4" identity scheme is also
moved here from p2p/enr to remove the dependency on Ethereum crypto from
that package.

Record signature handling is changed significantly. The identity scheme
registry is removed and acceptable schemes must be passed to any method
that needs identity. This means records must now be validated explicitly
after decoding.

The enode API is designed to make signature handling easy and safe: most
APIs around the codebase work with enode.Node, which is a wrapper around
a valid record. Going from enr.Record to enode.Node requires a valid
signature.

* p2p/discover: port to p2p/enode

This ports the discovery code to the new node representation in
p2p/enode. The wire protocol is unchanged, this can be considered a
refactoring change. The Kademlia table can now deal with nodes using an
arbitrary identity scheme. This requires a few incompatible API changes:

  - Table.Lookup is not available anymore. It used to take a public key
    as argument because v4 protocol requires one. Its replacement is
    LookupRandom.
  - Table.Resolve takes *enode.Node instead of NodeID. This is also for
    v4 protocol compatibility because nodes cannot be looked up by ID
    alone.
  - Types Node and NodeID are gone. Further commits in the series will be
    fixes all over the the codebase to deal with those removals.

* p2p: port to p2p/enode and discovery changes

This adapts package p2p to the changes in p2p/discover. All uses of
discover.Node and discover.NodeID are replaced by their equivalents from
p2p/enode.

New API is added to retrieve the enode.Node instance of a peer. The
behavior of Server.Self with discovery disabled is improved. It now
tries much harder to report a working IP address, falling back to
127.0.0.1 if no suitable address can be determined through other means.
These changes were needed for tests of other packages later in the
series.

* p2p/simulations, p2p/testing: port to p2p/enode

No surprises here, mostly replacements of discover.Node, discover.NodeID
with their new equivalents. The 'interesting' API changes are:

 - testing.ProtocolSession tracks complete nodes, not just their IDs.
 - adapters.NodeConfig has a new method to create a complete node.

These changes were needed to make swarm tests work.

Note that the NodeID change makes the code incompatible with old
simulation snapshots.

* whisper/whisperv5, whisper/whisperv6: port to p2p/enode

This port was easy because whisper uses []byte for node IDs and
URL strings in the API.

* eth: port to p2p/enode

Again, easy to port because eth uses strings for node IDs and doesn't
care about node information in any way.

* les: port to p2p/enode

Apart from replacing discover.NodeID with enode.ID, most changes are in
the server pool code. It now deals with complete nodes instead
of (Pubkey, IP, Port) triples. The database format is unchanged for now,
but we should probably change it to use the node database later.

* node: port to p2p/enode

This change simply replaces discover.Node and discover.NodeID with their
new equivalents.

* swarm/network: port to p2p/enode

Swarm has its own node address representation, BzzAddr, containing both
an overlay address (the hash of a secp256k1 public key) and an underlay
address (enode:// URL).

There are no changes to the BzzAddr format in this commit, but certain
operations such as creating a BzzAddr from a node ID are now impossible
because node IDs aren't public keys anymore.

Most swarm-related changes in the series remove uses of
NewAddrFromNodeID, replacing it with NewAddr which takes a complete node
as argument. ToOverlayAddr is removed because we can just use the node
ID directly.
2018-09-25 00:59:00 +02:00
vsmk98 8d95a0ef8e Blacklisting nodes to disconnect the p2p peer 2018-09-18 05:52:46 +00:00
Emil 86a03f97d3 all: simplify s[:] to s where s is a slice (#17673) 2018-09-14 22:07:13 +02:00
HAOYUatHZ 5c0954afff p2p/discv5: make idx bounds checking more sound (#17571) 2018-09-03 16:47:20 +02:00