nimbus-eth1/nimbus
Jordan Hrycaj cfe955c962
Feature/implement poa processing (#748)
* re-shuffled Clique functions

why:
  Due to the port from the go-sources, the interface logic is not optimal
  for nimbus. The main visible function is currently snapshot() and most
  of the _procurement_ of this function result has been moved to a
  sub-directory.

* run eip-225 Clique test against p2p/chain.persistBlocks()

why:
  Previously, loading the test block chains was fugdged with the purpose
  only to fill the database. As it is now clear how nimbus works on
  Goerli, the same can be achieved with a more realistic scenario.

details:
  Eventually these tests will be pre-cursor to the reply tests for the
  Goerli chain supporting TDD approach with more simple cases.

* fix exception annotations for executor module

why:
  needed for exception tracking

details:
  main annoyance are vmState methods (in state.nim) which potentially
  throw a base level Exception (a proc would only throws CatchableError)

* split p2p/chain into sub-modules and fix exception annotations

why:
  make space for implementing PoA stuff

* provide over-loadable Clique PRNG

why:
  There is a PRNG provided for generating reproducible number sequences.
  The functions which employ the PRNG to generate time slots were ported
  ported from the go-implementation. They are currently unused.

* implement trusted signer assembly in p2p/chain.persistBlocks()

details:
  * PoA processing moved there at the end of a transaction. Currently,
   there is no action (eg. transaction rollback) if this fails.
  * The unit tests with staged blocks work ok. In particular, there should
    be tests with to-be-rejected blocks.
  * TODO: 1.Optimise throughput/cache handling; 2.Verify headers

* fix statement cast in pool.nim

* added table features to LRU cache

why:
  Clique uses the LRU cache using a mixture of volatile online items
  from the LRU cache and database checkpoints for hard synchronisation.
  For performance, Clique needs more table like features.

details:
  First, last, and query key added, as well as efficient random delete
  added. Also key-item pair iterator added for debugging.

* re-factored LRU snapshot caching

why:
  Caching was sub-optimal (aka. bonkers) in that it skipped over memory
  caches in many cases and so mostly rebuild the snapshot from the
  last on-disk checkpoint.

details;
  The LRU snapshot toValue() handler has been moved into the module
  clique_snapshot. This is for the fact that toValue() is not supposed
  to see the whole LRU cache database. So there must be a higher layer
  working with the the whole LRU cache and the on-disk checkpoint
  database.

also:
  some clean up

todo:
  The code still assumes that the block headers are valid in itself. This
  is particular important when an epoch header (aka re-sync header) is
  processed as it must contain the PoA result of all previous headers.

  So blocks need to be verified when they come in before used for PoA
  processing.

* fix some snapshot cache fringe cases

why:
  Must not index empty sequences in clique_snapshot module
2021-07-14 16:13:27 +01:00
..
db Eip225 clique/PoA consensus protocol 2021-06-17 08:03:57 +01:00
graphql preparation for EIP-1559 implementation 2021-06-29 07:33:48 +07:00
p2p Feature/implement poa processing (#748) 2021-07-14 16:13:27 +01:00
rpc preparation for EIP-1559 implementation 2021-06-29 07:33:48 +07:00
transaction EIP-3529: Replace SSTORE_CLEARS_SCHEDULE in evmc host_service 2021-06-30 20:35:10 +07:00
utils Feature/implement poa processing (#748) 2021-07-14 16:13:27 +01:00
vm EIP-3541: Fixes typo, 0xFE -> 0xEF 2021-06-30 20:44:34 +07:00
vm2 EIP-3541: Fixes typo, 0xFE -> 0xEF 2021-06-30 20:44:34 +07:00
block_types.nim reduce compiler warnings 2019-11-13 21:49:39 +07:00
chain_config.nim EIP-1559: Fee market change for ETH 1.0 chain 2021-06-30 20:30:39 +07:00
conf_utils.nim Jordan/fix some failing nohive tests (#727) 2021-06-24 16:29:21 +01:00
config.nim preparation for London hard fork 2021-06-29 07:34:45 +07:00
constants.nim Clear up meaning of `ZERO_ADDRESS`, delete `CREATE_CONTRACT_ADDRESS` 2021-05-27 12:14:51 +01:00
errors.nim remove unused eraseReturnData 2020-01-20 18:36:58 +02:00
forks.nim preparation for London hard fork 2021-06-29 07:34:45 +07:00
genesis.nim EIP-1559: Fee market change for ETH 1.0 chain 2021-06-30 20:30:39 +07:00
genesis_alloc.nim add goerli testnet genesis data[skip ci] 2020-04-09 19:13:17 +03:00
launcher.nim Premix-related changes 2019-01-28 12:38:23 +02:00
lightchain_shell.nim
makefile Basic tests for Clique PoA/Consensus engine 2021-06-17 08:03:57 +01:00
nim.cfg
nimbus.nim Whisper: Remove all the main Whisper code (config, startup, RPC etc) 2021-06-01 18:12:48 +01:00
random_keys.nim move rng to configuration 2020-07-21 00:16:59 +07:00
tracer.nim Feature/goerli replay clique poa (#743) 2021-07-06 14:14:45 +01:00
transaction.nim EIP-3529: Reduce the max gas refunded after a transaction 2021-06-29 07:37:17 +07:00
utils.nim implement more eth rpc and keystore management 2020-07-23 14:54:32 +07:00
validation.nim reduce compiler warnings 2019-11-13 21:49:39 +07:00
vm_compile_info.nim print compiler warning about the VM used 2021-04-28 15:24:14 +03:00
vm_computation.nim EVM: Apply EIP-6 in the code (affects both vm and vm2) 2021-06-08 15:36:30 +01:00
vm_gas_costs.nim EIP-3529: Replace SSTORE_CLEARS_SCHEDULE 2021-06-29 07:37:17 +07:00
vm_internals.nim vm2: Remove vm2 `forks_list` everywhere, use common forks list 2021-06-08 15:36:31 +01:00
vm_precompiles.nim re-named some v2*.nim sources to its original name *.nim (without the v2) 2021-04-28 15:24:14 +03:00
vm_state.nim EIP-1559: Fee market change for ETH 1.0 chain 2021-06-30 20:30:39 +07:00
vm_state_transactions.nim Transaction: Prepare txRefundGas to support txCallEvm 2021-05-03 19:51:20 +01:00
vm_types.nim re-named some v2*.nim sources to its original name *.nim (without the v2) 2021-04-28 15:24:14 +03:00