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

feat: add panic if commitment mode differs (Moved) #179

Open
wants to merge 129 commits into
base: feat_validium_pubdata_abstraction
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
dacd8c9
feat: Add more buckets to call tracer (#1137)
Artemka374 Feb 19, 2024
00d3429
feat(vlog): Remove env getters from vlog (#1077)
popzxc Feb 20, 2024
b538d1a
feat(api): Create RPC method to return all tokens (#1103)
slowli Feb 20, 2024
dc2b827
fix(zk_stack): Use deployer private key and remove create2 address (#…
Deniallugo Feb 20, 2024
2a766a7
feat(shared bridge): preparation for shared bridge migration (server)…
ly0va Feb 20, 2024
22099cb
feat(en): Take into account nonce from tx proxy (#995)
Deniallugo Feb 20, 2024
b567e6c
docs(db): Document DB invariants after snapshot recovery (#1133)
slowli Feb 20, 2024
8b0cc4a
feat(prover): Added 4844 circuit to verification keys (#1141)
mm-zk Feb 20, 2024
ce6c120
feat(en): switch to tree light mode (#1152)
perekopskiy Feb 20, 2024
975f54b
feat: Adding ability to generate 4844 setup key and refactor (#1143)
mm-zk Feb 21, 2024
f983e80
feat(en): Start health checks early into EN lifecycle (#1146)
slowli Feb 21, 2024
6f63c53
feat(prover): Adding first support for 4844 circuit (#1155)
mm-zk Feb 21, 2024
9e96281
fix: Return back sepolia.json (#1165)
Artemka374 Feb 21, 2024
0dda7cc
perf(db): Improve `get_logs_by_tx_hashes` query (#1171)
perekopskiy Feb 21, 2024
add2321
fix(zk_stack): fix docker compose and prover setup (#1164)
Deniallugo Feb 21, 2024
72c60bd
fix(contract-verifier): allow other zksolc settings (#1174)
perekopskiy Feb 21, 2024
2a0368b
fix(zk_stack): Use correct owner and db url (#1178)
Deniallugo Feb 21, 2024
cad7278
feat(prover): Added --recompute-if-missing option to key generator (#…
mm-zk Feb 21, 2024
d8894fe
chore(prover): Remove obsolete files (#1148)
mm-zk Feb 21, 2024
e75aa11
fix(contract-verifier): Add force_evmla flag (#1179)
perekopskiy Feb 21, 2024
4f41b68
feat(node_framework): Support Eth Watch in the framework (#1145)
AnastasiiaVashchuk Feb 21, 2024
3878142
Improve config files for validium
lferrigno Feb 21, 2024
87172dd
zk fmt on improving validium config files
lferrigno Feb 21, 2024
6fdc097
modify comments
lferrigno Feb 21, 2024
a879621
chore: fix MIT license link (#1195)
itegulov Feb 22, 2024
b486d7e
feat(api): add a config flag for disabling filter api (#1078)
itegulov Feb 22, 2024
b9e8836
Implement serde solution
jorbush Feb 22, 2024
3aa12e8
chore(prover): small features for 4844 proofs (#1181)
mm-zk Feb 22, 2024
ecb4118
refactor(state-keeper): Propagate I/O errors in state keeper (#1080)
slowli Feb 22, 2024
376c09e
feat(prover): Use new shivini function for 4844 circuits (#1205)
mm-zk Feb 22, 2024
cef6923
fix(witness_generator): Add trusted setup to wit gens (#1207)
EmilLuta Feb 22, 2024
0171e16
Update contracts submodule commit
ilitteri Feb 22, 2024
733d3e9
Use serve(default) instead
jorbush Feb 22, 2024
c2c69f1
Update contracts submodule commit
ilitteri Feb 22, 2024
66cdefc
feat(vm): Add new VM folder (#1208)
perekopskiy Feb 22, 2024
2f02dca
Add unit test
jorbush Feb 22, 2024
7692025
Refactor name
jorbush Feb 22, 2024
11a34d4
feat(api): Implement TxSink abstraction (#1204)
popzxc Feb 22, 2024
3b9db65
Update contracts submodule commit
ilitteri Feb 22, 2024
0b27ef1
Update contracts submodule commit
ilitteri Feb 22, 2024
dee8aea
Update contracts submodule commit
ilitteri Feb 22, 2024
cabd73a
set BatchCommitDataGenerator in external node init
toni-calvin Feb 22, 2024
ea4daa7
add panic if commitment mode differs
Feb 22, 2024
fcee5d1
use assert_eq, panic if eth response is invalid
Feb 22, 2024
96035d8
use a function for the function selector
Feb 22, 2024
3fd04b1
chore(docker): Exclude trusted_setup from .dockerignore (#1224)
perekopskiy Feb 23, 2024
a1c866c
feat: Integration tests enhancement for L1 (#1209)
Artemka374 Feb 23, 2024
63d1f52
feat(vm): integrate new vm version (#1215)
perekopskiy Feb 23, 2024
fab8b6a
Apdapt protobuf_config
jorbush Feb 23, 2024
85954ad
Apdapt testonly
jorbush Feb 23, 2024
e11df5e
chore: slightly change instructions in node version to match yarn (#1…
zk-Lumi Feb 23, 2024
ce6247e
add support for validium in external mode
toni-calvin Feb 23, 2024
57f4bbe
update tests
toni-calvin Feb 23, 2024
6cd69aa
fix(zk): Adapting zk status prover to new Database layout (#1229)
mm-zk Feb 23, 2024
ba00a14
remove unused parameter
toni-calvin Feb 23, 2024
ee59553
Merge branch 'feat_validium_pubdata_abstraction' of github.com:Lambda…
ilitteri Feb 23, 2024
4470772
Update contracts submodule commit to matter-labs
ilitteri Feb 23, 2024
e78e9e0
Update contracts submodule commit
ilitteri Feb 23, 2024
254d87b
Update contracts submodule commit
ilitteri Feb 23, 2024
a6959f4
Remove obscure use of VALIDIUM_MODE env
ilitteri Feb 23, 2024
652b33a
Merge branch 'feat_validium_pubdata_abstraction' into feat_remove_val…
ilitteri Feb 23, 2024
95ab24a
Revert "use a function for the function selector"
ilitteri Feb 23, 2024
c2c464d
Remove call implementation
ilitteri Feb 23, 2024
e165fac
impl Detokenize for L1BatchCommitDataGeneratorMode
ilitteri Feb 23, 2024
3a9e133
Add executor_contract getter
ilitteri Feb 23, 2024
da18d24
Call getPubdataPriceMode using Executor's contract ABI
ilitteri Feb 23, 2024
8528d02
Fix unhandled error
ilitteri Feb 23, 2024
bb64792
Update contracts submodule commit
ilitteri Feb 23, 2024
2e240eb
Fix L1BatchCommitDataGeneratorMode::from_tokens
ilitteri Feb 23, 2024
19f3938
Add comment
ilitteri Feb 23, 2024
629c325
refactor configLine into struct
toni-calvin Feb 26, 2024
d9341fe
Update contracts submodule commit
ilitteri Feb 26, 2024
6ecb2a5
Merge branch 'feat_remove_validium_mode_env_usage' of github.com:Lamb…
ilitteri Feb 26, 2024
272e35f
update ext node config
toni-calvin Feb 26, 2024
d5fdb5c
rename var
toni-calvin Feb 26, 2024
4c6de9f
Merge branch 'feat_validium_pubdata_abstraction' of github.com:Lambda…
ilitteri Feb 26, 2024
d1fb75e
Merge branch 'feat_validium_pubdata_abstraction' of github.com:Lambda…
ilitteri Feb 26, 2024
bb42d5b
Update contracts submodule commit
ilitteri Feb 26, 2024
213b2b1
Update contracts submodule commit
ilitteri Feb 26, 2024
c99c61e
Stash
jorbush Feb 27, 2024
0a04805
Update contracts submodule commit
ilitteri Feb 27, 2024
fe24f89
Check mode
jorbush Feb 28, 2024
f902523
Remove unused function
ilitteri Feb 28, 2024
cc34e81
Remove unnecessary test and TODOs
jorbush Feb 28, 2024
d35e74d
add ext-node-validium.toml file
toni-calvin Feb 28, 2024
15d31f6
Update how the config is set now
ilitteri Feb 28, 2024
6310305
Merge pull request #1235 from lambdaclass/feat_add_validium_support_e…
ilitteri Feb 28, 2024
c6e3fe8
Merge pull request #1236 from lambdaclass/optional-commit_data_generator
ilitteri Feb 28, 2024
4b95657
Update .gitignore
ilitteri Feb 28, 2024
78148e9
Merge branch 'add-ext-node-config-in-init' of github.com:LambdaClass/…
ilitteri Feb 28, 2024
447f9c3
Merge branch 'feat_validium_pubdata_abstraction' of github.com:matter…
ilitteri Feb 28, 2024
89c32ff
Revert "rename var"
ilitteri Feb 28, 2024
b99e4b0
Revert "update ext node config"
ilitteri Feb 28, 2024
2dcebfd
Revert "refactor configLine into struct"
ilitteri Feb 28, 2024
9ed55e0
Delete infrastructure/zk/src/config_constants.ts
ilitteri Feb 28, 2024
daf7e4d
Update config.ts
ilitteri Feb 28, 2024
e1e01dd
Init system using DeploymentMode enum
ilitteri Feb 28, 2024
1adeb3a
Fix lightweight-init and reinit cmds
ilitteri Feb 28, 2024
f89ebda
Fix hyperchain_wizard
ilitteri Feb 28, 2024
2a9cf8f
Fix conditional
ilitteri Feb 28, 2024
304e331
Merge pull request #1237 from lambdaclass/fix_validium_mode_config_files
ilitteri Feb 28, 2024
8d8b3ce
Merge branch 'feat_validium_pubdata_abstraction' of github.com:matter…
ilitteri Feb 28, 2024
3805f90
Fix merge
ilitteri Feb 28, 2024
f2e90fc
Fix compilation error in tests (because of a merge)
ilitteri Feb 28, 2024
172ef3f
Merge branch 'feat_validium_pubdata_abstraction' of github.com:matter…
ilitteri Feb 28, 2024
3e8559d
Merge pull request #1239 from lambdaclass/validium_update_contracts_s…
ilitteri Feb 28, 2024
9b37ccd
Update contracts submodule commit
ilitteri Feb 28, 2024
773efe8
Merge branch 'feat_validium_pubdata_abstraction' of github.com:matter…
ilitteri Feb 28, 2024
5783c1b
Remove unused imports
ilitteri Feb 29, 2024
ea433ef
Update contracts submodule commit
ilitteri Feb 29, 2024
719686e
Merge branch 'feat_validium_pubdata_abstraction' of github.com:matter…
ilitteri Feb 29, 2024
ee31fdf
Merge branch 'feat_validium_pubdata_abstraction' of github.com:matter…
ilitteri Feb 29, 2024
06fad6a
Merge branch 'feat_validium_pubdata_abstraction' of github.com:matter…
ilitteri Feb 29, 2024
981c26c
Merge branch 'adapt-protobuf_config-tests' of github.com:LambdaClass/…
ilitteri Feb 29, 2024
baa1083
Revert "Add executor_contract getter"
ilitteri Feb 29, 2024
06752d6
Fix method name
ilitteri Feb 29, 2024
d6c1c20
Improve assert comment
ilitteri Feb 29, 2024
538b64f
Fix call to getPubdataPricingMode method
ilitteri Feb 29, 2024
52c177a
Merge branch 'feat_validium_pubdata_abstraction' of github.com:matter…
ilitteri Feb 29, 2024
51875a3
Merge pull request #1242 from lambdaclass/feat_remove_validium_mode_e…
ilitteri Feb 29, 2024
e5d19ec
Merge pull request #1275 from lambdaclass/adapt-protobuf_config-tests
ilitteri Feb 29, 2024
1685e29
Merge pull request #1277 from lambdaclass/add-ext-node-config-in-init
ilitteri Feb 29, 2024
08c969d
Merge branch 'feat_validium_pubdata_abstraction' of github.com:matter…
ilitteri Feb 29, 2024
d58e1ac
Refactor
ilitteri Feb 29, 2024
000775a
Remove unused import
ilitteri Feb 29, 2024
9586ecc
Handle special case where these changes are merged before the contrac…
ilitteri Feb 29, 2024
c241c78
Update era.dic
ilitteri Feb 29, 2024
d7789fc
Fix comment
ilitteri Mar 1, 2024
ac7f5fb
Address nits
ilitteri Mar 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ contracts/.git
!bellman-cuda
!prover/vk_setup_data_generator_server_fri/data/
!.github/release-please/manifest.json
!trusted_setup.json
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ Cargo.lock
/etc/env/*
!/etc/env/base
!/etc/env/dev.toml
!/etc/env/dev_validium.toml
!/etc/env/docker.toml
!/etc/env/ext-node.toml
!/etc/env/ext-node-docker.toml
!/etc/env/ext-node-validium.toml
!/etc/env/consensus_config.json
!/etc/env/en_consensus_config.json
/etc/tokens/localhost.json
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "contracts"]
path = contracts
url = https://github.com/LambdaClass/era-contracts.git
branch = update_validium_mode_contracts
url = https://github.com/matter-labs/era-contracts.git
branch = feat_validium_mode
35 changes: 23 additions & 12 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The following questions will be answered by the following resources:
zkSync Era is distributed under the terms of either

- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <https://opensource.org/license/mit/>)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <https://opensource.org/blog/license/mit/>)

at your option.

Expand Down
12 changes: 11 additions & 1 deletion checks-config/era.dic
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,10 @@ prode
StorageBatchInfo
CommitBatchInfo
IExecutor
SetChainId
setChainId
SetChainIdUpgrade
state_transition_manager_contract

// Names
Vyper
Expand Down Expand Up @@ -896,5 +900,11 @@ downcasting
parameterized
reimplementation
composability
DeployRequest
md5
shivini
balancer
lookups
stateful
DeployRequest
getPubdataPricingMode
Uint
21 changes: 12 additions & 9 deletions core/bin/block_reverter/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use anyhow::Context as _;
use clap::{Parser, Subcommand};
use tokio::io::{self, AsyncReadExt};
use zksync_config::{ContractsConfig, DBConfig, ETHClientConfig, ETHSenderConfig, PostgresConfig};
use zksync_config::{
configs::ObservabilityConfig, ContractsConfig, DBConfig, ETHClientConfig, ETHSenderConfig,
PostgresConfig,
};
use zksync_core::block_reverter::{
BlockReverter, BlockReverterEthConfig, BlockReverterFlags, L1ExecutedBatchesRevert,
};
Expand Down Expand Up @@ -68,19 +71,19 @@ enum Command {

#[tokio::main]
async fn main() -> anyhow::Result<()> {
#[allow(deprecated)] // TODO (QIT-21): Use centralized configuration approach.
let log_format = vlog::log_format_from_env();
#[allow(deprecated)] // TODO (QIT-21): Use centralized configuration approach.
let sentry_url = vlog::sentry_url_from_env();
#[allow(deprecated)] // TODO (QIT-21): Use centralized configuration approach.
let environment = vlog::environment_from_env();
let observability_config =
ObservabilityConfig::from_env().context("ObservabilityConfig::from_env()")?;
let log_format: vlog::LogFormat = observability_config
.log_format
.parse()
.context("Invalid log format")?;

let mut builder = vlog::ObservabilityBuilder::new().with_log_format(log_format);
if let Some(sentry_url) = sentry_url {
if let Some(sentry_url) = observability_config.sentry_url {
builder = builder
.with_sentry_url(&sentry_url)
.context("Invalid Sentry URL")?
.with_sentry_environment(environment);
.with_sentry_environment(observability_config.sentry_environment);
}
let _guard = builder.build();

Expand Down
24 changes: 13 additions & 11 deletions core/bin/contract-verifier/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ use anyhow::Context as _;
use futures::{channel::mpsc, executor::block_on, SinkExt, StreamExt};
use prometheus_exporter::PrometheusExporterConfig;
use tokio::sync::watch;
use zksync_config::{configs::PrometheusConfig, ApiConfig, ContractVerifierConfig, PostgresConfig};
use zksync_config::{
configs::{ObservabilityConfig, PrometheusConfig},
ApiConfig, ContractVerifierConfig, PostgresConfig,
};
use zksync_dal::ConnectionPool;
use zksync_env_config::FromEnv;
use zksync_queued_job_processor::JobProcessor;
Expand Down Expand Up @@ -140,24 +143,23 @@ async fn main() -> anyhow::Result<()> {
.await
.unwrap();

#[allow(deprecated)] // TODO (QIT-21): Use centralized configuration approach.
let log_format = vlog::log_format_from_env();
#[allow(deprecated)] // TODO (QIT-21): Use centralized configuration approach.
let sentry_url = vlog::sentry_url_from_env();
#[allow(deprecated)] // TODO (QIT-21): Use centralized configuration approach.
let environment = vlog::environment_from_env();

let observability_config =
ObservabilityConfig::from_env().context("ObservabilityConfig::from_env()")?;
let log_format: vlog::LogFormat = observability_config
.log_format
.parse()
.context("Invalid log format")?;
let mut builder = vlog::ObservabilityBuilder::new().with_log_format(log_format);
if let Some(sentry_url) = &sentry_url {
if let Some(sentry_url) = &observability_config.sentry_url {
builder = builder
.with_sentry_url(sentry_url)
.expect("Invalid Sentry URL")
.with_sentry_environment(environment);
.with_sentry_environment(observability_config.sentry_environment);
}
let _guard = builder.build();

// Report whether sentry is running after the logging subsystem was initialized.
if let Some(sentry_url) = sentry_url {
if let Some(sentry_url) = observability_config.sentry_url {
tracing::info!("Sentry configured with URL: {sentry_url}");
} else {
tracing::info!("No sentry URL was provided");
Expand Down
10 changes: 7 additions & 3 deletions core/bin/contract-verifier/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,17 @@ impl ContractVerifier {
enabled: request.req.optimization_used,
mode: request.req.optimizer_mode.and_then(|s| s.chars().next()),
};
let optimizer_value = serde_json::to_value(optimizer).unwrap();

let settings = Settings {
libraries: None,
output_selection: Some(default_output_selection),
optimizer,
is_system: request.req.is_system,
metadata: None,
force_evmla: request.req.force_evmla,
other: serde_json::Value::Object(
vec![("optimizer".to_string(), optimizer_value)]
.into_iter()
.collect(),
),
};

Ok(ZkSolcInput::StandardJson(StandardJson {
Expand Down
36 changes: 12 additions & 24 deletions core/bin/contract-verifier/src/zksolc_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,38 +34,23 @@ pub struct Source {
pub content: String,
}

#[derive(Debug, Serialize, Deserialize)]
pub enum MetadataHash {
/// Do not include bytecode hash.
#[serde(rename = "none")]
None,
}

#[derive(Debug, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Metadata {
/// The bytecode hash mode.
#[serde(skip_serializing_if = "Option::is_none")]
pub bytecode_hash: Option<MetadataHash>,
}

/// Compiler settings.
/// 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")]
pub struct Settings {
/// The linker library addresses.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub libraries: Option<HashMap<String, HashMap<String, String>>>,
/// The output selection filters.
pub output_selection: Option<serde_json::Value>,
/// The optimizer settings.
#[serde(default)]
pub optimizer: Optimizer,
/// The metadata settings.
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<Metadata>,
/// 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,
}

#[derive(Debug, Serialize, Deserialize)]
Expand Down Expand Up @@ -121,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
Loading
Loading