Skip to content

Conversation

@prajwolrg
Copy link
Contributor

@prajwolrg prajwolrg commented Sep 29, 2025

Description

Implements a memory-efficient OperatorBitmap structure to replace Vec<OperatorIdx> across the bridge subprotocol to reduce memory usage for operator set tracking while improving performance of set operations.

I used Claude Code for generating tests and updating docstrings.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature/Enhancement (non-breaking change which adds functionality or enhances an existing one)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor
  • New or updated tests
  • Dependency Update

Notes to Reviewers

Checklist

  • I have performed a self-review of my code.
  • I have commented my code where necessary.
  • I have updated the documentation if needed.
  • My changes do not introduce new warnings.
  • I have added (where necessary) tests that prove my changes are effective or that my feature works.
  • New and existing tests pass with my changes.
  • I have disclosed my use of AI
    in the body of this PR.

Related Issues

@github-actions
Copy link
Contributor

github-actions bot commented Sep 29, 2025

Commit: 412b866

SP1 Execution Results

program cycles success
EVM EE STF 1,172,795
CL STF 332,280
Checkpoint 2,422

@codecov
Copy link

codecov bot commented Sep 29, 2025

Codecov Report

❌ Patch coverage is 94.65649% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.43%. Comparing base (7c37990) to head (cbc22e0).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...asm/subprotocols/bridge-v1/src/state/assignment.rs 88.88% 10 Missing ⚠️
...tes/asm/subprotocols/bridge-v1/src/state/bitmap.rs 97.60% 3 Missing ⚠️
...es/asm/subprotocols/bridge-v1/src/state/deposit.rs 85.71% 1 Missing ⚠️
@@            Coverage Diff             @@
##             main    #1073      +/-   ##
==========================================
+ Coverage   74.31%   74.43%   +0.12%     
==========================================
  Files         492      501       +9     
  Lines       40960    42336    +1376     
==========================================
+ Hits        30439    31514    +1075     
- Misses      10521    10822     +301     
Flag Coverage Δ
functional 52.38% <14.90%> (-0.18%) ⬇️
unit 53.65% <94.27%> (+0.81%) ⬆️

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

Files with missing lines Coverage Δ
...tes/asm/subprotocols/bridge-v1/src/state/bridge.rs 96.95% <100.00%> (ø)
...s/asm/subprotocols/bridge-v1/src/state/operator.rs 96.19% <100.00%> (+0.19%) ⬆️
...es/asm/subprotocols/bridge-v1/src/state/deposit.rs 96.24% <85.71%> (-0.11%) ⬇️
...tes/asm/subprotocols/bridge-v1/src/state/bitmap.rs 97.60% <97.60%> (ø)
...asm/subprotocols/bridge-v1/src/state/assignment.rs 93.67% <88.88%> (-2.33%) ⬇️

... and 33 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@prajwolrg prajwolrg self-assigned this Sep 29, 2025
@prajwolrg prajwolrg force-pushed the STR-1639-use-bitmap branch 2 times, most recently from b455eee to 1400d32 Compare September 29, 2025 16:12
@prajwolrg prajwolrg force-pushed the STR-1639-use-bitmap branch 2 times, most recently from 8441be6 to e90fb0a Compare September 30, 2025 02:50
@prajwolrg prajwolrg changed the title Str 1639 use bitmap perf: optimize operator tracking with bitmap implementation Sep 30, 2025
@prajwolrg prajwolrg marked this pull request as ready for review September 30, 2025 02:54
@prajwolrg prajwolrg requested review from a team as code owners September 30, 2025 02:54
storopoli
storopoli previously approved these changes Sep 30, 2025
Copy link
Member

@storopoli storopoli left a comment

Choose a reason for hiding this comment

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

ACK e90fb0a

Copy link
Contributor

@Rajil1213 Rajil1213 left a comment

Choose a reason for hiding this comment

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

There is something to be said about whether this kind of optimization is even needed given that there are not going to be that many operators. Barring that, I've left a few nits (both on the APIs and the docs) but there are no major blockers.

storopoli
storopoli previously approved these changes Oct 6, 2025
Copy link
Member

@storopoli storopoli left a comment

Choose a reason for hiding this comment

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

ACK a26e6a1

@prajwolrg
Copy link
Contributor Author

There is something to be said about whether this kind of optimization is even needed given that there are not going to be that many operators. Barring that, I've left a few nits (both on the APIs and the docs) but there are no major blockers.

The optimization is not that significant. I worked on it because it was brought up in some old PR.

@prajwolrg prajwolrg force-pushed the STR-1639-use-bitmap branch from fd30b90 to 7f2b91c Compare October 7, 2025 08:21
Copy link
Contributor

@Rajil1213 Rajil1213 left a comment

Choose a reason for hiding this comment

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

Did another pass after the recent changes and left a few more comments. I think it'll be good to go for me once those have been addressed.

@prajwolrg prajwolrg requested a review from a team as a code owner October 10, 2025 02:52
Copy link
Member

@storopoli storopoli left a comment

Choose a reason for hiding this comment

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

ACK cbc22e0

@storopoli
Copy link
Member

@evgenyzdanovich or @irnb can someone from @alpenlabs/chain-protocol review this as well please?

@storopoli storopoli added this pull request to the merge queue Oct 13, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 13, 2025
@prajwolrg prajwolrg added this pull request to the merge queue Oct 13, 2025
Merged via the queue into main with commit 13a80a4 Oct 13, 2025
30 of 31 checks passed
@prajwolrg prajwolrg deleted the STR-1639-use-bitmap branch October 13, 2025 10:42
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.

5 participants