Cleanup unused raises in evm/state and other obsolete informations (#2243)

This commit is contained in:
andri lim 2024-05-30 16:03:54 +07:00 committed by GitHub
parent 6a9ca40cc8
commit 0a07425112
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 33 deletions

View File

@ -45,8 +45,7 @@ const
# ------------------------------------------------------------------------------
proc getVmState(c: ChainRef, header: BlockHeader):
Result[BaseVMState, void]
{.gcsafe, raises: [CatchableError].} =
Result[BaseVMState, void] =
if c.vmState.isNil.not:
return ok(c.vmState)

View File

@ -13,7 +13,7 @@
##
## See `core_db/README.md` for implementation details
##
## This module provides a memory datanase only. For providing a persistent
## This module provides a memory database only. For providing a persistent
## constructor, import `db/code_db/persistent` though avoiding to
## unnecessarily link to the persistent backend library (e.g. `rocksdb`)
## when a memory only database is used.
@ -25,13 +25,7 @@ import
export
memory_only
# Default database backend selection. Note that an `Aristo` type backend
# should run on a `LedgerCache` type ledger (will not work with
# `LegacyAccountsCache`.) The `common` module automatically sets that up
# (unless overridden.) Practically, these constants are mainly used for
# setting up DB agnostic unit/integration tests.
#
# Uncomment the below symbols in order to activate the `Aristo` database.
# Default database backend selection.
const DefaultDbMemory* = AristoDbMemory
const DefaultDbPersistent* = AristoDbRocks

View File

@ -26,8 +26,7 @@ proc init(
blockCtx: BlockContext;
com: CommonRef;
tracer: TracerRef,
flags: set[VMFlag] = self.flags)
{.gcsafe.} =
flags: set[VMFlag] = self.flags) =
## Initialisation helper
self.parent = parent
self.blockCtx = blockCtx
@ -38,7 +37,7 @@ proc init(
self.flags = flags
func blockCtx(com: CommonRef, header: BlockHeader):
BlockContext {.gcsafe, raises: [CatchableError].} =
BlockContext =
BlockContext(
timestamp : header.timestamp,
gasLimit : header.gasLimit,
@ -64,8 +63,7 @@ proc new*(
parent: BlockHeader; ## parent header, account sync position
blockCtx: BlockContext;
com: CommonRef; ## block chain config
tracer: TracerRef = nil): T
{.gcsafe.} =
tracer: TracerRef = nil): T =
## Create a new `BaseVMState` descriptor from a parent block header. This
## function internally constructs a new account state cache rooted at
## `parent.stateRoot`
@ -84,8 +82,7 @@ proc new*(
proc reinit*(self: BaseVMState; ## Object descriptor
parent: BlockHeader; ## parent header, account sync pos.
blockCtx: BlockContext
): bool
{.gcsafe.} =
): bool =
## Re-initialise state descriptor. The `LedgerRef` database is
## re-initilaise only if its `rootHash` doe not point to `parent.stateRoot`,
## already. Accumulated state data are reset.
@ -116,8 +113,7 @@ proc reinit*(self: BaseVMState; ## Object descriptor
proc reinit*(self: BaseVMState; ## Object descriptor
parent: BlockHeader; ## parent header, account sync pos.
header: BlockHeader; ## header with tx environment data fields
): bool
{.gcsafe, raises: [CatchableError].} =
): bool =
## Variant of `reinit()`. The `parent` argument is used to sync the accounts
## cache and the `header` is used as a container to pass the `timestamp`,
## `gasLimit`, and `fee` values.
@ -131,8 +127,7 @@ proc reinit*(self: BaseVMState; ## Object descriptor
proc reinit*(self: BaseVMState; ## Object descriptor
header: BlockHeader; ## header with tx environment data fields
): bool
{.gcsafe, raises: [CatchableError].} =
): bool =
## This is a variant of the `reinit()` function above where the field
## `header.parentHash`, is used to fetch the `parent` BlockHeader to be
## used in the `update()` variant, above.
@ -147,8 +142,7 @@ proc init*(
parent: BlockHeader; ## parent header, account sync position
header: BlockHeader; ## header with tx environment data fields
com: CommonRef; ## block chain config
tracer: TracerRef = nil)
{.gcsafe, raises: [CatchableError].} =
tracer: TracerRef = nil) =
## Variant of `new()` constructor above for in-place initalisation. The
## `parent` argument is used to sync the accounts cache and the `header`
## is used as a container to pass the `timestamp`, `gasLimit`, and `fee`
@ -168,8 +162,7 @@ proc new*(
parent: BlockHeader; ## parent header, account sync position
header: BlockHeader; ## header with tx environment data fields
com: CommonRef; ## block chain config
tracer: TracerRef = nil): T
{.gcsafe, raises: [CatchableError].} =
tracer: TracerRef = nil): T =
## This is a variant of the `new()` constructor above where the `parent`
## argument is used to sync the accounts cache and the `header` is used
## as a container to pass the `timestamp`, `gasLimit`, and `fee` values.
@ -202,8 +195,7 @@ proc init*(
vmState: BaseVMState;
header: BlockHeader; ## header with tx environment data fields
com: CommonRef; ## block chain config
tracer: TracerRef = nil): bool
{.gcsafe, raises: [CatchableError].} =
tracer: TracerRef = nil): bool =
## Variant of `new()` which does not throw an exception on a dangling
## `BlockHeader` parent hash reference.
var parent: BlockHeader

View File

@ -18,12 +18,7 @@ const
VmName* = vmName()
warningMsg = block:
var rc = "*** Compiling with " & VmName
when defined(eth66_enabled):
rc &= ", eth/66"
when defined(eth67_enabled):
rc &= ", eth/67"
when defined(eth68_enabled):
rc &= ", eth/68"
rc &= ", eth/68"
when defined(chunked_rlpx_enabled):
rc &= ", chunked-rlpx"
when defined(boehmgc):