Skip to content

Commit

Permalink
client: added invalid-type on DPT message decoding to list of ignored…
Browse files Browse the repository at this point in the history
… RLPx server errors, sorted ignored error list by origin
  • Loading branch information
holgerd77 committed Jan 29, 2021
1 parent 05059c8 commit 0d64db5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
24 changes: 17 additions & 7 deletions packages/client/lib/net/server/rlpxserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,28 @@ export interface RlpxServerOptions extends ServerOptions {

const ignoredErrors = new RegExp(
[
// Peer socket connection
'ECONNRESET',
'EPIPE',
'ETIMEDOUT',
'EPIPE', // (?)
'ETIMEDOUT', // (?)

// ETH status handling
'Genesis block mismatch',
'Handshake timed out',
'NetworkId mismatch',
'Unknown fork hash',

// DPT message decoding
'Hash verification failed',
'Invalid address buffer',
'Invalid MAC',
'Invalid timestamp buffer',
'NetworkId mismatch',
'Timeout error: ping',
'Unknown fork hash',
'Invalid type',
'Timeout error: ping', // connection

// ECIES message encryption
'Invalid MAC',

// Client
'Handshake timed out', // Protocol handshake
].join('|')
)

Expand Down
2 changes: 1 addition & 1 deletion packages/client/lib/sync/execution/vmexecution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class VMExecution extends Execution {
* Initializes VM execution. Must be called before run() is called
*/
async open(): Promise<void> {
const headBlock = await this.vm.blockchain.getHead()
const headBlock = await this.vm.blockchain.getIteratorHead()
const blockNumber = headBlock.header.number.toNumber()
this.config.execCommon.setHardforkByBlockNumber(blockNumber)
this.hardfork = this.config.execCommon.hardfork()
Expand Down

0 comments on commit 0d64db5

Please sign in to comment.