Commit Graph

10 Commits

Author SHA1 Message Date
Jacek Sieka 768307d91d
Cache code and invalid jump destination tables (fixes #2268) (#2404)
It is common for many accounts to share the same code - at the database
level, code is stored by hash meaning only one copy exists per unique
program but when loaded in memory, a copy is made for each account.

Further, every time we execute the code, it must be scanned for invalid
jump destinations which slows down EVM exeuction.

Finally, the extcodesize call causes code to be loaded even if only the
size is needed.

This PR improves on all these points by introducing a shared
CodeBytesRef type whose code section is immutable and that can be shared
between accounts. Further, a dedicated `len` API call is added so that
the EXTCODESIZE opcode can operate without polluting the GC and code
cache, for cases where only the size is requested - rocksdb will in this
case cache the code itself in the row cache meaning that lookup of the
code itself remains fast when length is asked for first.

With 16k code entries, there's a 90% hit rate which goes up to 99%
during the 2.3M attack - the cache significantly lowers memory
consumption and execution time not only during this event but across the
board.
2024-06-21 09:44:10 +02:00
jangko b0000eed8b
Add check copyright year linter to CI 2023-11-01 10:41:20 +07:00
Ștefan Talpalaru 0b98747888
Nimbus-Grafana-dashboard.json: gauge panel fix 2019-10-02 19:02:06 +02:00
Ștefan Talpalaru 36d1afe131
example Grafana dashboard + nim-metrics bump [skip ci] 2019-10-02 02:41:59 +02:00
Ștefan Talpalaru 2d9f62530b metrics HTTP server replacing the periodic "stats" logging
and example prometheus.yml file to use it as a scraping target
2019-07-19 15:17:51 +03:00
mratsim ca5eba20f8 update example 2018-07-17 19:18:59 +02:00
Mark Spanbroek cb36a0c18d Fix import in example 2018-06-19 21:15:43 +02:00
Yuriy Glukhov 51b572d8b8 Some renames 2018-05-28 13:22:28 +03:00
mratsim 165b1872a6 Update the smart contract decompiler example 2018-05-18 12:57:55 +02:00
Alexander Ivanov 0d31382e3d Work on text fitures and decompiling bytecode 2018-02-12 18:59:50 +02:00