-
Notifications
You must be signed in to change notification settings - Fork 53
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
feat(client): providers generic over oracles #336
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files☔ View full report in Codecov by Sentry. |
let precompile_overrides = FPVMPrecompileOverride::< | ||
OracleL2ChainProvider<CachingOracle>, | ||
OracleL2ChainProvider<CachingOracle>, | ||
>::default(); |
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.
@clabby I understand the logic for keeping a separate Fetcher and Hinter in the library crates, as we want to keep flexibility for future users to implement these separately.
But if we are going to have the L2 Provider fulfill both of these roles in kona-client
, do you think it makes sense to refactor FPVMPrecompileOverride
to just be generic over a single type that implements both traits?
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.
Since this simplifies the ux and isn't clear who will need the split logic, I support doing this refactor in a follow-on pr. The FPVM Precompile Override can always be made even more abstract by encapsulating it's internal logic in a trait, so not too worried about increasing the abstractions here.
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.
Generally looks good - just have a preference to keep serde
as a feature flag with mutual exclusion.
Description
This PR includes a range of changes that will make it easier for our
zkvm-client
(and likely future integrating teams) to work withkona-client
directly rather than forking and modifying it.Changes:
CommsClient
trait encompassesPreimageOracleClient + Clone + HintWriterClient
. Therefore anything that implements this trait (which will be the Oracles) can both fetch and hint data.CachingOracle
to include the hint writer, and therefore properly implementCommsClient
.self.oracle
(which implementsCommsClient
) and therefore never need to access the hint writer directly. This includesTrieDBHinter
, which is now implemented on L2Provider rather than requiring theTrieDBHintWriter
type.preimage
crate now has anrkyv
flag for serialization instead ofserde
. This is used for more efficient serialization that is better for us when passing data into the zkVM.Tests
N/A
Additional context
N/A
Metadata
N/A