Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Lighthouse Types #5

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ path = "rust-abi/lib.rs"
ethers = "2.0.10"
lightclient-circuits.workspace = true
eth-types.workspace = true
ssz_rs.workspace = true
halo2curves = { workspace = true }
itertools = { workspace = true }
halo2-base = { workspace = true }
halo2-base = { workspace = true }
tree_hash.workspace = true
17 changes: 5 additions & 12 deletions rust-abi/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#![feature(generic_const_exprs)]
use ethers::contract::abigen;
use lightclient_circuits::witness::SyncStepArgs;
use ssz_rs::Merkleized;
use std::ops::Deref;
use tree_hash::TreeHash;

abigen!(
Spectre,
"./out/Spectre.sol/Spectre.json";
Expand All @@ -28,20 +28,13 @@ impl<Spec: eth_types::Spec> From<SyncStepArgs<Spec>> for StepInput {
.map(|v| *v as u64)
.sum::<u64>();

let finalized_header_root: [u8; 32] = args
.finalized_header
.clone()
.hash_tree_root()
.unwrap()
.deref()
.try_into()
.unwrap();
let finalized_header_root: [u8; 32] = args.finalized_header.tree_hash_root().0;

let execution_payload_root: [u8; 32] = args.execution_payload_root.try_into().unwrap();

StepInput {
attested_slot: args.attested_header.slot,
finalized_slot: args.finalized_header.slot,
attested_slot: args.attested_header.slot.into(),
finalized_slot: args.finalized_header.slot.into(),
participation,
finalized_header_root,
execution_payload_root,
Expand Down