diff --git a/crates/cmd/Cargo.toml b/crates/cmd/Cargo.toml index 46963819..0bdad0a5 100644 --- a/crates/cmd/Cargo.toml +++ b/crates/cmd/Cargo.toml @@ -12,7 +12,7 @@ helix-common.workspace = true tokio.workspace = true tracing.workspace = true -tracing-subscriber.workspace = true +tracing-subscriber = { workspace = true, features = ["env-filter"] } tracing-appender.workspace = true num_cpus.workspace = true \ No newline at end of file diff --git a/crates/cmd/src/main.rs b/crates/cmd/src/main.rs index 3ccd975a..d9b72830 100644 --- a/crates/cmd/src/main.rs +++ b/crates/cmd/src/main.rs @@ -15,7 +15,8 @@ async fn run() { match &config.logging { LoggingConfig::Console => { - tracing_subscriber::fmt().init(); + let filter_layer = tracing_subscriber::EnvFilter::from_default_env(); + tracing_subscriber::fmt().with_env_filter(filter_layer).init(); } LoggingConfig::File { dir_path, file_name } => { let file_appender = tracing_appender::rolling::daily(dir_path, file_name); diff --git a/crates/database/src/postgres/migrations/V22__proposer_duties_fix.sql b/crates/database/src/postgres/migrations/V22__proposer_duties_fix.sql new file mode 100644 index 00000000..dfcf516f --- /dev/null +++ b/crates/database/src/postgres/migrations/V22__proposer_duties_fix.sql @@ -0,0 +1,2 @@ +ALTER TABLE proposer_duties DROP CONSTRAINT proposer_duties_pkey; +ALTER TABLE proposer_duties ADD PRIMARY KEY (slot_number); diff --git a/crates/database/src/postgres/postgres_db_service.rs b/crates/database/src/postgres/postgres_db_service.rs index eb503cff..af6a2102 100644 --- a/crates/database/src/postgres/postgres_db_service.rs +++ b/crates/database/src/postgres/postgres_db_service.rs @@ -571,7 +571,7 @@ impl DatabaseService for PostgresDatabaseService { // Join the values clauses and append them to the SQL statement sql.push_str(&values_clauses.join(", ")); - sql.push_str(" ON CONFLICT (public_key) DO NOTHING"); + sql.push_str(" ON CONFLICT (slot_number) DO NOTHING"); // Execute the query transaction.execute(&sql, ¶ms[..]).await?;