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: Verify blob L1 #287

Draft
wants to merge 20 commits into
base: da-eigen-implementation-m0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2,928 changes: 1,947 additions & 981 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion core/bin/zksync_server/src/node_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,10 @@ impl MainNodeBuilder {
.add_layer(ObjectStorageClientWiringLayer::new(config));
}
(DAClientConfig::EigenDA(config), _) => {
self.node.add_layer(EigenDAWiringLayer::new(config));
self.node.add_layer(EigenDAWiringLayer::new(
config,
self.contracts_config.eigenda_verifier_addr.unwrap(),
));
}
}

Expand Down
2 changes: 2 additions & 0 deletions core/lib/config/src/configs/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub struct ContractsConfig {
// Used by the RPC API and by the node builder in wiring the BaseTokenRatioProvider layer.
pub base_token_addr: Option<Address>,
pub chain_admin_addr: Option<Address>,
pub eigenda_verifier_addr: Option<Address>,
}

impl ContractsConfig {
Expand All @@ -61,6 +62,7 @@ impl ContractsConfig {
base_token_addr: Some(Address::repeat_byte(0x14)),
ecosystem_contracts: Some(EcosystemContracts::for_tests()),
chain_admin_addr: Some(Address::repeat_byte(0x18)),
eigenda_verifier_addr: Some(Address::repeat_byte(0x19)),
}
}
}
1 change: 1 addition & 0 deletions core/lib/config/src/testonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ impl Distribution<configs::ContractsConfig> for EncodeDist {
ecosystem_contracts: self.sample(rng),
base_token_addr: self.sample_opt(|| rng.gen()),
chain_admin_addr: self.sample_opt(|| rng.gen()),
eigenda_verifier_addr: self.sample_opt(|| rng.gen()),
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion core/lib/contracts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ const LOADNEXT_CONTRACT_FILE: &str =
"etc/contracts-test-data/artifacts-zk/contracts/loadnext/loadnext_contract.sol/LoadnextContract.json";
const LOADNEXT_SIMPLE_CONTRACT_FILE: &str =
"etc/contracts-test-data/artifacts-zk/contracts/loadnext/loadnext_contract.sol/Foo.json";

const EIGENDA_VERIFIER_CONTRACT_FILE: (&str, &str) =
("eigenda", "EigendaVerifier.sol/EigendaVerifier.json");
fn home_path() -> PathBuf {
Workspace::locate().core()
}
Expand Down Expand Up @@ -163,6 +164,10 @@ pub fn verifier_contract() -> Contract {
load_contract_for_both_compilers(VERIFIER_CONTRACT_FILE)
}

pub fn eigenda_verifier_contract() -> Contract {
load_contract_for_both_compilers(EIGENDA_VERIFIER_CONTRACT_FILE)
}

#[derive(Debug, Clone)]
pub struct TestContract {
/// Contract bytecode to be used for sending deploy transaction.
Expand Down
2 changes: 2 additions & 0 deletions core/lib/env_config/src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ mod tests {
}),
base_token_addr: Some(SHARED_BRIDGE_ETHER_TOKEN_ADDRESS),
chain_admin_addr: Some(addr("0xdd6fa5c14e7550b4caf2aa2818d24c69cbc347ff")),
eigenda_verifier_addr: None,
}
}

Expand All @@ -98,6 +99,7 @@ CONTRACTS_STATE_TRANSITION_PROXY_ADDR="0xd90f1c081c6117241624e97cb6147257c3cb209
CONTRACTS_TRANSPARENT_PROXY_ADMIN_ADDR="0xdd6fa5c14e7550b4caf2aa2818d24c69cbc347e5"
CONTRACTS_BASE_TOKEN_ADDR="0x0000000000000000000000000000000000000001"
CONTRACTS_CHAIN_ADMIN_ADDR="0xdd6fa5c14e7550b4caf2aa2818d24c69cbc347ff"
CONTRACTS_EIGENDA_VERIFIER_ADDR=""
"#;
lock.set_env(config);

Expand Down
1 change: 1 addition & 0 deletions core/lib/l1_contract_interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ sha2.workspace = true
sha3.workspace = true
hex.workspace = true
once_cell.workspace = true
rlp.workspace = true

[dev-dependencies]
serde.workspace = true
Expand Down
Loading