Skip to content

Commit 2496721

Browse files
committed
various fixes for builder deposits & builder details UI
1 parent abbd103 commit 2496721

8 files changed

Lines changed: 128 additions & 60 deletions

File tree

handlers/builder_deposits.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
func BuilderDeposits(w http.ResponseWriter, r *http.Request) {
2121
var templateFiles = append(layoutTemplateFiles,
2222
"builder_deposits/builder_deposits.html",
23+
"_shared/txDetailsModal.html",
2324
"_svg/professor.html",
2425
)
2526

@@ -197,6 +198,14 @@ func buildBuilderDepositsPageData(ctx context.Context, pageIdx uint64, pageSize
197198
depositData.HasTransaction = true
198199
depositData.TransactionHash = deposit.Transaction.TxHash
199200
depositData.TransactionOrphaned = deposit.TransactionOrphaned
201+
depositData.TransactionDetails = &models.BuilderPageDataDepositTxDetails{
202+
BlockNumber: deposit.Transaction.BlockNumber,
203+
BlockHash: fmt.Sprintf("%#x", deposit.Transaction.BlockRoot),
204+
BlockTime: deposit.Transaction.BlockTime,
205+
TxOrigin: common.Address(deposit.Transaction.TxSender).Hex(),
206+
TxTarget: common.Address(deposit.Transaction.TxTarget).Hex(),
207+
TxHash: fmt.Sprintf("%#x", deposit.Transaction.TxHash),
208+
}
200209
}
201210

202211
pageData.Deposits = append(pageData.Deposits, depositData)

handlers/builder_exits.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
func BuilderExits(w http.ResponseWriter, r *http.Request) {
2121
var templateFiles = append(layoutTemplateFiles,
2222
"builder_exits/builder_exits.html",
23+
"_shared/txDetailsModal.html",
2324
"_svg/professor.html",
2425
)
2526

@@ -183,6 +184,14 @@ func buildBuilderExitsPageData(ctx context.Context, pageIdx uint64, pageSize uin
183184
exitData.HasTransaction = true
184185
exitData.TransactionHash = exit.Transaction.TxHash
185186
exitData.TransactionOrphaned = exit.TransactionOrphaned
187+
exitData.TransactionDetails = &models.BuilderPageDataExitTxDetails{
188+
BlockNumber: exit.Transaction.BlockNumber,
189+
BlockHash: fmt.Sprintf("%#x", exit.Transaction.BlockRoot),
190+
BlockTime: exit.Transaction.BlockTime,
191+
TxOrigin: common.Address(exit.Transaction.TxSender).Hex(),
192+
TxTarget: common.Address(exit.Transaction.TxTarget).Hex(),
193+
TxHash: fmt.Sprintf("%#x", exit.Transaction.TxHash),
194+
}
186195
}
187196

188197
pageData.Exits = append(pageData.Exits, exitData)

handlers/pageData.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,17 +301,17 @@ func createMenuItems(active string) []types.MainMenuItem {
301301
{
302302
Links: []types.NavigationLink{
303303
{
304-
Label: "Builders List",
304+
Label: "Builders",
305305
Path: "/builders",
306306
Icon: "fa-building",
307307
},
308308
{
309-
Label: "Builder Deposits",
309+
Label: "Deposits",
310310
Path: "/builders/deposits",
311311
Icon: "fa-file-signature",
312312
},
313313
{
314-
Label: "Builder Exits",
314+
Label: "Exits",
315315
Path: "/builders/exits",
316316
Icon: "fa-door-open",
317317
},
@@ -322,14 +322,14 @@ func createMenuItems(active string) []types.MainMenuItem {
322322
builderSubmitLinks := []types.NavigationLink{}
323323
if utils.Config.Frontend.ShowSubmitDeposit {
324324
builderSubmitLinks = append(builderSubmitLinks, types.NavigationLink{
325-
Label: "Submit Builder Deposit",
325+
Label: "Submit Deposit",
326326
Path: "/builders/submit_deposit",
327327
Icon: "fa-file-import",
328328
})
329329
}
330330
if utils.Config.Frontend.ShowSubmitElRequests {
331331
builderSubmitLinks = append(builderSubmitLinks, types.NavigationLink{
332-
Label: "Submit Builder Exit",
332+
Label: "Submit Exit",
333333
Path: "/builders/submit_exit",
334334
Icon: "fa-door-open",
335335
})

templates/builder_deposits/builder_deposits.html

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,17 @@ <h1 class="h4 mb-1 mb-md-0">
167167
</td>
168168
<td class="d-none d-md-table-cell">
169169
{{ if $deposit.HasTransaction }}
170-
<a href="/el/tx/0x{{ printf "%x" $deposit.TransactionHash }}" class="text-truncate d-inline-block" style="max-width: 150px;">0x{{ printf "%x" $deposit.TransactionHash }}</a>
170+
<div class="d-flex">
171+
<span class="flex-grow-1 text-truncate" style="max-width: 150px;">{{ ethTransactionLink $deposit.TransactionHash 0 }}</span>
172+
<div>
173+
<i class="fa fa-copy text-muted ml-2 p-1" role="button" data-bs-toggle="tooltip" title="Copy to clipboard" data-clipboard-text="0x{{ printf "%x" $deposit.TransactionHash }}"></i>
174+
</div>
175+
{{ if $deposit.TransactionDetails }}
176+
<div>
177+
<i class="fa fa-info-circle text-muted ml-2 p-1 nojs-hide tx-details-btn" role="button" data-txdetails="{{ includeJSON $deposit.TransactionDetails true }}"></i>
178+
</div>
179+
{{ end }}
180+
</div>
171181
{{ else }}
172182
<span class="text-muted">-</span>
173183
{{ end }}
@@ -223,9 +233,12 @@ <h1 class="h4 mb-1 mb-md-0">
223233
</div>
224234
<div id="footer-placeholder" style="height:71px;"></div>
225235
</div>
236+
{{ template "txDetailsModal" . }}
226237
</div>
227238
{{ end }}
228-
{{ define "js" }}{{ end }}
239+
{{ define "js" }}
240+
{{ template "txDetailsModal-js" . }}
241+
{{ end }}
229242
{{ define "css" }}
230243
<style>
231244
.filter-amount-separator {
@@ -234,4 +247,5 @@ <h1 class="h4 mb-1 mb-md-0">
234247
padding-right: 10px;
235248
}
236249
</style>
250+
{{ template "txDetailsModal-css" . }}
237251
{{ end }}

templates/builder_exits/builder_exits.html

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,17 @@ <h1 class="h4 mb-1 mb-md-0">
156156
</td>
157157
<td class="d-none d-md-table-cell">
158158
{{ if $exit.HasTransaction }}
159-
<a href="/el/tx/0x{{ printf "%x" $exit.TransactionHash }}" class="text-truncate d-inline-block" style="max-width: 150px;">0x{{ printf "%x" $exit.TransactionHash }}</a>
159+
<div class="d-flex">
160+
<span class="flex-grow-1 text-truncate" style="max-width: 150px;">{{ ethTransactionLink $exit.TransactionHash 0 }}</span>
161+
<div>
162+
<i class="fa fa-copy text-muted ml-2 p-1" role="button" data-bs-toggle="tooltip" title="Copy to clipboard" data-clipboard-text="0x{{ printf "%x" $exit.TransactionHash }}"></i>
163+
</div>
164+
{{ if $exit.TransactionDetails }}
165+
<div>
166+
<i class="fa fa-info-circle text-muted ml-2 p-1 nojs-hide tx-details-btn" role="button" data-txdetails="{{ includeJSON $exit.TransactionDetails true }}"></i>
167+
</div>
168+
{{ end }}
169+
</div>
160170
{{ else }}
161171
<span class="text-muted">-</span>
162172
{{ end }}
@@ -212,9 +222,12 @@ <h1 class="h4 mb-1 mb-md-0">
212222
</div>
213223
<div id="footer-placeholder" style="height:71px;"></div>
214224
</div>
225+
{{ template "txDetailsModal" . }}
215226
</div>
216227
{{ end }}
217-
{{ define "js" }}{{ end }}
228+
{{ define "js" }}
229+
{{ template "txDetailsModal-js" . }}
230+
{{ end }}
218231
{{ define "css" }}
219232
<style>
220233
.filter-amount-separator {
@@ -223,4 +236,5 @@ <h1 class="h4 mb-1 mb-md-0">
223236
padding-right: 10px;
224237
}
225238
</style>
239+
{{ template "txDetailsModal-css" . }}
226240
{{ end }}

templates/slot/slot.html

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -242,33 +242,43 @@ <h3 class="h5 col-md-12 text-center"><b>Showing {{ .Block.BlobsCount }} Blob sid
242242
{{ if gt $executionRequestsCount 0 }}
243243
<div class="tab-pane fade show active" id="executionRequests" role="tabpanel" aria-labelledby="executionRequests-tab">
244244
<div class="card block-card">
245-
<div style="margin-bottom: -.25rem;" class="card-body px-0 py-1">
245+
<div class="card-body px-0 py-1">
246246
<div class="row p-1 mx-0">
247-
<h3 class="h5 col-md-12 text-center"><b>Showing {{ $executionRequestsCount }} Execution Requests{{ if .Block.RequestsFromParentPayload }} from the Parent Payload{{ end }}</b></h3>
247+
<h3 class="h5 col-md-12 text-center mb-0"><b>Showing {{ $executionRequestsCount }} Execution Requests{{ if .Block.RequestsFromParentPayload }} from the Parent Payload{{ end }}</b></h3>
248248
{{ if .Block.RequestsFromParentPayload }}<p class="col-md-12 text-center text-muted mb-0"><small>These requests were included in the parent block's payload (EIP-7732) and are processed in this block.</small></p>{{ end }}
249249
</div>
250250
</div>
251+
{{ if gt .Block.DepositRequestsCount 0 }}
252+
<div class="exec-request-section border-top">
253+
<h4 class="h6 px-3 pt-2 mb-1">Deposit Requests <span class="badge bg-secondary text-white">{{ .Block.DepositRequestsCount }}</span></h4>
254+
{{ template "block_deposit_requests" . }}
255+
</div>
256+
{{ end }}
257+
{{ if gt .Block.WithdrawalRequestsCount 0 }}
258+
<div class="exec-request-section border-top">
259+
<h4 class="h6 px-3 pt-2 mb-1">Withdrawal Requests <span class="badge bg-secondary text-white">{{ .Block.WithdrawalRequestsCount }}</span></h4>
260+
{{ template "block_withdrawal_requests" . }}
261+
</div>
262+
{{ end }}
263+
{{ if gt .Block.ConsolidationRequestsCount 0 }}
264+
<div class="exec-request-section border-top">
265+
<h4 class="h6 px-3 pt-2 mb-1">Consolidation Requests <span class="badge bg-secondary text-white">{{ .Block.ConsolidationRequestsCount }}</span></h4>
266+
{{ template "block_consolidation_requests" . }}
267+
</div>
268+
{{ end }}
269+
{{ if gt .Block.BuilderDepositRequestsCount 0 }}
270+
<div class="exec-request-section border-top">
271+
<h4 class="h6 px-3 pt-2 mb-1">Builder Deposits <span class="badge bg-secondary text-white">{{ .Block.BuilderDepositRequestsCount }}</span></h4>
272+
{{ template "block_builder_deposit_requests" . }}
273+
</div>
274+
{{ end }}
275+
{{ if gt .Block.BuilderExitRequestsCount 0 }}
276+
<div class="exec-request-section border-top">
277+
<h4 class="h6 px-3 pt-2 mb-1">Builder Exits <span class="badge bg-secondary text-white">{{ .Block.BuilderExitRequestsCount }}</span></h4>
278+
{{ template "block_builder_exit_requests" . }}
279+
</div>
280+
{{ end }}
251281
</div>
252-
{{ if gt .Block.DepositRequestsCount 0 }}
253-
<h4 class="h6 px-2 mt-3 mb-1">Deposit Requests <span class="badge bg-secondary text-white">{{ .Block.DepositRequestsCount }}</span></h4>
254-
{{ template "block_deposit_requests" . }}
255-
{{ end }}
256-
{{ if gt .Block.WithdrawalRequestsCount 0 }}
257-
<h4 class="h6 px-2 mt-3 mb-1">Withdrawal Requests <span class="badge bg-secondary text-white">{{ .Block.WithdrawalRequestsCount }}</span></h4>
258-
{{ template "block_withdrawal_requests" . }}
259-
{{ end }}
260-
{{ if gt .Block.ConsolidationRequestsCount 0 }}
261-
<h4 class="h6 px-2 mt-3 mb-1">Consolidation Requests <span class="badge bg-secondary text-white">{{ .Block.ConsolidationRequestsCount }}</span></h4>
262-
{{ template "block_consolidation_requests" . }}
263-
{{ end }}
264-
{{ if gt .Block.BuilderDepositRequestsCount 0 }}
265-
<h4 class="h6 px-2 mt-3 mb-1">Builder Deposits <span class="badge bg-secondary text-white">{{ .Block.BuilderDepositRequestsCount }}</span></h4>
266-
{{ template "block_builder_deposit_requests" . }}
267-
{{ end }}
268-
{{ if gt .Block.BuilderExitRequestsCount 0 }}
269-
<h4 class="h6 px-2 mt-3 mb-1">Builder Exits <span class="badge bg-secondary text-white">{{ .Block.BuilderExitRequestsCount }}</span></h4>
270-
{{ template "block_builder_exit_requests" . }}
271-
{{ end }}
272282
</div>
273283
{{ end }}
274284
{{ if and .Block.ExecutionData .Block.ExecutionData.BlockAccessList }}
@@ -607,5 +617,15 @@ <h5 class="mb-3"><i class="fas fa-project-diagram me-2"></i>Tracoor Traces</h5>
607617
.eip7918-info-btn:hover {
608618
opacity: 0.8;
609619
}
620+
.exec-request-section {
621+
padding-bottom: 0.25rem;
622+
}
623+
.exec-request-section > h4 {
624+
color: var(--bs-secondary-color, #6c757d);
625+
font-weight: 600;
626+
}
627+
.exec-request-section .table {
628+
margin-bottom: 0;
629+
}
610630
</style>
611631
{{ end }}

types/models/builder_deposits.go

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,20 @@ type BuilderDepositsPageData struct {
3636
}
3737

3838
type BuilderDepositsPageDataDeposit struct {
39-
IsIncluded bool `json:"is_included"` // included in a block (CL request) vs pending tx only
40-
SlotNumber uint64 `json:"slot"`
41-
SlotRoot []byte `json:"slot_root" ssz-size:"32"`
42-
Time time.Time `json:"time"`
43-
Orphaned bool `json:"orphaned"`
44-
PublicKey []byte `json:"pubkey" ssz-size:"48"`
45-
WithdrawalCredentials []byte `json:"wdcreds" ssz-size:"32"`
46-
Amount uint64 `json:"amount"`
47-
HasBuilderIndex bool `json:"has_builder_index"`
48-
BuilderIndex uint64 `json:"builder_index"`
49-
Result uint8 `json:"result"`
50-
HasTransaction bool `json:"has_transaction"`
51-
TransactionHash []byte `json:"tx_hash" ssz-size:"32"`
52-
TransactionOrphaned bool `json:"tx_orphaned"`
53-
BlockNumber uint64 `json:"block_number"`
39+
IsIncluded bool `json:"is_included"` // included in a block (CL request) vs pending tx only
40+
SlotNumber uint64 `json:"slot"`
41+
SlotRoot []byte `json:"slot_root" ssz-size:"32"`
42+
Time time.Time `json:"time"`
43+
Orphaned bool `json:"orphaned"`
44+
PublicKey []byte `json:"pubkey" ssz-size:"48"`
45+
WithdrawalCredentials []byte `json:"wdcreds" ssz-size:"32"`
46+
Amount uint64 `json:"amount"`
47+
HasBuilderIndex bool `json:"has_builder_index"`
48+
BuilderIndex uint64 `json:"builder_index"`
49+
Result uint8 `json:"result"`
50+
HasTransaction bool `json:"has_transaction"`
51+
TransactionHash []byte `json:"tx_hash" ssz-size:"32"`
52+
TransactionDetails *BuilderPageDataDepositTxDetails `json:"tx_details"`
53+
TransactionOrphaned bool `json:"tx_orphaned"`
54+
BlockNumber uint64 `json:"block_number"`
5455
}

types/models/builder_exits.go

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,19 @@ type BuilderExitsPageData struct {
3535
}
3636

3737
type BuilderExitsPageDataExit struct {
38-
IsIncluded bool `json:"is_included"`
39-
SlotNumber uint64 `json:"slot"`
40-
SlotRoot []byte `json:"slot_root" ssz-size:"32"`
41-
Time time.Time `json:"time"`
42-
Orphaned bool `json:"orphaned"`
43-
SourceAddress []byte `json:"source_address" ssz-size:"20"`
44-
PublicKey []byte `json:"pubkey" ssz-size:"48"`
45-
HasBuilderIndex bool `json:"has_builder_index"`
46-
BuilderIndex uint64 `json:"builder_index"`
47-
Result uint8 `json:"result"`
48-
HasTransaction bool `json:"has_transaction"`
49-
TransactionHash []byte `json:"tx_hash" ssz-size:"32"`
50-
TransactionOrphaned bool `json:"tx_orphaned"`
51-
BlockNumber uint64 `json:"block_number"`
38+
IsIncluded bool `json:"is_included"`
39+
SlotNumber uint64 `json:"slot"`
40+
SlotRoot []byte `json:"slot_root" ssz-size:"32"`
41+
Time time.Time `json:"time"`
42+
Orphaned bool `json:"orphaned"`
43+
SourceAddress []byte `json:"source_address" ssz-size:"20"`
44+
PublicKey []byte `json:"pubkey" ssz-size:"48"`
45+
HasBuilderIndex bool `json:"has_builder_index"`
46+
BuilderIndex uint64 `json:"builder_index"`
47+
Result uint8 `json:"result"`
48+
HasTransaction bool `json:"has_transaction"`
49+
TransactionHash []byte `json:"tx_hash" ssz-size:"32"`
50+
TransactionDetails *BuilderPageDataExitTxDetails `json:"tx_details"`
51+
TransactionOrphaned bool `json:"tx_orphaned"`
52+
BlockNumber uint64 `json:"block_number"`
5253
}

0 commit comments

Comments
 (0)