Skip to content

Commit

Permalink
improve(relayer): Test lowered ethers pollingInterval (#1788)
Browse files Browse the repository at this point in the history
The current ethers polling interval is 4 seconds. In case of waiting on
transaction confirmation, this probably imposes unnecessary delays in
the fast relayer when it has many fills to make.

This is done for test purposes to see whether relayer fill times improve
as a result. Subject to the results, this should be upstreamed to the 
SDK and made configurable, such that the fast relayer can opt-in to a
lower pollingInterval, and that it can tune the interval per chain.
  • Loading branch information
pxrl authored Aug 28, 2024
1 parent c7c705f commit 9e7de09
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/utils/ProviderUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,19 @@ export class RetryProvider extends ethers.providers.StaticJsonRpcProvider {
...inputs
)
);

// This is added for interim testing to see whether relayer fill performance improves.
// @todo: Upstream this to the SDK where the relayer's implementation will be relocated.
this.providers.forEach((provider) => {
const url = getOriginFromURL(provider.connection.url);
const { pollingInterval } = provider;
provider.pollingInterval = 1000;
logger?.debug({
at: "RetryProvider",
message: `Dropped ${url} pollingInterval ${pollingInterval} -> ${provider.pollingInterval}.`,
});
});

if (this.nodeQuorumThreshold < 1 || !Number.isInteger(this.nodeQuorumThreshold)) {
throw new Error(
`nodeQuorum,Threshold cannot be < 1 and must be an integer. Currently set to ${this.nodeQuorumThreshold}`
Expand Down

0 comments on commit 9e7de09

Please sign in to comment.