Skip to content

Commit

Permalink
Client: More UI Improvements / Fix TxPool not being started along FCU (
Browse files Browse the repository at this point in the history
…#3100)

* Client: expand super msgs to also take in multiline output

* Client: adjust CL disconnect thresholds to avoid reconnect messages

* Client: add note to explain subchains on subchain creation

* Client: fix synchronized setting on FCU

* Client: make tx pool started a super msg

* fix switching client to syncronized state and start txpool

---------

Co-authored-by: harkamal <[email protected]>
  • Loading branch information
holgerd77 and g11tech authored Oct 11, 2023
1 parent f4a4a92 commit 02a7abb
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 15 deletions.
14 changes: 11 additions & 3 deletions packages/client/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -651,10 +651,18 @@ export class Config {
return key
}

superMsg(msg: string, meta?: any) {
const len = msg.length
superMsg(msgs: string | string[], meta?: any) {
if (typeof msgs === 'string') {
msgs = [msgs]
}
let len = 0
for (const msg of msgs) {
len = msg.length > len ? msg.length : len
}
this.logger.info('-'.repeat(len), meta)
this.logger.info(msg, meta)
for (const msg of msgs) {
this.logger.info(msg, meta)
}
this.logger.info('-'.repeat(len), meta)
}

Expand Down
17 changes: 11 additions & 6 deletions packages/client/src/rpc/modules/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1225,12 +1225,6 @@ export class Engine {
}
}
this.service.txPool.removeNewBlockTxs(blocks)

const isPrevSynced = this.chain.config.synchronized
this.config.updateSynchronizedState(headBlock.header)
if (!isPrevSynced && this.chain.config.synchronized) {
this.service.txPool.checkRunState()
}
} else {
// even if the vmHead is same still validations need to be done regarding the correctness
// of the sequence and canonical-ity
Expand All @@ -1244,6 +1238,17 @@ export class Engine {
}
}

if (
this.config.syncTargetHeight === undefined ||
this.config.syncTargetHeight < headBlock.header.number
) {
this.config.syncTargetHeight = headBlock.header.number
}
this.config.updateSynchronizedState(headBlock.header)
if (this.chain.config.synchronized) {
this.service.txPool.checkRunState()
}

// prepare valid response
let validResponse
// If payloadAttributes is present, start building block and return payloadId
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/rpc/util/CLConnectionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ export class CLConnectionManager {
private DEFAULT_FORKCHOICE_LOG_INTERVAL = 60000

/** Threshold for a disconnected status decision */
private DISCONNECTED_THRESHOLD = 30000
private DISCONNECTED_THRESHOLD = 45000
/** Wait for a minute to log disconnected again*/
private LOG_DISCONNECTED_EVERY_N_CHECKS = 6
private disconnectedCheckIndex = 0

/** Threshold for an uncertain status decision */
private UNCERTAIN_THRESHOLD = 15000
private UNCERTAIN_THRESHOLD = 30000

/** Track ethereumjs client shutdown status */
private _clientShutdown = false
Expand Down
8 changes: 5 additions & 3 deletions packages/client/src/service/skeleton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,11 @@ export class Skeleton extends MetaDBManager {
next: head.header.parentHash,
}
this.status.progress.subchains.unshift(s)
this.config.superMsg(
`Created new subchain tail=${s.tail} head=${s.head} next=${short(s.next)}`
)
const msgs = [
`Created new subchain tail=${s.tail} head=${s.head} next=${short(s.next)}`,
'Note: Subchain will be backfilled and merged with the canonical chain on success.',
]
this.config.superMsg(msgs)
// Reset the filling of canonical head from tail only on tail reorg and exit any ongoing fill
this.status.canonicalHeadReset = s.tail > BIGINT_0
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/service/txpool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export class TxPool {
this._logInterval = setInterval(this._logPoolStats.bind(this), this.LOG_STATISTICS_INTERVAL)
}
this.running = true
this.config.logger.info('TxPool started.')
this.config.superMsg('TxPool started.')
return true
}

Expand Down

0 comments on commit 02a7abb

Please sign in to comment.