Skip to content

Commit 560bbb0

Browse files
authored
Merge pull request #535 from ethpandaops/bbusa/change-default-blob-view
chore: change the calculator time frame to 18d
2 parents 1036009 + c1b4c7a commit 560bbb0

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

handlers/blobs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func buildBlobsPageData() (*models.BlobsPageData, time.Duration) {
9393
pageData.BlobsLast1h = stats.BlobsLast1h
9494
pageData.BlobsLast24h = stats.BlobsLast24h
9595
pageData.BlobsLast7d = stats.BlobsLast7d
96-
pageData.BlobsLast30d = stats.BlobsLast18d
96+
pageData.BlobsLast18d = stats.BlobsLast18d
9797
pageData.BlocksWithBlobsLast1h = stats.BlocksWithBlobsLast1h
9898
pageData.BlocksWithBlobsLast24h = stats.BlocksWithBlobsLast24h
9999
pageData.BlocksWithBlobsLast7d = stats.BlocksWithBlobsLast7d

templates/blobs/blobs.html

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ <h5 class="mb-0"><i class="fas fa-calculator"></i> Blob Storage Calculator (Peer
115115
<div class="alert alert-success p-4 text-center border-2">
116116
<h4 class="mb-2 text-success">Current Storage Required</h4>
117117
<h1 class="mb-0 display-4 fw-bold text-success" id="storageResult">Loading...</h1>
118-
<small class="text-muted d-block mt-2" id="storageDescription">Based on {{ formatAddCommas .BlobsLast30d }} blobs in last 1d</small>
118+
<small class="text-muted d-block mt-2" id="storageDescription">Based on {{ formatAddCommas .BlobsLast18d }} blobs in last 18d</small>
119119
</div>
120120

121121
<div class="mt-3">
@@ -210,10 +210,10 @@ <h5 class="mb-0"><i class="fas fa-list"></i> Latest Blob Transactions</h5>
210210
const FREE_THRESHOLD_ETH = VALIDATOR_CUSTODY_REQUIREMENT * MAX_EFFECTIVE_BALANCE_ETH;
211211
const MAX_ETH = {{ .StorageCalculator.MaxEth }};
212212

213-
const blobsInRetentionWindow = {{ .BlobsLast30d }};
213+
const blobsInRetentionWindow = {{ .BlobsLast18d }};
214214
const blobsLast24h = {{ .BlobsLast24h }};
215215
const blobsLast7d = {{ .BlobsLast7d }};
216-
const blobsLast18d = {{ .BlobsLast30d }};
216+
const blobsLast18d = {{ .BlobsLast18d }};
217217

218218
const timeStats = {
219219
'1h': {
@@ -235,7 +235,7 @@ <h5 class="mb-0"><i class="fas fa-list"></i> Latest Blob Transactions</h5>
235235
label: '7d'
236236
},
237237
'18d': {
238-
blobs: {{ .BlobsLast30d }},
238+
blobs: {{ .BlobsLast18d }},
239239
blocksWithBlobs: {{ .BlocksWithBlobsLast18d }},
240240
blobGas: {{ .BlobGasLast18d }},
241241
label: '18d'
@@ -244,6 +244,7 @@ <h5 class="mb-0"><i class="fas fa-list"></i> Latest Blob Transactions</h5>
244244

245245
let currentPeriod = '1d';
246246
let currentBlobCount = {{ .BlobsLast24h }};
247+
const calculatorBlobCount = {{ .BlobsLast18d }};
247248

248249
function updateTimeStats(period) {
249250
const stats = timeStats[period];
@@ -262,9 +263,6 @@ <h5 class="mb-0"><i class="fas fa-list"></i> Latest Blob Transactions</h5>
262263

263264
const avgGas = blocks > 0 ? Math.round(gas / blocks).toLocaleString() : '0';
264265
document.getElementById('timeAvgGas').textContent = avgGas;
265-
266-
const ethValue = parseInt(document.getElementById('ethSlider').value);
267-
updateCalculator(ethValue, false);
268266
}
269267

270268
function calculateCustodyColumns(eth) {
@@ -286,7 +284,7 @@ <h5 class="mb-0"><i class="fas fa-list"></i> Latest Blob Transactions</h5>
286284
const columns = calculateCustodyColumns(eth);
287285
const custodyPercent = ((columns / TOTAL_COLUMNS) * 100).toFixed(2);
288286

289-
const blobsToStore = currentBlobCount > 0 ? currentBlobCount : 0;
287+
const blobsToStore = calculatorBlobCount > 0 ? calculatorBlobCount : 0;
290288

291289
const storageBytes = blobsToStore * columns * COLUMN_SIZE_BYTES;
292290
const storageKiB = storageBytes / 1024;
@@ -337,7 +335,7 @@ <h5 class="mb-0"><i class="fas fa-list"></i> Latest Blob Transactions</h5>
337335

338336
document.getElementById('storageResult').textContent = storageText;
339337

340-
const descText = 'Based on ' + currentBlobCount.toLocaleString() + ' blobs in last ' + currentPeriod;
338+
const descText = 'Based on ' + calculatorBlobCount.toLocaleString() + ' blobs in last 18d';
341339
document.getElementById('storageDescription').textContent = descText;
342340
}
343341

types/models/blobs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type BlobsPageData struct {
88
BlobsLast1h uint64 `json:"blobs_last_1h"`
99
BlobsLast24h uint64 `json:"blobs_last_24h"`
1010
BlobsLast7d uint64 `json:"blobs_last_7d"`
11-
BlobsLast30d uint64 `json:"blobs_last_30d"`
11+
BlobsLast18d uint64 `json:"blobs_last_18d"`
1212
BlocksWithBlobsLast1h uint64 `json:"blocks_with_blobs_last_1h"`
1313
BlocksWithBlobsLast24h uint64 `json:"blocks_with_blobs_last_24h"`
1414
BlocksWithBlobsLast7d uint64 `json:"blocks_with_blobs_last_7d"`

0 commit comments

Comments
 (0)