2019-11-20 15:25:09 +00:00
|
|
|
# Nimbus
|
Core db and aristo updates for destructor and tx logic (#1894)
* Disable `TransactionID` related functions from `state_db.nim`
why:
Functions `getCommittedStorage()` and `updateOriginalRoot()` from
the `state_db` module are nowhere used. The emulation of a legacy
`TransactionID` type functionality is administratively expensive to
provide by `Aristo` (the legacy DB version is only partially
implemented, anyway).
As there is no other place where `TransactionID`s are used, they will
not be provided by the `Aristo` variant of the `CoreDb`. For the
legacy DB API, nothing will change.
* Fix copyright headers in source code
* Get rid of compiler warning
* Update Aristo code, remove unused `merge()` variant, export `hashify()`
why:
Adapt to upcoming `CoreDb` wrapper
* Remove synced tx feature from `Aristo`
why:
+ This feature allowed to synchronise transaction methods like begin,
commit, and rollback for a group of descriptors.
+ The feature is over engineered and not needed for `CoreDb`, neither
is it complete (some convergence features missing.)
* Add debugging helpers to `Kvt`
also:
Update database iterator, add count variable yield argument similar
to `Aristo`.
* Provide optional destructors for `CoreDb` API
why;
For the upcoming Aristo wrapper, this allows to control when certain
smart destruction and update can take place. The auto destructor works
fine in general when the storage/cache strategy is known and acceptable
when creating descriptors.
* Add update option for `CoreDb` API function `hash()`
why;
The hash function is typically used to get the state root of the MPT.
Due to lazy hashing, this might be not available on the `Aristo` DB.
So the `update` function asks for re-hashing the gurrent state changes
if needed.
* Update API tracking log mode: `info` => `debug
* Use shared `Kvt` descriptor in new Ledger API
why:
No need to create a new descriptor all the time
2023-11-16 19:35:03 +00:00
|
|
|
# Copyright (c) 2018-2023 Status Research & Development GmbH
|
2019-11-20 15:25:09 +00:00
|
|
|
# Licensed under either of
|
|
|
|
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
|
|
|
|
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
|
|
|
|
# XXX: when all but a relative few dozen, say, GeneralStateTests run, remove this,
|
|
|
|
# but for now, this enables some CI use before that to prevent regressions. In the
|
|
|
|
# separate file here because it would otherwise just distract. Could use all sorts
|
|
|
|
# of O(1) or O(log n) lookup structures, or be more careful to only initialize the
|
|
|
|
# table once, but notion's that it should shrink reasonable quickly and disappear,
|
|
|
|
# being mostly used for short-term regression prevention.
|
|
|
|
|
|
|
|
import strutils
|
|
|
|
|
|
|
|
func slowGSTTests(folder: string, name: string): bool =
|
|
|
|
result = folder == "stQuadraticComplexityTest" or
|
|
|
|
name in @["randomStatetest352.json", "randomStatetest1.json",
|
|
|
|
"randomStatetest32.json", "randomStatetest347.json",
|
|
|
|
"randomStatetest393.json", "randomStatetest626.json",
|
|
|
|
"CALLCODE_Bounds.json", "DELEGATECALL_Bounds3.json",
|
|
|
|
"CALLCODE_Bounds4.json", "CALL_Bounds.json",
|
|
|
|
"DELEGATECALL_Bounds2.json", "CALL_Bounds3.json",
|
|
|
|
"CALLCODE_Bounds2.json", "CALLCODE_Bounds3.json",
|
|
|
|
"DELEGATECALL_Bounds.json", "CALL_Bounds2a.json",
|
|
|
|
"CALL_Bounds2.json",
|
|
|
|
"CallToNameRegistratorMemOOGAndInsufficientBalance.json",
|
|
|
|
"CallToNameRegistratorTooMuchMemory0.json",
|
|
|
|
|
|
|
|
# all these tests below actually pass
|
|
|
|
# but they are very slow
|
|
|
|
|
|
|
|
# constantinople slow tests
|
|
|
|
"Create2Recursive.json",
|
|
|
|
|
|
|
|
# byzantium slow tests
|
|
|
|
"LoopCallsDepthThenRevert3.json",
|
|
|
|
"LoopCallsDepthThenRevert2.json",
|
|
|
|
"LoopCallsDepthThenRevert.json",
|
|
|
|
"static_Call50000.json",
|
|
|
|
"static_Call50000_ecrec.json",
|
|
|
|
"static_Call50000_identity.json",
|
|
|
|
"static_Call50000_identity2.json",
|
|
|
|
"static_Call50000_rip160.json",
|
|
|
|
"static_Call50000_sha256.json",
|
|
|
|
"LoopCallsThenRevert.json",
|
|
|
|
"LoopDelegateCallsDepthThenRevert.json",
|
|
|
|
"recursiveCreateReturnValue.json",
|
|
|
|
"static_Call1024PreCalls2.json",
|
|
|
|
"Callcode1024BalanceTooLow.json",
|
|
|
|
"static_Call1024BalanceTooLow.json",
|
|
|
|
"static_Call1024BalanceTooLow2.json",
|
|
|
|
"static_Call1024OOG.json",
|
|
|
|
"static_Call1024PreCalls3.json",
|
|
|
|
"static_Call1024PreCalls.json",
|
|
|
|
"static_Call1MB1024Calldepth.json",
|
|
|
|
|
|
|
|
# Homestead recursives
|
|
|
|
"ContractCreationSpam.json",
|
|
|
|
"Call1024OOG.json",
|
|
|
|
"Call1024PreCalls.json",
|
|
|
|
"CallRecursiveBombPreCall.json",
|
|
|
|
"Delegatecall1024.json",
|
|
|
|
"Delegatecall1024OOG.json",
|
|
|
|
"JUMPDEST_Attack.json",
|
|
|
|
"JUMPDEST_AttackwithJump.json",
|
|
|
|
"ABAcalls1.json",
|
|
|
|
"ABAcalls2.json",
|
|
|
|
"CallRecursiveBomb0.json",
|
|
|
|
"CallRecursiveBomb0_OOG_atMaxCallDepth.json",
|
|
|
|
"CallRecursiveBomb1.json",
|
|
|
|
"CallRecursiveBomb2.json",
|
|
|
|
"CallRecursiveBombLog.json",
|
|
|
|
"CallRecursiveBombLog2.json",
|
|
|
|
"Call1024BalanceTooLow.json",
|
|
|
|
|
|
|
|
# Frontier recursives
|
|
|
|
"Callcode1024OOG.json",
|
|
|
|
"callcallcodecall_ABCB_RECURSIVE.json",
|
|
|
|
"callcallcodecallcode_ABCB_RECURSIVE.json",
|
|
|
|
"callcodecallcall_ABCB_RECURSIVE.json",
|
|
|
|
"callcodecallcallcode_ABCB_RECURSIVE.json",
|
|
|
|
"callcodecallcodecall_ABCB_RECURSIVE.json",
|
|
|
|
"callcodecallcodecallcode_ABCB_RECURSIVE.json",
|
2019-12-09 09:35:58 +00:00
|
|
|
"callcallcallcode_ABCB_RECURSIVE.json",
|
|
|
|
|
|
|
|
# Istanbul slow tests
|
|
|
|
"CALLBlake2f_MaxRounds.json",
|
2021-06-09 18:47:41 +00:00
|
|
|
"loopMul.json",
|
|
|
|
"loopExp.json",
|
2021-01-11 08:33:30 +00:00
|
|
|
|
2019-11-20 15:25:09 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
func skipGSTTests*(folder: string, name: string): bool =
|
|
|
|
# we skip tests that are slow or expected to fail for now
|
2021-01-06 10:02:19 +00:00
|
|
|
if slowGSTTests(folder, name):
|
|
|
|
return true
|
|
|
|
|
2019-11-20 15:25:09 +00:00
|
|
|
func skipNewGSTTests*(folder: string, name: string): bool =
|
|
|
|
# share the same slow and failing tests
|
|
|
|
if skipGSTTests(folder, name):
|
|
|
|
return true
|
|
|
|
|
|
|
|
func skipVMTests*(folder: string, name: string): bool =
|
|
|
|
result = (folder == "vmPerformance" and "loop" in name)
|
|
|
|
|
|
|
|
func skipBCTests*(folder: string, name: string): bool =
|
2020-02-11 02:28:34 +00:00
|
|
|
name in @[
|
2019-11-20 15:25:09 +00:00
|
|
|
# BlockChain slow tests
|
|
|
|
"SuicideIssue.json",
|
|
|
|
|
2019-12-07 23:55:18 +00:00
|
|
|
# BC huge memory consumption
|
2020-01-10 13:12:44 +00:00
|
|
|
"randomStatetest94.json",
|
2021-01-06 10:02:19 +00:00
|
|
|
"DelegateCallSpam.json",
|
2019-11-20 15:25:09 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
func skipNewBCTests*(folder: string, name: string): bool =
|
2021-01-14 10:20:42 +00:00
|
|
|
if folder in ["vmPerformance"]:
|
2021-01-11 07:54:11 +00:00
|
|
|
return true
|
|
|
|
|
2019-12-08 00:58:39 +00:00
|
|
|
# the new BC tests also contains these slow tests
|
|
|
|
# for Istanbul fork
|
|
|
|
if slowGSTTests(folder, name):
|
|
|
|
return true
|
|
|
|
|
2020-02-11 02:28:34 +00:00
|
|
|
name in @[
|
2019-12-07 23:55:18 +00:00
|
|
|
# BC huge memory consumption
|
2020-01-10 13:12:44 +00:00
|
|
|
"randomStatetest94.json",
|
2021-01-11 08:33:30 +00:00
|
|
|
"DelegateCallSpam.json",
|
2019-11-20 15:25:09 +00:00
|
|
|
]
|
2021-01-11 08:33:30 +00:00
|
|
|
|
|
|
|
func skipPrecompilesTests*(folder: string, name: string): bool =
|
2021-05-16 12:22:01 +00:00
|
|
|
# EIP2565: modExp gas cost
|
|
|
|
# reason: included in berlin
|
|
|
|
# name == "modexp_eip2565.json"
|
|
|
|
return false
|