Skip to content

Commit

Permalink
Add force_evmla flag
Browse files Browse the repository at this point in the history
  • Loading branch information
perekopskiy committed Feb 21, 2024
1 parent 40b266d commit 06d263f
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 10 deletions.
1 change: 1 addition & 0 deletions core/bin/contract-verifier/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ impl ContractVerifier {
let settings = Settings {
output_selection: Some(default_output_selection),
is_system: request.req.is_system,
force_evmla: request.req.force_evmla,
other: serde_json::Value::Object(
vec![("optimizer".to_string(), optimizer_value)]
.into_iter()
Expand Down
8 changes: 7 additions & 1 deletion core/bin/contract-verifier/src/zksolc_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub struct Source {
}

/// Compiler settings.
/// There are fields like `output_selection` and `is_system` which are accessed by contract verifier explicitly.
/// There are fields like `output_selection`, `is_system`, `force_evmla` which are accessed by contract verifier explicitly.
/// Other fields are accumulated in `other`, this way every field that was in the original request will be passed to a compiler.
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
Expand All @@ -45,6 +45,9 @@ pub struct Settings {
/// Flag for system compilation mode.
#[serde(default)]
pub is_system: bool,
/// Flag to force evmla IR.
#[serde(default)]
pub force_evmla: bool,
/// Other fields.
#[serde(flatten)]
pub other: serde_json::Value,
Expand Down Expand Up @@ -103,6 +106,9 @@ impl ZkSolc {
if input.settings.is_system {
command.arg("--system-mode");
}
if input.settings.force_evmla {
command.arg("--force-evmla");
}
}
command
.arg("--solc")
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE contract_verification_requests DROP COLUMN force_evmla;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE contract_verification_requests ADD COLUMN IF NOT EXISTS force_evmla BOOLEAN NOT NULL DEFAULT false;
10 changes: 7 additions & 3 deletions core/lib/dal/src/contract_verification_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ impl ContractVerificationDal<'_, '_> {
optimizer_mode,
constructor_arguments,
is_system,
force_evmla,
status,
created_at,
updated_at
)
VALUES
($1, $2, $3, $4, $5, $6, $7, $8, $9, 'queued', NOW(), NOW())
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, 'queued', NOW(), NOW())
RETURNING
id
"#,
Expand All @@ -92,6 +93,7 @@ impl ContractVerificationDal<'_, '_> {
query.optimizer_mode,
query.constructor_arguments.0,
query.is_system,
query.force_evmla,
)
.fetch_one(self.storage.conn())
.await
Expand Down Expand Up @@ -149,7 +151,8 @@ impl ContractVerificationDal<'_, '_> {
optimization_used,
optimizer_mode,
constructor_arguments,
is_system
is_system,
force_evmla
"#,
&processing_timeout
)
Expand Down Expand Up @@ -469,7 +472,8 @@ impl ContractVerificationDal<'_, '_> {
optimization_used,
optimizer_mode,
constructor_arguments,
is_system
is_system,
force_evmla
FROM
contract_verification_requests
WHERE
Expand Down
2 changes: 2 additions & 0 deletions core/lib/dal/src/models/storage_verification_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub struct StorageVerificationRequest {
pub optimizer_mode: Option<String>,
pub constructor_arguments: Vec<u8>,
pub is_system: bool,
pub force_evmla: bool,
}

impl From<StorageVerificationRequest> for VerificationRequest {
Expand All @@ -44,6 +45,7 @@ impl From<StorageVerificationRequest> for VerificationRequest {
optimizer_mode: value.optimizer_mode,
constructor_arguments: value.constructor_arguments.into(),
is_system: value.is_system,
force_evmla: value.force_evmla,
},
}
}
Expand Down
2 changes: 2 additions & 0 deletions core/lib/types/src/contract_verification_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ pub struct VerificationIncomingRequest {
pub constructor_arguments: Bytes,
#[serde(default)]
pub is_system: bool,
#[serde(default)]
pub force_evmla: bool,
}

#[derive(Debug, Eq, PartialEq, Clone, Copy)]
Expand Down

0 comments on commit 06d263f

Please sign in to comment.