-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Scroll integration #42
Conversation
Add indentation Co-authored-by: Nick Johnson <[email protected]>
Co-authored-by: Nick Johnson <[email protected]>
* move propsDecoder * Add Request as type * Update workers-types * Fix lint error
ScrollVerifier Gas estimate 2418085 ✔ simple proofs for fixed values (2652ms) Gas estimate 2419066 ✔ simple proofs for dynamic values (1641ms) Gas estimate 2282506 ✔ nested proofs for dynamic values (1800ms) Gas estimate 4773362 ✔ nested proofs for long dynamic values (1960ms) Gas estimate 3607123 ✔ nested proofs with lookbehind (2488ms) Gas estimate 3527831 ✔ nested proofs with lookbehind for dynamic values (1810ms) Gas estimate 2353134 ✔ mappings with variable-length keys (1721ms) Gas estimate 3608890 ✔ nested proofs of mappings with variable-length keys (2086ms) Gas estimate 2223797 ✔ treats uninitialized storage elements as zeroes (1534ms) Gas estimate 2228241 ✔ treats uninitialized dynamic values as empty strings (1800ms)
* @dev Returns an object representing a block whose state can be proven on L1. | ||
*/ | ||
public async getProvableBlock(): Promise<ScrollProvableBlock> { | ||
const block = await this.l2Provider.send("eth_getBlockByNumber", ["finalized", false]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't finalized
be true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it means finalized
to be false
According to the doc (https://www.ankr.com/docs/rpc-service/chains/chains-api/scroll/#eth_getblockbynumber) ,
<boolean>: if true it returns the full transaction objects,
if false — only the hashes of the transactions.
both L1ProofService and OPProofService set the second value as false
as well FYI
Co-authored-by: Nick Johnson <[email protected]>
Co-authored-by: Nick Johnson <[email protected]>
List of changes
StateProof
interface fromstateTrieWitness: string[];, storageProofs: string[][];
tostateTrieWitness: string;, storageProofs: string[];
getStorageValues
to take a proof verification function which isn't dependent on SecureMerkleTriegetStorageRoot
fromEVMHelper.sol
toMerkleTrieProofHelper.sol
Gas comparison
Arbitrum
Scroll
Things to improve
ScrollProofService
is currently fetching thebatch_index
via centralised API server. Should replace it with l1 smart contract call once Scroll team provides the functionality.verifier.verifyZkTrieProof
currently verifies account proof every time it tries to verify storage proof which is unnecessary. We are currently requesting Scroll team to provide function that can only verify account proof or storage proof, not both at the same time.