From 4bdad0b21f9939027b5f9b51da63d46468c28e7b Mon Sep 17 00:00:00 2001 From: benji-bitfly Date: Mon, 11 Nov 2024 12:16:05 +0100 Subject: [PATCH 1/5] docs: refactor `set` to `add` to avoid misinterpretation --- frontend/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/README.md b/frontend/README.md index 7f1a5afb3..d41133a2c 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -37,7 +37,7 @@ cp .env-example .env In file `.env`, write the URLs of the API servers and the secret key to access to them. The variable evoking the development is used to show/hide features and components that are not ready for production. -Set the following mapping in your `/etc/hosts` file: +Add the following mapping in your `/etc/hosts` file: ``` 127.0.0.1 local.beaconcha.in From feb4f660b4d317eccd9306976919b79985f233c5 Mon Sep 17 00:00:00 2001 From: Stefan Pletka <124689083+Eisei24@users.noreply.github.com> Date: Tue, 12 Nov 2024 08:25:38 +0100 Subject: [PATCH 2/5] Added conditions to the subqueries that use union (#1116) --- backend/pkg/api/data_access/vdb_blocks.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/backend/pkg/api/data_access/vdb_blocks.go b/backend/pkg/api/data_access/vdb_blocks.go index 17bfcec76..b0dbe6dee 100644 --- a/backend/pkg/api/data_access/vdb_blocks.go +++ b/backend/pkg/api/data_access/vdb_blocks.go @@ -198,8 +198,7 @@ func (d *DataAccessService) GetValidatorDashboardBlocks(ctx context.Context, das if err != nil { return nil, nil, err } - blocksDs = goqu.Dialect("postgres").From(goqu.T("past_blocks_cte")). - With("past_blocks_cte", blocksDs). // encapsulate so we can use selected fields + blocksDs = blocksDs. Order(order...) if directions != nil { blocksDs = blocksDs.Where(directions) @@ -267,12 +266,17 @@ func (d *DataAccessService) GetValidatorDashboardBlocks(ctx context.Context, das goqu.C("slot"), groupId, goqu.V("0").As("status"), - goqu.V(nil).As("exec_block_number"), - goqu.V(nil).As("graffiti_text"), - goqu.V(nil).As("fee_recipient"), - goqu.V(nil).As("el_reward"), + goqu.L("NULL::INTEGER").As("exec_block_number"), + goqu.L("NULL::TEXT").As("graffiti_text"), + goqu.L("NULL::BYTEA").As("fee_recipient"), + goqu.L("NULL::NUMERIC").As("el_reward"), ). - As("scheduled_blocks") + Order(order...). + Limit(uint(limit + 1)) + + if directions != nil { + scheduledDs = scheduledDs.Where(directions) + } // Supply to result query // distinct + block number ordering to filter out duplicates in an edge case (if dutiesInfo didn't update yet after a block was proposed, but the blocks table was) From 25579b75edfdcb4ea204f639304db90d3130fd49 Mon Sep 17 00:00:00 2001 From: Stefan Pletka <124689083+Eisei24@users.noreply.github.com> Date: Tue, 12 Nov 2024 10:14:09 +0100 Subject: [PATCH 3/5] Removed limits for scheduled blocks for some sortings --- backend/pkg/api/data_access/vdb_blocks.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/backend/pkg/api/data_access/vdb_blocks.go b/backend/pkg/api/data_access/vdb_blocks.go index b0dbe6dee..4616991f3 100644 --- a/backend/pkg/api/data_access/vdb_blocks.go +++ b/backend/pkg/api/data_access/vdb_blocks.go @@ -270,12 +270,17 @@ func (d *DataAccessService) GetValidatorDashboardBlocks(ctx context.Context, das goqu.L("NULL::TEXT").As("graffiti_text"), goqu.L("NULL::BYTEA").As("fee_recipient"), goqu.L("NULL::NUMERIC").As("el_reward"), - ). - Order(order...). - Limit(uint(limit + 1)) + ) - if directions != nil { - scheduledDs = scheduledDs.Where(directions) + // We don't have access to exec_block_number and status for a WHERE without wrapping the query so if we sort by those get all the data + if colSort.Column == enums.VDBBlocksColumns.Proposer || colSort.Column == enums.VDBBlocksColumns.Slot { + scheduledDs = scheduledDs. + Order(order...). + Limit(uint(limit + 1)) + + if directions != nil { + scheduledDs = scheduledDs.Where(directions) + } } // Supply to result query From fd27d06f07ed1fa7cc2f5566998dc9be3986adb3 Mon Sep 17 00:00:00 2001 From: peter <1674920+peterbitfly@users.noreply.github.com> Date: Tue, 12 Nov 2024 10:11:18 +0000 Subject: [PATCH 4/5] fix(notifications): write webhook status to the correct table --- backend/pkg/notification/sending.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/pkg/notification/sending.go b/backend/pkg/notification/sending.go index d7fca5945..2efc68a99 100644 --- a/backend/pkg/notification/sending.go +++ b/backend/pkg/notification/sending.go @@ -328,9 +328,9 @@ func sendWebhookNotifications() error { } if n.Content.Webhook.DashboardId == 0 && n.Content.Webhook.DashboardGroupId == 0 { - _, err = db.FrontendWriterDB.Exec(`UPDATE users_val_dashboards_groups SET webhook_retries = retries + 1, webhook_last_sent = now() WHERE id = $1 AND dashboard_id = $2;`, n.Content.Webhook.DashboardGroupId, n.Content.Webhook.DashboardId) - } else { _, err = db.FrontendWriterDB.Exec(`UPDATE users_webhooks SET retries = retries + 1, last_sent = now(), request = $2, response = $3 WHERE id = $1;`, n.Content.Webhook.ID, n.Content, errResp) + } else { + _, err = db.WriterDb.Exec(`UPDATE users_val_dashboards_groups SET webhook_retries = retries + 1, webhook_last_sent = now() WHERE id = $1 AND dashboard_id = $2;`, n.Content.Webhook.DashboardGroupId, n.Content.Webhook.DashboardId) } if err != nil { log.Error(err, "error updating users_webhooks table", 0) From fed5140277868077cabd4fc2196e3a5472c5c6fe Mon Sep 17 00:00:00 2001 From: Lucca Dukic <109136188+LuccaBitfly@users.noreply.github.com> Date: Tue, 12 Nov 2024 09:44:54 +0100 Subject: [PATCH 5/5] refactor(DashboardTableBlocks): remove `sortable` attribute from rewards See: BEDS-947 --- frontend/components/dashboard/table/DashboardTableBlocks.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/components/dashboard/table/DashboardTableBlocks.vue b/frontend/components/dashboard/table/DashboardTableBlocks.vue index 01227c95f..df4e11a15 100644 --- a/frontend/components/dashboard/table/DashboardTableBlocks.vue +++ b/frontend/components/dashboard/table/DashboardTableBlocks.vue @@ -280,7 +280,6 @@ const isRowExpandable = (row: VDBBlocksTableRow) => {