Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
318 commits
Select commit Hold shift + click to select a range
f877735
testing split digest
nikkolasg Sep 23, 2024
90e4d42
with correct name
nikkolasg Sep 23, 2024
5e057ed
more tests
nikkolasg Sep 23, 2024
9020e54
fixes
nikkolasg Sep 23, 2024
c90e821
query adaptable
nikkolasg Sep 23, 2024
edad5fa
putting back ignoring query
nikkolasg Sep 23, 2024
71c2ce7
Merge branch 'main' into feat/merge_table
nikkolasg Sep 23, 2024
8ce5ca1
Fix non-existence proven node selection
nicholas-mainardi Sep 25, 2024
185ff79
Comment to clarify non-existence node selection logic
nicholas-mainardi Sep 25, 2024
994a115
Check query upper bounds in Parsil + add LIMIT to query if missing
nicholas-mainardi Sep 26, 2024
5fd774f
Refactor revelation APIs to avoid calling ids_for_placeholder_hash
nicholas-mainardi Sep 26, 2024
c89fc0f
Add comment for cells tree hash construction
nicholas-mainardi Sep 27, 2024
0f706cf
Fix: ensure we always use the appropriate merge flag in rows tre circ…
nicholas-mainardi Oct 1, 2024
06941a7
Implement the MPT part of generic extraction.
silathdiir Sep 30, 2024
3b368f4
Replace `32` with `MAPPING_LEAF_VALUE_LEN` in column gadget.
silathdiir Oct 6, 2024
84143e8
Replace the wrong index `7 - j` with `NUM_LAST_BITS_LOOKUP_TABLES - 1…
silathdiir Oct 6, 2024
69014f4
Re-use `length_bytes` as `real_len`.
silathdiir Oct 6, 2024
22068c4
Replace `less_than_or_equal_to` with `less_than_or_equal_to_unsafe` i…
silathdiir Oct 6, 2024
af66891
Fix to pack `extract_value`.
silathdiir Oct 6, 2024
1fbe615
Delete the wrong addition of `mpt_key` and `offset`.
silathdiir Oct 6, 2024
08f34cd
Replace `UInt256Target::new_from_be_target_limbs` with `new_from_targ…
silathdiir Oct 6, 2024
dce73a4
Delete uesless range check for slot and EVM word, since they're hashe…
silathdiir Oct 6, 2024
9c9519a
Fix to pack before digest computation as `D(key_id || pack(left_pad32…
silathdiir Oct 6, 2024
6640d85
Fix to only add values digest if EVM word is zero in leaf mapping cir…
silathdiir Oct 6, 2024
87809b8
Fix to use one field for the prefix `KEY`.
silathdiir Oct 6, 2024
94c9de8
Fix wrong byte order in `unpack_u32_to_u8_target`.
silathdiir Oct 7, 2024
691b69f
Add mapping of mappings leaf circuit.
silathdiir Oct 7, 2024
4f27919
Update storage key.
silathdiir Oct 7, 2024
08642f3
Update values extraction API.
silathdiir Oct 7, 2024
c7371b0
Add tests for column and metadata gadgets.
silathdiir Oct 8, 2024
6b8c7af
Add tests for storage key.
silathdiir Oct 9, 2024
cdc353b
Add test for leaf single circuit.
silathdiir Oct 10, 2024
7127536
Add test to leaf mapping circuit.
silathdiir Oct 10, 2024
e54449a
Add test for leaf mapping of mappings circuit.
silathdiir Oct 10, 2024
0cd9487
Merge branch 'main' into feat/merge_table
nikkolasg Oct 10, 2024
1da45a1
Delete `aggregation type` (`is_simple_aggregation`) in branch circuit.
silathdiir Oct 10, 2024
b23465d
Replace `31` with `MAPPING_LEAF_VALUE_LEN - 1`.
silathdiir Oct 11, 2024
46eeeb4
Replace wrong `curve_eq` with `connect_curve_points` in `TestMetadata…
silathdiir Oct 11, 2024
65fe5cf
Replace wrong `curve_eq` with `connect_curve_points` in `TestColumnGa…
silathdiir Oct 11, 2024
5b8ad23
Fix a bug in `ColumnGadget`.
silathdiir Oct 11, 2024
23ecf24
Move common fields to `MetadataGadget`.
silathdiir Oct 11, 2024
cd5fa5c
Fix `unpack_u32_to_u8_targets`.
silathdiir Oct 11, 2024
3407665
Fix to only set maximum as `u8::MAX + 8` for `first_bits_5` lookup ta…
silathdiir Oct 11, 2024
bc84083
Fix to generic paramters for `impl CircuitLogicWires`.
silathdiir Oct 11, 2024
380be6b
Add API tests.
silathdiir Oct 13, 2024
02290cd
Add simple struct, mapping struct and mapping of mappings to the test…
silathdiir Oct 13, 2024
ef7d07b
Update bindings.
silathdiir Oct 13, 2024
43791de
Enable single value extraction in integration test.
silathdiir Oct 13, 2024
08ebeea
Enable mapping value extraction in integration test.
silathdiir Oct 14, 2024
3bd0319
Optimize normalize_left to reduce cost of extract values
nicholas-mainardi Oct 14, 2024
7b63f6e
fmt
nicholas-mainardi Oct 14, 2024
9757f60
Fix the assigment to `evm_word`.
silathdiir Oct 14, 2024
6428a2f
Fix `MAX_COLUMNS` and `MAX_FIELD_PER_EVM` to generic parameters.
silathdiir Oct 14, 2024
b7e9ed3
Pass into the extracted column identifier to init `MetadataGadget`.
silathdiir Oct 15, 2024
ad4ddd9
Fix `outer_key_id` and `inner_key_id` to `Option` in `StorageSlotInfo…
silathdiir Oct 15, 2024
20f3933
Add test `test_values_extraction_api_serialization`.
silathdiir Oct 15, 2024
32f9837
Remove `evm_word` for generating mapping key identifier.
silathdiir Oct 15, 2024
d87b8a6
Fix encoded data.
silathdiir Oct 15, 2024
b405f04
Add common functions for metadata and values digest computation.
silathdiir Oct 15, 2024
5916860
Merge branch 'feat/merge_table' into feat/tabular-queries
nicholas-mainardi Oct 15, 2024
7b12a98
Fix to check the expected metadata digest in API test.
silathdiir Oct 15, 2024
1098ce5
Specify `NODE_LEN` to `69` as `MAX_LEAF_NODE_LEN`.
silathdiir Oct 15, 2024
39d522d
Fix build.
silathdiir Oct 15, 2024
635eb56
Clean the current useless code in integration test.
silathdiir Oct 15, 2024
63fc418
Enable rows digest check in integration test.
silathdiir Oct 15, 2024
9002398
Merge branch 'feat/tabular-queries' into feat/unproven-limit-offset-q…
nicholas-mainardi Oct 15, 2024
c87856f
Add LIMIT by default only in simple SELECT queries
nicholas-mainardi Oct 15, 2024
c7bd811
Avoid running wildcard queries on merged tables
nicholas-mainardi Oct 15, 2024
a5a6962
Fix parsil test
nicholas-mainardi Oct 15, 2024
9c325d6
Merge remote-tracking branch 'origin/feat/unproven-limit-offset-queri…
silathdiir Oct 15, 2024
e3292a6
Add a new constant `EVM_WORD_LEN` for the slot value length.
silathdiir Oct 16, 2024
0048e0d
Remove `num_actual_columns` from the arguments of `MetadataGadget::ne…
silathdiir Oct 16, 2024
ef51ed8
Add check for the parent of a Slot mapping entry, it must be type of …
silathdiir Oct 16, 2024
bc90aba
Compute the column information digest in `ColumnInfo` and called in `…
silathdiir Oct 16, 2024
de7e002
Fix the Key ID constants to size of Uint32 or Uint64.
silathdiir Oct 16, 2024
8a85e45
Fix `evm_word` to `usize`, key IDs to `u64` and `extracted_column_ide…
silathdiir Oct 16, 2024
896e85a
Fix build.
silathdiir Oct 16, 2024
765731c
Fix tests.
silathdiir Oct 16, 2024
e36d424
Fix build.
silathdiir Oct 16, 2024
75937e2
Remove `extracted_column_identifiers` and `evm_word` from metadata co…
silathdiir Oct 16, 2024
5249a29
Fix tests.
silathdiir Oct 16, 2024
83a68e3
Pass `MetadataGadget` to the API functions.
silathdiir Oct 16, 2024
ec22c05
Check `values_digest` in `prove_leaf`.
silathdiir Oct 16, 2024
ddd0e9e
Replace `key_id` with `value_id` in `value_metadata` function.
silathdiir Oct 16, 2024
96f2223
Fix to place the value column for mappings of simple variables.
silathdiir Oct 16, 2024
7671861
Support mapping of Struct and mapping of mappings for the value metad…
silathdiir Oct 16, 2024
3043229
Update the metadata hash and integration test.
silathdiir Oct 17, 2024
92c73f4
Add `extracted_column_indentifiers` function to `MetadataGadget`.
silathdiir Oct 17, 2024
e5c21d1
Fix to check MPT `location` bytes without unpacking.
silathdiir Oct 17, 2024
17680fb
Fix the merge circuit metadata to `D(md_a) + D(md_b)`.
silathdiir Oct 17, 2024
1058717
Fix test.
silathdiir Oct 17, 2024
94dca85
fix: MemoryStorage::all_keys_at should not return dead keys
delehef Oct 17, 2024
e58faee
feat: add random_key_at
delehef Oct 17, 2024
3548cc5
Do range-check for the Keccak output which will be converted for Uint…
silathdiir Oct 22, 2024
aea77c6
Refactor the assign functions for the simple and mapping slots.
silathdiir Oct 22, 2024
7f9cb61
Update the circuits of cells tree, rows tree and block tree for gener…
silathdiir Oct 18, 2024
63b3b2d
Update tests for cells tree.
silathdiir Oct 22, 2024
c7291cf
Update tests for rows tree.
silathdiir Oct 23, 2024
d9f8825
Update tests of block tree.
silathdiir Oct 23, 2024
f59c5d7
Fix test.
silathdiir Oct 23, 2024
e651ab9
Add missing `value` for hash in rows tree.
silathdiir Oct 25, 2024
85cdb54
Merge branch 'feat/merge_table' into feat/tabular-queries
nicholas-mainardi Oct 29, 2024
791ba8a
Merge branch 'feat/tabular-queries' into feat/unproven-limit-offset-q…
nicholas-mainardi Oct 29, 2024
65ff089
Merge branch 'feat/unproven-limit-offset-queries' into generic-mpt-ex…
nicholas-mainardi Oct 29, 2024
5e2df85
Simple Select Queries with Unchecked Offset (#365)
nicholas-mainardi Oct 29, 2024
2717f98
Update verifiable-db/src/row_tree/public_inputs.rs
silathdiir Oct 30, 2024
a5ae612
Fix to ensure `extraction_proof.is_merge or rows_tree_proof.multiplie…
silathdiir Oct 30, 2024
ca0a971
Fix to use `split_and_accumulate`.
silathdiir Oct 30, 2024
2c94c12
Fix the test coverage for the all cells node circuits.
silathdiir Oct 30, 2024
6b791c9
Remove merge flag in rows tree public inputs.
silathdiir Oct 30, 2024
16bea45
Rename `assign_wires` to `assign`.
silathdiir Oct 30, 2024
1f70eb4
Fix to use `PublicInputs::sample`.
silathdiir Oct 30, 2024
21bb637
Fix to `p.partial`.
silathdiir Oct 30, 2024
0ad3977
Merge remote-tracking branch 'origin/feat/tabular-queries' into gener…
silathdiir Oct 30, 2024
32f4495
Merge remote-tracking branch 'origin/generic-mpt-extraction' into gen…
silathdiir Oct 30, 2024
31f7685
Delete the `ignore` comment for test `isolution`.
silathdiir Oct 30, 2024
e37e98e
Fix to use `split_and_accumulate`.
silathdiir Oct 30, 2024
0836ee3
Replace MPT metadata with the counter.
silathdiir Oct 30, 2024
aa84a07
Remove `child_metadata_digest` in the cells tree test.
silathdiir Oct 31, 2024
3a686f9
Fix to use `F::from_bool`.
silathdiir Oct 31, 2024
d5c9e24
Replace `HashOut<F>` with `HashOutput` in the API functions.
silathdiir Oct 31, 2024
5ce5ca5
Fix test
silathdiir Oct 31, 2024
5483d50
chore: clippy
delehef Oct 31, 2024
93c80de
Update integration test for generic extraction.
silathdiir Oct 24, 2024
60d3f34
[parsil] correctly handle LIMIT/OFFSET
delehef Nov 5, 2024
35d9623
[mp2] use more explicit names
delehef Nov 5, 2024
5bb0490
fix: imports
delehef Nov 5, 2024
2e32687
Merge branch 'main' into feat/tabular-queries
nicholas-mainardi Nov 6, 2024
3644f30
Fix integration test + fmt
nicholas-mainardi Nov 6, 2024
6a27c73
use u32's for offset & limit
delehef Nov 6, 2024
ec32679
Fix test failing from time to time
nicholas-mainardi Nov 6, 2024
d6cd3ad
Merge remote-tracking branch 'origin/feat/tabular-queries' into gener…
silathdiir Nov 7, 2024
a2c4cfc
Remove `bit_offset` in API.
silathdiir Nov 7, 2024
322280b
Merge remote-tracking branch 'origin/generic-mpt-extraction' into gen…
silathdiir Nov 7, 2024
82cc17c
Merge remote-tracking branch 'origin/generic-extraction-tree-creation…
silathdiir Nov 7, 2024
d7607cf
Merge remote-tracking branch 'origin/generic-extraction-row-id-update…
silathdiir Nov 7, 2024
9c4ddb7
Rename `Row` to `SecondaryIndexCell`.
silathdiir Nov 7, 2024
4b5dc13
Merge remote-tracking branch 'origin/generic-extraction-tree-creation…
silathdiir Nov 7, 2024
51768ea
Merge remote-tracking branch 'origin/generic-extraction-row-id-update…
silathdiir Nov 7, 2024
b33cd73
Combine the single and mapping test cases, and update the merge test …
silathdiir Nov 8, 2024
911aadb
Rename to `ContractController` and update the trait function names.
silathdiir Nov 12, 2024
6b8d4bc
Add TODO to the deprecated `bit_offset`.
silathdiir Nov 12, 2024
e2b717c
Fix the wrong log.
silathdiir Nov 12, 2024
302b17e
Add back the MPT key and ptr check.
silathdiir Nov 12, 2024
6155a66
Fix `last_byte_offset` to not restrict the maximum length.
silathdiir Nov 12, 2024
051bf96
Rename `MetadataGadget` to `ColumnsMetadata`, and leave `build` and `…
silathdiir Nov 12, 2024
c21fe13
Add more common `_raw` functions for the values extraction identifier…
silathdiir Nov 12, 2024
29fd77b
Remove `TableDimension`.
silathdiir Nov 13, 2024
2d1aa8a
Fix the row unique ID always get from the key ID column.
silathdiir Nov 13, 2024
38d6d30
Fix to the value column as the secondary index column in mapping stru…
silathdiir Nov 13, 2024
be3db69
Merge the match arms for mapping update.
silathdiir Nov 14, 2024
973325d
Set to simple rest for the row key.
silathdiir Nov 14, 2024
c423611
Fix the slot checking logic in the storage trie.
silathdiir Nov 14, 2024
50a58d9
Refactor the columns metadata and APIs.
silathdiir Nov 14, 2024
f53f0ee
Fix test.
silathdiir Nov 15, 2024
45deacf
Fix test.
silathdiir Nov 15, 2024
736d790
Merge remote-tracking branch 'origin/main' into generic-mpt-extraction
silathdiir Nov 17, 2024
4a342a0
Merge remote-tracking branch 'origin/generic-mpt-extraction' into gen…
silathdiir Nov 18, 2024
93e04dc
Merge remote-tracking branch 'origin/generic-extraction-tree-creation…
silathdiir Nov 18, 2024
8e1fb40
Merge remote-tracking branch 'origin/generic-extraction-row-id-update…
silathdiir Nov 18, 2024
29b6ddf
Add mapping of mappings test cases to the integration test.
silathdiir Nov 4, 2024
2c1ee60
Merge remote-tracking branch 'origin/main' into generic-mpt-extraction
silathdiir Dec 13, 2024
a139673
Merge remote-tracking branch 'origin/generic-mpt-extraction' into gen…
silathdiir Dec 13, 2024
e13b75e
Merge remote-tracking branch 'origin/generic-extraction-tree-creation…
silathdiir Dec 13, 2024
a22e6d7
Merge remote-tracking branch 'origin/generic-extraction-row-id-update…
silathdiir Dec 13, 2024
6018cdb
Merge remote-tracking branch 'origin/generic-extraction-integration-t…
silathdiir Dec 13, 2024
8fa830e
Comment out `test_pidgy_pinguin_mapping_slot` test case, and fix clippy.
silathdiir Dec 13, 2024
5719de9
Fix `test_pidgy_pinguin_mapping_slot`.
silathdiir Dec 13, 2024
dd0348b
Fix toolchain.
silathdiir Dec 13, 2024
8bbe471
Fix lint.
silathdiir Dec 13, 2024
be0c0a1
Merge branch 'main' into generic-mpt-extraction
nicholas-mainardi Jan 24, 2025
41e798a
Merge branch 'generic-mpt-extraction' into generic-extraction-tree-cr…
nicholas-mainardi Jan 24, 2025
55a2a14
Merhe with generic-mpt-extraction
nicholas-mainardi Jan 24, 2025
de716a7
Merge branch 'generic-extraction-tree-creation' into generic-extracti…
nicholas-mainardi Jan 24, 2025
47a5784
Merge branch 'generic-extraction-row-id-update' into generic-extracti…
nicholas-mainardi Jan 24, 2025
279b340
Merge branch 'generic-extraction-integration-test' into generic-extra…
nicholas-mainardi Jan 24, 2025
d981c7a
fmt
nicholas-mainardi Jan 24, 2025
c3c1002
chroe: update dependencies (#411)
silathdiir Nov 27, 2024
195946f
test with receipts encoding
nikkolasg Oct 17, 2024
129984f
wip
nikkolasg Oct 18, 2024
485dcb9
further testing
nikkolasg Oct 21, 2024
68a0532
WIP: Receipt Trie leaves
Nov 7, 2024
4261eab
Receipt Leaf Circuit added with tests
Nov 8, 2024
7f9702c
Change Receipt query test
Zyouell Nov 8, 2024
9b81835
Address review comments
Zyouell Nov 11, 2024
f1abff8
Value digest computation corrected
Zyouell Nov 27, 2024
d071575
Moved receipt value extraction location
Zyouell Nov 27, 2024
a3a596f
Added unit tests for receipt leaf api
Zyouell Dec 2, 2024
931ab2d
Rebased onto feat/receipt-trie
Zyouell Dec 2, 2024
b72c9f1
Reworked block extraction to extract all three roots
Zyouell Dec 2, 2024
57c99f2
Added testing for final extraction API
Zyouell Dec 3, 2024
2e4e060
Addressed review comments
Zyouell Dec 17, 2024
030dc32
Fixed tests to pass CI
Zyouell Dec 17, 2024
551495c
Resolves CRY-22
Zyouell Dec 18, 2024
1cb06af
Changed TableSource to be a trait
Zyouell Dec 19, 2024
39810b7
Fixed stack too deep error
Zyouell Dec 19, 2024
2e98183
Changed final extraction circuit set size constant
Zyouell Dec 19, 2024
b0b4c13
resolves CRY-23
Zyouell Dec 23, 2024
a94068c
resolves CRY-25
Zyouell Dec 23, 2024
d7b6ff7
Fixed to_receipt method
Zyouell Dec 30, 2024
f2a0cd8
Updated ethers receipt compatibility test
Zyouell Dec 31, 2024
d693970
Receipt value extraction prover
Zyouell Dec 31, 2024
025d8db
Resolves CRY-26
Zyouell Dec 31, 2024
268f116
Fixed topic cell id discrepancy
Zyouell Jan 2, 2025
017a15a
Fixed receipt value digest
Zyouell Jan 2, 2025
727b00a
RowTreeUpdate Debugging
Zyouell Jan 2, 2025
0c7a982
Correct Receipt Row Tree
Zyouell Jan 2, 2025
01793ab
Fixed slot input lengths for test
Zyouell Jan 13, 2025
14cf959
StorageSlotInfo Single Value fix
Zyouell Jan 13, 2025
317351f
WIP: Review comments
Zyouell Jan 21, 2025
73f8212
Error types for retries in mp2_common::eth
Zyouell Jan 29, 2025
3783c4f
Added empty block tree proof
Zyouell Jan 29, 2025
d7c6135
Integrated querying encodes 0 to hex string correctly now
Zyouell Jan 30, 2025
85dd6ed
IQ debugging
Zyouell Jan 30, 2025
da96604
Rebased back on top of Generic Extraction
Zyouell Jan 31, 2025
1ccc212
Added dummy value extraction circuit
Zyouell Jan 31, 2025
7f610bc
Support non-contiguous block numbers
nicholas-mainardi Jan 3, 2025
c59a1e1
fmt + clippy
nicholas-mainardi Jan 3, 2025
cc7fd0b
Make current_epoch in EpochStorage trait return error
nicholas-mainardi Jan 3, 2025
72c45e9
fmt
nicholas-mainardi Jan 3, 2025
2bf0658
Fix table name provided to core_index_keys
nicholas-mainardi Jan 3, 2025
cf1c60f
Avoid expenmsive JOIN in some queries
nicholas-mainardi Jan 10, 2025
cfc65ad
Optimize row cache SQL queries
nicholas-mainardi Jan 10, 2025
652e732
Optimize JOIN wide lineage rows tree + fix eth test
nicholas-mainardi Jan 10, 2025
64a30c9
Address comments
nicholas-mainardi Jan 13, 2025
2d99d5e
Optimize InMemoryEpochMapper + imporve handling of incremental user e…
nicholas-mainardi Jan 14, 2025
f5f7db2
Add untracked file
nicholas-mainardi Jan 14, 2025
91191ae
Add maximum size to epoch mapper cache
nicholas-mainardi Jan 14, 2025
869a968
fmt
nicholas-mainardi Jan 14, 2025
e548c1e
Improve fetch_many_at
nicholas-mainardi Jan 15, 2025
8b591ab
Address comments
nicholas-mainardi Jan 16, 2025
57c5c10
Add indexes + optimizes bracketer secondary index
nicholas-mainardi Jan 20, 2025
33077f4
fmt
nicholas-mainardi Jan 20, 2025
7ffb465
Fix pidgy_pinguit test
nicholas-mainardi Jan 20, 2025
8eab5b5
Split bracketer queries for performance
nicholas-mainardi Jan 21, 2025
ea59525
fmt
nicholas-mainardi Jan 21, 2025
737079d
Improve comments to bracketer secondary index
nicholas-mainardi Jan 21, 2025
9ae7296
Values extraction API working
Zyouell Feb 3, 2025
8c963fa
Updated Extraction Planner
Zyouell Feb 3, 2025
1298394
Fix after rebase
nicholas-mainardi Feb 3, 2025
73540da
fmt
nicholas-mainardi Feb 3, 2025
6fae445
Removed ReceiptQuery struct
Zyouell Feb 4, 2025
cc8326c
Change indexing integration test to support non-consecutive blocks
nicholas-mainardi Feb 4, 2025
eab6236
Updated for review comments
Zyouell Feb 5, 2025
e130bd9
Changed receipt proof query to make fewer calls
Zyouell Feb 5, 2025
143ffa6
Changed receipt proof query to make fewer calls
Zyouell Feb 5, 2025
f5c75af
Changed receipt proof query to make fewer calls
Zyouell Feb 5, 2025
2f13f53
Query in integration test compatible with non-conseuctive blocks
nicholas-mainardi Feb 6, 2025
54a23a2
Fix typo in bracketer_primary_index query
nicholas-mainardi Feb 6, 2025
71961da
merged with feat/support_non_consecutive_blocks_ryhope
Zyouell Feb 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
835 changes: 455 additions & 380 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ alloy = { version = "0.6", default-features = false, features = [
"rlp",
"rpc",
"rpc-types",
"json-rpc",
"signer-local",
"sol-types",
"transport-http",
"transports",
"postgres",
] }

anyhow = "1.0"
base64 = "0.22"
bb8 = "0.8.5"
Expand Down Expand Up @@ -75,7 +77,7 @@ rand_chacha = "0.3.1"
revm = { version = "3.5", default-features = false }
rlp = "0.5"
rstest = "0.23"
serde = { version = "1.0", features = ["derive"] }
serde = { version = "1.0", features = ["derive", "std"] }
serde_json = "1.0"
serial_test = "3.0"
sha2 = "0.10"
Expand Down
2 changes: 1 addition & 1 deletion inspect/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::repl::PayloadFormatter;
pub(crate) type IndexDb = MerkleTreeKvDb<
BlockTree,
IndexNode<BlockPrimaryIndex>,
PgsqlStorage<BlockTree, IndexNode<BlockPrimaryIndex>>,
PgsqlStorage<BlockTree, IndexNode<BlockPrimaryIndex>, false>,
>;

struct IndexPayloadFormatterDisplay {
Expand Down
11 changes: 7 additions & 4 deletions inspect/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use repl::Repl;
use rows::{RowDb, RowPayloadFormatter};
use ryhope::{
storage::pgsql::{SqlServerConnection, SqlStorageSettings, ToFromBytea},
Epoch, InitSettings,
InitSettings, UserEpoch,
};
use serde::Serialize;

Expand All @@ -26,7 +26,7 @@ struct Args {

#[arg(short = 'E', long = "at")]
/// If set, try to view the tree at this epoch
epoch: Option<Epoch>,
epoch: Option<UserEpoch>,

#[command(subcommand)]
/// The type of tree to load from the database
Expand Down Expand Up @@ -77,6 +77,8 @@ async fn main() -> Result<()> {
SqlStorageSettings {
source: SqlServerConnection::NewConnection(args.db_uri.clone()),
table: args.db_table,
external_mapper: None, // not necessary even if there is an external epoch mapper,
// since we are initializing the tree with `InitSettings::MustExist`
},
)
.await?;
Expand All @@ -91,7 +93,7 @@ async fn main() -> Result<()> {

let mut repl = Repl::new(tree_db, payload_fmt).await?;
if let Some(epoch) = args.epoch {
repl.set_epoch(epoch)?;
repl.set_epoch(epoch).await?;
}
repl.run().await
}
Expand All @@ -101,6 +103,7 @@ async fn main() -> Result<()> {
SqlStorageSettings {
source: SqlServerConnection::NewConnection(args.db_uri.clone()),
table: args.db_table,
external_mapper: None,
},
)
.await?;
Expand All @@ -109,7 +112,7 @@ async fn main() -> Result<()> {

let mut repl = Repl::new(tree_db, payload_fmt).await?;
if let Some(epoch) = args.epoch {
repl.set_epoch(epoch)?;
repl.set_epoch(epoch).await?;
}
repl.run().await
}
Expand Down
22 changes: 11 additions & 11 deletions inspect/src/repl.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use anyhow::{anyhow, bail};
use anyhow::{anyhow, bail, Result};
use colored::Colorize;
use dialoguer::{console, theme::ColorfulTheme, FuzzySelect, Input};
use itertools::Itertools;
Expand All @@ -8,7 +8,7 @@ use ryhope::{
TreeStorage,
},
tree::{MutableTree, PrintableTree, TreeTopology},
Epoch, MerkleTreeKvDb, NodePayload,
MerkleTreeKvDb, NodePayload, UserEpoch,
};
use std::io::Write;
use tabled::{builder::Builder, settings::Style};
Expand Down Expand Up @@ -57,7 +57,7 @@ pub(crate) struct Repl<
F: PayloadFormatter<V>,
> {
current_key: T::Key,
current_epoch: Epoch,
current_epoch: UserEpoch,
db: MerkleTreeKvDb<T, V, S>,
tty: console::Term,
payload_fmt: F,
Expand All @@ -77,7 +77,7 @@ impl<
{
pub async fn new(db: MerkleTreeKvDb<T, V, S>, payload_fmt: F) -> anyhow::Result<Self> {
let current_key = db.root().await?.ok_or(anyhow!("tree is empty"))?;
let current_epoch = db.current_epoch();
let current_epoch = db.current_epoch().await?;

Ok(Self {
current_key,
Expand Down Expand Up @@ -105,19 +105,19 @@ impl<
.unwrap();
}

pub fn set_epoch(&mut self, epoch: Epoch) -> anyhow::Result<()> {
if epoch < self.db.initial_epoch() {
pub async fn set_epoch(&mut self, epoch: UserEpoch) -> Result<()> {
if epoch < self.db.initial_epoch().await {
bail!(
"epoch `{}` is older than initial epoch `{}`",
epoch,
self.db.initial_epoch()
self.db.initial_epoch().await
);
}
if epoch > self.db.current_epoch() {
if epoch > self.db.current_epoch().await? {
bail!(
"epoch `{}` is newer than latest epoch `{}`",
epoch,
self.db.current_epoch()
self.db.current_epoch().await?
);
}

Expand Down Expand Up @@ -147,9 +147,9 @@ impl<

async fn travel(&mut self) -> anyhow::Result<()> {
loop {
let epoch: Epoch = Input::new().with_prompt("target epoch:").interact_text()?;
let epoch: UserEpoch = Input::new().with_prompt("target epoch:").interact_text()?;

self.set_epoch(epoch)?;
self.set_epoch(epoch).await?;
}
}

Expand Down
2 changes: 1 addition & 1 deletion inspect/src/rows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::repl::PayloadFormatter;
pub(crate) type RowDb = MerkleTreeKvDb<
RowTree,
RowPayload<BlockPrimaryIndex>,
PgsqlStorage<RowTree, RowPayload<BlockPrimaryIndex>>,
PgsqlStorage<RowTree, RowPayload<BlockPrimaryIndex>, true>,
>;

struct RowPayloadFormatterDisplay {
Expand Down
2 changes: 1 addition & 1 deletion mp2-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ hex.workspace = true
rand.workspace = true
rstest.workspace = true
tokio.workspace = true

mp2_test = { path = "../mp2-test" }


[features]
ci = ["mp2_test/ci"]
original_poseidon = []
Loading