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

Fix switch proposer_duties table primary key to slot_number #13

Merged
merged 2 commits into from
Oct 15, 2024
Merged
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 changes: 1 addition & 1 deletion crates/cmd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion crates/cmd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE proposer_duties DROP CONSTRAINT proposer_duties_pkey;
ALTER TABLE proposer_duties ADD PRIMARY KEY (slot_number);
2 changes: 1 addition & 1 deletion crates/database/src/postgres/postgres_db_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, &params[..]).await?;
Expand Down