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

feat: add initial ethereum light client #150

Merged
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
a577c12
current state minus cosmwasm
gjermundgaraba Dec 4, 2024
bb1a04f
testing and cleanup
gjermundgaraba Dec 5, 2024
39c0414
fork tree_hash for now
gjermundgaraba Dec 5, 2024
8052da9
lint
gjermundgaraba Dec 5, 2024
c657b38
Merge branch 'main' into gjermund/142-create-initial-08-wasm-ethereum…
gjermundgaraba Dec 5, 2024
699cdf4
add run-script
gjermundgaraba Dec 6, 2024
14ebe5a
Merge branch 'main' into gjermund/142-create-initial-08-wasm-ethereum…
gjermundgaraba Dec 6, 2024
9022dfa
add wasm target to cosmwasm build in ci
gjermundgaraba Dec 6, 2024
2387472
move features out of top-level cargo
gjermundgaraba Dec 6, 2024
d95dd17
Merge branch 'main' into gjermund/142-create-initial-08-wasm-ethereum…
gjermundgaraba Dec 6, 2024
a3854e4
lint and fix just lint command
gjermundgaraba Dec 6, 2024
ee4df25
fix cosmwasm ci build
gjermundgaraba Dec 6, 2024
60730c2
cr fixes
gjermundgaraba Dec 6, 2024
26cb328
Merge branch 'main' into gjermund/142-create-initial-08-wasm-ethereum…
gjermundgaraba Dec 7, 2024
e9c1626
cargo lock
gjermundgaraba Dec 7, 2024
8577c38
fix e2e test in pow mode
gjermundgaraba Dec 7, 2024
b9d0ef4
add cosmwasm-check to ci
gjermundgaraba Dec 7, 2024
2d1c2b2
added unit tests on cosmwasm contract
gjermundgaraba Dec 7, 2024
abf2ef9
some minor cleanup before review
gjermundgaraba Dec 7, 2024
34df628
Update packages/ethereum-light-client/src/types/sync_committee.rs
gjermundgaraba Dec 9, 2024
1026bd2
Update programs/08-wasm-eth/src/msg.rs
gjermundgaraba Dec 9, 2024
001807f
add source errors to error messages
gjermundgaraba Dec 9, 2024
4021f54
remove From trait for json serializaiton
gjermundgaraba Dec 9, 2024
b4de277
remove no_std feature from typenum
gjermundgaraba Dec 9, 2024
2f6b5da
fix spacing issue
gjermundgaraba Dec 9, 2024
5ec6b9b
tree_hash using workspace
gjermundgaraba Dec 9, 2024
d0b7eac
Update programs/08-wasm-eth/src/state.rs
gjermundgaraba Dec 9, 2024
1991845
consistent returns macro usage
gjermundgaraba Dec 9, 2024
8ca1579
move optimized wasm build to justfile
gjermundgaraba Dec 9, 2024
6b5acb1
use div_ceil
gjermundgaraba Dec 9, 2024
6192e7e
Update packages/ethereum-light-client/src/types/wrappers.rs
gjermundgaraba Dec 9, 2024
82a4493
consistent line breaks for wrapper tree_hash fns
gjermundgaraba Dec 9, 2024
c346d0b
Update packages/ethereum-light-client/src/types/sync_committee.rs
gjermundgaraba Dec 9, 2024
afe0db9
rename load_fixture
gjermundgaraba Dec 9, 2024
f205908
move and rename cw light client program
gjermundgaraba Dec 9, 2024
d1e9199
remove tendermint proto crate
gjermundgaraba Dec 9, 2024
9dd789a
remove export metadata
gjermundgaraba Dec 9, 2024
e0d216e
update wasm ci file name for check
gjermundgaraba Dec 10, 2024
68e99f1
move and use branch consts everywhere
gjermundgaraba Dec 10, 2024
c9de44d
add readme with WIP warnings and acknowledgements
gjermundgaraba Dec 10, 2024
fc9958a
change ensure to macro
gjermundgaraba Dec 10, 2024
a4ac4aa
added unit tests for supermajority check
gjermundgaraba Dec 10, 2024
68a50d2
move rust fixtures into a single file per test
gjermundgaraba Dec 10, 2024
9cae4fa
docs: updated readmes
srdtrk Dec 11, 2024
a56859d
docs: fully linted and documented wasm client
srdtrk Dec 11, 2024
c792160
refactor: custom query
srdtrk Dec 11, 2024
b99018f
docs: update README
srdtrk Dec 11, 2024
52dfc31
docs: refactored and added docs to all of `ethereum-light-client`
srdtrk Dec 11, 2024
13caeb1
refactor: use match instead of if
srdtrk Dec 11, 2024
0442375
lint: fixed clippy complaint
srdtrk Dec 11, 2024
373d094
docs: added linting and docs to triedb
srdtrk Dec 11, 2024
2b5eaa0
deps: added std feature for error impl
srdtrk Dec 11, 2024
b1e90e2
imp: removed ethereum-utils::base64
srdtrk Dec 11, 2024
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
Prev Previous commit
Next Next commit
consistent line breaks for wrapper tree_hash fns
gjermundgaraba committed Dec 9, 2024
commit 82a4493097770c6dae64fccb922380d73fe495cd
5 changes: 2 additions & 3 deletions packages/ethereum-light-client/src/types/wrappers.rs
Original file line number Diff line number Diff line change
@@ -79,7 +79,6 @@ impl TreeHash for WrappedBloom {
let leaves = self.0.len().div_ceil(BYTES_PER_CHUNK);

let mut hasher = MerkleHasher::with_leaves(leaves);

for item in &self.0 {
hasher.write(item.tree_hash_root()[..1].as_ref()).unwrap()
}
@@ -108,8 +107,8 @@ impl<const N: usize> TreeHash for WrappedBranch<N> {

fn tree_hash_root(&self) -> tree_hash::Hash256 {
let leaves = self.0.len().div_ceil(BYTES_PER_CHUNK);
let mut hasher = MerkleHasher::with_leaves(leaves);

let mut hasher = MerkleHasher::with_leaves(leaves);
for item in &self.0 {
hasher.write(item.tree_hash_root()[..1].as_ref()).unwrap()
}
@@ -150,8 +149,8 @@ impl TreeHash for WrappedVecBlsPublicKey {

fn tree_hash_root(&self) -> tree_hash::Hash256 {
let leaves = self.0.len();
let mut hasher = MerkleHasher::with_leaves(leaves);

let mut hasher = MerkleHasher::with_leaves(leaves);
for item in &self.0 {
hasher.write(item.tree_hash_root().as_ref()).unwrap()
}

Unchanged files with check annotations Beta

fn tree_hash_root(&self) -> Hash256 {
let values_per_chunk = BYTES_PER_CHUNK;
let minimum_chunk_count = (48 + values_per_chunk - 1) / values_per_chunk;

Check warning on line 101 in packages/tree_hash/src/impls.rs

GitHub Actions / fmt-and-clippy

manually reimplementing `div_ceil`
merkle_root(self, minimum_chunk_count)
}
}
Slice(&'a [u8]),
}
impl<'a> Preimage<'a> {

Check warning on line 22 in packages/tree_hash/src/merkle_hasher.rs

GitHub Actions / fmt-and-clippy

the following explicit lifetimes could be elided: 'a
/// Returns a 32-byte slice.
fn as_bytes(&self) -> &[u8] {
match self {
);
// The number of leaves that can be made directly from `bytes`.
let leaves_with_values = (bytes.len() + (BYTES_PER_CHUNK - 1)) / BYTES_PER_CHUNK;

Check warning on line 50 in packages/tree_hash/src/merkleize_padded.rs

GitHub Actions / fmt-and-clippy

manually reimplementing `div_ceil`
// The number of parents that have at least one non-padding leaf.
//
}
fn num_sanitized_leaves(num_bytes: usize) -> usize {
let leaves = (num_bytes + HASHSIZE - 1) / HASHSIZE;

Check warning on line 76 in packages/tree_hash/src/merkleize_standard.rs

GitHub Actions / fmt-and-clippy

manually reimplementing `div_ceil`
leaves.next_power_of_two()
}
/// `minimum_leaf_count` will only be used if it is greater than or equal to the minimum number of leaves that can be created from `bytes`.
pub fn merkle_root(bytes: &[u8], minimum_leaf_count: usize) -> Hash256 {
let leaves = std::cmp::max(
(bytes.len() + (HASHSIZE - 1)) / HASHSIZE,

Check warning on line 28 in packages/tree_hash/src/lib.rs

GitHub Actions / fmt-and-clippy

manually reimplementing `div_ceil`
minimum_leaf_count,
);
}
/// Punch through references.
impl<'a, T> TreeHash for &'a T

Check warning on line 124 in packages/tree_hash/src/lib.rs

GitHub Actions / fmt-and-clippy

the following explicit lifetimes could be elided: 'a
where
T: TreeHash,
{
InvalidSignature(InvalidSignatureErr),
}
impl<'a> BlsVerify for BlsVerifier<'a> {

Check warning on line 43 in programs/08-wasm-eth/src/custom_query.rs

GitHub Actions / fmt-and-clippy

the following explicit lifetimes could be elided: 'a
type Error = BlsVerifierError;
fn fast_aggregate_verify(