aboutsummaryrefslogtreecommitdiffstats
path: root/japanese
diff options
context:
space:
mode:
Diffstat (limited to 'japanese')
-rw-r--r--japanese/emacs-emcws/Makefile2
-rw-r--r--japanese/emacs-emcws/files/patch-src-xfns.c20
2 files changed, 19 insertions, 3 deletions
diff --git a/japanese/emacs-emcws/Makefile b/japanese/emacs-emcws/Makefile
index 8e0e3985ed48..dc2fc769938a 100644
--- a/japanese/emacs-emcws/Makefile
+++ b/japanese/emacs-emcws/Makefile
@@ -30,8 +30,6 @@ LIB_DEPENDS= png15:${PORTSDIR}/graphics/png
USE_EMACS= yes
EMACS_PORT_NAME= emacs21
-BROKEN= does not compile
-
CONFLICTS= emacs-19.* emacs-20.* emacs-22.* \
ja-emcws-20.* \
xemacs-[0-9]* xemacs-devel-[0-9]* \
diff --git a/japanese/emacs-emcws/files/patch-src-xfns.c b/japanese/emacs-emcws/files/patch-src-xfns.c
index 208256a93689..5e31c2f9801f 100644
--- a/japanese/emacs-emcws/files/patch-src-xfns.c
+++ b/japanese/emacs-emcws/files/patch-src-xfns.c
@@ -1,5 +1,14 @@
--- src/xfns.c.orig 2002-12-06 18:05:35.000000000 +0100
-+++ src/xfns.c 2010-03-30 06:35:54.000000000 +0200
++++ src/xfns.c 2012-05-02 19:50:40.000000000 +0200
+@@ -8541,7 +8541,7 @@
+ {
+ xassert (png_ptr != NULL);
+ image_error ("PNG error: %s", build_string (msg), Qnil);
+- longjmp (png_ptr->jmpbuf, 1);
++ longjmp (png_jmpbuf(png_ptr), 1);
+ }
+
+
@@ -8641,7 +8641,7 @@
/* Check PNG signature. */
@@ -18,3 +27,12 @@
{
image_error ("Not a PNG image: `%s'", img->spec, Qnil);
UNGCPRO;
+@@ -8699,7 +8699,7 @@
+
+ /* Set error jump-back. We come back here when the PNG library
+ detects an error. */
+- if (setjmp (png_ptr->jmpbuf))
++ if (setjmp (png_jmpbuf(png_ptr)))
+ {
+ error:
+ if (png_ptr) \ No newline at end of file
he issue permanently. resolves: ethersphere/go-ethereum#1146 * p2p/simulations: fix unmarshal of simulations.Node Making Node.Up field private in 13292ee897e345045fbfab3bda23a77589a271c1 broke TestHTTPNetwork and TestHTTPSnapshot. Because the default UnmarshalJSON does not handle unexported fields. Important: The fix is partial and not proper to my taste. But I cut scope as I think the fix may require a change to the current serialization format. New ticket: https://github.com/ethersphere/go-ethereum/issues/1177 * p2p/simulations: Add a sanity test case for Node.Config UnmarshalJSON * p2p/simulations: revert back to defer Unlock() pattern for Network It's a good patten to call `defer Unlock()` right after `Lock()` so (new) error cases won't miss to unlock. Let's get back to that pattern. The patten was abandoned in 85a79b3ad3c5863f8612d25c246bcfad339f36b7, while fixing a data race. That data race does not exist anymore, since the Node.Up field got hidden behind its own lock. * p2p/simulations: consistent naming for test providers Node.UnmarshalJSON * p2p/simulations: remove JSON annotation from private fields of Node As unexported fields are not serialized. * p2p/simulations: fix deadlock in Network.GetRandomDownNode() Problem: GetRandomDownNode() locks -> getDownNodeIDs() -> GetNodes() tries to lock -> deadlock On Network type, unexported functions must assume that `net.lock` is already acquired and should not call exported functions which might try to lock again. * p2p/simulations: ensure method conformity for Network Connect* methods were moved to p2p/simulations.Network from swarm/network/simulation. However these new methods did not follow the pattern of Network methods, i.e., all exported method locks the whole Network either for read or write. * p2p/simulations: fix deadlock during network shutdown `TestDiscoveryPersistenceSimulationSimAdapter` often got into deadlock. The execution was stuck on two locks, i.e, `Kademlia.lock` and `p2p/simulations.Network.lock`. Usually the test got stuck once in each 20 executions with high confidence. `Kademlia` was stuck in `Kademlia.EachAddr()` and `Network` in `Network.Stop()`. Solution: in `Network.Stop()` `net.lock` must be released before calling `node.Stop()` as stopping a node (somehow - I did not find the exact code path) causes `Network.InitConn()` to be called from `Kademlia.SuggestPeer()` and that blocks on `net.lock`. Related ticket: https://github.com/ethersphere/go-ethereum/issues/1223 * swarm/state: simplify if statement in DBStore.Put() * p2p/simulations: remove faulty godoc from private function The comment started with the wrong method name. The method is simple and self explanatory. Also, it's private. => Let's just remove the comment. (cherry picked from commit 50b872bf05b8644f14b9bea340092ced6968dd59) * swarm: fix network/stream data races (#19051)Janoš Guljaš2019-02-191-1/+1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * swarm/network/stream: newStreamerTester cleanup only if err is nil * swarm/network/stream: raise newStreamerTester waitForPeers timeout * swarm/network/stream: fix data races in GetPeerSubscriptions * swarm/storage: prevent data race on LDBStore.batchesC https://github.com/ethersphere/go-ethereum/issues/1198#issuecomment-461775049 * swarm/network/stream: fix TestGetSubscriptionsRPC data race https://github.com/ethersphere/go-ethereum/issues/1198#issuecomment-461768477 * swarm/network/stream: correctly use Simulation.Run callback https://github.com/ethersphere/go-ethereum/issues/1198#issuecomment-461783804 * swarm/network: protect addrCountC in Kademlia.AddrCountC function https://github.com/ethersphere/go-ethereum/issues/1198#issuecomment-462273444 * p2p/simulations: fix a deadlock calling getRandomNode with lock https://github.com/ethersphere/go-ethereum/issues/1198#issuecomment-462317407 * swarm/network/stream: terminate disconnect goruotines in tests * swarm/network/stream: reduce memory consumption when testing data races * swarm/network/stream: add watchDisconnections helper function * swarm/network/stream: add concurrent counter for tests * swarm/network/stream: rename race/norace test files and use const * swarm/network/stream: remove watchSim and its panic * swarm/network/stream: pass context in watchDisconnections * swarm/network/stream: add concurrent safe bool for watchDisconnections * swarm/storage: fix LDBStore.batchesC data race by not closing it (cherry picked from commit 3fd6db2bf63ce90232de445c7f33943406a5e634) * p2p/testing, swarm: remove unused testing.T in protocol tester (#18500)Elad2019-02-192-8/+7 | | | | (cherry picked from commit 2abeb35d5425d72c2f7fdfe4209f7a94fac52a8e) * swarm: bootnode-mode, new bootnodes and no p2p package discovery (#18498)Anton Evangelatov2019-02-191-0/+14 | | | | (cherry picked from commit bbd120354a8d226b446591eeda9f9462cb9b690a) * p2p/simulations: fix data race on swarm/network/simulations (#18464)Elad2019-02-191-4/+15 | | | | (cherry picked from commit 85a79b3ad3c5863f8612d25c246bcfad339f36b7) * p2p/discover: improve table addition code (#18974)Felix Lange2019-01-314-62/+175 | | | | | | | | | | | | | This change clears up confusion around the two ways in which nodes can be added to the table. When a neighbors packet is received as a reply to findnode, the nodes contained in the reply are added as 'seen' entries if sufficient space is available. When a ping is received and the endpoint verification has taken place, the remote node is added as a 'verified' entry or moved to the front of the bucket if present. This also updates the node's IP address and port if they have changed. * p2p/discover, p2p/enode: rework endpoint proof handling, packet logging (#18963)Felix Lange2019-01-308-332/+595 | | | | | | | | | | | | | | | | This change resolves multiple issues around handling of endpoint proofs. The proof is now done separately for each IP and completing the proof requires a matching ping hash. Also remove waitping because it's equivalent to sleep. waitping was slightly more efficient, but that may cause issues with findnode if packets are reordered and the remote end sees findnode before pong. Logging of received packets was hitherto done after handling the packet, which meant that sent replies were logged before the packet that generated them. This change splits up packet handling into 'preverify' and 'handle'. The error from 'preverify' is logged, but 'handle' happens after the message is logged. This fixes the order. Packet logs now contain the node ID. * p2p/simulations: eliminate concept of pivot (#18426)Ferenc Szabo2019-01-114-106/+27 | * swarm, p2p/protocols: Stream accounting (#18337)holisticode2019-01-081-74/+74 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * swarm: completed 1st phase of swap accounting * swarm, p2p/protocols: added stream pricing * swarm/network/stream: gofmt simplify stream.go * swarm: fixed review comments * swarm: used snapshots for swap tests * swarm: custom retrieve for swap (less cascaded requests at any one time) * swarm: addressed PR comments * swarm: log output formatting * swarm: removed parallelism in swap tests * swarm: swap tests simplification * swarm: removed swap_test.go * swarm/network/stream: added prefix space for comments * swarm/network/stream: unit test for prices * swarm/network/stream: don't hardcode price * swarm/network/stream: fixed invalid price check * A few minor code inspection fixes (#18393)Ferenc Szabo2019-01-066-13/+15 | | | | | | | | | | | | | | | | * swarm/network: fix code inspection problems - typos - redundant import alias * p2p/simulations: fix code inspection problems - typos - unused function parameters - redundant import alias - code style issue: snake case * swarm/network: fix unused method parameters inspections * vendor, crypto, swarm: switch over to upstream sha3 packageDave McGregor2019-01-045-16/+16 | * p2p/protocols: accounting metrics rpc (#18336)Jerzy Lasyk2018-12-221-0/+94 | | | | | | | | | | | | | | | | | | | | | | * p2p/protocols: accounting metrics rpc added (#847) * p2p/protocols: accounting api documentation added (#847) * p2p/protocols: accounting api doc updated (#847) * p2p/protocols: accounting api doc update (#847) * p2p/protocols: accounting api doc update (#847) * p2p/protocols: fix file is not gofmted * fix lint error * updated comments after review * add account balance to rpc * naming changed after review * p2p/simulation: Test snapshot correctness and minimal benchmark (#18287)lash2018-12-211-0/+327 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * p2p/simulation: WIP minimal snapshot test * p2p/simulation: Add snapshot create, load and verify to snapshot test * build: add test tag for tests * p2p/simulations, build: Revert travis change, build test sym always * p2p/simulations: Add comments, timeout check on additional events * p2p/simulation: Add benchmark template for minimal peer protocol init * p2p/simulations: Remove unused code * p2p/simulation: Correct timer reset * p2p/simulations: Put snapshot check events in buffer and call blocking * p2p/simulations: TestSnapshot fail if Load function returns early * p2p/simulations: TestSnapshot wait for all connections before returning * p2p/simulation: Revert to before wait for snap load (5e75594) * p2p/simulations: add "conns after load" subtest to TestSnapshot and nudge * p2p/simulation: move connection methods from swarm/network/simulation (#18323)Elad2018-12-174-12/+571 | * p2p/discv5: don't hash findnode target in lookup against table (#18309)yahtoo2018-12-141-1/+1 | * swarm: snapshot load improvement (#18220)Janoš Guljaš2018-12-071-0/+75 | | | | | | | | | | | | | | | | | | * swarm/network: Hive - do not notify peer if discovery is disabled * p2p/simulations: validate all connections on loading a snapshot * p2p/simulations: track all connections in on snapshot loading * p2p/simulations: add snapshotLoadTimeout variable * p2p/simulations: ignore control events in snapshot load * p2p/simulations: simplify event loop synchronization * p2p/simulations: return already connected error from Load function * p2p/simulations: log warning on snapshot loading disconnection * p2p: use errors.New instead of fmt.Errorf (#18193)needkane2018-12-011-5/+4 | * p2p/discv5: gofmtPéter Szilágyi2018-11-271-1/+1 | * p2p/discv5: minor code simplification (#18188)ANOTHEL2018-11-271-5/+4 | | | | | | | | * Update net.go more simple * Update net.go * p2p/protocols: fix minor comments typo (#18185)Liang Ma2018-11-271-1/+1 | * Accounting metrics reporter (#18136)holisticode2018-11-274-10/+267 | * core: better side-chain importingMartin Holst Swende2018-11-201-1/+1 | * p2p/simulations, swarm/network: Custom services in snapshot (#17991)lash2018-11-122-6/+93 | | | | | | | | | | | | | | | | | | | | * 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 * metrics, p2p: add ephemeral registry (#18067)Kurkó Mihály2018-11-091-2/+2 | | | | | | * metrics, p2p: add ephemeral registry * metrics: fix linter issue * eth, p2p: fix comment typos (#18014)Corey Lin2018-11-081-1/+1 | * p2p: fix comment typo (#18027)Liang Ma2018-11-081-1/+1 | * p2p: use enode.ID type in metered connection (#17933)Kurkó Mihály2018-11-081-6/+5 | | | Change the type of the metered connection's id field from string to enode.ID. * p2p/protocols: use keyed fields for struct instantiation (#18017)Corey Lin2018-11-071-1/+1 | * p2p accounting (#17951)holisticode2018-10-265-0/+937 | | | | | | | | | | | | | | | | | | | | * 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 * p2p: meter peer traffic, emit metered peer events (#17695)Kurkó Mihály2018-10-163-18/+187 | | | | | | | | | 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 * p2p, p2p/discover: add signed ENR generation (#17753)Felix Lange2018-10-1222-266/+966 | | | | | | | | | | | | | | | 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. * p2p/simulations: fix a deadlock and clean up adapters (#17891)Felix Lange2018-10-127-400/+151 | | | | | | | | | | | | | | | | | | | | | | | | 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. * Fix retrieval tests and simulation backends (#17723)holisticode2018-10-091-0/+3 | | | | | | | | | | | | | | | | | | | | * 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 * p2p: add enode URL to PeerInfo (#17838)Felix Lange2018-10-041-3/+5 | * all: fix various comment typos (#17748)Liang ZOU2018-09-252-2/+2 | * all: new p2p node representation (#17643)Felix Lange2018-09-2544-2127/+2388 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. * all: simplify s[:] to s where s is a slice (#17673)Emil2018-09-152-2/+2 | * p2p/discv5: make idx bounds checking more sound (#17571)HAOYUatHZ2018-09-031-1/+1 | * all: remove the duplicate 'the' in annotations (#17509)Wenbiao Zheng2018-08-271-1/+1 | * p2p: fix comment typo (#17491)Mymskmkt2018-08-231-1/+1 | * p2p: fix typo (#17446)Wuxiang2018-08-201-1/+1 | * p2p/discv5: add delay to refresh cycle when no seed nodes are found (#16994)Felföldi Zsolt2018-08-151-1/+1 | * p2p/discv5: fix negative index after uint convert to int (#17274)libotony2018-08-091-1/+1 | * p2p, swarm, trie: avoid copying slices in loops (#17265)Oleg Kovalov2018-08-073-9/+9 | * p2p: use safe atomic operations when changing connFlags (#17325)Felföldi Zsolt2018-08-061-6/+11 | * Merge pull request #16333 from shazow/addremovetrustedpeerFelföldi Zsolt2018-08-063-8/+166 |\ | | | | rpc: Add admin_addTrustedPeer and admin_removeTrustedPeer. | * p2p: Wrap conn.flags ops with atomic.Load/StoreAndrey Petrov2018-06-223-20/+28 | | | * p2p: Test for peer.rw.flags race conditionsAndrey Petrov2018-06-221-11/+18 | | | * p2p: Cache inbound flag on Peer.isInbound to avoid a raceAndrey Petrov2018-06-221-12/+14 | | | * p2p: Attempt to race check peer.Inbound() in TestServerDialAndrey Petrov2018-06-221-0/+3 | | | * p2p: More tests for AddTrustedPeer/RemoveTrustedPeerAndrey Petrov2018-06-221-8/+52 | | | * p2p: Test for MaxPeers=0 and TrustedPeer overrideAndrey Petrov2018-06-221-0/+54 | | | * rpc: Add admin_addTrustedPeer and admin_removeTrustedPeer.Andrey Petrov2018-06-221-3/+43 | | | | | | | | | | | | | | | | These RPC calls are analogous to Parity's parity_addReservedPeer and parity_removeReservedPeer. They are useful for adjusting the trusted peer set during runtime, without requiring restarting the server. * | p2p: fix rare deadlock in Stop (#17260)Janoš Guljaš2018-07-301-1/+2 | | * | all: simplify switches (#17267)Oleg Kovalov2018-07-303-9/+4 | | | | | | | | | | | | * all: simplify switches * silly mistake * | Merge pull request #17231 from ethersphere/developViktor Trón2018-07-241-0/+18 |\ \ | | | | | | swarm: client-side MRU signatures ; BMT fixes ; network simulation tests | * | swarm: network simulation for swarm tests (#769)Janoš Guljaš2018-07-231-0/+18 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cmd/swarm: minor cli flag text adjustments * cmd/swarm, swarm/storage, swarm: fix mingw on windows test issues * cmd/swarm: support for smoke tests on the production swarm cluster * cmd/swarm/swarm-smoke: simplify cluster logic as per suggestion * changed colour of landing page * landing page reacts to enter keypress * swarm/api/http: sticky footer for swarm landing page using flex * swarm/api/http: sticky footer for error pages and fix for multiple choices * swarm: propagate ctx to internal apis (#754) * swarm/simnet: add basic node/service functions * swarm/netsim: add buckets for global state and kademlia health check * swarm/netsim: Use sync.Map as bucket and provide cleanup function for... * swarm, swarm/netsim: adjust SwarmNetworkTest * swarm/netsim: fix tests * swarm: added visualization option to sim net redesign * swarm/netsim: support multiple services per node * swarm/netsim: remove redundant return statement * swarm/netsim: add comments * swarm: shutdown HTTP in Simulation.Close * swarm: sim HTTP server timeout * swarm/netsim: add more simulation methods and peer events examples * swarm/netsim: add WaitKademlia example * swarm/netsim: fix comments * swarm/netsim: terminate peer events goroutines on simulation done * swarm, swarm/netsim: naming updates * swarm/netsim: return not healthy kademlias on WaitTillHealthy * swarm: fix WaitTillHealthy call in testSwarmNetwork * swarm/netsim: allow bucket to have any type for a key * swarm: Added snapshots to new netsim * swarm/netsim: add more tests for bucket * swarm/netsim: move http related things into separate files * swarm/netsim: add AddNodeWithService option * swarm/netsim: add more tests and Start* methods * swarm/netsim: add peer events and kademlia tests * swarm/netsim: fix some tests flakiness * swarm/netsim: improve random nodes selection, fix TestStartStop* tests * swarm/netsim: remove time measurement from TestClose to avoid flakiness * swarm/netsim: builder pattern for netsim HTTP server (#773) * swarm/netsim: add connect related tests * swarm/netsim: add comment for TestPeerEvents * swarm: rename netsim package to network/simulation * | | p2p: token is useless in xxxEncHandshake (#17230)Wenbiao Zheng2018-07-231-8/+7 |/ / * | p2p: correct comments typo (#17184)jkcomment2018-07-181-1/+1 | | * | swarm: integrate OpenTracing; propagate ctx to internal APIs (#17169)Anton Evangelatov2018-07-133-13/+101 | | | | | | | | | | | | * swarm: propagate ctx, enable opentracing * swarm/tracing: log error when tracing is misconfigured * | p2p/discover: move bond logic from table to transport (#17048)Felix Lange2018-07-036-245/+147 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * p2p/discover: move bond logic from table to transport This commit moves node endpoint verification (bonding) from the table to the UDP transport implementation. Previously, adding a node to the table entailed pinging the node if needed. With this change, the ping-back logic is embedded in the packet handler at a lower level. It is easy to verify that the basic protocol is unchanged: we still require a valid pong reply from the node before findnode is accepted. The node database tracked the time of last ping sent to the node and time of last valid pong received from the node. Node endpoints are considered verified when a valid pong is received and the time of last pong was called 'bond time'. The time of last ping sent was unused. In this commit, the last ping database entry is repurposed to mean last ping _received_. This entry is now used to track whether the node needs to be pinged back. The other big change is how nodes are added to the table. We used to add nodes in Table.bond, which ran when a remote node pinged us or when we encountered the node in a neighbors reply. The transport now adds to the table directly after the endpoint is verified through ping. To ensure that the Table can't be filled just by pinging the node repeatedly, we retain the isInitDone check. During init, only nodes from neighbors replies are added. * p2p/discover: reduce findnode failure counter on success * p2p/discover: remove unused parameter of loadSeedNodes * p2p/discover: improve ping-back check and comments * p2p/discover: add neighbors reply nodes always, not just during init * | swarm: network rewrite mergeethersphere2018-06-226-76/+53 |/ * all: library changes for swarm-network-rewrite (#16898)Elad2018-06-1416-102/+494 | | | | | | | | | | | | This commit adds all changes needed for the merge of swarm-network-rewrite. The changes: - build: increase linter timeout - contracts/ens: export ensNode - log: add Output method and enable fractional seconds in format - metrics: relax test timeout - p2p: reduced some log levels, updates to simulation packages - rpc: increased maxClientSubscriptionBuffer to 20000 * crypto: replace ToECDSAPub with error-checking func UnmarshalPubkey (#16932)Felix Lange2018-06-121-3/+3 | | | | | | ToECDSAPub was unsafe because it returned a non-nil key with nil X, Y in case of invalid input. This change replaces ToECDSAPub with UnmarshalPubkey across the codebase. * p2p/discv5: add egress/ingress traffic metrics to discv5 udp transport (#16369)Dmitry Shulyak2018-05-292-1/+12 | * p2p/enr: updates for discovery v4 compatibility (#16679)Felix Lange2018-05-175-154/+277 | | | | | | | | | | | | | This applies spec changes from ethereum/EIPs#1049 and adds support for pluggable identity schemes. Some care has been taken to make the "v4" scheme standalone. It uses public APIs only and could be moved out of package enr at any time. A couple of minor changes were needed to make identity schemes work: - The sequence number is now updated in Set instead of when signing. - Record is now copy-safe, i.e. calling Set on a shallow copy doesn't modify the record it was copied from. * p2p: don't discard reason set by Disconnect (#16559)Guilherme Salgado2018-05-091-0/+1 | | | | Peer.run was discarding the reason for disconnection sent to the disc channel by Disconnect. * p2p/simulations/adapters: fix websocket log line parsing in exec adapter ↵Ivan Daniluk2018-05-083-23/+75 | | | | (#16667) * p2p: fix some golint warnings (#16577)kiel barry2018-05-0813-291/+292 | * p2p: changed if-else blocks to conform with golint (#16660)GagziW2018-05-032-17/+15 | * build: enable goimports and varcheck linters (#16446)thomasmodeneis2018-04-188-42/+12 | * ecies: drop randomness parameter from `PrivateKey.Decrypt` (#16374)David Huie2018-03-261-2/+2 | | | | | The parameter `rand` is unused in `PrivateKey.Decrypt`. Decryption in the ECIES encryption scheme is deterministic, so randomness isn't needed. * p2p: fix doEncHandshake documentation (#16184)JU HYEONG PARK2018-02-271-4/+4 | * metrics: pull library and introduce ResettingTimer and InfluxDB reporter ↵Anton Evangelatov2018-02-231-4/+4 | | | | | | | | | | | | | | | | | | | | (#15910) * go-metrics: fork library and introduce ResettingTimer and InfluxDB reporter. * vendor: change nonsense/go-metrics to ethersphere/go-metrics * go-metrics: add tests. move ResettingTimer logic from reporter to type. * all, metrics: pull in metrics package in go-ethereum * metrics/test: make sure metrics are enabled for tests * metrics: apply gosimple rules * metrics/exp, internal/debug: init expvar endpoint when starting pprof server * internal/debug: tiny comment formatting fix * p2p: remove unused code (#16158)Ivan Daniluk2018-02-232-29/+1 | | | | | | * p2p: remove unused code * p2p: remove unused imports * Merge pull request #15919 from ethersphere/p2p-protocols-prBalint Gabor2018-02-225-0/+1316 |\ | | | | p2p/protocols, p2p/testing: protocol abstraction and testing | * p2p/protocols: gofmt -w -sFelix Lange2018-02-221-22/+22 | | | * p2p/testing: check for all expectations in TestExchangesJanos Guljas2018-02-182-57/+200 | | | | | | | | | | Handle all expectations in ProtocolSession.TestExchanges in any order that are received. | * p2p/protocols, p2p/testing: protocol abstraction and testingzelig2018-01-185-0/+1173 | | * | p2p: don't send DiscReason when using net.Pipe (#16004)Anton Evangelatov2018-02-222-5/+43 | | * | p2p: when peer is removed remove it also from dial history (#16060)Dmitry Shulyak2018-02-212-0/+57 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change removes a peer information from dialing history when peer is removed from static list. It allows to force a server to re-dial concrete peer if it is needed. In our case we are running geth node on mobile devices, and it is common for a network connection to flap on mobile. Almost every time it flaps or network connection is changed from cellular to wifi peers are disconnected with read timeout. And usually it takes 30 seconds (default expiration timeout) to recover connection with static peers after connectivity is restored. This change allows us to reconnect with peers almost immediately and it seems harmless enough. * | p2p/discover: s/lastPong/bondTime/, update TestUDP_findnodeFelix Lange2018-02-175-25/+26 | | | | | | | | | | | | | | I forgot to change the check in udp.go when I changed Table.bond to be based on lastPong instead of node presence in db. Rename lastPong to bondTime and add hasBond so it's clearer what this DB key is used for now. * | p2p/discover: validate bond against lastpong, not db presencePéter Szilágyi2018-02-161-1/+1 | | * | all: update license information (#16089)Felix Lange2018-02-141-0/+1 | | * | p2p/discover: fix out-of-bounds issuePéter Szilágyi2018-02-141-1/+1 | | * | rpc: dns rebind protection (#15962)Martin Holst Swende2018-02-121-1/+1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cmd,node,rpc: add allowedHosts to prevent dns rebinding attacks * p2p,node: Fix bug with dumpconfig introduced in r54aeb8e4c0bb9f0e7a6c67258af67df3b266af3d * rpc: add wildcard support for rpcallowedhosts + go fmt * cmd/geth, cmd/utils, node, rpc: ignore direct ip(v4/6) addresses in rpc virtual hostnames check * http, rpc, utils: make vhosts into map, address review concerns * node: change log messages to use geth standard (not sprintf) * rpc: fix spelling * | p2p, p2p/discover: misc connectivity improvements (#16069)Felix Lange2018-02-129-276/+795 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * p2p: add DialRatio for configuration of inbound vs. dialed connections * p2p: add connection flags to PeerInfo * p2p/netutil: add SameNet, DistinctNetSet * p2p/discover: improve revalidation and seeding This changes node revalidation to be periodic instead of on-demand. This should prevent issues where dead nodes get stuck in closer buckets because no other node will ever come along to replace them. Every 5 seconds (on average), the last node in a random bucket is checked and moved to the front of the bucket if it is still responding. If revalidation fails, the last node is replaced by an entry of the 'replacement list' containing recently-seen nodes. Most close buckets are removed because it's very unlikely we'll ever encounter a node that would fall into any of those buckets. Table seeding is also improved: we now require a few minutes of table membership before considering a node as a potential seed node. This should make it less likely to store short-lived nodes as potential seeds. * p2p/discover: fix nits in UDP transport We would skip sending neighbors replies if there were fewer than maxNeighbors results and CheckRelayIP returned an error for the last one. While here, also resolve a TODO about pong reply tokens. * | p2p/discv5: fix multiple discovery issues (#16036)Felföldi Zsolt2018-02-093-27/+37 | | | | | | | | | | | | | | | | | | | | | | | | * p2p/discv5: add query delay, fix node address update logic, retry refresh if empty * p2p/discv5: remove unnecessary ping before topic query * p2p/discv5: do not filter local address from topicNodes * p2p/discv5: remove canQuery() * p2p/discv5: gofmt * | p2p/discv5: fix removeTicketRef cached ticket removal (#15995)Felföldi Zsolt2018-01-311-4/+4 | | * | p2p/discv5: fix topic register panic at shutdown (#15946)Felföldi Zsolt2018-01-231-1/+1 | | * | p2p/discv5: logs info about discv5 node info at bind timeMartin Holst Swende2018-01-231-0/+1 | | * | p2p, p2p/discover, p2p/discv5: implement UDP port sharing (#15200)Felföldi Zsolt2018-01-228-63/+114 |/ | | | | | | | | | | | | | | This commit affects p2p/discv5 "topic discovery" by running it on the same UDP port where the old discovery works. This is realized by giving an "unhandled" packet channel to the old v4 discovery packet handler where all invalid packets are sent. These packets are then processed by v5. v5 packets are always invalid when interpreted by v4 and vice versa. This is ensured by adding one to the first byte of the packet hash in v5 packets. DiscoveryV5Bootnodes is also changed to point to new bootnodes that are implementing the changed packet format with modified hash. Existing and new v5 bootnodes are both running on different ports ATM. * all: update generated code (#15808)Felix Lange2018-01-081-3/+3 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * core/types, core/vm, eth, tests: regenerate gencodec files * Makefile: update devtools target Install protoc-gen-go and print reminders about npm, solc and protoc. Also switch to github.com/kevinburke/go-bindata because it's more maintained. * contracts/ens: update contracts and regenerate with solidity v0.4.19 The newer upstream version of the FIFSRegistrar contract doesn't set the resolver anymore. The resolver is now deployed separately. * contracts/release: regenerate with solidity v0.4.19 * contracts/chequebook: fix fallback and regenerate with solidity v0.4.19 The contract didn't have a fallback function, payments would be rejected when compiled with newer solidity. References to 'mortal' and 'owned' use the local file system so we can compile without network access. * p2p/discv5: regenerate with recent stringer * cmd/faucet: regenerate * dashboard: regenerate * eth/tracers: regenerate * internal/jsre/deps: regenerate * dashboard: avoid sed -i because it's not portable * accounts/usbwallet/internal/trezor: fix go generate warnings * core, p2p/discv5: use time.NewTicker instead of time.Tick (#15747)ferhat elmas2018-01-021-3/+3 | * p2p/enr: initial implementation (#15585)Anton Evangelatov2017-12-303-0/+768 | | | | Initial implementation of ENR according to ethereum/EIPs#778 * p2p/discv5: fix reg lookup, polish code, use logger (#15737)Péter Szilágyi2017-12-284-142/+139 | * p2p/discover: fix leaked goroutine in data expirationferhat elmas2017-12-181-3/+3 | * p2p/simulations: fix gosimple nit (#15661)Felix Lange2017-12-131-1/+1 | * p2p/simulations: add mocker functionality (#15207)holisticode2017-12-135-2/+480 | | | | This commit adds mocker functionality to p2p/simulations. A mocker allows to starting/stopping of nodes via the HTTP API. * all: use gometalinter.v2, fix new gosimple issues (#15650)Zach2017-12-134-15/+14 | * p2p, swarm/network/kademlia: use IsZero to check for zero time (#15603)ferhat elmas2017-12-041-1/+1 | * p2p/simulations: various stability fixes (#15198)Lewis Marshall2017-12-019-56/+148 | | | | | | | | | | | | | | | | | | | | | | | | p2p/simulations: introduce dialBan - Refactor simulations/network connection getters to support avoiding simultaneous dials between two peers If two peers dial simultaneously, the connection will be dropped to help avoid that, we essentially lock the connection object with a timestamp which serves as a ban on dialing for a period of time (dialBanTimeout). - The connection getter InitConn can be wrapped and passed to the nodes via adapters.NodeConfig#Reachable field and then used by the respective services when they initiate connections. This massively stablise the emerging connectivity when running with hundreds of nodes bootstrapping a network. p2p: add Inbound public method to p2p.Peer p2p/simulations: Add server id to logs to support debugging in-memory network simulations when multiple peers are logging. p2p: SetupConn now returns error. The dialer checks the error and only calls resolve if the actual TCP dial fails. * build: enable unconvert linter (#15456)ferhat elmas2017-11-111-1/+1 | | | | | | | | | * build: enable unconvert linter - fixes #15453 - update code base for failing cases * cmd/puppeth: replace syscall.Stdin with os.Stdin.Fd() for unconvert linter * p2p/nat: delete port mapping before adding (#15222)Darrel Herbst2017-10-061-0/+1 | | | Fixes #1024 * p2p: snappy encoding for devp2p (version bump to 5) (#15106)Péter Szilágyi2017-09-262-1/+45 | | | | | | * p2p: snappy encoding for devp2p (version bump to 5) * p2p: remove lazy decompression, enforce 16MB limit * p2p: add network simulation framework (#14982)Lewis Marshall2017-09-2522-14/+4513 | | | | | | This commit introduces a network simulation framework which can be used to run simulated networks of devp2p nodes. The intention is to use this for testing protocols, performing benchmarks and visualising emergent network behaviour. * p2p: change ping ticker to timer (#15071)Martin Holst Swende2017-09-041-1/+2 | | | | | | Using a Timer over Ticker seems to be a lot better, though I cannot fully account for why that it behaves so (since Ticker should be more bursty, but not necessarily more active over time, but that may depend on how long window it uses to decide on when to tick next) * discover: Changed Logging from Debug to Info (#14485)Ali Hajimirza2017-05-201-1/+1 | * cmd/geth: add --config file flag (#13875)Felix Lange2017-04-124-17/+70 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * p2p/discover, p2p/discv5: add marshaling methods to Node * p2p/netutil: make Netlist decodable from TOML * common/math: encode nil HexOrDecimal256 as 0x0 * cmd/geth: add --config file flag * cmd/geth: add missing license header * eth: prettify Config again, fix tests * eth: use gasprice.Config instead of duplicating its fields * eth/gasprice: hide nil default from dumpconfig output * cmd/geth: hide genesis block in dumpconfig output * node: make tests compile * console: fix tests * cmd/geth: make TOML keys look exactly like Go struct fields * p2p: use discovery by default This makes the zero Config slightly more useful. It also fixes package node tests because Node detects reuse of the datadir through the NodeDatabase. * cmd/geth: make ethstats URL settable through config file * cmd/faucet: fix configuration * cmd/geth: dedup attach tests * eth: add comment for DefaultConfig * eth: pass downloader.SyncMode in Config This removes the FastSync, LightSync flags in favour of a more general SyncMode flag. * cmd/utils: remove jitvm flags * cmd/utils: make mutually exclusive flag error prettier It now reads: Fatal: flags --dev, --testnet can't be used at the same time * p2p: fix typo * node: add DefaultConfig, use it for geth * mobile: add missing NoDiscovery option * cmd/utils: drop MakeNode This exposed a couple of places that needed to be updated to use node.DefaultConfig. * node: fix typo * eth: make fast sync the default mode * cmd/utils: remove IPCApiFlag (unused) * node: remove default IPC path Set it in the frontends instead. * cmd/geth: add --syncmode * cmd/utils: make --ipcdisable and --ipcpath mutually exclusive * cmd/utils: don't enable WS, HTTP when setting addr * cmd/utils: fix --identity * p2p: if no nodes are connected, attempt dialing bootnodes (#13874)Péter Szilágyi2017-04-113-9/+121 | * p2p, p2p/discover, p2p/nat: rework logging using context keysFelix Lange2017-02-2811-151/+171 | * all: disable log message colors outside of gethFelix Lange2017-02-271-1/+1 | | | | Also tweak behaviour so colors are only enabled when stderr is a terminal. * all: blidly swap out glog to our log15, logs need reworkPéter Szilágyi2017-02-2314-140/+118 | * p2p: remove trailing newlines from log messagesPéter Szilágyi2017-02-235-19/+19 | * crypto: add btcec fallback for sign/recover without cgo (#3680)Felix Lange2017-02-184-35/+4 | | | | | | | | | | | * vendor: add github.com/btcsuite/btcd/btcec * crypto: add btcec fallback for sign/recover without cgo This commit adds a non-cgo fallback implementation of secp256k1 operations. * crypto, core/vm: remove wrappers for sha256, ripemd160 * all: fix ineffectual assignments and remove uses of crypto.Sha3Felix Lange2017-01-091-3/+3 | | | | | go get github.com/gordonklaus/ineffassign ineffassign . * all: fix spelling errorsPéter Szilágyi2017-01-072-2/+2 | * logger, pow/dagger, pow/ezp: delete dead codeFelix Lange2017-01-071-12/+0 | * all: fix issues reported by honnef.co/go/simple/cmd/gosimpleFelix Lange2017-01-074-10/+4 | * all: gofmt -w -sFelix Lange2017-01-0610-38/+38 | * p2p/nat: fix a bytes based net.IP comparisonPéter Szilágyi2016-12-151-2/+1 | * p2p/discover, p2p/discv5: use flexible comparison for IPsPéter Szilágyi2016-12-154-5/+4 | * p2p/discv5: search and lookup improvementZsolt Felfoldi2016-12-082-64/+99 | * p2p, p2p/discover, p2p/discv5: add IP network restriction featureFelix Lange2016-11-239-34/+124 | | | | | | The p2p packages can now be configured to restrict all communication to a certain subset of IP networks. This feature is meant to be used for private networks. * p2p/discover, p2p/discv5: prevent relay of invalid IPs and low portsFelix Lange2016-11-236-28/+56 | | | | | | | | | | | | | | | | | | | | | The discovery DHT contains a number of hosts with LAN and loopback IPs. These get relayed because some implementations do not perform any checks on the IP. go-ethereum already prevented relay in most cases because it verifies that the host actually exists before adding it to the local table. But this verification causes other issues. We have received several reports where people's VPSs got shut down by hosting providers because sending packets to random LAN hosts is indistinguishable from a slow port scan. The new check prevents sending random packets to LAN by discarding LAN IPs sent by Internet hosts (and loopback IPs from LAN and Internet hosts). The new check also blacklists almost all currently registered special-purpose networks assigned by IANA to avoid inciting random responses from services in the LAN. As another precaution against abuse of the DHT, ports below 1024 are now considered invalid. * p2p/discover, p2p/discv5: use netutil.IsTemporaryErrorFelix Lange2016-11-238-248/+2 | * p2p/netutil: new package for network utilitiesFelix Lange2016-11-236-0/+503 | | | | | | | | The new package contains three things for now: - IP network list parsing and matching - The WSAEMSGSIZE workaround, which is duplicated in p2p/discover and p2p/discv5. * cmd, mobile, node, p2p: surface the discovery V5 bootnodesPéter Szilágyi2016-11-152-13/+13 | * mobile: initial wrappers for mobile supportPéter Szilágyi2016-11-142-3/+3 | * p2p/discv5: added new bootnodesZsolt Felfoldi2016-11-141-1/+2 | * p2p/discv5: fixed bootnode connect issuesZsolt Felfoldi2016-11-144-67/+107 | * discv5: fixed state machine lockup bugZsolt Felfoldi2016-11-111-0/+3 | * all: update license informationFelix Lange2016-11-098-8/+8 | * p2p/discv5: fix build with Go 1.5, delete package testimgFelix Lange2016-11-095-879/+18 |