2018-04-06 14:52:10 +00:00
|
|
|
# Nimbus
|
|
|
|
# Copyright (c) 2018 Status Research & Development GmbH
|
|
|
|
# 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.
|
|
|
|
|
2018-01-29 17:40:22 +00:00
|
|
|
import
|
2023-08-04 11:10:09 +00:00
|
|
|
std/[sets, strformat],
|
|
|
|
chronicles,
|
|
|
|
eth/[common, rlp],
|
|
|
|
../constants,
|
|
|
|
../utils/utils,
|
|
|
|
"."/[core_db, distinct_tries, storage_types]
|
2018-08-23 03:38:00 +00:00
|
|
|
|
|
|
|
logScope:
|
|
|
|
topics = "state_db"
|
2018-01-29 17:40:22 +00:00
|
|
|
|
2020-02-19 10:27:14 +00:00
|
|
|
# aleth/geth/parity compatibility mode:
|
|
|
|
#
|
|
|
|
# affected test cases both in GST and BCT:
|
|
|
|
# - stSStoreTest\InitCollision.json
|
|
|
|
# - stRevertTest\RevertInCreateInInit.json
|
|
|
|
# - stCreate2\RevertInCreateInInitCreate2.json
|
|
|
|
#
|
|
|
|
# pyEVM sided with original Nimbus EVM
|
|
|
|
#
|
|
|
|
# implementation difference:
|
|
|
|
# Aleth/geth/parity using accounts cache.
|
|
|
|
# When contract creation happened on an existing
|
|
|
|
# but 'empty' account with non empty storage will
|
|
|
|
# get new empty storage root.
|
|
|
|
# Aleth cs. only clear the storage cache while both pyEVM
|
|
|
|
# and Nimbus will modify the state trie.
|
|
|
|
# During the next SSTORE call, aleth cs. calculate
|
|
|
|
# gas used based on this cached 'original storage value'.
|
|
|
|
# In other hand pyEVM and Nimbus will fetch
|
|
|
|
# 'original storage value' from state trie.
|
|
|
|
#
|
|
|
|
# Both Yellow Paper and EIP2200 are not clear about this
|
|
|
|
# situation but since aleth/geth/and parity implement this
|
|
|
|
# behaviour, we perhaps also need to implement it.
|
|
|
|
#
|
|
|
|
# TODO: should this compatibility mode enabled via
|
|
|
|
# compile time switch, runtime switch, or just hard coded
|
|
|
|
# it?
|
|
|
|
const
|
|
|
|
aleth_compat = true
|
|
|
|
|
2018-01-29 17:40:22 +00:00
|
|
|
type
|
|
|
|
AccountStateDB* = ref object
|
2023-03-10 18:42:37 +00:00
|
|
|
trie: AccountsTrie
|
2019-11-13 06:18:01 +00:00
|
|
|
originalRoot: KeccakHash # will be updated for every transaction
|
2023-08-04 11:10:09 +00:00
|
|
|
transactionID: CoreDbTxID
|
2020-02-19 10:27:14 +00:00
|
|
|
when aleth_compat:
|
|
|
|
cleared: HashSet[EthAddress]
|
2018-01-29 17:40:22 +00:00
|
|
|
|
2018-12-31 03:27:02 +00:00
|
|
|
ReadOnlyStateDB* = distinct AccountStateDB
|
2018-07-05 12:41:01 +00:00
|
|
|
|
2023-08-04 11:10:09 +00:00
|
|
|
proc pruneTrie*(db: AccountStateDB): bool =
|
2022-12-02 04:39:12 +00:00
|
|
|
db.trie.isPruning
|
|
|
|
|
2023-08-04 11:10:09 +00:00
|
|
|
func db*(db: AccountStateDB): CoreDbRef =
|
|
|
|
db.trie.db
|
|
|
|
|
2023-10-11 19:09:11 +00:00
|
|
|
proc kvt*(db: AccountStateDB): CoreDbKvtRef =
|
2023-08-04 11:10:09 +00:00
|
|
|
db.trie.db.kvt
|
2022-12-02 04:39:12 +00:00
|
|
|
|
2018-12-31 03:27:02 +00:00
|
|
|
proc rootHash*(db: AccountStateDB): KeccakHash =
|
|
|
|
db.trie.rootHash
|
|
|
|
|
|
|
|
proc `rootHash=`*(db: AccountStateDB, root: KeccakHash) =
|
2023-08-04 11:10:09 +00:00
|
|
|
db.trie = initAccountsTrie(db.trie.db, root, db.trie.isPruning)
|
2018-07-05 12:41:01 +00:00
|
|
|
|
2023-08-04 11:10:09 +00:00
|
|
|
proc newAccountStateDB*(backingStore: CoreDbRef,
|
2018-12-31 03:27:02 +00:00
|
|
|
root: KeccakHash, pruneTrie: bool): AccountStateDB =
|
2018-07-05 12:41:01 +00:00
|
|
|
result.new()
|
2023-03-10 18:42:37 +00:00
|
|
|
result.trie = initAccountsTrie(backingStore, root, pruneTrie)
|
2019-11-13 06:18:01 +00:00
|
|
|
result.originalRoot = root
|
2019-11-28 10:02:11 +00:00
|
|
|
result.transactionID = backingStore.getTransactionID()
|
2020-02-19 10:27:14 +00:00
|
|
|
when aleth_compat:
|
|
|
|
result.cleared = initHashSet[EthAddress]()
|
2018-01-29 17:40:22 +00:00
|
|
|
|
2023-08-04 11:10:09 +00:00
|
|
|
proc getTrie*(db: AccountStateDB): CoreDbMptRef =
|
|
|
|
db.trie.mpt
|
2022-02-15 03:22:05 +00:00
|
|
|
|
2023-08-04 11:10:09 +00:00
|
|
|
proc getSecureTrie*(db: AccountStateDB): CoreDbPhkRef =
|
|
|
|
db.trie.phk
|
2022-02-15 03:22:05 +00:00
|
|
|
|
2018-12-10 15:54:19 +00:00
|
|
|
proc getAccount*(db: AccountStateDB, address: EthAddress): Account =
|
2023-03-10 18:42:37 +00:00
|
|
|
let recordFound = db.trie.getAccountBytes(address)
|
2018-07-05 12:41:01 +00:00
|
|
|
if recordFound.len > 0:
|
|
|
|
result = rlp.decode(recordFound, Account)
|
|
|
|
else:
|
|
|
|
result = newAccount()
|
2018-01-29 17:40:22 +00:00
|
|
|
|
2018-08-08 12:48:34 +00:00
|
|
|
proc setAccount*(db: AccountStateDB, address: EthAddress, account: Account) =
|
2023-03-10 18:42:37 +00:00
|
|
|
db.trie.putAccountBytes(address, rlp.encode(account))
|
2018-02-13 17:18:08 +00:00
|
|
|
|
2018-09-14 13:43:40 +00:00
|
|
|
proc deleteAccount*(db: AccountStateDB, address: EthAddress) =
|
2023-03-10 18:42:37 +00:00
|
|
|
db.trie.delAccountBytes(address)
|
2018-09-14 13:43:40 +00:00
|
|
|
|
2018-05-30 16:11:15 +00:00
|
|
|
proc getCodeHash*(db: AccountStateDB, address: EthAddress): Hash256 =
|
2018-02-13 17:18:08 +00:00
|
|
|
let account = db.getAccount(address)
|
|
|
|
result = account.codeHash
|
2018-01-29 17:40:22 +00:00
|
|
|
|
2018-05-30 16:11:15 +00:00
|
|
|
proc getBalance*(db: AccountStateDB, address: EthAddress): UInt256 =
|
2018-01-29 17:40:22 +00:00
|
|
|
let account = db.getAccount(address)
|
|
|
|
account.balance
|
|
|
|
|
2022-02-15 03:22:05 +00:00
|
|
|
proc setBalance*(db: AccountStateDB, address: EthAddress, balance: UInt256) =
|
2018-07-05 12:41:01 +00:00
|
|
|
var account = db.getAccount(address)
|
2018-01-29 17:40:22 +00:00
|
|
|
account.balance = balance
|
|
|
|
db.setAccount(address, account)
|
|
|
|
|
2022-02-15 03:22:05 +00:00
|
|
|
proc addBalance*(db: AccountStateDB, address: EthAddress, delta: UInt256) =
|
2018-09-10 08:44:07 +00:00
|
|
|
db.setBalance(address, db.getBalance(address) + delta)
|
|
|
|
|
2022-02-15 03:22:05 +00:00
|
|
|
proc subBalance*(db: AccountStateDB, address: EthAddress, delta: UInt256) =
|
2018-09-10 08:44:07 +00:00
|
|
|
db.setBalance(address, db.getBalance(address) - delta)
|
|
|
|
|
2020-04-20 18:12:44 +00:00
|
|
|
template createTrieKeyFromSlot(slot: UInt256): auto =
|
2018-07-05 12:41:01 +00:00
|
|
|
# Converts a number to hex big-endian representation including
|
|
|
|
# prefix and leading zeros:
|
2023-09-13 02:32:38 +00:00
|
|
|
slot.toBytesBE
|
2018-07-05 12:41:01 +00:00
|
|
|
# Original py-evm code:
|
|
|
|
# pad32(int_to_big_endian(slot))
|
2018-09-04 12:30:15 +00:00
|
|
|
# morally equivalent to toByteRange_Unnecessary but with different types
|
2018-07-05 12:41:01 +00:00
|
|
|
|
2023-03-10 18:42:37 +00:00
|
|
|
template getStorageTrie(db: AccountStateDB, account: Account): auto =
|
2023-04-12 12:39:11 +00:00
|
|
|
storageTrieForAccount(db.trie, account, false)
|
2018-08-08 12:48:34 +00:00
|
|
|
|
2022-02-15 03:22:05 +00:00
|
|
|
proc clearStorage*(db: AccountStateDB, address: EthAddress) =
|
2018-09-15 20:04:58 +00:00
|
|
|
var account = db.getAccount(address)
|
2023-08-04 11:10:09 +00:00
|
|
|
account.storageRoot = EMPTY_ROOT_HASH
|
2018-09-15 20:04:58 +00:00
|
|
|
db.setAccount(address, account)
|
2020-02-19 10:27:14 +00:00
|
|
|
when aleth_compat:
|
|
|
|
db.cleared.incl address
|
2018-09-15 20:04:58 +00:00
|
|
|
|
2018-12-04 08:13:35 +00:00
|
|
|
proc getStorageRoot*(db: AccountStateDB, address: EthAddress): Hash256 =
|
2018-09-15 20:04:58 +00:00
|
|
|
var account = db.getAccount(address)
|
|
|
|
account.storageRoot
|
|
|
|
|
2022-02-15 03:22:05 +00:00
|
|
|
proc setStorage*(db: AccountStateDB,
|
2018-07-05 12:41:01 +00:00
|
|
|
address: EthAddress,
|
|
|
|
slot: UInt256, value: UInt256) =
|
|
|
|
var account = db.getAccount(address)
|
2023-03-10 18:42:37 +00:00
|
|
|
var accountTrie = getStorageTrie(db, account)
|
2018-07-05 12:41:01 +00:00
|
|
|
let slotAsKey = createTrieKeyFromSlot slot
|
2018-02-13 17:18:08 +00:00
|
|
|
|
2018-02-26 11:59:56 +00:00
|
|
|
if value > 0:
|
2020-04-20 18:12:44 +00:00
|
|
|
let encodedValue = rlp.encode(value)
|
2023-03-10 18:42:37 +00:00
|
|
|
accountTrie.putSlotBytes(slotAsKey, encodedValue)
|
2018-02-26 11:59:56 +00:00
|
|
|
else:
|
2023-03-10 18:42:37 +00:00
|
|
|
accountTrie.delSlotBytes(slotAsKey)
|
2018-07-05 12:41:01 +00:00
|
|
|
|
2018-12-04 08:13:35 +00:00
|
|
|
# map slothash back to slot value
|
|
|
|
# see iterator storage below
|
|
|
|
var
|
2023-08-04 11:10:09 +00:00
|
|
|
triedb = db.kvt
|
2018-12-04 08:13:35 +00:00
|
|
|
# slotHash can be obtained from accountTrie.put?
|
2023-09-13 02:32:38 +00:00
|
|
|
slotHash = keccakHash(slot.toBytesBE)
|
2018-12-04 08:13:35 +00:00
|
|
|
triedb.put(slotHashToSlotKey(slotHash.data).toOpenArray, rlp.encode(slot))
|
|
|
|
|
2018-07-05 12:41:01 +00:00
|
|
|
account.storageRoot = accountTrie.rootHash
|
|
|
|
db.setAccount(address, account)
|
2018-02-13 17:18:08 +00:00
|
|
|
|
2018-12-04 08:13:35 +00:00
|
|
|
iterator storage*(db: AccountStateDB, address: EthAddress): (UInt256, UInt256) =
|
|
|
|
let
|
|
|
|
storageRoot = db.getStorageRoot(address)
|
2023-08-04 11:10:09 +00:00
|
|
|
triedb = db.kvt
|
|
|
|
trie = db.db.mptPrune storageRoot
|
2018-12-04 08:13:35 +00:00
|
|
|
|
|
|
|
for key, value in trie:
|
|
|
|
if key.len != 0:
|
2020-04-20 18:12:44 +00:00
|
|
|
var keyData = triedb.get(slotHashToSlotKey(key).toOpenArray)
|
2018-12-04 08:13:35 +00:00
|
|
|
yield (rlp.decode(keyData, UInt256), rlp.decode(value, UInt256))
|
|
|
|
|
2018-07-05 12:41:01 +00:00
|
|
|
proc getStorage*(db: AccountStateDB, address: EthAddress, slot: UInt256): (UInt256, bool) =
|
|
|
|
let
|
|
|
|
account = db.getAccount(address)
|
|
|
|
slotAsKey = createTrieKeyFromSlot slot
|
2023-03-10 18:42:37 +00:00
|
|
|
storageTrie = getStorageTrie(db, account)
|
2018-04-06 14:52:10 +00:00
|
|
|
|
2018-07-05 12:41:01 +00:00
|
|
|
let
|
2023-03-10 18:42:37 +00:00
|
|
|
foundRecord = storageTrie.getSlotBytes(slotAsKey)
|
2018-02-13 17:18:08 +00:00
|
|
|
|
2018-07-05 12:41:01 +00:00
|
|
|
if foundRecord.len > 0:
|
|
|
|
result = (rlp.decode(foundRecord, UInt256), true)
|
2018-02-20 17:27:43 +00:00
|
|
|
else:
|
2018-02-26 11:59:56 +00:00
|
|
|
result = (0.u256, false)
|
2018-02-13 17:18:08 +00:00
|
|
|
|
2018-12-31 03:27:02 +00:00
|
|
|
proc setNonce*(db: AccountStateDB, address: EthAddress, newNonce: AccountNonce) =
|
2018-02-13 17:18:08 +00:00
|
|
|
var account = db.getAccount(address)
|
2018-08-09 09:25:37 +00:00
|
|
|
if newNonce != account.nonce:
|
|
|
|
account.nonce = newNonce
|
|
|
|
db.setAccount(address, account)
|
2018-02-13 17:18:08 +00:00
|
|
|
|
2018-08-31 17:38:17 +00:00
|
|
|
proc getNonce*(db: AccountStateDB, address: EthAddress): AccountNonce =
|
2018-02-13 17:18:08 +00:00
|
|
|
let account = db.getAccount(address)
|
Refactor interpreter dispatch (#65)
* move forks constants, rename errors
* Move vm/utils to vm/interpreter/utils
* initial opcodes refactoring
* Add refactored Comparison & Bitwise Logic Operations
* Add sha3 and address, simplify macro, support pop 0
* balance, origin, caller, callValue
* fix gas copy opcodes gas costs, add callDataLoad/Size/Copy, CodeSize/Copy and gas price opcode
* Update with 30s, 40s, 50s opcodes + impl of balance + stack improvement
* add push, dup, swap, log, create and call operations
* finish opcode implementation
* Add the new dispatching logic
* Pass the opcode test
* Make test_vm_json compile
* halt execution without exceptions for Return, Revert, selfdestruct (fix #62)
* Properly catch and recover from EVM exceptions (stack underflow ...)
* Fix byte op
* Fix jump regressions
* Update for latest devel, don't import old dispatch code as quasiBoolean macro is broken by latest devel
* Fix sha3 regression on empty memory slice and until end of range slice
* Fix padding / range error on expXY_success (gas computation left)
* update logging procs
* Add tracing - expXY_success is not a regression, sload stub was accidentally passing the test
* Reuse the same stub as OO implementation
* Delete previous opcode implementation
* Delete object oriented fork code
* Delete exceptions that were used as control flows
* delete base.nim :fire:, yet another OO remnants
* Delete opcode table
* Enable omputed gotos and compile-time gas fees
* Revert const gasCosts -> generates SIGSEGV
* inline push, swap and dup opcodes
* loggers are now template again, why does this pass new tests?
* Trigger CI rebuild after rocksdb fix https://github.com/status-im/nim-rocksdb/pull/5
* Address review comment on "push" + VMTests in debug mode (not release)
* Address review comment: don't tag fork by default, make opcode impl grepable
* Static compilation fixes after rebasing
* fix the initialization of the VM database
* add a missing import
* Deactivate balance and sload test following #59
* Reactivate stack check (deactivated in #59, necessary to pass tests)
* Merge remaining opcodes implementation from #59
* Merge callDataLoad and codeCopy fixes, todo simplify see #67
2018-07-06 07:52:31 +00:00
|
|
|
account.nonce
|
2018-02-13 17:18:08 +00:00
|
|
|
|
2019-02-26 07:41:37 +00:00
|
|
|
proc incNonce*(db: AccountStateDB, address: EthAddress) {.inline.} =
|
|
|
|
db.setNonce(address, db.getNonce(address) + 1)
|
|
|
|
|
2020-04-20 18:12:44 +00:00
|
|
|
proc setCode*(db: AccountStateDB, address: EthAddress, code: openArray[byte]) =
|
2018-02-13 17:18:08 +00:00
|
|
|
var account = db.getAccount(address)
|
2018-12-31 03:27:02 +00:00
|
|
|
# TODO: implement JournalDB to store code and storage
|
|
|
|
# also use JournalDB to revert state trie
|
|
|
|
|
|
|
|
let
|
2020-04-20 18:12:44 +00:00
|
|
|
newCodeHash = keccakHash(code)
|
2023-08-04 11:10:09 +00:00
|
|
|
triedb = db.kvt
|
2018-12-31 03:27:02 +00:00
|
|
|
|
|
|
|
if code.len != 0:
|
2020-04-20 18:12:44 +00:00
|
|
|
triedb.put(contractHashKey(newCodeHash).toOpenArray, code)
|
2018-12-31 03:27:02 +00:00
|
|
|
|
|
|
|
account.codeHash = newCodeHash
|
|
|
|
db.setAccount(address, account)
|
2018-02-13 17:18:08 +00:00
|
|
|
|
2020-04-20 18:12:44 +00:00
|
|
|
proc getCode*(db: AccountStateDB, address: EthAddress): seq[byte] =
|
2023-08-04 11:10:09 +00:00
|
|
|
let triedb = db.kvt
|
2020-04-20 18:12:44 +00:00
|
|
|
triedb.get(contractHashKey(db.getCodeHash(address)).toOpenArray)
|
2018-02-13 17:18:08 +00:00
|
|
|
|
2019-02-01 09:25:10 +00:00
|
|
|
proc hasCodeOrNonce*(db: AccountStateDB, address: EthAddress): bool {.inline.} =
|
|
|
|
db.getNonce(address) != 0 or db.getCodeHash(address) != EMPTY_SHA3
|
2018-09-04 15:37:43 +00:00
|
|
|
|
2018-09-04 12:30:15 +00:00
|
|
|
proc dumpAccount*(db: AccountStateDB, addressS: string): string =
|
|
|
|
let address = addressS.parseAddress
|
|
|
|
return fmt"{addressS}: Storage: {db.getStorage(address, 0.u256)}; getAccount: {db.getAccount address}"
|
2018-09-04 15:37:43 +00:00
|
|
|
|
2019-02-02 09:17:57 +00:00
|
|
|
proc accountExists*(db: AccountStateDB, address: EthAddress): bool =
|
2023-03-10 18:42:37 +00:00
|
|
|
db.trie.getAccountBytes(address).len > 0
|
2019-02-01 09:25:10 +00:00
|
|
|
|
2019-04-17 04:03:52 +00:00
|
|
|
proc isEmptyAccount*(db: AccountStateDB, address: EthAddress): bool =
|
2023-03-10 18:42:37 +00:00
|
|
|
let recordFound = db.trie.getAccountBytes(address)
|
2019-04-17 04:03:52 +00:00
|
|
|
assert(recordFound.len > 0)
|
|
|
|
|
|
|
|
let account = rlp.decode(recordFound, Account)
|
|
|
|
result = account.codeHash == EMPTY_SHA3 and
|
|
|
|
account.balance.isZero and
|
|
|
|
account.nonce == 0
|
|
|
|
|
2019-05-06 12:08:26 +00:00
|
|
|
proc isDeadAccount*(db: AccountStateDB, address: EthAddress): bool =
|
2023-03-10 18:42:37 +00:00
|
|
|
let recordFound = db.trie.getAccountBytes(address)
|
2019-02-01 09:25:10 +00:00
|
|
|
if recordFound.len > 0:
|
|
|
|
let account = rlp.decode(recordFound, Account)
|
|
|
|
result = account.codeHash == EMPTY_SHA3 and
|
|
|
|
account.balance.isZero and
|
|
|
|
account.nonce == 0
|
|
|
|
else:
|
2019-05-06 12:08:26 +00:00
|
|
|
result = true
|
2019-02-01 09:25:10 +00:00
|
|
|
|
2019-11-12 13:24:52 +00:00
|
|
|
proc getCommittedStorage*(db: AccountStateDB, address: EthAddress, slot: UInt256): UInt256 =
|
2019-11-13 06:18:01 +00:00
|
|
|
let tmpHash = db.rootHash
|
|
|
|
db.rootHash = db.originalRoot
|
2023-08-04 11:10:09 +00:00
|
|
|
db.transactionID.shortTimeReadOnly():
|
2020-02-19 10:27:14 +00:00
|
|
|
when aleth_compat:
|
|
|
|
if address in db.cleared:
|
|
|
|
debug "Forced contract creation on existing account detected", address
|
|
|
|
result = 0.u256
|
|
|
|
else:
|
|
|
|
result = db.getStorage(address, slot)[0]
|
|
|
|
else:
|
|
|
|
result = db.getStorage(address, slot)[0]
|
2019-11-13 06:18:01 +00:00
|
|
|
db.rootHash = tmpHash
|
|
|
|
|
|
|
|
proc updateOriginalRoot*(db: AccountStateDB) =
|
|
|
|
## this proc will be called for every transaction
|
|
|
|
db.originalRoot = db.rootHash
|
2019-11-28 10:02:11 +00:00
|
|
|
# no need to rollback or dispose
|
|
|
|
# transactionID, it will be handled elsewhere
|
2023-08-04 11:10:09 +00:00
|
|
|
db.transactionID = db.db.getTransactionID()
|
2019-11-12 13:24:52 +00:00
|
|
|
|
2020-02-19 10:27:14 +00:00
|
|
|
when aleth_compat:
|
|
|
|
db.cleared.clear()
|
|
|
|
|
2018-12-31 03:27:02 +00:00
|
|
|
proc rootHash*(db: ReadOnlyStateDB): KeccakHash {.borrow.}
|
|
|
|
proc getAccount*(db: ReadOnlyStateDB, address: EthAddress): Account {.borrow.}
|
|
|
|
proc getCodeHash*(db: ReadOnlyStateDB, address: EthAddress): Hash256 {.borrow.}
|
|
|
|
proc getBalance*(db: ReadOnlyStateDB, address: EthAddress): UInt256 {.borrow.}
|
|
|
|
proc getStorageRoot*(db: ReadOnlyStateDB, address: EthAddress): Hash256 {.borrow.}
|
|
|
|
proc getStorage*(db: ReadOnlyStateDB, address: EthAddress, slot: UInt256): (UInt256, bool) {.borrow.}
|
|
|
|
proc getNonce*(db: ReadOnlyStateDB, address: EthAddress): AccountNonce {.borrow.}
|
2020-04-20 18:12:44 +00:00
|
|
|
proc getCode*(db: ReadOnlyStateDB, address: EthAddress): seq[byte] {.borrow.}
|
2019-02-01 09:25:10 +00:00
|
|
|
proc hasCodeOrNonce*(db: ReadOnlyStateDB, address: EthAddress): bool {.borrow.}
|
2019-02-02 09:17:57 +00:00
|
|
|
proc accountExists*(db: ReadOnlyStateDB, address: EthAddress): bool {.borrow.}
|
2019-05-06 12:08:26 +00:00
|
|
|
proc isDeadAccount*(db: ReadOnlyStateDB, address: EthAddress): bool {.borrow.}
|
|
|
|
proc isEmptyAccount*(db: ReadOnlyStateDB, address: EthAddress): bool {.borrow.}
|
2019-11-12 13:24:52 +00:00
|
|
|
proc getCommittedStorage*(db: ReadOnlyStateDB, address: EthAddress, slot: UInt256): UInt256 {.borrow.}
|