Skip to content

Increase parallelism#27

Merged
dwerner merged 5 commits intomainfrom
parallelism
Nov 11, 2025
Merged

Increase parallelism#27
dwerner merged 5 commits intomainfrom
parallelism

Conversation

@dwerner
Copy link
Collaborator

@dwerner dwerner commented Nov 11, 2025

Start syncing logs at the beginning, don't wait. Full sync takes ~8 hours on my hardware. Tested with a cold erigon.

- Rename config field for clarity (better describes what it does)
- Change default from 1 to 16 segments
- Rationale: Bridge already limits concurrent Erigon requests via buffering
- Streaming architecture means data flows through without accumulation
- 16 concurrent segments provides good parallelism while preventing
  the 48-segment explosion that caused memory/stream issues

The semaphore limits how many segments can process logs concurrently,
but the bridge's max_concurrent_executions prevents too much in-flight
work at the Erigon level. This allows better throughput without risking
resource exhaustion.
- Use renamed config field when creating logs semaphore
- Update comment to reflect "limiting" rather than "sequencing"
- Log message shows semaphore capacity for observability
Semaphore changes:
- Format semaphore acquire chain for readability
- Permit is held for entire log sync operation per segment

Clippy/dead_code fixes:
- Rename bytes_written to _bytes_written (unused but kept for future use)
- Add #[allow(dead_code)] to ProgressUpdate struct (legacy tracking code)
- Add #[allow(dead_code)] to update_stage and update_progress methods
  (may be used in future for enhanced progress tracking)
Apply rustfmt formatting to multi-line field call.
@dwerner
Copy link
Collaborator Author

dwerner commented Nov 11, 2025

Ethereum mainnet data sync (from customized erigon)

Before changeset:

Screenshot_20251110_073705

After changeset:

Screenshot_20251111_081507

@dwerner dwerner merged commit 0710d1f into main Nov 11, 2025
5 checks passed
@dwerner dwerner deleted the parallelism branch November 11, 2025 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant