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

fix(prover): Remove FriProtocolVersionId #1510

Merged
merged 2 commits into from
Mar 27, 2024
Merged

Conversation

EmilLuta
Copy link
Contributor

@EmilLuta EmilLuta commented Mar 27, 2024

This is PR 2 of many to move us to safe Protocol Upgrades (phase 1).

FriProtocolVersionId was introduced as a cludge to serve as communication between core (which was saved from L1 straight to DB) and prover (which was manually configured from env vars). Whilst in theory it's possible to have an upgrade on core side without affecting prover, I don't envision this happening any time soon. Right now we maintain 2 different protocol numbers that cause confusion. This PR unifies the protocol ids.

Other relevant notes:

  • this is not exactly backwards compatible -- we'll need to deploy both core and prover at the same time, otherwise provers will go in crash loop. We can make it backwards compatible, but at our track record of deployments (and speed of deployments), I'm concerned we will slow everything down for no real reason. I see very small risks here
  • database tables in prover's end should be renamed to protocol_version as well (to be covered in next PR)
  • all our code base assumes the old prover's interface to hashes which is confusing and unnecessary. I propose we address those with following PR. The points there are (to be done on both databases and configs):
    • rename recursion_scheduler_level_vk_hash to snark_wrapper_vk_hash. This is what it represents today. I believe we can't change recursion_scheduler_level_vk_hash without changing snark_wrapper_vk_hash.
    • delete recursion_circuits_set_vks_hash; it's all 0.

This is PR 2 of many to move us to safe Protocol Upgrades (phase 1).

`FriProtocolVersionId` was introduced as a cludge to serve as
communication between core (which was saved from L1 straight to DB) and
prover (which was manually configured from env vars). Whilst in theory
it's possible to have an upgrade on core side without affecting prover,
I don't envision this happening any time soon. Right now we maintain
2 different protocol numbers that cause confusion. This PR unifies the
protocol ids.

Other relevant notes:
- this is not exactly backwards compatible -- we'll need to deploy both
  server and prover at the same time, otherwise provers will go in crash
  loop. We can make it backwards compatible, but at our track record of
  deployments (and speed of deployments), I'm concerned we will slow
  everything down for no real reason. I see very small risks here
- database tables in prover's end should be renamed to protocol_version
  as well (to be covered in next PR)
- all our code base assumes the old prover's interface to hashes which
  is confusing and unnecessary. I propose we address those with
  following PR. The points there are (to be done on both databases and
  configs):
    - rename `recursion_scheduler_level_vk_hash` to
      `snark_wrapper_vk_hash`. This is what it represents today. I
      believe we can't change `recursion_scheduler_level_vk_hash` without
      changing `snark_wrapper_vk_hash`.
    - delete 'recursion_circuits_set_vks_hash`; it's all 0.
    - (prover only) rename table to `protocol_versions` from
      `prover_fri_protocol_versions`
@EmilLuta EmilLuta marked this pull request as ready for review March 27, 2024 12:06
@EmilLuta EmilLuta requested review from mm-zk, Artemka374, Deniallugo, popzxc, ColoCarletti and ilitteri and removed request for mm-zk March 27, 2024 12:06
core/lib/prover_interface/src/api.rs Show resolved Hide resolved
@mm-zk
Copy link
Collaborator

mm-zk commented Mar 27, 2024

where does backwards incompatibility come from? (as AFAIK we actually used the same value for both)

@Flukena
Copy link

Flukena commented Mar 27, 2024

ok

@EmilLuta EmilLuta added this pull request to the merge queue Mar 27, 2024
Merged via the queue into main with commit 6aa51b0 Mar 27, 2024
38 checks passed
@EmilLuta EmilLuta deleted the evl-prover-protocol-upgrade-2 branch March 27, 2024 13:36
RomanBrodetski pushed a commit that referenced this pull request Mar 28, 2024
🤖 I have created a release *beep* *boop*
---


##
[22.1.0](core-v22.0.0...core-v22.1.0)
(2024-03-28)


### Features

* Drop prover tables in core database
([#1436](#1436))
([0d78122](0d78122))
* **en:** consistency checker persistent cursor
([#1466](#1466))
([03496e6](03496e6))
* **en:** Make snapshot syncing future-proof
([#1441](#1441))
([8c26a7a](8c26a7a))
* **genesis:** Using genesis config only during the genesis
([#1423](#1423))
([4b634fd](4b634fd))
* **node_framework:** Add a task to handle sigint
([#1471](#1471))
([2ba6527](2ba6527))
* **node-framework:** Add circuit breaker checker layer to framework
([#1452](#1452))
([2c7a6bf](2c7a6bf))
* **prover:** export prover traces through OTLP
([#1427](#1427))
([16dce75](16dce75))
* sigint initialization only after snapshots is applied
([#1356](#1356))
([c7c7356](c7c7356))
* Split witness generator timeout configs by round
([#1505](#1505))
([8074d01](8074d01))
* **state-keeper:** implement asynchronous RocksDB cache
([#1256](#1256))
([da41f63](da41f63))
* **state-keeper:** Refactor persistence in `StateKeeper`
([#1411](#1411))
([e26091a](e26091a))
* **state-keeper:** Remove `WitnessBlockState` generation from state
keeper ([#1507](#1507))
([8ae0355](8ae0355))
* Switch contract verification API to axum and get rid of actix-web
usage ([#1467](#1467))
([e7a9d61](e7a9d61))


### Bug Fixes

* **api:** `filters_disabled` should only affect HTTP endpoints
([#1493](#1493))
([8720568](8720568))
* **api:** Fix API server shutdown flow
([#1425](#1425))
([780f6b0](780f6b0))
* **prover:** Remove FriProtocolVersionId
([#1510](#1510))
([6aa51b0](6aa51b0))
* **prover:** Remove redundant LoadingMode
([#1496](#1496))
([e7583f4](e7583f4))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
github-merge-queue bot pushed a commit that referenced this pull request Mar 28, 2024
🤖 I have created a release *beep* *boop*
---


##
[12.2.0](prover-v12.1.0...prover-v12.2.0)
(2024-03-28)


### Features

* **api:** introduce mempool cache
([#1460](#1460))
([c5d6c4b](c5d6c4b))
* **commitment-generator:** `events_queue` shadow mode
([#1138](#1138))
([9bb47fa](9bb47fa))
* Drop prover tables in core database
([#1436](#1436))
([0d78122](0d78122))
* Follow-up for DAL split
([#1464](#1464))
([c072288](c072288))
* **prover:** export prover traces through OTLP
([#1427](#1427))
([16dce75](16dce75))
* **prover:** File-info tool to help prover debugging
([#1216](#1216))
([9759907](9759907))
* Separate Prover and Server DAL
([#1334](#1334))
([103a56b](103a56b))
* support running consensus from snapshot (BFT-418)
([#1429](#1429))
([f9f4d38](f9f4d38))


### Bug Fixes

* **api:** Fix API server shutdown flow
([#1425](#1425))
([780f6b0](780f6b0))
* **prover:** Remove FriProtocolVersionId
([#1510](#1510))
([6aa51b0](6aa51b0))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: Roman Brodetski <rb@matterlabs.dev>
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.

4 participants