nimbus-eth1/nimbus
Jordan Hrycaj ea268e81ff
Beacon sync activation control update (#2782)
* Clarifying/commenting FCU setup condition & small fixes, comments etc.

* Update some logging

* Reorg metrics updater and activation

* Better `async` responsiveness

why:
  Block import does not allow `async` task activation while
  executing. So allow potential switch after each imported
  block (rather than a group of 32 blocks.)

* Handle resuming after previous sync followed by import

why:
  In this case the ledger state is more recent than the saved
  sync state. So this is considered a pristine sync where any
  previous sync state is forgotten.

  This fixes some assert thrown because of inconsistent internal
  state at some point.

* Provide option for clearing saved beacon sync state before starting syncer

why:
  It would resume with the last state otherwise which might be undesired
  sometimes.

  Without RPC available, the syncer typically stops and terminates with
  the canonical head larger than the base/finalised head. The latter one
  will be saved as database/ledger state and the canonical head as syncer
  target. Resuming syncing here will repeat itself.

  So clearing the syncer state can prevent from starting the syncer
  unnecessarily avoiding useless actions.

* Allow workers to request syncer shutdown from within

why:
  In one-trick-pony mode (after resuming without RPC support) the
  syncer can be stopped from within soavoiding unnecessary polling.
  In that case, the syncer can (theoretically) be restarted externally
  with `startSync()`.

* Terminate beacon sync after a single run target is reached

why:
  Stops doing useless polling (typically when there is no RPC available)

* Remove crufty comments

* Tighten state reload condition when resuming

why:
  Some pathological case might apply if the syncer is stopped while the
  distance between finalised block and head is very large and the FCU
  base becomes larger than the locked finalised state.

* Verify that finalised number from CL is at least FCU base number

why:
  The FCU base number is determined by the database, non zero if
  manually imported. The finalised number is passed via RPC by the CL
  node and will increase over time. Unless fully synced, this number
  will be pretty low.

  On the other hand, the FCU call `forkChoice()` will eventually fail
  if the `finalizedHash` argument refers to something outside the
  internal chain starting at the FCU base block.

* Remove support for completing interrupted sync without RPC support

why:
  Simplifies start/stop logic

* Rmove unused import
2024-10-28 16:22:04 +00:00
..
beacon better logging for running client (#2781) 2024-10-27 22:20:04 +00:00
common Use stateRoot/storageRoot more consistently (#2791) 2024-10-27 19:56:28 +01:00
core better logging for running client (#2781) 2024-10-27 22:20:04 +00:00
db Use stateRoot/storageRoot more consistently (#2791) 2024-10-27 19:56:28 +01:00
evm Use stateRoot/storageRoot more consistently (#2791) 2024-10-27 19:56:28 +01:00
graphql Use stateRoot/storageRoot more consistently (#2791) 2024-10-27 19:56:28 +01:00
rpc Use stateRoot/storageRoot more consistently (#2791) 2024-10-27 19:56:28 +01:00
stateless replace deprecated types (#2704) 2024-10-16 08:34:12 +07:00
sync Beacon sync activation control update (#2782) 2024-10-28 16:22:04 +00:00
transaction Unify tx validation (#2777) 2024-10-26 09:19:48 +02:00
utils Use stateRoot/storageRoot more consistently (#2791) 2024-10-27 19:56:28 +01:00
common.nim implement better hardfork management 2022-12-02 13:51:42 +07:00
compile_info.nim Small updates and fixes for rlpx suite (#2571) 2024-08-19 14:00:10 +00:00
config.nim Update networking defaults (#2783) 2024-10-26 09:18:02 +02:00
constants.nim Bump nim-eth and nimbus-eth2 (#2741) 2024-10-16 13:51:38 +07:00
errors.nim Remove EVM indirect imports and unused EVM errors (#2370) 2024-06-17 09:56:39 +02:00
makefile Snap sync fix trie interpolation fringe condition (#1457) 2023-02-01 18:56:06 +00:00
nim.cfg import: read from era files (#2254) 2024-05-31 09:13:56 +02:00
nimbus_desc.nim Suppress beacon sync unless potential actions (#2765) 2024-10-21 18:01:45 +00:00
nimbus_execution_client.nim Beacon sync activation control update (#2782) 2024-10-28 16:22:04 +00:00
nimbus_import.nim fix: show correct blockNumber and log in end of era files (#2691) 2024-10-04 01:37:50 +00:00
rpc.nim add eth_sendRawTransaction to server API (#2678) 2024-10-02 03:56:39 +00:00
tracer.nim Use stateRoot/storageRoot more consistently (#2791) 2024-10-27 19:56:28 +01:00
transaction.nim Unify tx validation (#2777) 2024-10-26 09:19:48 +02:00
version.nim Add startup banner (#2354) 2024-06-14 10:08:44 +02:00