-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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(eigenda): implement eigenDA client remaining features #3243
base: main
Are you sure you want to change the base?
feat(eigenda): implement eigenDA client remaining features #3243
Conversation
impl rlp encoding
Implement non auth blob dispersal for eigen client --------- Co-authored-by: Gianbelinche <39842759+gianbelinche@users.noreply.github.com>
feat(eigen-client-extra-features): get inclusion data
add test for remote disperser cfg
* initial commit * Add tests * Add memstore * Add assert to tests * Add rest of memstore * Address pr comments * Remove to retriable error * Fix conflicts * Document memstore * Fix typo --------- Co-authored-by: Juan Munoz <juanmunoz890@gmail.com>
blob size limit --------- Co-authored-by: Gianbelinche <39842759+gianbelinche@users.noreply.github.com>
* initial commit * Add tests * Add memstore * Add assert to tests * Add rest of memstore * Add soft confirmations * Remove print * Address pr comments * Remove to retriable error * Fix conflicts * Add inclusion data * Change status query timeout to millis * Document memstore * Fix typo * Fix typo * Format --------- Co-authored-by: Juan Munoz <juanmunoz890@gmail.com>
* initial commit * Add tests * Add memstore * Add assert to tests * Add rest of memstore * Address pr comments * Remove to retriable error * Fix conflicts * Add verifier * Fix verifier * Add path to points to config * Fix typo * Fix eigenda env test * Fix verifier test * Move eigendaservicemanager to generated * Remove unneeded imports * Document verifier * Modify errors * Address comments * Fix conflicts --------- Co-authored-by: Juan Munoz <juanmunoz890@gmail.com>
* initial commit * move file location * fix step
* Add eth confirmation depth * Fix error
#329) * Remove unused custom quorum numbers * Add serial to tests
feat(eigen-client-extra-features): fix clippy and add doc
feat(eigen-client-extra-features): merge main
…dule-update feat(eigen-client-extra-features): update contracts submodule
* Move inclusion logic * Remove unused import
* Move inclusion logic * Remove verify cert
* Change eth conf depth for settlement layer * Remove blob size limit * Move reserved * Change function name * Add constants to lib * Fix compilation
* initial commit * remove anyhow err * Format code * Fix compilation --------- Co-authored-by: Gianbelinche <39842759+gianbelinche@users.noreply.github.com>
* Add option to download points * Fix test * Fix clippy * Change name to points source * Fix test * Fix test
…s with mock tests (#356) * initial commit * create verifier client trait * remove unwraps * Update core/node/da_clients/src/eigen/verifier.rs Ignore test Co-authored-by: Gianbelinche <39842759+gianbelinche@users.noreply.github.com> * Update core/node/da_clients/src/eigen/sdk.rs Co-authored-by: Gianbelinche <39842759+gianbelinche@users.noreply.github.com> * change ignore test comment * Format code --------- Co-authored-by: Gianbelinche <39842759+gianbelinche@users.noreply.github.com>
…on docs (#360) * Remove steps to run from integration docs * Combine readme * Clarify readme
…and-main feat(eigen-client-extra-features): Merge Main
* Remove verify cert * Change names * Create aux functions * Remove milestones * Add url crate to save pointsz * Remove hex and rlp * Make get inclusion data not return entire blob info * Remove hardcoded function selectors * move tests to a different file * Remove retrys and add option to get inclusion data * Solve clippy * Get blob data from db * Add async trait * Change function to get blob data * Remove path to points in favor of links * Change link to url * Update core/lib/env_config/src/da_client.rs Co-authored-by: juan518munoz <62400508+juan518munoz@users.noreply.github.com> --------- Co-authored-by: juan518munoz <62400508+juan518munoz@users.noreply.github.com>
Eigen client extra merge main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR logic look great, left mostly some nits and style-related comments
core/node/node_framework/src/implementations/layers/da_clients/eigen.rs
Outdated
Show resolved
Hide resolved
core/node/node_framework/src/implementations/layers/da_clients/eigen.rs
Outdated
Show resolved
Hide resolved
* Add envy load * Readd proto reference * Rename blob id to request id * Make literals constants * Make point size constant * Get pool unique * Remaining comments * Fix comment * Add check for failed states * Change l1 name
Merge main to extra features
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great! I will start the CI and ask for another reviewer to do a final look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some preliminary comments. Will try to do another review round later this week.
pub disperser_rpc: String, | ||
/// Block height needed to reach in order to consider the blob finalized | ||
/// a value less or equal to 0 means that the disperser will not wait for finalization | ||
pub settlement_layer_confirmation_depth: i32, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do different negative values have semantic differences? If not, please use u32
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed here lambdaclass#375
pub disperser_rpc: String, | ||
/// Block height needed to reach in order to consider the blob finalized | ||
/// a value less or equal to 0 means that the disperser will not wait for finalization | ||
pub settlement_layer_confirmation_depth: i32, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do different negative values have semantic differences? If not, please use u32
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed here lambdaclass#375
pub rpc_node_url: String, | ||
pub inclusion_polling_interval_ms: u64, | ||
/// URL of the Disperser RPC server | ||
pub disperser_rpc: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String::default()
is not a reasonable default for URLs; please #[derive(Default)]
(maybe replacing it with a manual impl, if the parameter does have a reasonable default value).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed here lambdaclass#375 , the testnet url was used as default
/// URL of the Ethereum RPC server | ||
pub eigenda_eth_rpc: Option<String>, | ||
/// Address of the service manager contract | ||
pub eigenda_svc_manager_address: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not Address
? Also, again, addresses don't have meaningful defaults, and ""
is not a valid address.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed here lambdaclass#375, the testnet URL was used as default
/// Url to the file containing the G1 point used for KZG | ||
pub g1_url: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any integrity checks for the file contents? What is the outcome of receiving invalid points (e.g., is this an attack vector)?
impl GetBlobData for GetBlobFromDB { | ||
async fn call(&self, input: &'_ str) -> anyhow::Result<Option<Vec<u8>>> { | ||
let pool = self.pool.clone(); | ||
let input = input.to_string(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allocation is not required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed here lambdaclass#375
.data_availability_dal() | ||
.get_blob_data_by_blob_id(&input) | ||
.await?; | ||
drop(conn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is useless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed here lambdaclass#375
|
||
#[async_trait::async_trait] | ||
impl GetBlobData for GetBlobFromDB { | ||
async fn call(&self, input: &'_ str) -> anyhow::Result<Option<Vec<u8>>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lifetime can be skipped, I think the only reason it's not flagged by Clippy is that it's inside the async_trait
proc macro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed here lambdaclass#375
self.verify_merkle_proof(cert.clone())?; | ||
self.verify_security_params(cert.clone()).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm reasonably sure cert
can be passed by ref at least for the last two methods (verify_batch
is tricky because of ethabi::Token
s created in hash_batch_metadata
). In general, please pass values by ref where possible; there are too many examples in this module and adjacent modules to highlight.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed here lambdaclass#375
core/node/da_clients/Cargo.toml
Outdated
rust-kzg-bn254.workspace = true | ||
ark-bn254.workspace = true | ||
num-bigint.workspace = true | ||
serial_test.workspace = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a dev dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed here lambdaclass#375
* Change settlement layer for u32 * Change string to address * Remove unwraps * Remove error from name * Remove unused to bytes * Rename call for get blob data * Revert "Change string to address" This reverts commit 6dd94d4. * Change string for address * feat(eigen-client-extra-features): address PR comments (part 2) (#374) * initial commit * clippy suggestion * feat(eigen-client-extra-features): address PR comments (part 3) (#376) * use keccak256 fn * simplify get_context_block * use saturating sub * feat(eigen-client-extra-features): address PR comments (part 4) (#378) * Replace decode bytes for ethabi * Add default to eigenconfig * Change str to url * Add index to data availability table * Address comments * Change error to verificationerror * Format code * feat(eigen-client-extra-features): address PR comments (part 5) (#377) * use trait object * prevent blocking non async code * clippy suggestion --------- Co-authored-by: juan518munoz <62400508+juan518munoz@users.noreply.github.com> --------- Co-authored-by: Gianbelinche <39842759+gianbelinche@users.noreply.github.com> --------- Co-authored-by: Gianbelinche <39842759+gianbelinche@users.noreply.github.com> * Format code --------- Co-authored-by: juan518munoz <62400508+juan518munoz@users.noreply.github.com>
What ❔
This PR adds extra functionality to the eigen client:
Why ❔
These features are needed to have a full featured client and to have the same features as when communicating with the EigenDA proxy.
Checklist
zkstack dev fmt
andzkstack dev lint
.