Commit Graph

84 Commits

Author SHA1 Message Date
andri lim b7365085ae
Implement EIP-7516: BLOBBASEFEE opcode (#1791)
* Implement EIP-7516: BLOBBASEFEE opcode
2023-10-01 14:24:15 +07:00
andri lim dc1dcfb206
EIP-4844: Fix excessBlobGas handling (#1771)
* EIP-4844: Fix excessBlobGas handling

* Change vmState.difficulty to vmState.difficultyOrPrevRandao
2023-09-24 22:25:41 +07:00
jangko 4d207e49ce
Implement plugable EVM tracer
available tracers:
- Legacy tracer
- new Json tracer
2023-08-03 16:45:39 +07:00
jangko 94a94c5b65 implement better hardfork management 2022-12-02 13:51:42 +07:00
jangko a4678a041d
wire evmc to vm2 and drop legacy vm
fixes #445, #1172
2022-09-26 15:16:28 +07:00
jangko cec628e620
cleanup: remove unused accessLogs code from vm_state
they are not used anywhere at present, nor in the future
2021-10-28 11:30:18 +07:00
Jordan Hrycaj ff6921eb1a re-named some v2*.nim sources to its original name *.nim (without the v2)
why:
  the v2 prefix of the file name was used as a visual aid when
  comparing vm2 against vm sources

details:
  all renamed v2*.nim sources compile locally with the -d:kludge:1 flag
  set or without (some work with either)

  only sources not renamed yet: v2state_transactions.nim
2021-04-28 15:24:14 +03:00
Jordan Hrycaj 7b6767c4a3 renamed types.nim, vm_fork.nim, opcode_values.nim => v2*.nim
why:
  these files provide part of the externally accessible interface
  provided by vm_types*.nim. so the new filename indicates that the
  source code belongs to vm2 (rather than vm).
2021-04-23 14:04:06 +03:00
Jordan Hrycaj b4f8450968 provide identical copy of vm folder => vm2, activated by make flag ENABLE_VM2=1
why:
  vm2 enabled by ENABLE_VM2=1 behaves as vm without ENABLE_EVMC=1 until
  it doesn't in some future fatch set. this leaves some wiggle room
  to work on a vm copy without degrading the original implementation.

details:
  + additional make flag ENABLE_VM2=1 (or ENABLE_VM2=0 to explicitely disable)
  + when both flags ENABLE_EVMC=1 and ENABLE_VM2=1 are present, the former
    flag ENABLE_EVMC=1 takes precedence, this is implemented at the NIM
    compiler level for -d:evmc_enabled and -d:vm2_enabled
2021-04-23 14:04:06 +03:00
Jordan Hrycaj 9e365734e6
renamed nvm_ prefixed modules to its original names
why:
  the nvm_ prefix was used inside the vm folder to hide them temporarily
  from the outside world while writing export wrappers. now all
  functionality is accessed via vm_*, rather than vm/* imports.

todo:
  at a later stage the import headers of the vm modules need to get fixed
  to meet style guide standards (as jacek kindly pointed out.)
2021-03-31 17:19:54 +01:00
Jordan Hrycaj ed59f602d5
isolate vm_types as import/export wrapper
details:
  moved original vm_types.nim => vm/nvm_types.nim
2021-03-31 09:48:50 +01:00
Jordan Hrycaj a3db0f41d8
remove relative paths ./ and ../ from import section
why:
  relative paths make sources inherently non-relocatable

details:
  import base is set to the nimbus directoy, so importing ./stack
  from file interpreter.nim becomes vm/stack etc.

caveat:
   a file named nimbus/strformat.nim would clash with strformat (but
   not with std/strformat)
2021-03-30 17:20:43 +01:00
jangko 56bc1205e5
returnStack: use seq[int] instead of Uint256 Stack 2020-11-25 19:09:16 +07:00
jangko e2cd9b20fa
add returnStack to Computation 2020-11-25 16:26:24 +07:00
jangko 165f9fea2e
reduce warnings 2020-07-21 13:15:06 +07:00
jangko f401622782
cache miner address instead of recalculation 2020-06-22 07:48:23 +07:00
jangko bd7e1fe2e5
reuse VMState and AccountsCache for better performance 2020-06-18 13:16:38 +07:00
jangko 7c026e1b48
modify VMState to enable witness data collection 2020-06-06 10:05:11 +07:00
jangko 71514a0a66
replace state_db with accounts_cache 2020-05-30 10:14:59 +07:00
andri lim 0686bb4b6e remove legacy unused code 2020-02-12 17:53:26 +02:00
andri lim d9991b1e8b simplify cash 2020-02-12 17:53:26 +02:00
andri lim 22dff9ff88 remove 'startGas' from 'gasMeter' 2020-02-12 17:53:26 +02:00
andri lim 8564e9532b change 'rawOutput' to 'output' 2020-02-12 17:53:26 +02:00
andri lim 55494f06e5
move 'validateTransaction' from GST into 'processTransaction' 2020-01-24 19:52:55 +07:00
andri lim 933b2dad78 remove code from EVM Message and load code in 'Computation' 2020-01-23 18:07:44 +02:00
andri lim c459879647 only import evmc files when 'evmc_enabled' defined 2020-01-23 18:07:44 +02:00
andri lim 64f0e59487 evmc_enabled compile time flags 2020-01-23 18:07:44 +02:00
andri lim 319e5d8ae9 integrate evmc 'getTxContext' 2020-01-23 18:07:44 +02:00
andri lim c1ef8632b2 move fork and gasCosts from Computation to vmState 2020-01-20 18:36:58 +02:00
andri lim bab359cabf move origin and gasPrice from Message to vmState 2020-01-20 18:36:58 +02:00
andri lim 009aa35dfb remove unused eraseReturnData 2020-01-20 18:36:58 +02:00
andri lim 63e886655b fixes coinbase suicide bugs 2020-01-20 18:36:58 +02:00
andri lim 0b99b76cd1 change 'BaseComputation' to 'Computation' 2020-01-20 18:36:58 +02:00
andri lim 79df931234 simplifies computation.getFork 2020-01-20 18:36:58 +02:00
andri lim d30f434f03 get rid of computation child after execution 2020-01-19 19:17:37 +02:00
andri lim 20a138c270 [skip ci] change 'accountsToDelete' to 'touchedAccounts' 2020-01-19 19:17:37 +02:00
andri lim 8f7597e23b [skip ci] add evmc CallKind to EVM Message 2020-01-19 19:17:37 +02:00
andri lim 836e087984 [skip ci] change storageAddress to contractAddres 2020-01-19 19:17:37 +02:00
andri lim 40ddbca1ee [skip ci] simplify EVM message creation 2020-01-19 19:17:37 +02:00
andri lim 7be6a4ea63 gather suicides from child to parent computation 2019-12-20 16:46:03 +02:00
andri lim c4dcf5da30
reduce compiler warnings 2019-11-13 21:49:39 +07:00
andri lim 15f3a7fe37 remove unused .child from computation 2019-05-13 10:26:28 +03:00
andri lim dd89af6d3d
implement EIP658: receipt status field 2019-04-26 07:31:09 +07:00
Ștefan Talpalaru 29a226da1e
more gcsafe pragmas for Nim HEAD 2019-04-26 00:18:51 +02:00
andri lim 1883472104
fix evm msg contract creation, GST +3 2019-04-18 12:42:37 +07:00
andri lim 7c134b481e
split state clearing in execComputation to processTransaction, GST +5 2019-04-18 08:27:55 +07:00
andri lim 03435c7beb
gst and processTransaction unification 2019-04-18 07:56:57 +07:00
andri lim 039256de6a
more on continuation passsing 2019-04-04 15:21:24 +07:00
andri lim e5cca19e7f
tail call recursion with continuation passing 2019-04-04 11:44:35 +07:00
andri lim 4c0ba876ef
move exception handler deeper in the EVM 2019-04-04 10:50:25 +07:00