Skip to content

Background Transaction Generation#3021

Merged
cody-littley merged 12 commits intomainfrom
cody-littley/time-per-block
Mar 10, 2026
Merged

Background Transaction Generation#3021
cody-littley merged 12 commits intomainfrom
cody-littley/time-per-block

Conversation

@cody-littley
Copy link
Contributor

Describe your changes and provide context

Moved transaction generation off of the main benchmark thread for the cryptosim benchmark.

Testing performed to validate your change

Tested locally.

@cody-littley cody-littley self-assigned this Mar 4, 2026
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMar 10, 2026, 7:26 PM

Cody Littley added 2 commits March 4, 2026 15:13
Signed-off-by: Cody Littley <cody.littley@seinetwork.io>
@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.37%. Comparing base (285e643) to head (a6d3126).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3021      +/-   ##
==========================================
- Coverage   58.39%   58.37%   -0.02%     
==========================================
  Files        2080     2109      +29     
  Lines      171924   174801    +2877     
==========================================
+ Hits       100396   102045    +1649     
- Misses      62588    63733    +1145     
- Partials     8940     9023      +83     
Flag Coverage Δ
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 105 files with indirect coverage changes

🚀 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.


// This method should be called after a block is finished executing and finalized.
// Reports metrics about the block.
func (b *block) ReportBlockMetrcs() {
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: Metrics

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

}

// Returns an iterator over the transactions in the block.
func (b *block) Iterator() iter.Seq[*transaction] {
Copy link
Contributor

Choose a reason for hiding this comment

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

is this function get called?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this to avoid direct access to the block.transactions member variable, but forgot to actually use it. It is now used.

EnableSuspension bool

// The capacity of the channel that holds blocks awaiting execution.
BlockChannelCapacity int
Copy link
Contributor

Choose a reason for hiding this comment

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

optional: adding BlockChannelCapacity to Validate()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added


// Now that we are done generating initial data, it is thread safe to start the block builder.
// (dataGenerator is not thread safe, and is used both for initial setup and for transaction generation)
c.blockBuilder.Start()
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if this could. a problem, when blockBuilder.Start() is called. the blocker builder thread owns dataGenerator. but during suspend(), the main groutoutine reads from it, introduces concurrent access.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Fixed.

}

// Returns an iterator over the transactions in the block.
func (b *block) Iterator() iter.Seq[*transaction] {
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@cody-littley cody-littley enabled auto-merge (squash) March 10, 2026 17:41
@cody-littley cody-littley merged commit b7f2626 into main Mar 10, 2026
36 of 38 checks passed
@cody-littley cody-littley deleted the cody-littley/time-per-block branch March 10, 2026 20:51
blindchaser pushed a commit that referenced this pull request Mar 13, 2026
## Describe your changes and provide context

Moved transaction generation off of the main benchmark thread for the
cryptosim benchmark.

## Testing performed to validate your change

Tested locally.

---------

Signed-off-by: Cody Littley <cody.littley@seinetwork.io>
Co-authored-by: Cody Littley <cody.littley@seinetwork.io>
github-merge-queue bot pushed a commit that referenced this pull request Mar 13, 2026
## Summary

The squash-merge of #3039 (`feat(flatkv): add read-only LoadVersion for
state sync`) inadvertently reverted changes from 5 previously-merged
PRs. The `yiren/flatkv-readonly` branch had accumulated stale versions
of files through merge-from-main commits, and when the final
squash-merge landed, those stale versions overwrote the newer code on
`main`.

### PRs reverted by #3039 and restored in this PR

| PR | Title | Key changes lost |
|---|---|---|
| **#2810** | fix(giga): check whether txs follow Giga ordering |
`firstCosmosSeen` tx ordering check, `len(evmEntries) > 0` /
`len(v2Entries) > 0` guards in `ProcessTXsWithOCCGiga` |
| **#3035** | Add receiptdb config option in app.toml |
`ReceiptStoreConfig` in app.toml, `readReceiptStoreConfig()`,
`BackendTypeName()`, receipt config tests |
| **#3043** | Add config to enable lattice hash | `EnableLatticeHash`
config, composite store lattice hash support |
| **#3021** | Background Transaction Generation | `block.go`,
`block_builder.go` for cryptosim benchmark |
| **#3046** | Add console logger and fix memiavl config for benchmark |
`BlocksPerCommit=1`, `SnapshotInterval=1000`,
`SnapshotMinTimeInterval=60` |

### Conflict resolutions

Since several PRs landed after #3039 (notably #3050 slog migration,
#3053 flaky test fix, #3062 admin service), cherry-picks required manual
conflict resolution:

- **`app/app.go`** (#2810): Kept #2810's structural changes, used
`logger.Error` (from #3050) instead of `ctx.Logger().Error`
- **`cmd/seid/cmd/app_config.go`** (#3035): Kept both `ReceiptStore`
(from #3035) and `Admin` (from #3062)
- **`sei-db/ledger_db/receipt/receipt_store.go`** (#3035): Restored
`BackendTypeName` but dropped logger param (superseded by #3050 slog)
- **`sei-db/ledger_db/receipt/parquet_store_test.go`** (#3035): Kept
#3053's deterministic pruning test fix
- **`sei-db/state_db/sc/composite/store_test.go`** (#3043): Merged all
three needed imports
- **`sei-db/common/logger/logger.go`** (#3046): Kept deletion from
#3050; `consoleLogger` is no longer needed with slog
- **`sei-db/state_db/bench/wrappers/db_implementations.go`** (#3046):
Kept #3050's no-logger-param API

---------

Signed-off-by: Cody Littley <cody.littley@seinetwork.io>
Co-authored-by: Cody Littley <56973212+cody-littley@users.noreply.github.com>
Co-authored-by: Cody Littley <cody.littley@seinetwork.io>
yzang2019 pushed a commit that referenced this pull request Mar 19, 2026
## Describe your changes and provide context

Moved transaction generation off of the main benchmark thread for the
cryptosim benchmark.

## Testing performed to validate your change

Tested locally.

---------

Signed-off-by: Cody Littley <cody.littley@seinetwork.io>
Co-authored-by: Cody Littley <cody.littley@seinetwork.io>
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.

3 participants