ralexstokes / ssz-rs

Implementation of ethereum's `ssz`
Apache License 2.0
102 stars 40 forks source link

add `Indexed` trait to compute generalized indices #88

Closed ralexstokes closed 7 months ago

ralexstokes commented 1 year ago

part I of adding multiproofs:

adds an Indexed trait so types can compute their own generalized indices from statically defined paths into each SSZ data structure

and pulls in earlier multiproof code from #2.

TODO:

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: -9.58 :warning:

Comparison is base (e37de56) 75.29% compared to head (9977e20) 65.71%.

:exclamation: Current head 9977e20 differs from pull request most recent head 21ae1a8. Consider uploading reports for the commit 21ae1a8 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #88 +/- ## ========================================== - Coverage 75.29% 65.71% -9.58% ========================================== Files 18 21 +3 Lines 858 983 +125 ========================================== Hits 646 646 - Misses 212 337 +125 ``` | [Impacted Files](https://app.codecov.io/gh/ralexstokes/ssz-rs/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alex+Stokes) | Coverage Δ | | |---|---|---| | [ssz-rs/src/boolean.rs](https://app.codecov.io/gh/ralexstokes/ssz-rs/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alex+Stokes#diff-c3N6LXJzL3NyYy9ib29sZWFuLnJz) | `77.77% <0.00%> (-13.53%)` | :arrow_down: | | [ssz-rs/src/lib.rs](https://app.codecov.io/gh/ralexstokes/ssz-rs/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alex+Stokes#diff-c3N6LXJzL3NyYy9saWIucnM=) | `100.00% <ø> (ø)` | | | [ssz-rs/src/list.rs](https://app.codecov.io/gh/ralexstokes/ssz-rs/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alex+Stokes#diff-c3N6LXJzL3NyYy9saXN0LnJz) | `65.85% <0.00%> (-8.12%)` | :arrow_down: | | [ssz-rs/src/merkleization/mod.rs](https://app.codecov.io/gh/ralexstokes/ssz-rs/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alex+Stokes#diff-c3N6LXJzL3NyYy9tZXJrbGVpemF0aW9uL21vZC5ycw==) | `93.10% <ø> (ø)` | | | [...src/merkleization/multiproofs/generalized\_index.rs](https://app.codecov.io/gh/ralexstokes/ssz-rs/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alex+Stokes#diff-c3N6LXJzL3NyYy9tZXJrbGVpemF0aW9uL211bHRpcHJvb2ZzL2dlbmVyYWxpemVkX2luZGV4LnJz) | `0.00% <0.00%> (ø)` | | | [ssz-rs/src/merkleization/multiproofs/indexed.rs](https://app.codecov.io/gh/ralexstokes/ssz-rs/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alex+Stokes#diff-c3N6LXJzL3NyYy9tZXJrbGVpemF0aW9uL211bHRpcHJvb2ZzL2luZGV4ZWQucnM=) | `0.00% <0.00%> (ø)` | | | [ssz-rs/src/merkleization/multiproofs/mod.rs](https://app.codecov.io/gh/ralexstokes/ssz-rs/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alex+Stokes#diff-c3N6LXJzL3NyYy9tZXJrbGVpemF0aW9uL211bHRpcHJvb2ZzL21vZC5ycw==) | `0.00% <0.00%> (ø)` | | | [ssz-rs/src/uint.rs](https://app.codecov.io/gh/ralexstokes/ssz-rs/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alex+Stokes#diff-c3N6LXJzL3NyYy91aW50LnJz) | `80.00% <0.00%> (-8.32%)` | :arrow_down: | | [ssz-rs/src/vector.rs](https://app.codecov.io/gh/ralexstokes/ssz-rs/pull/88?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alex+Stokes#diff-c3N6LXJzL3NyYy92ZWN0b3IucnM=) | `76.13% <0.00%> (-6.58%)` | :arrow_down: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/ralexstokes/ssz-rs/pull/88/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alex+Stokes)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

ralexstokes commented 11 months ago

something to check out: https://github.com/lightclient/proof

ralexstokes commented 7 months ago

closing in lieu of #120