24 Commits

Author SHA1 Message Date
Jordan Hrycaj
0f89c1f901
Beacon sync blocks queue mgmnt update (#3108)
* Update comments and colouring of example metrics display

* Update comment for import/download serialisation flag

details
   When importing starts while peers are actively downloading, the
   system tends to loose download peers, most probably due to high
   system activity. By this behaviour, there will be extra waiting
   delays for finding and connecting to new download peers.

   For this reason, importing and downloading is serialised. Downloading
   does not take place while importing.

* Update comment on import start condition

details
  When importing starts while peers are actively downloading, the
  system tends to loose download peers, most probably due to high
  system activity. By this behaviour, there will be extra waiting
  delays for finding and connecting to new download peers.

  For this reason, importing starts not before the staged blocks queue
  is filled up. The ramp up time to fill up is a fraction of the
  potential waiting time when losing peers.

* Update comment on header or block fetch conversation via eth/XX

* Increase staged blocks queue

why
  Better overall throughput for slightly increased memory usage

* Reduce header queue limits

why
  In regular circumstances, the header queue has a few records most of
  time. Longer queues appear with unwieldy peers (bogus data, timeouts,
  etc.) if they happen to lock the lowest record so preventing from
  temporarily serialising the queue.
2025-02-25 12:48:46 +00:00
andri lim
b4226b66e4
Remove chain_desc.nim and ChainRef usage from hive simulator (#3105) 2025-02-25 15:18:44 +07:00
andri lim
aa4770d337
Fix finalizedBlockHash validation in engine fCU (#3089)
* Fix finalizedBlockHash validation in engine fCU

* restore fcu order
2025-02-20 21:59:16 +00:00
Jordan Hrycaj
38413d25ac
Beacon sync recalibrate blocks queue (#3099)
* Remove obsolete header cache

why:
  Was fall back for the case that the DB table was inaccessible before
  `FC` module reorg.

* Add the number of unused connected peers to metric

* Update docu, add Grafana example

why:
  Provides useful settings, e.g. for memory debugging

* Re-calibrate blocks queue for import

why:
  Old queue setup provided a staging area which was much too large
  consuming too much idle memory. Also the command-line re-calibrating
  for debugging was much too complicated.

  And the naming for the old setup was wrong: There is no max queue
  size. Rather there is a HWM where filling the queue stops when reached.

  The currently tested size allows for 1.5k blocks on the queue.

* Rename hidden command-line option for debug/re-calibrating blocks queue
2025-02-20 18:29:35 +00:00
andri lim
c82fc13836
Merge KvtDbRef/AristoDbRef with their BackendRef (#3088)
* Merge KvtDbRef/AristoDbRef with their BackendRef

* Fix aristo memory_only constructor

* Remove aristo_persist.nim
2025-02-19 10:05:11 +07:00
andri lim
bc1a9dd2c9
Fix data dir id not persisted immediately (#3090) 2025-02-19 10:04:36 +07:00
Jacek Sieka
03010dc558
Reduce ChainRef usage (#3093)
* Reduce ChainRef usage

It's now only used in the hive node, from which it probably also should
be removed

* lint
2025-02-19 10:04:22 +07:00
Advaita Saha
0528c843be
wire in forkedchain to p2p (#3082)
* wire in forkedchain to p2p

* cleanup code not used

* add receipts capability

* suggested changes
2025-02-18 16:07:28 +07:00
andri lim
a97312064e
Merge CoreDbRef with CoreDbCtxRef (#3086) 2025-02-18 13:52:43 +07:00
andri lim
d346759008
Remove Coredb abstraction (#3084)
* Remove Coredb abstraction

* lint
2025-02-18 09:04:18 +07:00
Jacek Sieka
3732b3f95e
fix level reporting (#3085)
Oops, level 0 was always used which needlessly increases mem usage -
comes with an assortment of simplifications
2025-02-18 08:01:44 +07:00
andri lim
a1a9c6b027
Merge AristoTxRef/KvtTxRef with their LayerRef (#3078)
* Merge AristoTxRef/KvtTxRef with their LayerRef

also clean up unused files

* rm unused test_rocksdb

* Fix tests

* lint
2025-02-17 10:30:43 +07:00
Jacek Sieka
caca11b30b
Simplify txFrame protocol, improve persist performance (#3077)
* Simplify txFrame protocol, improve persist performance

To prepare forked-layers for further surgery to avoid the nesting tax,
the commit/rollback style of interacting must first be adjusted, since
it does not provide a point in time where the frame is "done" and goes
from being actively written to, to simply waiting to be persisted or
discarded.

A collateral benefit of this change is that the scheme removes some
complexity from the process by moving the "last saved block number" into
txframe along with the actual state changes thus reducing the risk that
they go "out of sync" and removing the "commit" consolidation
responsibility from ForkedChain.

* commit/rollback become checkpoint/dispose - since these are pure
in-memory constructs, there's less error handling and there's no real
"rollback" involved - dispose better implies that the instance cannot be
used and we can more aggressively clear the memory it uses
* simplified block number handling that moves to become part of txFrame
just like the data that the block number references
* avoid reparenting step by replacing the base instead of keeping a
singleton instance
* persist builds the set of changes from the bottom which helps avoid
moving changes in the top layers through each ancestor level of the
frame stack
* when using an in-memory database in tests, allow the instance to be
passed around to enable testing persist and reload logic
2025-02-17 01:51:56 +00:00
tersec
c8e6247a16
rm graphql (EIP-1767) server (#3080) 2025-02-17 07:48:47 +07:00
andri lim
c300b41c07
Add engine_getBlobsV1 implementation (#3071)
* Add engine_getBlobsV1 implementation

* Addressing review
2025-02-15 12:18:07 +00:00
Jacek Sieka
45ec6e7050
Use unittest2 test runner (#3073)
* Use unittest2 test runner

Since upgrading to unittest2, the test runner prints the command line to
re-run a failed test - this however relies on actually using the
unittest2 command line runner.

Previously, test files were assigned numbers - with the unittest2
runner, tests are run using suite/category names instead, like so:

```
# run the Genesis suite
build/all_tests "Genesis::``
# run all tests with "blsMapG1" in the name
build/all_tests "blsMapG1*"
# run tests verbosely
build/all_tests -v
```

A reasonable follow-up here would be to review the suite names to make
them easier to run :)

* lint

* easier-to-compare test order

* bump unittest2 (also the repo)
2025-02-15 14:08:50 +07:00
Jacek Sieka
b6584153ff
add custom hash for RootedVertexID (#3070)
* add custom `hash` for `RootedVertexID`

There's no benefit hashing `root` since `vid` is already unique and the
"default" hash is not free - this trivially brings a small perf boost to
one of the key lookup tables in aristo_layers.

* lint
2025-02-14 14:50:46 +00:00
Jordan Hrycaj
e666eb52b0
Fix fringe case where the final checkpoint() must not be applied (#3072)
* Fix fringe case where the final `checkpoint()` must not be applied

why
  If there are no `era` or `era1` files that can be imported from,
  then the internal state will not be in sync with the DB state. This
  would lead to overwriting the saved state block number with something
  fancy. As a consequence the database becomes unusable for the next
  process which will eventually fail with a state root mismatch.

* Update comment
2025-02-14 12:51:56 +00:00
Jacek Sieka
42bb640443
Simplify shared rocksdb instance / write batch handling (#3063)
By introducing the "shared rocksdb instance" concept to the backend, we
can remove the "piggybacking" mode , thus reducing the complexity of
database initialisation and opening the possibility of extending how
write batching works across kvt/aristo.

The change makes explicit the hidden shared state that was previously
hiding in closures and provides the first step towards simplifying the
"commit/persist" interface of coredb, preparing it for optimizations to
reduce the "layering tax" that `forked-layers` introduced.
2025-02-14 09:40:22 +01:00
andri lim
c08e83a9a5
Add Prague fork timestamp for Holesky and Sepolia (#3068) 2025-02-14 01:47:20 +00:00
tersec
b417dd1986
rm engine_exchangeTransitionConfigurationV1 support (#3067) 2025-02-14 08:10:47 +07:00
bhartnett
f513e1dc53
Update Nimbus EVM code to use the latest nim-evmc which supports EVMC v12.1.0 (#3065)
* Update Nimbus EVM code to use the latest nim-evmc which is now on EVMC v12.1.0

* Fix copyright.

* Fix tests.

* Update to use FkLatest.

* Fix copyright and update test helper.
2025-02-14 08:06:54 +07:00
andri lim
67dbe817a9
Add Sepolia depositContractAddress (#3059) 2025-02-12 12:53:01 +07:00
pmmiranda
411a3cadfa
Renamed 'nimbus' directory and its references to 'execution_chain' (#3052)
* renamed nimbus folder to execution_chain

* Renamed "nimbus" references to "execution_chain"

* fixed wrongly changed http reference

* delete snap types file given that it was deleted before this PR merge

* missing 'execution_chain' replacement

---------

Co-authored-by: pmmiranda <pedro.miranda@nimbus.team>
2025-02-11 22:28:42 +00:00