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

Comm host client proxy return rollup blob #19

Merged
merged 29 commits into from
Jan 3, 2025

Conversation

bxue-l2
Copy link
Collaborator

@bxue-l2 bxue-l2 commented Dec 22, 2024

Alternative approach to integrate with eigenda to #18

This PR does the follows

  • host fetch blob from proxy, assuming the proxy returns the original rollup-data (i.e compressed batches)
  • host does the codec, and prepend the blob_header (containting the rollup-date.len())
  • host splits data into field element by field element, where key is hash of 96 bytes. Where the first 64 bytes contain kzg commitment, the last 8 bytes contains the field element index
  • host does not provide a proof at the end
  • client can read field element by field element
  • client check if any returned byte is empty, return early if true
  • once the entire blob is received, the eigenda_data.rs removes the header again. Note we don't do IFFT/FFT anywhere
  • Inside the eigenda.rs, we perform a check on blob staleness. However, it is not a complete feature.

This PR contains #17

bin/client/justfile Outdated Show resolved Hide resolved
bin/host/src/eigenda_fetcher/mod.rs Show resolved Hide resolved
bin/host/src/eigenda_fetcher/mod.rs Outdated Show resolved Hide resolved
crates/eigenda/src/certificate.rs Show resolved Hide resolved
crates/eigenda/src/constant.rs Outdated Show resolved Hide resolved
// The preimage oracle key for each field element is the keccak256 hash of
// `abi.encodePacked(cert.KZGCommitment, uint256(i))`

let mut blob_key = [0u8; 96];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason why we make this 96 long instead of 72? [65,88) is always just 0 bytes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curerntly, op uses 80 Bytes, even though their commitment is only 48 bytes. there is extra 32 Bytes.
Since our commitment is 64Bytes, so in total 96.

However, I recall the extra 32 bytes for op 4844 is for bytes alighment. We can change it later

crates/eigenda/src/certificate.rs Outdated Show resolved Hide resolved
crates/eigenda/src/eigenda.rs Outdated Show resolved Hide resolved
@samlaf samlaf force-pushed the comm-host-client-proxy-return-rollup-blob branch from 781000e to 12a0b47 Compare January 2, 2025 21:12
@samlaf
Copy link
Collaborator

samlaf commented Jan 2, 2025

@bxue-l2 I just rebased + fixed the README merge conflict.

bin/client/justfile Outdated Show resolved Hide resolved
@bxue-l2
Copy link
Collaborator Author

bxue-l2 commented Jan 2, 2025

We should pull the decode function from eigenda_data.rs into a separate module that handles both encode and decode, called it codec.

So that the bin/host/src/eigenda_fetcher/mod.rs can call the function. Inside the codec, we can more robustly do the test

@bxue-l2 bxue-l2 force-pushed the comm-host-client-proxy-return-rollup-blob branch from 1bc16c8 to e94a755 Compare January 3, 2025 00:39
@bxue-l2 bxue-l2 force-pushed the comm-host-client-proxy-return-rollup-blob branch from e94a755 to 736de0b Compare January 3, 2025 00:50
Bowen and others added 2 commits January 2, 2025 17:49
This reverts commit f87fd34.
@bxue-l2 bxue-l2 merged commit 6da009d into master Jan 3, 2025
5 checks passed
@bxue-l2 bxue-l2 deleted the comm-host-client-proxy-return-rollup-blob branch January 3, 2025 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants