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.
@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.
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.
refcell
left a comment
There was a problem hiding this comment.
Generally looks good - just have a preference to keep serde as a feature flag with mutual exclusion.
* merge generic oracle changes to the current head * rm patch file * fix preimage cargo toml * cargo update * add serde feature back to preimage crate * linted, all features lint fails due to mutual exclusion * rm mutual exclusion
* merge generic oracle changes to the current head * rm patch file * fix preimage cargo toml * cargo update * add serde feature back to preimage crate * linted, all features lint fails due to mutual exclusion * rm 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-clientdirectly rather than forking and modifying it.Changes:
CommsClienttrait encompassesPreimageOracleClient + Clone + HintWriterClient. Therefore anything that implements this trait (which will be the Oracles) can both fetch and hint data.CachingOracleto 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 theTrieDBHintWritertype.preimagecrate now has anrkyvflag 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