Skip to content

Blocksim Benchmark#3247

Open
cody-littley wants to merge 3 commits intomainfrom
cjl/blocksim-stand-alone
Open

Blocksim Benchmark#3247
cody-littley wants to merge 3 commits intomainfrom
cjl/blocksim-stand-alone

Conversation

@cody-littley
Copy link
Copy Markdown
Contributor

@cody-littley cody-littley commented Apr 14, 2026

Created a benchmarking framework for the block DB. This benchmark currently exercises the write pathway. The read pathway benchmarking will come in a future PR.

@cody-littley cody-littley self-assigned this Apr 14, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 14, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 15, 2026, 6:00 PM

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 10.77283% with 762 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.98%. Comparing base (ec0ec44) to head (acfe800).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
sei-db/block_db/blocksim/blocksim.go 0.00% 188 Missing ⚠️
sei-db/common/metrics/system_metrics.go 0.00% 143 Missing ⚠️
sei-db/block_db/blocksim/blocksim_metrics.go 0.00% 103 Missing ⚠️
sei-db/common/utils/format.go 0.00% 89 Missing ⚠️
sei-db/block_db/blocksim/blocksim_config.go 0.00% 60 Missing ⚠️
sei-db/block_db/blocksim/cmd/blocksim/main.go 0.00% 50 Missing ⚠️
sei-db/block_db/blocksim/block_generator.go 0.00% 38 Missing ⚠️
sei-db/common/metrics/setup.go 0.00% 32 Missing ⚠️
...-db/block_db/blocksim/cmd/configure-logger/main.go 0.00% 19 Missing ⚠️
sei-db/common/utils/config.go 0.00% 19 Missing ⚠️
... and 4 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3247      +/-   ##
==========================================
- Coverage   59.22%   58.98%   -0.25%     
==========================================
  Files        2069     2082      +13     
  Lines      169661   170572     +911     
==========================================
+ Hits       100487   100608     +121     
- Misses      60378    61158     +780     
- Partials     8796     8806      +10     
Flag Coverage Δ
sei-chain-pr 18.72% <10.77%> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-db/common/rand/canned_random.go 51.66% <66.66%> (ø)
sei-db/block_db/mem_block_db/mem_block_db.go 97.50% <97.50%> (ø)
sei-db/common/utils/hash64.go 85.71% <85.71%> (ø)
sei-db/common/utils/path.go 27.27% <0.00%> (-72.73%) ⬇️
...-db/block_db/blocksim/cmd/configure-logger/main.go 0.00% <0.00%> (ø)
sei-db/common/utils/config.go 0.00% <0.00%> (ø)
sei-db/common/metrics/setup.go 0.00% <0.00%> (ø)
sei-db/block_db/blocksim/block_generator.go 0.00% <0.00%> (ø)
sei-db/block_db/blocksim/cmd/blocksim/main.go 0.00% <0.00%> (ø)
sei-db/block_db/blocksim/blocksim_config.go 0.00% <0.00%> (ø)
... and 4 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cody-littley cody-littley marked this pull request as ready for review April 15, 2026 18:00
@@ -0,0 +1,78 @@
package blockdb
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend move blockDB code to ledger_db/block

Comment on lines +197 to +201
// Periodic prune.
if blk.Height > b.config.UnprunedBlocks {
b.metrics.SetMainThreadPhase("prune")
lowestToKeep := blk.Height - b.config.UnprunedBlocks
if err := b.db.Prune(b.ctx, lowestToKeep); err != nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says periodic prune, but we are pruning for every block here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants