* add : start commit work only after connecting to peers
* fix : chainconfig fix
* chg : change test and unitTest chainconfigs chainID from 80001
* fix : p2p server deadlock
The Go authors updated golang/x/ext to change the function signature of the slices sort method.
It's an entire shitshow now because x/ext is not tagged, so everyone's codebase just
picked a new version that some other dep depends on, causing our code to fail building.
This PR updates the dep on our code too and does all the refactorings to follow upstream...
This changes the port mapping procedure such that, when the requested port is unavailable
an alternative port suggested by the router is used instead.
We now also repeatedly request the external IP from the router in order to catch any IP changes.
Co-authored-by: Felix Lange <fjl@twurst.com>
This simplifies the code that initializes the discovery a bit, and
adds new flags for enabling/disabling discv4 and discv5 separately.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
In all other UDPv4 methods, the deadline is checked first. It seems weird to me that ping is an exception. Deadline comparison is also less resource intensive.
Co-authored-by: Exca-DK <Exca-DK@users.noreply.github.com>
* p2p/discover: remove ReadRandomNodes
Even though it's public, this method is not callable by code outside of
package p2p/discover because one can't get a valid instance of Table.
* p2p/discover: add Table.Nodes
* p2p/discover: make Table settings configurable
In unit tests and externally developed cmd/devp2p test runs, it can be
useful to tune the timer intervals used by Table.
This changes TALKREQ message processing to run the handler on separate goroutine,
instead of running on the main discv5 dispatcher goroutine. It's better this way because
it allows the handler to perform blocking actions.
I'm also adding a new method TalkRequestToID here. The method allows implementing
a request flow where one node A sends TALKREQ to another node B, and node B later
sends a TALKREQ back. With TalkRequestToID, node B does not need the ENR of A to
send its request.
* minor comment update
* added support for rpc.evmtimeout flag
* added support for vmdebug (EnablePreimageRecording) flag
* added support for jsonrpc.auth.(jwtsecret, addr, port, vhosts) flags
* added support for miner.recommit flag
* added support for gpo.maxheaderhistory and gpo.maxblockhistory flag
* Revert "added support for miner.recommit flag"
This reverts commit fcb722e4bf5bdda23d4c91da40ab95c9023a80c3.
* added pprof related flags (expect --pprof.cpuprofile - Write CPU profile to the given file)
* added support for --dev.gaslimit flag
* added support for --fdlimit flag
* added support for --netrestrict flag
* added support for --nodekey and --nodekeyhex flag
* added support for --vmodule, --log.json, --log.backtrace, and --log.debug flags
* fixed related lint errors
* fix lints from develop (few lints decided to appear from code that was untouched, weird)
* more weird lints from develop
* small precautionary fix
* small bug ;) fix in NetRestrict
* weird lints
* change vmdebug = true to vmdebug = false
This PR is a (superior) alternative to https://github.com/ethereum/go-ethereum/pull/26708, it handles deprecation, primarily two specific cases.
`rand.Seed` is typically used in two ways
- `rand.Seed(time.Now().UnixNano())` -- we seed it, just to be sure to get some random, and not always get the same thing on every run. This is not needed, with global seeding, so those are just removed.
- `rand.Seed(1)` this is typically done to ensure we have a stable test. If we rely on this, we need to fix up the tests to use a deterministic prng-source. A few occurrences like this has been replaced with a proper custom source.
`rand.Read` has been replaced by `crypto/rand`.`Read` in this PR.
* p2p/discover: add more packet information in logs
This adds more fields to discv5 packet logs. These can be useful when
debugging multi-packet interactions.
The FINDNODE message also gets an additional field, OpID for debugging
purposes. This field is not encoded onto the wire.
I'm also removing topic system related message types in this change.
These will come back in the future, where support for them will be
guarded by a config flag.
* p2p/discover/v5wire: rename 'Total' to 'RespCount'
The new name captures the meaning of this field better.