Commit Graph

2979 Commits

Author SHA1 Message Date
jangko dcd1225724
implement txparse tool and add make target for txparse 2022-12-10 20:38:47 +07:00
jangko 1cd4a3fd54
tools: add missing copyright header 2022-12-10 19:53:24 +07:00
jangko 13e5b1a76b
fix persistHeaderToDb, allow POS block header to be canonical 2022-12-10 09:02:30 +07:00
KonradStaniec 1cc6fc5cff
bump nimbus-eth2 and web3 (#1360)
- nimbus-eth2 exposes new callbacks in LightClient
- web3 exposes createAccessList call
2022-12-09 18:00:45 +01:00
Kim De Mey c5ecba83cd
Refactor and clean-up of history network and eth rpc (#1357)
- Switch from using Option to Opt which allows for smoother
usage with already existing Result types
- With all moved to Opt, make more use of valueOr to avoid
too many if else clause indentation and unstead have a more
clear error path at each step
- Remove dead code, char limits, style guide, etc.
- Replace getEncodedKeyForContent with ContentKey.init
and use ContentKey.init for each type
2022-12-09 17:59:36 +01:00
Jordan Hrycaj 179b4adac3
Snap sync tweaks n fixes (#1359)
* Miscellaneous tweaks & fixes

details:
+ Catch `TransportError` exception in `legacy.nim` module
+ Fix self-calling wrapper `hexaryEnvelopeTouchedBy()`

* Update documentation, logging etc.

* Changed `checkNode` batch list `seq[Blob]` => `seq[NodeSpecs]`

why:
  The `NodeSpecs` type as used here is a tuple `(partial-path,node-key)`.

  When `checkNode` partial paths are collected, also the node key is
  available so it should be registered and not repeatedly recovered from
  the database.

* Add optional begin/end trace statement in snap scheduler

why:
  Allows to trace invoked entity and scheduler state variables
2022-12-09 13:43:55 +00:00
jangko 7bab58731b
simplify test_blockchain_json a bit 2022-12-09 15:26:53 +07:00
jangko 93725bdc02
remove clique unused code 2022-12-09 11:26:14 +07:00
jangko b16b35caea
cleanup unused txpool unused code 2022-12-09 11:26:14 +07:00
jangko 718f4991cf
eliminate github action warning by upgrading to v3
also change deprecated `set-output` to $GITHUB_OUTPUT
2022-12-08 16:21:43 +07:00
jangko d2381b6536
eliminate simulators ci warning 2022-12-08 13:21:15 +07:00
jangko 4287a31961
fix t8n compiler switch when evmc_enabled 2022-12-08 13:20:23 +07:00
jangko a57471197f
update t8n tool testdata 2022-12-08 13:20:23 +07:00
jangko 490b2f8023
fix t8n tool tx and env parser 2022-12-08 13:20:23 +07:00
jangko ed518c760f
fix t8n does not support BLOCKHASH opcode 2022-12-08 13:20:22 +07:00
jangko 05584a21b9
fix t8n 0-touch reward on pre EIP150 networks 2022-12-08 12:20:01 +07:00
jangko 505091597a
add debug(tx) in utils/debug 2022-12-07 23:11:03 +07:00
Jordan Hrycaj 3766eddf5a
Some updates to the envelope module (#1353)
details:
+ Add detailed error return codes
+ Remove cruft
+ Some prototype wrappers
2022-12-06 20:13:31 +00:00
Jordan Hrycaj 85de03fd6e
Rename and update dismantle => hexaryEnvelopeDecompose() (#1351)
* Rename and update dismantle => hexaryEnvelopeDecompose()

why:
+ As for naming, a positive connotation is prefered
+ The unit tests were really insufficient
+ The function result was wrong on a few boundry conditions

detail:
+ Extracted the function from `hexary_paths.nim` and re-implemented
  it together with other envelope functions => `hexary_envelope.nim`
+ Re-wrote docu for `hexaryEnvelopeDecompose()`

* Relaxed right condition for `hexaryEnvelopeDecompose()` range argument

why;
  Previously, the right point of the argument interval had to be a path
  to an allocated leaf node. While this is typically a given for accounts,
  it is easier to require an arbitrary range of paths (or keys) with
  the requirement of a `boundary proof` for left and right (i.e. enough
  nodes in the database to find the end points.)

also:
  Bug fixes for related functions (typos, missing conditions etc.)

* Add missing unit tests include file
2022-12-06 17:35:56 +00:00
jangko a26a9f9ece
fix txpool: using consensus rule to prepare header 2022-12-06 16:43:00 +07:00
jangko b81511fcfc
move poa and pow from ChainRef to CommonRef 2022-12-06 16:42:55 +07:00
jangko 53e71e8837
better hardForkTransition usage 2022-12-05 15:46:37 +07:00
jangko 4cf2ab661c
connect legacy sync to rpc/eth_syncing and graphql/syncing
fix #1333
2022-12-05 10:25:21 +07:00
jangko 56f169b23e
rename Fast Sync to Legacy Sync
fix #1332
2022-12-05 09:42:25 +07:00
KonradStaniec f4cacdfc6a
bump nimbus-eth2 (#1345)
* bump nimbus-eth2
2022-12-02 16:09:31 +01:00
jangko 94a94c5b65 implement better hardfork management 2022-12-02 13:51:42 +07:00
jangko ac2cb82a2b saner source code grouping 2022-12-02 13:51:42 +07:00
KonradStaniec e78110202b
bump nim-eth (#1342) 2022-11-30 12:05:41 +01:00
Jordan Hrycaj 44a57496d9
Snap sync interval complement method to speed up trie perusal (#1328)
* Add quick hexary trie inspector, called `dismantle()`

why:
+ Full hexary trie perusal is slow if running down leaf nodes
+ For known range of leaf nodes, work out the UInt126-complement of
  partial sub-trie paths (for existing nodes). The result should cover
  no (or only a few) sub-tries with leaf nodes.

* Extract common healing methods => `sub_tries_helper.nim`

details:
  Also apply quick hexary trie inspection tool `dismantle()`
  Replace `inspectAccountsTrie()` wrapper by `hexaryInspectTrie()`

* Re-arrange task dispatching in main peer worker

* Refactor accounts and storage slots downloaders

* Rename `HexaryDbError` => `HexaryError`
2022-11-28 09:03:23 +00:00
Etan Kissling bc3f164b97
bump `nim-eth` for `withdrawalsRoot` support (#1326)
The `BlockHeader` structure in `nim-eth` was updated with support for
EIP-4895 (withdrawals). To enable the `nim-eth` bump, the ingress of
`BlockHeader` structures has been hardened to reject headers that have
the new `withdrawalsRoot` field until proper withdrawals support exists.
https://github.com/status-im/nim-eth/pull/562
2022-11-26 15:59:19 +01:00
Jordan Hrycaj 7688148565
Snap sync can start on saved checkpoint (#1327)
* Stop negotiating pivot if peer repeatedly replies w/usesless answers

why:
  There is some fringe condition where a peer replies with legit but
  useless empty headers repetely. This goes on until somebody stops.
  We stop now.

* Rename `missingNodes` => `sickSubTries`

why:
  These (probably missing) nodes represent in reality fully or partially
  missing sub-tries. The top nodes may even exist, e.g. as a shallow
  sub-trie.

also:
  Keep track of account healing on/of by bool variable `accountsHealing`
  controlled in `pivot_helper.execSnapSyncAction()`

* Add `nimbus` option argument `snapCtx` for starting snap recovery (if any)

also:
+ Trigger the recovery (or similar) process from inside the global peer
  worker initialisation `worker.setup()` and not by the `snap.start()`
  function.
+ Have `runPool()` returned a `bool` code to indicate early stop to
  scheduler.

* Can import partial snap sync checkpoint at start

details:
 + Modified what is stored with the checkpoint in `snapdb_pivot.nim`
 + Will be loaded within `runDaemon()` if activated

* Forgot to import total coverage range

why:
  Only the top (or latest) pivot needs coverage but the total coverage
  is the list of all ranges for all pivots -- simply forgotten.
2022-11-25 14:56:42 +00:00
jangko 66439d69ca
unify chain config parser of t8n, bc test, and consensus simulator 2022-11-25 12:26:29 +07:00
Kim De Mey 73ad6e86f8
Several clean-ups in nimbus_verified_proxy (#1324)
- clean-up config a bit and remove deprecated log-file
- style fixes
- a bit of error msg & logging clean-up and add missing log
- ...
2022-11-24 14:41:00 +01:00
Kim De Mey 99769cc0e1
Rename lc_proxy to nimbus_verified_proxy (#1321)
* Change Light client proxy naming to verified proxy naming in code

* Rename the lc_proxy files to the verified proxy naming

* Update to the verified proxy name in the docs
2022-11-23 17:11:38 +01:00
jangko 7381ee8ff9 t8n tool support --state.reward -1
fixes #1313
2022-11-23 19:49:58 +07:00
KonradStaniec 52a2ba4bd7
Handle blocks from cache (#1312)
* Handle blocks from cache
2022-11-23 12:46:09 +01:00
KonradStaniec e56bd994ff
Add eth_getCode to lc proxy (#1310) 2022-11-21 13:28:15 +01:00
KonradStaniec 4b497ec3ca
bump nim-web3 (#1309) 2022-11-21 08:02:15 +01:00
Kim De Mey 9da1e7b755
Update Nimbus Light Client Proxy documentation (#1308) 2022-11-18 14:37:22 +01:00
KonradStaniec 5374e7d37f
Initial implementation of getting range of lc updates (#1301)
* Initial implementation of getting lc updates
2022-11-18 10:00:06 +01:00
jangko 6b28b64395
update hive statistics 2022-11-18 11:58:04 +07:00
jangko fffe071f86
eth wire protocol: implement NewBlock and NewBlockHashes handler
and it also do invasive changes to fast sync because
they are tightly related.

fix #673
2022-11-18 01:22:31 +07:00
jangko c3e8f951b2
enable chronicles runtime filtering of t8n and evmstate tools 2022-11-18 00:56:23 +07:00
Kim De Mey ced7db901b
Bump nim-eth module for bug fixes in RLPx (#1306)
- RLP Enum DisconnectionReason deserialization fixes
- RLPx auth RangeError fixes
2022-11-17 13:52:55 +01:00
jangko acad1e86bc
upgrade github actions/cache and actions/checkout to v3
Also change ::set-output usage to $GITHUB_OUTPUT.
This commit goal is to eliminate warnings in github actions
summary page.
2022-11-17 09:52:07 +07:00
Jordan Hrycaj bba1bea4c8
Snap sync state save (#1302)
* Piecemeal trie inspection

details:
  Trie inspection will stop after maximum number of nodes visited.
  The inspection can be resumed using the returned state from the
  last session.

why:
  This feature allows for task switch between `piecemeal` sessions.

* Extract pivot helper code from `worker.nim` => `pivot_helper.nim`

* Accounts import will now return dangling paths from `proof` nodes

why:
  With proper bookkeeping, this can be used to start healing without
  analysing the the probably full trie.

* Update `unprocessed` account range handling

why:
  More generally, the API of a pairs of unprocessed intervals favours
  the first set and not before that is exhausted the second set comes
  into play.

  This was unfortunately implemented which caused the ranges to be
  unnecessarily fractioned. Now the number of range interval typically
  remains in the lower single digit numbers.

* Save sync state after end of downloading some accounts

details:
  restore/resume to be implemented later
2022-11-16 23:51:06 +00:00
jangko f59e5b63e3
update t8n and evmstate tools readme.md 2022-11-15 10:50:12 +07:00
jangko 12e5b6460e
fix t8n tool copyright banner 2022-11-15 10:49:41 +07:00
Jordan Hrycaj 9aa925cf36
Update sync scheduler (#1297)
* Add `stop()` methods to shutdown to shutdown procedure

why:
  Nasty behaviour when hitting Ctrl-C, otherwise

* Add background service to sync scheduler

why:
  The background service will be used for sync data import and recovery
  after restart.

   It is controlled by the sync scheduler for an easy turn/on off API.

also:
  Simplified snap ticker time calc.

* Fix typo
2022-11-14 14:13:00 +00:00
jangko 43f4b99a1b
disable NewBlockHashes and NewBlock of eth wire handler after POS transition
fix #1133
2022-11-14 16:17:34 +07:00