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: attester committees data extractor (BFT-434) #2684

Merged
merged 71 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
e9b7c36
Add consensus L2 contracts VM storage reader
moshababo Jul 10, 2024
5a1a259
Upgrade to new contract format
moshababo Jul 12, 2024
a8779b5
Use a single connection per read batch
moshababo Jul 20, 2024
477ea5e
Use abi (de)serialization traits, propagate errors
moshababo Jul 21, 2024
5a925c6
`zksync_contracts` to incapsulate FS
moshababo Jul 21, 2024
f7b1b9b
Add docs
moshababo Jul 22, 2024
5680805
Fix lint warnings
moshababo Jul 22, 2024
42a974c
Add cargo deps
moshababo Jul 22, 2024
2ad2c32
Merge branch 'main' into consensus_contracts_reader
moshababo Jul 22, 2024
899f07b
Add Debug derivation
moshababo Jul 22, 2024
d4e6f84
Add docs
moshababo Jul 22, 2024
cbc46a1
Propagate connection error
moshababo Jul 22, 2024
f1cda3e
Merge branch 'refs/heads/main' into consensus_contracts_reader
moshababo Jul 27, 2024
4bb671a
Add committees data denormalizer
moshababo Jul 29, 2024
cfd7316
Use local data types instead of integrating with `era-consensus`
moshababo Aug 4, 2024
4fc93f2
Extract attester committee only
moshababo Aug 4, 2024
c4d51da
`Denormalizer` -> `CommitteeExtractor`
moshababo Aug 4, 2024
2ed908c
`test_committee_extractor`
moshababo Aug 5, 2024
2b41130
Check whether contract is deployed
moshababo Aug 5, 2024
b8e4216
Add `get_last_batch_committee_number`, refactor `get_last_batch_certi…
moshababo Aug 5, 2024
2824931
Move all related components to `storage/registry_contract`
moshababo Aug 5, 2024
65d3fa3
Check for null certificate before unwrapping
moshababo Aug 5, 2024
ea03ab3
Merge remote-tracking branch 'origin/main' into committees_data_denor…
pompon0 Aug 19, 2024
095ab12
dal compiles
pompon0 Aug 19, 2024
74595b5
wip
pompon0 Aug 20, 2024
0d648a8
wip abi in the right place
pompon0 Aug 21, 2024
1fea7b2
added types to registry contract
pompon0 Aug 21, 2024
78bd096
wip
pompon0 Aug 21, 2024
4542a87
wip
pompon0 Aug 21, 2024
9c4e039
wip tests
pompon0 Aug 21, 2024
d0b3d58
shifted testonly stuff
pompon0 Aug 21, 2024
4232d6b
wip
pompon0 Aug 22, 2024
94b9215
wip
pompon0 Aug 22, 2024
2bd281e
?
pompon0 Aug 23, 2024
66d89df
?
pompon0 Aug 23, 2024
f41486e
more or less implemented
pompon0 Aug 23, 2024
9ed4373
compiles
pompon0 Aug 23, 2024
eba23e7
registry works :)
pompon0 Aug 24, 2024
9a13801
wip
pompon0 Aug 28, 2024
01fa03c
code complete, test needed
pompon0 Aug 29, 2024
fdf64ab
zk fmt
pompon0 Aug 29, 2024
9835998
Merge remote-tracking branch 'origin/main' into gprusak-extract-commi…
pompon0 Aug 29, 2024
a365a19
separate tables
pompon0 Aug 29, 2024
3f5976c
typo
pompon0 Aug 29, 2024
f5f93f8
missing files
pompon0 Aug 29, 2024
8ce3b9c
test fails
pompon0 Aug 29, 2024
9b3a805
test passes
pompon0 Sep 2, 2024
0173ea4
bumped era-consensus dep
pompon0 Sep 3, 2024
4b69dd6
Merge remote-tracking branch 'origin/main' into gprusak-extract-commi…
pompon0 Sep 3, 2024
dc4f83f
contracts
pompon0 Sep 3, 2024
b944379
fixed test
pompon0 Sep 4, 2024
8375731
wip
pompon0 Sep 4, 2024
dc3f342
reverted debugging stuff
pompon0 Sep 4, 2024
5ae2e23
added verification and fixed test
pompon0 Sep 4, 2024
e7590a0
test fix
pompon0 Sep 4, 2024
3168fd3
zk lint
pompon0 Sep 4, 2024
7250a59
random bullshit
pompon0 Sep 4, 2024
e8bd9b0
Merge remote-tracking branch 'origin/main' into gprusak-extract-commi…
pompon0 Sep 6, 2024
65da7dc
wip: registry_addr shouldn't be in api_server config
pompon0 Sep 6, 2024
13b4feb
wip: rerouting registry_address configuration
pompon0 Sep 6, 2024
47d294a
introduced consensus global config
pompon0 Sep 9, 2024
983e70b
sqlx
pompon0 Sep 9, 2024
4586623
piped build_version argument
pompon0 Sep 9, 2024
b16ef86
Merge remote-tracking branch 'origin/main' into gprusak-extract-commi…
pompon0 Sep 9, 2024
0dae56b
Cargo.lock
pompon0 Sep 9, 2024
9a8cd55
moved registry contract abi to consensus crate
pompon0 Sep 9, 2024
f0b1416
Cargo.lock
pompon0 Sep 9, 2024
461c112
Update core/lib/types/src/api/en.rs
pompon0 Sep 10, 2024
c58befa
applied comment
pompon0 Sep 10, 2024
be4c9f4
Merge branch 'gprusak-extract-committee' of http://github.com/matter-…
pompon0 Sep 10, 2024
5f95974
Merge branch 'main' into gprusak-extract-committee
pompon0 Sep 10, 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
67 changes: 39 additions & 28 deletions Cargo.lock

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

20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -218,16 +218,16 @@ zk_evm_1_5_0 = { package = "zk_evm", version = "=0.150.4" }
vm2 = { git = "https://github.com/matter-labs/vm2.git", rev = "4ef15d46410ffc11744771a3a6c7c09dd9470c90" }

# Consensus dependencies.
zksync_concurrency = "=0.1.0-rc.11"
zksync_consensus_bft = "=0.1.0-rc.11"
zksync_consensus_crypto = "=0.1.0-rc.11"
zksync_consensus_executor = "=0.1.0-rc.11"
zksync_consensus_network = "=0.1.0-rc.11"
zksync_consensus_roles = "=0.1.0-rc.11"
zksync_consensus_storage = "=0.1.0-rc.11"
zksync_consensus_utils = "=0.1.0-rc.11"
zksync_protobuf = "=0.1.0-rc.11"
zksync_protobuf_build = "=0.1.0-rc.11"
zksync_concurrency = "=0.1.0-rc.12"
zksync_consensus_bft = "=0.1.0-rc.12"
zksync_consensus_crypto = "=0.1.0-rc.12"
zksync_consensus_executor = "=0.1.0-rc.12"
zksync_consensus_network = "=0.1.0-rc.12"
zksync_consensus_roles = "=0.1.0-rc.12"
zksync_consensus_storage = "=0.1.0-rc.12"
zksync_consensus_utils = "=0.1.0-rc.12"
zksync_protobuf = "=0.1.0-rc.12"
zksync_protobuf_build = "=0.1.0-rc.12"

# "Local" dependencies
zksync_multivm = { version = "0.1.0", path = "core/lib/multivm" }
Expand Down
8 changes: 7 additions & 1 deletion core/bin/external_node/src/node_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,13 @@ impl ExternalNodeBuilder {
let config = self.config.consensus.clone();
let secrets =
config::read_consensus_secrets().context("config::read_consensus_secrets()")?;
let layer = ExternalNodeConsensusLayer { config, secrets };
let layer = ExternalNodeConsensusLayer {
build_version: crate::metadata::SERVER_VERSION
.parse()
.context("CRATE_VERSION.parse()")?,
config,
secrets,
};
self.node.add_layer(layer);
Ok(self)
}
Expand Down
4 changes: 3 additions & 1 deletion core/lib/config/src/configs/consensus.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::{BTreeMap, BTreeSet};

use secrecy::{ExposeSecret as _, Secret};
use zksync_basic_types::L2ChainId;
use zksync_basic_types::{ethabi, L2ChainId};
use zksync_concurrency::{limiter, time};

/// `zksync_consensus_crypto::TextFmt` representation of `zksync_consensus_roles::validator::PublicKey`.
Expand Down Expand Up @@ -89,6 +89,8 @@ pub struct GenesisSpec {
/// Leader of the committee. Represents
/// `zksync_consensus_roles::validator::LeaderSelectionMode::Sticky`.
pub leader: ValidatorPublicKey,
/// Address of the registry contract.
pub registry_address: Option<ethabi::Address>,
}

#[derive(Clone, Debug, PartialEq, Default)]
Expand Down
19 changes: 10 additions & 9 deletions core/lib/config/src/testonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,17 +243,17 @@ impl Distribution<configs::ContractsConfig> for EncodeDist {
default_upgrade_addr: rng.gen(),
diamond_proxy_addr: rng.gen(),
validator_timelock_addr: rng.gen(),
l1_erc20_bridge_proxy_addr: rng.gen(),
l2_erc20_bridge_addr: rng.gen(),
l1_shared_bridge_proxy_addr: rng.gen(),
l2_shared_bridge_addr: rng.gen(),
l1_weth_bridge_proxy_addr: rng.gen(),
l2_weth_bridge_addr: rng.gen(),
l2_testnet_paymaster_addr: rng.gen(),
l1_erc20_bridge_proxy_addr: self.sample_opt(|| rng.gen()),
l2_erc20_bridge_addr: self.sample_opt(|| rng.gen()),
l1_shared_bridge_proxy_addr: self.sample_opt(|| rng.gen()),
l2_shared_bridge_addr: self.sample_opt(|| rng.gen()),
l1_weth_bridge_proxy_addr: self.sample_opt(|| rng.gen()),
l2_weth_bridge_addr: self.sample_opt(|| rng.gen()),
l2_testnet_paymaster_addr: self.sample_opt(|| rng.gen()),
l1_multicall3_addr: rng.gen(),
base_token_addr: rng.gen(),
chain_admin_addr: rng.gen(),
ecosystem_contracts: self.sample(rng),
base_token_addr: self.sample_opt(|| rng.gen()),
chain_admin_addr: self.sample_opt(|| rng.gen()),
}
}
}
Expand Down Expand Up @@ -777,6 +777,7 @@ impl Distribution<configs::consensus::GenesisSpec> for EncodeDist {
validators: self.sample_collect(rng),
attesters: self.sample_collect(rng),
leader: ValidatorPublicKey(self.sample(rng)),
registry_address: self.sample_opt(|| rng.gen()),
}
}
}
Expand Down

This file was deleted.

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.

Loading
Loading