Skip to content
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: remove x/authz dependency from precompiles #62

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

cloudgray
Copy link

Description

Removal of x/authz dependency on precompiles

  • Remove authzKeeper dependency from common Precompile struct
  • For staking and ics20 precompile
    • remove authorization methods (Approve, Revoke, IncreaseAllowance, DecreaseAllowance, Allowance) and its usage.
  • For erc20 precompile
    • Add Allowance state CRUD methods in x/erc20 module
    • Use added Allowance state of x/erc20 module instead of Grant state of x/authz module for authorization methods (Approve, Revoke, IncreaseAllowance, DecreaseAllowance, Allowance)

Closes: #47


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

Reviewers Checklist

All items are required.
Please add a note if the item is not applicable
and please add your handle next to the items reviewed
if you only reviewed selected items.

I have...

  • added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • confirmed all author checklist items have been addressed
  • confirmed that this PR does not change production code
  • reviewed content
  • tested instructions (if applicable)
  • confirmed all CI checks have passed

@cloudgray cloudgray changed the title feat: remove authz dependency from precompiles except for erc20 feat: remove authz dependency from precompiles Apr 9, 2025
@cloudgray cloudgray changed the title feat: remove authz dependency from precompiles feat: remove x/authz dependency from precompiles Apr 9, 2025
@@ -60,15 +60,14 @@ func NewAvailableStaticPrecompiles(
panic(fmt.Errorf("failed to instantiate bech32 precompile: %w", err))
}

stakingPrecompile, err := stakingprecompile.NewPrecompile(stakingKeeper, authzKeeper)
stakingPrecompile, err := stakingprecompile.NewPrecompile(stakingKeeper)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the arguments of NewAvailableStaticPrecompiles, it also seems possible to remove authzKeeper.

Additionally, I noticed that dependencies on Erc20Keeper, werc20 and erc20 precompiles (which are planned to be removed later as they will have their own state) still remain, so I’m leaving a note just in case it was overlooked.

FYI: temporary removed for IBC v2 test on this commit

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for feedback.

  1. In case of NewAvailableStaticPrecompiles, I missed it, I'll fix it.
  2. In case of erc20 and werc20, I intended that the task order that 1) add allowance state in x/erc20 module, 2) modify erc20 precompile, 3) modify werc20 precompile.
  3. And I will consider commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removal of x/authz dependency on precompiles
2 participants