Skip to content

Commit 2a2a79e

Browse files
committed
fix(api): added CL consolidations slot
1 parent 32843e9 commit 2a2a79e

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed

backend/pkg/api/data_access/vdb_consolidations.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func (d *DataAccessService) GetValidatorDashboardExecutionLayerConsolidations(ct
130130
}
131131

132132
defaultSlotSortDesc := true
133-
if colSort.Column == enums.VDBConsolidationsElColumns.BlockProcessed {
133+
if colSort.Column == enums.VDBConsolidationsElColumns.BlockQueued {
134134
// this implements a form of multicolumn sort which we don't want to support atm, but for a time-sensitive sort it should be justified
135135
defaultSlotSortDesc = colSort.Desc
136136
}
@@ -156,11 +156,11 @@ func (d *DataAccessService) GetValidatorDashboardExecutionLayerConsolidations(ct
156156
TargetIndex uint64 `db:"target_index"`
157157
BlockQueued uint64 `db:"block_queued"`
158158
BlockQueuedTime time.Time `db:"block_queued_ts"`
159-
TxIndex uint64 `db:"tx_index"` // for cursor only
160-
ITxIndex uint64 `db:"itx_index"` // for cursor only
161-
BlockProcessed sql.NullInt64 `db:"block_processed"` // need CL queued events from BEDS-1399
162-
BlockProcessedTime sql.NullInt64 `db:"block_processed_ts"` // need CL queued events from BEDS-1399
163-
From []byte `db:"from_address"` // BEDS-1405 (might get from BT for now)
159+
TxIndex uint64 `db:"tx_index"` // for cursor only
160+
ITxIndex uint64 `db:"itx_index"` // for cursor only
161+
BlockProcessed sql.NullInt64 `db:"block_processed"`
162+
BlockProcessedTime sql.NullInt64 `db:"block_processed_ts"`
163+
From []byte `db:"from_address"` // BEDS-1405 (might get from BT for now)
164164
Consolidator []byte `db:"consolidator"`
165165
TxHash []byte `db:"tx_hash"`
166166
Fee uint64 `db:"fee"`
@@ -416,10 +416,12 @@ func (d *DataAccessService) GetValidatorDashboardConsensusLayerConsolidations(ct
416416

417417
for _, r := range res {
418418
row := t.VDBConsolidationsClTableRow{
419-
Source: r.Source,
420-
Target: r.Target,
421-
Status: r.Status,
422-
Id: r.Id,
419+
Source: r.Source,
420+
Target: r.Target,
421+
Status: r.Status,
422+
Id: r.Id,
423+
Slot: r.Slot,
424+
SlotIndex: r.SlotIndex,
423425
}
424426

425427
// some data integrity checks TODO add more

backend/pkg/api/enums/validator_dashboard_enums.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ type VDBConsolidationsElColumn int
298298
var _ EnumFactory[VDBConsolidationsElColumn] = VDBConsolidationsElColumn(0)
299299

300300
const (
301-
VDBConsolidationElBlockProcessed VDBConsolidationsElColumn = iota
301+
VDBConsolidationElBlockQueued VDBConsolidationsElColumn = iota
302302
)
303303

304304
func (c VDBConsolidationsElColumn) Int() int {
@@ -307,26 +307,26 @@ func (c VDBConsolidationsElColumn) Int() int {
307307

308308
func (VDBConsolidationsElColumn) NewFromString(s string) VDBConsolidationsElColumn {
309309
switch s {
310-
case "", "block_processed", "timestamp":
311-
return VDBConsolidationElBlockProcessed
310+
case "", "block_queued", "timestamp":
311+
return VDBConsolidationElBlockQueued
312312
default:
313313
return VDBConsolidationsElColumn(-1)
314314
}
315315
}
316316

317317
func (c VDBConsolidationsElColumn) ToExpr() OrderableSortable {
318318
switch c {
319-
case VDBConsolidationElBlockProcessed:
319+
case VDBConsolidationElBlockQueued:
320320
return goqu.I("el_cr.block_number")
321321
default:
322322
return nil
323323
}
324324
}
325325

326326
var VDBConsolidationsElColumns = struct {
327-
BlockProcessed VDBConsolidationsElColumn
327+
BlockQueued VDBConsolidationsElColumn
328328
}{
329-
VDBConsolidationElBlockProcessed,
329+
VDBConsolidationElBlockQueued,
330330
}
331331

332332
// ----------------

backend/pkg/api/types/validator_dashboard.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,8 @@ type VDBConsolidationsClTableRow struct {
353353
RejectReason *string `json:"reject_reason,omitempty" tstype:"'source_equals_target' | 'full_queue' | 'insufficient_consolidation_churn' | 'source_unknown_pubkey' | 'target_unknown_pubkey' | 'source_no_execution_withdrawal_credentials' | 'source_address_mismatch' | 'target_not_compounding' | 'source_inactive' | 'target_inactive' | 'source_exiting' | 'target_exiting' | 'source_too_young' | 'source_pending_withdrawals' | 'source_slashed'" faker:"oneof: source_equals_target, full_queue, insufficient_consolidation_churn, source_unknown_pubkey, target_unknown_pubkey, source_no_execution_withdrawal_credentials, source_address_mismatch, target_not_compounding, source_inactive, target_inactive, source_exiting, target_exiting, source_too_young, source_pending_withdrawals, source_slashed"`
354354
Amount *decimal.Decimal `json:"amount,omitempty" faker:"eth"`
355355
Id uint64 `json:"id"`
356+
Slot uint64 `json:"slot"`
357+
SlotIndex uint64 `json:"slot_index"`
356358
}
357359
type GetValidatorDashboardConsensusLayerConsolidationsResponse ApiPagingResponse[VDBConsolidationsClTableRow]
358360

frontend/types/api/validator_dashboard.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ export interface VDBConsolidationsClTableRow {
313313
reject_reason?: 'source_equals_target' | 'full_queue' | 'insufficient_consolidation_churn' | 'source_unknown_pubkey' | 'target_unknown_pubkey' | 'source_no_execution_withdrawal_credentials' | 'source_address_mismatch' | 'target_not_compounding' | 'source_inactive' | 'target_inactive' | 'source_exiting' | 'target_exiting' | 'source_too_young' | 'source_pending_withdrawals' | 'source_slashed';
314314
amount?: string /* decimal.Decimal */;
315315
id: number /* uint64 */;
316+
slot: number /* uint64 */;
317+
slot_index: number /* uint64 */;
316318
}
317319
export type GetValidatorDashboardConsensusLayerConsolidationsResponse = ApiPagingResponse<VDBConsolidationsClTableRow>;
318320
/**

0 commit comments

Comments
 (0)