forked from ensdomains/evmgateway
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
throw error cleanup, add more guards
- Loading branch information
Showing
17 changed files
with
141 additions
and
88 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@unruggable/evmgateway", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"keywords": [ | ||
"ethereum", | ||
"evm", | ||
|
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
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 { OPRollup } from "../../src/op/OPRollup.js"; | ||
import { createProviderPair } from "../providers.js"; | ||
|
||
const config = OPRollup.baseMainnetConfig; | ||
const rollup = new OPRollup(createProviderPair(config), config); | ||
|
||
const commit = await logTime('fetchLatestCommit', rollup.fetchLatestCommit()); | ||
await logTime('fetchParentCommit', rollup.fetchParentCommit(commit)); | ||
|
||
await logTime('prove(cold)', commit.prover.prove([[config.L2OutputOracle, true]])); | ||
|
||
commit.prover.proofLRU.clear(); | ||
|
||
await logTime('getStorage(cold)', commit.prover.getStorage(config.L2OutputOracle, 0n)); | ||
await logTime('getProofs(warm)', commit.prover.getProofs(config.L2OutputOracle, [1n])); | ||
await logTime('getStorage(hot)', commit.prover.getStorage(config.L2OutputOracle, 0n)); | ||
|
||
await logTime('prove(hot)', commit.prover.prove([ | ||
[config.L2OutputOracle, true], | ||
[config.L2OutputOracle, 1n] | ||
])); | ||
|
||
async function logTime<T>(label: string, promise: Promise<T>): Promise<T> { | ||
const t = performance.now(); | ||
const ret = await promise; | ||
console.log((performance.now() - t).toFixed().padStart(5), label); | ||
return ret; | ||
} |
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.