All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog (modification: no type change headlines) and this project adheres to Semantic Versioning.
This release integrates a Common
library version which provides the london
HF blocks for all networks including mainnet
and is therefore the first release with finalized London HF support. For the devp2p
library this particularly means that the fork hashes for the london
HF will be correct when using eth/64 or higher.
PR #1331 added support for eth/66 and #1324 for les/4. Be sure to check out the updated peer communication examples.
Source files from the src
folder are now included in the distribution build, see PR #1301. This allows for a better debugging experience in debug tools like Chrome DevTools by having working source map references to the original sources available for inspection.
- Fixed zero Buffer forkhash bug in case no future fork known, PR #1148 commit
afd00a8
Attention! This new version is part of a series of EthereumJS releases all moving to a new scoped package name format. In this case the library is renamed as follows:
ethereumjs-devp2p
->@ethereumjs/devp2p
Please update your library references accordingly or install with:
npm i @ethereumjs/devp2p
This is the first-production ready release of this library. During our work on the EthereumJS Client we were finally able to battle-test this library in a real-world environment (so: towards mainnet
, the main official testnets like goerli
or rinkeby
as well as ephemeral testnets like yolov3
). We fixed a myriad of partly critical bugs along the way (which are extremely hard to reproduce just in a test environment) and can now fully recommend to use this library for ETH
protocol integrations up to version ETH/65
in a production setup. Note that the LES
support in the library is still outdated (but working), an update is planned (let us know if you have demand).
The ETH
protocol support has been updated to now also support versions 64
and 65
. Biggest protocol update here is ETH/64
introduced with PR #82 which adds support for selecting peers by fork ID (see associated EIP-2124). This allows for a much more differentiated chain selection and avoids connecting to peers which are on a different chain but having a shared chain history with the same blocks and the same block hashes.
ETH/65
implemented in PR #1159 adds three new message types NewPooledTransactionHashes (0x08)
, GetPooledTransactions (0x09)
and PooledTransactions (0x0a)
for a more efficient exchange on txs from the tx pool (EIP-2464).
Node discovery via DNS has been added to quickly acquire testnet (or mainnet) peers from the DNS ENR tree per EIP-1459, see PRs #1070, #1097 and #1149. This allows for easier peer discovery especially on the testnets. Peer search is randomized as being recommended in the EIP and the implementation avoids to download the entire DNS tree at once.
DNS discovery can be activated in the DPT
module with the shouldGetDnsPeers
option, in addition there is a new shouldFindNeighbours
option allowing to deactivate the classical v4 discovery process. Both discovery methods can be used in conjunction though. DNS Peer discovery can be customized/configured with additional constructor options dnsRefreshQuantity
, dnsNetworks
and dnsAddress
. See API section in the README for a description.
- Updated
goerli
bootnodes, PR #1031 maxPeers
,dpt
, andlistenPort
are now optional inRLPxOptions
, PR #1019- New
DPTOptions
interface,DPT
type improvements, PR #1029 - Improved
RLPx
disconnect reason debug output, PR #1031 LES
: unifiyETH
andLES
sendMessage()
signature by somewhat change payload semantics and pass inreqId
along, PR #1087RLPx
: limit connection refill debug logging to a restarted interval log message to not bloat logging too much, PR #1087
- Subdivided interval calls to refill
RLPx
peer connections to improve networking distribution and connection reliability, PR #1036 - Fixed an error in
DPT
not properly banning old peers and replacing with a new peer onKBucket
ping, PR #1036 - Connection reliability: distribute network traffic on
DPT
additions of new neighbour peers, PR #1036 - Fixed a critical peer data processing bug, PR #1064
- Added socket destroyed checks on peer message sending to safeguard against stream-was-destroyed error, PR #1075
DPT
: fixed undefined array access in ETH._getStatusString() on malformed ETH/64 status msgs, PR #1029
- Added dedicated browser build published to
dist.browser
topackage.json
, PR #1184 - Updated
rlp-encoding
dependency to the EthereumJSrlp
library, PR #94 RLPx
type improvements, PR #1036- Switched to
Codecov
, PR #92 - Upgraded dev deps (config 2.0, monorepo betas, typedoc), PR #93
3.0.3 - 2020-09-29
- Moved
TypeScript
type packages forlru-cache
andbl
fromdevDependencies
todependencies
, PR #90
3.0.2 - 2020-09-28
- Fixed
TypeScript
import issue causing problems when integrating the library in aTypeScript
project, PR #88 - Updated
k-bucket
library tov5
, added types from new@types/k-bucket
package from @tomonari-t, PR #88
3.0.1 - 2020-06-10
This release focuses on improving the debugging
capabilities of the library. PR #72
reduces the verbosity of the log output to cut on noise on everyday debugging. There is a new verbose
logger to retain the more verbose output (e.g. with full message bodies) which can be used like this:
DEBUG=devp2p:*,verbose node -r ts-node/register ./examples/peer-communication.ts
Other Logging Improvements
- Added number of peers to
refillConnections()
debug message - Replaced try/catch logic for EIP-8 auth check to avoid side-effects and get rid of misleading wrong-ecies-header debug output
- Moved debug output in
BanList.add()
after the set operation to get the correct size output - Added debug message for
DISCONNECT
reason from peer (this was always some constant re-debug reason, and at the end it's mostlyTOO_MANY_PEERS
) - Internalize detached logger output from the
devp2p:util
logger
Other Changes
- Refactored
Peer
class for better code readability, PR #77
There has also been a new high-level diagram added to the README
which can be used to get an overview on the structure, available loggers and the event flow of the library (PR #76).
3.0.0 - 2020-05-25
First TypeScript
release of the library, see PR #56 for all the changes and associated discussion.
All source parts of the library have been ported to TypeScript
and working with the library should now therefore be much more reliable due to the additional type safety features provided by the TypeScript
language. The API of the library remains unchanged in a JavaScript
context.
Noteworthy Changes from PR #56:
- Type additions for all method signatures and class members of all protocol components (
dpt
,eth
,les
,rlpx
) - Addition of various structuring interfaces (like PeerInfo for
DPT
message input) andenum
constructs (like MESSAGE_CODES from theETH
protocol) - Port of the examples to
TypeScript
- Port of all the test cases to
TypeScript
- Integration of the library into the common ethereumjs-config EthereumJS configuration setup (
standard
->TSLint
linting, docs withTypeDoc
,TypeScript
compilation,Prettier
formatting rules) - Lots of code cleanups and code part modernizations
Thanks @dryajov for all the great work on this! ❤
Other Updates:
- Added Node 12,13 support, upgrade from Travis to GitHub actions, PR #57
- Updated
ethereumjs-common
dependency tov1.5.1
for a bootnode update, PR #67 - Removed Node 6, 8 support, updated
secp256k1
dependency to fromv3.1.0
tov4.0.1
, PR #68 - Updated
keccak
dependency tov3.0.0
, PR #64 - Some dependency cleanup, PRs #62, #65, #58
2.5.1 - 2018-12-12
- Fix connection error by ignoring
RLPX
peers with missing tcp port, PR #45
2.5.0 - 2018-03-22
- Light client protocol (
LES/2
) implementation, PR #21 LES/2
usage example, see:examples/peer-communication-les.js
- Better test coverage for upper-layer protocols (
ETH
,LES/2
), PR #34
2.4.0 - 2018-02-28
- First release providing a reliable
ETH
connection - Fix Parity
DPT
ping echo hash bug preventing the library to connect to Parity clients, PR #32 - Fixed a bug not setting weHello in peer after sent
HELLO
msg
2.3.0 - 2018-02-27
- Fix critical
RLPX
bug leading to not processing incomingEIP-8
Auth
orAck
messages, PR #26 - Fix bug not forwarding
k-bucket
remove event throughDPT
(sopeer:removed
fromDPT
was not working), PR #27 - Fix updating
ingressMac
with wrongAuth
msg leading to divergingMac
hashes, PR #29 - Fix bug not let first
ETH
status
message emit amessage
event, PR #30 - Large rework of the test setup, additional
DPT
,RLPX
andETH
simulator tests, improving test coverage from 48% to 84%, PR #25
2.2.0 - 2017-12-07
EIP-8
compatibility- Improved debug messages
- Fixes a bug on DPT ping timeout being triggered even if pong message is received
- Only send connect event after both HELLO msgs are exchanged (fixes unreliable upper-protocol communication start)
- Connection reliability improvements for
peer-communication
example - API documentation
2.1.3 - 2017-11-09
- Dependency updates
- Improved README documentation