-
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: Poll DB and sign L1 batches (BFT-474) #2399
feat: Poll DB and sign L1 batches (BFT-474) #2399
Conversation
@RomanBrodetski I think it's correct to sign the hash of It might even be enough to sign just this and not the hash of So Solidity would have to verify something like |
5f43aff
to
ba0d8b2
Compare
## What ❔ Followup for some design discussions in #148 * Removes `BatchStore::unsigned_batch_numbers` * Add `BatchStore::earliest_batch_number_to_sign` * Add `BatchStore::latest_batch_number` * Changes `AttesterRunner` to have a mutable range of `earliest_batch_number` and `latest_batch_number` instead of querying `unsigned_batch_numbers` and filtering it with a `min_batch_number` ## Why ❔ This might be more intuitive than the original version. Another motivation was that the current implementation of `unsigned_batch_numbers` in matter-labs/zksync-era#2399 has to do two queries: 1) to figure out the latest batch number and 2) to find all batches without certificates within a limited range of the latest batch. Here we only query the latest batch number in each loop, and we forego the check on whether a QC already exists, otherwise we'd be back at doing two queries, or some ugly book keeping to only check it on the first loop after a restart. It should be cheap enough to publish a duplicate vote.
ba0d8b2
to
512a789
Compare
## What ❔ Bumps the version to 0.1.0-rc.2 ## Why ❔ So that we can merge matter-labs/zksync-era#2399 and matter-labs/zksync-era#2410
What ❔
Implements
PersistentBatchStore
methods added in matter-labs/era-consensus#148ConsensusDal::unsigned_batch_numbers
to retrieve L1 batch numbers without a QC after a given minimum batch numberStore::unsigned_batch_numbers
which return the unsigned batches that are max 10 batches older than the last oneConsensusDal::get_batch_to_sign
after finding out what to put intohash
ConsensusDal::insert_batch_certificate
to validate the correcthash
valueunsigned_batch_numbers
get_batch_to_sign
andinsert_batch_certificate
era-consensus
at the latest version instead of https://github.com/matter-labs/era-consensus/tree/bft-474-pairing-prev-version then delete that branchThe hash check has been implemented against the
StoredBatchInfo::hash()
which isn't available in the DAL crate.Why ❔
The consensus
Executor
will pollunsigned_batch_numbers
and submit attestations overget_batch_to_sign
. These methods decide 1) which batches to sign and 2) what content to sign.Checklist
zk fmt
andzk lint
.