forked from latticexyz/mud
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(network): increase network performance by reducing unnecessary r…
…pc calls (latticexyz#165) * feat: faster network [wip] * feat: no network check provider * feat: not wait for stuff you don't care about * chore: wip * chore: clean up * chore: self-review * test: add chainId to provider config * feat(network): add gasPriceInput$ to txQueue * fix(network): make sure initial gas price is an integer value Co-authored-by: ludens <ludens@lattice.xyz>
- Loading branch information
Showing
15 changed files
with
180 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { JsonRpcBatchProvider, JsonRpcProvider, Network, Networkish } from "@ethersproject/providers"; | ||
import { ConnectionInfo } from "ethers/lib/utils"; | ||
|
||
export class MUDJsonRpcProvider extends JsonRpcProvider { | ||
constructor(url: string | ConnectionInfo | undefined, network: Networkish) { | ||
super(url, network); | ||
} | ||
async detectNetwork(): Promise<Network> { | ||
const network = this.network; | ||
if (network == null) { | ||
throw new Error("No network"); | ||
} | ||
return network; | ||
} | ||
} | ||
|
||
export class MUDJsonRpcBatchProvider extends JsonRpcBatchProvider { | ||
constructor(url?: string | ConnectionInfo | undefined, network?: Networkish | undefined) { | ||
super(url, network); | ||
} | ||
async detectNetwork(): Promise<Network> { | ||
const network = this.network; | ||
if (network == null) { | ||
throw new Error("No network"); | ||
} | ||
return network; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.