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

merge staging->main #1125

Merged
merged 7 commits into from
Nov 13, 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
25 changes: 17 additions & 8 deletions backend/pkg/api/data_access/vdb_blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -267,12 +266,22 @@ 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"),
).
As("scheduled_blocks")
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"),
)

// 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
// 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)
Expand Down
4 changes: 2 additions & 2 deletions backend/pkg/notification/sending.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ const isRowExpandable = (row: VDBBlocksTableRow) => {
<Column
v-if="colsVisible.rewards"
field="reward"
:sortable="true"
body-class="reward"
header-class="reward"
:header="$t('dashboard.validator.col.proposer_rewards')"
Expand Down
Loading