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

Ics20 contract rollback #633

Merged
merged 5 commits into from
Jan 27, 2022
Merged

Ics20 contract rollback #633

merged 5 commits into from
Jan 27, 2022

Conversation

ethanfrey
Copy link
Member

@ethanfrey ethanfrey commented Jan 17, 2022

Builds on #631 but ensures that the balance tracked in the main contract is proper even if the transfer submessage (to the cw20 contract) fails, eg hits gas limit or other issue.

I am still struggling a bit with this atomic rollback in the contract. The official wasmd 0.44/0.45 upgrade CosmWasm/wasmd#717 handles this properly using ibcv2 and ensuring that not catching the error properly rolls back all state and returning an application-level error. But not sure how Juno is handling that currently

Went back to optimistic write to local state on ibc_packet_receive and then catch the reply_errors on that one and revert the tally of how much balance can be returned

@ethanfrey ethanfrey force-pushed the ics20-contract-rollback branch from 2448a03 to 315be1a Compare January 27, 2022 19:36
@ethanfrey ethanfrey marked this pull request as ready for review January 27, 2022 19:36
@ethanfrey ethanfrey force-pushed the ics20-contract-rollback branch from 68d3c10 to a0ca1dc Compare January 27, 2022 19:43
@ethanfrey ethanfrey merged commit 7523406 into main Jan 27, 2022
@ethanfrey ethanfrey deleted the ics20-contract-rollback branch January 27, 2022 19:50
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.

1 participant