Skip to content

Commit 9091173

Browse files
chore: Use prefix-based routing for IBCv2 contracts (#2258)
* feat: Register all contracts in IBCv2 port router * chore: Use prefix-based routing for IBCv2 contracts * chore: Update tests * update ibc-go * Use prefix route for IBCv2 * Cleanup --------- Co-authored-by: Christoph Otter <chris@confio.gmbh>
1 parent 17b39df commit 9091173

File tree

15 files changed

+826
-172
lines changed

15 files changed

+826
-172
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# docker build . -t cosmwasm/wasmd:latest
22
# docker run --rm -it cosmwasm/wasmd:latest /bin/sh
33

4-
FROM golang:1.23.6-alpine AS go-builder
4+
FROM golang:1.23.8-alpine AS go-builder
55

66
# this comes from standard alpine nightly file
77
# https://github.com/rust-lang/docker-rust-nightly/blob/master/alpine3.12/Dockerfile

app/app.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,6 @@ func NewWasmApp(
598598
panic(fmt.Sprintf("error while reading wasm config: %s", err))
599599
}
600600

601-
ibcRouterV2 := ibcapi.NewRouter()
602-
603601
// The last arguments can contain custom message handlers, and custom query handlers,
604602
// if we want to allow any custom callbacks
605603
app.WasmKeeper = wasmkeeper.NewKeeper(
@@ -620,7 +618,6 @@ func NewWasmApp(
620618
wasmtypes.VMConfig{},
621619
wasmkeeper.BuiltInCapabilities(),
622620
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
623-
ibcRouterV2,
624621
wasmOpts...,
625622
)
626623

@@ -662,8 +659,11 @@ func NewWasmApp(
662659
AddRoute(icahosttypes.SubModuleName, icaHostStack)
663660
app.IBCKeeper.SetRouter(ibcRouter)
664661

662+
ibcRouterV2 := ibcapi.NewRouter()
665663
ibcRouterV2 = ibcRouterV2.
666-
AddRoute(ibctransfertypes.PortID, transferv2.NewIBCModule(app.TransferKeeper))
664+
AddRoute(ibctransfertypes.PortID, transferv2.NewIBCModule(app.TransferKeeper)).
665+
AddPrefixRoute(wasmkeeper.PortIDPrefixV2, wasmkeeper.NewIBC2Handler(app.WasmKeeper))
666+
667667
app.IBCKeeper.SetRouterV2(ibcRouterV2)
668668

669669
clientKeeper := app.IBCKeeper.ClientKeeper

go.mod

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module github.com/CosmWasm/wasmd
22

3-
go 1.23.6
3+
go 1.23.8
4+
5+
toolchain go1.24.3
46

57
require (
68
github.com/CosmWasm/wasmvm/v3 v3.0.0-ibc2.1
@@ -17,7 +19,7 @@ require (
1719
github.com/grpc-ecosystem/grpc-gateway v1.16.0
1820
github.com/pkg/errors v0.9.1
1921
github.com/prometheus/client_golang v1.22.0
20-
github.com/spf13/cast v1.7.1
22+
github.com/spf13/cast v1.8.0
2123
github.com/spf13/cobra v1.9.1
2224
github.com/spf13/pflag v1.0.6
2325
github.com/stretchr/testify v1.10.0
@@ -30,10 +32,10 @@ require (
3032
require (
3133
cosmossdk.io/api v0.9.2
3234
cosmossdk.io/client/v2 v2.0.0-beta.3
33-
cosmossdk.io/collections v1.2.0
35+
cosmossdk.io/collections v1.2.1
3436
cosmossdk.io/core v0.11.3
3537
cosmossdk.io/errors v1.0.2
36-
cosmossdk.io/log v1.5.1
38+
cosmossdk.io/log v1.6.0
3739
cosmossdk.io/math v1.5.3
3840
cosmossdk.io/store v1.1.2
3941
cosmossdk.io/tools/confix v0.1.2
@@ -42,22 +44,22 @@ require (
4244
cosmossdk.io/x/feegrant v0.1.1
4345
cosmossdk.io/x/nft v0.1.1
4446
cosmossdk.io/x/tx v0.14.0
45-
cosmossdk.io/x/upgrade v0.1.4
47+
cosmossdk.io/x/upgrade v0.2.0
4648
github.com/cometbft/cometbft v0.38.17
4749
github.com/cosmos/cosmos-db v1.1.1
48-
github.com/cosmos/ibc-go/v10 v10.1.0
50+
github.com/cosmos/ibc-go/v10 v10.3.0
4951
github.com/distribution/reference v0.5.0
5052
github.com/rs/zerolog v1.34.0
5153
github.com/spf13/viper v1.20.1
5254
golang.org/x/sync v0.13.0
53-
google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463
55+
google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e
5456
)
5557

5658
require (
5759
cel.dev/expr v0.20.0 // indirect
5860
cloud.google.com/go v0.116.0 // indirect
59-
cloud.google.com/go/auth v0.13.0 // indirect
60-
cloud.google.com/go/auth/oauth2adapt v0.2.6 // indirect
61+
cloud.google.com/go/auth v0.14.1 // indirect
62+
cloud.google.com/go/auth/oauth2adapt v0.2.7 // indirect
6163
cloud.google.com/go/compute/metadata v0.6.0 // indirect
6264
cloud.google.com/go/iam v1.2.2 // indirect
6365
cloud.google.com/go/monitoring v1.21.2 // indirect
@@ -73,7 +75,7 @@ require (
7375
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 // indirect
7476
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1 // indirect
7577
github.com/Microsoft/go-winio v0.6.2 // indirect
76-
github.com/aws/aws-sdk-go v1.44.224 // indirect
78+
github.com/aws/aws-sdk-go v1.49.0 // indirect
7779
github.com/beorn7/perks v1.0.1 // indirect
7880
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
7981
github.com/bgentry/speakeasy v0.2.0 // indirect
@@ -86,9 +88,9 @@ require (
8688
github.com/cloudwego/base64x v0.1.5 // indirect
8789
github.com/cncf/xds/go v0.0.0-20250121191232-2f005788dc42 // indirect
8890
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
89-
github.com/cockroachdb/errors v1.11.3 // indirect
91+
github.com/cockroachdb/errors v1.12.0 // indirect
9092
github.com/cockroachdb/fifo v0.0.0-20240616162244-4768e80dfb9a // indirect
91-
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
93+
github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 // indirect
9294
github.com/cockroachdb/pebble v1.1.5 // indirect
9395
github.com/cockroachdb/redact v1.1.6 // indirect
9496
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
@@ -108,12 +110,12 @@ require (
108110
github.com/emicklei/dot v1.6.2 // indirect
109111
github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
110112
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
111-
github.com/ethereum/go-ethereum v1.15.5 // indirect
113+
github.com/ethereum/go-ethereum v1.15.11 // indirect
112114
github.com/fatih/color v1.17.0 // indirect
113115
github.com/felixge/httpsnoop v1.0.4 // indirect
114116
github.com/fsnotify/fsnotify v1.9.0 // indirect
115-
github.com/getsentry/sentry-go v0.28.1 // indirect
116-
github.com/go-jose/go-jose/v4 v4.0.4 // indirect
117+
github.com/getsentry/sentry-go v0.32.0 // indirect
118+
github.com/go-jose/go-jose/v4 v4.0.5 // indirect
117119
github.com/go-kit/kit v0.13.0 // indirect
118120
github.com/go-kit/log v0.2.1 // indirect
119121
github.com/go-logfmt/logfmt v0.6.0 // indirect
@@ -125,12 +127,12 @@ require (
125127
github.com/gogo/protobuf v1.3.2 // indirect
126128
github.com/golang/glog v1.2.4 // indirect
127129
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
128-
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
130+
github.com/golang/snappy v0.0.5-0.20231225225746-43d5d4cd4e0e // indirect
129131
github.com/google/btree v1.1.3 // indirect
130132
github.com/google/flatbuffers v24.3.25+incompatible // indirect
131133
github.com/google/go-cmp v0.7.0 // indirect
132134
github.com/google/orderedcode v0.0.1 // indirect
133-
github.com/google/s2a-go v0.1.8 // indirect
135+
github.com/google/s2a-go v0.1.9 // indirect
134136
github.com/google/uuid v1.6.0 // indirect
135137
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
136138
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
@@ -139,7 +141,7 @@ require (
139141
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
140142
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
141143
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
142-
github.com/hashicorp/go-getter v1.7.5 // indirect
144+
github.com/hashicorp/go-getter v1.7.8 // indirect
143145
github.com/hashicorp/go-hclog v1.6.3 // indirect
144146
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
145147
github.com/hashicorp/go-metrics v0.5.4 // indirect
@@ -203,8 +205,8 @@ require (
203205
go.opencensus.io v0.24.0 // indirect
204206
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
205207
go.opentelemetry.io/contrib/detectors/gcp v1.34.0 // indirect
206-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect
207-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
208+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.58.0 // indirect
209+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect
208210
go.opentelemetry.io/otel v1.34.0 // indirect
209211
go.opentelemetry.io/otel/metric v1.34.0 // indirect
210212
go.opentelemetry.io/otel/sdk v1.34.0 // indirect
@@ -216,12 +218,12 @@ require (
216218
golang.org/x/crypto v0.37.0 // indirect
217219
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect
218220
golang.org/x/net v0.39.0 // indirect
219-
golang.org/x/oauth2 v0.26.0 // indirect
221+
golang.org/x/oauth2 v0.27.0 // indirect
220222
golang.org/x/sys v0.32.0 // indirect
221223
golang.org/x/term v0.31.0 // indirect
222224
golang.org/x/text v0.24.0 // indirect
223-
golang.org/x/time v0.9.0 // indirect
224-
google.golang.org/api v0.215.0 // indirect
225+
golang.org/x/time v0.10.0 // indirect
226+
google.golang.org/api v0.222.0 // indirect
225227
google.golang.org/genproto/googleapis/rpc v0.0.0-20250422160041-2d3770c4ea7f // indirect
226228
google.golang.org/protobuf v1.36.6 // indirect
227229
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)