nimbus-eth1/nimbus/vm2
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 provide identical copy of vm folder => vm2, activated by make flag ENABLE_VM2=1 2021-04-23 14:04:06 +03:00
blscurve.nim provide identical copy of vm folder => vm2, activated by make flag ENABLE_VM2=1 2021-04-23 14:04:06 +03:00
code_stream.nim eliminated v2opcode_values, v2forks in favour of op_codes, forks_list 2021-04-28 15:24:14 +03:00
computation.nim Redesign of BaseVMState descriptor (#923) 2022-01-18 16:19:32 +00:00
interpreter_dispatch.nim EVM: `writeContract` fixes, never return contract code as `RETURNDATA` 2021-12-12 16:34:13 +07:00
map_to_curve_g1.nim provide identical copy of vm folder => vm2, activated by make flag ENABLE_VM2=1 2021-04-23 14:04:06 +03:00
memory.nim re-named some v2*.nim sources to its original name *.nim (without the v2) 2021-04-28 15:24:14 +03:00
message.nim re-named some v2*.nim sources to its original name *.nim (without the v2) 2021-04-28 15:24:14 +03:00
nimdoc.cfg update doc generator 2021-04-28 15:24:14 +03:00
precompiles.nim Tracing: Remove some trace messages that occur a lot during sync 2021-07-27 14:12:55 +01:00
stack.nim re-named some v2state_transactions.nim to its original name without the v2 2021-04-28 15:24:14 +03:00
state.nim Redesign of BaseVMState descriptor (#923) 2022-01-18 16:19:32 +00:00
state_transactions.nim Redesign of BaseVMState descriptor (#923) 2022-01-18 16:19:32 +00: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