-
Notifications
You must be signed in to change notification settings - Fork 113
Light client starter #1336
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
Light client starter #1336
Conversation
* kpp's changes for da * fix tests after kpp's changes * make prover service accept bytes so that it can work on different inputs * lint * rename prover to batch prover * move prover service to its own crate * rename prover related functions to batch prover * * rename more prover related things to batch prover * * create barebone light client prover crate * add runner to light client prover * fix cherry pick mistake on da changes * write native part skeleton for light client prover * add mock da and bitcoin da light client circuit guests * Fix light client method ids * Fix typo * Remove unused dep * Add Send + Sync to LightClientLedgerOps * Add light client to e2e test * Handle proof len 0 case * Cleanup light client l1 handler * Carry ledger db op outside * Remove empty checks * Disable rocksdb default feats * Implemented wait_for_proving_and_extract_output * Cleanup waiting for proof * Specify batch prover name in get code commitments method * Add light client code commitments by spec * Carry ledger db op into process * Rename prover_config_path arg to batch_prover_config_path * Add light client config opt to cli * lint * Update regtest config * Update gitignore and makefile * Update docs * Fix forgotten conflict * Fix merge conflicts * Cleanup create_new_light_client_prover * Add create_light_client_prover_service method * Remove unused bitcoin-e2e files * Use single code commitment --------- Co-authored-by: Roman Proskuryakoff <r.proskuryakoff@gmail.com> Co-authored-by: eyusufatik <esadyusufatik@gmail.com>
/// Give the guest a piece of advice non-deterministically | ||
fn add_hint<T: BorshSerialize>(&mut self, item: T); | ||
/// `item` is a borsh serialized input to the guest | ||
fn add_hint(&mut self, item: 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.
Why?
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.
had some problems regarding types idk
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.
We should fix it then?
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.
is it really important?
every adapter was doing borsh::to_vec()
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 think it is important as this is more error-prone. Enforcing a codec on data sharing level would be much safer and dev friendly to use.
65d73dd
to
4d38d84
Compare
bin/citrea/provers/risc0/guest-light-client-bitcoin/src/bin/light_client_bitcoin_da.rs
Show resolved
Hide resolved
/// Give the guest a piece of advice non-deterministically | ||
fn add_hint<T: BorshSerialize>(&mut self, item: T); | ||
/// `item` is a borsh serialized input to the guest | ||
fn add_hint(&mut self, item: 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.
is it really important?
every adapter was doing borsh::to_vec()
] | ||
|
||
[[package]] | ||
name = "brotli" |
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.
it's coming from primitives, and also bitcoin da verifier now needs it, need a lot of feature gating to prevent this I guess
Description
Added initial support for light client, and an example test. This PR is intended to give skeleton to light client both file structure-wise and behavior-wise. It is in no way complete functionality of light client.
IMPORTANT:
Before merging this pr, citrea-e2e pr chainwayxyz/citrea-e2e#20 should be merged, and rev in Cargo.toml should be updated accordingly.
Linked Issues
Testing
Describe how these changes were tested. If you've added new features, have you added unit tests?
Docs
Describe where this code is documented. If it changes a documented interface, have the docs been updated?