Skip to content

Commit

Permalink
feat(basic_witness_producer_input): Add Basic Witness Producer Input …
Browse files Browse the repository at this point in the history
…component (matter-labs#156)

# What ❔

This PR introduces a new component that will be ran alongside all
components in the service. The component extracts all information needed
for running Basic Witness Generator in a binary serialized Input and
uploads it to Object Store (GCS for now).

## Why ❔

Part of work decoupling Prover Subsystems from Server Core. Today,
Witness Generators need Server Core Database's access to generate
witnesses. More information can be found
[here](https://www.notion.so/matterlabs/Decouple-Witness-Generator-from-Core-Database-313ece3293d74ee8aea1d1fca823df15)
for the Witness Generator split and
[here](https://www.notion.so/matterlabs/Segregating-prover-and-server-to-use-API-for-communication-6cdcb7a508e84420bdfcb153af0e2524)
for the Prover Subsystems and Server core split.

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [x] Tests for the changes have been added / updated.
- [x] Documentation comments have been added / updated.
- [x] Code has been formatted via `zk fmt` and `zk lint`.
  • Loading branch information
EmilLuta authored Oct 26, 2023
1 parent f048485 commit 3cd24c9
Show file tree
Hide file tree
Showing 27 changed files with 1,156 additions and 188 deletions.
2 changes: 1 addition & 1 deletion core/bin/zksync_server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct Cli {
/// Comma-separated list of components to launch.
#[arg(
long,
default_value = "api,tree,eth,data_fetcher,state_keeper,witness_generator,housekeeper"
default_value = "api,tree,eth,data_fetcher,state_keeper,witness_generator,housekeeper,basic_witness_input_producer"
)]
components: ComponentsToRun,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
DROP INDEX IF EXISTS idx_basic_witness_input_producer_jobs_status_processing_attempts;

DROP TABLE IF EXISTS basic_witness_input_producer_jobs;

DROP TYPE IF EXISTS basic_witness_input_producer_job_status;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CREATE TYPE basic_witness_input_producer_job_status AS ENUM ('Queued', 'ManuallySkipped', 'InProgress', 'Successful', 'Failed');

CREATE TABLE IF NOT EXISTS basic_witness_input_producer_jobs
(
l1_batch_number BIGINT NOT NULL PRIMARY KEY,
attempts SMALLINT NOT NULL DEFAULT 0,
status basic_witness_input_producer_job_status,
picked_by TEXT,
input_blob_url TEXT,
error TEXT,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,
processing_started_at TIMESTAMP,
time_taken TIME
);

CREATE INDEX IF NOT EXISTS idx_basic_witness_input_producer_jobs_status_processing_attempts
ON basic_witness_input_producer_jobs (status, processing_started_at, attempts);
Loading

0 comments on commit 3cd24c9

Please sign in to comment.