File tree Expand file tree Collapse file tree 3 files changed +19
-9
lines changed
Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -256,7 +256,16 @@ export class Engine {
256256
257257 this . exchangeTransitionConfigurationV1 = middleware (
258258 this . exchangeTransitionConfigurationV1 . bind ( this ) ,
259- 0
259+ 1 ,
260+ [
261+ [
262+ validators . object ( {
263+ terminalTotalDifficulty : validators . hex ,
264+ terminalBlockHash : validators . hex ,
265+ terminalBlockNumber : validators . hex ,
266+ } ) ,
267+ ] ,
268+ ]
260269 )
261270 }
262271
Original file line number Diff line number Diff line change 88import { Address , BN } from 'ethereumjs-util'
99import { Config } from '../config'
1010import { Peer } from '../net/peer'
11- import { EthProtocolMethods } from '../net/protocol'
1211import type { PeerPool } from '../net/peerpool'
1312import type { Block } from '@ethereumjs/block'
1413import type { StateManager } from '@ethereumjs/vm/dist/state'
@@ -369,16 +368,16 @@ export class TxPool {
369368 this . config . logger . debug (
370369 `TxPool: requesting txs number=${ reqHashes . length } pending=${ this . pending . length } `
371370 )
372- const [ _ , txs ] = await ( peer ! . eth as EthProtocolMethods ) . getPooledTransactions ( {
371+ const getPooledTxs = await peer . eth ! . getPooledTransactions ( {
373372 hashes : reqHashes . slice ( 0 , this . TX_RETRIEVAL_LIMIT ) ,
374373 } )
375374
376- this . config . logger . debug ( `TxPool: received requested txs number=${ txs . length } ` )
377-
378375 // Remove from pending list regardless if tx is in result
379- for ( const reqHashStr of reqHashesStr ) {
380- this . pending = this . pending . filter ( ( hash ) => hash !== reqHashStr )
381- }
376+ this . pending = this . pending . filter ( ( hash ) => ! reqHashesStr . includes ( hash ) )
377+
378+ if ( ! getPooledTxs ) return
379+ const [ _ , txs ] = getPooledTxs
380+ this . config . logger . debug ( `TxPool: received requested txs number=${ txs . length } ` )
382381
383382 const newTxHashes = [ ]
384383 for ( const tx of txs ) {
Original file line number Diff line number Diff line change @@ -22,13 +22,15 @@ const level = require('level-mem')
2222const config : any = { }
2323config . logger = getLogger ( config )
2424
25+ type StartRPCOpts = { port ?: number ; wsServer ?: boolean }
2526type WithEngineMiddleware = { jwtSecret : Buffer ; unlessFn ?: ( req : IncomingMessage ) => boolean }
2627
2728export function startRPC (
2829 methods : any ,
29- { port , wsServer } : { port ?: number ; wsServer ?: boolean } = { port : 3000 } ,
30+ opts : StartRPCOpts = { port : 3000 } ,
3031 withEngineMiddleware ?: WithEngineMiddleware
3132) {
33+ const { port, wsServer } = opts
3234 const server = new RPCServer ( methods )
3335 const httpServer = wsServer
3436 ? createWsRPCServerListener ( { server, withEngineMiddleware } )
You can’t perform that action at this time.
0 commit comments