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

enable backwards compat feature: only contracts after migration are charged for ice creation NTRN-135 #334

Merged
merged 11 commits into from Nov 3, 2023

Conversation

quasisamurai
Copy link
Contributor

@quasisamurai quasisamurai commented Oct 24, 2023

TASK

We need changes in ICTX module related to register_fee backwards compatible.

In the upgrade handler of Neutron v1.1.0 we must take the last uploaded code_id of wasm contracts and save it to the storage.

We make register_fee field optional.

When a contract calls RegisterInterchainAccount method, Neutron compares code_id of the calling contract with the saved one:

If it’s less or equal to the saved one - we allow contract to not pay fees for the ICA registration;

if code_id is greater - register_fee is required.

  • register_fee is optional field in Neutron CW SDK and in the RegisterInterchainAccount message;

  • last code_id is saved into the storage in the upgrade handler for v1.1.0;

  • contracts with code_id less or equal then the saved one do not pay fees for ICA registration;

  • contract with code_id greater then the saved one pay fees for ICA registration;

  • documentation is updated;

  • tests are implemented;

@quasisamurai quasisamurai marked this pull request as ready for review October 25, 2023 07:16
x/interchaintxs/keeper/keeper.go Outdated Show resolved Hide resolved
app/upgrades/nextupgrade/upgrades.go Outdated Show resolved Hide resolved
app/upgrades/nextupgrade/upgrades_test.go Outdated Show resolved Hide resolved
x/interchaintxs/keeper/msg_server.go Outdated Show resolved Hide resolved
x/interchaintxs/types/keys.go Outdated Show resolved Hide resolved
x/contractmanager/types/expected_keepers.go Show resolved Hide resolved
x/interchaintxs/keeper/keeper.go Outdated Show resolved Hide resolved
x/interchaintxs/keeper/msg_server.go Outdated Show resolved Hide resolved
app/upgrades/nextupgrade/upgrades_test.go Outdated Show resolved Hide resolved
app/upgrades/nextupgrade/upgrades_test.go Outdated Show resolved Hide resolved
app/upgrades/nextupgrade/upgrades_test.go Show resolved Hide resolved
@quasisamurai
Copy link
Contributor Author

# Conflicts:
#	app/upgrades/nextupgrade/upgrades.go
@quasisamurai
Copy link
Contributor Author

@pr0n00gler pr0n00gler merged commit 5914596 into update-sdk47 Nov 3, 2023
5 of 6 checks passed
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.

None yet

3 participants