Commit Graph

63 Commits

Author SHA1 Message Date
0eba6888c1
Merge pull request #18 from cerc-io/roy/v5-dev
* Refactor redundant DB code

* Fix storage paths

GetState takes a slot, not a leaf path

* Add trie_by_cid/state.TryGetNode

used in ipld-eth-server

* Reorganize packages

* direct_by_leaf/ is original StateDB package
* sql/ for SQL DB interfaces

* Test NodeBlob

* Fix node resolution; use Cid struct as key

was erroneously storing the cid in the fullNode's flag.cache

* Add basic trie tests
2023-04-25 15:01:12 +08:00
4b2aba4fc7 Add basic trie tests 2023-04-24 21:38:11 +08:00
88e7a394d0 Fix node resolution; use Cid struct as key
was erroneously storing the cid in the fullNode's flag.cache
2023-04-24 18:34:49 +08:00
3f0e36c0a3 Test NodeBlob 2023-04-24 18:34:49 +08:00
3625e22949 Reorganize packages
* direct_by_leaf/ is original StateDB package
* sql/ for SQL DB interfaces
2023-04-24 18:34:49 +08:00
5790ff0439 Add trie_by_cid/state.TryGetNode
used in ipld-eth-server
2023-04-24 18:34:49 +08:00
e3e4e1e41c Fix storage paths
GetState takes a slot, not a leaf path
2023-04-24 18:34:49 +08:00
49177ee0ab Refactor redundant DB code 2023-04-24 18:34:49 +08:00
ced8041f72 fix package oops 2023-04-24 18:34:42 +08:00
b6ef6d4e12
Proof tests (#17)
* Port proof tests from geth
* Scale trie size, seed rand
2023-04-24 05:04:13 -05:00
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
3ddb592d6b expose NodeIterator 2023-04-10 16:43:36 +08:00
a5a95c2a9f clean up 2023-04-10 16:43:27 +08:00
49f3d43e46 update statedb
add transient storage
2023-04-10 16:43:27 +08:00
i-norden
7575a88b03 add a bit to the README about the alt implementation 2023-04-09 12:59:07 -05:00
i-norden
cee8f21984 some fixes 2023-04-09 12:42:19 -05:00
i-norden
804b321c42 updated deps 2023-04-09 12:25:11 -05:00
i-norden
0cea5840f8 move to trie_by_cid 2023-04-09 12:01:26 -05:00
0573da1982 trie iterator and tests 2023-04-09 12:01:26 -05:00
ed5238a742 unused pkg 2023-04-09 12:01:26 -05:00
33e3d2f0ec Implement StateDB using IPFS-backed trie and supporting types 2023-04-09 12:01:26 -05:00
i-norden
f8648b51a7 initial commit 2023-04-09 12:01:26 -05:00
Ian Norden
c7d05bb86e
Merge pull request #11 from cerc-io/ian/v5_dev
create database abstraction to make it easier to use different drivers
2023-03-16 07:32:03 -05:00
i-norden
73bb6cf62b clean up 2023-03-13 16:58:59 -05:00
i-norden
784860a7f0 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
Ian Norden
9f53f99fc6
Merge pull request #10 from cerc-io/ian/v5_dev
add `SetStorage` methods to StateDB and StateObject
2023-03-13 11:08:29 -05:00
i-norden
04a4cc7014 add SetStorage methods to StateDB and StateObject 2023-03-13 10:41:45 -05:00
Ian Norden
ac6d1918e2
Merge pull request #8 from cerc-io/ian/v5_dev
Additional unit tests
2023-03-09 09:04:44 -06:00
i-norden
02d148c5ef review fixes 2023-03-09 09:03:47 -06:00
i-norden
31aec61d7e fix for difficult to identify bug due to block_num arg being overriden by optimistic get_storage_at path which then can mess up the pessimistic path in very particular scenarios 2023-03-08 16:44:49 -06:00
i-norden
f354dca32d another test case to check handling when non-canonic blocks are present 2023-03-08 12:46:11 -06:00
Ian Norden
c09bc65a92
Merge pull request #7 from cerc-io/ian/v5
Use `get_storage_at` procedures
2023-03-08 12:45:42 -06:00
i-norden
96067bd223 review fixes 2023-03-08 11:20:16 -06:00
i-norden
2a004e887c add one more case 2023-03-08 10:03:48 -06:00
i-norden
affaeeb481 add simple unit test cases to test behavior when slots or contracts are destructed 2023-03-07 20:41:53 -06:00
i-norden
bd7a73afe8 update to use get_storage_at functions 2023-03-07 20:41:53 -06:00
Ian Norden
1ed81b588d
Merge pull request #2 from cerc-io/ian/v5
ipld-eth-statedb
2023-03-06 12:11:23 -06:00
i-norden
3a5606673a removeu unused method hash arg 2023-03-06 11:46:07 -06:00
Ian Norden
d68c12706f
Merge pull request #5 from cerc-io/roy/unit-tests
Add unit tests and fixes
2023-03-06 11:38:26 -06:00
1483fa3c67 add unit tests 2023-03-05 16:45:18 +08:00
355d58ee3d fixes 2023-03-05 16:31:01 +08:00
i-norden
5ac92c5594 update readme 2023-03-01 22:36:17 -06:00
i-norden
5df06198ac fix pgx dep; go.mod 2023-03-01 14:06:40 -06:00
i-norden
9c0283dae9 remove unused fields 2023-02-28 12:19:09 -06:00
i-norden
6b25cde9dd fix: need to pass block_hash to StateObject and Database 2023-02-28 12:08:06 -06:00
i-norden
ede0af3c26 implement database.StorageSlot() 2023-02-28 12:08:06 -06:00
i-norden
8754278d18 implement database.StateAccount() 2023-02-28 12:08:06 -06:00
i-norden
16b0b5b0f2 postgres sql statements for database queries 2023-02-28 12:08:06 -06:00
i-norden
82555a5319 update internal database interface 2023-02-28 12:08:06 -06:00
i-norden
1741e5f790 remove remaining trie access, ForEachStorage is the only method which requires this access pattern and afaict it is only ever used in tests so we can leave it unimplemented 2023-02-28 12:08:06 -06:00