Skip to content

Commit

Permalink
Merge pull request #217 from aura-nw/euphoria
Browse files Browse the repository at this point in the history
v0.9.3
  • Loading branch information
kienvc authored Aug 13, 2024
2 parents 6c95554 + d3e717e commit 4a33274
Show file tree
Hide file tree
Showing 59 changed files with 393 additions and 17,163 deletions.
2 changes: 1 addition & 1 deletion .VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.8.3
v0.9.3
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
VER=$(cat .VERSION)-${{ github.head_ref || github.ref_name }}
echo "VERSION=$VER" >> $GITHUB_ENV
- uses: mukunku/tag-exists-action@v1.4.0
- uses: mukunku/tag-exists-action@v1.6.0
id: checkTag
with:
tag: ${{ env.VERSION }}
Expand All @@ -39,7 +39,7 @@ jobs:
exit 1
- name: Delete the "latest" Pre-Release
uses: dev-drprasad/delete-older-releases@v0.3.2
uses: dev-drprasad/delete-older-releases@v0.3.4
with:
keep_latest: 0
delete_tag_pattern: .*-${{ github.head_ref || github.ref_name }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '1.20'

Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ Ref: https://keepachangelog.com/en/1.0.0/

## Unreleased

## [v0.9.3] - 2024-08-05
### Improvements
- Upgrade to evmos v18.1.0
- Use erc20 module to automatically convert ibc tokens to registered erc20 tokens
- Remove precompiles as they are not compatible with evmos v18.1.0
- Remove ibc-hooks
- Update dependencies

## [v0.8.1] - 2024-05-22
### Improvements
- Clean unused code in evmutil module
Expand Down Expand Up @@ -173,4 +181,4 @@ Upgrade sdk to v0.47.4

- Bump wasmd version to version `v0.18.0`
- Bump cosmos-sdk to version `v0.45.5`
- Feegrant allows to use contract address
- Feegrant allows to use contract address
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ Aura project source code files are made available under Apache-2.0 License, loca
## Acknowledgments

Aura project is built using [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) and uses additional modules:
- ```github.com/evmos/evmos/v16``` by Tharsis Labs Ltd.(Evmos). This EVM library is distributed under [ENCL-1.0](https://github.com/evmos/evmos/blob/v16.0.3/LICENSE).
- ```github.com/evmos/evmos/v18``` by Tharsis Labs Ltd.(Evmos). This EVM library is distributed under [ENCL-1.0](https://github.com/evmos/evmos/blob/v16.0.3/LICENSE).

- ```x/evmutil``` by Kava Labs, Inc. This module is distributed under [Apache v2 License](https://github.com/Kava-Labs/kava/blob/master/LICENSE.md).
12 changes: 6 additions & 6 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import (

// ethermint ante
sdkvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
evmosante "github.com/evmos/evmos/v16/app/ante"
cosmosante "github.com/evmos/evmos/v16/app/ante/cosmos"
"github.com/evmos/evmos/v16/app/ante/evm"
evmante "github.com/evmos/evmos/v16/app/ante/evm"
evmostypes "github.com/evmos/evmos/v16/types"
evmtypes "github.com/evmos/evmos/v16/x/evm/types"
evmosante "github.com/evmos/evmos/v18/app/ante"
cosmosante "github.com/evmos/evmos/v18/app/ante/cosmos"
"github.com/evmos/evmos/v18/app/ante/evm"
evmante "github.com/evmos/evmos/v18/app/ante/evm"
evmostypes "github.com/evmos/evmos/v18/types"
evmtypes "github.com/evmos/evmos/v18/x/evm/types"

smartaccount "github.com/aura-nw/aura/x/smartaccount"
smartaccountkeeper "github.com/aura-nw/aura/x/smartaccount/keeper"
Expand Down
171 changes: 91 additions & 80 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ import (
v700 "github.com/aura-nw/aura/app/upgrades/v0.7.0"
v701 "github.com/aura-nw/aura/app/upgrades/v0.7.1"
v702 "github.com/aura-nw/aura/app/upgrades/v0.7.2"

v081 "github.com/aura-nw/aura/app/upgrades/v0.8.1"

ibcupgrade "github.com/aura-nw/aura/app/upgrades/ibcupgrade"

v081 "github.com/aura-nw/aura/app/upgrades/v0.8.1"
v093 "github.com/aura-nw/aura/app/upgrades/v0.9.3"

"github.com/aura-nw/aura/app/internal"

"github.com/aura-nw/aura/app/utils"
Expand Down Expand Up @@ -145,14 +146,14 @@ import (
"github.com/prometheus/client_golang/prometheus"

// evm module
srvflags "github.com/evmos/evmos/v16/server/flags"
"github.com/evmos/evmos/v16/x/erc20"
erc20client "github.com/evmos/evmos/v16/x/erc20/client"
erc20keeper "github.com/evmos/evmos/v16/x/erc20/keeper"
erc20types "github.com/evmos/evmos/v16/x/erc20/types"
"github.com/evmos/evmos/v16/x/evm"
evmkeeper "github.com/evmos/evmos/v16/x/evm/keeper"
evmtypes "github.com/evmos/evmos/v16/x/evm/types"
srvflags "github.com/evmos/evmos/v18/server/flags"
"github.com/evmos/evmos/v18/x/erc20"
erc20client "github.com/evmos/evmos/v18/x/erc20/client"
erc20keeper "github.com/evmos/evmos/v18/x/erc20/keeper"
erc20types "github.com/evmos/evmos/v18/x/erc20/types"
"github.com/evmos/evmos/v18/x/evm"
evmkeeper "github.com/evmos/evmos/v18/x/evm/keeper"
evmtypes "github.com/evmos/evmos/v18/x/evm/types"

// Force-load the tracer engines to trigger registration due to Go-Ethereum v1.10.15 changes
_ "github.com/ethereum/go-ethereum/eth/tracers/js"
Expand All @@ -164,12 +165,12 @@ import (
evmutiltypes "github.com/aura-nw/aura/x/evmutil/types"

// overide transfer for erc20
"github.com/evmos/evmos/v16/x/ibc/transfer"
transferkeeper "github.com/evmos/evmos/v16/x/ibc/transfer/keeper"
"github.com/evmos/evmos/v18/x/ibc/transfer"
transferkeeper "github.com/evmos/evmos/v18/x/ibc/transfer/keeper"

"github.com/evmos/evmos/v16/x/feemarket"
feemarketkeeper "github.com/evmos/evmos/v16/x/feemarket/keeper"
feemarkettypes "github.com/evmos/evmos/v16/x/feemarket/types"
"github.com/evmos/evmos/v18/x/feemarket"
feemarketkeeper "github.com/evmos/evmos/v18/x/feemarket/keeper"
feemarkettypes "github.com/evmos/evmos/v18/x/feemarket/types"

v0_3_0 "github.com/aura-nw/aura/app/upgrades/v0.3.0"
v0_3_1 "github.com/aura-nw/aura/app/upgrades/v0.3.1"
Expand Down Expand Up @@ -593,13 +594,12 @@ func New(
)
app.IBCHooksKeeper = &hooksKeeper

auraPrefix := sdk.GetConfig().GetBech32AccountAddrPrefix()
wasmHooks := ibc_hooks.NewWasmHooks(app.IBCHooksKeeper, &app.WasmKeeper, auraPrefix) // The contract keeper needs to be set later
app.Ics20WasmHooks = &wasmHooks
app.HooksICS4Wrapper = ibc_hooks.NewICS4Middleware(
app.IBCKeeper.ChannelKeeper,
app.Ics20WasmHooks,
)
// auraPrefix := sdk.GetConfig().GetBech32AccountAddrPrefix()
// wasmHooks := ibc_hooks.NewWasmHooks(app.IBCHooksKeeper, &app.WasmKeeper, auraPrefix) // The contract keeper needs to be set later
// app.Ics20WasmHooks = &wasmHooks
// app.HooksICS4Wrapper = ibc_hooks.NewICS4Middleware(
// app.IBCKeeper.ChannelKeeper,
// )

// Create Transfer Keepers
// app.TransferKeeper = transferkeeper.NewKeeper(
Expand All @@ -621,15 +621,19 @@ func New(
app.AccountKeeper, app.BankKeeper, scopedTransferKeeper,
app.Erc20Keeper, // Add ERC20 Keeper for ERC20 transfers
)
transferIBCModule := transfer.NewIBCModule(app.TransferKeeper)
middlewareTransferModule := ibc_hooks.NewIBCMiddleware(
transferIBCModule,
&app.HooksICS4Wrapper,
)

var transferIBCModule ibcporttypes.IBCModule
transferIBCModule = transfer.NewIBCModule(app.TransferKeeper)
transferIBCModule = erc20.NewIBCMiddleware(app.Erc20Keeper, transferIBCModule)

// middlewareTransferModule := ibc_hooks.NewIBCMiddleware(
// transferIBCModule,
// &app.HooksICS4Wrapper,
// )

// Create static IBC router, add transfer route, then set and seal it
ibcRouter := ibcporttypes.NewRouter()
ibcRouter.AddRoute(ibctransfertypes.ModuleName, middlewareTransferModule)
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferIBCModule)

// enable evm precompile, this need to be done after initialized ibc and transfer keeper
chainID := bApp.ChainID()
Expand Down Expand Up @@ -699,7 +703,7 @@ func New(
saModule := samodule.NewAppModule(appCodec, app.SaKeeper, app.ContractKeeper, app.AccountKeeper)

// Pass the contract keeper to ICS4Wrappers for ibc middlewares
app.Ics20WasmHooks.ContractKeeper = &app.WasmKeeper
// app.Ics20WasmHooks.ContractKeeper = &app.WasmKeeper

// The gov proposal types can be individually enabled
enabledProposals := GetEnabledProposals()
Expand Down Expand Up @@ -1306,6 +1310,11 @@ func (app *App) setupUpgradeHandlers() {
ibcupgrade.CreateUpgradeHandler(app.mm, app.configurator),
)

app.UpgradeKeeper.SetUpgradeHandler(
v093.UpgradeName,
v093.CreateUpgradeHandler(app.mm, app.configurator),
)

// When a planned update height is reached, the old binary will panic
// writing on disk the height and name of the update that triggered it
// This will read that value, and execute the preparations for the upgrade.
Expand All @@ -1321,74 +1330,76 @@ func (app *App) setupUpgradeHandlers() {
var storeUpgrades *storetypes.StoreUpgrades

switch upgradeInfo.Name {
case v0_3_0.UpgradeName:
// no store upgrades in v0.3.0
case v0_3_0.UpgradeName:
// no store upgrades in v0.3.0

case v0_3_1.UpgradeName:
// no store upgrades in v0.3.1
case v0_3_1.UpgradeName:
// no store upgrades in v0.3.1

case v0_3_2.UpgradeName:
// no store upgrades in v0.3.2
case v0_3_2.UpgradeName:
// no store upgrades in v0.3.2

case v0_3_3.UpgradeName:
// no store upgrades in v0.3.3
case v0_3_3.UpgradeName:
// no store upgrades in v0.3.3

case v0_4_0.UpgradeName:
// no store upgrades in v0.4.0
case v0_4_0.UpgradeName:
// no store upgrades in v0.4.0

case v0_4_1.UpgradeName:
// no store upgrades in v0.4.1
case v0_4_1.UpgradeName:
// no store upgrades in v0.4.1

case v0_4_2.UpgradeName:
// no store upgrades in v0.4.2
case v0_4_2.UpgradeName:
// no store upgrades in v0.4.2

case v0_4_4.UpgradeName:
// no store upgrades in v0.4.4
case v0_4_4.UpgradeName:
// no store upgrades in v0.4.4

case v500.UpgradeName:
// no store upgrades in v0.5.0
case v500.UpgradeName:
// no store upgrades in v0.5.0

case v501.UpgradeName:
storeUpgrades = &storetypes.StoreUpgrades{
//Added: []string{ibcmiddlewaretypes.StoreKey},
}
case v600.UpgradeName:
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{samoduletypes.StoreKey},
}
case v501.UpgradeName:
storeUpgrades = &storetypes.StoreUpgrades{
//Added: []string{ibcmiddlewaretypes.StoreKey},
}
case v600.UpgradeName:
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{samoduletypes.StoreKey},
}

case v601.UpgradeName:
// no store upgrades in v0.6.
case v601.UpgradeName:
// no store upgrades in v0.6.

case v700.UpgradeName:
case v700.UpgradeName:
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{
consensusparamtypes.StoreKey,
crisistypes.StoreKey,
},
}

case v701.UpgradeName:
if ChainID == "xstaxy-1" {
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{
ibchookstypes.StoreKey,
samoduletypes.StoreKey,
consensusparamtypes.StoreKey,
crisistypes.StoreKey,
},
}
}

case v701.UpgradeName:
if ChainID == "xstaxy-1" {
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{
ibchookstypes.StoreKey,
samoduletypes.StoreKey,
consensusparamtypes.StoreKey,
crisistypes.StoreKey,
},
}
}

case v702.UpgradeName:
// no store upgrades in v0.7.2
case v703.UpgradeName:
// no store upgrades in v0.7.3

case v081.UpgradeName:
// no store upgrades in v0.8.1
case ibcupgrade.UpgradeName:
// no store upgrades in ibcupgrade
case v702.UpgradeName:
// no store upgrades in v0.7.2
case v703.UpgradeName:
// no store upgrades in v0.7.3

case v081.UpgradeName:
// no store upgrades in v0.8.1
case ibcupgrade.UpgradeName:
// no store upgrades in ibcupgrade
case v093.UpgradeName:
// no store upgrades in v0.9.3
}

if storeUpgrades != nil {
Expand Down
Loading

0 comments on commit 4a33274

Please sign in to comment.