Skip to content

Commit 9b5f5a8

Browse files
committed
Merge branch 'main' into start-typestate
2 parents 9d28c26 + df3fdee commit 9b5f5a8

File tree

7 files changed

+52
-50
lines changed

7 files changed

+52
-50
lines changed

.github/workflows/check.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ jobs:
3030

3131
steps:
3232
- name: Harden the runner (Audit all outbound calls)
33-
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
33+
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
3434
with:
3535
egress-policy: audit
3636

3737
- name: Fetch Repository
38-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
38+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
3939

4040
- name: Install stable toolchain
4141
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
@@ -49,12 +49,12 @@ jobs:
4949

5050
steps:
5151
- name: Harden the runner (Audit all outbound calls)
52-
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
52+
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
5353
with:
5454
egress-policy: audit
5555

5656
- name: Fetch Repository
57-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
57+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
5858

5959
- name: Install stable toolchain
6060
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
@@ -71,12 +71,12 @@ jobs:
7171

7272
steps:
7373
- name: Harden the runner (Audit all outbound calls)
74-
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
74+
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
7575
with:
7676
egress-policy: audit
7777

7878
- name: Fetch Repository
79-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
79+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
8080

8181
- name: Install stable toolchain
8282
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
@@ -92,12 +92,12 @@ jobs:
9292

9393
steps:
9494
- name: Harden the runner (Audit all outbound calls)
95-
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
95+
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
9696
with:
9797
egress-policy: audit
9898

9999
- name: Fetch Repository
100-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
100+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
101101

102102
- name: Install stable toolchain
103103
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
@@ -113,12 +113,12 @@ jobs:
113113

114114
steps:
115115
- name: Harden the runner (Audit all outbound calls)
116-
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
116+
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
117117
with:
118118
egress-policy: audit
119119

120120
- name: Fetch Repository
121-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
121+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
122122

123123
- name: Check spelling of files in the workspace
124124
uses: crate-ci/typos@2d0ce569feab1f8752f1dde43cc2f2aa53236e06 # v1.40.0

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- name: Harden the runner (Audit all outbound calls)
25-
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
25+
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
2626
with:
2727
egress-policy: audit
2828

29-
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
29+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
3030

3131
- name: Install rust
3232
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2

.github/workflows/scorecard.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ jobs:
3030
# actions: read
3131
steps:
3232
- name: Harden Runner
33-
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
33+
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
3434
with:
3535
egress-policy: audit
3636
- name: Checkout code
37-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v5.0.0
37+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5.0.0
3838
with:
3939
persist-credentials: false
4040
- name: Run analysis
@@ -52,6 +52,6 @@ jobs:
5252
path: results.sarif
5353
retention-days: 5
5454
- name: Upload SARIF to GitHub Code Scanning
55-
uses: github/codeql-action/upload-sarif@fe4161a26a8629af62121b670040955b330f9af2 # v3.29.5
55+
uses: github/codeql-action/upload-sarif@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v3.29.5
5656
with:
5757
sarif_file: results.sarif

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323

2424
steps:
2525
- name: Harden the runner (Audit all outbound calls)
26-
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
26+
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
2727
with:
2828
egress-policy: audit
2929

3030
- name: Fetch Repository
31-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
31+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
3232

3333
- name: Install stable toolchain
3434
uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1.15.2
@@ -45,7 +45,7 @@ jobs:
4545

4646
- name: Install cargo-nextest
4747
if: steps.cache-cargo-nextest.outputs.cache-hit != 'true'
48-
uses: taiki-e/install-action@3575e532701a5fc614b0c842e4119af4cc5fd16d # v2.62.60
48+
uses: taiki-e/install-action@50708e9ba8d7b6587a2cb575ddaa9a62e927bc06 # v2.62.63
4949
with:
5050
tool: cargo-nextest
5151

