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

Fix proposeAppVersion to always set false initially to AppVersion.consumed #56

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ This provides the ethereum chain module of [yui-relayer](https://github.com/hype

## Compatibility

This module is compatible with [ibc-solidity v0.3.23](https://github.com/hyperledger-labs/yui-ibc-solidity/releases/tag/v0.3.23).
This module is compatible with [ibc-solidity v0.3.39](https://github.com/hyperledger-labs/yui-ibc-solidity/releases/tag/v0.3.39).
10 changes: 7 additions & 3 deletions contracts/IBCContractUpgradableModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ abstract contract IBCContractUpgradableModuleBase is
/**
* @dev See {IIBCContractUpgradableModule-proposeAppVersion}
*/
function proposeAppVersion(string calldata version, AppInfo calldata appInfo_)
function proposeAppVersion(string calldata version, address implementation, bytes calldata initialCalldata)
external
override(IIBCContractUpgradableModule)
onlyContractUpgrader
{
if (appInfo_.implementation == address(0)) {
if (implementation == address(0)) {
revert IBCContractUpgradableModuleAppInfoProposedWithZeroImpl();
}

Expand All @@ -58,7 +58,11 @@ abstract contract IBCContractUpgradableModuleBase is
revert IBCContractUpgradableModuleAppInfoIsAlreadySet();
}

appInfos[version] = appInfo_;
appInfos[version] = AppInfo({
implementation: implementation,
initialCalldata: initialCalldata,
consumed: false
});
}

/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/IIBCContractUpgradableModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ interface IIBCContractUpgradableModule {
* To upgrade the IBC module contract along with a channel upgrade, the upgrader must
* call this function before calling `channelUpgradeInit` or `channelUpgradeTry` of the IBC handler.
*/
function proposeAppVersion(string calldata version, AppInfo calldata appInfo) external;
function proposeAppVersion(string calldata version, address implementation, bytes calldata initialCalldata) external;

}

7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"author": "Datachain, Inc.",
"license": "Apache-2.0",
"dependencies": {
"@hyperledger-labs/yui-ibc-solidity": "git+https://github.com/hyperledger-labs/yui-ibc-solidity.git#semver:v0.3.35",
"@hyperledger-labs/yui-ibc-solidity": "git+https://github.com/hyperledger-labs/yui-ibc-solidity.git#semver:v0.3.39",
"@openzeppelin/contracts-upgradeable": "^5.0.2"
}
}
273 changes: 272 additions & 1 deletion pkg/contract/ibchandler/ibchandler.go

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions pkg/relay/ethereum/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,8 @@ func (c *Chain) ProposeAppVersion(
tx, err := mockApp.ProposeAppVersion(
txOpts,
version,
iibccontractupgradablemodule.IIBCContractUpgradableModuleAppInfo{
Implementation: implementation,
InitialCalldata: initialCalldata,
},
implementation,
initialCalldata,
)

return processSendTxResult(ctx, logger, c, tx, err)
Expand Down
2 changes: 1 addition & 1 deletion yui-ibc-solidity
Submodule yui-ibc-solidity updated 57 files
+62 −54 .gas-snapshot
+6 −0 .github/workflows/test.yml
+3 −0 .gitmodules
+10 −5 Makefile
+0 −100 contracts/apps/20-transfer/ICS20Bank.sol
+140 −42 contracts/apps/20-transfer/ICS20Lib.sol
+318 −93 contracts/apps/20-transfer/ICS20Transfer.sol
+0 −99 contracts/apps/20-transfer/ICS20TransferBank.sol
+0 −58 contracts/apps/20-transfer/IICS20Bank.sol
+8 −10 contracts/apps/20-transfer/IICS20Errors.sol
+21 −6 contracts/apps/commons/IBCAppBase.sol
+4 −4 contracts/apps/mock/IBCMockApp.sol
+185 −0 contracts/apps/mock/IBCMockAppFactory.sol
+18 −16 contracts/core/02-client/IBCClientLib.sol
+11 −13 contracts/core/04-channel/IBCChannelHandshake.sol
+3 −2 contracts/core/04-channel/IBCChannelPacketSendRecv.sol
+8 −6 contracts/core/04-channel/IBCChannelUpgrade.sol
+13 −4 contracts/core/24-host/IBCHostConfigurator.sol
+14 −16 contracts/core/24-host/IBCHostLib.sol
+3 −3 contracts/core/24-host/IIBCHostConfigurator.sol
+6 −1 contracts/core/24-host/IIBCHostErrors.sol
+9 −0 contracts/core/25-handler/IBCClientConnectionChannelHandler.sol
+1 −0 contracts/core/25-handler/IBCHandler.sol
+2 −2 contracts/core/25-handler/IBCQuerier.sol
+2 −0 contracts/core/25-handler/IIBCHandler.sol
+2 −2 contracts/core/25-handler/IIBCQuerier.sol
+2 −2 contracts/core/25-handler/OwnableIBCHandler.sol
+83 −0 contracts/core/25-handler/OwnableUpgradeableIBCHandler.sol
+49 −14 contracts/core/26-router/IBCModuleManager.sol
+39 −28 contracts/core/26-router/IIBCModule.sol
+14 −0 contracts/core/26-router/IIBCModuleManager.sol
+105 −0 docs/adr/adr-002.md
+274 −0 docs/adr/adr-003.md
+73 −21 docs/architecture.md
+ docs/img/architecture-01.png
+4 −0 foundry.toml
+1,712 −18 package-lock.json
+4 −2 package.json
+272 −1 pkg/contract/ibchandler/ibchandler.go
+33 −33 pkg/contract/ibcmockapp/ibcmockapp.go
+0 −1,104 pkg/contract/ics20bank/ics20bank.go
+736 −0 pkg/contract/ics20transfer/ics20transfer.go
+33 −33 pkg/contract/ics20transferbank/ics20transferbank.go
+3 −53 pkg/testing/app.go
+23 −25 pkg/testing/chains.go
+29 −16 pkg/testing/config.go
+1 −2 scripts/abigen.sh
+43 −38 tests/e2e/chains_test.go
+1 −0 tests/foundry/lib/openzeppelin-foundry-upgrades
+44 −0 tests/foundry/src/ContractUpgrade.t.sol
+34 −13 tests/foundry/src/Deploy.s.sol
+155 −0 tests/foundry/src/IBCMockAppFactory.t.sol
+1 −1 tests/foundry/src/ICS04Handshake.t.sol
+19 −3 tests/foundry/src/ICS20Lib.t.sol
+256 −0 tests/foundry/src/ICS20Transfer.t.sol
+38 −0 tests/foundry/src/helpers/TestableOwnableUpgradeableIBCHandlerV1.sol
+41 −0 tests/foundry/src/helpers/TestableOwnableUpgradeableIBCHandlerV2.sol