nimbus-eth1/nimbus/vm
Jordan Hrycaj 261c0b51a7
Redesign of BaseVMState descriptor (#923)
* Redesign of BaseVMState descriptor

why:
  BaseVMState provides an environment for executing transactions. The
  current descriptor also provides data that cannot generally be known
  within the execution environment, e.g. the total gasUsed which is
  available not before after all transactions have finished.

  Also, the BaseVMState constructor has been replaced by a constructor
  that does not need pre-initialised input of the account database.

also:
  Previous constructor and some fields are provided with a deprecated
  annotation (producing a lot of noise.)

* Replace legacy directives in production sources

* Replace legacy directives in unit test sources

* fix CI (missing premix update)

* Remove legacy directives

* chase CI problem

* rebased

* Re-introduce 'AccountsCache' constructor optimisation for 'BaseVmState' re-initialisation

why:
  Constructing a new 'AccountsCache' descriptor can be avoided sometimes
  when the current state root is properly positioned already. Such a
  feature existed already as the update function 'initStateDB()' for the
  'BaseChanDB' where the accounts cache was linked into this desctiptor.

  The function 'initStateDB()' was removed and re-implemented into the
  'BaseVmState' constructor without optimisation. The old version was of
  restricted use as a wrong accounts cache state would unconditionally
  throw an exception rather than conceptually ask for a remedy.

  The optimised 'BaseVmState' re-initialisation has been implemented for
  the 'persistBlocks()' function.

also:
  moved some test helpers to 'test/replay' folder

* Remove unused & undocumented fields from Chain descriptor

why:
  Reduces attack surface in general & improves reading the code.
2022-01-18 16:19:32 +00:00
..
interpreter EVM: `writeContract` fixes, never return contract code as `RETURNDATA` 2021-12-12 16:34:13 +07:00
blake2b_f.nim implement EIP-152 2019-11-12 15:51:48 +00:00
blscurve.nim bump submodules 2021-01-20 11:50:07 +07:00
code_stream.nim reset explicit import paths for local modules 2021-04-01 12:53:22 +01:00
computation.nim Redesign of BaseVMState descriptor (#923) 2022-01-18 16:19:32 +00:00
evmc_api.nim EVMC: Add missing EIP-2929 (Berlin) functions to EVMC host 2021-08-11 19:47:34 +07:00
evmc_helpers.nim EVMC: Byte-endian conversions for 256-bit numeric values 2021-12-10 16:23:27 +00:00
evmc_host.nim Redesign of BaseVMState descriptor (#923) 2022-01-18 16:19:32 +00:00
interpreter.nim EVM: Remove `vm_forks` everywhere, use common forks list instead 2021-06-08 15:36:31 +01:00
interpreter_dispatch.nim code cleanup removed unused imports 2021-08-18 10:35:36 +07:00
map_to_curve_g1.nim more eip2537 cleanup 2020-12-02 15:15:58 +07:00
memory.nim reset explicit import paths for local modules 2021-04-01 12:53:22 +01:00
message.nim reset explicit import paths for local modules 2021-04-01 12:53:22 +01:00
precompiles.nim Tracing: Remove some trace messages that occur a lot during sync 2021-07-27 14:12:55 +01:00
stack.nim reset explicit import paths for local modules 2021-04-01 12:53:22 +01:00
state.nim Redesign of BaseVMState descriptor (#923) 2022-01-18 16:19:32 +00:00
state_transactions.nim code cleanup removed unused imports 2021-08-18 10:35:36 +07:00
transaction_tracer.nim move stateDB from VMState to chainDB 2021-10-28 18:57:08 +07:00
types.nim Redesign of BaseVMState descriptor (#923) 2022-01-18 16:19:32 +00:00