Added an extra data field to the Hyperdrive interface#608
Merged
jalextowle merged 16 commits intomainfrom Oct 19, 2023
Merged
Conversation
Hyperdrive Gas Benchmark
This comment was automatically generated by workflow using github-action-benchmark. |
Collaborator
jrhea
approved these changes
Oct 10, 2023
Contributor
jrhea
left a comment
There was a problem hiding this comment.
lgtm. you have a few FIXMEs to cleanup comments. is the plan to address them in this PR?
This commit moved the `destination`, `asUnderlying`, and `extraData` fields into a single struct called `IHyperdrive.Options`. Along with this change, `Hyperdrive` is now `IHyperdriveWrite` and `HyperdriveDataProvider` is now `IHyperdriveRead`, which ensures that future interface changes will result in compiler errors rather than issues at run-time.
d7aff24 to
37a162c
Compare
jrhea
approved these changes
Oct 19, 2023
Contributor
jrhea
left a comment
There was a problem hiding this comment.
looks good. just one question
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some yield sources may need additional data outside of the core Hyperdrive interface to function. Since we can't anticipate all of these requirements and don't want to clutter the interface with parameters that will only be used by specific yield sources, it makes sense to add a catch-all parameter that is just a string of bytes.
This ended up being a pretty straightforward change. It will have a large impact on the frontend and sims teams, but from a system perspective, it wasn't an invasive change. The one place that was slightly less trivial was the bond wrapper which makes repeated calls to Hyperdrive.
sweepAndRedeemtakes an array ofbytesto sidestep any issues caused by trying to re-use the same extra data over and over.