src/event_scanner/scanner/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ pub enum ConsumerMode {
3535
///
3636
/// Log consumers are tightly coupled with the `ConsumerMode` because the mode dictates their
3737
/// entire lifecycle and behavior:
38-
/// - `Stream` mode: consumers forward logs immediately as they arrive
39-
/// - `CollectLatest` mode: consumers accumulate logs and send them only at the end
38+
/// * `Stream` mode: consumers forward logs immediately as they arrive
39+
/// * `CollectLatest` mode: consumers accumulate logs and send them only at the end
4040
///
4141
/// This tight coupling means consumers cannot be reused across different modes. For example,
4242
/// the "sync from latest" scanning strategy needs to run two modes sequentially (first

src/event_scanner/scanner/mod.rs

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,14 @@ impl EventScannerBuilder<Unspecified> {
130130
///
131131
/// # Key behaviors
132132
///
133-
/// - **Continuous streaming**: Events are delivered in multiple messages as they are fetched
134-
/// - **Chronological order**: Events are always delivered oldest to newest
135-
/// - **Default range**: By default, scans from `Earliest` to `Latest` block
136-
/// - **Batch control**: Use `.max_block_range(n)` to control how many blocks are queried per
133+
/// * **Continuous streaming**: Events are delivered in multiple messages as they are fetched
134+
/// * **Chronological order**: Events are always delivered oldest to newest
135+
/// * **Default range**: By default, scans from `Earliest` to `Latest` block
136+
/// * **Batch control**: Use `.max_block_range(n)` to control how many blocks are queried per
137137
/// RPC call
138-
/// - **Completion**: The scanner completes when the entire range has been processed
138+
/// * **Reorg handling**: Performs reorg checks when streaming events from non-finalized blocks;
139+
/// if a reorg is detected, streams events from the reorged blocks
140+
/// * **Completion**: The scanner completes when the entire range has been processed.
139141
#[must_use]
140142
pub fn historic() -> EventScannerBuilder<Historic> {
141143
EventScannerBuilder::default()
@@ -190,11 +192,11 @@ impl EventScannerBuilder<Unspecified> {
190192
///
191193
/// # Key behaviors
192194
///
193-
/// - **Real-time streaming**: Events are delivered as new blocks are confirmed
194-
/// - **Reorg protection**: Waits for configured confirmations before emitting events
195-
/// - **Continuous operation**: Runs indefinitely until the scanner is dropped or encounters an
195+
/// * **Real-time streaming**: Events are delivered as new blocks are confirmed
196+
/// * **Reorg protection**: Waits for configured confirmations before emitting events
197+
/// * **Continuous operation**: Runs indefinitely until the scanner is dropped or encounters an
196198
/// error
197-
/// - **Default confirmations**: By default, waits for 12 block confirmations
199+
/// * **Default confirmations**: By default, waits for 12 block confirmations
198200
///
199201
/// # Reorg behavior
200202
///
@@ -222,8 +224,8 @@ impl EventScannerBuilder<Unspecified> {
222224
/// EventScannerBuilder::sync().from_latest(10);
223225
/// ```
224226
///
225-
/// See [`from_block`](EventScannerBuilder::from_block) and
226-
/// [`from_latest`](EventScannerBuilder::from_latest) for details on each mode.
227+
/// See [`from_block`](crate::EventScannerBuilder#method.from_block-2) and
228+
/// [`from_latest`](crate::EventScannerBuilder#method.from_latest) for details on each mode.
227229
#[must_use]
228230
pub fn sync() -> EventScannerBuilder<Synchronize> {
229231
EventScannerBuilder::default()
@@ -290,20 +292,20 @@ impl EventScannerBuilder<Unspecified> {
290292
///
291293
/// # Key behaviors
292294
///
293-
/// - **Single delivery**: Each registered stream receives at most `count` logs in a single
295+
/// * **Single delivery**: Each registered stream receives at most `count` logs in a single
294296
/// message, chronologically ordered
295-
/// - **One-shot operation**: The scanner completes after delivering messages; it does not
297+
/// * **One-shot operation**: The scanner completes after delivering messages; it does not
296298
/// continue streaming
297-
/// - **Flexible count**: If fewer than `count` events exist in the range, returns all available
299+
/// * **Flexible count**: If fewer than `count` events exist in the range, returns all available
298300
/// events
299-
/// - **Default range**: By default, scans from `Earliest` to `Latest` block
300-
/// - **Reorg handling**: Periodically checks the tip to detect reorgs during the scan
301+
/// * **Default range**: By default, scans from `Earliest` to `Latest` block
302+
/// * **Reorg handling**: Periodically checks the tip to detect reorgs during the scan
301303
///
302304
/// # Notifications
303305
///
304306
/// The scanner emits the following notification before delivering log data:
305307
///
306-
/// - **[`Notification::NoPastLogsFound`][no_logs]**: Emitted when no matching logs are found in
308+
/// * **[`Notification::NoPastLogsFound`][no_logs]**: Emitted when no matching logs are found in
307309
/// the scanned range.
308310
///
309311
/// # Arguments
@@ -392,10 +394,10 @@ impl<M> EventScannerBuilder<M> {
392394
/// # Example
393395
///
394396
/// If scanning events from blocks 1000–1099 (100 blocks total) with `max_block_range(30)`:
395-
/// - Batch 1: blocks 1000–1029 (30 blocks)
396-
/// - Batch 2: blocks 1030–1059 (30 blocks)
397-
/// - Batch 3: blocks 1060–1089 (30 blocks)
398-
/// - Batch 4: blocks 1090–1099 (10 blocks)
397+
/// * Batch 1: blocks 1000–1029 (30 blocks)
398+
/// * Batch 2: blocks 1030–1059 (30 blocks)
399+
/// * Batch 3: blocks 1060–1089 (30 blocks)
400+
/// * Batch 4: blocks 1090–1099 (10 blocks)
399401
#[must_use]
400402
pub fn max_block_range(mut self, max_block_range: u64) -> Self {
401403
self.block_range_scanner.max_block_range = max_block_range;

src/event_scanner/scanner/sync/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,20 @@ impl EventScannerBuilder<Synchronize> {
7272
///
7373
/// # Key behaviors
7474
///
75-
/// - **No duplicates**: Events are not delivered twice across the phase transition
76-
/// - **Flexible count**: If fewer than `count` events exist, returns all available events
77-
/// - **Reorg handling**: Both phases handle reorgs appropriately:
75+
/// * **No duplicates**: Events are not delivered twice across the phase transition
76+
/// * **Flexible count**: If fewer than `count` events exist, returns all available events
77+
/// * **Reorg handling**: Both phases handle reorgs appropriately:
7878
/// - Latest events phase: resets and rescans on reorg detection
7979
/// - Live phase: resets stream to the first post-reorg block that satisfies the configured
8080
/// block confirmations
81-
/// - **Continuous operation**: Live phase continues indefinitely until the scanner is dropped
81+
/// * **Continuous operation**: Live phase continues indefinitely until the scanner is dropped
8282
///
8383
/// # Notifications
8484
///
8585
/// During the **latest events phase**, the scanner can emit the following notification
8686
/// before transitioning to live mode:
8787
///
88-
/// - **[`Notification::NoPastLogsFound`][no_logs]**: Emitted when no matching logs are found in
88+
/// * **[`Notification::NoPastLogsFound`][no_logs]**: Emitted when no matching logs are found in
8989
/// the scanned range
9090
///
9191
/// After the latest events phase completes, [`Notification::SwitchingToLive`][switch_to_live]
@@ -98,15 +98,15 @@ impl EventScannerBuilder<Synchronize> {
9898
///
9999
/// # Important notes
100100
///
101-
/// - The live phase continues indefinitely until the scanner is dropped or encounters an error
101+
/// * The live phase continues indefinitely until the scanner is dropped or encounters an error
102102
///
103103
/// # Detailed reorg behavior
104104
///
105-
/// - **Latest events phase**: Restart the scanner. On detecting a reorg, emits
105+
/// * **Latest events phase**: Restart the scanner. On detecting a reorg, emits
106106
/// [`Notification::ReorgDetected`][reorg], resets the rewind start to the new tip, and
107107
/// continues until collectors accumulate `count` logs. Final delivery to listeners preserves
108108
/// chronological order.
109-
/// - **Live streaming phase**: Starts from `latest_block + 1` and respects the configured block
109+
/// * **Live streaming phase**: Starts from `latest_block + 1` and respects the configured block
110110
/// confirmations. On reorg, emits [`Notification::ReorgDetected`][reorg], adjusts the next
111111
/// confirmed window (possibly re-emitting confirmed portions), and continues streaming.
112112
///
@@ -205,7 +205,7 @@ impl EventScannerBuilder<Synchronize> {
205205
/// * **Continuous operation**: Live phase continues indefinitely until the scanner is dropped
206206
/// * **Reorg detection**: When a reorg is detected, [`Notification::ReorgDetected`][reorg] is
207207
/// emitted, the next confirmed window is adjusted to stream the reorged blocks, and continues
208-
/// streaming.
208+
/// streaming. While syncing, reorg checks are only performed for non-finalized blocks.
209209
///
210210
/// # Arguments
211211
///

0 commit comments

Comments
 (0)