reth icon indicating copy to clipboard operation
reth copied to clipboard

feat: add duptable support for `reth db get`

Open dragan2234 opened this issue 1 year ago • 4 comments

Closes #2836

dragan2234 avatar May 29 '23 14:05 dragan2234

Tables:

    (TableType::DupSort, PlainStorageState::const_name()),
    (TableType::DupSort, AccountChangeSet::const_name()),
    (TableType::DupSort, StorageChangeSet::const_name()),
    (TableType::DupSort, HashedStorage::const_name()),
    (TableType::DupSort, StoragesTrie::const_name()),

dragan2234 avatar May 29 '23 18:05 dragan2234

Right now it works this way:

reth db get-dup <table> <key> <subkey>

dragan2234 avatar May 30 '23 19:05 dragan2234

Codecov Report

Merging #2897 (8d45e47) into main (e8b09cc) will decrease coverage by 52.12%. The diff coverage is 0.00%.

:exclamation: Current head 8d45e47 differs from pull request most recent head ccb2f2b. Consider uploading reports for the commit ccb2f2b to get more accurate results

@@             Coverage Diff             @@
##             main    #2897       +/-   ##
===========================================
- Coverage   69.48%   17.36%   -52.12%     
===========================================
  Files         535      515       -20     
  Lines       71761    66778     -4983     
===========================================
- Hits        49860    11595    -38265     
- Misses      21901    55183    +33282     
Flag Coverage Δ
integration-tests 17.36% <0.00%> (+1.01%) :arrow_up:
unit-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
bin/reth/src/db/get.rs 0.00% <0.00%> (-75.65%) :arrow_down:
bin/reth/src/db/mod.rs 0.00% <0.00%> (-10.39%) :arrow_down:
bin/reth/src/utils.rs 0.00% <0.00%> (-4.69%) :arrow_down:

... and 429 files with indirect coverage changes

codecov-commenter avatar May 31 '23 20:05 codecov-commenter

Thanks for the review. Just to note: there is this pr: https://github.com/paradigmxyz/reth/pull/2935 which needs to be merged before merging this one since it changes a few things related to this pr

dragan2234 avatar May 31 '23 21:05 dragan2234

what I'm looking at right now is how to generate the view_dupsort function inside the same macro, but only for DupSort table type. Since that function would need to have type view_dupsort<DupSor>. I'm looking into the macro's identifiers, and expressions but still struggling to do it correctly

dragan2234 avatar Jun 25 '23 21:06 dragan2234