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

Updated Axelar Proxy Contract Features #227

Closed
wants to merge 104 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
54f4e05
clean build
mvid Apr 4, 2023
e726d40
bring over axelar module
mvid Apr 4, 2023
d190bfb
redo axelar corks with cork v2
mvid Apr 12, 2023
e93514c
rpc endpoints for hitting axelar
mvid Apr 14, 2023
bd81a11
cleanup for CLI
mvid Apr 17, 2023
83cde22
clean up CLI
mvid Apr 17, 2023
ec2739e
proposal trasnfered from gravity
mvid Apr 25, 2023
927c250
typo
mvid Apr 25, 2023
a885feb
update for heighliner
mvid May 3, 2023
f2877b3
genesis updates
mvid May 3, 2023
465c4c2
governance
mvid May 3, 2023
ee5fe9d
rename msg field
mvid May 3, 2023
a7bacc3
some review updates
mvid May 5, 2023
be1bffb
more review updates
mvid May 5, 2023
530fe58
even more review updates!
mvid May 5, 2023
9e18aad
proposal updates
mvid May 5, 2023
4cc1105
chain configs query
mvid May 5, 2023
29fe77e
comment updates
mvid May 6, 2023
0eeb0b2
fix issue with ID in key parsing
mvid May 17, 2023
b438612
add staking mocks
mvid May 17, 2023
c138859
all existing cork v2 tests pass
mvid May 17, 2023
1691acd
add mocks to sc
mvid May 17, 2023
4af566d
tests for middleware
mvid Jun 5, 2023
c19ea7c
empty payload
mvid Jun 5, 2023
05470ad
prost build
mvid Jun 20, 2023
200ff49
bring in changes from cork v2
mvid Jun 20, 2023
85cce47
actual prost build
mvid Jun 22, 2023
d49ed24
include modules
mvid Jun 22, 2023
2069278
namespace issue
mvid Jun 22, 2023
050d855
unique gov prop ids
mvid Jun 26, 2023
2514b01
unused interchain test
mvid Jun 26, 2023
1d61e92
go mod conflict
mvid Jun 26, 2023
51dff16
move scoped axelar keeper
mvid Jun 27, 2023
c22b34a
issue with params key table
mvid Jun 27, 2023
90db919
app.go fixes for axelar cork
mvid Jun 27, 2023
06340a7
something is funky with codec registrations
mvid Jun 27, 2023
5bab5af
more prop types
mvid Jun 29, 2023
6fb0c77
all proposals
mvid Jun 29, 2023
494d6d1
unit test pass
mvid Jun 29, 2023
54f88ae
clarify all registered types
mvid Jun 30, 2023
0695e31
newer protos broken for axelar cork
mvid Jun 30, 2023
b320c7d
downgrade bufbuild
mvid Jun 30, 2023
75febe0
old version cellar fees
mvid Jun 30, 2023
c0f091a
Bolten/test axelar buf (#220)
mvid Jun 30, 2023
e339a62
rebuild prost from new (old) buf build
mvid Jul 3, 2023
5e0b04e
compiles
mvid Jul 6, 2023
abb11d6
params unit tests
mvid Jul 6, 2023
d56e88c
lint pass
mvid Jul 6, 2023
cae2365
prost build
mvid Jul 6, 2023
0a5659c
validate disabled
mvid Jul 7, 2023
f5a3861
review pass
mvid Jul 13, 2023
f2c80e6
only chain id
mvid Jul 13, 2023
c047631
more updates
mvid Jul 16, 2023
ef1cc7f
import gravity module to pull delegate information
mvid Jul 19, 2023
33dc46b
adjust mocks
mvid Jul 19, 2023
ac62ab5
set protocgen back to previous
mvid Jul 19, 2023
86ae9dd
linting
mvid Jul 19, 2023
3757e0e
test configuration correct for scenario
mvid Jul 20, 2023
8f5d968
return proto update to previous style
mvid Jul 20, 2023
fe27312
resetting swagger script to previous
mvid Jul 20, 2023
c021d9f
another pass
mvid Jul 26, 2023
46ec04f
more changes
mvid Jul 26, 2023
3dc9011
cleanup local script changes for protos
mvid Jul 26, 2023
5a7b6d8
encode id to string on result retrieval
mvid Jul 26, 2023
40bb3c0
revert cellarfee protos
mvid Jul 26, 2023
30d1901
test update for hex
mvid Jul 26, 2023
5fb45e9
cork timeouts
mvid Jul 28, 2023
c19a92c
updates for unused cancel msg
mvid Jul 28, 2023
087ca62
several review comments
mvid Jul 31, 2023
6ede3f7
Add AxelarContractCallNonce types and keeper methods
cbrit Sep 15, 2023
ad59ab4
Update tests
cbrit Sep 15, 2023
be7b58d
Update protos, generate docs
cbrit Sep 18, 2023
83c5456
Add deadline to AxelarCork state and keeper methods
cbrit Sep 18, 2023
2db0718
Add deadline and noce to RelayCork payload
cbrit Sep 18, 2023
d213dcf
Initial axelar proxy upgrade types and logic
cbrit Sep 19, 2023
88d230a
Unit tests and rename encoding method
cbrit Sep 19, 2023
1b52a60
Fix proto errors
cbrit Sep 19, 2023
0b3ea21
Make linter happy
cbrit Sep 19, 2023
660b1a6
Upgrade data iterator
cbrit Sep 19, 2023
3ec15dc
Init/ExportGenesis for upgrade data
cbrit Sep 19, 2023
71f0fd8
Tweak keeper comments
cbrit Sep 19, 2023
06c691b
More accurate test name
cbrit Sep 19, 2023
62d975f
Tweak tests
cbrit Sep 19, 2023
6dc13c2
Clarify proxy encoding arg name
cbrit Sep 19, 2023
b94c72d
Revert "Clarify proxy encoding arg name"
cbrit Sep 19, 2023
ed59e54
CLI tx commands for new proposals
cbrit Sep 19, 2023
6c1bbd5
Proposal boilerplate, queries, CLI, fixes
cbrit Sep 19, 2023
4c25eee
Wire up handlers
cbrit Sep 19, 2023
80d09c4
Improved Axelar call encoding/decoding, add unit test
cbrit Sep 21, 2023
588a286
Add proxy upgrade to IBC packet validation
cbrit Sep 21, 2023
5a845c8
Rename packet validation method
cbrit Sep 21, 2023
ba5f880
Add missing validation for upgrade packet
cbrit Sep 21, 2023
7cb8b81
Remove unneeded comment
cbrit Sep 21, 2023
41c68e7
Add new axelar proposal handlers to BasicManager
cbrit Sep 27, 2023
bf0fd69
Add message type constant for relay upgrade message
cbrit Sep 27, 2023
9aadba3
Remove unused struct
cbrit Sep 27, 2023
d978004
Register missing messages with legacy amino codec
cbrit Sep 27, 2023
01a36af
Add ValidateBasic() for new state and add to default genesis
cbrit Sep 27, 2023
a778abf
Update somm_proto crate
cbrit Sep 27, 2023
7965628
Add new query commands to CLI
cbrit Sep 27, 2023
e34eb14
Add new tx command to CLI
cbrit Sep 27, 2023
8a40d0f
Lock somm_proto crate to steward compatible version
cbrit Sep 28, 2023
d5a0c85
Update Cellar IDs query and add QueryCellarIDsByChainID
cbrit Sep 29, 2023
d42d457
Remove duplicate chainID argument from axelar cork ID hash
cbrit Oct 3, 2023
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 .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ linters:
enable:
- bodyclose
- deadcode
- depguard
# - depguard
- dogsled
# - errcheck
- goconst
Expand Down
55 changes: 47 additions & 8 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ import (
v4 "github.com/peggyjv/sommelier/v6/app/upgrades/v4"
v5 "github.com/peggyjv/sommelier/v6/app/upgrades/v5"
v6 "github.com/peggyjv/sommelier/v6/app/upgrades/v6"
"github.com/peggyjv/sommelier/v6/x/axelarcork"
axelarcorkclient "github.com/peggyjv/sommelier/v6/x/axelarcork/client"
axelarcorkkeeper "github.com/peggyjv/sommelier/v6/x/axelarcork/keeper"
axelarcorktypes "github.com/peggyjv/sommelier/v6/x/axelarcork/types"
"github.com/peggyjv/sommelier/v6/x/cellarfees"
cellarfeeskeeper "github.com/peggyjv/sommelier/v6/x/cellarfees/keeper"
cellarfeestypes "github.com/peggyjv/sommelier/v6/x/cellarfees/types"
Expand Down Expand Up @@ -150,6 +154,14 @@ var (
gravityclient.ProposalHandler,
corkclient.AddProposalHandler,
corkclient.RemoveProposalHandler,
axelarcorkclient.AddProposalHandler,
axelarcorkclient.RemoveProposalHandler,
axelarcorkclient.AddChainConfigurationHandler,
axelarcorkclient.RemoveChainConfigurationHandler,
axelarcorkclient.ScheduledCorkProposalHandler,
axelarcorkclient.CommunityPoolEthereumSpendProposalHandler,
axelarcorkclient.UpgradeAxelarProxyContractHandler,
axelarcorkclient.CancelAxelarProxyContractUpgradeHandler,
),
params.AppModuleBasic{},
crisis.AppModuleBasic{},
Expand All @@ -164,6 +176,7 @@ var (
authzmodule.AppModuleBasic{},
gravity.AppModuleBasic{},
cork.AppModuleBasic{},
axelarcork.AppModuleBasic{},
cellarfees.AppModuleBasic{},
incentives.AppModuleBasic{},
)
Expand Down Expand Up @@ -228,13 +241,15 @@ type SommelierApp struct {

// Sommelier keepers
CorkKeeper corkkeeper.Keeper
AxelarCorkKeeper axelarcorkkeeper.Keeper
CellarFeesKeeper cellarfeeskeeper.Keeper
IncentivesKeeper incentiveskeeper.Keeper

// make capability scoped keepers public for test purposes (IBC only)
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
ScopedAxelarCorkKeeper capabilitykeeper.ScopedKeeper
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper

// the module manager
mm *module.Manager
Expand Down Expand Up @@ -288,6 +303,7 @@ func NewSommelierApp(
feegrant.StoreKey,
authzkeeper.StoreKey,
corktypes.StoreKey,
axelarcorktypes.StoreKey,
incentivestypes.StoreKey,
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
Expand All @@ -313,6 +329,7 @@ func NewSommelierApp(
scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName)
scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName)
scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName)
scopedAxelarCorkKeeper := app.CapabilityKeeper.ScopeToModule(axelarcorktypes.ModuleName)
app.CapabilityKeeper.Seal()

// add keepers
Expand Down Expand Up @@ -370,8 +387,22 @@ func NewSommelierApp(
app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper,
app.AccountKeeper, app.BankKeeper, scopedTransferKeeper,
)

// create axelar cork keeper
app.AxelarCorkKeeper = axelarcorkkeeper.NewKeeper(
appCodec,
keys[axelarcorktypes.StoreKey],
app.GetSubspace(axelarcorktypes.ModuleName),
app.StakingKeeper,
app.TransferKeeper,
app.DistrKeeper,
app.IBCKeeper.ChannelKeeper,
app.GravityKeeper,
)
transferModule := ibctransfer.NewAppModule(app.TransferKeeper)
transferIBCModule := ibctransfer.NewIBCModule(app.TransferKeeper)
var transferStack ibcporttypes.IBCModule = transferIBCModule
transferStack = axelarcork.NewIBCMiddleware(app.AxelarCorkKeeper, transferStack)

// Create the ICAHost Keeper
app.ICAHostKeeper = icahostkeeper.NewKeeper(
Expand Down Expand Up @@ -422,6 +453,7 @@ func NewSommelierApp(
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).
AddRoute(corktypes.RouterKey, cork.NewUpdateCellarIDsProposalHandler(app.CorkKeeper)).
AddRoute(axelarcorktypes.RouterKey, axelarcork.NewProposalHandler(app.AxelarCorkKeeper)).
AddRoute(gravitytypes.RouterKey, gravity.NewCommunityPoolEthereumSpendProposalHandler(app.GravityKeeper))
app.GovKeeper = govkeeper.NewKeeper(
appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper,
Expand All @@ -431,7 +463,7 @@ func NewSommelierApp(
// Create static IBC router, add transfer route, then set and seal it
ibcRouter := ibcporttypes.NewRouter()
ibcRouter.
AddRoute(ibctransfertypes.ModuleName, transferIBCModule).
AddRoute(ibctransfertypes.ModuleName, transferStack).
AddRoute(icahosttypes.SubModuleName, icaHostIBCModule)
app.IBCKeeper.SetRouter(ibcRouter)

Expand Down Expand Up @@ -475,11 +507,12 @@ func NewSommelierApp(
ica.NewAppModule(nil, &app.ICAHostKeeper),
params.NewAppModule(app.ParamsKeeper),
transferModule,
axelarcork.NewAppModule(app.AxelarCorkKeeper, appCodec),
gravity.NewAppModule(app.GravityKeeper, app.BankKeeper),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
cork.NewAppModule(app.CorkKeeper, appCodec),
cellarfees.NewAppModule(app.CellarFeesKeeper, appCodec, app.AccountKeeper, app.BankKeeper),
incentives.NewAppModule(app.IncentivesKeeper, app.DistrKeeper, app.BankKeeper, app.MintKeeper, appCodec),
cellarfees.NewAppModule(app.CellarFeesKeeper, appCodec),
incentives.NewAppModule(app.IncentivesKeeper, appCodec),
)

// During begin block slashing happens after distr.BeginBlocker so that
Expand Down Expand Up @@ -510,6 +543,7 @@ func NewSommelierApp(
incentivestypes.ModuleName,
gravitytypes.ModuleName,
corktypes.ModuleName,
axelarcorktypes.ModuleName,
cellarfeestypes.ModuleName,
)

Expand Down Expand Up @@ -537,6 +571,7 @@ func NewSommelierApp(
incentivestypes.ModuleName,
gravitytypes.ModuleName,
corktypes.ModuleName,
axelarcorktypes.ModuleName,
cellarfeestypes.ModuleName,
)

Expand Down Expand Up @@ -568,6 +603,7 @@ func NewSommelierApp(
gravitytypes.ModuleName,
incentivestypes.ModuleName,
corktypes.ModuleName,
axelarcorktypes.ModuleName,
cellarfeestypes.ModuleName,
)

Expand Down Expand Up @@ -597,8 +633,9 @@ func NewSommelierApp(
ibc.NewAppModule(app.IBCKeeper),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
cork.NewAppModule(app.CorkKeeper, appCodec),
cellarfees.NewAppModule(app.CellarFeesKeeper, appCodec, app.AccountKeeper, app.BankKeeper),
incentives.NewAppModule(app.IncentivesKeeper, app.DistrKeeper, app.BankKeeper, app.MintKeeper, appCodec),
axelarcork.NewAppModule(app.AxelarCorkKeeper, appCodec),
cellarfees.NewAppModule(app.CellarFeesKeeper, appCodec),
incentives.NewAppModule(app.IncentivesKeeper, appCodec),
)

app.sm.RegisterStoreDecoders()
Expand Down Expand Up @@ -635,6 +672,7 @@ func NewSommelierApp(
app.ScopedIBCKeeper = scopedIBCKeeper
app.ScopedTransferKeeper = scopedTransferKeeper
app.ScopedICAHostKeeper = scopedICAHostKeeper
app.ScopedAxelarCorkKeeper = scopedAxelarCorkKeeper

return app
}
Expand Down Expand Up @@ -831,6 +869,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(icahosttypes.SubModuleName)
paramsKeeper.Subspace(gravitytypes.ModuleName)
paramsKeeper.Subspace(corktypes.ModuleName)
paramsKeeper.Subspace(axelarcorktypes.ModuleName)
paramsKeeper.Subspace(cellarfeestypes.ModuleName)
paramsKeeper.Subspace(incentivestypes.ModuleName)

Expand Down
Loading
Loading