nimbus-eth1/nimbus/sync/snap
Jordan Hrycaj 7d9e1d8607
Misc updates for full sync (#2140)
* Code cosmetics

* Aristo+Kvt: Fix api wrappers

why:
  Api setup killed the backend descriptor when backend mapping was
  disabled.

* Aristo: Implement masked profiling entries

why:
  Database backend should be listed but not counted in tally

* CoreDb: Simplify backend() methods

why:
  DBMS backend access Was provided very early and over engineered. Now
  there are only two backend machines, one for `Kvt` and the other one
  for an `Mpt` available only via new API.

* CoreDb: Code cleanup regarding descriptor types

* CoreDb: Refactor/redefine `persistent()` methods

why:
  There were `persistent()` methods for any type of caching storage
  facilities `Kvt`, `Mpt`, `Phk`, and `Acc`. Now there is only a single
  `persistent()` method storing all facilities in tandem (similar to
  how transactions work.)

  For non shared `Kvt` tables, there is now an extra storage method
  `saveOffSite()`.

* CoreDb lingo update: `trie` becomes `column`

why:
  Notion of a `trie` is pretty much hidden by the new `CoreDb` api.
  Revealed are sort of database columns for accounts an storage data,
  any of which have an internal state represented by a Keccack hash.
  So a `trie` or `MPT` becomes a `column` and a `rootHash` becomes a
  column state.

* Aristo: rename backend filed `filters` => `journal`

* Update full sync logging

details:
  + Disable eth handler noise while syncing
  + Log journal depth (if available)

* Fix copyright year

* Fix cruft and unwanted imports
2024-04-19 18:37:27 +00:00
..
worker Misc updates for full sync (#2140) 2024-04-19 18:37:27 +00:00
README.txt Improve full sync part behaviour 4 snap sync suite (#1564) 2023-04-26 16:46:42 +01:00
constants.nim Code reorg 4 snap sync suite (#1560) 2023-04-24 21:24:07 +01:00
range_desc.nim Reduce compiler warnings (#2030) 2024-02-16 16:08:07 +07:00
worker.nim Code reorg 4 snap sync suite (#1560) 2023-04-24 21:24:07 +01:00
worker_desc.nim Remove obsolete select_backend and fix simulators CI (#2007) 2024-02-04 21:28:20 +07:00

README.txt

Test & debugging scenario with nimbus-eth1 client/server
========================================================


Start snap/1 server
-------------------

  # Enter nimbus directory for snap/1 protocol server.
  cd server

  # Tell nimbus to stop full sync after 2 mio blocks.
  echo 2000000 > full-limit.txt

  # Tell nimbus to use this predefined key ID
  echo 123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0 > full-id.key

  ./build/nimbus \
    --tcp-port:30319 --nat=None --sync-mode=full \
	--protocols=snap --discovery=none \
	--net-key=./full-id.key \
	--sync-ctrl-file=./full-limit.txt \
	--log-level:TRACE

  # Wait for several hours until enough blocks have been downloaded so that
  # snap sync data are available. The full 2 mio blocks are available if the
  # log ticker shows something like
  #
  # INF 2023-03-17 [..] Sync statistics (suspended) topics="full-tick" [..] persistent=#2000080 [..]
  #
  # where the persistent=#2000080 field might vary


Start snap/1 client
-------------------

  # Note: When the snap/1 server has enough blocks, the client can be started.

  # Enter nimbus directory for snap/1 protocol server
  cd client

  # Tell nimbus to use this pivot block number. This number must be smaller
  # than the 2000000 written into the file full-limit.txt above.
  echo 600000 > snap/snap-update.txt

  # Tell nimbus to stop somewhere after 1000000 blocks have been downloaded
  # with full sync follow up after snap sync has completed (2nd line of
  # external setuip file.)
  echo 1000000 >> snap/snap-update.txt

  # Tell nimbus to use this hard coded peer enode.
  echo enode://192d7e7a302bd4ff27f48d7852621e0d3cb863a6dd67dd44e0314a25a3aa866837f0d2460b4444dc66e7b7a2cd56a2de1c31b2a2ba4e23549bf3ba3b0c4f2eb5@127.0.0.1:30319 > snap/full-servers.txt

  ./build/nimbus \
    --tcp-port:30102 --nat=None --sync-mode=snap \
	--protocols=none --discovery=none \
	--static-peers-file=./full-servers.txt \
	--sync-ctrl-file=./snap-update.txt \
	--log-level:TRACE


Modifications while the programs are syncing
--------------------------------------------

  # Increasing the number in the files full/full-limit.txt or
  # snap/snap-update.txt will be recognised while running. Decreasing
  # or removing will be ignored.