From 68b1815dae830a6e5864bc32012bc1f1b5e89e28 Mon Sep 17 00:00:00 2001 From: Alex Peters Date: Thu, 3 Jul 2025 15:34:42 +0200 Subject: [PATCH 1/2] Removed exection mode --- pkg/adapter/adapter.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/adapter/adapter.go b/pkg/adapter/adapter.go index b204c2b..43f7729 100644 --- a/pkg/adapter/adapter.go +++ b/pkg/adapter/adapter.go @@ -732,6 +732,6 @@ outerLoop: return nil } -func (a *Adapter) GetExecutionMode() execution.ExecutionMode { - return execution.ExecutionModeDelayed -} +//func (a *Adapter) GetExecutionMode() execution.ExecutionMode { +// return execution.ExecutionModeDelayed +//} From ae8ec6b9ec2b1c550cf84608361903a2c2b15ead Mon Sep 17 00:00:00 2001 From: Alex Peters Date: Thu, 3 Jul 2025 16:43:07 +0200 Subject: [PATCH 2/2] x --- go.mod | 47 ++- go.sum | 101 +++---- hack/.gitignore | 3 + hack/README.md | 21 ++ hack/attester/.gitignore | 1 + hack/attester/README.md | 3 + hack/attester/main.go | 544 ++++++++++++++++++++++++++++++++++ hack/download.sh | 101 +++++++ hack/ibc-connection-hermes.sh | 131 ++++++++ hack/ibc-connection-rly.sh | 133 +++++++++ hack/ics20-token-transfer.sh | 166 +++++++++++ hack/init-gaia.sh | 98 ++++++ hack/run_gmd.sh | 147 +++++++++ pkg/adapter/adapter.go | 8 +- server/start.go | 3 + 15 files changed, 1417 insertions(+), 90 deletions(-) create mode 100644 hack/.gitignore create mode 100644 hack/README.md create mode 100644 hack/attester/.gitignore create mode 100644 hack/attester/README.md create mode 100644 hack/attester/main.go create mode 100755 hack/download.sh create mode 100755 hack/ibc-connection-hermes.sh create mode 100755 hack/ibc-connection-rly.sh create mode 100755 hack/ics20-token-transfer.sh create mode 100755 hack/init-gaia.sh create mode 100755 hack/run_gmd.sh diff --git a/go.mod b/go.mod index 5a17336..2550e45 100644 --- a/go.mod +++ b/go.mod @@ -31,10 +31,10 @@ require ( github.com/libp2p/go-libp2p-pubsub v0.14.1 github.com/multiformats/go-multiaddr v0.16.0 github.com/prometheus/client_golang v1.22.0 - github.com/rollkit/rollkit v0.14.2-0.20250630141726-fa03f78d8121 - github.com/rollkit/rollkit/core v0.0.0-20250630141726-fa03f78d8121 - github.com/rollkit/rollkit/da v0.0.0-20250630141726-fa03f78d8121 - github.com/rollkit/rollkit/sequencers/single v0.0.0-20250630141726-fa03f78d8121 + github.com/rollkit/rollkit v0.14.2-0.20250703132945-e191259d4cac + github.com/rollkit/rollkit/core v0.0.0-20250703132945-e191259d4cac + github.com/rollkit/rollkit/da v0.0.0-20250703132945-e191259d4cac + github.com/rollkit/rollkit/sequencers/single v0.0.0-20250703132945-e191259d4cac github.com/rs/cors v1.11.1 github.com/spf13/cobra v1.9.1 github.com/stretchr/testify v1.10.0 @@ -125,7 +125,7 @@ require ( github.com/filecoin-project/go-jsonrpc v0.7.1 // indirect github.com/flynn/noise v1.1.0 // indirect github.com/francoispqt/gojay v1.2.13 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/go-chi/chi/v5 v5.2.2 // indirect @@ -134,6 +134,7 @@ require ( github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect + github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/goccy/go-yaml v1.18.0 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect @@ -158,14 +159,11 @@ require ( github.com/gorilla/websocket v1.5.3 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-plugin v1.6.3 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect @@ -173,10 +171,9 @@ require ( github.com/iancoleman/strcase v0.3.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/ipfs/boxo v0.27.4 // indirect + github.com/ipfs/boxo v0.30.0 // indirect github.com/ipfs/go-cid v0.5.0 // indirect github.com/ipfs/go-ds-badger4 v0.1.8 // indirect - github.com/ipfs/go-log v1.0.5 // indirect github.com/ipld/go-ipld-prime v0.21.0 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect @@ -193,20 +190,19 @@ require ( github.com/libp2p/go-cidranger v1.1.0 // indirect github.com/libp2p/go-flow-metrics v0.2.0 // indirect github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect - github.com/libp2p/go-libp2p-kad-dht v0.29.1 // indirect - github.com/libp2p/go-libp2p-kbucket v0.6.5 // indirect + github.com/libp2p/go-libp2p-kad-dht v0.33.1 // indirect + github.com/libp2p/go-libp2p-kbucket v0.7.0 // indirect github.com/libp2p/go-libp2p-record v0.3.1 // indirect - github.com/libp2p/go-libp2p-routing-helpers v0.7.4 // indirect + github.com/libp2p/go-libp2p-routing-helpers v0.7.5 // indirect github.com/libp2p/go-msgio v0.3.0 // indirect github.com/libp2p/go-netroute v0.2.2 // indirect github.com/libp2p/go-reuseport v0.4.0 // indirect github.com/libp2p/go-yamux/v5 v5.0.0 // indirect github.com/linxGnu/grocksdb v1.8.14 // indirect - github.com/magiconair/properties v1.8.7 // indirect github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/miekg/dns v1.1.64 // indirect + github.com/miekg/dns v1.1.66 // indirect github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect github.com/minio/highwayhash v1.0.3 // indirect @@ -244,9 +240,8 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect github.com/opencontainers/runtime-spec v1.2.1 // indirect - github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect - github.com/pelletier/go-toml/v2 v2.2.2 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pion/datachannel v1.5.10 // indirect github.com/pion/dtls/v2 v2.2.12 // indirect @@ -271,9 +266,9 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/polydawn/refmt v0.89.0 // indirect - github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.63.0 // indirect - github.com/prometheus/procfs v0.16.0 // indirect + github.com/prometheus/procfs v0.16.1 // indirect github.com/quic-go/qpack v0.5.1 // indirect github.com/quic-go/quic-go v0.51.0 // indirect github.com/quic-go/webtransport-go v0.8.1-0.20241018022711-4ac2c9250e66 // indirect @@ -282,18 +277,17 @@ require ( github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/rs/zerolog v1.34.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/sagikazarmark/locafero v0.4.0 // indirect - github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/sagikazarmark/locafero v0.7.0 // indirect github.com/sasha-s/go-deadlock v0.3.5 // indirect github.com/segmentio/asm v1.2.0 // indirect github.com/segmentio/encoding v0.4.1 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/afero v1.12.0 // indirect github.com/spf13/cast v1.7.1 // indirect github.com/spf13/pflag v1.0.6 // indirect - github.com/spf13/viper v1.19.0 // indirect + github.com/spf13/viper v1.20.1 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect @@ -334,14 +328,13 @@ require ( golang.org/x/text v0.26.0 // indirect golang.org/x/tools v0.33.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect - gonum.org/v1/gonum v0.15.1 // indirect - google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + gonum.org/v1/gonum v0.16.0 // indirect + google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect - gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.2 // indirect - lukechampine.com/blake3 v1.4.0 // indirect + lukechampine.com/blake3 v1.4.1 // indirect nhooyr.io/websocket v1.8.6 // indirect pgregory.net/rapid v1.1.0 // indirect pluginrpc.com/pluginrpc v0.5.0 // indirect diff --git a/go.sum b/go.sum index c40f4e9..17d9f7f 100644 --- a/go.sum +++ b/go.sum @@ -323,8 +323,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= @@ -374,6 +374,8 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= @@ -513,8 +515,6 @@ github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NM github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= -github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= @@ -526,8 +526,6 @@ github.com/hashicorp/go-metrics v0.5.4 h1:8mmPiIJkTPPEbAiV97IxdAGNdRdaWwVap1BU6e github.com/hashicorp/go-metrics v0.5.4/go.mod h1:CG5yz4NZ/AI/aQt9Ucm/vdBnbh7fvmv4lxZ350i+QQI= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.6.3 h1:xgHB+ZUSYeuJi96WtxEjzi23uh7YQpznjGh0U0UUrwg= github.com/hashicorp/go-plugin v1.6.3/go.mod h1:MRobyh+Wc/nYy1V4KAXUiYfzxoYhs7V1mlH1Z7iY2h0= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= @@ -545,8 +543,6 @@ github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iP github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= @@ -572,8 +568,8 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/ipfs/boxo v0.27.4 h1:6nC8lY5GnR6whAbW88hFz6L13wZUj2vr5BRe3iTvYBI= -github.com/ipfs/boxo v0.27.4/go.mod h1:qEIRrGNr0bitDedTCzyzBHxzNWqYmyuHgK8LG9Q83EM= +github.com/ipfs/boxo v0.30.0 h1:7afsoxPGGqfoH7Dum/wOTGUB9M5fb8HyKPMlLfBvIEQ= +github.com/ipfs/boxo v0.30.0/go.mod h1:BPqgGGyHB9rZZcPSzah2Dc9C+5Or3U1aQe7EH1H7370= github.com/ipfs/go-block-format v0.2.0 h1:ZqrkxBA2ICbDRbK8KJs/u0O3dlp6gmAuuXUJNiW1Ycs= github.com/ipfs/go-block-format v0.2.0/go.mod h1:+jpL11nFx5A/SPpsoBn6Bzkra/zaArfSmsknbPMYgzM= github.com/ipfs/go-cid v0.5.0 h1:goEKKhaGm0ul11IHA7I6p1GmKz8kEYniqFopaB5Otwg= @@ -586,13 +582,10 @@ github.com/ipfs/go-ds-badger4 v0.1.8 h1:frNczf5CjCVm62RJ5mW5tD/oLQY/9IKAUpKviRV9 github.com/ipfs/go-ds-badger4 v0.1.8/go.mod h1:FdqSLA5TMsyqooENB/Hf4xzYE/iH0z/ErLD6ogtfMrA= github.com/ipfs/go-ipfs-util v0.0.3 h1:2RFdGez6bu2ZlZdI+rWfIdbQb1KudQp3VGwPtdNCmE0= github.com/ipfs/go-ipfs-util v0.0.3/go.mod h1:LHzG1a0Ig4G+iZ26UUOMjHd+lfM84LZCrn17xAKWBvs= -github.com/ipfs/go-log v1.0.5 h1:2dOuUCB1Z7uoczMWgAyDck5JLb72zHzrMnGnCNNbvY8= -github.com/ipfs/go-log v1.0.5/go.mod h1:j0b8ZoR+7+R99LD9jZ6+AJsrzkPbSXbZfGakb5JPtIo= -github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= github.com/ipfs/go-log/v2 v2.6.0 h1:2Nu1KKQQ2ayonKp4MPo6pXCjqw1ULc9iohRqWV5EYqg= github.com/ipfs/go-log/v2 v2.6.0/go.mod h1:p+Efr3qaY5YXpx9TX7MoLCSEZX5boSWj9wh86P5HJa8= -github.com/ipfs/go-test v0.0.4 h1:DKT66T6GBB6PsDFLoO56QZPrOmzJkqU1FZH5C9ySkew= -github.com/ipfs/go-test v0.0.4/go.mod h1:qhIM1EluEfElKKM6fnWxGn822/z9knUGM1+I/OAQNKI= +github.com/ipfs/go-test v0.2.1 h1:/D/a8xZ2JzkYqcVcV/7HYlCnc7bv/pKHQiX5TdClkPE= +github.com/ipfs/go-test v0.2.1/go.mod h1:dzu+KB9cmWjuJnXFDYJwC25T3j1GcN57byN+ixmK39M= github.com/ipld/go-ipld-prime v0.21.0 h1:n4JmcpOlPDIxBcY037SVfpd1G+Sj1nKZah0m6QH9C2E= github.com/ipld/go-ipld-prime v0.21.0/go.mod h1:3RLqy//ERg/y5oShXXdx5YIp50cFGOanyMctpPjsvxQ= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= @@ -669,16 +662,16 @@ github.com/libp2p/go-libp2p v0.41.1 h1:8ecNQVT5ev/jqALTvisSJeVNvXYJyK4NhQx1nNRXQ github.com/libp2p/go-libp2p v0.41.1/go.mod h1:DcGTovJzQl/I7HMrby5ZRjeD0kQkGiy+9w6aEkSZpRI= github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl950SO9L6n94= github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8= -github.com/libp2p/go-libp2p-kad-dht v0.29.1 h1:RyD1RnnkXOh1gwBCrMQ6ZVfTJECY5yDOY6qxt9VNqE4= -github.com/libp2p/go-libp2p-kad-dht v0.29.1/go.mod h1:tZEFTKWCsY0xngypKyAIwNDNZOBiikSUIgd/BjTF5Ms= -github.com/libp2p/go-libp2p-kbucket v0.6.5 h1:Fsl1YvZcMwqrR4DYrTO02yo9PGYs2HBQIT3lGXFMTxg= -github.com/libp2p/go-libp2p-kbucket v0.6.5/go.mod h1:U6WOd0BvnSp03IQSrjgM54tg7zh1UUNsXLJqAQzClTA= +github.com/libp2p/go-libp2p-kad-dht v0.33.1 h1:hKFhHMf7WH69LDjaxsJUWOU6qZm71uO47M/a5ijkiP0= +github.com/libp2p/go-libp2p-kad-dht v0.33.1/go.mod h1:CdmNk4VeGJa9EXM9SLNyNVySEvduKvb+5rSC/H4pLAo= +github.com/libp2p/go-libp2p-kbucket v0.7.0 h1:vYDvRjkyJPeWunQXqcW2Z6E93Ywx7fX0jgzb/dGOKCs= +github.com/libp2p/go-libp2p-kbucket v0.7.0/go.mod h1:blOINGIj1yiPYlVEX0Rj9QwEkmVnz3EP8LK1dRKBC6g= github.com/libp2p/go-libp2p-pubsub v0.14.1 h1:XK/rPKZKhPvRrtsjvfwrOZPnQQbGLmaEg7u6qnJfn8U= github.com/libp2p/go-libp2p-pubsub v0.14.1/go.mod h1:MKPU5vMI8RRFyTP0HfdsF9cLmL1nHAeJm44AxJGJx44= github.com/libp2p/go-libp2p-record v0.3.1 h1:cly48Xi5GjNw5Wq+7gmjfBiG9HCzQVkiZOUZ8kUl+Fg= github.com/libp2p/go-libp2p-record v0.3.1/go.mod h1:T8itUkLcWQLCYMqtX7Th6r7SexyUJpIyPgks757td/E= -github.com/libp2p/go-libp2p-routing-helpers v0.7.4 h1:6LqS1Bzn5CfDJ4tzvP9uwh42IB7TJLNFJA6dEeGBv84= -github.com/libp2p/go-libp2p-routing-helpers v0.7.4/go.mod h1:we5WDj9tbolBXOuF1hGOkR+r7Uh1408tQbAKaT5n1LE= +github.com/libp2p/go-libp2p-routing-helpers v0.7.5 h1:HdwZj9NKovMx0vqq6YNPTh6aaNzey5zHD7HeLJtq6fI= +github.com/libp2p/go-libp2p-routing-helpers v0.7.5/go.mod h1:3YaxrwP0OBPDD7my3D0KxfR89FlcX/IEbxDEDfAmj98= github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA= github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg= github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0= @@ -720,8 +713,8 @@ github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.64 h1:wuZgD9wwCE6XMT05UU/mlSko71eRSXEAm2EbjQXLKnQ= -github.com/miekg/dns v1.1.64/go.mod h1:Dzw9769uoKVaLuODMDZz9M6ynFU6Em65csPuoi8G0ck= +github.com/miekg/dns v1.1.66 h1:FeZXOS3VCVsKnEAd+wBkjMC3D2K+ww66Cq3VnCINuJE= +github.com/miekg/dns v1.1.66/go.mod h1:jGFzBsSNbJw6z1HYut1RKBKHA9PBdxeHrZG8J+gC2WE= github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c h1:bzE/A84HN25pxAuk9Eej1Kz9OUelF97nAc82bDquQI8= github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c/go.mod h1:0SQS9kMwD2VsyFEB++InYyBJroV/FRmBgcydeSUcJms= github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b h1:z78hV3sbSMAUoyUMM0I83AUIT6Hu17AWfgjzIbtrYFc= @@ -864,8 +857,6 @@ github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= @@ -880,8 +871,8 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= -github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= @@ -963,8 +954,8 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1: github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= +github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -983,8 +974,8 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.16.0 h1:xh6oHhKwnOJKMYiYBDWmkHqQPyiY40sny36Cmx2bbsM= -github.com/prometheus/procfs v0.16.0/go.mod h1:8veyXUu3nGP7oaCxhX6yeaM5u4stL2FeMXnCqhDthZg= +github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg= +github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI= github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg= github.com/quic-go/quic-go v0.51.0 h1:K8exxe9zXxeRKxaXxi/GpUqYiTrtdiWP8bo1KFya6Wc= @@ -1002,14 +993,14 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= -github.com/rollkit/rollkit v0.14.2-0.20250630141726-fa03f78d8121 h1:CDTRFiNOkYoYwH7kp8vBlA508wmqYvIex7uheD1HonM= -github.com/rollkit/rollkit v0.14.2-0.20250630141726-fa03f78d8121/go.mod h1:voFC1cTCp9osZRb7DWeLLWLAtRI0DWiWoXdpaS5DkeA= -github.com/rollkit/rollkit/core v0.0.0-20250630141726-fa03f78d8121 h1:hZd7CBZXDadofPmmYcnRJF++EgA0UFKcM9B/aukPrJA= -github.com/rollkit/rollkit/core v0.0.0-20250630141726-fa03f78d8121/go.mod h1:0RhbqC8Is970KRhr6zPUQOZkmKt6/WqPRDQWfd2P7P0= -github.com/rollkit/rollkit/da v0.0.0-20250630141726-fa03f78d8121 h1:XDUT6BWc6j/5FV8Gv2iq3AzaPFIFb8pSLabetiAx3KA= -github.com/rollkit/rollkit/da v0.0.0-20250630141726-fa03f78d8121/go.mod h1:oiubohaox9z/Zl5lopu5nXySOIoMtFPJUdrBrlzHIDs= -github.com/rollkit/rollkit/sequencers/single v0.0.0-20250630141726-fa03f78d8121 h1:cPzpb7Ne2lohk8QmvsBHrQ4JRBXo0RmzgYske6SwtDQ= -github.com/rollkit/rollkit/sequencers/single v0.0.0-20250630141726-fa03f78d8121/go.mod h1:xu+rEtcXynLSwB7u/jnNsRiBwmxCLhP3cjH+tEBOAvc= +github.com/rollkit/rollkit v0.14.2-0.20250703132945-e191259d4cac h1:sL+Qcxbjm3Gqaj7usmChWJqbBTZ7S4jYqq2JmS9kBK4= +github.com/rollkit/rollkit v0.14.2-0.20250703132945-e191259d4cac/go.mod h1:RXYW7SkD5sGpA6RpgNrRtZo9UnoOMNKYkffS37Utn+Y= +github.com/rollkit/rollkit/core v0.0.0-20250703132945-e191259d4cac h1:z0FkzJCSL4QfNKcCP5LcPcEBhZxVh1spF8DwrYBM4ac= +github.com/rollkit/rollkit/core v0.0.0-20250703132945-e191259d4cac/go.mod h1:0RhbqC8Is970KRhr6zPUQOZkmKt6/WqPRDQWfd2P7P0= +github.com/rollkit/rollkit/da v0.0.0-20250703132945-e191259d4cac h1:javMdMHVDTqzWhU7eky06dqf2ZZGOLxmYg+Ac28O7QE= +github.com/rollkit/rollkit/da v0.0.0-20250703132945-e191259d4cac/go.mod h1:oiubohaox9z/Zl5lopu5nXySOIoMtFPJUdrBrlzHIDs= +github.com/rollkit/rollkit/sequencers/single v0.0.0-20250703132945-e191259d4cac h1:+hf9Mxo28MRlW4avG+eNzJE28ejuCma5wyTXYMStiq0= +github.com/rollkit/rollkit/sequencers/single v0.0.0-20250703132945-e191259d4cac/go.mod h1:BXo3oPT5TDgrHNuG7HntzR+jCDYctYpAtkQx0BlyARg= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -1021,10 +1012,8 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= -github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= -github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= -github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/sagikazarmark/locafero v0.7.0 h1:5MqpDsTGNDhY8sGp0Aowyf0qKsPrhewaLSsFaodPcyo= +github.com/sagikazarmark/locafero v0.7.0/go.mod h1:2za3Cg5rMaTMoG/2Ulr9AwtFaIppKXTRYnozin4aB5k= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= @@ -1077,8 +1066,8 @@ github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIK github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= -github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= +github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= @@ -1088,8 +1077,8 @@ github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= -github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= +github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4= +github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1113,7 +1102,6 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= @@ -1202,7 +1190,6 @@ go.opentelemetry.io/proto/otlp v1.6.0/go.mod h1:cicgGehlFuNdgZkcALOCh3VE6K/u2tAj go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= @@ -1217,14 +1204,12 @@ go.uber.org/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko= go.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= @@ -1468,8 +1453,8 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0= -gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o= +gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= +gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= @@ -1492,8 +1477,8 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= -google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 h1:ToEetK57OidYuqD4Q5w+vfEnPvPpuTwedCNVohYJfNk= +google.golang.org/genproto v0.0.0-20241118233622-e639e219e697/go.mod h1:JJrvXBWRZaFMxBufik1a4RpFw4HhgVtBBWQeQgUj2cc= google.golang.org/genproto/googleapis/api v0.0.0-20250505200425-f936aa4a68b2 h1:vPV0tzlsK6EzEDHNNH5sa7Hs9bd7iXR7B1tSiPepkV0= google.golang.org/genproto/googleapis/api v0.0.0-20250505200425-f936aa4a68b2/go.mod h1:pKLAc5OolXC3ViWGI62vvC0n10CpwAtRcTNCFwTKBEw= google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a h1:v2PbRU4K3llS09c7zodFpNePeamkAwG3mPrAery9VeE= @@ -1548,8 +1533,6 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= -gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1576,8 +1559,8 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -lukechampine.com/blake3 v1.4.0 h1:xDbKOZCVbnZsfzM6mHSYcGRHZ3YrLDzqz8XnV4uaD5w= -lukechampine.com/blake3 v1.4.0/go.mod h1:MQJNQCTnR+kwOP/JEZSxj3MaQjp80FOFSNMMHXcSeX0= +lukechampine.com/blake3 v1.4.1 h1:I3Smz7gso8w4/TunLKec6K2fn+kyKtDxr/xcQEN84Wg= +lukechampine.com/blake3 v1.4.1/go.mod h1:QFosUxmjB8mnrWFSNwKmvxHpfY72bmD2tQ0kBMM3kwo= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= diff --git a/hack/.gitignore b/hack/.gitignore new file mode 100644 index 0000000..934e3e0 --- /dev/null +++ b/hack/.gitignore @@ -0,0 +1,3 @@ +downloads/ +testnet/ +config/ diff --git a/hack/README.md b/hack/README.md new file mode 100644 index 0000000..7a15364 --- /dev/null +++ b/hack/README.md @@ -0,0 +1,21 @@ +# Hack + +Local test scripts + +## Requirements + +* `gaiad` + `hermes` app are available. Use `download.sh` script to fetch +* Rollkit example app `gmd` is built with network integration and available in the path +* `local-da` is built and located in `../../rollkit/build/local-da` + +## Run local setup + +```shell +./init-gaia.sh # setup and start gaia app +./run_node.sh # setup and start gmd example app + local da + +go run ./attester --chain-id=rollkitnet-1 --home=$(pwd)/testnet/gm --mnemonic="abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art" --verbose + +./ibc-connection-hermes.sh # relayer +./ics20-token-transfer.sh # token transfer +``` diff --git a/hack/attester/.gitignore b/hack/attester/.gitignore new file mode 100644 index 0000000..b26c9b0 --- /dev/null +++ b/hack/attester/.gitignore @@ -0,0 +1 @@ +/attester diff --git a/hack/attester/README.md b/hack/attester/README.md new file mode 100644 index 0000000..88b97b5 --- /dev/null +++ b/hack/attester/README.md @@ -0,0 +1,3 @@ +# Attest everything attester + +little helper that pulls new blocks from the rpc node and submits (fake) attestations after each epoch diff --git a/hack/attester/main.go b/hack/attester/main.go new file mode 100644 index 0000000..452e9fa --- /dev/null +++ b/hack/attester/main.go @@ -0,0 +1,544 @@ +package main + +import ( + "bytes" + "context" + "encoding/hex" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "os" + "os/signal" + "path/filepath" + "strconv" + "syscall" + "time" + + pvm "github.com/cometbft/cometbft/privval" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + "github.com/cosmos/cosmos-sdk/std" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/gogoproto/proto" + "github.com/spf13/cobra" + + networktypes "github.com/rollkit/go-execution-abci/modules/network/types" +) + +const ( + flagChainID = "chain-id" + flagNode = "node" + flagAPIAddr = "api-addr" + flagHome = "home" + flagVerbose = "verbose" + flagMnemonic = "mnemonic" +) + +func main() { + rootCmd := &cobra.Command{ + Use: "attester_ws", + Short: "Attester client for Rollkit using websocket", + Long: `Attester client for Rollkit that joins the attester set and attests to blocks at the end of each epoch.`, + DisableFlagParsing: false, + SuggestionsMinimumDistance: 2, + RunE: runAttester, + } + + // Add flags + rootCmd.Flags().String(flagChainID, "", "Chain ID of the blockchain") + rootCmd.Flags().String(flagNode, "tcp://localhost:26657", "RPC node address") + rootCmd.Flags().String(flagAPIAddr, "http://localhost:1317", "API node address") + rootCmd.Flags().String(flagHome, "", "Directory for config and data") + rootCmd.Flags().Bool(flagVerbose, false, "Enable verbose output") + rootCmd.Flags().String(flagMnemonic, "", "Mnemonic for the private key") + + _ = rootCmd.MarkFlagRequired(flagChainID) + _ = rootCmd.MarkFlagRequired(flagMnemonic) + + // Execute + if err := rootCmd.Execute(); err != nil { + fmt.Println(err) + os.Exit(1) + } +} + +func runAttester(cmd *cobra.Command, args []string) error { + chainID, err := cmd.Flags().GetString(flagChainID) + if err != nil { + return err + } + + node, err := cmd.Flags().GetString(flagNode) + if err != nil { + return err + } + apiAddr, err := cmd.Flags().GetString(flagAPIAddr) + if err != nil { + return err + } + + home, err := cmd.Flags().GetString(flagHome) + if err != nil { + return err + } + + verbose, err := cmd.Flags().GetBool(flagVerbose) + if err != nil { + return err + } + + mnemonic, err := cmd.Flags().GetString(flagMnemonic) + if err != nil { + return err + } + + // Create context with cancellation + ctx, cancel := context.WithCancel(cmd.Context()) + defer cancel() + + config := sdk.GetConfig() + config.SetBech32PrefixForAccount("gm", "gmpub") + config.SetBech32PrefixForValidator("gmvaloper", "gmvaloperpub") + config.Seal() + + // Create the sender key from the mnemonic + senderKey, err := createPrivateKeyFromMnemonic(mnemonic) + if err != nil { + return fmt.Errorf("failed to create private key from mnemonic: %w", err) + } + + // Get the account address from the private key + pubKey := senderKey.PubKey() + valAddr := sdk.ValAddress(pubKey.Address()) + + if verbose { + addr := sdk.AccAddress(pubKey.Address()) + fmt.Printf("Sender Account address: %s\n", addr.String()) + fmt.Printf("Sender Validator address: %s\n", valAddr.String()) + } + + pv := pvm.LoadOrGenFilePV(filepath.Join(home, "config", "priv_validator_key.json"), filepath.Join(home, "data", "priv_validator_state.json")) + + // Handle OS signals for graceful shutdown + sigCh := make(chan os.Signal, 1) + signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM) + go func() { + <-sigCh + fmt.Println("Received signal, shutting down...") + cancel() + }() + + // Step 1: Join attester set + fmt.Println("Joining attester set...") + if err := joinAttesterSet(ctx, chainID, node, verbose, valAddr, senderKey, pv); err != nil { + return fmt.Errorf("join attester set: %w", err) + } + + // Step 2: Query network parameters to get epoch length + fmt.Println("Querying network parameters...") + epochLength, err := getEpochLength(apiAddr) + if err != nil { + return fmt.Errorf("get epoch length: %w", err) + } + fmt.Printf("Epoch length: %d blocks\n", epochLength) + + // Get validator address from private key + valAccAddr := sdk.AccAddress(senderKey.PubKey().Address()) + + // Step 3 & 4: Watch new block events via websocket and attest at the end of each epoch + fmt.Println("Starting to watch for new blocks...") + if err := pullBlocksAndAttest(ctx, chainID, node, home, epochLength, valAccAddr.Bytes(), verbose, senderKey, pv); err != nil { + return fmt.Errorf("error watching blocks: %w", err) + } + + return nil +} + +// joinAttesterSet creates and submits a MsgJoinAttesterSet transaction +func joinAttesterSet(ctx context.Context, chainID, node string, verbose bool, valAddr sdk.ValAddress, privKey *secp256k1.PrivKey, pv *pvm.FilePV) error { + if verbose { + fmt.Printf("Using validator address: %s\n", valAddr.String()) + } + + // Create the message + msg := networktypes.NewMsgJoinAttesterSet(valAddr.String()) + + // Broadcast the transaction + txHash, err := broadcastTx(ctx, chainID, node, msg, privKey, verbose) + if err != nil { + return fmt.Errorf("broadcast join attester set tx: %w", err) + } + + fmt.Printf("Successfully joined attester set. Tx hash: %s\n", txHash) + return nil +} + +// getEpochLength queries the network parameters to get the epoch length +func getEpochLength(apiAddr string) (uint64, error) { + // Create a simple HTTP client to query the node + httpClient := &http.Client{ + Timeout: 10 * time.Second, + } + + // Get epoch parameters + paramsResp, err := httpClient.Get(fmt.Sprintf("%s/rollkit/network/v1/params", apiAddr)) + if err != nil { + return 0, fmt.Errorf("error getting params: %w", err) + } + defer paramsResp.Body.Close() //nolint:errcheck // test code + + var paramsResult struct { + Params struct { + EpochLength string `json:"epoch_length"` + } `json:"params"` + } + var buf bytes.Buffer + + if err := json.NewDecoder(io.TeeReader(paramsResp.Body, &buf)).Decode(¶msResult); err != nil { + return 0, fmt.Errorf("error decoding params: %w: got %s", err, buf.String()) + } + + epochLength, err := strconv.ParseUint(paramsResult.Params.EpochLength, 10, 64) + if err != nil { + return 0, fmt.Errorf("epoch length: %w", err) + } + if epochLength == 0 { + return 0, fmt.Errorf("epoch length is 0") + } + + return epochLength, nil +} + +// pullBlocksAndAttest polls for new blocks via HTTP and attests at the end of each epoch +func pullBlocksAndAttest( + ctx context.Context, + chainID, node, home string, + epochLength uint64, + valAddr sdk.ValAddress, + verbose bool, + senderKey *secp256k1.PrivKey, + pv *pvm.FilePV, +) error { + // Parse node URL + parsed, err := url.Parse(node) + if err != nil { + return fmt.Errorf("parse node URL: %w", err) + } + + httpClient := &http.Client{ + Timeout: 10 * time.Second, + } + + var lastAttested int64 = 0 + + // Poll for new blocks + for { + select { + case <-ctx.Done(): + return nil + default: + // Query latest block + resp, err := httpClient.Get(fmt.Sprintf("http://%s/block", parsed.Host)) + if err != nil { + fmt.Printf("Error querying block: %v\n", err) + time.Sleep(time.Second / 10) + continue + } + + var blockResponse struct { + Result struct { + Block struct { + Header struct { + Height string `json:"height"` + AppHash string `json:"app_hash"` + } `json:"header"` + } `json:"block"` + } `json:"result"` + } + + var buf bytes.Buffer + if err := json.NewDecoder(io.TeeReader(resp.Body, &buf)).Decode(&blockResponse); err != nil { + fmt.Printf("Error parsing response: %v: %s\n", err, buf.String()) + _ = resp.Body.Close() + time.Sleep(time.Second / 10) + continue + } + _ = resp.Body.Close() + + // Extract block height + height, err := strconv.ParseInt(blockResponse.Result.Block.Header.Height, 10, 64) + if err != nil { + fmt.Printf("Error parsing height: %v\n", err) + time.Sleep(time.Second / 10) + continue + } + + fmt.Printf("Current block: %d\n", height) + + // Check if this is the end of an epoch and we haven't attested to it yet + if height > 1 && height%int64(epochLength) == 0 && height > lastAttested { + fmt.Printf("End of epoch at height %d, submitting attestation\n", height) + + // Submit attestation with the block's app hash + appHash, err := hex.DecodeString(blockResponse.Result.Block.Header.AppHash) + if err != nil { + return fmt.Errorf("decoding app hash: %w", err) + } + err = submitAttestation(ctx, chainID, node, home, height, appHash, valAddr, verbose, senderKey, pv) + if err != nil { + return fmt.Errorf("submitting attestation: %w", err) + } + + lastAttested = height + } + + // Wait before next poll + time.Sleep(time.Second / 10) + } + } +} + +// formatCommandArgs formats command arguments for verbose output +func formatCommandArgs(args []string) string { + var result string + for i, arg := range args { + if i > 0 { + result += " " + } + // Add quotes if the argument contains spaces + if containsSpace(arg) { + result += "\"" + arg + "\"" + } else { + result += arg + } + } + return result +} + +// containsSpace checks if a string contains any space character +func containsSpace(s string) bool { + for _, c := range s { + if c == ' ' || c == '\t' || c == '\n' || c == '\r' { + return true + } + } + return false +} + +// broadcastTx executes a command to broadcast a transaction using the Cosmos SDK +func broadcastTx(ctx context.Context, chainID, nodeAddr string, msg proto.Message, privKey *secp256k1.PrivKey, verbose bool) (string, error) { + // Get validator address from private key + valAddr := sdk.ValAddress(privKey.PubKey().Address()) + + if verbose { + fmt.Printf("Broadcasting transaction for validator: %s\n", valAddr.String()) + } + + // Initialize the transaction config with the proper codec and sign modes + interfaceRegistry := codectypes.NewInterfaceRegistry() + authtypes.RegisterInterfaces(interfaceRegistry) + std.RegisterInterfaces(interfaceRegistry) + protoCodec := codec.NewProtoCodec(interfaceRegistry) + txConfig := authtx.NewTxConfig(protoCodec, authtx.DefaultSignModes) + + // Create proper transaction + txBuilder := txConfig.NewTxBuilder() + err := txBuilder.SetMsgs(msg) + if err != nil { + return "", fmt.Errorf("setting messages: %w", err) + } + + txBuilder.SetGasLimit(200000) + txBuilder.SetFeeAmount(sdk.NewCoins()) + txBuilder.SetMemo("") + // Get account info from node + clientCtx, err := createClientContext(nodeAddr, chainID, txConfig) + if err != nil { + return "", fmt.Errorf("creating client context: %w", err) + } + clientCtx = clientCtx.WithInterfaceRegistry(interfaceRegistry).WithCodec(protoCodec) + addr := sdk.AccAddress(privKey.PubKey().Address()) + accountRetriever := authtypes.AccountRetriever{} + account, err := accountRetriever.GetAccount(clientCtx, addr) + if err != nil { + return "", fmt.Errorf("getting account: %w", err) + } + fmt.Printf("+++ chainid: %s, GetAccountNumber: %d\n", chainID, account.GetAccountNumber()) + // Sign transaction using account sequence + accSeq := account.GetSequence() + signerData := authsigning.SignerData{ + Address: addr.String(), + ChainID: chainID, + AccountNumber: account.GetAccountNumber(), + Sequence: accSeq, + PubKey: privKey.PubKey(), + } + + // For SIGN_MODE_DIRECT, we need to set a nil signature first + // to generate the correct sign bytes + sigData := signing.SingleSignatureData{ + SignMode: signing.SignMode_SIGN_MODE_DIRECT, + Signature: nil, + } + sig := signing.SignatureV2{ + PubKey: privKey.PubKey(), + Data: &sigData, + Sequence: accSeq, + } + + err = txBuilder.SetSignatures(sig) + if err != nil { + return "", fmt.Errorf("setting nil signatures: %w", err) + } + + // Now get the bytes to sign and create the real signature + signBytes, err := authsigning.GetSignBytesAdapter( + ctx, + txConfig.SignModeHandler(), + signing.SignMode_SIGN_MODE_DIRECT, + signerData, + txBuilder.GetTx(), + ) + if err != nil { + return "", fmt.Errorf("getting sign bytes: %w", err) + } + + // Sign those bytes + signature, err := privKey.Sign(signBytes) + if err != nil { + return "", fmt.Errorf("signing bytes: %w", err) + } + + // Construct the SignatureV2 struct with the actual signature + sigData = signing.SingleSignatureData{ + SignMode: signing.SignMode_SIGN_MODE_DIRECT, + Signature: signature, + } + sig = signing.SignatureV2{ + PubKey: privKey.PubKey(), + Data: &sigData, + Sequence: accSeq, + } + + err = txBuilder.SetSignatures(sig) + if err != nil { + return "", fmt.Errorf("setting signatures: %w", err) + } + + txBytes, err := txConfig.TxEncoder()(txBuilder.GetTx()) + if err != nil { + return "", fmt.Errorf("encoding transaction: %w", err) + } + + // Set broadcast mode to sync + clientCtx = clientCtx.WithBroadcastMode("sync") + + // Broadcast the transaction using the cosmos-sdk library + resp, err := clientCtx.BroadcastTx(txBytes) + if err != nil { + return "", fmt.Errorf("broadcasting transaction: %w", err) + } + + // Check if the transaction was successful + if resp.Code != 0 { + return "", fmt.Errorf("transaction failed with code %d: %s", resp.Code, resp.RawLog) + } + + if verbose { + fmt.Printf("Transaction successful with hash: %s\n", resp.TxHash) + } + + return resp.TxHash, nil +} + +// createClientContext creates a client.Context with the necessary fields for broadcasting transactions +func createClientContext(nodeAddr, chainID string, txConfig client.TxConfig) (client.Context, error) { + // Create a CometRPC client + rpcClient, err := client.NewClientFromNode(nodeAddr) + if err != nil { + return client.Context{}, fmt.Errorf("creating RPC client: %w", err) + } + + // Create a client.Context with the necessary fields + clientCtx := client.Context{ + Client: rpcClient, + ChainID: chainID, + TxConfig: txConfig, + BroadcastMode: "sync", + Output: os.Stdout, + AccountRetriever: authtypes.AccountRetriever{}, + } + + return clientCtx, nil +} + +// createPrivateKeyFromMnemonic derives a private key from a mnemonic using the standard +// BIP44 HD path (m/44'/118'/0'/0/0) +func createPrivateKeyFromMnemonic(mnemonic string) (*secp256k1.PrivKey, error) { + // Create master key from mnemonic + derivedPriv, err := hd.Secp256k1.Derive()( + mnemonic, + "", + hd.CreateHDPath(118, 0, 0).String(), // Cosmos HD path + ) + if err != nil { + return nil, fmt.Errorf("failed to derive private key: %w", err) + } + return &secp256k1.PrivKey{Key: derivedPriv}, nil +} + +// submitAttestation creates and submits an attestation for a block using direct RPC +func submitAttestation( + ctx context.Context, + chainID, node, home string, + height int64, + appHash []byte, + valAddr sdk.ValAddress, + verbose bool, + senderKey *secp256k1.PrivKey, + pv *pvm.FilePV, +) error { + // Create the vote + vote := &cmtproto.Vote{ + Type: cmtproto.PrecommitType, + ValidatorAddress: pv.GetAddress(), + Height: height, + Round: 0, + BlockID: cmtproto.BlockID{Hash: appHash, PartSetHeader: cmtproto.PartSetHeader{Total: 1, Hash: appHash}}, + Timestamp: time.Now(), + } + var err error + err = pv.SignVote(chainID, vote) + if err != nil { + return fmt.Errorf("sign vote: %w", err) + } + + voteBytes, err := proto.Marshal(vote) + if err != nil { + return fmt.Errorf("marshal vote: %w", err) + } + + msg := networktypes.NewMsgAttest( + valAddr.String(), + height, + voteBytes, + ) + + txHash, err := broadcastTx(ctx, chainID, node, msg, senderKey, verbose) + if err != nil { + return fmt.Errorf("broadcast attest tx: %w", err) + } + + fmt.Printf("Attestation submitted with hash: %s\n", txHash) + return nil +} diff --git a/hack/download.sh b/hack/download.sh new file mode 100755 index 0000000..5f30eaa --- /dev/null +++ b/hack/download.sh @@ -0,0 +1,101 @@ +#!/bin/bash + + +HERMES_VERSION=${1:-"v1.13.1"} +GAIAD_VERSION=${2:-"v24.0.0"} +COSMOS_RELAYER_VERSION=${3:-"v2.6.0"} + +ARCH=$(uname -m) +OS=$(uname -s) + +case "$ARCH" in + "arm64") + ARCH_LABEL="aarch64" + ;; + "x86_64") + ARCH_LABEL="x86_64" + ;; + *) + echo "Unsupported architecture: $ARCH" + exit 1 + ;; +esac + +case "$OS" in + "Darwin") + OS_LABEL="apple-darwin" + ;; + "Linux") + OS_LABEL="unknown-linux-gnu" + ;; + *) + echo "Unsupported operating system: $OS" + exit 1 + ;; +esac + +HERMES_URL="https://github.com/informalsystems/hermes/releases/download/$HERMES_VERSION/hermes-$HERMES_VERSION-${ARCH_LABEL}-${OS_LABEL}.tar.gz" +GAIAD_URL="https://github.com/cosmos/gaia/releases/download/$GAIAD_VERSION/gaiad-$GAIAD_VERSION-darwin-$ARCH" + +# For Cosmos Relayer, we need to map the architecture differently +COSMOS_RELAYER_ARCH="amd64" +if [ "$ARCH" == "arm64" ]; then + COSMOS_RELAYER_ARCH="arm64" +fi + +COSMOS_RELAYER_OS="linux" +if [ "$OS" == "Darwin" ]; then + COSMOS_RELAYER_OS="darwin" +fi + +COSMOS_RELAYER_URL="https://github.com/cosmos/relayer/releases/download/$COSMOS_RELAYER_VERSION/Cosmos.Relayer_${COSMOS_RELAYER_VERSION#v}_${COSMOS_RELAYER_OS}_${COSMOS_RELAYER_ARCH}.tar.gz" + +if [ "$OS" == "Linux" ]; then + GAIAD_URL="https://github.com/cosmos/gaia/releases/download/$GAIAD_VERSION/gaiad-$GAIAD_VERSION-linux-amd64" +fi + +# Define output directories +DOWNLOAD_DIR="./downloads" +mkdir -p "$DOWNLOAD_DIR" + +# Function to download a file +download_file() { + local url=$1 + local output_path=$2 + + echo "Downloading: $url" + curl -L -o "$output_path" "$url" + if [ $? -ne 0 ]; then + echo "Failed to download $url" + exit 1 + fi +} + +# Download hermes +HERMES_ARCHIVE="$DOWNLOAD_DIR/hermes.tar.gz" +download_file "$HERMES_URL" "$HERMES_ARCHIVE" + +# Extract hermes if tar.gz +if [[ "$HERMES_ARCHIVE" == *.tar.gz ]]; then + echo "Extracting: $HERMES_ARCHIVE" + tar -xzvf "$HERMES_ARCHIVE" -C "$DOWNLOAD_DIR" +elif [[ "$HERMES_ARCHIVE" == *.zip ]]; then + echo "Extracting: $HERMES_ARCHIVE" + unzip "$HERMES_ARCHIVE" -d "$DOWNLOAD_DIR" +fi + +GAIAD_BINARY="$DOWNLOAD_DIR/gaiad" +download_file "$GAIAD_URL" "$GAIAD_BINARY" + +# Make gaiad binary executable +chmod +x "$GAIAD_BINARY" + +# Download Cosmos Relayer +COSMOS_RELAYER_ARCHIVE="$DOWNLOAD_DIR/cosmos-relayer.tar.gz" +download_file "$COSMOS_RELAYER_URL" "$COSMOS_RELAYER_ARCHIVE" + +# Extract Cosmos Relayer +echo "Extracting: $COSMOS_RELAYER_ARCHIVE" +tar -xzvf "$COSMOS_RELAYER_ARCHIVE" --strip-components=1 -C "$DOWNLOAD_DIR" + +echo "Hermes, Gaiad, and Cosmos Relayer downloaded successfully to $DOWNLOAD_DIR" diff --git a/hack/ibc-connection-hermes.sh b/hack/ibc-connection-hermes.sh new file mode 100755 index 0000000..5625e8a --- /dev/null +++ b/hack/ibc-connection-hermes.sh @@ -0,0 +1,131 @@ +#!/bin/bash +set -e + +# Configuration variables +GAIA_CHAIN_ID="localnet-1" +WORDLED_CHAIN_ID="rollkitnet-1" + +GAIA_RPC="http://localhost:26654" +WORDLED_RPC="http://localhost:26657" + +GAIA_GRPC="http://localhost:9091" +WORDLED_GRPC="http://localhost:9090" + +GAIA_DENOM="stake" +WORDLED_DENOM="stake" + +RELAYER_WALLET="relayer" # Name of relayer account + +# Hardcoded mnemonic (must match initialization scripts) +RELAYER_MNEMONIC="reject camp lock magic dragon degree loop ignore quantum verify invest primary object afraid crane unveil parrot jelly rubber risk mirror globe torch category" + + +# Logging functions +log_info() { + echo "[INFO] $1" +} + +log_success() { + echo "[SUCCESS] $1" +} + +log_error() { + echo "[ERROR] $1" >&2 +} + +CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +HERMES_BIN="${HERMES_BIN:-$CURRENT_DIR/downloads/hermes}" + +# Verify Hermes is installed +if [ ! -f "$HERMES_BIN" ]; then + log_error "Hermes not found at $HERMES_BIN" + exit 1 +fi +log_success "Hermes installed" + +CONFIG_DIR="${CURRENT_DIR}/testnet/hermes" +rm -rf "$CONFIG_DIR" +mkdir -p "$CONFIG_DIR" + +# Generate configuration file (config.toml) +CONFIG_FILE="$CONFIG_DIR/config.toml" +log_info "Generating Hermes configuration at $CONFIG_FILE..." + +cat < "$CONFIG_FILE" +[global] +log_level = "trace" + +[mode] + [mode.clients] + enabled = true + refresh = true + misbehaviour = true + [mode.connections] + enabled = true + [mode.channels] + enabled = true + [mode.packets] + enabled = true + +[[chains]] +id = "$GAIA_CHAIN_ID" +rpc_addr = "$GAIA_RPC" +grpc_addr = "$GAIA_GRPC" +event_source = { mode = "pull", interval = "1s", max_retries = 4 } +store_prefix = "ibc" +account_prefix = "cosmos" +key_name = "$RELAYER_WALLET" +gas_price = { price = 3.5, denom = "stake" } +gas_multiplier = 1.4 +rpc_timeout = "10s" +trusting_period = "503h" +clock_drift = "10s" +key_store_folder = "$CONFIG_DIR/$GAIA_CHAIN_ID-keys" + +[[chains]] +id = "$WORDLED_CHAIN_ID" +rpc_addr = "$WORDLED_RPC" +grpc_addr = "$WORDLED_GRPC" +store_prefix = "ibc" +event_source = { mode = "pull", interval = "1s", max_retries = 4 } +account_prefix = "gm" +key_name = "$RELAYER_WALLET" +gas_price = { price = 0.025, denom = "stake" } +gas_multiplier = 1.4 +rpc_timeout = "10s" +trusting_period = "503h" +clock_drift = "10s" +key_store_folder = "$CONFIG_DIR/$WORDLED_CHAIN_ID-keys" +EOF + +log_success "Configuration file generated" + +# Import keys to relayer (Hermes) using mnemonic +TMP_MNEMONIC=$(mktemp) +echo "$RELAYER_MNEMONIC" > "$TMP_MNEMONIC" + +log_info "Importing key for $GAIA_CHAIN_ID..." +"$HERMES_BIN" --config "$CONFIG_FILE" keys add --chain "$GAIA_CHAIN_ID" --mnemonic-file "$TMP_MNEMONIC" +log_success "Key imported for $GAIA_CHAIN_ID" + +log_info "Importing key for $WORDLED_CHAIN_ID..." +"$HERMES_BIN" --config "$CONFIG_FILE" keys add --chain "$WORDLED_CHAIN_ID" --mnemonic-file "$TMP_MNEMONIC" +log_success "Key imported for $WORDLED_CHAIN_ID" + +rm "$TMP_MNEMONIC" + +# Show configured addresses (optional) +log_info "Showing configured addresses:" +"$HERMES_BIN" --config "$CONFIG_FILE" keys list --chain "$GAIA_CHAIN_ID" +"$HERMES_BIN" --config "$CONFIG_FILE" keys list --chain "$WORDLED_CHAIN_ID" + +# Create IBC channel between chains +log_info "Creating IBC channel between $GAIA_CHAIN_ID and $WORDLED_CHAIN_ID..." + "$HERMES_BIN" --config "$CONFIG_FILE" create channel --a-chain "$GAIA_CHAIN_ID" --a-port transfer \ + --b-chain "$WORDLED_CHAIN_ID" --b-port transfer \ + --new-client-connection --yes +log_success "IBC channel created" + +# Start Hermes +log_info "Starting Hermes..." +"$HERMES_BIN" --config "$CONFIG_FILE" start \ No newline at end of file diff --git a/hack/ibc-connection-rly.sh b/hack/ibc-connection-rly.sh new file mode 100755 index 0000000..910a46b --- /dev/null +++ b/hack/ibc-connection-rly.sh @@ -0,0 +1,133 @@ +#!/bin/bash +set -e + +# Configuration variables +GAIA_CHAIN_ID="localnet-1" +WORDLED_CHAIN_ID="rollkitnet-1" + +GAIA_RPC="http://localhost:26654" +WORDLED_RPC="http://localhost:26657" + +GAIA_GRPC="http://localhost:9091" +WORDLED_GRPC="http://localhost:9090" + +GAIA_DENOM="stake" +WORDLED_DENOM="stake" + +RELAYER_WALLET="relayer" # Name of relayer account + +# Hardcoded mnemonic (must match initialization scripts) +RELAYER_MNEMONIC="reject camp lock magic dragon degree loop ignore quantum verify invest primary object afraid crane unveil parrot jelly rubber risk mirror globe torch category" + +# Logging functions +log_info() { + echo "[INFO] $1" +} + +log_success() { + echo "[SUCCESS] $1" +} + +log_error() { + echo "[ERROR] $1" >&2 +} + +CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +RELAYER_BIN="${RELAYER_BIN:-$CURRENT_DIR/downloads/rly}" + + +# Verify Go IBC Relayer is installed +if ! command -v $RELAYER_BIN &> /dev/null; then + log_error "Go IBC Relayer not found. Please install it with: go install github.com/cosmos/relayer/v2@latest" + exit 1 +fi +log_success "Go IBC Relayer installed" + +CONFIG_DIR="${CURRENT_DIR}/testnet/go-relayer" +rm -rf "$CONFIG_DIR" +mkdir -p "$CONFIG_DIR" + +# Initialize the relayer configuration +log_info "Initializing Go IBC Relayer configuration..." +$RELAYER_BIN config init --home "$CONFIG_DIR" +log_success "Relayer configuration initialized" + +# Add chains to the relayer configuration +log_info "Adding $GAIA_CHAIN_ID chain to the relayer..." +cat < gaia-config.json +{ + "type": "cosmos", + "value": { + "key": "$RELAYER_WALLET", + "chain-id": "$GAIA_CHAIN_ID", + "rpc-addr": "$GAIA_RPC", + "grpc-addr": "$GAIA_GRPC", + "account-prefix": "cosmos", + "keyring-backend": "test", + "gas-adjustment": 2.0, + "gas-prices": "0.1$GAIA_DENOM", + "debug": true, + "timeout": "10s", + "output-format": "json", + "sign-mode": "direct", + "trusting-period": "504h" + } +} +EOF +$RELAYER_BIN chains add $GAIA_CHAIN_ID -f gaia-config.json --home "$CONFIG_DIR" +log_success "$GAIA_CHAIN_ID chain added" + +log_info "Adding $WORDLED_CHAIN_ID chain to the relayer..." +cat < wordled-config.json +{ + "type": "cosmos", + "value": { + "key": "$RELAYER_WALLET", + "chain-id": "$WORDLED_CHAIN_ID", + "rpc-addr": "$WORDLED_RPC", + "grpc-addr": "$WORDLED_GRPC", + "account-prefix": "gm", + "keyring-backend": "test", + "gas-adjustment": 2.0, + "gas-prices": "0.1$WORDLED_DENOM", + "debug": true, + "timeout": "10s", + "output-format": "json", + "sign-mode": "direct", + "trusting-period": "504h" + } +} +EOF +$RELAYER_BIN chains add $WORDLED_CHAIN_ID -f wordled-config.json --home "$CONFIG_DIR" +log_success "$WORDLED_CHAIN_ID chain added" + +# Import keys to relayer using mnemonic +log_info "Importing key for $GAIA_CHAIN_ID..." +$RELAYER_BIN keys restore $GAIA_CHAIN_ID $RELAYER_WALLET "$RELAYER_MNEMONIC" --home "$CONFIG_DIR" +log_success "Key imported for $GAIA_CHAIN_ID" + +log_info "Importing key for $WORDLED_CHAIN_ID..." +$RELAYER_BIN keys restore $WORDLED_CHAIN_ID $RELAYER_WALLET "$RELAYER_MNEMONIC" --home "$CONFIG_DIR" +log_success "Key imported for $WORDLED_CHAIN_ID" +# Clean up config files +rm gaia-config.json wordled-config.json + +# Show configured addresses (optional) +log_info "Showing configured addresses:" +$RELAYER_BIN keys list $GAIA_CHAIN_ID --home "$CONFIG_DIR" +$RELAYER_BIN keys list $WORDLED_CHAIN_ID --home "$CONFIG_DIR" + +# Create a path between the chains +PATH_NAME="gaia-rollkit" +log_info "Creating path $PATH_NAME between $GAIA_CHAIN_ID and $WORDLED_CHAIN_ID..." +$RELAYER_BIN paths new $GAIA_CHAIN_ID $WORDLED_CHAIN_ID $PATH_NAME --home "$CONFIG_DIR" +log_success "Path created" + +# Create IBC channel between chains +log_info "Creating IBC connection and channel between $GAIA_CHAIN_ID and $WORDLED_CHAIN_ID..." +$RELAYER_BIN tx link $PATH_NAME --home "$CONFIG_DIR" --src-port transfer --dst-port transfer --order unordered --log-level=DEBUG --debug +log_success "IBC connection and channel created" + +# Start the relayer +log_info "Starting Go IBC Relayer..." +$RELAYER_BIN start $PATH_NAME --home "$CONFIG_DIR" diff --git a/hack/ics20-token-transfer.sh b/hack/ics20-token-transfer.sh new file mode 100755 index 0000000..b08b0ca --- /dev/null +++ b/hack/ics20-token-transfer.sh @@ -0,0 +1,166 @@ +#!/bin/bash +set -e + +# Configuration variables (matching ibc-connection-hermes.sh) +GAIA_CHAIN_ID="localnet-1" +ROLLKIT_CHAIN_ID="rollkitnet-1" + +GAIA_RPC="http://localhost:26654" +ROLLKIT_RPC="http://localhost:26657" + +GAIA_DENOM="stake" +ROLLKIT_DENOM="stake" + +GAIA_KEY_NAME="bob" +ROLLKIT_KEY_NAME="carl" + +# IBC channel information +CHANNEL_ID="" +TRANSFER_PORT="transfer" + +# Logging functions +log_info() { + echo "[INFO] $1" +} + +log_success() { + echo "[SUCCESS] $1" +} + +log_error() { + echo "[ERROR] $1" >&2 +} + +CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +GAIAD_BIN="${GAIAD_BIN:-$CURRENT_DIR/downloads/gaiad}" +GMD_BIN="gmd" +ROLLKIT_HOME="${1:-"${CURRENT_DIR}/testnet/gm"}" + +# Verify binaries are installed +if [ ! -f "$GAIAD_BIN" ]; then + log_error "Gaiad not found at $GAIAD_BIN" + exit 1 +fi +log_success "Gaiad installed" + +if ! command -v $GMD_BIN &> /dev/null; then + log_error "gmd binary not found in PATH" + exit 1 +fi +log_success "gmd installed" + +# Get validator addresses +log_info "Getting user addresses..." +USER_ADDRESS_GAIA=$($GAIAD_BIN keys show $GAIA_KEY_NAME -a --keyring-backend test --home "$CURRENT_DIR/testnet/gaia") +USER_ADDRESS_ROLLKIT=$($GMD_BIN keys show $ROLLKIT_KEY_NAME -a --keyring-backend test --home "$ROLLKIT_HOME") + +log_info "Gaia user address: $USER_ADDRESS_GAIA" +log_info "Rollkit user address: $USER_ADDRESS_ROLLKIT" + +# Check initial balances +log_info "Checking initial balances..." +log_info "Gaia $GAIA_KEY_NAME balance:" +$GAIAD_BIN q bank balances $USER_ADDRESS_GAIA --node $GAIA_RPC --home "$CURRENT_DIR/testnet/gaia" + +log_info "Rollkit $ROLLKIT_KEY_NAME balance:" +$GMD_BIN q bank balances $USER_ADDRESS_ROLLKIT --node $ROLLKIT_RPC --home "$ROLLKIT_HOME" + +# Get channel ID +log_info "Getting IBC channel ID..." +CHANNEL_INFO=$($GAIAD_BIN q ibc channel channels --node $GAIA_RPC --home "$CURRENT_DIR/testnet/gaia" -o json) +CHANNEL_ID=$(echo $CHANNEL_INFO | jq -r '.channels[0].channel_id') + +if [ -z "$CHANNEL_ID" ] || [ "$CHANNEL_ID" == "null" ]; then + log_error "Failed to get channel ID. Make sure IBC connection is established." + exit 1 +fi + +log_info "Using IBC channel: $CHANNEL_ID" + +# Transfer Rollkit tokens to Gaia +ROLLKIT_TRANSFER_AMOUNT="101" + +log_info "Transferring ${ROLLKIT_TRANSFER_AMOUNT}${ROLLKIT_DENOM} from Rollkit to Gaia..." +TX_HASH=$($GMD_BIN tx ibc-transfer transfer $TRANSFER_PORT $CHANNEL_ID $USER_ADDRESS_GAIA ${ROLLKIT_TRANSFER_AMOUNT}${ROLLKIT_DENOM} \ + --from ${ROLLKIT_KEY_NAME} \ + --chain-id $ROLLKIT_CHAIN_ID \ + --node $ROLLKIT_RPC \ + --keyring-backend test \ + --home "$ROLLKIT_HOME" \ + --gas auto \ + --gas-adjustment 1.4 \ + --gas-prices 1stake \ + --yes -o json | jq -r '.txhash') + +log_info "Querying gmd tx... $TX_HASH" +for i in {1..10}; do + if ! tx_result=$($GMD_BIN q tx --type=hash "$TX_HASH" -o json --home "$ROLLKIT_HOME" 2>/dev/null); then + sleep 1 + continue + fi +done +if [ "$(echo "$tx_result" | jq -r '.code')" != "0" ]; then + log_error "Transaction failed : $tx_result" + exit 1 +fi + + +# Check balances after Rollkit to Gaia transfer +log_info "Checking balances after Rollkit to Gaia transfer..." +log_info "Gaia user balance (should show IBC tokens):" +$GAIAD_BIN q bank balances $USER_ADDRESS_GAIA --node $GAIA_RPC --home "$CURRENT_DIR/testnet/gaia" + +log_info "Rollkit user balance:" +$GMD_BIN q bank balances $USER_ADDRESS_ROLLKIT --node $ROLLKIT_RPC --home "$ROLLKIT_HOME" + +# Transfer tokens from Gaia to Rollkit +TRANSFER_AMOUNT="102" +log_info "Transferring $TRANSFER_AMOUNT$GAIA_DENOM from Gaia to Rollkit..." +TX_HASH=$($GAIAD_BIN tx ibc-transfer transfer $TRANSFER_PORT $CHANNEL_ID $USER_ADDRESS_ROLLKIT ${TRANSFER_AMOUNT}${GAIA_DENOM} \ + --from ${GAIA_KEY_NAME} \ + --chain-id $GAIA_CHAIN_ID \ + --node $GAIA_RPC \ + --keyring-backend test \ + --home "$CURRENT_DIR/testnet/gaia" \ + --gas auto \ + --gas-adjustment 1.4 \ + --gas-prices 1stake \ + --yes -o json | jq -r '.txhash') + +log_info "Querying gaia tx... $TX_HASH" +for i in {1..20}; do + if ! tx_result=$($GAIAD_BIN q tx --type=hash "$TX_HASH" -o json --node $GAIA_RPC 2>/dev/null); then + echo "$tx_result" + sleep 1 + continue + fi +done +if [ "$(echo "$tx_result" | jq -r '.code')" != "0" ]; then + log_error "Transaction failed : $tx_result" + exit 1 +fi + +# Check balances after transfer to Rollkit +log_info "Checking balances after transfer to Rollkit..." +log_info "Gaia user balance:" +$GAIAD_BIN q bank balances $USER_ADDRESS_GAIA --node $GAIA_RPC --home "$CURRENT_DIR/testnet/gaia" + +log_info "Rollkit user balance (should show IBC tokens):" +ibc_tokens_visible=false + +for i in {1..${20}}; do + $GMD_BIN q bank balances $USER_ADDRESS_ROLLKIT --node $ROLLKIT_RPC --home "$ROLLKIT_HOME" + if $GMD_BIN q bank balances $USER_ADDRESS_ROLLKIT --node $ROLLKIT_RPC --home "$ROLLKIT_HOME" | grep -q "ibc"; then + log_success "IBC tokens are now visible in Rollkit balance" + ibc_tokens_visible=true + break + fi + sleep 1 +done + +if [ "$ibc_tokens_visible" = false ]; then + log_error "IBC tokens did not become visible within time frame" + exit 1 +fi + +log_success "ICS20 token transfer test completed!" diff --git a/hack/init-gaia.sh b/hack/init-gaia.sh new file mode 100755 index 0000000..e6fcc5a --- /dev/null +++ b/hack/init-gaia.sh @@ -0,0 +1,98 @@ +#!/bin/bash + +# Function for formatted logging +log() { + local color=$1 + local emoji=$2 + local message=$3 + shift 3 + printf "\e[${color}m${emoji} [$(date '+%T')] ${message}\e[0m\n" "$@" +} + +# Hardcoded mnemonic for validator account (igual que en Wordled) +VALIDATOR_MNEMONIC="abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art" +BOB_MNEMONIC="rack argue disorder flame appear broom smile effort one rubber buffalo suspect tool devote zebra between inhale trigger brief possible parrot nation expose place" +RELAYER_MNEMONIC="reject camp lock magic dragon degree loop ignore quantum verify invest primary object afraid crane unveil parrot jelly rubber risk mirror globe torch category" + +CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +GAIA_HOME=${1:-"${CURRENT_DIR}/testnet/gaia"} +GAIAD_BIN=${2:-"${CURRENT_DIR}/downloads/gaiad"} + +# Kill existing Gaia processes +log "31" "πŸ’€" "Checking for existing Gaia processes..." +GAIA_PID=$(pgrep gaiad) +if [ -n "$GAIA_PID" ]; then + log "31" "πŸ”ͺ" "Killing existing Gaia process (PID: $GAIA_PID)..." + kill -9 "$GAIA_PID" +else + log "32" "πŸ‘Œ" "No existing Gaia process found." +fi + +# Clean previous configurations +log "32" "πŸ”₯" "Cleaning previous Gaia configurations..." +rm -rf "$GAIA_HOME" + +# 1. Initialize Gaia chain +log "36" "πŸ†•" "Initializing Gaia chain..." +"$GAIAD_BIN" init my-node --chain-id localnet-1 --home "$GAIA_HOME" + +# 2. Create/Recover validator account usando la mnemΓ³nica fija +log "35" "πŸ‘€" "Generating validator account from mnemonic..." +echo "$VALIDATOR_MNEMONIC" | "$GAIAD_BIN" keys add validator \ + --keyring-backend test \ + --home "$GAIA_HOME" \ + --recover > /dev/null 2>&1 +echo "$BOB_MNEMONIC" | "$GAIAD_BIN" keys add bob \ + --keyring-backend test \ + --home "$GAIA_HOME" \ + --recover > /dev/null 2>&1 +echo "$RELAYER_MNEMONIC" | "$GAIAD_BIN" keys add relayer \ + --keyring-backend test \ + --home "$GAIA_HOME" \ + --recover > /dev/null 2>&1 + +# 3. Add account to genesis +log "34" "πŸ“" "Adding account to genesis..." +"$GAIAD_BIN" genesis add-genesis-account validator 10000000000000000stake --keyring-backend test --home "$GAIA_HOME" +"$GAIAD_BIN" genesis add-genesis-account bob 10000000000000000stake --keyring-backend test --home "$GAIA_HOME" +"$GAIAD_BIN" genesis add-genesis-account relayer 10000000000000000stake --keyring-backend test --home "$GAIA_HOME" + +# 4. Generate gentx +log "33" "πŸ“œ" "Creating validator transaction..." +"$GAIAD_BIN" genesis gentx validator 1000000000stake \ + --chain-id localnet-1 \ + --keyring-backend test \ + --home "$GAIA_HOME" + +# 5. Collect gentxs +log "32" "πŸ“¦" "Collecting genesis transactions..." +"$GAIAD_BIN" genesis collect-gentxs --home "$GAIA_HOME" + +# 6. Configure minimum gas prices +log "36" "β›½" "Setting minimum gas prices..." +sed -i.bak -E 's#minimum-gas-prices = ""#minimum-gas-prices = "0stake"#g' "$GAIA_HOME/config/app.toml" + +# 7. Modify consensus timeouts +log "35" "⏱️" "Adjusting consensus timeouts..." +sed -i.bak -E 's/timeout_commit = "5s"/timeout_commit = "1s"/g' "$GAIA_HOME/config/config.toml" +sed -i.bak -E 's/timeout_propose = "3s"/timeout_propose = "1s"/g' "$GAIA_HOME/config/config.toml" + +# 8. Start Gaia chain +log "34" "πŸš€" "Starting Gaia node..." +"$GAIAD_BIN" start --home "$GAIA_HOME" --minimum-gas-prices "0stake" --rpc.laddr tcp://0.0.0.0:26654 --rpc.pprof_laddr localhost:6061 --p2p.laddr tcp://0.0.0.0:26653 --grpc.address 0.0.0.0:9091 | tee "$GAIA_HOME/gaia.log" & +GAIA_PID=$! + +# Wait for initialization +log "33" "⏳" "Waiting for Gaia initialization (port 26654)..." +while ! nc -z localhost 26654; do + sleep 1 +done +log "32" "βœ…" "Gaia chain running successfully!" + +# Show recent logs +log "36" "πŸ“„" "Last lines of Gaia log:" +tail -n 5 "$GAIA_HOME/gaia.log" + +# Keep script alive +log "35" "πŸ‘€" "Monitoring Gaia chain activity..." +wait $GAIA_PID \ No newline at end of file diff --git a/hack/run_gmd.sh b/hack/run_gmd.sh new file mode 100755 index 0000000..de0d7a1 --- /dev/null +++ b/hack/run_gmd.sh @@ -0,0 +1,147 @@ +#!/bin/bash +set -x + +# Function for cleanup on script interruption +cleanup() { + log "31" "πŸ›‘" "Cleaning up processes..." + if [ -n "$DA_PID" ]; then + kill -9 "$DA_PID" 2>/dev/null || true + fi + if [ -n "$ROLLKIT_PID" ]; then + kill -9 "$ROLLKIT_PID" 2>/dev/null || true + fi + exit 0 +} + +trap cleanup INT TERM + +# Function for formatted logging +log() { + local color=$1 + local emoji=$2 + local message=$3 + shift 3 + printf "\e[${color}m${emoji} [$(date '+%T')] ${message}\e[0m\n" "$@" +} + + +# Define paths +CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROLLKIT_BIN="gmd" +ROLLKIT_HOME="${1:-"${CURRENT_DIR}/testnet/gm"}" +LOCAL_DA_PATH="${2:-"../../rollkit/build/local-da"}" +CHAIN_ID="${3:-"rollkitnet-1"}" + +# Clean previous configurations +log "32" "πŸ”₯" "Cleaning previous rollkit configurations..." +rm -rf "$ROLLKIT_HOME" + +"$ROLLKIT_BIN" init my-rollkit-node --chain-id "$CHAIN_ID" --home "$ROLLKIT_HOME" + +# Hardcoded mnemonic for validator account (igual que en Wordled) +VALIDATOR_MNEMONIC="abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art" +#ATTESTER_MNEMONIC="tennis sponsor brick almost coyote soup rib wisdom warm bean onion tray devote pretty crime grid rough boil wear december travel inch work note" +RELAYER_MNEMONIC="reject camp lock magic dragon degree loop ignore quantum verify invest primary object afraid crane unveil parrot jelly rubber risk mirror globe torch category" +USER_MNEMONIC="sport head real antique sad expect ignore feature claim manual heavy mouse coil rebuild police flag robust picture milk symptom suffer chuckle worry virus" + + +echo "$VALIDATOR_MNEMONIC" | "$ROLLKIT_BIN" keys add validator \ + --keyring-backend test \ + --home "$ROLLKIT_HOME" \ + --recover > /dev/null 2>&1 + +#echo "$ATTESTER_MNEMONIC" | "$ROLLKIT_BIN" keys add attester \ +# --keyring-backend test \ +# --home "$ROLLKIT_HOME" \ +# --recover > /dev/null 2>&1 + +echo "$RELAYER_MNEMONIC" | "$ROLLKIT_BIN" keys add relayer \ + --keyring-backend test \ + --home "$ROLLKIT_HOME" \ + --recover > /dev/null 2>&1 + +echo "$USER_MNEMONIC" | "$ROLLKIT_BIN" keys add carl \ + --keyring-backend test \ + --home "$ROLLKIT_HOME" \ + --recover > /dev/null 2>&1 + +"$ROLLKIT_BIN" genesis add-genesis-account validator "10000000000000000stake" --keyring-backend test --home "$ROLLKIT_HOME" +#"$ROLLKIT_BIN" genesis add-genesis-account attester "10000000000000000stake" --keyring-backend test --home "$ROLLKIT_HOME" +"$ROLLKIT_BIN" genesis add-genesis-account relayer "10000000000000000stake" --keyring-backend test --home "$ROLLKIT_HOME" +"$ROLLKIT_BIN" genesis add-genesis-account carl "10000000000000000stake" --keyring-backend test --home "$ROLLKIT_HOME" + + +log "33" "πŸ“œ" "Creating validator transaction..." +"$ROLLKIT_BIN" genesis gentx validator 1000000000stake \ + --chain-id "$CHAIN_ID" \ + --keyring-backend test \ + --home "$ROLLKIT_HOME" + +# 5. Collect gentxs +log "32" "πŸ“¦" "Collecting genesis transactions..." +"$ROLLKIT_BIN" genesis collect-gentxs --home "$ROLLKIT_HOME" + +# Set validator in consensus block +log "32" "πŸ”„" "Setting validator in consensus block..." +# Extract validator address and pubkey from validator key file, then modify genesis file to set the validator +jq -r '.address as $addr | .pub_key | { + address: $addr, + pub_key: { type: "tendermint/PubKeyEd25519", value: .value }, + power: "1000", + name: "Rollkit Sequencer" +}' "$ROLLKIT_HOME/config/priv_validator_key.json" | \ +jq --slurpfile genesis "$ROLLKIT_HOME/config/genesis.json" \ + '. as $validator | ($genesis[0] | .consensus.validators += [$validator])' > \ + "$ROLLKIT_HOME/config/tmp_genesis.json" && \ +mv "$ROLLKIT_HOME/config/tmp_genesis.json" "$ROLLKIT_HOME/config/genesis.json" + +# 6. Configure minimum gas prices +log "33" "β›½" "Setting minimum gas prices..." +sed -i.bak -E 's#minimum-gas-prices = ""#minimum-gas-prices = "0stake"#g' "$ROLLKIT_HOME/config/app.toml" + +# 7. Modify consensus timeouts +log "34" "⏱️" "Adjusting consensus timeouts..." +sed -i.bak -E 's/timeout_commit = "5s"/timeout_commit = "1s"/g' "$ROLLKIT_HOME/config/config.toml" +sed -i.bak -E 's/timeout_propose = "3s"/timeout_propose = "1s"/g' "$ROLLKIT_HOME/config/config.toml" + +# enable api +sed -i.bak 's#enable = false#enable = true#g' "$ROLLKIT_HOME/config/app.toml" + + + +# Build and start local DA +echo "Building and starting local DA..." +# --- Kill previous local-da process if running --- +echo "Checking for existing local-da process on port 7980..." +# Find PID using lsof on the DA port (adjust if your DA uses a different port) +DA_PORT=7980 +EXISTING_PID=$(lsof -ti tcp:${DA_PORT}) + +if [ -n "$EXISTING_PID" ]; then + echo "Found existing processes on port $DA_PORT with PIDs: $EXISTING_PID. Killing..." + # Kill the process(es) + kill -9 $EXISTING_PID + # Allow a moment for the OS to release the port + sleep 2 +else + echo "No existing process found on port $DA_PORT." +fi +# --- End Kill previous local-da process --- + + +if [ ! -f "$LOCAL_DA_PATH" ]; then + echo "Error: local-da binary not found at $LOCAL_DA_PATH" + exit 1 +else + echo "Starting local DA in background..." + $LOCAL_DA_PATH & + DA_PID=$! + echo "Local DA started with PID $DA_PID" + sleep 2 # Give DA a moment to start +fi + +log "35" "πŸš€" "Starting ROLLKIT node..." +"$ROLLKIT_BIN" start --home "$ROLLKIT_HOME" --rollkit.node.aggregator --minimum-gas-prices "0stake" --rollkit.node.lazy_block_interval=150ms --rollkit.node.block_time=100ms --rollkit.da.block_time=500ms --pruning=nothing --rollkit.network.soft-confirmation --log_level=debug & +ROLLKIT_PID=$! +log "36" "βœ…" "ROLLKIT chain running successfully!" +wait $ROLLKIT_PID diff --git a/pkg/adapter/adapter.go b/pkg/adapter/adapter.go index 43f7729..eef1449 100644 --- a/pkg/adapter/adapter.go +++ b/pkg/adapter/adapter.go @@ -277,10 +277,10 @@ func (a *Adapter) InitChain(ctx context.Context, genesisTime time.Time, initialH nValSet := cmttypes.NewValidatorSet(vals) - if len(nValSet.Validators) != 1 { - err := fmt.Errorf("expected exactly one validator") - return nil, 0, err - } + //if n := len(nValSet.Validators); n != 1 { + // err := fmt.Errorf("expected exactly one validator but got %d", n) + // return nil, 0, err + //} s.Validators = cmttypes.NewValidatorSet(nValSet.Validators) s.NextValidators = cmttypes.NewValidatorSet(nValSet.Validators).CopyIncrementProposerPriority(1) diff --git a/server/start.go b/server/start.go index 457b54a..a72aa92 100644 --- a/server/start.go +++ b/server/start.go @@ -681,6 +681,9 @@ func loadRollkitMigrationGenesis(rootDir string) (*rollkitMigrationGenesis, erro // This is used for normal startup scenarios where a full cometbft genesis document // is available and contains all the necessary information. func createRollkitGenesisFromCometBFT(cmtGenDoc *cmttypes.GenesisDoc) *genesis.Genesis { + if len(cmtGenDoc.Validators) == 0 { + panic("no .validators in genesis") + } rollkitGenesis := genesis.NewGenesis( cmtGenDoc.ChainID, uint64(cmtGenDoc.InitialHeight),