-
Notifications
You must be signed in to change notification settings - Fork 138
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: aa-core smart account provider fee options to handle more systematic fee options for userops #276
Conversation
cdd5bb8
to
dc77bad
Compare
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.
think it might be good to review provider/base.ts, provider/types.ts, and middleware/gas-manager.ts live as a team. left comments on everything else though.
8ee6b14
to
7c5dcf4
Compare
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.
some qs/nits
packages/core/src/utils/bigint.ts
Outdated
* @param args a list of bigints to get the max of | ||
* @returns the min bigint in the list | ||
*/ | ||
export const bigIntMin = (...args: bigint[]) => { |
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.
bump still don't see it used, you're welcome to keep it if you anticipate a use case.
f15e335
to
fcafec7
Compare
…matic fee options for userops
* feat: support updated overrides for alchemy request gas and paymaster and data * feat: rebase parent where account middle func def is updated
Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
fcafec7
to
9048fcb
Compare
Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
9048fcb
to
f06f1c5
Compare
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.
few leftover comments to address?
packages/core/src/provider/types.ts
Outdated
@@ -325,7 +329,8 @@ export interface ISmartAccountProvider< | |||
* Overrides the feeDataGetter middleware which is used for setting the fee fields on the UserOperation | |||
* prior to execution. | |||
* | |||
* @param override - a function for overriding the default feeDataGetter middleware | |||
* @param override - a function for overriding the default feeDataGetter middleware |
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.
bump?
@@ -325,7 +329,8 @@ export interface ISmartAccountProvider< | |||
* Overrides the feeDataGetter middleware which is used for setting the fee fields on the UserOperation | |||
* prior to execution. | |||
* | |||
* @param override - a function for overriding the default feeDataGetter middleware | |||
* @param override - a function for overriding the default feeDataGetter middleware | |||
* @param feeOptions - optional FeeDataFeeOptions to set at the global level of the provider. |
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.
bump?
Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
Co-authored-by: Michael Moldoveanu <michael.moldoveanu@alchemy.com>
bb83c95
to
4f5d49f
Compare
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.
LGTM but there's still one unaddressed comment from @avasisht23 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.
lgtm, one last comment to address + 1 request for follow-up :) nice work!
f108d0a
to
4f5d49f
Compare
…matic fee options for userops (#276) * feat: aa-core smart account provider fee options to handle more systematic fee options for userops * feat: remove fee options middleware and expose fee options to middleware functions * feat: aa-alchemy ergonomic support for handling gas estimation (#243) * feat: support updated overrides for alchemy request gas and paymaster and data * feat: rebase parent where account middle func def is updated * Update site/packages/aa-alchemy/middleware/withAlchemyGasManager.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update packages/core/src/utils/index.ts Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update packages/core/src/utils/index.ts Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update packages/core/src/provider/base.ts Co-authored-by: Michael Moldoveanu <michael.moldoveanu@alchemy.com> * fix: alchemy gas manager 0x check for user op overrides --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> Co-authored-by: Michael Moldoveanu <michael.moldoveanu@alchemy.com>
…matic fee options for userops (#276) * feat: aa-core smart account provider fee options to handle more systematic fee options for userops * feat: remove fee options middleware and expose fee options to middleware functions * feat: aa-alchemy ergonomic support for handling gas estimation (#243) * feat: support updated overrides for alchemy request gas and paymaster and data * feat: rebase parent where account middle func def is updated * Update site/packages/aa-alchemy/middleware/withAlchemyGasManager.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update packages/core/src/utils/index.ts Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update packages/core/src/utils/index.ts Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update packages/core/src/provider/base.ts Co-authored-by: Michael Moldoveanu <michael.moldoveanu@alchemy.com> * fix: alchemy gas manager 0x check for user op overrides --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> Co-authored-by: Michael Moldoveanu <michael.moldoveanu@alchemy.com>
…matic fee options for userops (#276) * feat: aa-core smart account provider fee options to handle more systematic fee options for userops * feat: remove fee options middleware and expose fee options to middleware functions * feat: aa-alchemy ergonomic support for handling gas estimation (#243) * feat: support updated overrides for alchemy request gas and paymaster and data * feat: rebase parent where account middle func def is updated * Update site/packages/aa-alchemy/middleware/withAlchemyGasManager.md Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update packages/core/src/utils/index.ts Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update packages/core/src/utils/index.ts Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> * Update packages/core/src/provider/base.ts Co-authored-by: Michael Moldoveanu <michael.moldoveanu@alchemy.com> * fix: alchemy gas manager 0x check for user op overrides --------- Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com> Co-authored-by: Michael Moldoveanu <michael.moldoveanu@alchemy.com>
per https://app.asana.com/0/1205598840815267/1205909484815093/f
this task is a ground work for supporting more advanced ways to enable/manage gas estimates during the user operation creation from the sdk.
This PR specifically defines and implements the smart account provider behavior when populating the gas fields of the user operation, enabling more stress-free and less error-prone experience for developers.
Tested with e2e tests that used to be more flaky, but fixed to be rather consistent on the PR #243
PR-Codex overview
This PR focuses on updating the gas estimation and fee options in the Alchemy codebase.
Detailed summary:
estimateGas
todelegateGasEstimation
inwithAlchemyGasManager.md
FeeOpts
type intype.ts
RequestGasAndPaymasterAndDataOverrides
type inindex.ts
ClientWithAlchemyMethods
type inclient.ts
logger.ts
index.ts
types/index.ts
AccountMiddlewareFn
and related types inprovider/types.ts
schema.ts
bigint.ts