Expand description
Persistence waiting utilities for benchmarks.
Provides waiting behavior to control benchmark pacing:
- Fixed duration waits: Sleep for a fixed time between blocks
- Persistence-based waits: Wait for blocks to be persisted using
reth_subscribePersistedBlocksubscription - Combined mode: Wait at least the fixed duration, and also wait for persistence if the block hasnโt been persisted yet (whichever takes longer)
Structsยง
- Persistence
Subscription ๐ - Wrapper that keeps both the subscription stream and the underlying provider alive. The provider must be kept alive for the subscription to continue receiving events.
- Persistence
Waiter ๐ - Encapsulates the block waiting logic.
Constantsยง
- DEFAULT_
WS_ ๐RPC_ PORT - Default
WebSocketRPC port for reth.
Functionsยง
- derive_
ws_ ๐rpc_ url - Returns the websocket RPC URL used for the persistence subscription.
- engine_
url_ ๐to_ ws_ url - Converts an engine API URL to the default RPC websocket URL.
- setup_
persistence_ ๐subscription - Establishes a websocket connection and subscribes to
reth_subscribePersistedBlock. - wait_
for_ ๐persistence - Waits until the persistence subscription reports that
targethas been persisted.