Skip to content

Commit

Permalink
feat(batcher): batch message request
Browse files Browse the repository at this point in the history
  • Loading branch information
haiyizxx committed Mar 7, 2024
1 parent bc8a8db commit c90d5ee
Show file tree
Hide file tree
Showing 20 changed files with 2,476 additions and 6 deletions.
9 changes: 9 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ import (
axelarnetKeeper "github.com/axelarnetwork/axelar-core/x/axelarnet/keeper"
axelarnetTypes "github.com/axelarnetwork/axelar-core/x/axelarnet/types"
axelarbankkeeper "github.com/axelarnetwork/axelar-core/x/bank/keeper"
"github.com/axelarnetwork/axelar-core/x/batcher"
batchertypes "github.com/axelarnetwork/axelar-core/x/batcher/types"
"github.com/axelarnetwork/axelar-core/x/evm"
evmKeeper "github.com/axelarnetwork/axelar-core/x/evm/keeper"
evmTypes "github.com/axelarnetwork/axelar-core/x/evm/types"
Expand Down Expand Up @@ -657,7 +659,9 @@ func initAppModules(keepers *KeeperCache, bApp *bam.BaseApp, encodingConfig axel
bApp.Router(),
),
permission.NewAppModule(*getKeeper[permissionKeeper.Keeper](keepers)),
batcher.NewAppModule(encodingConfig.Codec, bApp.MsgServiceRouter(), initMessageAnteDecorators(encodingConfig, keepers)),
)

return appModules
}

Expand Down Expand Up @@ -789,6 +793,7 @@ func orderMigrations() []string {
permissionTypes.ModuleName,
snapTypes.ModuleName,
axelarnetTypes.ModuleName,
batchertypes.ModuleName,
)
return migrationOrder
}
Expand Down Expand Up @@ -839,6 +844,7 @@ func orderBeginBlockers() []string {
snapTypes.ModuleName,
axelarnetTypes.ModuleName,
voteTypes.ModuleName,
batchertypes.ModuleName,
)
return beginBlockerOrder
}
Expand Down Expand Up @@ -884,6 +890,7 @@ func orderEndBlockers() []string {
axelarnetTypes.ModuleName,
permissionTypes.ModuleName,
voteTypes.ModuleName,
batchertypes.ModuleName,
)
return endBlockerOrder
}
Expand Down Expand Up @@ -932,6 +939,7 @@ func orderModulesForGenesis() []string {
axelarnetTypes.ModuleName,
rewardTypes.ModuleName,
permissionTypes.ModuleName,
batchertypes.ModuleName,
)
return genesisOrder
}
Expand Down Expand Up @@ -1102,6 +1110,7 @@ func GetModuleBasics() module.BasicManager {
axelarnet.AppModuleBasic{},
reward.AppModuleBasic{},
permission.AppModuleBasic{},
batcher.AppModuleBasic{},
}

if IsWasmEnabled() {
Expand Down
156 changes: 156 additions & 0 deletions docs/proto/proto-docs.md

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

15 changes: 15 additions & 0 deletions proto/axelar/batcher/v1beta1/events.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";
package axelar.batcher.v1beta1;

option go_package = "github.com/axelarnetwork/axelar-core/x/batcher/types";
option (gogoproto.messagename_all) = true;

import "gogoproto/gogo.proto";

message FailedMessages {
message FailedMessage {
int32 index = 1;
string error = 2;
}
repeated FailedMessage messages = 1 [ (gogoproto.nullable) = false, (gogoproto.jsontag) = "messages,omitempty" ];
}
11 changes: 11 additions & 0 deletions proto/axelar/batcher/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
syntax = "proto3";
package axelar.batcher.v1beta1;

option go_package = "github.com/axelarnetwork/axelar-core/x/batcher/types";

import "gogoproto/gogo.proto";

option (gogoproto.goproto_getters_all) = false;

// GenesisState represents the genesis state
message GenesisState {}
20 changes: 20 additions & 0 deletions proto/axelar/batcher/v1beta1/service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
syntax = "proto3";
package axelar.batcher.v1beta1;

option go_package = "github.com/axelarnetwork/axelar-core/x/batcher/types";

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "axelar/batcher/v1beta1/tx.proto";

option (gogoproto.goproto_registration) = true;

// Msg defines the nexus Msg service.
service MsgService {
rpc Batch(BatchRequest) returns (BatchResponse) {
option (google.api.http) = {
post : "/axelar/batcher/batch"
body : "*"
};
}
}
22 changes: 22 additions & 0 deletions proto/axelar/batcher/v1beta1/tx.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
syntax = "proto3";
package axelar.batcher.v1beta1;

import "google/protobuf/any.proto";
import "gogoproto/gogo.proto";

import "axelar/permission/exported/v1beta1/types.proto";

option go_package = "github.com/axelarnetwork/axelar-core/x/batcher/types";

message BatchRequest {
option (permission.exported.v1beta1.permission_role) = ROLE_UNRESTRICTED;

bytes sender = 1 [ (gogoproto.casttype) =
"github.com/cosmos/cosmos-sdk/types.AccAddress" ];
repeated google.protobuf.Any must_succeed_messages = 2
[ (gogoproto.nullable) = false ];
repeated google.protobuf.Any can_fail_messages = 3
[ (gogoproto.nullable) = false ];
}

message BatchResponse {}
12 changes: 6 additions & 6 deletions third_party/proto/ibc/applications/transfer/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ option go_package = "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types";

// Query provides defines the gRPC querier service.
service Query {
// DenomTrace queries a denomination trace information.
rpc DenomTrace(QueryDenomTraceRequest) returns (QueryDenomTraceResponse) {
option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces/{hash}";
}

// DenomTraces queries all denomination traces.
rpc DenomTraces(QueryDenomTracesRequest) returns (QueryDenomTracesResponse) {
option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces";
}

// DenomTrace queries a denomination trace information.
rpc DenomTrace(QueryDenomTraceRequest) returns (QueryDenomTraceResponse) {
option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces/{hash=**}";
}

// Params queries all parameters of the ibc-transfer module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/ibc/apps/transfer/v1/params";
}

// DenomHash queries a denomination hash information.
rpc DenomHash(QueryDenomHashRequest) returns (QueryDenomHashResponse) {
option (google.api.http).get = "/ibc/apps/transfer/v1/denom_hashes/{trace}";
option (google.api.http).get = "/ibc/apps/transfer/v1/denom_hashes/{trace=**}";
}

// EscrowAddress returns the escrow address for a particular port and channel id.
Expand Down
1 change: 1 addition & 0 deletions utils/events/event_imports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package events_test
import (
_ "github.com/axelarnetwork/axelar-core/x/ante/types"
_ "github.com/axelarnetwork/axelar-core/x/axelarnet/types"
_ "github.com/axelarnetwork/axelar-core/x/batcher/types"
_ "github.com/axelarnetwork/axelar-core/x/evm/types"
_ "github.com/axelarnetwork/axelar-core/x/multisig/types"
_ "github.com/axelarnetwork/axelar-core/x/nexus/types"
Expand Down
Loading

0 comments on commit c90d5ee

Please sign in to comment.