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

Simplified block storage #53

Merged
merged 40 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
013478c
moved stuff around
pompon0 Dec 14, 2023
79f0983
snapshot
pompon0 Dec 15, 2023
eb9ec66
snapshot; config verification got distorted
pompon0 Dec 15, 2023
7b9e104
stuff compiles except for tests
pompon0 Dec 15, 2023
e5f76be
tests pass
pompon0 Dec 15, 2023
e255fa7
simplified blocks in test
pompon0 Dec 15, 2023
50342c1
removed unused loadtest binary modes
pompon0 Dec 18, 2023
5963f69
removed header from FinalBlock
pompon0 Dec 19, 2023
ed6fe4b
rewritten storage
pompon0 Dec 20, 2023
27e8a1a
bft compiles; ut_harness is not running storage background tasks
pompon0 Dec 20, 2023
8123774
before moving payload back to bft
pompon0 Dec 21, 2023
b03d770
reorganized storage crate
pompon0 Dec 21, 2023
ae338ef
splitted traits
pompon0 Dec 21, 2023
fcbaa16
leader tests migrated
pompon0 Dec 21, 2023
25da63b
bft tests pass
pompon0 Dec 22, 2023
4fd6acf
sync_blocks rewrite wip
pompon0 Dec 22, 2023
6b2be51
compiles
pompon0 Dec 22, 2023
12e6277
tests compile (1 commented out)
pompon0 Dec 22, 2023
0f72363
all tests pass
pompon0 Dec 23, 2023
dbd860c
cargo fmt
pompon0 Dec 23, 2023
c87326e
tests pass
pompon0 Dec 23, 2023
2b4b992
compiles
pompon0 Dec 23, 2023
2b5808c
executor tests pass
pompon0 Dec 23, 2023
93ab685
fixed loadtest
pompon0 Dec 24, 2023
5c3ccda
moved rocksdb dep
pompon0 Dec 28, 2023
c3ea6d4
separate runner, cargo fmt
pompon0 Dec 28, 2023
ced17c9
require persistent storage before proposing/verifying
pompon0 Dec 28, 2023
66ef974
cargo fmt
pompon0 Jan 1, 2024
4aad921
Merge remote-tracking branch 'origin/main' into gprusak-tools-config
pompon0 Jan 3, 2024
f2dae9a
nits
pompon0 Jan 3, 2024
eb0f5eb
applied comments
pompon0 Jan 4, 2024
f4d530b
deque
pompon0 Jan 4, 2024
10b3595
applied comments
pompon0 Jan 4, 2024
6edc1b2
store_block -> queue_block
pompon0 Jan 4, 2024
3f2d8da
Merge remote-tracking branch 'origin/main' into gprusak-tools-config
pompon0 Jan 4, 2024
2e9ddde
Update node/actors/bft/src/replica/state_machine.rs
pompon0 Jan 5, 2024
c319079
added metrics for storage
pompon0 Jan 8, 2024
0a14d00
nonempty block store
pompon0 Jan 8, 2024
14e963f
Merge remote-tracking branch 'refs/remotes/origin/gprusak-tools-confi…
pompon0 Jan 8, 2024
b750173
applied comments
pompon0 Jan 9, 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
Prev Previous commit
Next Next commit
tests pass
  • Loading branch information
pompon0 committed Dec 15, 2023
commit e5f76be2d86ac4eaa77b8cd024f079d671d9061c
4 changes: 2 additions & 2 deletions node/libs/protobuf/src/testonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rand::{

/// Test encoding and canonical encoding properties.
#[track_caller]
pub fn test_encode<R: Rng, T: ProtoFmt + std::fmt::Debug + Eq>(rng: &mut R, x: &T) {
pub fn test_encode<R: Rng, T: ProtoFmt + std::fmt::Debug + PartialEq>(rng: &mut R, x: &T) {
let x_encode = encode(x);
let x_canonical = canonical(x);
let x_shuffled = encode_shuffled(rng, x);
Expand All @@ -26,7 +26,7 @@ pub fn test_encode<R: Rng, T: ProtoFmt + std::fmt::Debug + Eq>(rng: &mut R, x: &
/// Syntax sugar for `test_encode`,
/// because `test_encode(rng,&rng::gen())` doesn't compile.
#[track_caller]
pub fn test_encode_random<R: Rng, T: ProtoFmt + std::fmt::Debug + Eq>(rng: &mut R)
pub fn test_encode_random<R: Rng, T: ProtoFmt + std::fmt::Debug + PartialEq>(rng: &mut R)
where
Standard: Distribution<T>,
{
Expand Down
2 changes: 1 addition & 1 deletion node/tools/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn decode_json<T: ProtoFmt>(json: &str) -> anyhow::Result<T> {

/// Node configuration including executor configuration, optional validator configuration,
/// and application-specific settings (e.g. metrics scraping).
#[derive(Debug)]
#[derive(Debug,PartialEq)]
pub struct AppConfig {
pub server_addr: std::net::SocketAddr,
pub public_addr: std::net::SocketAddr,
Expand Down
19 changes: 12 additions & 7 deletions node/tools/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
use super::{ExecutorConfig};
use crate::AppConfig;
use rand::{
distributions::{Distribution, Standard},
Rng,
};
use zksync_concurrency::ctx;
use zksync_consensus_roles::{node, validator};
use zksync_consensus_roles::{node,validator};
use zksync_protobuf::testonly::test_encode_random;

fn make_addr<R: Rng + ?Sized>(rng: &mut R) -> std::net::SocketAddr {
std::net::SocketAddr::new(std::net::IpAddr::from(rng.gen::<[u8; 16]>()), rng.gen())
}

impl Distribution<ExecutorConfig> for Standard {
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> ExecutorConfig {
ExecutorConfig {
impl Distribution<AppConfig> for Standard {
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> AppConfig {
AppConfig {
server_addr: make_addr(rng),
public_addr: make_addr(rng),
metrics_server_addr: Some(make_addr(rng)),

validator_key: Some(rng.gen::<validator::SecretKey>().public()),
validators: rng.gen(),
node_key: rng.gen().public(),
genesis_block: rng.gen(),

node_key: rng.gen::<node::SecretKey>().public(),
gossip_dynamic_inbound_limit: rng.gen(),
gossip_static_inbound: (0..5)
.map(|_| rng.gen::<node::SecretKey>().public())
Expand All @@ -33,5 +38,5 @@ impl Distribution<ExecutorConfig> for Standard {
fn test_schema_encoding() {
let ctx = ctx::test_root(&ctx::RealClock);
let rng = &mut ctx.rng();
test_encode_random::<_, ExecutorConfig>(rng);
test_encode_random::<_, AppConfig>(rng);
}