Geth StateDB that works ontop of ipld-eth-db, leveraging its unique indexes
Go to file
Ian Norden 32e4994b09
Merge pull request #16 from cerc-io/ian/v5_dev
Merge StateDB and Trie that use CIDs and trie traversal access pattern to interface with ipld.blocks
2023-04-10 23:58:29 -05:00
internal add unit tests 2023-03-05 16:45:18 +08:00
trie_by_cid expose NodeIterator 2023-04-10 16:43:36 +08:00
.gitignore init commit 2023-02-22 18:57:42 -06:00
access_list.go port over required internal geth packages 2023-02-23 16:10:34 -06:00
config.go clean up 2023-03-13 16:58:59 -05:00
database.go create database abstraction to make it easier to use different drivers; add sqlx driver support to make integrating into ipld-eth-server database metrics easier 2023-03-13 14:07:01 -05:00
go.mod updated deps 2023-04-09 12:25:11 -05:00
go.sum updated deps 2023-04-09 12:25:11 -05:00
interfaces.go clean up 2023-03-13 16:58:59 -05:00
journal.go update statedb 2023-04-10 16:43:27 +08:00
pgx.go create database abstraction to make it easier to use different drivers; add sqlx driver support to make integrating into ipld-eth-server database metrics easier 2023-03-13 14:07:01 -05:00
README.md add a bit to the README about the alt implementation 2023-04-09 12:59:07 -05:00
sql.go update to use get_storage_at functions 2023-03-07 20:41:53 -06:00
sqlx.go create database abstraction to make it easier to use different drivers; add sqlx driver support to make integrating into ipld-eth-server database metrics easier 2023-03-13 14:07:01 -05:00
state_database.go clean up 2023-03-13 16:58:59 -05:00
state_object.go clean up 2023-04-10 16:43:27 +08:00
statedb_test.go clean up 2023-03-13 16:58:59 -05:00
statedb.go clean up 2023-04-10 16:43:27 +08:00
transient_storage.go update statedb 2023-04-10 16:43:27 +08:00

ipld-eth-statedb

Implementation of the geth vm.StateDB on top of ipld-eth-db, to allow us to plug into existing EVM functionality. Analogous to ipfs-ethdb but at one database abstraction level higher. This allows us to bypass the trie-traversal access pattern normally used by the EVM (and which ipfs-ethdb allows us to replicate ontop of our Postgres IPLD blockstore in the "public.blocks" table) and access state and storage directly in the "state_cids" and "storage_cids" tables.

Note: "IPFS" is chosen in the name of "ipfs-ethdb" as it can function through an IPFS BlockService abstraction or directly ontop of an IPLD blockstore, whereas this repository is very tightly coupled to the schema in ipld-eth-db.

The top-level package contains the implementation of the vm.StateDB interface that accesses state directly using the state_cids and storage_cids tables in ipld-eth-db. The trie_by_cid package contains an alternative implementation which accesses state in ipld.blocks through the typical trie traversal access pattern (using CIDs instead of raw keccak256 hashes), it is used for benchmarking and for functionality which requires performing a trie traversal (things which must collect intermediate nodes, e.g. eth_getProof and eth_getSlice).