Skip to content

Commit

Permalink
feat(ssz): refactor and spec compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
benluelo committed May 1, 2024
1 parent 0c7029f commit 6e69b35
Show file tree
Hide file tree
Showing 65 changed files with 220,202 additions and 5,468 deletions.
123 changes: 70 additions & 53 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ members = [
"lib/scroll-verifier",
"lib/serde-utils",
"lib/ssz",
"lib/ssz/tests-generator",
"lib/ssz-derive",
"lib/tendermint-verifier",
"lib/unionlabs",
Expand Down
7 changes: 2 additions & 5 deletions lib/ethereum-verifier/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use sha2::{Digest, Sha256};
use ssz::{types::BitVector, TreeHash};
use ssz::{types::BitVector, Ssz};
use typenum::Unsigned;
use unionlabs::{
ethereum::{
Expand Down Expand Up @@ -103,10 +103,7 @@ pub fn compute_fork_data_root(current_version: Version, genesis_validators_root:
/// Return the signing root for the corresponding signing data
///
/// [See in consensus-spec](https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#compute_signing_root)
pub fn compute_signing_root<T: TreeHash>(
ssz_object: &T,
domain: Domain,
) -> ssz::tree_hash::Hash256 {
pub fn compute_signing_root<T: Ssz>(ssz_object: &T, domain: Domain) -> ssz::tree_hash::Hash256 {
SigningData {
object_root: ssz_object.tree_hash_root().into(),
domain,
Expand Down
2 changes: 1 addition & 1 deletion lib/ethereum-verifier/src/verify.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use hash_db::HashDB;
use memory_db::{HashKey, MemoryDB};
use ssz::TreeHash;
use ssz::Ssz;
use trie_db::{Trie, TrieDBBuilder};
use typenum::Unsigned;
use unionlabs::{
Expand Down
2 changes: 1 addition & 1 deletion lib/macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ proc-macro = true
[dependencies]
proc-macro2 = "1.0.78"
quote = "1.0.35"
syn = { version = "2.0.52", default-features = false, features = ["quote", "clone-impls", "parsing", "printing", "proc-macro", "derive", "fold"] }
syn = { version = "2.0.52", default-features = false, features = ["clone-impls", "parsing", "printing", "proc-macro", "derive", "fold"] }
Loading

0 comments on commit 6e69b35

Please sign in to comment.