Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e9870c9
feat: add HTTP subscription support via polling
smartprogrammer93 Jan 29, 2026
4fea1ad
test: add integration tests for HTTP subscription feature
smartprogrammer93 Jan 29, 2026
8b29a12
test: improve test coverage and fix weak tests
smartprogrammer93 Jan 29, 2026
bb6fe13
Add RPC failover integration tests
smartprogrammer93 Jan 29, 2026
b6001af
fix: HTTP subscription config propagation and reconnect validation
smartprogrammer93 Jan 29, 2026
66cc162
refactor: use Alloy's watch_blocks() for HTTP polling
PoulavBhowmick03 Feb 2, 2026
e4d249d
fix tests, add buffer and implement is_empty method
PoulavBhowmick03 Feb 5, 2026
606840f
feat: add HTTP subscription support via polling
smartprogrammer93 Jan 29, 2026
c2da7b1
test: add integration tests for HTTP subscription feature
smartprogrammer93 Jan 29, 2026
4957dfe
test: improve test coverage and fix weak tests
smartprogrammer93 Jan 29, 2026
22aab71
Add RPC failover integration tests
smartprogrammer93 Jan 29, 2026
429666a
fix: HTTP subscription config propagation and reconnect validation
smartprogrammer93 Jan 29, 2026
e3d7833
refactor: use Alloy's watch_blocks() for HTTP polling
PoulavBhowmick03 Feb 2, 2026
d9e14e4
fix tests, add buffer and implement is_empty method
PoulavBhowmick03 Feb 5, 2026
06a94ff
fix: add http-subscription feature fields to test_provider helper
smartprogrammer93 Feb 5, 2026
36a967b
Merge origin/main into pr-32
smartprogrammer93 Feb 14, 2026
3ecdb0f
fix: address maintainer PR comments
smartprogrammer93 Feb 14, 2026
ec651ad
fix: address remaining maintainer comments
smartprogrammer93 Feb 14, 2026
d90dd00
fix: convert magic numbers to pub const values
smartprogrammer93 Feb 14, 2026
e8a5513
Merge remote-tracking branch 'upstream/main' into feat/http-subscription
PoulavBhowmick03 Feb 16, 2026
57f59e7
Merge remote-tracking branch 'smartprogrammer93/feat/http-subscriptio…
PoulavBhowmick03 Feb 16, 2026
3d66811
suggestions and use RobustProvider for block fetching
PoulavBhowmick03 Feb 16, 2026
7f25889
fmt
PoulavBhowmick03 Feb 16, 2026
f39546c
remove duplicate timeout and sync buffer sizes
PoulavBhowmick03 Feb 18, 2026
2872bb7
Merge remote-tracking branch 'upstream/main' into feat/http-subscription
PoulavBhowmick03 Feb 25, 2026
e628e21
fixes and suggestions
PoulavBhowmick03 Feb 26, 2026
47ab9c5
refactor
0xNeshi Feb 26, 2026
5eab3ee
add test_mixed_chain_skips_http_until_ws_is_found
0xNeshi Feb 27, 2026
c89615c
add test-log crate
0xNeshi Feb 27, 2026
4beb33d
add additional tests
0xNeshi Feb 27, 2026
34e3deb
Merge pull request #1 from 0xNeshi/feat/http-subscription
PoulavBhowmick03 Feb 27, 2026
abc1ef9
Apply suggestion from @0xNeshi
0xNeshi Mar 3, 2026
b9bbc55
refactor stream creation when building SubscriptionBackend::HttpPolling
0xNeshi Mar 4, 2026
6690229
explain the subscribe_blocks logic in a comment
0xNeshi Mar 4, 2026
14d3d2a
remove mentions of require_pubsub
0xNeshi Mar 4, 2026
6ce15ab
update doc wording in builder.rs
0xNeshi Mar 4, 2026
eeef439
update readme to mention http subscriptions
0xNeshi Mar 4, 2026
a6272cd
Merge pull request #2 from 0xNeshi/feat/http-subscription
PoulavBhowmick03 Mar 4, 2026
9d48ad7
Merge branch 'main' into feat/http-subscription
PoulavBhowmick03 Mar 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"rust-analyzer.rustfmt.extraArgs": ["+nightly"]
"rust-analyzer.rustfmt.extraArgs": ["+nightly"],
"rust-analyzer.cargo.features": ["http-subscription"]
}
209 changes: 209 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ serde_json = "1.0.149"
[dev-dependencies]
anyhow = "1.0"
alloy = { version = "1.1.2", features = ["node-bindings", "provider-ws"] }
test-log = { version = "0.2.18", features = ["trace"] }

[package.metadata.docs.rs]
all-features = true

[features]
tracing = ["dep:tracing"]
http-subscription = []

[profile.release]
lto = "thin"
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,26 @@ while let Some(result) = stream.next().await {
- When a fallback fails, the primary is tried first before moving to the next fallback.
- The `Lagged` error indicates the consumer is not keeping pace with incoming blocks.

#### HTTP-based subscriptions (feature flag)

By default, subscriptions use WebSocket/pubsub-capable providers. Normally, HTTP-only providers are skipped during subscription retries. If your environment only exposes HTTP endpoints, you can enable HTTP-based block subscriptions via polling using the `http-subscription` Cargo feature:

```toml
[dependencies]
robust-provider = { version = "1.0.0", features = ["http-subscription"] }
```

With this feature enabled and `allow_http_subscriptions(true)` is set, those HTTP providers can also act as subscription sources via polling, and are treated like regular pubsub-capable providers in the retry/failover logic:

```rust
let robust = RobustProviderBuilder::new(http_provider)
.allow_http_subscriptions(true)
// Optional: tune how often to poll for new blocks (defaults to ~12s)
.poll_interval(Duration::from_secs(12))
.build()
.await?;
```

---

## Provider Conversion
Expand Down
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,8 @@ pub use robust_provider::{
CoreError, DEFAULT_CALL_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_MIN_DELAY,
DEFAULT_RECONNECT_INTERVAL, DEFAULT_SUBSCRIPTION_BUFFER_CAPACITY, DEFAULT_SUBSCRIPTION_TIMEOUT,
Error, IntoRobustProvider, IntoRootProvider, RobustProvider, RobustProviderBuilder,
RobustSubscription, RobustSubscriptionStream, SubscriptionError,
RobustSubscription, RobustSubscriptionStream,
};

#[cfg(feature = "http-subscription")]
pub use robust_provider::DEFAULT_POLL_INTERVAL;
2 changes: 0 additions & 2 deletions src/macros/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ macro_rules! robust_rpc {
// Call the provider method with turbofish syntax if generics are present
provider.$method $(::<$($generic),+>)? ($($($arg),+)?).await
},
false, // is_subscription = false
)
.await;

Expand Down Expand Up @@ -203,7 +202,6 @@ macro_rules! robust_rpc {
provider.$method $(::<$($generic),+>)? ($($arg),+).await
}
},
false, // is_subscription = false
)
.await;

Expand Down
Loading