-
Notifications
You must be signed in to change notification settings - Fork 54
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
improve(LineaFinalizer): Force RPC calls through custom provider #1931
Conversation
The functions that we use in the Linea SDK make event queries from block 0 to "latest" by default which means that some of our RPC's can't be used with the Finalizer. Additionally, we're missing out our custom provider retry and caching logic. This PR removes all instances of making RPC calls via the Linea SDK's provider and replace with making the same call through our custom Provider. The latest [Linea SDK](https://github.com/Consensys/linea-monorepo/blob/3fbe660683a318b6fa1b63ec518f948791536352/sdk/src/sdk/LineaSDK.ts#L56) code looks like it'll support injecting custom providers but its not released yet on NPM. So this code should be removed eventually once a later SDK version is released.
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.
No showstoppers for me here. I do worry a bit about the long-term maintainability of this though. Feels like we need to upstream some of this feedback.
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.
This looks good to me. Have you been able to finalize a L2 -> L1 message?
I haven't been able to time it well. I think one way to do it is i can temporarily pause the production finalizer for linea and run this locally. |
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.
This makes sense but I think we should avoid accessing the Linea package in an unintended way. We've forked/patched packages before so that they play nicely with our imports - this could be a viable workaround.
Otherwise there's nothing that stands out - I'll approve pending my comments
Yes, now I have: https://etherscan.io/tx/0xdd512394eb0aed5b44ae4c9ed6619937555d8d67d7f8795e4c82f060cdbcce94 |
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.
Does this finalize the messages that are throwing errors? I've left a few nits as code makes sense.
As a general thought I think we should co-locate all of the code that will be removed when Linea releases 1.0.
I think the issue here is that the entire linea/ folder will change, the code is very different |
The functions that we use in the Linea SDK make event queries from block 0 to "latest" by default which means that some of our RPC's can't be used with the Finalizer. Additionally, we're missing out our custom provider retry and caching logic.
This PR removes all instances of making RPC calls via the Linea SDK's provider and replace with making the same call through our custom Provider.
The latest Linea SDK code looks like it'll support injecting custom providers but its not released yet on NPM. So this code should be removed eventually once a later SDK version is released.
This PR also fixes a bug where the existing SDK's interface doesn't match what's on chain: 12e872e