Commit Graph

17 Commits

Author SHA1 Message Date
Jamie Lokier 74f53c7761
EVMC: Add missing EIP-2929 (Berlin) functions to EVMC host
The update for London (EIP-1559) in 1cdb30df ("bump nim-emvc with evmc revision
8.0.0 to 9.0.0") really bumped EVMC ABI version from 7.5 up to 9.

In other words, it skipped Berlin, going direct from Istanbul to London.

That was accompanied by EVMC changes in 05e9b891 ("EIP-3198: add baseFee op
code in nim-evm"), which added the API changes needed for London.

But the missing Berlin functions weren't added in the move to London.

As a result, our EVMC host became incompatible with Berlin, London, and really
all revisions of the ABI, and if a third party EVM was loaded, it crashed.

This commit adds the missing Berlin host support, and makes our ABI
binary-compatible with real EVMC again.

Signed-off-by: Jamie Lokier <jamie@shareable.org>
2021-08-11 19:47:34 +07:00
jangko 5159ad7aac
preparation for London hard fork
This preparation is needed for subsequent
EIPs included in London.

- Add London to Fork enum
- Block number to fork
- Parsing London fork in chain config
- Prepare gas costs table for London
- Prepare EVM opcode dispatcher for London
- Block rewards for London
- Prepare hive script for London
2021-06-29 07:34:45 +07:00
Jordan Hrycaj 827b8c9c81
reset explicit import paths for local modules
why:
  it was convenient to have relocatable source modules when writing the
  vm interface wrappers. this patch moves it back to the standard.

also:
  there are no deep links into the vm folder anymore which leaves some
  room for manoeuvring inside
2021-04-01 12:53:22 +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
andri lim fff35ab01d implement evmc create/create2 2020-02-12 17:53:26 +02:00
andri lim 95edc54b46 fixes gcsafe overrides and reduce unnecessary evmc conversion 2020-01-23 18:07:44 +02:00
andri lim 4aa209113a integrate evmc 'setStorage' 2020-01-23 18:07:44 +02:00
andri lim 62f96e9bd4 integrate evmc 'emitLog' 2020-01-23 18:07:44 +02:00
andri lim 295d2c180b integrate evmc 'selfDestruct' and 'copyCode' 2020-01-23 18:07:44 +02:00
andri lim 8a9d9114e7 integrate evmc 'getCodeHash' 2020-01-23 18:07:44 +02:00
andri lim 5507e80b63 integrate evmc 'getCodeSize' 2020-01-23 18:07:44 +02:00
andri lim 8c53371c49 integrate evmc 'getBalance' 2020-01-23 18:07:44 +02:00
andri lim fdbc888840 integrate evmc 'getStorage' 2020-01-23 18:07:44 +02:00
andri lim a4a1148a45 integrate evmc 'accountExists' 2020-01-23 18:07:44 +02:00
andri lim 1813579bc4 integrate evmc 'getBlockHash' 2020-01-23 18:07:44 +02:00
andri lim 319e5d8ae9 integrate evmc 'getTxContext' 2020-01-23 18:07:44 +02:00
andri lim e25f2bb82f evmc host implementation 2020-01-23 18:07:44 +02:00