mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-09 20:06:52 +00:00
c4c37302b1
* Introduce wrapper type for EIP-4844 transactions EIP-4844 blob sidecars are a concept that only exists in the mempool. After inclusion of a transaction into an execution block, only the versioned hash within the transaction remains. To improve type safety, replace the `Transaction.networkPayload` member with a wrapper type `PooledTransaction` that is used in contexts where blob sidecars exist. * Bump nimbus-eth2 to 87605d08a7f9cfc3b223bd32143e93a6cdf351ac * IPv6 'listen-address' in `nimbus_verified_proxy` * Bump nim-libp2p to 21cbe3a91a70811522554e89e6a791172cebfef2 * Fix beacon_lc_bridge payload conversion and conf.listenAddress type * Change nimbus_verified_proxy.asExecutionData param to SomeExecutionPayload * Rerun nph to fix asExecutionData style format * nimbus_verified_proxy listenAddress * Use PooledTransaction in nimbus-eth1 tests --------- Co-authored-by: jangko <jangko128@gmail.com>
Core database replacement wrapper object
This wrapper replaces the TrieDatabaseRef and its derivatives by the new object CoreDbRef.
Relations to current TrieDatabaseRef implementation
Here are some incomplete translations for objects and constructors.
Object types:
Legacy notation | CoreDbRef based replacement |
---|---|
ChainDB | (don't use/avoid) |
ChainDbRef | CoreDbRef |
TrieDatabaseRef | CoreDbKvtRef |
HexaryTrie | CoreDbMptRef |
SecureHexaryTrie | CoreDbPhkRef |
DbTransaction | CoreDbTxRef |
TransactionID | CoreDbTxID |
Constructors:
Legacy notation | CoreDbRef based replacement |
---|---|
trieDB newChainDB("..") | newCoreDbRef(LegacyDbPersistent,"..") |
newMemoryDB() | newCoreDbRef(LegacyDbMemory) |
-- | |
initHexaryTrie(db,..) | db.mpt(..) (no pruning) |
db.mptPrune(..) (w/pruning true/false) | |
-- | |
initSecureHexaryTrie(db,..) | db.phk(..) (no pruning) |
db.phkPrune(..) (w/pruning true/false) | |
-- | |
newCaptureDB(db,memDB) | db.capture() (see below) |
Usage of the replacement wrapper
Objects pedigree:
CoreDbRef -- base descriptor
| | |
| | +--- CoreDbCtxRef -- MPT context descriptor
| | | |
| | | +-- CoreDbMptRef -- hexary trie instance
| | | | : :
| | | +-- CoreDbMptRef -- hexary trie instance
| | |
| | |
| | +---- CoreDbPhkRef -- pre-hashed key hexary trie instance
| | | : :
| | +---- CoreDbPhkRef -- pre-hashed key hexary trie instance
| |
| |
| +------ CoreDbKvtRef -- single static key-value table
|
|
+-------- CoreDbCaptRef -- tracer support descriptor
Instantiating legacy standard database object descriptors works as follows:
let
db = newCoreDbRef(..) # new base descriptor
mpt = db.mpt(..) # hexary trie/Merkle Patricia Tree
phk = db.phk(..) # pre-hashed key hexary trie/MPT
kvt = db.kvt # key-value table
Tracer support setup by hiding the current CoreDbRef behind a replacement:
let
capture = db.capture()
db = capture.recorder # use the recorder in place of db
...
for key,value in capture.recorder.kvt:
... # process recorded data