From 481e72040c072e984218bb4ab84c147af87dc9e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nina=20/=20=E1=83=9C=E1=83=98=E1=83=9C=E1=83=90?= Date: Tue, 18 Jun 2024 08:47:23 +0200 Subject: [PATCH 01/10] chore: enable slack pings (#3562) ## Overview Fixes #3506 I tested it by triggering workflow on push to my working branch and breaking e2e tests. The notifications showed up in our slack channel. Screenshot 2024-06-13 at 19 13 19 --------- Co-authored-by: Rootul P --- .github/workflows/test-e2e.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 7b1c7a29e0..82bc8ef771 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -28,3 +28,14 @@ jobs: echo "${KUBECONFIG_FILE}" > $HOME/.kube/config - name: Run e2e tests run: make test-e2e + + - name: If the e2e test fails, notify Slack channel #e2e-test-failures + if: failure() + uses: ravsamhq/notify-slack-action@v2 + with: + status: ${{ job.status }} + token: ${{ secrets.GITHUB_TOKEN }} + notification_title: "E2E test failure" + message_format: "{emoji} *{workflow}* {status_message} in <{run_url}|{repo}>" + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_E2E_TEST_FAILURES }} From d3b1923b2c899e390eefe38a0af50900ea99459c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nina=20/=20=E1=83=9C=E1=83=98=E1=83=9C=E1=83=90?= Date: Tue, 18 Jun 2024 11:54:19 +0200 Subject: [PATCH 02/10] fix: minfee key table not registered on app restarts (#3571) ## Overview Fixes #3553 --- app/app.go | 10 +++++----- app/app_test.go | 6 ++++++ x/minfee/module.go | 7 +++++++ x/minfee/module_test.go | 41 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 x/minfee/module_test.go diff --git a/app/app.go b/app/app.go index c6e4f15373..cb33c0e1f7 100644 --- a/app/app.go +++ b/app/app.go @@ -301,13 +301,13 @@ func New( paramBlockList := paramfilter.NewParamBlockList(app.BlockedParams()...) - // register the proposal types + // Register the proposal types. govRouter := oldgovtypes.NewRouter() govRouter.AddRoute(paramproposal.RouterKey, paramBlockList.GovHandler(app.ParamsKeeper)). AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). AddRoute(ibcclienttypes.RouterKey, NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) - // Create Transfer Keepers + // Create Transfer Keepers. tokenFilterKeeper := tokenfilter.NewKeeper(app.IBCKeeper.ChannelKeeper) app.PacketForwardKeeper = packetforwardkeeper.NewKeeper( @@ -326,7 +326,7 @@ func New( app.PacketForwardKeeper, app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, app.ScopedTransferKeeper, ) - // transfer stack contains (from top to bottom): + // Transfer stack contains (from top to bottom): // - Token Filter // - Packet Forwarding Middleware // - Transfer @@ -339,9 +339,9 @@ func New( packetforwardkeeper.DefaultForwardTransferPacketTimeoutTimestamp, // forward timeout packetforwardkeeper.DefaultRefundTransferPacketTimeoutTimestamp, // refund timeout ) - // packetForwardMiddleware is used only for version 2 + // PacketForwardMiddleware is used only for version 2. transferStack = module.NewVersionedIBCModule(packetForwardMiddleware, transferStack, v2, v2) - // token filter wraps packet forward middleware and is thus the first module in the transfer stack + // Token filter wraps packet forward middleware and is thus the first module in the transfer stack. tokenFilterMiddelware := tokenfilter.NewIBCMiddleware(transferStack) transferStack = module.NewVersionedIBCModule(tokenFilterMiddelware, transferStack, v1, v2) diff --git a/app/app_test.go b/app/app_test.go index 88c9c2927d..a991981d41 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -5,6 +5,7 @@ import ( "github.com/celestiaorg/celestia-app/v2/app" "github.com/celestiaorg/celestia-app/v2/app/encoding" + "github.com/celestiaorg/celestia-app/v2/x/minfee" "github.com/stretchr/testify/assert" "github.com/tendermint/tendermint/libs/log" tmdb "github.com/tendermint/tm-db" @@ -39,6 +40,11 @@ func TestNew(t *testing.T) { t.Run("should not have sealed the baseapp", func(t *testing.T) { assert.False(t, got.IsSealed()) }) + t.Run("should have set the minfee key table", func(t *testing.T) { + subspace := got.GetSubspace(minfee.ModuleName) + hasKeyTable := subspace.HasKeyTable() + assert.True(t, hasKeyTable) + }) } // NoopWriter is a no-op implementation of a writer. diff --git a/x/minfee/module.go b/x/minfee/module.go index fd5afceb79..c3f3eae354 100644 --- a/x/minfee/module.go +++ b/x/minfee/module.go @@ -77,6 +77,13 @@ type AppModule struct { // NewAppModule creates a new AppModule object func NewAppModule(k params.Keeper) AppModule { + // Register the parameter key table in its associated subspace. + subspace, exists := k.GetSubspace(ModuleName) + if !exists { + panic("minfee subspace not set") + } + RegisterMinFeeParamTable(subspace) + return AppModule{ AppModuleBasic: AppModuleBasic{}, paramsKeeper: k, diff --git a/x/minfee/module_test.go b/x/minfee/module_test.go new file mode 100644 index 0000000000..5a5ea953a9 --- /dev/null +++ b/x/minfee/module_test.go @@ -0,0 +1,41 @@ +package minfee_test + +import ( + "testing" + + "github.com/celestiaorg/celestia-app/v2/x/minfee" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/store" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + paramkeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/stretchr/testify/require" + tmdb "github.com/tendermint/tm-db" +) + +func TestNewModuleInitializesKeyTable(t *testing.T) { + storeKey := sdk.NewKVStoreKey(paramtypes.StoreKey) + tStoreKey := storetypes.NewTransientStoreKey(paramtypes.TStoreKey) + + // Create the state store + db := tmdb.NewMemDB() + stateStore := store.NewCommitMultiStore(db) + stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) + stateStore.MountStoreWithDB(tStoreKey, storetypes.StoreTypeTransient, nil) + require.NoError(t, stateStore.LoadLatestVersion()) + + registry := codectypes.NewInterfaceRegistry() + + // Create a params keeper + paramsKeeper := paramkeeper.NewKeeper(codec.NewProtoCodec(registry), codec.NewLegacyAmino(), storeKey, tStoreKey) + subspace := paramsKeeper.Subspace(minfee.ModuleName) + + // Initialize the minfee module which registers the key table + minfee.NewAppModule(paramsKeeper) + + // Require key table to be initialized + hasKeyTable := subspace.HasKeyTable() + require.True(t, hasKeyTable) +} From b36655e7282cb8a80316f7a0d0c4edca4c9aeb26 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Tue, 18 Jun 2024 13:01:18 +0200 Subject: [PATCH 03/10] fix: TxClient gas price querying on v1 networks (#3570) Closes: #3569 --- pkg/user/tx_client.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/user/tx_client.go b/pkg/user/tx_client.go index be722b72c2..a220a00ec1 100644 --- a/pkg/user/tx_client.go +++ b/pkg/user/tx_client.go @@ -574,6 +574,12 @@ func QueryMinimumGasPrice(ctx context.Context, grpcConn *grpc.ClientConn) (float globalMinPrice, err := QueryGlobalMinGasPrice(ctx, grpcConn) if err != nil { + // check if the network version supports a global min gas + // price using a regex check. If not (i.e. v1) use the + // local price only + if strings.Contains(err.Error(), "unknown subspace: minfee") { + return localMinPrice, nil + } return 0, err } From 115ef3a368195d73e5c24779660fef0ba732994d Mon Sep 17 00:00:00 2001 From: smuu <18609909+smuu@users.noreply.github.com> Date: Tue, 18 Jun 2024 15:06:59 +0200 Subject: [PATCH 04/10] feat: use proxy instead of port forwards (#3505) This pull request removes the need for port-forwarding. Instead, it facilitates the reverse proxy that is available in the scope. Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com> --- go.mod | 53 +++++---- go.sum | 139 ++++++++++++------------ test/e2e/benchmark/benchmark.go | 4 +- test/e2e/major_upgrade_v2.go | 50 ++++----- test/e2e/minor_version_compatibility.go | 37 ++----- test/e2e/simple.go | 27 ++--- test/e2e/testnet/defaults.go | 4 +- test/e2e/testnet/node.go | 99 ++++++----------- test/e2e/testnet/node_helpers.go | 80 -------------- test/e2e/testnet/testnet.go | 55 ++++------ test/e2e/testnet/txsimNode.go | 1 + 11 files changed, 194 insertions(+), 355 deletions(-) delete mode 100644 test/e2e/testnet/node_helpers.go diff --git a/go.mod b/go.mod index ee07c1e28e..c2ec002c90 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/celestiaorg/blobstream-contracts/v3 v3.1.0 github.com/celestiaorg/go-square v1.1.0 github.com/celestiaorg/go-square/merkle v0.0.0-20240117232118-fd78256df076 - github.com/celestiaorg/knuu v0.13.2 + github.com/celestiaorg/knuu v0.14.0 github.com/celestiaorg/nmt v0.21.0 github.com/celestiaorg/rsmt2d v0.13.1 github.com/cosmos/cosmos-proto v1.0.0-beta.5 @@ -29,7 +29,7 @@ require ( github.com/stretchr/testify v1.9.0 github.com/tendermint/tendermint v0.34.29 github.com/tendermint/tm-db v0.6.7 - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb + golang.org/x/exp v0.0.0-20240213143201-ec583247a57a google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 google.golang.org/grpc v1.64.0 google.golang.org/protobuf v1.34.2 @@ -56,7 +56,7 @@ require ( github.com/bgentry/speakeasy v0.1.0 // indirect github.com/bits-and-blooms/bitset v1.10.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/celestiaorg/bittwister v0.0.0-20231211182706-b065de784c03 // indirect + github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 // indirect github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect @@ -85,8 +85,8 @@ require ( github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/distribution/reference v0.5.0 // indirect - github.com/docker/docker v26.0.2+incompatible // indirect - github.com/docker/go-connections v0.4.0 // indirect + github.com/docker/docker v26.1.3+incompatible // indirect + github.com/docker/go-connections v0.4.1-0.20210727194412-58542c764a11 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect @@ -104,6 +104,7 @@ require ( github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect github.com/go-playground/validator/v10 v10.11.2 // indirect + github.com/goccy/go-json v0.10.2 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/gateway v1.1.0 // indirect github.com/golang/glog v1.2.0 // indirect @@ -138,15 +139,16 @@ require ( github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect github.com/holiman/uint256 v1.2.4 // indirect github.com/iancoleman/orderedmap v0.2.0 // indirect - github.com/imdario/mergo v0.3.13 // indirect + github.com/imdario/mergo v0.3.16 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect + github.com/joho/godotenv v1.5.1 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.6 // indirect - github.com/klauspost/cpuid/v2 v2.2.6 // indirect + github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/klauspost/reedsolomon v1.12.1 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect @@ -160,8 +162,7 @@ require ( github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/minio/md5-simd v1.1.2 // indirect - github.com/minio/minio-go/v7 v7.0.69 // indirect - github.com/minio/sha256-simd v1.0.1 // indirect + github.com/minio/minio-go/v7 v7.0.70 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect @@ -172,10 +173,9 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/onsi/ginkgo v1.16.5 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc2 // indirect + github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect github.com/pkg/errors v0.9.1 // indirect @@ -212,36 +212,35 @@ require ( go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect - go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel v1.26.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.18.0 // indirect - go.opentelemetry.io/otel/metric v1.24.0 // indirect - go.opentelemetry.io/otel/sdk v1.24.0 // indirect - go.opentelemetry.io/otel/trace v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.26.0 // indirect + go.opentelemetry.io/otel/sdk v1.26.0 // indirect + go.opentelemetry.io/otel/trace v1.26.0 // indirect go.opentelemetry.io/proto/otlp v1.1.0 // indirect - go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.24.0 // indirect - golang.org/x/crypto v0.22.0 // indirect - golang.org/x/net v0.24.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/net v0.25.0 // indirect golang.org/x/oauth2 v0.18.0 // indirect golang.org/x/sync v0.7.0 // indirect golang.org/x/sys v0.20.0 // indirect - golang.org/x/term v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/term v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/api v0.169.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.29.3 // indirect - k8s.io/apimachinery v0.29.3 // indirect - k8s.io/client-go v0.29.2 // indirect - k8s.io/klog/v2 v2.110.1 // indirect - k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect + k8s.io/api v0.28.2 // indirect + k8s.io/apimachinery v0.28.2 // indirect + k8s.io/client-go v0.28.2 // indirect + k8s.io/klog/v2 v2.120.1 // indirect + k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect nhooyr.io/websocket v1.8.6 // indirect rsc.io/tmplfunc v0.0.3 // indirect diff --git a/go.sum b/go.sum index 16eb2fc25b..3f99417a99 100644 --- a/go.sum +++ b/go.sum @@ -215,6 +215,7 @@ github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/DataDog/zstd v1.5.0 h1:+K/VEwIAaPcHiMtQvpLD4lqW7f0Gk3xdYZmI1hD+CXo= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= @@ -273,8 +274,6 @@ github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7 github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -317,8 +316,8 @@ github.com/bufbuild/protocompile v0.5.1/go.mod h1:G5iLmavmF4NsYtpZFvE3B/zFch2GIY github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/celestiaorg/bittwister v0.0.0-20231211182706-b065de784c03 h1:oAyIR+jHql2SR4lIcsI3gXeyhzM3GSMtAzSXBuH0NEQ= -github.com/celestiaorg/bittwister v0.0.0-20231211182706-b065de784c03/go.mod h1:1EF5MfOxVf0WC51Gb7pJ6bcZxnXKNAf9pqWtjgPBAYc= +github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8wrLMjhu260RuigXylC3pWoDu4OVumPHeojnk= +github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7/go.mod h1:1EF5MfOxVf0WC51Gb7pJ6bcZxnXKNAf9pqWtjgPBAYc= github.com/celestiaorg/blobstream-contracts/v3 v3.1.0 h1:h1Y4V3EMQ2mFmNtWt2sIhZIuyASInj1a9ExI8xOsTOw= github.com/celestiaorg/blobstream-contracts/v3 v3.1.0/go.mod h1:x4DKyfKOSv1ZJM9NwV+Pw01kH2CD7N5zTFclXIVJ6GQ= github.com/celestiaorg/celestia-core v1.36.1-tm-v0.34.29 h1:BuYworCMtFxAYyM5l1C0gx6PT/ViHosVRydvYd7vCqs= @@ -329,8 +328,8 @@ github.com/celestiaorg/go-square v1.1.0 h1:K4tBL5PCJwDtpBfyDxxZ3N962aC9VYb5/bw3L github.com/celestiaorg/go-square v1.1.0/go.mod h1:1EXMErhDrWJM8B8V9hN7dqJ2kUTClfwdqMOmF9yQUa0= github.com/celestiaorg/go-square/merkle v0.0.0-20240117232118-fd78256df076 h1:PYInrsYzrDIsZW9Yb86OTi2aEKuPcpgJt6Mc0Jlc/yg= github.com/celestiaorg/go-square/merkle v0.0.0-20240117232118-fd78256df076/go.mod h1:hlidgivKyvv7m4Yl2Fdf2mSTmazZYxX8+bnr5IQrI98= -github.com/celestiaorg/knuu v0.13.2 h1:JKA4RpKighW8StYFAm34wno3lQLTN+iuhUm6q3VrxkI= -github.com/celestiaorg/knuu v0.13.2/go.mod h1:7UUt/ZYezIXVKKypNbr/b0/NyP39sRttfJp3grOAjvw= +github.com/celestiaorg/knuu v0.14.0 h1:96uaDHTzlTfhDLrAiygq9Ewow7UzOzGAbUvMwws1S4A= +github.com/celestiaorg/knuu v0.14.0/go.mod h1:5x/+tlLebBSfLmmSBm2ps6aLjnKLn5bOaZpUfI5FpsA= github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4 h1:CJdIpo8n5MFP2MwK0gSRcOVlDlFdQJO1p+FqdxYzmvc= github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4/go.mod h1:fzuHnhzj1pUygGz+1ZkB3uQbEUL4htqCGJ4Qs2LwMZA= github.com/celestiaorg/nmt v0.21.0 h1:81MBqxNn3orByoiCtdNVjwi5WsLgMkzHwP02ZMhTBHM= @@ -487,10 +486,10 @@ github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwu github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v26.0.2+incompatible h1:yGVmKUFGgcxA6PXWAokO0sQL22BrQ67cgVjko8tGdXE= -github.com/docker/docker v26.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/docker v26.1.3+incompatible h1:lLCzRbrVZrljpVNobJu1J2FHk8V0s4BawoZippkc+xo= +github.com/docker/docker v26.1.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.4.1-0.20210727194412-58542c764a11 h1:IPrmumsT9t5BS7XcPhgsCTlkWbYg80SEXUzDpReaU6Y= +github.com/docker/go-connections v0.4.1-0.20210727194412-58542c764a11/go.mod h1:a6bNUGTbQBsY6VRHTr4h/rkOXjl244DyRD0tx3fgq4Q= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= @@ -526,8 +525,8 @@ github.com/ethereum/go-ethereum v1.14.5 h1:szuFzO1MhJmweXjoM5nSAeDvjNUH3vIQoMzzQ github.com/ethereum/go-ethereum v1.14.5/go.mod h1:VEDGGhSxY7IEjn98hJRFXl/uFvpRgbIIf2PpXiyGGgc= github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0 h1:KrE8I4reeVvf7C1tm8elRjj4BdscTYzz/WAbYyf/JI4= github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0/go.mod h1:D9AJLVXSyZQXJQVk8oh1EwjISE+sJTn2duYIZC0dy3w= -github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= -github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= +github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= @@ -623,6 +622,8 @@ github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -734,8 +735,8 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 h1:CqYfpuYIjnlNxM3msdyPRKabhXZWbKjf3Q8BWROFBso= -github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10/go.mod h1:79YE0hCXdHag9sBkw2o+N/YnZtTkXi0UT9Nnixa5eYk= +github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 h1:E/LAvt58di64hlYjx7AsNS6C/ysHWYo+2qPCZKTQhRo= +github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= @@ -862,8 +863,8 @@ github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6 github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= +github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -895,6 +896,8 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= @@ -929,8 +932,8 @@ github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2e github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= -github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= +github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/klauspost/reedsolomon v1.12.1 h1:NhWgum1efX1x58daOBGCFWcxtEhOhXKKl1HAPQUp03Q= @@ -1010,10 +1013,8 @@ github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= -github.com/minio/minio-go/v7 v7.0.69 h1:l8AnsQFyY1xiwa/DaQskY4NXSLA2yrGsW5iD9nRPVS0= -github.com/minio/minio-go/v7 v7.0.69/go.mod h1:XAvOPJQ5Xlzk5o3o/ArO2NMbhSGkimC+bpW/ngRKDmQ= -github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= -github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= +github.com/minio/minio-go/v7 v7.0.70 h1:1u9NtMgfK1U42kUxcsl5v0yj6TEOPR497OAQxpJnn2g= +github.com/minio/minio-go/v7 v7.0.70/go.mod h1:4yBA8v80xGA30cfM3fz0DKYMXunWl/AV/6tWEs9ryzo= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -1059,8 +1060,6 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= @@ -1087,19 +1086,19 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= -github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= +github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= -github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= +github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b h1:YWuSjZCQAPM8UUBLkYUk1e+rZcvWHJmFb6i6rM44Xs8= +github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= @@ -1222,6 +1221,7 @@ github.com/shirou/gopsutil v3.21.6+incompatible h1:mmZtAlWSd8U2HeRTjswbnDLPxqsEo github.com/shirou/gopsutil v3.21.6+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= @@ -1378,33 +1378,31 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.4 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= -go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= -go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel v1.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs= +go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 h1:Xw8U6u2f8DK2XAkGRFV7BBLENgnTGX9i4rQRxJf+/vs= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0/go.mod h1:6KW1Fm6R/s6Z3PGXwSJN2K4eT6wQB3vXX6CVnYX9NmM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0 h1:1wp/gyxsuYtuE/JFxsQRtcCDtMrO2qMvlfXALU5wkzI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0/go.mod h1:gbTHmghkGgqxMomVQQMur1Nba4M0MQ8AYThXDUjsJ38= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.18.0 h1:hSWWvDjXHVLq9DkmB+77fl8v7+t+yYiS+eNkiplDK54= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.18.0/go.mod h1:zG7KQql1WjZCaUJd+L/ReSYx4bjbYJxg5ws9ws+mYes= go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= -go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= -go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/metric v1.26.0 h1:7S39CLuY5Jgg9CrnA9HHiEjGMF/X2VHvoXGgSllRz30= +go.opentelemetry.io/otel/metric v1.26.0/go.mod h1:SY+rHOI4cEawI9a7N1A4nIg/nTQXe1ccCNWYOJUrpX4= go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= -go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= -go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= +go.opentelemetry.io/otel/sdk v1.26.0 h1:Y7bumHf5tAiDlRYFmGqetNcLaVUZmh4iYfmGxtmz7F8= +go.opentelemetry.io/otel/sdk v1.26.0/go.mod h1:0p8MXpqLeJ0pzcszQQN4F0S5FVjBLgypeGSngLsmirs= go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= -go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= -go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= +go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA= +go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= 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.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= -go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.2.0 h1:TaP3xedm7JaAgScZO7tlvlKrqT0p7I6OsdGB5YNSMDU= go.uber.org/mock v0.2.0/go.mod h1:J0y0rp9L3xiff1+ZBfKxlC1fz2+aO16tw0tsDOixfuM= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -1415,8 +1413,8 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= 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.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1439,8 +1437,8 @@ golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1455,8 +1453,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20240213143201-ec583247a57a h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE= +golang.org/x/exp v0.0.0-20240213143201-ec583247a57a/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1548,8 +1546,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1711,8 +1709,8 @@ golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXR golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= -golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1724,8 +1722,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1798,8 +1796,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= -golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= +golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= +golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1989,8 +1987,8 @@ google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUE google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4= google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -2090,7 +2088,6 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= @@ -2106,16 +2103,16 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -k8s.io/api v0.29.3 h1:2ORfZ7+bGC3YJqGpV0KSDDEVf8hdGQ6A03/50vj8pmw= -k8s.io/api v0.29.3/go.mod h1:y2yg2NTyHUUkIoTC+phinTnEa3KFM6RZ3szxt014a80= -k8s.io/apimachinery v0.29.3 h1:2tbx+5L7RNvqJjn7RIuIKu9XTsIZ9Z5wX2G22XAa5EU= -k8s.io/apimachinery v0.29.3/go.mod h1:hx/S4V2PNW4OMg3WizRrHutyB5la0iCUbZym+W0EQIU= -k8s.io/client-go v0.29.2 h1:FEg85el1TeZp+/vYJM7hkDlSTFZ+c5nnK44DJ4FyoRg= -k8s.io/client-go v0.29.2/go.mod h1:knlvFZE58VpqbQpJNbCbctTVXcd35mMyAAwBdpt4jrA= -k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= -k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/api v0.28.2 h1:9mpl5mOb6vXZvqbQmankOfPIGiudghwCoLl1EYfUZbw= +k8s.io/api v0.28.2/go.mod h1:RVnJBsjU8tcMq7C3iaRSGMeaKt2TWEUXcpIt/90fjEg= +k8s.io/apimachinery v0.28.2 h1:KCOJLrc6gu+wV1BYgwik4AF4vXOlVJPdiqn0yAWWwXQ= +k8s.io/apimachinery v0.28.2/go.mod h1:RdzF87y/ngqk9H4z3EL2Rppv5jj95vGS/HaFXrLDApU= +k8s.io/client-go v0.28.2 h1:DNoYI1vGq0slMBN/SWKMZMw0Rq+0EQW6/AK4v9+3VeY= +k8s.io/client-go v0.28.2/go.mod h1:sMkApowspLuc7omj1FOSUxSoqjr+d5Q0Yc0LOFnYFJY= +k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= +k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= diff --git a/test/e2e/benchmark/benchmark.go b/test/e2e/benchmark/benchmark.go index fb192c2618..88f50de000 100644 --- a/test/e2e/benchmark/benchmark.go +++ b/test/e2e/benchmark/benchmark.go @@ -1,3 +1,4 @@ +//nolint:staticcheck package main import ( @@ -105,9 +106,6 @@ func (b *BenchmarkTest) Run() error { // add latency if specified in the manifest if b.manifest.EnableLatency { for _, node := range b.Nodes() { - if err = node.ForwardBitTwisterPort(); err != nil { - return fmt.Errorf("failed to forward bit twister port: %v", err) - } if err = node.Instance.SetLatencyAndJitter(b.manifest.LatencyParams. Latency, b.manifest.LatencyParams.Jitter); err != nil { return fmt.Errorf("failed to set latency and jitter: %v", err) diff --git a/test/e2e/major_upgrade_v2.go b/test/e2e/major_upgrade_v2.go index 0a4a399914..374c632de9 100644 --- a/test/e2e/major_upgrade_v2.go +++ b/test/e2e/major_upgrade_v2.go @@ -1,3 +1,4 @@ +//nolint:staticcheck package main import ( @@ -5,15 +6,12 @@ import ( "errors" "fmt" "log" - "strings" "time" "github.com/celestiaorg/celestia-app/v2/app" - "github.com/celestiaorg/celestia-app/v2/app/encoding" v1 "github.com/celestiaorg/celestia-app/v2/pkg/appconsts/v1" v2 "github.com/celestiaorg/celestia-app/v2/pkg/appconsts/v2" "github.com/celestiaorg/celestia-app/v2/test/e2e/testnet" - "github.com/celestiaorg/celestia-app/v2/test/txsim" "github.com/celestiaorg/knuu/pkg/knuu" "github.com/tendermint/tendermint/rpc/client/http" ) @@ -49,29 +47,23 @@ func MajorUpgradeToV2(logger *log.Logger) error { testnet.NoError("failed to create genesis node", err) } - kr, err := testNet.CreateAccount("alice", 1e12, "") - testnet.NoError("failed to create account", err) + logger.Println("Creating txsim") + endpoints, err := testNet.RemoteGRPCEndpoints() + testnet.NoError("failed to get remote gRPC endpoints", err) + err = testNet.CreateTxClient("txsim", testnet.TxsimVersion, 1, "100-2000", 100, testnet.DefaultResources, endpoints[0]) + testnet.NoError("failed to create tx client", err) logger.Println("Setting up testnet") testnet.NoError("Failed to setup testnet", testNet.Setup()) logger.Println("Starting testnet") testnet.NoError("Failed to start testnet", testNet.Start()) - errCh := make(chan error) - encCfg := encoding.MakeConfig(app.ModuleEncodingRegisters...) - opts := txsim.DefaultOptions().WithSeed(seed).SuppressLogs() - sequences := txsim.NewBlobSequence(txsim.NewRange(200, 4000), txsim.NewRange(1, 3)).Clone(5) - sequences = append(sequences, txsim.NewSendSequence(4, 1000, 100).Clone(5)...) - go func() { - errCh <- txsim.Run(ctx, testNet.GRPCEndpoints()[0], kr, encCfg, opts, sequences...) - }() - heightBefore := upgradeHeight - 1 for i := 0; i < numNodes; i++ { client, err := testNet.Node(i).Client() testnet.NoError("failed to get client", err) - testnet.NoError("failed to wait for height", waitForHeight(testNet, testNet.Node(i), upgradeHeight, time.Minute)) + testnet.NoError("failed to wait for height", waitForHeight(ctx, client, upgradeHeight, time.Minute)) resp, err := client.Header(ctx, &heightBefore) testnet.NoError("failed to get header", err) @@ -87,13 +79,8 @@ func MajorUpgradeToV2(logger *log.Logger) error { } } - // end txsim cancel() - err = <-errCh - if !strings.Contains(err.Error(), context.Canceled.Error()) { - return fmt.Errorf("expected context.Canceled error, got: %w", err) - } return nil } @@ -116,21 +103,24 @@ func getHeight(ctx context.Context, client *http.HTTP, period time.Duration) (in } } -func waitForHeight(testnet *testnet.Testnet, node *testnet.Node, height int64, period time.Duration) error { - timer := time.NewTimer(period) +func waitForHeight(ctx context.Context, client *http.HTTP, height int64, period time.Duration) error { + ctx, cancel := context.WithTimeout(ctx, period) + defer cancel() + ticker := time.NewTicker(100 * time.Millisecond) + defer ticker.Stop() + for { select { - case <-timer.C: - return fmt.Errorf("failed to reach height %d in %.2f seconds", height, period.Seconds()) + case <-ctx.Done(): + return fmt.Errorf("timeout waiting for height %d", height) case <-ticker.C: - executor, err := testnet.GetExecutor() - if err != nil { - return fmt.Errorf("failed to get executor: %w", err) - } - currentHeight, err := node.GetHeight(executor) + currentHeight, err := getHeight(ctx, client, period) if err != nil { - return err + if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) { + return err + } + continue } if currentHeight >= height { return nil diff --git a/test/e2e/minor_version_compatibility.go b/test/e2e/minor_version_compatibility.go index ca29305bcd..f9e3fb4710 100644 --- a/test/e2e/minor_version_compatibility.go +++ b/test/e2e/minor_version_compatibility.go @@ -1,8 +1,8 @@ +//nolint:staticcheck package main import ( "context" - "errors" "fmt" "log" "math/rand" @@ -12,11 +12,9 @@ import ( "time" "github.com/celestiaorg/celestia-app/v2/app" - "github.com/celestiaorg/celestia-app/v2/app/encoding" v1 "github.com/celestiaorg/celestia-app/v2/pkg/appconsts/v1" v2 "github.com/celestiaorg/celestia-app/v2/pkg/appconsts/v2" "github.com/celestiaorg/celestia-app/v2/test/e2e/testnet" - "github.com/celestiaorg/celestia-app/v2/test/txsim" "github.com/celestiaorg/knuu/pkg/knuu" ) @@ -37,6 +35,9 @@ func MinorVersionCompatibility(logger *log.Logger) error { testNet, err := testnet.New("runMinorVersionCompatibility", seed, nil, "test") testnet.NoError("failed to create testnet", err) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + defer testNet.Cleanup() testNet.SetConsensusParams(app.DefaultInitialConsensusParams()) @@ -57,8 +58,11 @@ func MinorVersionCompatibility(logger *log.Logger) error { testnet.NoError("failed to create genesis node", testNet.CreateGenesisNode(v, 10000000, 0, testnet.DefaultResources)) } - kr, err := testNet.CreateAccount("alice", 1e12, "") - testnet.NoError("failed to create account", err) + logger.Println("Creating txsim") + endpoints, err := testNet.RemoteGRPCEndpoints() + testnet.NoError("failed to get remote gRPC endpoints", err) + err = testNet.CreateTxClient("txsim", testnet.TxsimVersion, 1, "100-2000", 100, testnet.DefaultResources, endpoints[0]) + testnet.NoError("failed to create tx client", err) // start the testnet logger.Println("Setting up testnet") @@ -66,19 +70,6 @@ func MinorVersionCompatibility(logger *log.Logger) error { logger.Println("Starting testnet") testnet.NoError("Failed to start testnet", testNet.Start()) - // TODO: with upgrade tests we should simulate a far broader range of transactions - sequences := txsim.NewBlobSequence(txsim.NewRange(200, 4000), txsim.NewRange(1, 3)).Clone(5) - sequences = append(sequences, txsim.NewSendSequence(4, 1000, 100).Clone(5)...) - - errCh := make(chan error) - encCfg := encoding.MakeConfig(app.ModuleEncodingRegisters...) - opts := txsim.DefaultOptions().WithSeed(seed).SuppressLogs() - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - go func() { - errCh <- txsim.Run(ctx, testNet.GRPCEndpoints()[0], kr, encCfg, opts, sequences...) - }() - for i := 0; i < len(versions)*2; i++ { // FIXME: skip the first node because we need them available to // submit txs @@ -96,7 +87,7 @@ func MinorVersionCompatibility(logger *log.Logger) error { testnet.NoError("failed to upgrade node", testNet.Node(i%numNodes).Upgrade(newVersion)) time.Sleep(10 * time.Second) // wait for the node to reach two more heights - testnet.NoError("failed to wait for height", waitForHeight(testNet, testNet.Node(i%numNodes), heightBefore+2, 30*time.Second)) + testnet.NoError("failed to wait for height", waitForHeight(ctx, client, heightBefore+2, 30*time.Second)) } heights := make([]int64, 4) @@ -118,14 +109,6 @@ func MinorVersionCompatibility(logger *log.Logger) error { } } - // end the tx sim - cancel() - - err = <-errCh - - if !errors.Is(err, context.Canceled) { - return fmt.Errorf("expected context.Canceled error, got: %w", err) - } return nil } diff --git a/test/e2e/simple.go b/test/e2e/simple.go index 54e0f71a27..9cb2699310 100644 --- a/test/e2e/simple.go +++ b/test/e2e/simple.go @@ -2,16 +2,12 @@ package main import ( "context" - "errors" "fmt" "log" "time" - "github.com/celestiaorg/celestia-app/v2/app" - "github.com/celestiaorg/celestia-app/v2/app/encoding" "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" "github.com/celestiaorg/celestia-app/v2/test/e2e/testnet" - "github.com/celestiaorg/celestia-app/v2/test/txsim" "github.com/celestiaorg/celestia-app/v2/test/util/testnode" ) @@ -32,9 +28,11 @@ func E2ESimple(logger *log.Logger) error { logger.Println("Creating testnet validators") testnet.NoError("failed to create genesis nodes", testNet.CreateGenesisNodes(4, latestVersion, 10000000, 0, testnet.DefaultResources)) - logger.Println("Creating account") - kr, err := testNet.CreateAccount("alice", 1e12, "") - testnet.NoError("failed to create account", err) + logger.Println("Creating txsim") + endpoints, err := testNet.RemoteGRPCEndpoints() + testnet.NoError("failed to get remote gRPC endpoints", err) + err = testNet.CreateTxClient("txsim", testnet.TxsimVersion, 1, "100-2000", 100, testnet.DefaultResources, endpoints[0]) + testnet.NoError("failed to create tx client", err) logger.Println("Setting up testnets") testnet.NoError("failed to setup testnets", testNet.Setup()) @@ -42,19 +40,8 @@ func E2ESimple(logger *log.Logger) error { logger.Println("Starting testnets") testnet.NoError("failed to start testnets", testNet.Start()) - logger.Println("Running txsim") - sequences := txsim.NewBlobSequence(txsim.NewRange(200, 4000), txsim.NewRange(1, 3)).Clone(5) - sequences = append(sequences, txsim.NewSendSequence(4, 1000, 100).Clone(5)...) - - encCfg := encoding.MakeConfig(app.ModuleEncodingRegisters...) - ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) - defer cancel() - opts := txsim.DefaultOptions().WithSeed(seed).SuppressLogs() - err = txsim.Run(ctx, testNet.GRPCEndpoints()[0], kr, encCfg, opts, sequences...) - - if !errors.Is(err, context.DeadlineExceeded) { - return fmt.Errorf("expected context.DeadlineExceeded, got %w", err) - } + // wait for 30 seconds + time.Sleep(30 * time.Second) logger.Println("Reading blockchain") blockchain, err := testnode.ReadBlockchain(context.Background(), testNet.Node(0).AddressRPC()) diff --git a/test/e2e/testnet/defaults.go b/test/e2e/testnet/defaults.go index 06cc1d70d9..d4cf4c33a3 100644 --- a/test/e2e/testnet/defaults.go +++ b/test/e2e/testnet/defaults.go @@ -1,8 +1,8 @@ package testnet var DefaultResources = Resources{ - MemoryRequest: "200Mi", - MemoryLimit: "200Mi", + MemoryRequest: "400Mi", + MemoryLimit: "400Mi", CPU: "300m", Volume: "1Gi", } diff --git a/test/e2e/testnet/node.go b/test/e2e/testnet/node.go index ca7fe6133f..46a9db708e 100644 --- a/test/e2e/testnet/node.go +++ b/test/e2e/testnet/node.go @@ -1,8 +1,7 @@ +//nolint:staticcheck package testnet import ( - "context" - "errors" "fmt" "os" "path/filepath" @@ -44,9 +43,10 @@ type Node struct { SelfDelegation int64 Instance *knuu.Instance - rpcProxyPort int - grpcProxyPort int - traceProxyPort int + rpcProxyHost string + // FIXME: This does not work currently with the reverse proxy + // grpcProxyHost string + traceProxyHost string } // PullRoundStateTraces retrieves the round state traces from a node. @@ -244,16 +244,17 @@ func (n Node) AddressP2P(withID bool) string { } // AddressRPC returns an RPC endpoint address for the node. -// This returns the local proxy port that can be used to communicate with the node +// This returns the proxy host that can be used to communicate with the node func (n Node) AddressRPC() string { - return fmt.Sprintf("http://127.0.0.1:%d", n.rpcProxyPort) + return n.rpcProxyHost } -// AddressGRPC returns a GRPC endpoint address for the node. This returns the -// local proxy port that can be used to communicate with the node -func (n Node) AddressGRPC() string { - return fmt.Sprintf("127.0.0.1:%d", n.grpcProxyPort) -} +// FIXME: This does not work currently with the reverse proxy +// // AddressGRPC returns a GRPC endpoint address for the node. +// // This returns the proxy host that can be used to communicate with the node +// func (n Node) AddressGRPC() string { +// return n.grpcProxyHost +// } // RemoteAddressGRPC retrieves the gRPC endpoint address of a node within the cluster. func (n Node) RemoteAddressGRPC() (string, error) { @@ -274,7 +275,7 @@ func (n Node) RemoteAddressRPC() (string, error) { } func (n Node) AddressTracing() string { - return fmt.Sprintf("http://127.0.0.1:%d", n.traceProxyPort) + return n.traceProxyHost } func (n Node) RemoteAddressTracing() (string, error) { @@ -290,6 +291,7 @@ func (n Node) IsValidator() bool { } func (n Node) Client() (*http.HTTP, error) { + log.Debug().Str("RPC Address", n.AddressRPC()).Msg("Creating HTTP client for node") return http.New(n.AddressRPC(), "/websocket") } @@ -302,7 +304,26 @@ func (n *Node) Start() error { return err } - return n.forwardPorts() + err, rpcProxyHost := n.Instance.AddHost(rpcPort) + if err != nil { + return err + } + n.rpcProxyHost = rpcProxyHost + + // FIXME: This does not work currently with the reverse proxy + // err, grpcProxyHost := n.Instance.AddHost(grpcPort) + // if err != nil { + // return err + // } + // n.grpcProxyHost = grpcProxyHost + + err, traceProxyHost := n.Instance.AddHost(tracingPort) + if err != nil { + return err + } + n.traceProxyHost = traceProxyHost + + return nil } func (n *Node) GenesisValidator() genesis.Validator { @@ -325,59 +346,9 @@ func (n *Node) Upgrade(version string) error { if err := n.Instance.WaitInstanceIsRunning(); err != nil { return err } - - return n.forwardPorts() -} - -func (n *Node) forwardPorts() error { - rpcProxyPort, err := n.Instance.PortForwardTCP(rpcPort) - if err != nil { - return fmt.Errorf("forwarding port %d: %w", rpcPort, err) - } - - grpcProxyPort, err := n.Instance.PortForwardTCP(grpcPort) - if err != nil { - return fmt.Errorf("forwarding port %d: %w", grpcPort, err) - } - - traceProxyPort, err := n.Instance.PortForwardTCP(tracingPort) - if err != nil { - return fmt.Errorf("forwarding port %d: %w", tracingPort, err) - } - - n.rpcProxyPort = rpcProxyPort - n.grpcProxyPort = grpcProxyPort - n.traceProxyPort = traceProxyPort - - return nil -} - -func (n *Node) ForwardBitTwisterPort() error { - fwdBtPort, err := n.Instance.PortForwardTCP(n.Instance.BitTwister.Port()) - if err != nil { - return err - } - n.Instance.BitTwister.SetPort(fwdBtPort) - n.Instance.BitTwister.SetNewClientByIPAddr("http://localhost") - log.Info().Str("address", fmt.Sprintf("http://localhost:%d", fwdBtPort)).Msg("BitTwister is listening") return nil } func DockerImageName(version string) string { return fmt.Sprintf("%s:%s", dockerSrcURL, version) } - -func (n *Node) GetHeight(executor *knuu.Executor) (int64, error) { - status, err := getStatus(executor, n.Instance) - if err == nil { - blockHeight, err := latestBlockHeightFromStatus(status) - if err == nil { - return blockHeight, nil - } - } - if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) { - return 0, err - } - - return 0, fmt.Errorf("error getting height: %w", err) -} diff --git a/test/e2e/testnet/node_helpers.go b/test/e2e/testnet/node_helpers.go deleted file mode 100644 index 167434844d..0000000000 --- a/test/e2e/testnet/node_helpers.go +++ /dev/null @@ -1,80 +0,0 @@ -package testnet - -import ( - "context" - "encoding/json" - "fmt" - "strconv" - "time" - - "github.com/celestiaorg/knuu/pkg/knuu" -) - -type JSONRPCError struct { - Code int - Message string - Data string -} - -func (e *JSONRPCError) Error() string { - return fmt.Sprintf("JSONRPC Error - Code: %d, Message: %s, Data: %s", e.Code, e.Message, e.Data) -} - -func getStatus(executor *knuu.Executor, app *knuu.Instance) (string, error) { - nodeIP, err := app.GetIP() - if err != nil { - return "", fmt.Errorf("error getting node ip: %w", err) - } - - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) - defer cancel() - status, err := executor.ExecuteCommandWithContext(ctx, "wget", "-q", "-O", "-", fmt.Sprintf("%s:26657/status", nodeIP)) - if err != nil { - return "", fmt.Errorf("error executing command: %w", err) - } - return status, nil -} - -func latestBlockHeightFromStatus(status string) (int64, error) { - var result map[string]interface{} - err := json.Unmarshal([]byte(status), &result) - if err != nil { - return 0, fmt.Errorf("error unmarshalling status: %w", err) - } - - if errorField, ok := result["error"]; ok { - errorData, ok := errorField.(map[string]interface{}) - if !ok { - return 0, fmt.Errorf("error field exists but is not a map[string]interface{}") - } - jsonError := &JSONRPCError{} - if errorCode, ok := errorData["code"].(float64); ok { - jsonError.Code = int(errorCode) - } - if errorMessage, ok := errorData["message"].(string); ok { - jsonError.Message = errorMessage - } - if errorData, ok := errorData["data"].(string); ok { - jsonError.Data = errorData - } - return 0, jsonError - } - - resultData, ok := result["result"].(map[string]interface{}) - if !ok { - return 0, fmt.Errorf("error getting result from status") - } - syncInfo, ok := resultData["sync_info"].(map[string]interface{}) - if !ok { - return 0, fmt.Errorf("error getting sync info from status") - } - latestBlockHeight, ok := syncInfo["latest_block_height"].(string) - if !ok { - return 0, fmt.Errorf("error getting latest block height from sync info") - } - latestBlockHeightInt, err := strconv.ParseInt(latestBlockHeight, 10, 64) - if err != nil { - return 0, fmt.Errorf("error converting latest block height to int: %w", err) - } - return latestBlockHeightInt, nil -} diff --git a/test/e2e/testnet/testnet.go b/test/e2e/testnet/testnet.go index fe6ad5325a..394d6eada5 100644 --- a/test/e2e/testnet/testnet.go +++ b/test/e2e/testnet/testnet.go @@ -1,3 +1,4 @@ +//nolint:staticcheck package testnet import ( @@ -20,20 +21,12 @@ import ( type Testnet struct { seed int64 nodes []*Node - executor *knuu.Executor genesis *genesis.Genesis keygen *keyGenerator grafana *GrafanaInfo txClients []*TxSim } -func (t *Testnet) GetExecutor() (*knuu.Executor, error) { - if t.executor == nil { - return nil, fmt.Errorf("testnet not initialized") - } - return t.executor, nil -} - func New(name string, seed int64, grafana *GrafanaInfo, chainID string, genesisModifiers ...genesis.Modifier) ( *Testnet, error, @@ -43,18 +36,12 @@ func New(name string, seed int64, grafana *GrafanaInfo, chainID string, return nil, err } - executor, err := knuu.NewExecutor() - if err != nil { - return nil, err - } - return &Testnet{ - seed: seed, - nodes: make([]*Node, 0), - genesis: genesis.NewDefaultGenesis().WithChainID(chainID).WithModifiers(genesisModifiers...), - keygen: newKeyGenerator(seed), - grafana: grafana, - executor: executor, + seed: seed, + nodes: make([]*Node, 0), + genesis: genesis.NewDefaultGenesis().WithChainID(chainID).WithModifiers(genesisModifiers...), + keygen: newKeyGenerator(seed), + grafana: grafana, }, nil } @@ -282,13 +269,14 @@ func (t *Testnet) RPCEndpoints() []string { return rpcEndpoints } -func (t *Testnet) GRPCEndpoints() []string { - grpcEndpoints := make([]string, len(t.nodes)) - for idx, node := range t.nodes { - grpcEndpoints[idx] = node.AddressGRPC() - } - return grpcEndpoints -} +// FIXME: This does not work currently with the reverse proxy +// func (t *Testnet) GRPCEndpoints() []string { +// grpcEndpoints := make([]string, len(t.nodes)) +// for idx, node := range t.nodes { +// grpcEndpoints[idx] = node.AddressGRPC() +// } +// return grpcEndpoints +// } // RemoteGRPCEndpoints retrieves the gRPC endpoint addresses of the // testnet's validator nodes. @@ -339,6 +327,10 @@ func (t *Testnet) Start() error { return fmt.Errorf("node %s failed to start: %w", node.Name, err) } } + err := t.StartTxClients() + if err != nil { + return err + } for _, node := range genesisNodes { client, err := node.Client() if err != nil { @@ -347,7 +339,11 @@ func (t *Testnet) Start() error { for i := 0; i < 10; i++ { resp, err := client.Status(context.Background()) if err != nil { - return fmt.Errorf("node %s status response: %w", node.Name, err) + if i == 9 { + return fmt.Errorf("node %s status response: %w", node.Name, err) + } + time.Sleep(time.Second) + continue } if resp.SyncInfo.LatestBlockHeight > 0 { break @@ -399,7 +395,7 @@ func (t *Testnet) Cleanup() { if err != nil { log.Err(err). Str("name", txsim.Name). - Msg("txsim failed to stop") + Msg("failed to wait for txsim to stop") } err = txsim.Instance.Destroy() if err != nil { @@ -409,9 +405,6 @@ func (t *Testnet) Cleanup() { } } } - if err := t.executor.Destroy(); err != nil { - log.Err(err).Msg("executor failed to cleanup") - } } func (t *Testnet) Node(i int) *Node { diff --git a/test/e2e/testnet/txsimNode.go b/test/e2e/testnet/txsimNode.go index 338ca3754b..994d87a831 100644 --- a/test/e2e/testnet/txsimNode.go +++ b/test/e2e/testnet/txsimNode.go @@ -1,3 +1,4 @@ +//nolint:staticcheck package testnet import ( From 3bc4d14ffe0aad19b12d09857f4af91e6b2c20e6 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Tue, 18 Jun 2024 15:09:54 +0200 Subject: [PATCH 05/10] feat: add grpc query server for minfee (#3565) Closes: #3539 Creates a grpc query server for easier querying of the min gas price. During this PR I had a change of heart and wanted to call `GlobalMinGasPrice` to `NetworkMinGasPrice` as I felt this was somewhat more accurate. Let me know how you guys feel? --------- Co-authored-by: Rootul P --- proto/celestia/minfee/v1/query.proto | 28 ++ x/minfee/grpc_query.go | 34 ++ x/minfee/grpc_query_test.go | 28 ++ x/minfee/module.go | 4 +- x/minfee/query.pb.go | 533 +++++++++++++++++++++++++++ x/minfee/query.pb.gw.go | 153 ++++++++ 6 files changed, 779 insertions(+), 1 deletion(-) create mode 100644 proto/celestia/minfee/v1/query.proto create mode 100644 x/minfee/grpc_query.go create mode 100644 x/minfee/grpc_query_test.go create mode 100644 x/minfee/query.pb.go create mode 100644 x/minfee/query.pb.gw.go diff --git a/proto/celestia/minfee/v1/query.proto b/proto/celestia/minfee/v1/query.proto new file mode 100644 index 0000000000..83f830e51e --- /dev/null +++ b/proto/celestia/minfee/v1/query.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +package celestia.minfee.v1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/celestiaorg/celestia-app/x/minfee"; + +// Query defines the gRPC querier service. +service Query { + // NetworkMinGasPrice queries the network wide minimum gas price. + rpc NetworkMinGasPrice(QueryNetworkMinGasPrice) returns (QueryNetworkMinGasPriceResponse) { + option (google.api.http).get = "/celestia/minfee/v1/min_gas_price"; + } +} + +// QueryNetworkMinGasPrice is the request type for the Query/NetworkMinGasPrice RPC method. +message QueryNetworkMinGasPrice {} + +// QueryNetworkMinGasPriceResponse is the response type for Query/NetworkMinGasPrice RPC method. +message QueryNetworkMinGasPriceResponse { + string network_min_gas_price = 1 [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/x/minfee/grpc_query.go b/x/minfee/grpc_query.go new file mode 100644 index 0000000000..c76d39722c --- /dev/null +++ b/x/minfee/grpc_query.go @@ -0,0 +1,34 @@ +package minfee + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/params/keeper" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +var _ QueryServer = &QueryServerImpl{} + +// QueryServerImpl wraps the params keeper and implements the minfee gRPC query server. +type QueryServerImpl struct { + paramsKeeper keeper.Keeper +} + +// NewQueryServerImpl creates a new QueryServerImpl. +func NewQueryServerImpl(paramsKeeper keeper.Keeper) *QueryServerImpl { + return &QueryServerImpl{paramsKeeper: paramsKeeper} +} + +// NetworkMinGasPrice returns the network minimum gas price. +func (q *QueryServerImpl) NetworkMinGasPrice(ctx context.Context, _ *QueryNetworkMinGasPrice) (*QueryNetworkMinGasPriceResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + var params Params + subspace, found := q.paramsKeeper.GetSubspace(ModuleName) + if !found { + return nil, status.Errorf(codes.NotFound, "subspace not found for minfee. Minfee is only active in app version 2 and onwards") + } + subspace.GetParamSet(sdkCtx, ¶ms) + return &QueryNetworkMinGasPriceResponse{NetworkMinGasPrice: params.GlobalMinGasPrice}, nil +} diff --git a/x/minfee/grpc_query_test.go b/x/minfee/grpc_query_test.go new file mode 100644 index 0000000000..0cbc90b7d8 --- /dev/null +++ b/x/minfee/grpc_query_test.go @@ -0,0 +1,28 @@ +package minfee_test + +import ( + "testing" + + "github.com/celestiaorg/celestia-app/v2/app" + v2 "github.com/celestiaorg/celestia-app/v2/pkg/appconsts/v2" + testutil "github.com/celestiaorg/celestia-app/v2/test/util" + "github.com/celestiaorg/celestia-app/v2/x/minfee" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" +) + +func TestQueryNetworkMinGasPrice(t *testing.T) { + testApp, _, _ := testutil.NewTestAppWithGenesisSet(app.DefaultConsensusParams()) + queryServer := minfee.NewQueryServerImpl(testApp.ParamsKeeper) + + sdkCtx := testApp.NewContext(false, tmproto.Header{Height: 1}) + ctx := sdk.WrapSDKContext(sdkCtx) + + // Perform a query for the network minimum gas price + resp, err := queryServer.NetworkMinGasPrice(ctx, &minfee.QueryNetworkMinGasPrice{}) + require.NoError(t, err) + + // Check the response + require.Equal(t, v2.GlobalMinGasPrice, resp.NetworkMinGasPrice.MustFloat64()) +} diff --git a/x/minfee/module.go b/x/minfee/module.go index c3f3eae354..989351650e 100644 --- a/x/minfee/module.go +++ b/x/minfee/module.go @@ -109,7 +109,9 @@ func (am AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { } // RegisterServices registers module services. -func (am AppModule) RegisterServices(_ sdkmodule.Configurator) {} +func (am AppModule) RegisterServices(cfg sdkmodule.Configurator) { + RegisterQueryServer(cfg.QueryServer(), NewQueryServerImpl(am.paramsKeeper)) +} // InitGenesis performs genesis initialization for the minfee module. It returns no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { diff --git a/x/minfee/query.pb.go b/x/minfee/query.pb.go new file mode 100644 index 0000000000..5a01fc9ca6 --- /dev/null +++ b/x/minfee/query.pb.go @@ -0,0 +1,533 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: celestia/minfee/v1/query.proto + +package minfee + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryNetworkMinGasPrice is the request type for the Query/NetworkMinGasPrice RPC method. +type QueryNetworkMinGasPrice struct { +} + +func (m *QueryNetworkMinGasPrice) Reset() { *m = QueryNetworkMinGasPrice{} } +func (m *QueryNetworkMinGasPrice) String() string { return proto.CompactTextString(m) } +func (*QueryNetworkMinGasPrice) ProtoMessage() {} +func (*QueryNetworkMinGasPrice) Descriptor() ([]byte, []int) { + return fileDescriptor_4c41d9a8b7bf8984, []int{0} +} +func (m *QueryNetworkMinGasPrice) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNetworkMinGasPrice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNetworkMinGasPrice.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryNetworkMinGasPrice) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNetworkMinGasPrice.Merge(m, src) +} +func (m *QueryNetworkMinGasPrice) XXX_Size() int { + return m.Size() +} +func (m *QueryNetworkMinGasPrice) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNetworkMinGasPrice.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNetworkMinGasPrice proto.InternalMessageInfo + +// QueryNetworkMinGasPriceResponse is the response type for Query/NetworkMinGasPrice RPC method. +type QueryNetworkMinGasPriceResponse struct { + NetworkMinGasPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=network_min_gas_price,json=networkMinGasPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"network_min_gas_price"` +} + +func (m *QueryNetworkMinGasPriceResponse) Reset() { *m = QueryNetworkMinGasPriceResponse{} } +func (m *QueryNetworkMinGasPriceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryNetworkMinGasPriceResponse) ProtoMessage() {} +func (*QueryNetworkMinGasPriceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4c41d9a8b7bf8984, []int{1} +} +func (m *QueryNetworkMinGasPriceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryNetworkMinGasPriceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryNetworkMinGasPriceResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryNetworkMinGasPriceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryNetworkMinGasPriceResponse.Merge(m, src) +} +func (m *QueryNetworkMinGasPriceResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryNetworkMinGasPriceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryNetworkMinGasPriceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryNetworkMinGasPriceResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*QueryNetworkMinGasPrice)(nil), "celestia.minfee.v1.QueryNetworkMinGasPrice") + proto.RegisterType((*QueryNetworkMinGasPriceResponse)(nil), "celestia.minfee.v1.QueryNetworkMinGasPriceResponse") +} + +func init() { proto.RegisterFile("celestia/minfee/v1/query.proto", fileDescriptor_4c41d9a8b7bf8984) } + +var fileDescriptor_4c41d9a8b7bf8984 = []byte{ + // 336 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0x4e, 0xcd, 0x49, + 0x2d, 0x2e, 0xc9, 0x4c, 0xd4, 0xcf, 0xcd, 0xcc, 0x4b, 0x4b, 0x4d, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, + 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0xc9, 0xeb, 0x41, + 0xe4, 0xf5, 0xca, 0x0c, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0xd2, 0xfa, 0x20, 0x16, 0x44, + 0xa5, 0x94, 0x4c, 0x7a, 0x7e, 0x7e, 0x7a, 0x4e, 0xaa, 0x7e, 0x62, 0x41, 0xa6, 0x7e, 0x62, 0x5e, + 0x5e, 0x7e, 0x49, 0x62, 0x49, 0x66, 0x7e, 0x5e, 0x31, 0x54, 0x56, 0x32, 0x39, 0xbf, 0x38, 0x37, + 0xbf, 0x38, 0x1e, 0xa2, 0x0d, 0xc2, 0x81, 0x48, 0x29, 0x49, 0x72, 0x89, 0x07, 0x82, 0x6c, 0xf4, + 0x4b, 0x2d, 0x29, 0xcf, 0x2f, 0xca, 0xf6, 0xcd, 0xcc, 0x73, 0x4f, 0x2c, 0x0e, 0x28, 0xca, 0x4c, + 0x4e, 0x55, 0x9a, 0xc4, 0xc8, 0x25, 0x8f, 0x43, 0x2e, 0x28, 0xb5, 0xb8, 0x20, 0x3f, 0xaf, 0x38, + 0x55, 0x28, 0x9f, 0x4b, 0x34, 0x0f, 0x22, 0x1b, 0x9f, 0x9b, 0x99, 0x17, 0x9f, 0x9e, 0x08, 0xb2, + 0x24, 0x33, 0x39, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0xd3, 0xc9, 0xe6, 0xc4, 0x3d, 0x79, 0x86, + 0x5b, 0xf7, 0xe4, 0xd5, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xa1, 0xd6, + 0x43, 0x29, 0xdd, 0xe2, 0x94, 0x6c, 0xfd, 0x92, 0xca, 0x82, 0xd4, 0x62, 0x3d, 0x97, 0xd4, 0xe4, + 0x4b, 0x5b, 0x74, 0xb9, 0xa0, 0xae, 0x73, 0x49, 0x4d, 0x0e, 0x12, 0xca, 0xc3, 0xb0, 0xd8, 0x68, + 0x35, 0x23, 0x17, 0x2b, 0xd8, 0x51, 0x42, 0x0b, 0x19, 0xb9, 0x84, 0x30, 0x5d, 0x26, 0xa4, 0xad, + 0x87, 0x19, 0x68, 0x7a, 0x38, 0xbc, 0x21, 0x65, 0x4c, 0x82, 0x62, 0x98, 0x9f, 0x95, 0x34, 0x9b, + 0x2e, 0x3f, 0x99, 0xcc, 0xa4, 0x2c, 0xa4, 0xa8, 0x8f, 0x25, 0xfa, 0x50, 0x42, 0xc1, 0xc9, 0xed, + 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, + 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x74, 0x90, 0x43, 0x04, 0x6a, 0x4c, + 0x7e, 0x51, 0x3a, 0x9c, 0xad, 0x9b, 0x58, 0x50, 0xa0, 0x5f, 0x01, 0x35, 0x38, 0x89, 0x0d, 0x1c, + 0x59, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x49, 0xc3, 0x8f, 0xd9, 0x31, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // NetworkMinGasPrice queries the network wide minimum gas price. + NetworkMinGasPrice(ctx context.Context, in *QueryNetworkMinGasPrice, opts ...grpc.CallOption) (*QueryNetworkMinGasPriceResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) NetworkMinGasPrice(ctx context.Context, in *QueryNetworkMinGasPrice, opts ...grpc.CallOption) (*QueryNetworkMinGasPriceResponse, error) { + out := new(QueryNetworkMinGasPriceResponse) + err := c.cc.Invoke(ctx, "/celestia.minfee.v1.Query/NetworkMinGasPrice", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // NetworkMinGasPrice queries the network wide minimum gas price. + NetworkMinGasPrice(context.Context, *QueryNetworkMinGasPrice) (*QueryNetworkMinGasPriceResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) NetworkMinGasPrice(ctx context.Context, req *QueryNetworkMinGasPrice) (*QueryNetworkMinGasPriceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NetworkMinGasPrice not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_NetworkMinGasPrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryNetworkMinGasPrice) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).NetworkMinGasPrice(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/celestia.minfee.v1.Query/NetworkMinGasPrice", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).NetworkMinGasPrice(ctx, req.(*QueryNetworkMinGasPrice)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "celestia.minfee.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "NetworkMinGasPrice", + Handler: _Query_NetworkMinGasPrice_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "celestia/minfee/v1/query.proto", +} + +func (m *QueryNetworkMinGasPrice) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryNetworkMinGasPrice) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNetworkMinGasPrice) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryNetworkMinGasPriceResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryNetworkMinGasPriceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryNetworkMinGasPriceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.NetworkMinGasPrice.Size() + i -= size + if _, err := m.NetworkMinGasPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryNetworkMinGasPrice) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryNetworkMinGasPriceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.NetworkMinGasPrice.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryNetworkMinGasPrice) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNetworkMinGasPrice: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNetworkMinGasPrice: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryNetworkMinGasPriceResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryNetworkMinGasPriceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryNetworkMinGasPriceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NetworkMinGasPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.NetworkMinGasPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/minfee/query.pb.gw.go b/x/minfee/query.pb.gw.go new file mode 100644 index 0000000000..0cb625e72d --- /dev/null +++ b/x/minfee/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: celestia/minfee/v1/query.proto + +/* +Package minfee is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package minfee + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_NetworkMinGasPrice_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNetworkMinGasPrice + var metadata runtime.ServerMetadata + + msg, err := client.NetworkMinGasPrice(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_NetworkMinGasPrice_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryNetworkMinGasPrice + var metadata runtime.ServerMetadata + + msg, err := server.NetworkMinGasPrice(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_NetworkMinGasPrice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_NetworkMinGasPrice_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NetworkMinGasPrice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_NetworkMinGasPrice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_NetworkMinGasPrice_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_NetworkMinGasPrice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_NetworkMinGasPrice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"celestia", "minfee", "v1", "min_gas_price"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_NetworkMinGasPrice_0 = runtime.ForwardResponseMessage +) From 6171e5c03b53f594cc14bf3d2cc4876d9e8948f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 15:14:21 +0200 Subject: [PATCH 06/10] chore(deps): Bump celestiaorg/.github from 0.4.2 to 0.4.3 (#3577) --- .github/workflows/create_release_tracking_epic.yml | 2 +- .github/workflows/docker-build-publish.yml | 4 ++-- .github/workflows/lint.yml | 4 ++-- .github/workflows/pr-review-requester.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/create_release_tracking_epic.yml b/.github/workflows/create_release_tracking_epic.yml index 08f6fd7bce..2fa90be14a 100644 --- a/.github/workflows/create_release_tracking_epic.yml +++ b/.github/workflows/create_release_tracking_epic.yml @@ -7,7 +7,7 @@ on: types: [released] jobs: trigger_issue: - uses: celestiaorg/.github/.github/workflows/reusable_create_release_tracking_epic.yml@v0.4.2 + uses: celestiaorg/.github/.github/workflows/reusable_create_release_tracking_epic.yml@v0.4.3 secrets: inherit with: release-repo: ${{ github.repository }} diff --git a/.github/workflows/docker-build-publish.yml b/.github/workflows/docker-build-publish.yml index 39f7e01c36..f805f343dd 100644 --- a/.github/workflows/docker-build-publish.yml +++ b/.github/workflows/docker-build-publish.yml @@ -20,7 +20,7 @@ jobs: permissions: contents: write packages: write - uses: celestiaorg/.github/.github/workflows/reusable_dockerfile_pipeline.yml@v0.4.2 + uses: celestiaorg/.github/.github/workflows/reusable_dockerfile_pipeline.yml@v0.4.3 with: dockerfile: Dockerfile secrets: inherit @@ -29,7 +29,7 @@ jobs: permissions: contents: write packages: write - uses: celestiaorg/.github/.github/workflows/reusable_dockerfile_pipeline.yml@v0.4.2 + uses: celestiaorg/.github/.github/workflows/reusable_dockerfile_pipeline.yml@v0.4.3 with: dockerfile: docker/Dockerfile_txsim packageName: txsim diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f63b6cc488..73923e88be 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -30,10 +30,10 @@ jobs: # hadolint lints the Dockerfile hadolint: - uses: celestiaorg/.github/.github/workflows/reusable_dockerfile_lint.yml@v0.4.2 + uses: celestiaorg/.github/.github/workflows/reusable_dockerfile_lint.yml@v0.4.3 yamllint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: celestiaorg/.github/.github/actions/yamllint@v0.4.2 + - uses: celestiaorg/.github/.github/actions/yamllint@v0.4.3 diff --git a/.github/workflows/pr-review-requester.yml b/.github/workflows/pr-review-requester.yml index d863065cb8..a46df08794 100644 --- a/.github/workflows/pr-review-requester.yml +++ b/.github/workflows/pr-review-requester.yml @@ -11,7 +11,7 @@ on: jobs: auto-request-review: name: Auto request reviews - uses: celestiaorg/.github/.github/workflows/reusable_housekeeping.yml@v0.4.2 + uses: celestiaorg/.github/.github/workflows/reusable_housekeeping.yml@v0.4.3 secrets: inherit # write access for issues and pull requests is needed because the called # workflow requires write access to issues and pull requests and the From 4c732d312032d96466b06e5f5b7db98268f2b1b1 Mon Sep 17 00:00:00 2001 From: Rootul P Date: Tue, 18 Jun 2024 09:24:39 -0600 Subject: [PATCH 07/10] refactor(x/minfee)!: rename to network min gas price (#3575) Closes https://github.com/celestiaorg/celestia-app/issues/3568 ## Testing Started a node and then: ```shell $ celestia-appd query params subspace minfee NetworkMinGasPrice key: NetworkMinGasPrice subspace: minfee value: '"0.000001000000000000"' ``` --- app/ante/fee_checker.go | 20 +++++++------- app/ante/min_fee_test.go | 16 ++++++------ app/test/upgrade_test.go | 6 ++--- local_devnet/celestia-app/genesis.json | 2 +- pkg/appconsts/v2/app_consts.go | 6 ++--- pkg/user/tx_client.go | 24 ++++++++--------- proto/celestia/minfee/v1/genesis.proto | 2 +- specs/src/specs/params.md | 8 +++--- specs/src/specs/resource_pricing.md | 6 ++--- test/tokenfilter/setup.go | 2 +- x/minfee/README.md | 2 +- x/minfee/genesis.go | 12 ++++----- x/minfee/genesis.pb.go | 36 +++++++++++++------------- x/minfee/module.go | 8 +++--- x/minfee/params.go | 14 +++++----- x/paramfilter/test/gov_params_test.go | 6 ++--- 16 files changed, 85 insertions(+), 85 deletions(-) diff --git a/app/ante/fee_checker.go b/app/ante/fee_checker.go index a77610b50c..fbfb18adf3 100644 --- a/app/ante/fee_checker.go +++ b/app/ante/fee_checker.go @@ -27,7 +27,7 @@ func ValidateTxFeeWrapper(paramKeeper params.Keeper) ante.TxFeeChecker { // ValidateTxFee implements default fee validation logic for transactions. // It ensures that the provided transaction fee meets a minimum threshold for the node -// as well as a global minimum threshold and computes the tx priority based on the gas price. +// as well as a network minimum threshold and computes the tx priority based on the gas price. func ValidateTxFee(ctx sdk.Context, tx sdk.Tx, paramKeeper params.Keeper) (sdk.Coins, int64, error) { feeTx, ok := tx.(sdk.FeeTx) if !ok { @@ -50,24 +50,24 @@ func ValidateTxFee(ctx sdk.Context, tx sdk.Tx, paramKeeper params.Keeper) (sdk.C } } - // Ensure that the provided fee meets a global minimum threshold. - // Global minimum fee only applies to app versions greater than one + // Ensure that the provided fee meets a network minimum threshold. + // Network minimum fee only applies to app versions greater than one. if ctx.BlockHeader().Version.App > v1.Version { subspace, exists := paramKeeper.GetSubspace(minfee.ModuleName) if !exists { return nil, 0, errors.Wrap(sdkerror.ErrInvalidRequest, "minfee is not a registered subspace") } - if !subspace.Has(ctx, minfee.KeyGlobalMinGasPrice) { - return nil, 0, errors.Wrap(sdkerror.ErrKeyNotFound, "GlobalMinGasPrice") + if !subspace.Has(ctx, minfee.KeyNetworkMinGasPrice) { + return nil, 0, errors.Wrap(sdkerror.ErrKeyNotFound, "NetworkMinGasPrice") } - var globalMinGasPrice sdk.Dec - // Gets the global minimum gas price from the param store - // panics if not configured properly - subspace.Get(ctx, minfee.KeyGlobalMinGasPrice, &globalMinGasPrice) + var networkMinGasPrice sdk.Dec + // Gets the network minimum gas price from the param store. + // Panics if not configured properly. + subspace.Get(ctx, minfee.KeyNetworkMinGasPrice, &networkMinGasPrice) - err := verifyMinFee(fee, gas, globalMinGasPrice, "insufficient gas price for the network") + err := verifyMinFee(fee, gas, networkMinGasPrice, "insufficient gas price for the network") if err != nil { return nil, 0, err } diff --git a/app/ante/min_fee_test.go b/app/ante/min_fee_test.go index fa3eff573b..6aa85c48f1 100644 --- a/app/ante/min_fee_test.go +++ b/app/ante/min_fee_test.go @@ -26,7 +26,7 @@ import ( tmdb "github.com/tendermint/tm-db" ) -func TestCheckTxFeeWithGlobalMinGasPrices(t *testing.T) { +func TestValidateTxFee(t *testing.T) { encCfg := encoding.MakeConfig(app.ModuleEncodingRegisters...) builder := encCfg.TxConfig.NewTxBuilder() @@ -58,7 +58,7 @@ func TestCheckTxFeeWithGlobalMinGasPrices(t *testing.T) { { name: "bad tx; fee below required minimum", fee: sdk.NewCoins(sdk.NewInt64Coin(appconsts.BondDenom, feeAmount-1)), - gasLimit: uint64(float64(feeAmount) / v2.GlobalMinGasPrice), + gasLimit: uint64(float64(feeAmount) / v2.NetworkMinGasPrice), appVersion: uint64(2), isCheckTx: false, expErr: true, @@ -66,7 +66,7 @@ func TestCheckTxFeeWithGlobalMinGasPrices(t *testing.T) { { name: "good tx; fee equal to required minimum", fee: sdk.NewCoins(sdk.NewInt64Coin(appconsts.BondDenom, feeAmount)), - gasLimit: uint64(float64(feeAmount) / v2.GlobalMinGasPrice), + gasLimit: uint64(float64(feeAmount) / v2.NetworkMinGasPrice), appVersion: uint64(2), isCheckTx: false, expErr: false, @@ -74,7 +74,7 @@ func TestCheckTxFeeWithGlobalMinGasPrices(t *testing.T) { { name: "good tx; fee above required minimum", fee: sdk.NewCoins(sdk.NewInt64Coin(appconsts.BondDenom, feeAmount+1)), - gasLimit: uint64(float64(feeAmount) / v2.GlobalMinGasPrice), + gasLimit: uint64(float64(feeAmount) / v2.NetworkMinGasPrice), appVersion: uint64(2), isCheckTx: false, expErr: false, @@ -82,7 +82,7 @@ func TestCheckTxFeeWithGlobalMinGasPrices(t *testing.T) { { name: "good tx; with no fee (v1)", fee: sdk.NewCoins(sdk.NewInt64Coin(appconsts.BondDenom, feeAmount)), - gasLimit: uint64(float64(feeAmount) / v2.GlobalMinGasPrice), + gasLimit: uint64(float64(feeAmount) / v2.NetworkMinGasPrice), appVersion: uint64(1), isCheckTx: false, expErr: false, @@ -143,12 +143,12 @@ func TestCheckTxFeeWithGlobalMinGasPrices(t *testing.T) { ctx = ctx.WithMinGasPrices(sdk.DecCoins{validatorMinGasPriceCoin}) - globalminGasPriceDec, err := sdk.NewDecFromStr(fmt.Sprintf("%f", v2.GlobalMinGasPrice)) + networkMinGasPriceDec, err := sdk.NewDecFromStr(fmt.Sprintf("%f", v2.NetworkMinGasPrice)) require.NoError(t, err) subspace, _ := paramsKeeper.GetSubspace(minfee.ModuleName) subspace = minfee.RegisterMinFeeParamTable(subspace) - subspace.Set(ctx, minfee.KeyGlobalMinGasPrice, globalminGasPriceDec) + subspace.Set(ctx, minfee.KeyNetworkMinGasPrice, networkMinGasPriceDec) _, _, err = ante.ValidateTxFee(ctx, tx, paramsKeeper) if tc.expErr { @@ -173,7 +173,7 @@ func setUp(t *testing.T) (paramkeeper.Keeper, storetypes.CommitMultiStore) { registry := codectypes.NewInterfaceRegistry() - // Create a params keeper and set the global min gas price + // Create a params keeper and set the network min gas price. paramsKeeper := paramkeeper.NewKeeper(codec.NewProtoCodec(registry), codec.NewLegacyAmino(), storeKey, tStoreKey) paramsKeeper.Subspace(minfee.ModuleName) return paramsKeeper, stateStore diff --git a/app/test/upgrade_test.go b/app/test/upgrade_test.go index 350f7bcd2f..b80321204b 100644 --- a/app/test/upgrade_test.go +++ b/app/test/upgrade_test.go @@ -30,7 +30,7 @@ import ( // TestAppUpgrades verifies that the all module's params are overridden during an // upgrade from v1 -> v2 and the app version changes correctly. func TestAppUpgrades(t *testing.T) { - GlobalMinGasPriceDec, err := sdk.NewDecFromStr(fmt.Sprintf("%f", v2.GlobalMinGasPrice)) + NetworkMinGasPriceDec, err := sdk.NewDecFromStr(fmt.Sprintf("%f", v2.NetworkMinGasPrice)) require.NoError(t, err) tests := []struct { @@ -42,8 +42,8 @@ func TestAppUpgrades(t *testing.T) { { module: "MinFee", subspace: minfee.ModuleName, - key: string(minfee.KeyGlobalMinGasPrice), - expectedValue: GlobalMinGasPriceDec.String(), + key: string(minfee.KeyNetworkMinGasPrice), + expectedValue: NetworkMinGasPriceDec.String(), }, { module: "ICA", diff --git a/local_devnet/celestia-app/genesis.json b/local_devnet/celestia-app/genesis.json index 7ba5ddeb91..bcdf09ae24 100644 --- a/local_devnet/celestia-app/genesis.json +++ b/local_devnet/celestia-app/genesis.json @@ -342,7 +342,7 @@ } }, "minfee": { - "global_min_gas_price": "0.000001000000000000" + "network_min_gas_price": "0.000001000000000000" }, "mint": { "bond_denom": "utia" diff --git a/pkg/appconsts/v2/app_consts.go b/pkg/appconsts/v2/app_consts.go index 3f1a042579..2ef7a4075c 100644 --- a/pkg/appconsts/v2/app_consts.go +++ b/pkg/appconsts/v2/app_consts.go @@ -4,7 +4,7 @@ const ( Version uint64 = 2 SquareSizeUpperBound int = 128 SubtreeRootThreshold int = 64 - // GlobalMinGasPrice is used by x/minfee to prevent transactions from being - // included in a block if they specify a gas price lower than this - GlobalMinGasPrice float64 = 0.000001 // utia + // NetworkMinGasPrice is used by x/minfee to prevent transactions from being + // included in a block if they specify a gas price lower than this. + NetworkMinGasPrice float64 = 0.000001 // utia ) diff --git a/pkg/user/tx_client.go b/pkg/user/tx_client.go index a220a00ec1..b8818a7c89 100644 --- a/pkg/user/tx_client.go +++ b/pkg/user/tx_client.go @@ -220,7 +220,7 @@ func (client *TxClient) SubmitPayForBlobWithAccount(ctx context.Context, account // BroadcastPayForBlob signs and broadcasts a transaction to pay for blobs. // It does not confirm that the transaction has been committed on chain. // If no gas or gas price is set, it will estimate the gas and use -// the max effective gas price: max(localMinGasPrice, globalMinGasPrice). +// the max effective gas price: max(localMinGasPrice, networkMinGasPrice). func (client *TxClient) BroadcastPayForBlob(ctx context.Context, blobs []*blob.Blob, opts ...TxOption) (*sdktypes.TxResponse, error) { return client.BroadcastPayForBlobWithAccount(ctx, client.defaultAccount, blobs, opts...) } @@ -559,7 +559,7 @@ func (client *TxClient) SetGasMultiplier(multiplier float64) { } // QueryMinimumGasPrice queries both the nodes local and network wide -// minimum gas prices, returning the maximum of the two +// minimum gas prices, returning the maximum of the two. func QueryMinimumGasPrice(ctx context.Context, grpcConn *grpc.ClientConn) (float64, error) { cfgRsp, err := nodeservice.NewServiceClient(grpcConn).Config(ctx, &nodeservice.ConfigRequest{}) if err != nil { @@ -572,7 +572,7 @@ func QueryMinimumGasPrice(ctx context.Context, grpcConn *grpc.ClientConn) (float } localMinPrice := localMinCoins.AmountOf(app.BondDenom).MustFloat64() - globalMinPrice, err := QueryGlobalMinGasPrice(ctx, grpcConn) + networkMinPrice, err := QueryNetworkMinGasPrice(ctx, grpcConn) if err != nil { // check if the network version supports a global min gas // price using a regex check. If not (i.e. v1) use the @@ -584,27 +584,27 @@ func QueryMinimumGasPrice(ctx context.Context, grpcConn *grpc.ClientConn) (float } // return the highest value of the two - if globalMinPrice > localMinPrice { - return globalMinPrice, nil + if networkMinPrice > localMinPrice { + return networkMinPrice, nil } return localMinPrice, nil } -func QueryGlobalMinGasPrice(ctx context.Context, grpcConn *grpc.ClientConn) (float64, error) { +func QueryNetworkMinGasPrice(ctx context.Context, grpcConn *grpc.ClientConn) (float64, error) { paramsClient := paramtypes.NewQueryClient(grpcConn) // NOTE: that we don't prove that this is the correct value - paramResponse, err := paramsClient.Params(ctx, ¶mtypes.QueryParamsRequest{Subspace: minfee.ModuleName, Key: string(minfee.KeyGlobalMinGasPrice)}) + paramResponse, err := paramsClient.Params(ctx, ¶mtypes.QueryParamsRequest{Subspace: minfee.ModuleName, Key: string(minfee.KeyNetworkMinGasPrice)}) if err != nil { return 0, fmt.Errorf("querying params module: %w", err) } - var globalMinPrice float64 - // Value is empty if global min gas price is not supported i.e. v1 state machine + var networkMinPrice float64 + // Value is empty if network min gas price is not supported i.e. v1 state machine. if paramResponse.Param.Value != "" { - globalMinPrice, err = strconv.ParseFloat(strings.Trim(paramResponse.Param.Value, `"`), 64) + networkMinPrice, err = strconv.ParseFloat(strings.Trim(paramResponse.Param.Value, `"`), 64) if err != nil { - return 0, fmt.Errorf("parsing global min gas price: %w", err) + return 0, fmt.Errorf("parsing network min gas price: %w", err) } } - return globalMinPrice, nil + return networkMinPrice, nil } diff --git a/proto/celestia/minfee/v1/genesis.proto b/proto/celestia/minfee/v1/genesis.proto index 769b396921..203d70f3f1 100644 --- a/proto/celestia/minfee/v1/genesis.proto +++ b/proto/celestia/minfee/v1/genesis.proto @@ -8,7 +8,7 @@ option go_package = "github.com/celestiaorg/celestia-app/x/minfee"; // GenesisState defines the minfee module's genesis state. message GenesisState { - string global_min_gas_price = 1 [ + string network_min_gas_price = 1 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false diff --git a/specs/src/specs/params.md b/specs/src/specs/params.md index 75b41519b5..a4928d79de 100644 --- a/specs/src/specs/params.md +++ b/specs/src/specs/params.md @@ -9,10 +9,10 @@ are blocked by the `x/paramfilter` module. ### Global parameters -| Parameter | Default | Summary | Changeable via Governance | -|---------------|---------|------------------------------------------------------------------------------------------------------------------------|---------------------------| +| Parameter | Default | Summary | Changeable via Governance | +|-------------------|---------|------------------------------------------------------------------------------------------------------------------------|---------------------------| | MaxBlockSizeBytes | 100MiB | Hardcoded value in CometBFT for the protobuf encoded block. | False | -| MaxSquareSize | 128 | Hardcoded maximum square size determined per shares per row or column for the original data square (not yet extended). | False | +| MaxSquareSize | 128 | Hardcoded maximum square size determined per shares per row or column for the original data square (not yet extended). | False | ### Module parameters @@ -49,7 +49,7 @@ are blocked by the `x/paramfilter` module. | ibc.ConnectionGenesis.MaxExpectedTimePerBlock | 7500000000000 (75 seconds) | Maximum expected time per block in nanoseconds under normal operation. | True | | ibc.Transfer.ReceiveEnabled | true | Enable receiving tokens via IBC. | True | | ibc.Transfer.SendEnabled | true | Enable sending tokens via IBC. | True | -| minfee.GlobalMinGasPrice | 0.000001 utia | All transactions must have a gas price greater than or equal to this value. | True | +| minfee.NetworkMinGasPrice | 0.000001 utia | All transactions must have a gas price greater than or equal to this value. | True | | mint.BondDenom | utia | Denomination that is inflated and sent to the distribution module account. | False | | mint.DisinflationRate | 0.10 (10%) | The rate at which the inflation rate decreases each year. | False | | mint.InitialInflationRate | 0.08 (8%) | The inflation rate the network starts at. | False | diff --git a/specs/src/specs/resource_pricing.md b/specs/src/specs/resource_pricing.md index 6e02217438..525bad661e 100644 --- a/specs/src/specs/resource_pricing.md +++ b/specs/src/specs/resource_pricing.md @@ -172,12 +172,12 @@ By default, Celestia's consensus nodes prioritize transactions in their mempools based on gas price. In version 1, there was no enforced minimum gas price, which allowed each consensus node to independently set its own minimum gas price in `app.toml`. This even permitted a gas price of 0, thereby creating the -possibility of secondary markets. In version 2, Celestia introduces a global +possibility of secondary markets. In version 2, Celestia introduces a network minimum gas price, a consensus constant, unaffected by individual node configurations. Although nodes retain the freedom to increase gas prices -locally, all transactions in a block must be greater than or equal to the global +locally, all transactions in a block must be greater than or equal to the network minimum threshold. If a block is proposed that contains a tx with a gas price -below the global min gas price, the block will be rejected as invalid. +below the network min gas price, the block will be rejected as invalid. ## Estimating PFB cost diff --git a/test/tokenfilter/setup.go b/test/tokenfilter/setup.go index fcc68cce3a..4e2764eeb4 100644 --- a/test/tokenfilter/setup.go +++ b/test/tokenfilter/setup.go @@ -246,7 +246,7 @@ func SetupWithGenesisValSet(t testing.TB, valSet *tmtypes.ValidatorSet, genAccs subspace := app.GetSubspace(minfee.ModuleName) subspace = minfee.RegisterMinFeeParamTable(subspace) ctx := sdk.NewContext(app.CommitMultiStore(), tmproto.Header{}, false, log.NewNopLogger()) - subspace.Set(ctx, minfee.KeyGlobalMinGasPrice, sdk.NewDec(0)) + subspace.Set(ctx, minfee.KeyNetworkMinGasPrice, sdk.NewDec(0)) return app } diff --git a/x/minfee/README.md b/x/minfee/README.md index 605c29bb57..7d102cdf7e 100644 --- a/x/minfee/README.md +++ b/x/minfee/README.md @@ -2,7 +2,7 @@ ## Abstract -The `x/minfee` module is responsible for managing the gov-modifiable parameter `GlobalMinGasPrice` introduced in app version 2. `GlobalMinGasPrice` ensures that all transactions adhere to this global minimum threshold, which is set in the genesis file and can be updated via governance proposals. +The `x/minfee` module is responsible for managing the gov-modifiable parameter `NetworkMinGasPrice` introduced in app version 2. `NetworkMinGasPrice` ensures that all transactions adhere to this network minimum threshold, which is set in the genesis file and can be updated via governance proposals. ## Resources diff --git a/x/minfee/genesis.go b/x/minfee/genesis.go index 7a3bc92204..5252c29597 100644 --- a/x/minfee/genesis.go +++ b/x/minfee/genesis.go @@ -10,14 +10,14 @@ import ( // DefaultGenesis returns the default genesis state. func DefaultGenesis() *GenesisState { return &GenesisState{ - GlobalMinGasPrice: DefaultGlobalMinGasPrice, + NetworkMinGasPrice: DefaultNetworkMinGasPrice, } } // ValidateGenesis performs basic validation of genesis data returning an error for any failed validation criteria. func ValidateGenesis(genesis *GenesisState) error { - if genesis.GlobalMinGasPrice.IsNegative() || genesis.GlobalMinGasPrice.IsZero() { - return fmt.Errorf("global min gas price cannot be negative: %g", genesis.GlobalMinGasPrice) + if genesis.NetworkMinGasPrice.IsNegative() || genesis.NetworkMinGasPrice.IsZero() { + return fmt.Errorf("network min gas price cannot be negative or zero: %g", genesis.NetworkMinGasPrice) } return nil @@ -31,8 +31,8 @@ func ExportGenesis(ctx sdk.Context, k params.Keeper) *GenesisState { } subspace = RegisterMinFeeParamTable(subspace) - var globalMinGasPrice sdk.Dec - subspace.Get(ctx, KeyGlobalMinGasPrice, &globalMinGasPrice) + var networkMinGasPrice sdk.Dec + subspace.Get(ctx, KeyNetworkMinGasPrice, &networkMinGasPrice) - return &GenesisState{GlobalMinGasPrice: globalMinGasPrice} + return &GenesisState{NetworkMinGasPrice: networkMinGasPrice} } diff --git a/x/minfee/genesis.pb.go b/x/minfee/genesis.pb.go index d2657a0103..e23e090296 100644 --- a/x/minfee/genesis.pb.go +++ b/x/minfee/genesis.pb.go @@ -27,7 +27,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the minfee module's genesis state. type GenesisState struct { - GlobalMinGasPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=global_min_gas_price,json=globalMinGasPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"global_min_gas_price"` + NetworkMinGasPrice github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=network_min_gas_price,json=networkMinGasPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"network_min_gas_price"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -70,23 +70,23 @@ func init() { func init() { proto.RegisterFile("celestia/minfee/v1/genesis.proto", fileDescriptor_40506204178306cf) } var fileDescriptor_40506204178306cf = []byte{ - // 249 bytes of a gzipped FileDescriptorProto + // 250 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0x4e, 0xcd, 0x49, 0x2d, 0x2e, 0xc9, 0x4c, 0xd4, 0xcf, 0xcd, 0xcc, 0x4b, 0x4b, 0x4d, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x82, 0xa9, 0xd0, 0x83, 0xa8, 0xd0, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x4b, 0xeb, 0x83, 0x58, 0x10, 0x95, 0x52, 0x92, 0xc9, 0xf9, 0xc5, 0xb9, 0xf9, 0xc5, 0xf1, 0x10, 0x09, 0x08, 0x07, - 0x22, 0xa5, 0x54, 0xcb, 0xc5, 0xe3, 0x0e, 0x31, 0x35, 0xb8, 0x24, 0xb1, 0x24, 0x55, 0x28, 0x97, - 0x4b, 0x24, 0x3d, 0x27, 0x3f, 0x29, 0x31, 0x27, 0x3e, 0x37, 0x33, 0x2f, 0x3e, 0x3d, 0x11, 0xa4, - 0x29, 0x33, 0x39, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0xd3, 0xc9, 0xe6, 0xc4, 0x3d, 0x79, 0x86, - 0x5b, 0xf7, 0xe4, 0xd5, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xa1, 0xc6, - 0x41, 0x29, 0xdd, 0xe2, 0x94, 0x6c, 0xfd, 0x92, 0xca, 0x82, 0xd4, 0x62, 0x3d, 0x97, 0xd4, 0xe4, - 0x4b, 0x5b, 0x74, 0xb9, 0xa0, 0xb6, 0xb9, 0xa4, 0x26, 0x07, 0x09, 0x42, 0x4c, 0xf6, 0xcd, 0xcc, - 0x73, 0x4f, 0x2c, 0x0e, 0x00, 0x19, 0xeb, 0xe4, 0x76, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, - 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, - 0x72, 0x0c, 0x51, 0x3a, 0xc8, 0x56, 0x40, 0x3d, 0x9a, 0x5f, 0x94, 0x0e, 0x67, 0xeb, 0x26, 0x16, - 0x14, 0xe8, 0x57, 0x40, 0x03, 0x27, 0x89, 0x0d, 0xec, 0x1b, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x61, 0x71, 0xcd, 0x0a, 0x36, 0x01, 0x00, 0x00, + 0x22, 0xa5, 0x54, 0xcf, 0xc5, 0xe3, 0x0e, 0x31, 0x35, 0xb8, 0x24, 0xb1, 0x24, 0x55, 0x28, 0x9f, + 0x4b, 0x34, 0x2f, 0xb5, 0xa4, 0x3c, 0xbf, 0x28, 0x3b, 0x3e, 0x37, 0x33, 0x2f, 0x3e, 0x3d, 0x11, + 0xa4, 0x2b, 0x33, 0x39, 0x55, 0x82, 0x51, 0x81, 0x51, 0x83, 0xd3, 0xc9, 0xe6, 0xc4, 0x3d, 0x79, + 0x86, 0x5b, 0xf7, 0xe4, 0xd5, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xa1, + 0xe6, 0x41, 0x29, 0xdd, 0xe2, 0x94, 0x6c, 0xfd, 0x92, 0xca, 0x82, 0xd4, 0x62, 0x3d, 0x97, 0xd4, + 0xe4, 0x4b, 0x5b, 0x74, 0xb9, 0xa0, 0xd6, 0xb9, 0xa4, 0x26, 0x07, 0x09, 0x41, 0x8d, 0xf6, 0xcd, + 0xcc, 0x73, 0x4f, 0x2c, 0x0e, 0x00, 0x99, 0xeb, 0xe4, 0x76, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, + 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, + 0xc7, 0x72, 0x0c, 0x51, 0x3a, 0xc8, 0x76, 0x40, 0xbd, 0x9a, 0x5f, 0x94, 0x0e, 0x67, 0xeb, 0x26, + 0x16, 0x14, 0xe8, 0x57, 0x40, 0x83, 0x27, 0x89, 0x0d, 0xec, 0x1f, 0x63, 0x40, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xc1, 0xc2, 0x03, 0x17, 0x38, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -110,9 +110,9 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l { - size := m.GlobalMinGasPrice.Size() + size := m.NetworkMinGasPrice.Size() i -= size - if _, err := m.GlobalMinGasPrice.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.NetworkMinGasPrice.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintGenesis(dAtA, i, uint64(size)) @@ -139,7 +139,7 @@ func (m *GenesisState) Size() (n int) { } var l int _ = l - l = m.GlobalMinGasPrice.Size() + l = m.NetworkMinGasPrice.Size() n += 1 + l + sovGenesis(uint64(l)) return n } @@ -181,7 +181,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GlobalMinGasPrice", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NetworkMinGasPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -209,7 +209,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.GlobalMinGasPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.NetworkMinGasPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/minfee/module.go b/x/minfee/module.go index 989351650e..324c502a54 100644 --- a/x/minfee/module.go +++ b/x/minfee/module.go @@ -125,13 +125,13 @@ func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.Ra subspace = RegisterMinFeeParamTable(subspace) - // Set the global min gas price initial value - globalMinGasPriceDec, err := sdk.NewDecFromStr(fmt.Sprintf("%f", genesisState.GlobalMinGasPrice)) + // Set the network min gas price initial value + networkMinGasPriceDec, err := sdk.NewDecFromStr(fmt.Sprintf("%f", genesisState.NetworkMinGasPrice)) if err != nil { - panic("failed to convert GlobalMinGasPrice to sdk.Dec") + panic("failed to convert NetworkMinGasPrice to sdk.Dec") } - subspace.SetParamSet(ctx, &Params{GlobalMinGasPrice: globalMinGasPriceDec}) + subspace.SetParamSet(ctx, &Params{NetworkMinGasPrice: networkMinGasPriceDec}) return []abci.ValidatorUpdate{} } diff --git a/x/minfee/params.go b/x/minfee/params.go index 9d0957ab28..42db4947ef 100644 --- a/x/minfee/params.go +++ b/x/minfee/params.go @@ -13,20 +13,20 @@ const ModuleName = "minfee" var _ paramtypes.ParamSet = (*Params)(nil) var ( - KeyGlobalMinGasPrice = []byte("GlobalMinGasPrice") - DefaultGlobalMinGasPrice sdk.Dec + KeyNetworkMinGasPrice = []byte("NetworkMinGasPrice") + DefaultNetworkMinGasPrice sdk.Dec ) func init() { - DefaultGlobalMinGasPriceDec, err := sdk.NewDecFromStr(fmt.Sprintf("%f", v2.GlobalMinGasPrice)) + DefaultNetworkMinGasPriceDec, err := sdk.NewDecFromStr(fmt.Sprintf("%f", v2.NetworkMinGasPrice)) if err != nil { panic(err) } - DefaultGlobalMinGasPrice = DefaultGlobalMinGasPriceDec + DefaultNetworkMinGasPrice = DefaultNetworkMinGasPriceDec } type Params struct { - GlobalMinGasPrice sdk.Dec + NetworkMinGasPrice sdk.Dec } // RegisterMinFeeParamTable returns a subspace with a key table attached. @@ -37,7 +37,7 @@ func RegisterMinFeeParamTable(subspace paramtypes.Subspace) paramtypes.Subspace return subspace.WithKeyTable(ParamKeyTable()) } -// ParamKeyTable returns the param key table for the global min gas price module +// ParamKeyTable returns the param key table for the minfee module. func ParamKeyTable() paramtypes.KeyTable { return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) } @@ -45,7 +45,7 @@ func ParamKeyTable() paramtypes.KeyTable { // ParamSetPairs gets the param key-value pair func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ - paramtypes.NewParamSetPair(KeyGlobalMinGasPrice, &p.GlobalMinGasPrice, ValidateMinGasPrice), + paramtypes.NewParamSetPair(KeyNetworkMinGasPrice, &p.NetworkMinGasPrice, ValidateMinGasPrice), } } diff --git a/x/paramfilter/test/gov_params_test.go b/x/paramfilter/test/gov_params_test.go index 68ab60d50a..ca482e99fe 100644 --- a/x/paramfilter/test/gov_params_test.go +++ b/x/paramfilter/test/gov_params_test.go @@ -488,16 +488,16 @@ func (suite *GovParamsTestSuite) TestModifiableParams() { }, }, { - "minfee.GlobalMinGasPrice", + "minfee.NetworkMinGasPrice", testProposal(proposal.ParamChange{ Subspace: minfeetypes.ModuleName, - Key: string(minfeetypes.KeyGlobalMinGasPrice), + Key: string(minfeetypes.KeyNetworkMinGasPrice), Value: `"0.1"`, }), func() { var got sdk.Dec subspace := suite.app.GetSubspace(minfeetypes.ModuleName) - subspace.Get(suite.ctx, minfeetypes.KeyGlobalMinGasPrice, &got) + subspace.Get(suite.ctx, minfeetypes.KeyNetworkMinGasPrice, &got) want, err := sdk.NewDecFromStr("0.1") assert.NoError(err) From 15276afcd1299af9a6738498deaf52cd6db226c2 Mon Sep 17 00:00:00 2001 From: Rootul P Date: Tue, 18 Jun 2024 10:41:20 -0600 Subject: [PATCH 08/10] refactor: test/util/common (#3572) Completely optional refactor that I made while reviewing this code. --- test/util/common.go | 80 +++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 43 deletions(-) diff --git a/test/util/common.go b/test/util/common.go index d7657e5061..b969400c2c 100644 --- a/test/util/common.go +++ b/test/util/common.go @@ -10,7 +10,7 @@ import ( cosmosmath "cosmossdk.io/math" "github.com/celestiaorg/celestia-app/v2/app" "github.com/celestiaorg/celestia-app/v2/x/blobstream/keeper" - bstypes "github.com/celestiaorg/celestia-app/v2/x/blobstream/types" + blobstreamtypes "github.com/celestiaorg/celestia-app/v2/x/blobstream/types" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" ccodec "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -153,11 +153,11 @@ func CreateTestEnvWithoutBlobstreamKeysInit(t *testing.T) TestInput { t.Helper() // Initialize store keys - bsKey := sdk.NewKVStoreKey(bstypes.StoreKey) - keyAcc := sdk.NewKVStoreKey(authtypes.StoreKey) + keyBlobstream := sdk.NewKVStoreKey(blobstreamtypes.StoreKey) + keyAuth := sdk.NewKVStoreKey(authtypes.StoreKey) keyStaking := sdk.NewKVStoreKey(stakingtypes.StoreKey) keyBank := sdk.NewKVStoreKey(banktypes.StoreKey) - keyDistro := sdk.NewKVStoreKey(distrtypes.StoreKey) + keyDistribution := sdk.NewKVStoreKey(distrtypes.StoreKey) keyParams := sdk.NewKVStoreKey(paramstypes.StoreKey) tkeyParams := sdk.NewTransientStoreKey(paramstypes.TStoreKey) keySlashing := sdk.NewKVStoreKey(slashingtypes.StoreKey) @@ -165,18 +165,17 @@ func CreateTestEnvWithoutBlobstreamKeysInit(t *testing.T) TestInput { // Initialize memory database and mount stores on it db := dbm.NewMemDB() ms := store.NewCommitMultiStore(db) - ms.MountStoreWithDB(bsKey, storetypes.StoreTypeIAVL, db) - ms.MountStoreWithDB(keyAcc, storetypes.StoreTypeIAVL, db) + ms.MountStoreWithDB(keyBlobstream, storetypes.StoreTypeIAVL, db) + ms.MountStoreWithDB(keyAuth, storetypes.StoreTypeIAVL, db) ms.MountStoreWithDB(keyParams, storetypes.StoreTypeIAVL, db) ms.MountStoreWithDB(keyStaking, storetypes.StoreTypeIAVL, db) ms.MountStoreWithDB(keyBank, storetypes.StoreTypeIAVL, db) - ms.MountStoreWithDB(keyDistro, storetypes.StoreTypeIAVL, db) + ms.MountStoreWithDB(keyDistribution, storetypes.StoreTypeIAVL, db) ms.MountStoreWithDB(tkeyParams, storetypes.StoreTypeTransient, db) ms.MountStoreWithDB(keySlashing, storetypes.StoreTypeIAVL, db) err := ms.LoadLatestVersion() - require.Nil(t, err) + require.NoError(t, err) - // Create sdk.Context ctx := sdk.NewContext(ms, tmproto.Header{ Version: tmversion.Consensus{ Block: 0, @@ -211,29 +210,29 @@ func CreateTestEnvWithoutBlobstreamKeysInit(t *testing.T) TestInput { paramsKeeper.Subspace(banktypes.ModuleName) paramsKeeper.Subspace(stakingtypes.ModuleName) paramsKeeper.Subspace(distrtypes.ModuleName) - paramsKeeper.Subspace(bstypes.DefaultParamspace) + paramsKeeper.Subspace(blobstreamtypes.DefaultParamspace) paramsKeeper.Subspace(slashingtypes.ModuleName) // this is also used to initialize module accounts for all the map keys - maccPerms := map[string][]string{ + moduleAccountPermissions := map[string][]string{ authtypes.FeeCollectorName: nil, distrtypes.ModuleName: nil, stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - bstypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + blobstreamtypes.ModuleName: {authtypes.Minter, authtypes.Burner}, } accountKeeper := authkeeper.NewAccountKeeper( marshaler, - keyAcc, // target store + keyAuth, // target store getSubspace(paramsKeeper, authtypes.ModuleName), authtypes.ProtoBaseAccount, // prototype - maccPerms, + moduleAccountPermissions, app.Bech32PrefixAccAddr, ) - blockedAddr := make(map[string]bool, len(maccPerms)) - for acc := range maccPerms { + blockedAddr := make(map[string]bool, len(moduleAccountPermissions)) + for acc := range moduleAccountPermissions { blockedAddr[authtypes.NewModuleAddress(acc).String()] = true } bankKeeper := bankkeeper.NewBaseKeeper( @@ -254,32 +253,28 @@ func CreateTestEnvWithoutBlobstreamKeysInit(t *testing.T) TestInput { stakingKeeper := stakingkeeper.NewKeeper(marshaler, keyStaking, accountKeeper, bankKeeper, getSubspace(paramsKeeper, stakingtypes.ModuleName)) stakingKeeper.SetParams(ctx, TestingStakeParams) - distKeeper := distrkeeper.NewKeeper(marshaler, keyDistro, getSubspace(paramsKeeper, distrtypes.ModuleName), accountKeeper, bankKeeper, stakingKeeper, authtypes.FeeCollectorName) + distKeeper := distrkeeper.NewKeeper(marshaler, keyDistribution, getSubspace(paramsKeeper, distrtypes.ModuleName), accountKeeper, bankKeeper, stakingKeeper, authtypes.FeeCollectorName) distKeeper.SetParams(ctx, distrtypes.DefaultParams()) - - // set genesis items required for distribution distKeeper.SetFeePool(ctx, distrtypes.InitialFeePool()) - // total supply to track this - totalSupply := sdk.NewCoins(sdk.NewInt64Coin("stake", 100000000)) - // set up initial accounts - for name, perms := range maccPerms { - mod := authtypes.NewEmptyModuleAccount(name, perms...) + for name, permissions := range moduleAccountPermissions { + moduleAccount := authtypes.NewEmptyModuleAccount(name, permissions...) + totalSupply := sdk.NewCoins(sdk.NewInt64Coin("stake", 100000000)) if name == stakingtypes.NotBondedPoolName { - err = bankKeeper.MintCoins(ctx, bstypes.ModuleName, totalSupply) + err = bankKeeper.MintCoins(ctx, blobstreamtypes.ModuleName, totalSupply) require.NoError(t, err) - err = bankKeeper.SendCoinsFromModuleToModule(ctx, bstypes.ModuleName, mod.Name, totalSupply) + err = bankKeeper.SendCoinsFromModuleToModule(ctx, blobstreamtypes.ModuleName, moduleAccount.Name, totalSupply) require.NoError(t, err) } else if name == distrtypes.ModuleName { // some big pot to pay out amt := sdk.NewCoins(sdk.NewInt64Coin("stake", 500000)) - err = bankKeeper.MintCoins(ctx, bstypes.ModuleName, amt) + err = bankKeeper.MintCoins(ctx, blobstreamtypes.ModuleName, amt) require.NoError(t, err) - err = bankKeeper.SendCoinsFromModuleToModule(ctx, bstypes.ModuleName, mod.Name, amt) + err = bankKeeper.SendCoinsFromModuleToModule(ctx, blobstreamtypes.ModuleName, moduleAccount.Name, amt) require.NoError(t, err) } - accountKeeper.SetModuleAccount(ctx, mod) + accountKeeper.SetModuleAccount(ctx, moduleAccount) } stakeAddr := authtypes.NewModuleAddress(stakingtypes.BondedPoolName) @@ -290,22 +285,21 @@ func CreateTestEnvWithoutBlobstreamKeysInit(t *testing.T) TestInput { marshaler, keySlashing, &stakingKeeper, - getSubspace(paramsKeeper, slashingtypes.ModuleName).WithKeyTable(slashingtypes.ParamKeyTable()), + getSubspace(paramsKeeper, slashingtypes.ModuleName), ) - k := keeper.NewKeeper(marshaler, bsKey, getSubspace(paramsKeeper, bstypes.DefaultParamspace), &stakingKeeper) - testBlobstreamParams := bstypes.DefaultGenesis().Params - k.SetParams(ctx, *testBlobstreamParams) + blobstreamKeeper := keeper.NewKeeper(marshaler, keyBlobstream, getSubspace(paramsKeeper, blobstreamtypes.DefaultParamspace), &stakingKeeper) + blobstreamKeeper.SetParams(ctx, *blobstreamtypes.DefaultGenesis().Params) stakingKeeper = *stakingKeeper.SetHooks( stakingtypes.NewMultiStakingHooks( distKeeper.Hooks(), slashingKeeper.Hooks(), - k.Hooks(), + blobstreamKeeper.Hooks(), ), ) return TestInput{ - BlobstreamKeeper: *k, + BlobstreamKeeper: *blobstreamKeeper, AccountKeeper: accountKeeper, BankKeeper: bankKeeper, StakingKeeper: stakingKeeper, @@ -335,7 +329,7 @@ func MakeTestCodec() *codec.LegacyAmino { sdk.RegisterLegacyAminoCodec(cdc) ccodec.RegisterCrypto(cdc) params.AppModuleBasic{}.RegisterLegacyAminoCodec(cdc) - bstypes.RegisterLegacyAminoCodec(cdc) + blobstreamtypes.RegisterLegacyAminoCodec(cdc) return cdc } @@ -350,7 +344,7 @@ func MakeTestMarshaler() codec.Codec { interfaceRegistry := codectypes.NewInterfaceRegistry() std.RegisterInterfaces(interfaceRegistry) ModuleBasics.RegisterInterfaces(interfaceRegistry) - bstypes.RegisterInterfaces(interfaceRegistry) + blobstreamtypes.RegisterInterfaces(interfaceRegistry) return codec.NewProtoCodec(interfaceRegistry) } @@ -392,8 +386,8 @@ func CreateValidator( ) // Set the balance for the account - require.NoError(t, input.BankKeeper.MintCoins(input.Context, bstypes.ModuleName, InitCoins)) - err := input.BankKeeper.SendCoinsFromModuleToAccount(input.Context, bstypes.ModuleName, acc.GetAddress(), InitCoins) + require.NoError(t, input.BankKeeper.MintCoins(input.Context, blobstreamtypes.ModuleName, InitCoins)) + err := input.BankKeeper.SendCoinsFromModuleToAccount(input.Context, blobstreamtypes.ModuleName, acc.GetAddress(), InitCoins) require.NoError(t, err) // Set the account in state @@ -413,7 +407,7 @@ func RegisterEVMAddress( evmAddr gethcommon.Address, ) { bsMsgServer := keeper.NewMsgServerImpl(input.BlobstreamKeeper) - registerMsg := bstypes.NewMsgRegisterEVMAddress(valAddr, evmAddr) + registerMsg := blobstreamtypes.NewMsgRegisterEVMAddress(valAddr, evmAddr) _, err := bsMsgServer.RegisterEVMAddress(input.Context, registerMsg) require.NoError(t, err) } @@ -468,8 +462,8 @@ func SetupTestChain(t *testing.T, weights []uint64) (TestInput, sdk.Context) { // Set the balance for the account weightCoins := sdk.NewCoins(sdk.NewInt64Coin(TestingStakeParams.BondDenom, int64(weight))) - require.NoError(t, input.BankKeeper.MintCoins(input.Context, bstypes.ModuleName, weightCoins)) - require.NoError(t, input.BankKeeper.SendCoinsFromModuleToAccount(input.Context, bstypes.ModuleName, accAddr, weightCoins)) + require.NoError(t, input.BankKeeper.MintCoins(input.Context, blobstreamtypes.ModuleName, weightCoins)) + require.NoError(t, input.BankKeeper.SendCoinsFromModuleToAccount(input.Context, blobstreamtypes.ModuleName, accAddr, weightCoins)) // Set the account in state input.AccountKeeper.SetAccount(input.Context, acc) @@ -482,7 +476,7 @@ func SetupTestChain(t *testing.T, weights []uint64) (TestInput, sdk.Context) { ) require.NoError(t, err) - registerMsg := bstypes.NewMsgRegisterEVMAddress(valAddr, EVMAddrs[i]) + registerMsg := blobstreamtypes.NewMsgRegisterEVMAddress(valAddr, EVMAddrs[i]) _, err = bsMsgServer.RegisterEVMAddress(input.Context, registerMsg) require.NoError(t, err) From 754eae99ff563717da0543ec033111b4d9c2058a Mon Sep 17 00:00:00 2001 From: Sanaz Taheri <35961250+staheri14@users.noreply.github.com> Date: Tue, 18 Jun 2024 11:38:07 -0700 Subject: [PATCH 09/10] fix: rename remaining instances of GlobalMinGasPrice to NetworkMinGasPrice (#3583) Closes #3582 --- x/minfee/grpc_query.go | 2 +- x/minfee/grpc_query_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x/minfee/grpc_query.go b/x/minfee/grpc_query.go index c76d39722c..b467fb0729 100644 --- a/x/minfee/grpc_query.go +++ b/x/minfee/grpc_query.go @@ -30,5 +30,5 @@ func (q *QueryServerImpl) NetworkMinGasPrice(ctx context.Context, _ *QueryNetwor return nil, status.Errorf(codes.NotFound, "subspace not found for minfee. Minfee is only active in app version 2 and onwards") } subspace.GetParamSet(sdkCtx, ¶ms) - return &QueryNetworkMinGasPriceResponse{NetworkMinGasPrice: params.GlobalMinGasPrice}, nil + return &QueryNetworkMinGasPriceResponse{NetworkMinGasPrice: params.NetworkMinGasPrice}, nil } diff --git a/x/minfee/grpc_query_test.go b/x/minfee/grpc_query_test.go index 0cbc90b7d8..08f9e6e834 100644 --- a/x/minfee/grpc_query_test.go +++ b/x/minfee/grpc_query_test.go @@ -24,5 +24,5 @@ func TestQueryNetworkMinGasPrice(t *testing.T) { require.NoError(t, err) // Check the response - require.Equal(t, v2.GlobalMinGasPrice, resp.NetworkMinGasPrice.MustFloat64()) + require.Equal(t, v2.NetworkMinGasPrice, resp.NetworkMinGasPrice.MustFloat64()) } From 85eb1cb707448b29dd821b7a0f72fd652f6ce473 Mon Sep 17 00:00:00 2001 From: Rootul P Date: Tue, 18 Jun 2024 13:31:50 -0600 Subject: [PATCH 10/10] fix!: msg gatekeeper for authz messages (#3555) Resolves this [security advisory](https://github.com/celestiaorg/celestia-app/security/advisories/GHSA-j4w8-q5hh-6xf9). Thanks @Reecepbcups for the report and fix! Co-authored-by: Reece Williams --- app/ante/msg_gatekeeper.go | 27 ++++++++++++++++++++--- app/ante/msg_gatekeeper_test.go | 39 +++++++++++++++++++++++++++++++-- 2 files changed, 61 insertions(+), 5 deletions(-) diff --git a/app/ante/msg_gatekeeper.go b/app/ante/msg_gatekeeper.go index a3824d1c08..9f4841448a 100644 --- a/app/ante/msg_gatekeeper.go +++ b/app/ante/msg_gatekeeper.go @@ -6,6 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/authz" ) var ( @@ -32,15 +33,35 @@ func (mgk MsgVersioningGateKeeper) AnteHandle(ctx sdk.Context, tx sdk.Tx, simula if !exists { return ctx, sdkerrors.ErrNotSupported.Wrapf("app version %d is not supported", ctx.BlockHeader().Version.App) } - for _, msg := range tx.GetMsgs() { + + if err := mgk.hasInvalidMsg(ctx, acceptedMsgs, tx.GetMsgs()); err != nil { + return ctx, err + } + + return next(ctx, tx, simulate) +} + +func (mgk MsgVersioningGateKeeper) hasInvalidMsg(ctx sdk.Context, acceptedMsgs map[string]struct{}, msgs []sdk.Msg) error { + for _, msg := range msgs { + // Recursively check for invalid messages in nested authz messages. + if execMsg, ok := msg.(*authz.MsgExec); ok { + nestedMsgs, err := execMsg.GetMessages() + if err != nil { + return err + } + if err = mgk.hasInvalidMsg(ctx, acceptedMsgs, nestedMsgs); err != nil { + return err + } + } + msgTypeURL := sdk.MsgTypeURL(msg) _, exists := acceptedMsgs[msgTypeURL] if !exists { - return ctx, sdkerrors.ErrNotSupported.Wrapf("message type %s is not supported in version %d", msgTypeURL, ctx.BlockHeader().Version.App) + return sdkerrors.ErrNotSupported.Wrapf("message type %s is not supported in version %d", msgTypeURL, ctx.BlockHeader().Version.App) } } - return next(ctx, tx, simulate) + return nil } func (mgk MsgVersioningGateKeeper) IsAllowed(ctx context.Context, msgName string) (bool, error) { diff --git a/app/ante/msg_gatekeeper_test.go b/app/ante/msg_gatekeeper_test.go index 4492d1061a..6bbedb1571 100644 --- a/app/ante/msg_gatekeeper_test.go +++ b/app/ante/msg_gatekeeper_test.go @@ -7,6 +7,7 @@ import ( "github.com/celestiaorg/celestia-app/v2/app/ante" "github.com/celestiaorg/celestia-app/v2/app/encoding" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/authz" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/stretchr/testify/require" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -14,6 +15,9 @@ import ( ) func TestMsgGateKeeperAnteHandler(t *testing.T) { + nestedBankSend := authz.NewMsgExec(sdk.AccAddress{}, []sdk.Msg{&banktypes.MsgSend{}}) + nestedMultiSend := authz.NewMsgExec(sdk.AccAddress{}, []sdk.Msg{&banktypes.MsgMultiSend{}}) + // Define test cases tests := []struct { name string @@ -27,23 +31,42 @@ func TestMsgGateKeeperAnteHandler(t *testing.T) { acceptMsg: true, version: 1, }, + { + name: "Accept nested MsgSend", + msg: &nestedBankSend, + acceptMsg: true, + version: 1, + }, { name: "Reject MsgMultiSend", msg: &banktypes.MsgMultiSend{}, acceptMsg: false, version: 1, }, + { + name: "Reject nested MsgMultiSend", + msg: &nestedMultiSend, + acceptMsg: false, + version: 1, + }, { name: "Reject MsgSend with version 2", msg: &banktypes.MsgSend{}, acceptMsg: false, version: 2, }, + { + name: "Reject nested MsgSend with version 2", + msg: &nestedBankSend, + acceptMsg: false, + version: 2, + }, } msgGateKeeper := ante.NewMsgVersioningGateKeeper(map[uint64]map[string]struct{}{ 1: { - "/cosmos.bank.v1beta1.MsgSend": {}, + "/cosmos.bank.v1beta1.MsgSend": {}, + "/cosmos.authz.v1beta1.MsgExec": {}, }, 2: {}, }) @@ -56,7 +79,19 @@ func TestMsgGateKeeperAnteHandler(t *testing.T) { txBuilder := cdc.TxConfig.NewTxBuilder() require.NoError(t, txBuilder.SetMsgs(tc.msg)) _, err := anteHandler(ctx, txBuilder.GetTx(), false) - allowed, err2 := msgGateKeeper.IsAllowed(ctx, sdk.MsgTypeURL(tc.msg)) + + msg := tc.msg + if sdk.MsgTypeURL(msg) == "/cosmos.authz.v1beta1.MsgExec" { + execMsg, ok := msg.(*authz.MsgExec) + require.True(t, ok) + + nestedMsgs, err := execMsg.GetMessages() + require.NoError(t, err) + msg = nestedMsgs[0] + } + + allowed, err2 := msgGateKeeper.IsAllowed(ctx, sdk.MsgTypeURL(msg)) + require.NoError(t, err2) if tc.acceptMsg { require.NoError(t, err, "expected message to be accepted")