Skip to content

Commit

Permalink
Merge pull request #1125 from gobitfly/staging
Browse files Browse the repository at this point in the history
merge staging->main
  • Loading branch information
guybrush authored Nov 13, 2024
2 parents 15233d3 + 68fdf00 commit 85b0ca3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
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

0 comments on commit 85b0ca3

Please sign in to comment.