-
Notifications
You must be signed in to change notification settings - Fork 577
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
[Smart Account] Pass fee to authenticator #7998
Merged
iboss-ptk
merged 3 commits into
feat/smart-accounts
from
boss/pass-deducted-fee-to-authenticator
Apr 9, 2024
Merged
[Smart Account] Pass fee to authenticator #7998
iboss-ptk
merged 3 commits into
feat/smart-accounts
from
boss/pass-deducted-fee-to-authenticator
Apr 9, 2024
Conversation
This file contains 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
nicolaslara
approved these changes
Apr 9, 2024
nicolaslara
added a commit
that referenced
this pull request
Apr 18, 2024
…ccount abstraction (#7005) * feat(smart-accounts): initial scaffolding for authenticator module * made protos * Generated protofile changes * chore: remove outdated tests * chore: remove references to scaffold tool * [AccAbs] Initial types (#6096) * authenticator types * changes from review * feat(ante): removing sigverify ante in favor of authenticator ante (#6100) * feat(secp256k1 auth): implementing secpk256k1 authenticator (#6119) * feat(secp256k1 auth): implementing secpk256k1 authenticator * chore: updating comments to be more concise * fix: move simulate to SigVerificationData struct * [AccAbs] Top-level messages and storage (#6098) * authenticator types * added initial message scaffold * experimemnt with collections * implementation without collections * added messages and keepers, improving interfaces * skip tests until wired up * updated tests * cleaner ante handler * [Account Abstraction ] Feat/authenticator module wire (#6138) * feat(authenticator): wire authenticator module into node * fix: use already initialized subspace in keeper test * Generated protofile changes * reset go.mod to main version * [AccountAbstraction] Authenticator handler (#6298) * initial authenticator setup * remove unnecessary params * note about ibc test failures * reset go.work * getting the signature data for a single msg * experimenting with tests using ibctesting * fix: update integration tests to remove init app * proper key rotation test * table tests * more tests * keep registered authenticators in the app * lints * updated tests * fix default case * fixed keeper test * propperly fix keeper tests --------- Co-authored-by: PaddyMc <[email protected]> * Paddy/auth tx and queries (#6324) * initial authenticator setup * remove unnecessary params * note about ibc test failures * reset go.work * getting the signature data for a single msg * experimenting with tests using ibctesting * fix: update integration tests to remove init app * proper key rotation test * table tests * more tests * keep registered authenticators in the app * lints * updated tests * fix default case * fixed keeper test * propperly fix keeper tests * feat(cli): adding query and tx command for authenticators * feat(cli): parse message correctly by decoding base64 string * feat(auth msg): validate bytes in message * chore: fix linting error in query --------- Co-authored-by: Nicolas Lara <[email protected]> * [AccountAbstraction] Authenticator state (#6332) * added experimental test to for dealing with stateful authenticators * added post habdler * testing both success and failures * cleanup * added moved file * fumpt * remove unised key * mockctx * remove unused func * removed test consume gas * remove comment decided against * feat(authenticator): move authenticators to their own package (#6364) * feat(authenticator): move authenticators to their own package * feat(authenticator): rename struct instance name * Proper handling of multi-msg (#6374) * proper handling of multi-msgs and notifying of failed txs * renamed interface file * lints * refactor GetSignersAndSignatures * fix lint * [AccountAbstraction] FeePayer handling (#6378) * added feepayer handling * lint * feat(authenticator): improved test cases for authenticator (#6383) * feat(authenticator): improved test cases for authenticator * feat(authenticator): added table based tests to signature verification * chore(comment): x/authenticator/authenticator/interface.go Co-authored-by: Nicolas Lara <[email protected]> * chore: update x/authenticator/authenticator/interface.go comments Co-authored-by: Nicolas Lara <[email protected]> * chore: update x/authenticator/authenticator/interface.go comment Co-authored-by: Nicolas Lara <[email protected]> * fix: change uint to int on testing authenticatior as we need to use negative numbers * Update x/authenticator/authenticator/interface.go setting msgIndex back to uint8 * fix: change uint to int on authenticator interface --------- Co-authored-by: Nicolas Lara <[email protected]> * Update modules.go * [Account Abstraction] Complex authenticators (#6415) * added any_of authenticator * allOf and composition * restore stateful_authenticator * integration test (tmp) * added initial spend limit * feat: test multisig transaction (#6438) * feat: test multisig transaction * Update x/authenticator/authenticator/interface.go * chore: fix linting errors --------- Co-authored-by: Nicolas Lara <[email protected]> * [Account Abstraction] Interface improvements (#6452) * added any_of authenticator * allOf and composition * restore stateful_authenticator * integration test (tmp) * added initial spend limit * initial interface changes * pass account into call and rever all authenticator's context if the tx is not authenticated * fix gas meter and return * comment cleanup * fix bad merge * transient ctx * lints and missing refactor * Proper calling order * feat: improve msg server, test aute handler (#6486) * feat: improve msg server. test aute handler * fix: small updates to msg_server.go, improved comments * Generated protofile changes * Update x/authenticator/authenticator/interface.go Co-authored-by: Nicolas Lara <[email protected]> * Update x/authenticator/keeper/msg_server.go Co-authored-by: Nicolas Lara <[email protected]> * Update x/authenticator/ante/authenticator_test.go Co-authored-by: Nicolas Lara <[email protected]> * chore: move type definition from interface to concrete impl --------- Co-authored-by: github-actions <[email protected]> Co-authored-by: Nicolas Lara <[email protected]> * [AccountAbstraction] selecting the authenticator with tx info (#6498) * initial implementation of selecting the authenticator with tx info * better tests * fix: transient store for auto increment (#6502) * [Account Abstraction] spend limit improvements (#6503) * period refactor * improve periods and add tests * no negs * fix after merge * initial implementation of price strategy. Deferred so we can do this correctly * lint * [AccountAbstraction] Making authz aware of authenticators (#6515) * authz wrapping to deail with authentication * proper authz support * lints and missing interfaces * added initial readme * [AccountAbstraction] validation (#6518) * renames * added validation * added on authenticator removed * added validation tests * feat: passkey authenticator (#6532) * feat: passkey authenticator * feat: panic on chain start if cannot gen key struct * Feat/update signature tests (#6533) * feat: passkey authenticator * feat: panic on chain start if cannot gen key struct * fix: incorrect signature and signer parsing check * Register authenticators (#6534) * registering the authenticators * added passkey authenticator * [AccountAbstraction] use int instead of int8 as msgIndex (#6542) * use int instead of int8 * style * lint * Authz authenticator tracking fix (#6543) * use int instead of int8 * style * fix authz not properly updating tracks * lint * lint * fix: remove bad validation (#6553) * [AccountAbstraction] Validating AnyOf and AllOf (#6568) * validating anyof and allof * only use the first authenticator of type. * simple remediation of custom fee payer skipping authenticatation (#6567) * validating that there is only one signer per message (#6569) * chore: return error from twap (#6722) * [Account Abstraction] Message filter authenticator (#6721) * added initial message filter authenticator * remove unnecessary codec * improving comparison * moved json comparison to our own code * Update x/authenticator/authenticator/message_filter.go Co-authored-by: PaddyMc <[email protected]> * more tests and a fix * lint --------- Co-authored-by: PaddyMc <[email protected]> * chore: handle negative selected authenticators (#6729) * Generated protofile changes * fix: remove executedAuths in favor of using the Track function (#6787) * fix: add use executedAuths slice in composition authenticators * executing Confirm * confirmation * feat: update anyOf to confirm if one authenticator allows --------- Co-authored-by: Nicolas Lara <[email protected]> * fix: ensure pubkey ante handler works as expected (#6768) * fix: esure pubkey ante handler works as expected * chore: add comments and fix lint * chore: add comment explaining updated ante implementation * feat: add remove-authenticator command to cli (#6761) * feat: add remove-authenticator command to cli * Generated protofile changes --------- Co-authored-by: github-actions <[email protected]> * feat: add MaximumUnauthenticatedGas param (#6807) * feat: add MaximumUnauthenticatedGas param * Generated protofile changes --------- Co-authored-by: github-actions <[email protected]> * chore: fix compliation issue missing var (#6830) * chore: fix compliation issue missing var * chore: fix linting issue * chore: check all authenticators for anyOf in ConfirmExecution (#6838) * feat(genesis): add genesis import and export of authenticators * Generated protofile changes * chore: use errormod instead of deprecated sdkerrors * using the new type * chore: fix errors in tests * chore: fix errors in integration tests * fix: e2e tests for smart accounts (#7046) * adding upgrade * fix: adding back to v21 for sake of tests passing * [Smart Accounts] Cosmwasm Authenticator (#7004) * initiall cw authenticator work * more complete cosmwasm authenticator but with a terrible api * initial tests and better interface. Need to properly serialize txs and signatures * initial explicit data * better serialization of auth message * msg received by the contract. Need to streamline more * added working authenticator contract * attempt at validating signatures (failing) * use the propper key type * remove wasmd replace * remove wasmd replace from go.work * make type definitions external * Added other entry points, updated interface, fixed and completed test * initial cosigner authenticator * using correct version of dep * added global cosigner infrastructure * trying to test the current cosigner impl * Generated protofile changes --------- Co-authored-by: github-actions <[email protected]> * better error * add cosmwasm authenticator doc (#7364) * add cosmwasm authenticator doc * Update x/authenticator/README.md Co-authored-by: Nicolas Lara <[email protected]> * fix duplicated * add set data part --------- Co-authored-by: Nicolas Lara <[email protected]> * Extend CosmWasm Authenticator (#7386) * fix on authenticated bug + improve data validation * add script to setup contract in case there is update * expose on authenticator added * expose on authenticator removed * add params to track request and fix error msg * reorder requests * add params to ConfirmExecutionRequest and spy on sudo calls * test confirmation request * delay registering contract keeper (#7421) * Skip ConfirmExecution if message is MsgAddAuthenticator (#7422) * delay registering contract keeper * skip confirm if msg add authenticator * Revert "skip confirm if msg add authenticator" This reverts commit a7f420a. * add is ready flag * track non ready authenticators and skip in post * make sure mark ready loop goes through unique entries * add test for mark authenticator as ready * usd errorsmod instead of sdkerrors for deprected Wrap * [Smart Accounts] Refactor (#7388) * initial refactor of authentication request extraction * Use authentication request in ante * message filter tests * fix stateful, but uncover sequence issues * allow empty json msg * fixing tests with better tx generation and replay prevention abstracted * fix composition tests * fix spending with proper accounts * remove unnecessary initializations * update iface * fix cosmwasm exec (update dep) * bring back feepayer and simplify function signature * move utils to util * moved todo to review q * added bytecode to get tests passing in ci * fix complex merge conflict * lints * cleanup feepayer test * fix remaining tests * added some todos and fixed readme * Paddy/fix/remove authz (#7502) * fix: remove authz from authenticator module * removed json field from msg in authentication request. This breaks message filter which needs to be updated to reconstruct the message * fix: comment out message filter tests --------- Co-authored-by: Nicolas Lara <[email protected]> * [Fix] CosmWasm Authenticator missing state (#7475) * Use real ctx on authenticator added hook * Sync cosmwasm authenticator contract's store * fix error unmarshaling * remove duplicated import * fix lint * Track and Confirm only should execute on used authenticators (#7504) * only execute track and confirm on used authenticators. Initial POC * fix signature * clean id handling * fixed test * chore: remove passkey authenticator (#7542) * chore: remove passkey authenticator * Add AuthenticatorId to entry points (#7547) * only exeute track and confirm on used authenticators. Initial POC * fix signature * clean id handling * initial adding of id * fixed test * lint * lint * added id to confirm and track * added authenticator_id to cw * releted passkey * added simple nested authenticator id. This can be improved by giving subauthenticators a global id and making them accesible, but that's a bigger lift and we can leave that for later * fix tests * fix cw test * chore: update message filter to use latest auth data (#7560) * chore: update message filter to use latest auth data * chore: revert isSuperset changes * Paddy/chore/remove util file (#7561) * chore: remove util.go * feat: add upgrade handler for authenticator module (#7569) * feat: add upgrade handler for authenticator module * Pass authenticator id to on add and remove hooks (#7581) * register tx extension impl * add authenticatorId to OnAuthenticatorAdded/Removed * Add authenticator id to on add / remove cosmwasm request * add recoursive validation (#7584) * feat: circuit breaker for smart accounts (#7571) * feat: circuit breaker for smart accounts * chore: rename chain ante decorator to improve readability * chore: set AreSmartAccountsActive in upgrade * [Smart Accounts] Pass msg index to requests (#7597) * add msg index to auth request * pass msg id to track * add msgIndex to track and cosmwasm req * Remove requirement over first authenticator (#7616) * remove require first authenticator to be sigver * lint * fix max feeless gas param * chore: remove sig verify authenticator required check (#7617) * [Smart Accounts] Simplify Authenticator Results (#7601) * add msg index to auth request * pass msg id to track * add msgIndex to track and cosmwasm req * remove authentication result * remove confirmation result * added a more passing error * fix bad syntax --------- Co-authored-by: Nicolas Lara <[email protected]> * [Experiment] Remove transient store (#7618) * removing transient store and is_ready * renamed file * lint * fix composite id not passing to on add/remove + refactor (#7629) * fix composite id not passing to on add/remove + refactor * add error log and make confirm behaves like authenticate * chore: refactor tx parsing flow with feePayer (#7624) * chore: refactor tx parsing flow with feePayer * chore: update signer parsing to match validate basic * feat: enforce selected authenticator when using smart-accounts (#7630) * feat: enforce selected authenticator when using smart-accounts * remove wasm store key from cosmwasm authenticator (#7634) * passing fee payer to auth req * add fee payer to request * add test to ensure feePayer is in authentication req * fix wrong sub auth id iteration * Add support for compound signatures (#7635) * added initial compound signatures * feat: adding test for failure of composite signatures for AllOf --------- Co-authored-by: PaddyMc <[email protected]> * chore(aa): remove cast during uint to string conversion (#7636) * chore: remove as authenticator function and utils folder (#7633) * chore: remove as authenticator function and utils folder * chore: remove iface folder and improving comments in iface.go * chore: remove iface/iface.go * chore: update comment to be more succinct * chore: fix spelling mistakes * [Smart Account] Composite authenticator sub auth calls & id tests (#7642) * id construction test * fix tests * update test to match calls * refactor test * fix test after refactor * fix test * [Smart Accounts] Emit authenticator id on add (#7656) * emit auth id on add * add test for event emission * typo * replace gen state serializing no next id as 0 with 1 --------- Co-authored-by: Nicolas Lara <[email protected]> * feat: get selected authenticator from store (#7644) * feat: enforce selecting specific authenticator * feat: change selected authenticator type to int64 * feat: add circuit breaker ante to ensure pubkey is never set (#7647) * feat: use IsCircuitBreakerActive function in post handler * feat: update selected authenticator tx extension to be a uint64 (#7648) * fix: remove useless code from pub key decorator * chore: adding tests to the post handler function (#7649) --------- Co-authored-by: Nicolas Lara <[email protected]> * Improving readme (#7673) * initial readme changes * more readme * Generated protofile changes --------- Co-authored-by: github-actions <[email protected]> * Enforce that the fee payer is the first signer of the first message (#7657) * added fee payer checks * lint * lint * fix * changes based on feedback and test fix * feat: add selected authenticator check to circuit breaker (#7683) * feat: add selected authenticator check to circuit breaker * chore: improve comments and reduce code with inlined statement * [Smart Account] Revert state of failed authenticator within anyOf (#7678) * revert anyof failure * add more cases * use cache ctx instead of loop reset * remove unused err guard * [Smart Accounts] Spend Limit Tests (#7703) * setup spend limit test * add spend limit test * add more cases * Signature verification no longer defaults to the accounts pubkey (#7721) * Signature verification no longer defaults to the accounts pubkey * spell check * Authenticators should never default. Only allow explicitly selected authenticators (#7722) * Signature verification no longer defaults to the accounts pubkey * Authenticators should never default. Only allow explicitly selected authenticators * spell check * lint * [Smart Account] Improve errors and add telemetry (#7749) * improve fee payer error * wrap GenerateAuthenticationData error with context instead of replacing * improve error for GetInitializedAuthenticatorForAccount * wrape authenticate error * log track error * improve GetSelectedAuthenticators error * fix tests * improve pubkey ante err * improve ante and post error * improve error in msgserver and keeper * remove spend_limit.go * improve cosmwasm authenticator error * improve composite authentcaitor error * improve init error * improve error for anyof * add telemetry * fix unguarded track error log * fix lint * rename generate authentication request * simplifying authenticator manager (#7787) * Simplify composite authenticators (#7786) * Inlining the code for composite authenticators. Less DRY, but more KISS * lint * uncomment tests that should not have been commented out * [Smart Accounts] Set authenticator active state (#7751) * create set active state msg * implement basic set activate state fn * update test * rename params * add cicuit breaker controllers params * authorize active state setter * remove gas check in ante test * Revert "remove gas check in ante test" This reverts commit 70b640b. * update measured gas for TestSpecificAuthenticator * rename authenticator_active_state back to is_smart_account_active * deduct fees after auth (#7849) * deduct fees after auth * leaving at the beginning for classic * WIP: Better docs (#7885) * added dinitial diagrams * better text * added manager and keeper * [Smart Account] Pass fee to authenticator (#7998) * pass fee grant & fee to authenticator request * passing auth request to track * fix failed cosmwasm test * Generated protofile changes * chore: rename authenticator module to smart-account (#8047) * chore: rename authenticator module to smart-account * chore: fix v24 upgrade test * lint --------- Co-authored-by: Nicolas Lara <[email protected]> * More restrictive Circuit Breaker Auth (#8049) * rename to smart account * renames again * lint * lint * updated pics * fix: genesis export and format uint * fix: calling all validates * fix: remove g * chore: comments and lint * fix: gas consumer test * chore: update CHANGELOG.md * typo --------- Co-authored-by: Nicolas Lara <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: Adam Tucker <[email protected]> Co-authored-by: Kingston <[email protected]> Co-authored-by: Supanat <[email protected]> Co-authored-by: Roman <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C:app-wiring
Changes to the app folder
C:CLI
C:docs
Improvements or additions to documentation
C:simulator
Edits simulator or simulations
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.
Closes: #7986
What is the purpose of the change
Pass fee and fee granter to authenticator, including CosmWasm authenticator.
Testing and Verifying
Covered by
cosmwasm_test.go
Documentation and Release Note
Unreleased
section ofCHANGELOG.md
?Where is the change documented?
x/{module}/README.md
)