From 8ef416bdc95b014fedc262fc751b206402cb1da0 Mon Sep 17 00:00:00 2001 From: sanaz Date: Tue, 17 Sep 2024 15:46:33 -0700 Subject: [PATCH 001/106] introduces timeout propose and commit consts --- app/default_overrides.go | 4 ++-- pkg/appconsts/v3/app_consts.go | 4 ++++ pkg/appconsts/versioned_consts.go | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/app/default_overrides.go b/app/default_overrides.go index 0ceedaeee1..bd9e98278f 100644 --- a/app/default_overrides.go +++ b/app/default_overrides.go @@ -274,8 +274,8 @@ func DefaultConsensusConfig() *tmcfg.Config { cfg.Mempool.MaxTxsBytes = int64(upperBoundBytes) * cfg.Mempool.TTLNumBlocks cfg.Mempool.Version = "v1" // prioritized mempool - cfg.Consensus.TimeoutPropose = appconsts.TimeoutPropose - cfg.Consensus.TimeoutCommit = appconsts.TimeoutCommit + cfg.Consensus.TimeoutPropose = appconsts.GetTimeoutPropose() + cfg.Consensus.TimeoutCommit = appconsts.GetTimeoutCommit() cfg.Consensus.SkipTimeoutCommit = false cfg.TxIndex.Indexer = "null" diff --git a/pkg/appconsts/v3/app_consts.go b/pkg/appconsts/v3/app_consts.go index 504360864a..4b9c7792c5 100644 --- a/pkg/appconsts/v3/app_consts.go +++ b/pkg/appconsts/v3/app_consts.go @@ -1,7 +1,11 @@ package v3 +import "time" + const ( Version uint64 = 3 SquareSizeUpperBound int = 128 SubtreeRootThreshold int = 64 + TimeoutPropose = time.Second * 10 + TimeoutCommit = time.Second * 11 ) diff --git a/pkg/appconsts/versioned_consts.go b/pkg/appconsts/versioned_consts.go index a8d01fdedf..7feb278651 100644 --- a/pkg/appconsts/versioned_consts.go +++ b/pkg/appconsts/versioned_consts.go @@ -1,6 +1,8 @@ package appconsts import ( + "time" + v1 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v1" v3 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v3" ) @@ -30,3 +32,21 @@ var ( DefaultSubtreeRootThreshold = SubtreeRootThreshold(LatestVersion) DefaultSquareSizeUpperBound = SquareSizeUpperBound(LatestVersion) ) + +func GetTimeoutPropose() time.Duration { + switch LatestVersion { + case v3.Version: + return v3.TimeoutPropose + default: + return TimeoutPropose + } +} + +func GetTimeoutCommit() time.Duration { + switch LatestVersion { + case v3.Version: + return v3.TimeoutCommit + default: + return TimeoutCommit + } +} From 0cd25d3e4d7f168a5b7cbb316d0e6f9295a000e1 Mon Sep 17 00:00:00 2001 From: sanaz Date: Thu, 19 Sep 2024 15:54:56 -0700 Subject: [PATCH 002/106] sets tiemouts in EndBlocker based on the updated version --- app/app.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index d31d33fcbf..af83ecf773 100644 --- a/app/app.go +++ b/app/app.go @@ -10,6 +10,7 @@ import ( celestiatx "github.com/celestiaorg/celestia-app/v3/app/grpc/tx" "github.com/celestiaorg/celestia-app/v3/app/module" "github.com/celestiaorg/celestia-app/v3/app/posthandler" + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" appv1 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v1" appv2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" appv3 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v3" @@ -457,7 +458,7 @@ func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.R func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { res := app.manager.EndBlock(ctx, req) currentVersion := app.AppVersion() - // For v1 only we upgrade using a agreed upon height known ahead of time + // For v1 only we upgrade using an agreed upon height known ahead of time if currentVersion == v1 { // check that we are at the height before the upgrade if req.Height == app.upgradeHeightV2-1 { @@ -479,6 +480,13 @@ func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.Respo app.SignalKeeper.ResetTally(ctx) } } + // Update timeouts based on the current version. + // TODO: We check app.AppVersion(), which may differ from currentVersion, + // as we want to set the timeouts based on the app version + // that will be used in the next block. + v := app.AppVersion() + res.TimeoutCommit = appconsts.GetTimeoutCommit(v) + res.TimeoutPropose = appconsts.GetTimeoutPropose(v) return res } From a878a203d0ab16d678845bf6b3d1fb1570a9cf2f Mon Sep 17 00:00:00 2001 From: sanaz Date: Thu, 19 Sep 2024 15:55:28 -0700 Subject: [PATCH 003/106] sets timeout propose of v3 to 10 --- pkg/appconsts/v3/app_consts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/appconsts/v3/app_consts.go b/pkg/appconsts/v3/app_consts.go index 4b9c7792c5..48e1e6356d 100644 --- a/pkg/appconsts/v3/app_consts.go +++ b/pkg/appconsts/v3/app_consts.go @@ -6,6 +6,6 @@ const ( Version uint64 = 3 SquareSizeUpperBound int = 128 SubtreeRootThreshold int = 64 - TimeoutPropose = time.Second * 10 + TimeoutPropose = time.Second * 11 TimeoutCommit = time.Second * 11 ) From 20b62ef66c70bfa0672fca917989ebe3af7b8fed Mon Sep 17 00:00:00 2001 From: sanaz Date: Thu, 19 Sep 2024 15:55:45 -0700 Subject: [PATCH 004/106] retrieves timeouts based on the app version --- pkg/appconsts/versioned_consts.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/appconsts/versioned_consts.go b/pkg/appconsts/versioned_consts.go index 7feb278651..ef6a80ad55 100644 --- a/pkg/appconsts/versioned_consts.go +++ b/pkg/appconsts/versioned_consts.go @@ -33,8 +33,8 @@ var ( DefaultSquareSizeUpperBound = SquareSizeUpperBound(LatestVersion) ) -func GetTimeoutPropose() time.Duration { - switch LatestVersion { +func GetTimeoutPropose(v uint64) time.Duration { + switch v { case v3.Version: return v3.TimeoutPropose default: @@ -42,8 +42,8 @@ func GetTimeoutPropose() time.Duration { } } -func GetTimeoutCommit() time.Duration { - switch LatestVersion { +func GetTimeoutCommit(v uint64) time.Duration { + switch v { case v3.Version: return v3.TimeoutCommit default: From 14abdab70599feeee34358ebb49497b4b5294bfa Mon Sep 17 00:00:00 2001 From: sanaz Date: Thu, 19 Sep 2024 15:55:56 -0700 Subject: [PATCH 005/106] points to a new version of core --- go.mod | 34 +++++++++++++------------- go.sum | 75 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 55 insertions(+), 54 deletions(-) diff --git a/go.mod b/go.mod index bf9aaa9178..b20ab023c5 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/celestiaorg/celestia-app/v3 -go 1.22.6 +go 1.23.1 require ( cosmossdk.io/errors v1.0.1 @@ -25,12 +25,12 @@ require ( github.com/rakyll/statik v0.1.7 github.com/rs/zerolog v1.33.0 github.com/spf13/cast v1.6.0 - github.com/spf13/cobra v1.8.0 + github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 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-20240213143201-ec583247a57a + golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 google.golang.org/grpc v1.66.2 google.golang.org/protobuf v1.34.2 @@ -95,7 +95,7 @@ require ( github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect @@ -131,7 +131,7 @@ require ( github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-uuid v1.0.2 // indirect - github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/go-version v1.7.0 // indirect github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect @@ -147,7 +147,7 @@ require ( github.com/klauspost/compress v1.17.9 // indirect github.com/klauspost/cpuid/v2 v2.2.8 // indirect github.com/klauspost/reedsolomon v1.12.1 // indirect - github.com/lib/pq v1.10.7 // indirect + github.com/lib/pq v1.10.9 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -170,7 +170,7 @@ require ( 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/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect @@ -205,24 +205,24 @@ 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.26.0 // indirect + go.opentelemetry.io/otel v1.30.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.18.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/otel/metric v1.30.0 // indirect + go.opentelemetry.io/otel/sdk v1.30.0 // indirect + go.opentelemetry.io/otel/trace v1.30.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.26.0 // indirect + golang.org/x/crypto v0.27.0 // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.23.0 // indirect - golang.org/x/term v0.23.0 // indirect - golang.org/x/text v0.17.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect + golang.org/x/text v0.18.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/api v0.169.0 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // 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 @@ -245,5 +245,5 @@ replace ( github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29 + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20240919215226-30bc1c0d330c ) diff --git a/go.sum b/go.sum index b0c0f27e3d..206e8b8eb8 100644 --- a/go.sum +++ b/go.sum @@ -317,8 +317,8 @@ github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8w 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.41.0-tm-v0.34.29 h1:hRdTxe+Dz6kiqifRZCC9qYQiTJME7CzAZodrTHlhhnk= -github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29/go.mod h1:H6vjzdoqTt4qmbf11z1Lnc9YLUp/B8ITEQLhU92ghqQ= +github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20240919215226-30bc1c0d330c h1:t4n5/mk4vfY8lnRAO7G/Utpe5VliprYjWFjsu1PBwPw= +github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20240919215226-30bc1c0d330c/go.mod h1:pOLjNFphDyMevd3bRomkm8ZFWYut2Svms1mIPu1uUbo= github.com/celestiaorg/cosmos-sdk v1.24.1-sdk-v0.46.16 h1:SeQ7Y/CyOcUMKo7mQiexaj/pZ/xIgyuZFIwYZwpSkWE= github.com/celestiaorg/cosmos-sdk v1.24.1-sdk-v0.46.16/go.mod h1:Bpl1LSWiDpQumgOhhMTZBMopqa0j7fRasIhvTZB44P0= github.com/celestiaorg/go-square v1.0.0 h1:pb1leaUi2WWSpri6ubNJOCUWdAoPr6AYGlT19F/Y/4k= @@ -433,8 +433,8 @@ github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7 github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c h1:uQYC5Z1mdLRPrZhHjHxufI8+2UG/i25QG92j0Er9p6I= github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= github.com/crate-crypto/go-kzg-4844 v1.0.0 h1:TsSgHwrkTKecKJ4kadtHi4b3xHW5dCFUDFnUp1TsawI= @@ -578,8 +578,8 @@ github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= @@ -622,8 +622,8 @@ github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PU 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= -github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= +github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= @@ -730,8 +730,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-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/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= 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= @@ -824,8 +824,9 @@ github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -949,8 +950,8 @@ github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgx github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= -github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= @@ -1103,8 +1104,8 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= -github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= @@ -1225,8 +1226,8 @@ github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= @@ -1361,19 +1362,19 @@ 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.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs= -go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4= +go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts= +go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc= 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.26.0 h1:7S39CLuY5Jgg9CrnA9HHiEjGMF/X2VHvoXGgSllRz30= -go.opentelemetry.io/otel/metric v1.26.0/go.mod h1:SY+rHOI4cEawI9a7N1A4nIg/nTQXe1ccCNWYOJUrpX4= +go.opentelemetry.io/otel/metric v1.30.0 h1:4xNulvn9gjzo4hjg+wzIKG7iNFEaBMX00Qd4QIZs7+w= +go.opentelemetry.io/otel/metric v1.30.0/go.mod h1:aXTfST94tswhWEb+5QjlSqG+cZlmyXy/u8jFpor3WqQ= go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= -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/sdk v1.30.0 h1:cHdik6irO49R5IysVhdn8oaiR9m8XluDaJAs4DfOrYE= +go.opentelemetry.io/otel/sdk v1.30.0/go.mod h1:p14X4Ok8S+sygzblytT1nqG98QG2KYKv++HE0LY/mhg= go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= -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/otel/trace v1.30.0 h1:7UBkkYzeg3C7kQX8VAidWh2biiQbtAKjyIML8dQ9wmc= +go.opentelemetry.io/otel/trace v1.30.0/go.mod h1:5EyKqTzzmyqB9bwtCCq6pDLktPK6fmGf/Dph+8VI02o= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= 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= @@ -1414,8 +1415,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.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= 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= @@ -1430,8 +1431,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-20240213143201-ec583247a57a h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE= -golang.org/x/exp v0.0.0-20240213143201-ec583247a57a/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e h1:I88y4caeGeuDQxgdoFPUq097j7kNfw6uvuiNxUBfcBk= +golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= 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= @@ -1680,14 +1681,14 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= 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.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= -golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= 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= @@ -1698,8 +1699,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 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.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= 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= @@ -1961,8 +1962,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-20240604185151-ef581f913117 h1:+rdxYoE3E5htTEWIe15GlN6IfvbURM//Jt0mmkmm6ZU= google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117/go.mod h1:OimBR/bc1wPO9iV4NC2bpyjy3VnAwZh5EBPQdtaE5oo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= 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= From 33b2f7fed6f36a850efc6008d7287063a6819c9d Mon Sep 17 00:00:00 2001 From: sanaz Date: Thu, 19 Sep 2024 15:56:13 -0700 Subject: [PATCH 006/106] adds a todo --- app/app.go | 1 + 1 file changed, 1 insertion(+) diff --git a/app/app.go b/app/app.go index af83ecf773..839cf6134a 100644 --- a/app/app.go +++ b/app/app.go @@ -542,6 +542,7 @@ func (app *App) Info(req abci.RequestInfo) abci.ResponseInfo { if resp.AppVersion > 0 && !app.IsSealed() { app.mountKeysAndInit(resp.AppVersion) } + // TODO add tiemouts to the response return resp } From dc127dabf175e710660d2b837f6ba0fceafa2a64 Mon Sep 17 00:00:00 2001 From: sanaz Date: Thu, 19 Sep 2024 15:56:33 -0700 Subject: [PATCH 007/106] displaying the timeout propose in the logs --- cmd/celestia-appd/cmd/start.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/celestia-appd/cmd/start.go b/cmd/celestia-appd/cmd/start.go index 763f1b6cd5..072d724922 100644 --- a/cmd/celestia-appd/cmd/start.go +++ b/cmd/celestia-appd/cmd/start.go @@ -113,6 +113,8 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. } serverCtx := server.GetServerContextFromCmd(cmd) + serverCtx.Logger.Info("starting node with timeout_propose: ", + serverCtx.Config.Consensus.TimeoutPropose.Seconds()) clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err From 7efde4681d443924a09dbfea291b6b41fb76b4f6 Mon Sep 17 00:00:00 2001 From: sanaz Date: Thu, 19 Sep 2024 15:58:08 -0700 Subject: [PATCH 008/106] minor correction on a comment --- app/app.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index 839cf6134a..ee9de11213 100644 --- a/app/app.go +++ b/app/app.go @@ -480,8 +480,8 @@ func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.Respo app.SignalKeeper.ResetTally(ctx) } } - // Update timeouts based on the current version. - // TODO: We check app.AppVersion(), which may differ from currentVersion, + // TODO: We set tiemouts based on app.AppVersion(), + // which may differ from currentVersion, // as we want to set the timeouts based on the app version // that will be used in the next block. v := app.AppVersion() From 3eca59db3c6bf7c9770fc8fc1a0045f59f2307dc Mon Sep 17 00:00:00 2001 From: sanaz Date: Thu, 19 Sep 2024 16:10:17 -0700 Subject: [PATCH 009/106] sets the initial values of timeouts according to the latest version supported --- app/default_overrides.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/default_overrides.go b/app/default_overrides.go index bd9e98278f..c8774c2360 100644 --- a/app/default_overrides.go +++ b/app/default_overrides.go @@ -274,8 +274,8 @@ func DefaultConsensusConfig() *tmcfg.Config { cfg.Mempool.MaxTxsBytes = int64(upperBoundBytes) * cfg.Mempool.TTLNumBlocks cfg.Mempool.Version = "v1" // prioritized mempool - cfg.Consensus.TimeoutPropose = appconsts.GetTimeoutPropose() - cfg.Consensus.TimeoutCommit = appconsts.GetTimeoutCommit() + cfg.Consensus.TimeoutPropose = appconsts.GetTimeoutPropose(appconsts.LatestVersion) + cfg.Consensus.TimeoutCommit = appconsts.GetTimeoutCommit(appconsts.LatestVersion) cfg.Consensus.SkipTimeoutCommit = false cfg.TxIndex.Indexer = "null" From 861309f576757dc80eb50b93b36530f45e5df2f2 Mon Sep 17 00:00:00 2001 From: sanaz Date: Thu, 19 Sep 2024 16:10:27 -0700 Subject: [PATCH 010/106] adds a todo --- app/app.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index ee9de11213..93a969113f 100644 --- a/app/app.go +++ b/app/app.go @@ -547,7 +547,7 @@ func (app *App) Info(req abci.RequestInfo) abci.ResponseInfo { } // InitChain implements the ABCI interface. This method is a wrapper around -// baseapp's InitChain so we can take the app version and setup the multicommit +// baseapp's InitChain so that we can take the app version and setup the multicommit // store. // // Side-effect: calls baseapp.Init() @@ -566,6 +566,7 @@ func (app *App) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain app.SetInitialAppVersionInConsensusParams(ctx, appVersion) app.SetAppVersion(ctx, appVersion) } + // TODO return timeouts as well return res } From 789bc23fa050008896481385eac7f34c5b62d5dc Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 20 Sep 2024 10:45:28 -0700 Subject: [PATCH 011/106] gets timeouts in info --- app/app.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/app.go b/app/app.go index 93a969113f..cd7f57c871 100644 --- a/app/app.go +++ b/app/app.go @@ -543,6 +543,8 @@ func (app *App) Info(req abci.RequestInfo) abci.ResponseInfo { app.mountKeysAndInit(resp.AppVersion) } // TODO add tiemouts to the response + resp.Timeouts.TimeoutPropose = appconsts.GetTimeoutPropose() + return resp } From 3158757d2e193640f8dde223ab2bd17d6523f134 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 20 Sep 2024 10:49:54 -0700 Subject: [PATCH 012/106] bumps core --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b20ab023c5..50365e4f52 100644 --- a/go.mod +++ b/go.mod @@ -245,5 +245,5 @@ replace ( github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20240919215226-30bc1c0d330c + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20240920170324-fa27abe8e36e ) diff --git a/go.sum b/go.sum index 206e8b8eb8..a6789ff907 100644 --- a/go.sum +++ b/go.sum @@ -317,8 +317,8 @@ github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8w 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.41.0-tm-v0.34.29.0.20240919215226-30bc1c0d330c h1:t4n5/mk4vfY8lnRAO7G/Utpe5VliprYjWFjsu1PBwPw= -github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20240919215226-30bc1c0d330c/go.mod h1:pOLjNFphDyMevd3bRomkm8ZFWYut2Svms1mIPu1uUbo= +github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20240920170324-fa27abe8e36e h1:9k70M39IA7IxuJGo1CzrdXA7YBW6Q9B25YRKMe/TbeA= +github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20240920170324-fa27abe8e36e/go.mod h1:pOLjNFphDyMevd3bRomkm8ZFWYut2Svms1mIPu1uUbo= github.com/celestiaorg/cosmos-sdk v1.24.1-sdk-v0.46.16 h1:SeQ7Y/CyOcUMKo7mQiexaj/pZ/xIgyuZFIwYZwpSkWE= github.com/celestiaorg/cosmos-sdk v1.24.1-sdk-v0.46.16/go.mod h1:Bpl1LSWiDpQumgOhhMTZBMopqa0j7fRasIhvTZB44P0= github.com/celestiaorg/go-square v1.0.0 h1:pb1leaUi2WWSpri6ubNJOCUWdAoPr6AYGlT19F/Y/4k= From 75a501605710b6d0beb146b79a69449cb3cbe927 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 20 Sep 2024 10:50:09 -0700 Subject: [PATCH 013/106] return timouts in the Info call --- app/app.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/app.go b/app/app.go index cd7f57c871..fbbdd284b0 100644 --- a/app/app.go +++ b/app/app.go @@ -339,7 +339,7 @@ func New( packetForwardMiddleware := packetforward.NewIBCMiddleware( transferStack, app.PacketForwardKeeper, - 0, // retries on timeout + 0, // retries on timeout packetforwardkeeper.DefaultForwardTransferPacketTimeoutTimestamp, // forward timeout packetforwardkeeper.DefaultRefundTransferPacketTimeoutTimestamp, // refund timeout ) @@ -542,8 +542,9 @@ func (app *App) Info(req abci.RequestInfo) abci.ResponseInfo { if resp.AppVersion > 0 && !app.IsSealed() { app.mountKeysAndInit(resp.AppVersion) } - // TODO add tiemouts to the response - resp.Timeouts.TimeoutPropose = appconsts.GetTimeoutPropose() + + resp.Timeouts.TimeoutPropose = appconsts.GetTimeoutPropose(resp.AppVersion) + resp.Timeouts.TimeoutCommit = appconsts.GetTimeoutCommit(resp.AppVersion) return resp } From 539d4d6eda7226feb878c23954a918bb18c8368e Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 20 Sep 2024 14:57:37 -0700 Subject: [PATCH 014/106] refactors the code based on the new core --- app/app.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/app.go b/app/app.go index fbbdd284b0..da38159a54 100644 --- a/app/app.go +++ b/app/app.go @@ -339,7 +339,7 @@ func New( packetForwardMiddleware := packetforward.NewIBCMiddleware( transferStack, app.PacketForwardKeeper, - 0, // retries on timeout + 0, // retries on timeout packetforwardkeeper.DefaultForwardTransferPacketTimeoutTimestamp, // forward timeout packetforwardkeeper.DefaultRefundTransferPacketTimeoutTimestamp, // refund timeout ) @@ -485,8 +485,8 @@ func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.Respo // as we want to set the timeouts based on the app version // that will be used in the next block. v := app.AppVersion() - res.TimeoutCommit = appconsts.GetTimeoutCommit(v) - res.TimeoutPropose = appconsts.GetTimeoutPropose(v) + res.Timeouts.TimeoutCommit = appconsts.GetTimeoutCommit(v) + res.Timeouts.TimeoutPropose = appconsts.GetTimeoutPropose(v) return res } @@ -542,7 +542,7 @@ func (app *App) Info(req abci.RequestInfo) abci.ResponseInfo { if resp.AppVersion > 0 && !app.IsSealed() { app.mountKeysAndInit(resp.AppVersion) } - + resp.Timeouts.TimeoutPropose = appconsts.GetTimeoutPropose(resp.AppVersion) resp.Timeouts.TimeoutCommit = appconsts.GetTimeoutCommit(resp.AppVersion) From a6d5c1dfe4993da4fdca705a4ad250110c455a85 Mon Sep 17 00:00:00 2001 From: sanaz Date: Tue, 24 Sep 2024 11:03:43 -0700 Subject: [PATCH 015/106] updates the core version with new InitChain --- go.mod | 19 +++++++------------ go.sum | 25 +++++++++---------------- 2 files changed, 16 insertions(+), 28 deletions(-) diff --git a/go.mod b/go.mod index c5c545de2b..ff5e727dd2 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,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-20240213143201-ec583247a57a + golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 google.golang.org/grpc v1.67.0 google.golang.org/protobuf v1.34.2 @@ -86,10 +86,6 @@ require ( github.com/dgraph-io/badger/v2 v2.2007.4 // indirect 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.6.0 // indirect - github.com/docker/docker v26.1.5+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 github.com/emicklei/go-restful/v3 v3.11.0 // indirect @@ -176,9 +172,8 @@ require ( 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 // indirect - github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect @@ -225,13 +220,13 @@ require ( golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.22.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/term v0.23.0 // indirect - golang.org/x/text v0.17.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect + golang.org/x/text v0.18.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/api v0.169.0 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // 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 @@ -254,5 +249,5 @@ replace ( github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20240920170324-fa27abe8e36e + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20240924175932-0904cd505002 ) diff --git a/go.sum b/go.sum index 3eed8e9dd8..8c4348eeaa 100644 --- a/go.sum +++ b/go.sum @@ -213,7 +213,6 @@ 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= @@ -318,8 +317,8 @@ github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8w 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.41.0-tm-v0.34.29.0.20240920170324-fa27abe8e36e h1:9k70M39IA7IxuJGo1CzrdXA7YBW6Q9B25YRKMe/TbeA= -github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20240920170324-fa27abe8e36e/go.mod h1:pOLjNFphDyMevd3bRomkm8ZFWYut2Svms1mIPu1uUbo= +github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20240924175932-0904cd505002 h1:bfB+7dWVLXzLUWKMGmFiLv/Sxh+0LIzyBYqQypa2dbg= +github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20240924175932-0904cd505002/go.mod h1:pOLjNFphDyMevd3bRomkm8ZFWYut2Svms1mIPu1uUbo= github.com/celestiaorg/cosmos-sdk v1.24.1-sdk-v0.46.16 h1:SeQ7Y/CyOcUMKo7mQiexaj/pZ/xIgyuZFIwYZwpSkWE= github.com/celestiaorg/cosmos-sdk v1.24.1-sdk-v0.46.16/go.mod h1:Bpl1LSWiDpQumgOhhMTZBMopqa0j7fRasIhvTZB44P0= github.com/celestiaorg/go-square v1.1.0 h1:K4tBL5PCJwDtpBfyDxxZ3N962aC9VYb5/bw3LjagEtY= @@ -406,8 +405,6 @@ github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJ github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= -github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= -github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -480,13 +477,10 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= -github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= 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.1.5+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= @@ -740,8 +734,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-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= -github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= 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= @@ -1197,8 +1191,8 @@ github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= -github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1216,7 +1210,6 @@ 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= @@ -1693,8 +1686,8 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= 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= @@ -1974,8 +1967,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-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= 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= From 81e7f9baf087f6a07dc05ba6e2ab8f67cf42efc3 Mon Sep 17 00:00:00 2001 From: sanaz Date: Tue, 24 Sep 2024 11:07:08 -0700 Subject: [PATCH 016/106] sends back timeouts in the InitChainResponse --- app/app.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index 7df904d081..77965bcb83 100644 --- a/app/app.go +++ b/app/app.go @@ -569,7 +569,8 @@ func (app *App) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain app.SetInitialAppVersionInConsensusParams(ctx, appVersion) app.SetAppVersion(ctx, appVersion) } - // TODO return timeouts as well + res.Timeouts.TimeoutCommit = appconsts.GetTimeoutCommit(appVersion) + res.Timeouts.TimeoutPropose = appconsts.GetTimeoutPropose(appVersion) return res } From 0dbe35c3e2abab620c14b176f85640c911579649 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 27 Sep 2024 14:24:43 -0700 Subject: [PATCH 017/106] adds a reminder --- test/util/testnode/query.go | 1 + 1 file changed, 1 insertion(+) diff --git a/test/util/testnode/query.go b/test/util/testnode/query.go index a0fc229000..8e3ad3bfd1 100644 --- a/test/util/testnode/query.go +++ b/test/util/testnode/query.go @@ -19,5 +19,6 @@ func QueryTx(clientCtx client.Context, hashHexStr string, prove bool) (*rpctypes return nil, err } + //node.DumpConsensusState(context.Background()) return node.Tx(context.Background(), hash, prove) } From be3bf263ed537ce04e8223803bd1a01d3be11c44 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 27 Sep 2024 14:35:16 -0700 Subject: [PATCH 018/106] adding a todo --- app/app.go | 1 + 1 file changed, 1 insertion(+) diff --git a/app/app.go b/app/app.go index 77965bcb83..528cc47ead 100644 --- a/app/app.go +++ b/app/app.go @@ -811,6 +811,7 @@ func (app *App) InitializeAppVersion(ctx sdk.Context) { // OfferSnapshot is a wrapper around the baseapp's OfferSnapshot method. It is // needed to mount stores for the appropriate app version. +// TODO [Q]: How about taking care of v3 version in this call? func (app *App) OfferSnapshot(req abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot { if app.IsSealed() { // If the app is sealed, keys have already been mounted so this can From 76eb2fbf457c6e2e556fc4d7183c94e8e3418de5 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 27 Sep 2024 15:30:35 -0700 Subject: [PATCH 019/106] deletes stale comment --- test/util/testnode/query.go | 1 - 1 file changed, 1 deletion(-) diff --git a/test/util/testnode/query.go b/test/util/testnode/query.go index 8e3ad3bfd1..a0fc229000 100644 --- a/test/util/testnode/query.go +++ b/test/util/testnode/query.go @@ -19,6 +19,5 @@ func QueryTx(clientCtx client.Context, hashHexStr string, prove bool) (*rpctypes return nil, err } - //node.DumpConsensusState(context.Background()) return node.Tx(context.Background(), hash, prove) } From bc2e04c658f60d0cf6f5646451ee071c8f514b42 Mon Sep 17 00:00:00 2001 From: sanaz Date: Tue, 1 Oct 2024 11:28:18 -0700 Subject: [PATCH 020/106] indicates that the long form of the flags are used using double hypen --- test/e2e/testnet/txsimNode.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/e2e/testnet/txsimNode.go b/test/e2e/testnet/txsimNode.go index 25a17f6d15..d200c8b825 100644 --- a/test/e2e/testnet/txsimNode.go +++ b/test/e2e/testnet/txsimNode.go @@ -66,12 +66,12 @@ func CreateTxClient( return nil, err } args := []string{ - fmt.Sprintf("-grpc-endpoint %s", endpoint), - fmt.Sprintf("-poll-time %ds", pollTime), - fmt.Sprintf("-seed %d ", seed), - fmt.Sprintf("-blob %d ", sequences), - fmt.Sprintf("-blob-amounts %d ", blobsPerSeq), - fmt.Sprintf("-blob-sizes %s ", blobRange), + fmt.Sprintf("--grpc-endpoint %s", endpoint), + fmt.Sprintf("--poll-time %ds", pollTime), + fmt.Sprintf("--seed %d ", seed), + fmt.Sprintf("--blob %d ", sequences), + fmt.Sprintf("--blob-amounts %d ", blobsPerSeq), + fmt.Sprintf("--blob-sizes %s ", blobRange), } if err := txIns.Build().SetArgs(args...); err != nil { From 07daa0bbf755d525cbd97cf9ca546c8cf527f422 Mon Sep 17 00:00:00 2001 From: sanaz Date: Tue, 1 Oct 2024 11:28:27 -0700 Subject: [PATCH 021/106] passes the key-path --- test/e2e/testnet/txsimNode.go | 1 + 1 file changed, 1 insertion(+) diff --git a/test/e2e/testnet/txsimNode.go b/test/e2e/testnet/txsimNode.go index d200c8b825..285e798d66 100644 --- a/test/e2e/testnet/txsimNode.go +++ b/test/e2e/testnet/txsimNode.go @@ -72,6 +72,7 @@ func CreateTxClient( fmt.Sprintf("--blob %d ", sequences), fmt.Sprintf("--blob-amounts %d ", blobsPerSeq), fmt.Sprintf("--blob-sizes %s ", blobRange), + fmt.Sprintf("--key-path %s ", volumePath), } if err := txIns.Build().SetArgs(args...); err != nil { From 8ac82fe5ee1bdde13d1c13127cc7212f2493678c Mon Sep 17 00:00:00 2001 From: sanaz Date: Tue, 1 Oct 2024 11:28:37 -0700 Subject: [PATCH 022/106] modifies a godoc --- test/e2e/simple.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/simple.go b/test/e2e/simple.go index 7999c726a0..65ba90d0b4 100644 --- a/test/e2e/simple.go +++ b/test/e2e/simple.go @@ -11,7 +11,7 @@ import ( "github.com/celestiaorg/celestia-app/v3/test/util/testnode" ) -// This test runs a simple testnet with 4 validators. It submits both MsgPayForBlobs +// E2ESimple runs a simple testnet with 4 validators. It submits both MsgPayForBlobs // and MsgSends over 30 seconds and then asserts that at least 10 transactions were // committed. func E2ESimple(logger *log.Logger) error { From 76fd45dc957f8ceef246fd8650322a7bcdf9f5cb Mon Sep 17 00:00:00 2001 From: sanaz Date: Tue, 1 Oct 2024 12:29:17 -0700 Subject: [PATCH 023/106] fixes a typo --- app/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index 528cc47ead..872a61038d 100644 --- a/app/app.go +++ b/app/app.go @@ -480,7 +480,7 @@ func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.Respo app.SignalKeeper.ResetTally(ctx) } } - // TODO: We set tiemouts based on app.AppVersion(), + // TODO: We set timeouts based on app.AppVersion(), // which may differ from currentVersion, // as we want to set the timeouts based on the app version // that will be used in the next block. From da8c5e4d48a9b083a2e3fcff361894c7c56cd5eb Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 2 Oct 2024 09:01:14 -0700 Subject: [PATCH 024/106] wip test --- test/e2e/major_upgrade_v2.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/e2e/major_upgrade_v2.go b/test/e2e/major_upgrade_v2.go index db21d65306..cb5d5ca6f6 100644 --- a/test/e2e/major_upgrade_v2.go +++ b/test/e2e/major_upgrade_v2.go @@ -72,6 +72,19 @@ func MajorUpgradeToV2(logger *log.Logger) error { return fmt.Errorf("version mismatch before upgrade: expected %d, got %d", v1.Version, resp.Header.Version.App) } + abciInfo, err := client.ABCIInfo(ctx) + testnet.NoError("failed to get ABCI info", err) + if abciInfo.Response.LastBlockHeight <= heightBefore { + if abciInfo.Response.AppVersion != v1.Version { + return fmt.Errorf("version mismatch before upgrade: expected %d, got %d", v1.Version, abciInfo.Response.AppVersion) + } + if abciInfo.Response.Timeouts.TimeoutCommit != 5*time.Second { + return fmt.Errorf("timeout mismatch before upgrade: expected %v, got %v", 5*time.Second, abciInfo.Response.Timeouts.TimeoutCommit) + } + if abciInfo.Response.Timeouts.TimeoutPropose != 5*time.Second { + return fmt.Errorf("timeout mismatch before upgrade: expected %v, got %v", 5*time.Second, abciInfo.Response.Timeouts.TimeoutPropose) + } + } resp, err = client.Header(ctx, &upgradeHeight) testnet.NoError("failed to get header", err) if resp.Header.Version.App != v2.Version { From 31a7f36eeb19b039c31caea1b959d6d808f0faab Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 2 Oct 2024 11:43:28 -0700 Subject: [PATCH 025/106] sets the timeouts according to the app version in the current block header --- app/app.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/app.go b/app/app.go index 872a61038d..eea8704950 100644 --- a/app/app.go +++ b/app/app.go @@ -480,13 +480,8 @@ func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.Respo app.SignalKeeper.ResetTally(ctx) } } - // TODO: We set timeouts based on app.AppVersion(), - // which may differ from currentVersion, - // as we want to set the timeouts based on the app version - // that will be used in the next block. - v := app.AppVersion() - res.Timeouts.TimeoutCommit = appconsts.GetTimeoutCommit(v) - res.Timeouts.TimeoutPropose = appconsts.GetTimeoutPropose(v) + res.Timeouts.TimeoutCommit = appconsts.GetTimeoutCommit(currentVersion) + res.Timeouts.TimeoutPropose = appconsts.GetTimeoutPropose(currentVersion) return res } From 6b2f58eb4b9d1ff29408e34055eca81021ebffdb Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 2 Oct 2024 11:43:48 -0700 Subject: [PATCH 026/106] adds checks for timeouts in the V3Upgrade tests --- app/test/upgrade_test.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/app/test/upgrade_test.go b/app/test/upgrade_test.go index ab188e01ac..d8eaa0d6d6 100644 --- a/app/test/upgrade_test.go +++ b/app/test/upgrade_test.go @@ -88,6 +88,10 @@ func TestAppUpgradeV3(t *testing.T) { Height: 3, }) require.Equal(t, v2.Version, endBlockResp.ConsensusParamUpdates.Version.AppVersion) + require.Equal(t, appconsts.GetTimeoutCommit(v2.Version), + endBlockResp.Timeouts.TimeoutCommit) + require.Equal(t, appconsts.GetTimeoutPropose(v2.Version), + endBlockResp.Timeouts.TimeoutPropose) testApp.Commit() require.NoError(t, signer.IncrementSequence(testnode.DefaultValidatorAccountName)) @@ -99,10 +103,11 @@ func TestAppUpgradeV3(t *testing.T) { // brace yourselfs, this part may take a while initialHeight := int64(4) for height := initialHeight; height < initialHeight+appconsts.DefaultUpgradeHeightDelay; height++ { + appVersion := v2.Version _ = testApp.BeginBlock(abci.RequestBeginBlock{ Header: tmproto.Header{ Height: height, - Version: tmversion.Consensus{App: 2}, + Version: tmversion.Consensus{App: appVersion}, }, }) @@ -110,9 +115,14 @@ func TestAppUpgradeV3(t *testing.T) { Height: 3 + appconsts.DefaultUpgradeHeightDelay, }) + require.Equal(t, appconsts.GetTimeoutCommit(appVersion), endBlockResp.Timeouts.TimeoutCommit) + require.Equal(t, appconsts.GetTimeoutPropose(appVersion), endBlockResp.Timeouts.TimeoutPropose) + _ = testApp.Commit() } require.Equal(t, v3.Version, endBlockResp.ConsensusParamUpdates.Version.AppVersion) + require.Equal(t, appconsts.GetTimeoutCommit(v3.Version), endBlockResp.Timeouts.TimeoutCommit) + require.Equal(t, appconsts.GetTimeoutPropose(v3.Version), endBlockResp.Timeouts.TimeoutPropose) // confirm that an authored blob tx works blob, err := share.NewV1Blob(share.RandomBlobNamespace(), []byte("hello world"), accAddr.Bytes()) @@ -286,7 +296,11 @@ func upgradeFromV1ToV2(t *testing.T, testApp *app.App) { Height: 2, Version: tmversion.Consensus{App: 1}, }}) - testApp.EndBlock(abci.RequestEndBlock{Height: 2}) + endBlockResp := testApp.EndBlock(abci.RequestEndBlock{Height: 2}) + require.Equal(t, appconsts.GetTimeoutCommit(v2.Version), + endBlockResp.Timeouts.TimeoutCommit) + require.Equal(t, appconsts.GetTimeoutPropose(v2.Version), + endBlockResp.Timeouts.TimeoutPropose) testApp.Commit() require.EqualValues(t, 2, testApp.AppVersion()) } From eb2dab56cfa39c00b7f0a17c005156fd76f99040 Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 2 Oct 2024 11:43:59 -0700 Subject: [PATCH 027/106] bumps core --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index ff5e727dd2..2227cd581f 100644 --- a/go.mod +++ b/go.mod @@ -249,5 +249,5 @@ replace ( github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20240924175932-0904cd505002 + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20241002165959-eddd24b3e196 ) diff --git a/go.sum b/go.sum index 8c4348eeaa..3ee7488fc6 100644 --- a/go.sum +++ b/go.sum @@ -317,8 +317,8 @@ github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8w 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.41.0-tm-v0.34.29.0.20240924175932-0904cd505002 h1:bfB+7dWVLXzLUWKMGmFiLv/Sxh+0LIzyBYqQypa2dbg= -github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20240924175932-0904cd505002/go.mod h1:pOLjNFphDyMevd3bRomkm8ZFWYut2Svms1mIPu1uUbo= +github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20241002165959-eddd24b3e196 h1:logtVTH3lW+3uBFSOKoO+dQHtg9dIoM8jYO0INdckkY= +github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20241002165959-eddd24b3e196/go.mod h1:pOLjNFphDyMevd3bRomkm8ZFWYut2Svms1mIPu1uUbo= github.com/celestiaorg/cosmos-sdk v1.24.1-sdk-v0.46.16 h1:SeQ7Y/CyOcUMKo7mQiexaj/pZ/xIgyuZFIwYZwpSkWE= github.com/celestiaorg/cosmos-sdk v1.24.1-sdk-v0.46.16/go.mod h1:Bpl1LSWiDpQumgOhhMTZBMopqa0j7fRasIhvTZB44P0= github.com/celestiaorg/go-square v1.1.0 h1:K4tBL5PCJwDtpBfyDxxZ3N962aC9VYb5/bw3LjagEtY= From 345ecc0b4c37bc7eb883d4d75cb3bb5bc0e2be60 Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 2 Oct 2024 11:51:36 -0700 Subject: [PATCH 028/106] updates test for new timeout logic at pre-upgrade height --- app/test/upgrade_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/test/upgrade_test.go b/app/test/upgrade_test.go index d8eaa0d6d6..1f98ff9c6b 100644 --- a/app/test/upgrade_test.go +++ b/app/test/upgrade_test.go @@ -121,8 +121,6 @@ func TestAppUpgradeV3(t *testing.T) { _ = testApp.Commit() } require.Equal(t, v3.Version, endBlockResp.ConsensusParamUpdates.Version.AppVersion) - require.Equal(t, appconsts.GetTimeoutCommit(v3.Version), endBlockResp.Timeouts.TimeoutCommit) - require.Equal(t, appconsts.GetTimeoutPropose(v3.Version), endBlockResp.Timeouts.TimeoutPropose) // confirm that an authored blob tx works blob, err := share.NewV1Blob(share.RandomBlobNamespace(), []byte("hello world"), accAddr.Bytes()) @@ -149,7 +147,11 @@ func TestAppUpgradeV3(t *testing.T) { }) require.Equal(t, abci.CodeTypeOK, deliverTxResp.Code, deliverTxResp.Log) - _ = testApp.EndBlock(abci.RequestEndBlock{}) + respEndBlock := testApp.EndBlock(abci. + RequestEndBlock{Height: initialHeight + appconsts.DefaultUpgradeHeightDelay}) + require.Equal(t, appconsts.GetTimeoutCommit(v3.Version), respEndBlock.Timeouts.TimeoutCommit) + require.Equal(t, appconsts.GetTimeoutPropose(v3.Version), respEndBlock.Timeouts.TimeoutPropose) + } // TestAppUpgradeV2 verifies that the all module's params are overridden during an From cdef17726a2463e3a948df28de78f03ba348212c Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 2 Oct 2024 12:04:23 -0700 Subject: [PATCH 029/106] extends timeout checks to the initChain calls --- app/test/upgrade_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/test/upgrade_test.go b/app/test/upgrade_test.go index 1f98ff9c6b..a363d03633 100644 --- a/app/test/upgrade_test.go +++ b/app/test/upgrade_test.go @@ -283,7 +283,10 @@ func SetupTestAppWithUpgradeHeight(t *testing.T, upgradeHeight int64) (*app.App, // assert that the chain starts with version provided in genesis infoResp := testApp.Info(abci.RequestInfo{}) - require.EqualValues(t, app.DefaultInitialConsensusParams().Version.AppVersion, infoResp.AppVersion) + appVersion := app.DefaultInitialConsensusParams().Version.AppVersion + require.EqualValues(t, appVersion, infoResp.AppVersion) + require.EqualValues(t, appconsts.GetTimeoutCommit(appVersion), infoResp.Timeouts.TimeoutCommit) + require.EqualValues(t, appconsts.GetTimeoutPropose(appVersion), infoResp.Timeouts.TimeoutPropose) supportedVersions := []uint64{v1.Version, v2.Version, v3.Version} require.Equal(t, supportedVersions, testApp.SupportedVersions()) @@ -299,9 +302,9 @@ func upgradeFromV1ToV2(t *testing.T, testApp *app.App) { Version: tmversion.Consensus{App: 1}, }}) endBlockResp := testApp.EndBlock(abci.RequestEndBlock{Height: 2}) - require.Equal(t, appconsts.GetTimeoutCommit(v2.Version), + require.Equal(t, appconsts.GetTimeoutCommit(v1.Version), endBlockResp.Timeouts.TimeoutCommit) - require.Equal(t, appconsts.GetTimeoutPropose(v2.Version), + require.Equal(t, appconsts.GetTimeoutPropose(v1.Version), endBlockResp.Timeouts.TimeoutPropose) testApp.Commit() require.EqualValues(t, 2, testApp.AppVersion()) From 510fb4c9848cfde40fee656f1cb3c36c9757e0b6 Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 2 Oct 2024 12:05:30 -0700 Subject: [PATCH 030/106] reverts major upgrade e2e tests back to its initial version --- test/e2e/major_upgrade_v2.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/test/e2e/major_upgrade_v2.go b/test/e2e/major_upgrade_v2.go index cb5d5ca6f6..db21d65306 100644 --- a/test/e2e/major_upgrade_v2.go +++ b/test/e2e/major_upgrade_v2.go @@ -72,19 +72,6 @@ func MajorUpgradeToV2(logger *log.Logger) error { return fmt.Errorf("version mismatch before upgrade: expected %d, got %d", v1.Version, resp.Header.Version.App) } - abciInfo, err := client.ABCIInfo(ctx) - testnet.NoError("failed to get ABCI info", err) - if abciInfo.Response.LastBlockHeight <= heightBefore { - if abciInfo.Response.AppVersion != v1.Version { - return fmt.Errorf("version mismatch before upgrade: expected %d, got %d", v1.Version, abciInfo.Response.AppVersion) - } - if abciInfo.Response.Timeouts.TimeoutCommit != 5*time.Second { - return fmt.Errorf("timeout mismatch before upgrade: expected %v, got %v", 5*time.Second, abciInfo.Response.Timeouts.TimeoutCommit) - } - if abciInfo.Response.Timeouts.TimeoutPropose != 5*time.Second { - return fmt.Errorf("timeout mismatch before upgrade: expected %v, got %v", 5*time.Second, abciInfo.Response.Timeouts.TimeoutPropose) - } - } resp, err = client.Header(ctx, &upgradeHeight) testnet.NoError("failed to get header", err) if resp.Header.Version.App != v2.Version { From 67e702b227d4ba924119fa0f6d94bb7a36cd1e4b Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 2 Oct 2024 14:42:13 -0700 Subject: [PATCH 031/106] bumps core --- go.mod | 2 +- go.sum | 4 ++-- test/e2e/timeouts.go | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 test/e2e/timeouts.go diff --git a/go.mod b/go.mod index 2227cd581f..6a7e0c4cf1 100644 --- a/go.mod +++ b/go.mod @@ -249,5 +249,5 @@ replace ( github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20241002165959-eddd24b3e196 + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20241002210128-585d6824ac95 ) diff --git a/go.sum b/go.sum index 3ee7488fc6..7c8d6e2791 100644 --- a/go.sum +++ b/go.sum @@ -317,8 +317,8 @@ github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8w 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.41.0-tm-v0.34.29.0.20241002165959-eddd24b3e196 h1:logtVTH3lW+3uBFSOKoO+dQHtg9dIoM8jYO0INdckkY= -github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20241002165959-eddd24b3e196/go.mod h1:pOLjNFphDyMevd3bRomkm8ZFWYut2Svms1mIPu1uUbo= +github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20241002210128-585d6824ac95 h1:8UKoXjNVQogdiEbz6dcDzLDnJu/rAsA1pUwxcxWdlUo= +github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20241002210128-585d6824ac95/go.mod h1:pOLjNFphDyMevd3bRomkm8ZFWYut2Svms1mIPu1uUbo= github.com/celestiaorg/cosmos-sdk v1.24.1-sdk-v0.46.16 h1:SeQ7Y/CyOcUMKo7mQiexaj/pZ/xIgyuZFIwYZwpSkWE= github.com/celestiaorg/cosmos-sdk v1.24.1-sdk-v0.46.16/go.mod h1:Bpl1LSWiDpQumgOhhMTZBMopqa0j7fRasIhvTZB44P0= github.com/celestiaorg/go-square v1.1.0 h1:K4tBL5PCJwDtpBfyDxxZ3N962aC9VYb5/bw3LjagEtY= diff --git a/test/e2e/timeouts.go b/test/e2e/timeouts.go new file mode 100644 index 0000000000..06ab7d0f9a --- /dev/null +++ b/test/e2e/timeouts.go @@ -0,0 +1 @@ +package main From d67a2fe8e76f503394781fe005c4106bdee7076e Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 2 Oct 2024 14:42:57 -0700 Subject: [PATCH 032/106] changes default configs for testing purposes --- scripts/single-node.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/single-node.sh b/scripts/single-node.sh index d7d19b4f07..28bad7ba0a 100755 --- a/scripts/single-node.sh +++ b/scripts/single-node.sh @@ -2,7 +2,7 @@ # Stop script execution if an error is encountered set -o errexit -# Stop script execution if an undefined variable is used +# Stop scyript execution if an undefined variable is used set -o nounset if ! [ -x "$(command -v celestia-appd)" ] @@ -87,6 +87,12 @@ createGenesis() { trace_push_batch_size=1000 sed -i.bak -e "s/^trace_push_batch_size *=.*/trace_push_batch_size = \"$trace_push_batch_size\"/" ${CELESTIA_APP_HOME}/config/config.toml + timeout_propose="100s" + sed -i.bak -e "s/^timeout_propose *=.*/timeout_propose = \"$timeout_propose\"/" ${CELESTIA_APP_HOME}/config/config.toml + + timeout_commit="900s" + sed -i.bak -e "s/^timeout_commit *=.*/timeout_commit = \"$timeout_commit\"/" ${CELESTIA_APP_HOME}/config/config.toml + echo "Tracing is set up with the ability to pull traced data from the node on the address http://127.0.0.1${trace_pull_address}" } From ebadbd8972e5a6e24c5dcdcaac53835758b9fe59 Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 2 Oct 2024 14:43:53 -0700 Subject: [PATCH 033/106] fixes test name --- test/e2e/simple.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/simple.go b/test/e2e/simple.go index 7999c726a0..65ba90d0b4 100644 --- a/test/e2e/simple.go +++ b/test/e2e/simple.go @@ -11,7 +11,7 @@ import ( "github.com/celestiaorg/celestia-app/v3/test/util/testnode" ) -// This test runs a simple testnet with 4 validators. It submits both MsgPayForBlobs +// E2ESimple runs a simple testnet with 4 validators. It submits both MsgPayForBlobs // and MsgSends over 30 seconds and then asserts that at least 10 transactions were // committed. func E2ESimple(logger *log.Logger) error { From c2a804fba4c1303e7692ba4bfc72a84245442230 Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 2 Oct 2024 14:44:21 -0700 Subject: [PATCH 034/106] adds a test file --- test/e2e/timeouts.go | 64 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/test/e2e/timeouts.go b/test/e2e/timeouts.go index 06ab7d0f9a..b4e5e7e189 100644 --- a/test/e2e/timeouts.go +++ b/test/e2e/timeouts.go @@ -1 +1,65 @@ package main + +import ( + "context" + "fmt" + "log" + "time" + + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" + "github.com/celestiaorg/celestia-app/v3/test/e2e/testnet" + "github.com/celestiaorg/celestia-app/v3/test/util/testnode" +) + +// Timeouts runs a simple testnet with 4 validators. It submits both MsgPayForBlobs +// and MsgSends over 30 seconds and then asserts that at least 10 transactions were +// committed. +func Timeouts(logger *log.Logger) error { + ctx := context.Background() + testNet, err := testnet.New(ctx, "E2ESimple", seed, nil, "test") + testnet.NoError("failed to create testnet", err) + + defer testNet.Cleanup(ctx) + + latestVersion := "pr-3882" + testnet.NoError("failed to get latest version", err) + + logger.Println("Running E2ESimple test", "version", latestVersion) + + logger.Println("Creating testnet validators") + testnet.NoError("failed to create genesis nodes", + testNet.CreateGenesisNodes(ctx, 4, latestVersion, 10000000, 0, testnet.DefaultResources, true)) + + logger.Println("Creating txsim") + endpoints, err := testNet.RemoteGRPCEndpoints(ctx) + testnet.NoError("failed to get remote gRPC endpoints", err) + err = testNet.CreateTxClient(ctx, "txsim", testnet.TxsimVersion, 10, + "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(ctx)) + + logger.Println("Starting testnets") + testnet.NoError("failed to start testnets", testNet.Start(ctx)) + + logger.Println("Waiting for 30 seconds to produce blocks") + time.Sleep(30 * time.Second) + + logger.Println("Reading blockchain headers") + blockchain, err := testnode.ReadBlockchainHeaders(ctx, testNet.Node(0).AddressRPC()) + testnet.NoError("failed to read blockchain headers", err) + + totalTxs := 0 + for _, blockMeta := range blockchain { + version := blockMeta.Header.Version.App + if appconsts.LatestVersion != version { + return fmt.Errorf("expected app version %d, got %d in blockMeta %d", appconsts.LatestVersion, version, blockMeta.Header.Height) + } + totalTxs += blockMeta.NumTxs + } + if totalTxs < 10 { + return fmt.Errorf("expected at least 10 transactions, got %d", totalTxs) + } + return nil +} From 759e65029017b694c83919577c3212dcf2c2d557 Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 2 Oct 2024 14:45:05 -0700 Subject: [PATCH 035/106] adds some checks over the abci responses --- test/e2e/major_upgrade_v2.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/e2e/major_upgrade_v2.go b/test/e2e/major_upgrade_v2.go index db21d65306..cb5d5ca6f6 100644 --- a/test/e2e/major_upgrade_v2.go +++ b/test/e2e/major_upgrade_v2.go @@ -72,6 +72,19 @@ func MajorUpgradeToV2(logger *log.Logger) error { return fmt.Errorf("version mismatch before upgrade: expected %d, got %d", v1.Version, resp.Header.Version.App) } + abciInfo, err := client.ABCIInfo(ctx) + testnet.NoError("failed to get ABCI info", err) + if abciInfo.Response.LastBlockHeight <= heightBefore { + if abciInfo.Response.AppVersion != v1.Version { + return fmt.Errorf("version mismatch before upgrade: expected %d, got %d", v1.Version, abciInfo.Response.AppVersion) + } + if abciInfo.Response.Timeouts.TimeoutCommit != 5*time.Second { + return fmt.Errorf("timeout mismatch before upgrade: expected %v, got %v", 5*time.Second, abciInfo.Response.Timeouts.TimeoutCommit) + } + if abciInfo.Response.Timeouts.TimeoutPropose != 5*time.Second { + return fmt.Errorf("timeout mismatch before upgrade: expected %v, got %v", 5*time.Second, abciInfo.Response.Timeouts.TimeoutPropose) + } + } resp, err = client.Header(ctx, &upgradeHeight) testnet.NoError("failed to get header", err) if resp.Header.Version.App != v2.Version { From 71fb6488e4e7e720f794c091d3790a710f19b849 Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 2 Oct 2024 15:41:57 -0700 Subject: [PATCH 036/106] logs txclient args for visibility and debugging --- test/e2e/testnet/txsimNode.go | 1 + 1 file changed, 1 insertion(+) diff --git a/test/e2e/testnet/txsimNode.go b/test/e2e/testnet/txsimNode.go index 285e798d66..4f05f1d5e0 100644 --- a/test/e2e/testnet/txsimNode.go +++ b/test/e2e/testnet/txsimNode.go @@ -79,6 +79,7 @@ func CreateTxClient( return nil, err } + log.Info().Str("args", fmt.Sprintf("%v", args)).Msg("setting args for tx client") return &TxSim{ Name: name, Instance: txIns, From a1843765a73fb75ae4f06c7cf10af6462cfa7beb Mon Sep 17 00:00:00 2001 From: sanaz Date: Thu, 3 Oct 2024 09:31:56 -0700 Subject: [PATCH 037/106] updates e2e benchmark test branch to the current branch --- test/e2e/benchmark/throughput.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/e2e/benchmark/throughput.go b/test/e2e/benchmark/throughput.go index 337d700525..cee2a7a335 100644 --- a/test/e2e/benchmark/throughput.go +++ b/test/e2e/benchmark/throughput.go @@ -140,6 +140,8 @@ func runBenchmarkTest(logger *log.Logger, testName string, manifest Manifest) er func TwoNodeBigBlock8MB(logger *log.Logger) error { manifest := bigBlockManifest manifest.MaxBlockBytes = 8 * testnet.MB + manifest.CelestiaAppVersion = "pr-3882" + manifest.TxClientVersion = "pr-3882" return runBenchmarkTest(logger, "TwoNodeBigBlock8MB", manifest) } From 6027fb3237c1598bf8a74fd5549a440a3ceb3d8e Mon Sep 17 00:00:00 2001 From: sanaz Date: Thu, 3 Oct 2024 14:52:07 -0700 Subject: [PATCH 038/106] bumps core --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1fe38c2d6c..4498362b5c 100644 --- a/go.mod +++ b/go.mod @@ -247,5 +247,5 @@ replace ( github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20241002210128-585d6824ac95 + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20241003214729-5dca0dcd28e8 ) diff --git a/go.sum b/go.sum index a79ad4784b..0fab04fb1b 100644 --- a/go.sum +++ b/go.sum @@ -317,8 +317,8 @@ github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8w 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.41.0-tm-v0.34.29.0.20241002210128-585d6824ac95 h1:8UKoXjNVQogdiEbz6dcDzLDnJu/rAsA1pUwxcxWdlUo= -github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20241002210128-585d6824ac95/go.mod h1:pOLjNFphDyMevd3bRomkm8ZFWYut2Svms1mIPu1uUbo= +github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20241003214729-5dca0dcd28e8 h1:JxgbVoGgYypUln8Yx4zyHy1xw/pEvqI44hTBqFaW2BY= +github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20241003214729-5dca0dcd28e8/go.mod h1:pOLjNFphDyMevd3bRomkm8ZFWYut2Svms1mIPu1uUbo= github.com/celestiaorg/cosmos-sdk v1.24.1-sdk-v0.46.16 h1:SeQ7Y/CyOcUMKo7mQiexaj/pZ/xIgyuZFIwYZwpSkWE= github.com/celestiaorg/cosmos-sdk v1.24.1-sdk-v0.46.16/go.mod h1:Bpl1LSWiDpQumgOhhMTZBMopqa0j7fRasIhvTZB44P0= github.com/celestiaorg/go-square v1.1.0 h1:K4tBL5PCJwDtpBfyDxxZ3N962aC9VYb5/bw3LjagEtY= From 05ebaa70aba200b60fd6f1705fd67f135e7027dd Mon Sep 17 00:00:00 2001 From: sanaz Date: Thu, 3 Oct 2024 16:10:17 -0700 Subject: [PATCH 039/106] reduces timeouts to the total of 6 s --- pkg/appconsts/v3/app_consts.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/appconsts/v3/app_consts.go b/pkg/appconsts/v3/app_consts.go index a89c6511ee..b6549274db 100644 --- a/pkg/appconsts/v3/app_consts.go +++ b/pkg/appconsts/v3/app_consts.go @@ -8,6 +8,6 @@ const ( SubtreeRootThreshold int = 64 TxSizeCostPerByte uint64 = 10 GasPerBlobByte uint32 = 8 - TimeoutPropose = time.Second * 11 - TimeoutCommit = time.Second * 11 + TimeoutPropose = time.Second * 3 + TimeoutCommit = time.Second * 1 ) From ba95e0b53e692c3731e7676a088d6fd08227292b Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 4 Oct 2024 09:45:16 -0700 Subject: [PATCH 040/106] bumps core --- go.mod | 17 +++++++++-------- go.sum | 50 +++++++++++++++++++++++++------------------------- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/go.mod b/go.mod index 4498362b5c..722a8a9fb0 100644 --- a/go.mod +++ b/go.mod @@ -57,7 +57,8 @@ require ( github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect 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/btcsuite/btcd/btcec/v2 v2.3.4 // indirect + github.com/bufbuild/protocompile v0.14.1 // 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.2.1 // indirect @@ -119,7 +120,7 @@ require ( github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.2 // indirect github.com/gorilla/handlers v1.5.2 // indirect - github.com/gorilla/websocket v1.5.0 // indirect + github.com/gorilla/websocket v1.5.3 // indirect github.com/grafana/otel-profiling-go v0.5.1 // indirect github.com/grafana/pyroscope-go v1.1.2 // indirect github.com/grafana/pyroscope-go/godeltaprof v0.1.8 // indirect @@ -157,7 +158,7 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect - github.com/minio/highwayhash v1.0.2 // indirect + github.com/minio/highwayhash v1.0.3 // indirect github.com/minio/md5-simd v1.1.2 // indirect github.com/minio/minio-go/v7 v7.0.74 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect @@ -176,10 +177,10 @@ require ( github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.19.1 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.53.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_golang v1.20.3 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/regen-network/cosmos-proto v0.3.1 // indirect github.com/rivo/uniseg v0.4.4 // indirect @@ -247,5 +248,5 @@ replace ( github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20241003214729-5dca0dcd28e8 + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004160214-cfdd2c352a9d ) diff --git a/go.sum b/go.sum index 0fab04fb1b..fafd5f85c2 100644 --- a/go.sum +++ b/go.sum @@ -289,8 +289,8 @@ github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= @@ -308,8 +308,8 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= -github.com/bufbuild/protocompile v0.5.1/go.mod h1:G5iLmavmF4NsYtpZFvE3B/zFch2GIY8+wjsYLR/lc40= +github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw= +github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= 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= @@ -317,8 +317,8 @@ github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8w 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.41.0-tm-v0.34.29.0.20241003214729-5dca0dcd28e8 h1:JxgbVoGgYypUln8Yx4zyHy1xw/pEvqI44hTBqFaW2BY= -github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29.0.20241003214729-5dca0dcd28e8/go.mod h1:pOLjNFphDyMevd3bRomkm8ZFWYut2Svms1mIPu1uUbo= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004160214-cfdd2c352a9d h1:FobXEPrunl+cCFlwBJVMiteTaRaBAYQ/G/fNMDescys= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004160214-cfdd2c352a9d/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= github.com/celestiaorg/cosmos-sdk v1.24.1-sdk-v0.46.16 h1:SeQ7Y/CyOcUMKo7mQiexaj/pZ/xIgyuZFIwYZwpSkWE= github.com/celestiaorg/cosmos-sdk v1.24.1-sdk-v0.46.16/go.mod h1:Bpl1LSWiDpQumgOhhMTZBMopqa0j7fRasIhvTZB44P0= github.com/celestiaorg/go-square v1.1.0 h1:K4tBL5PCJwDtpBfyDxxZ3N962aC9VYb5/bw3LjagEtY= @@ -614,8 +614,8 @@ github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PU 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= -github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= -github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= +github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= +github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= @@ -722,8 +722,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-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= -github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= 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= @@ -764,8 +764,8 @@ github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWS github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grafana/otel-profiling-go v0.5.1 h1:stVPKAFZSa7eGiqbYuG25VcqYksR6iWvF3YH66t4qL8= github.com/grafana/otel-profiling-go v0.5.1/go.mod h1:ftN/t5A/4gQI19/8MoWurBEtC6gFw8Dns1sJZ9W4Tls= github.com/grafana/pyroscope-go v1.1.2 h1:7vCfdORYQMCxIzI3NlYAs3FcBP760+gWuYWOyiVyYx8= @@ -988,8 +988,8 @@ github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3N github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= -github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= 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.74 h1:fTo/XlPBTSpo3BAMshlwKL5RspXRv9us5UeHEGYCFe0= @@ -1067,8 +1067,8 @@ github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5 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.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= -github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= +github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= +github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc= 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= @@ -1122,16 +1122,16 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= -github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -1140,16 +1140,16 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE= -github.com/prometheus/common v0.53.0/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= @@ -1568,7 +1568,6 @@ golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1670,6 +1669,7 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= From c1abf94ce9dd7427efd193ecf3fe5b97d4aeea23 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 4 Oct 2024 10:07:41 -0700 Subject: [PATCH 041/106] allows changing app version in the genesis --- test/e2e/benchmark/benchmark.go | 5 ++++- test/e2e/benchmark/manifest.go | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/test/e2e/benchmark/benchmark.go b/test/e2e/benchmark/benchmark.go index 81b2748cb1..67125ebd52 100644 --- a/test/e2e/benchmark/benchmark.go +++ b/test/e2e/benchmark/benchmark.go @@ -19,6 +19,8 @@ type BenchmarkTest struct { manifest *Manifest } +// NewBenchmarkTest wraps around testnet.New to create a new benchmark test +// it may modify genesis consensus parameters based on manifest func NewBenchmarkTest(name string, manifest *Manifest) (*BenchmarkTest, error) { // create a new testnet testNet, err := testnet.New(context.Background(), name, seed, @@ -28,12 +30,13 @@ func NewBenchmarkTest(name string, manifest *Manifest) (*BenchmarkTest, error) { return nil, err } + // modify the consensus parameters based on the manifest testNet.SetConsensusParams(manifest.GetConsensusParams()) return &BenchmarkTest{Testnet: testNet, manifest: manifest}, nil } // SetupNodes creates genesis nodes and tx clients based on the manifest. -// There will be manifest.Validators validators and manifest.TxClients tx clients. +// There will be manifest.Validators many validators and manifest.TxClients many tx clients. // Each tx client connects to one validator. If TxClients are fewer than Validators, some validators will not have a tx client. func (b *BenchmarkTest) SetupNodes() error { ctx := context.Background() diff --git a/test/e2e/benchmark/manifest.go b/test/e2e/benchmark/manifest.go index 64b319fcc8..b212ff85c4 100644 --- a/test/e2e/benchmark/manifest.go +++ b/test/e2e/benchmark/manifest.go @@ -80,6 +80,8 @@ type Manifest struct { GovMaxSquareSize int64 DisableBBR bool + + GenesisAppVersion uint64 } func (m *Manifest) GetGenesisModifiers() []genesis.Modifier { @@ -88,6 +90,7 @@ func (m *Manifest) GetGenesisModifiers() []genesis.Modifier { blobParams := blobtypes.DefaultParams() blobParams.GovMaxSquareSize = uint64(m.GovMaxSquareSize) + modifiers = append(modifiers, genesis.SetBlobParams(ecfg.Codec, blobParams)) return modifiers @@ -96,6 +99,7 @@ func (m *Manifest) GetGenesisModifiers() []genesis.Modifier { func (m *Manifest) GetConsensusParams() *tmproto.ConsensusParams { cparams := app.DefaultConsensusParams() cparams.Block.MaxBytes = m.MaxBlockBytes + cparams.Version.AppVersion = m.GenesisAppVersion return cparams } From d9d5231836491cf200b8e04b9f3b6c3e805c3644 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 4 Oct 2024 10:11:43 -0700 Subject: [PATCH 042/106] adds some utilities to calculate block time stats --- test/util/testnode/read.go | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/test/util/testnode/read.go b/test/util/testnode/read.go index f4b5572a75..234652cc7c 100644 --- a/test/util/testnode/read.go +++ b/test/util/testnode/read.go @@ -3,6 +3,9 @@ package testnode import ( "context" "fmt" + "math" + "sort" + "time" "github.com/celestiaorg/celestia-app/v3/app" "github.com/celestiaorg/celestia-app/v3/app/encoding" @@ -96,6 +99,67 @@ func reverseSlice[T any](s []T) { } } +type HeightTime struct { + Height int64 + Time time.Duration +} + +func CalculateBlockTime(blockMetas []*types.BlockMeta) []HeightTime { + // sort by Height in ascending order + sort.Slice(blockMetas, func(i, j int) bool { + return blockMetas[i].Header.Height < blockMetas[j].Header.Height + }) + + var result []HeightTime + for i := 0; i < len(blockMetas)-1; i++ { + // the time difference between the current header and the next one + timeDiff := blockMetas[i+1].Header.Time.Sub(blockMetas[i].Header.Time) + // shift the time difference to the next height + result = append(result, HeightTime{Height: blockMetas[i+1].Header.Height, Time: timeDiff}) + } + return result +} + +type Stats struct { + Min time.Duration + Max time.Duration + Avg time.Duration + Std time.Duration +} + +func CalculateStats(heightTimes []HeightTime) Stats { + var min, max, sum time.Duration + var count int64 + var variance float64 + + for i, ht := range heightTimes { + if i == 0 || ht.Time < min { + min = ht.Time + } + if i == 0 || ht.Time > max { + max = ht.Time + } + sum += ht.Time + count++ + } + + avg := time.Duration(int64(sum) / count) + + for _, ht := range heightTimes { + diff := float64(ht.Time - avg) + variance += diff * diff + } + + std := time.Duration(math.Sqrt(variance / float64(count))) + + return Stats{ + Min: min, + Max: max, + Avg: avg, + Std: std, + } +} + func ReadBlockHeights(ctx context.Context, rpcAddress string, fromHeight, toHeight int64) ([]*types.Block, error) { client, err := http.New(rpcAddress, "/websocket") if err != nil { From 721910df813a83e1b524594feeba7ea3713a6e82 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 4 Oct 2024 10:48:11 -0700 Subject: [PATCH 043/106] bumps core --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8d4a07e0ea..c41a61b3d6 100644 --- a/go.mod +++ b/go.mod @@ -247,5 +247,5 @@ replace ( github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004160214-cfdd2c352a9d + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004174128-f8eaf2d790f3 ) diff --git a/go.sum b/go.sum index 52a74d19d4..e72db4f67e 100644 --- a/go.sum +++ b/go.sum @@ -317,8 +317,8 @@ github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8w 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.42.0-tm-v0.34.35.0.20241004160214-cfdd2c352a9d h1:FobXEPrunl+cCFlwBJVMiteTaRaBAYQ/G/fNMDescys= -github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004160214-cfdd2c352a9d/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004174128-f8eaf2d790f3 h1:Qj5FLcilBRGc+ihcLujSJycPBqUixPhRfJ+Cl/uaM/w= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004174128-f8eaf2d790f3/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16 h1:f+fTe7GGk0/qgdzyqB8kk8EcDf9d6MC22khBTQiDXsU= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16/go.mod h1:07Z8HJqS8Rw4XlZ+ok3D3NM/X/in8mvcGLvl0Zb5wrA= github.com/celestiaorg/go-square v1.1.0 h1:K4tBL5PCJwDtpBfyDxxZ3N962aC9VYb5/bw3LjagEtY= From 072d17d46b4e4ed0521645b7aeba22ee07d30fd1 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 4 Oct 2024 10:55:07 -0700 Subject: [PATCH 044/106] bumps core --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c41a61b3d6..1552ae21e4 100644 --- a/go.mod +++ b/go.mod @@ -247,5 +247,5 @@ replace ( github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004174128-f8eaf2d790f3 + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004175320-eff0bb265864 ) diff --git a/go.sum b/go.sum index e72db4f67e..b85e902fb7 100644 --- a/go.sum +++ b/go.sum @@ -317,8 +317,8 @@ github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8w 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.42.0-tm-v0.34.35.0.20241004174128-f8eaf2d790f3 h1:Qj5FLcilBRGc+ihcLujSJycPBqUixPhRfJ+Cl/uaM/w= -github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004174128-f8eaf2d790f3/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004175320-eff0bb265864 h1:cT+AD/bF5nzjZN4zNPASBBMCDEW1s1pA7KzL0Le3uZ0= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004175320-eff0bb265864/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16 h1:f+fTe7GGk0/qgdzyqB8kk8EcDf9d6MC22khBTQiDXsU= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16/go.mod h1:07Z8HJqS8Rw4XlZ+ok3D3NM/X/in8mvcGLvl0Zb5wrA= github.com/celestiaorg/go-square v1.1.0 h1:K4tBL5PCJwDtpBfyDxxZ3N962aC9VYb5/bw3LjagEtY= From 0e202041bec5cab462e7b2b20a17300e02425484 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 4 Oct 2024 12:21:48 -0700 Subject: [PATCH 045/106] bumps core --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1552ae21e4..e5dea44f32 100644 --- a/go.mod +++ b/go.mod @@ -247,5 +247,5 @@ replace ( github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004175320-eff0bb265864 + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004191934-9865ebe79261 ) diff --git a/go.sum b/go.sum index b85e902fb7..e95da4ac2f 100644 --- a/go.sum +++ b/go.sum @@ -317,8 +317,8 @@ github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8w 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.42.0-tm-v0.34.35.0.20241004175320-eff0bb265864 h1:cT+AD/bF5nzjZN4zNPASBBMCDEW1s1pA7KzL0Le3uZ0= -github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004175320-eff0bb265864/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004191934-9865ebe79261 h1:UU62Up87NY4l6ugV61sgcSUGY2wzdjBVkHzmIEIqC1Q= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004191934-9865ebe79261/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16 h1:f+fTe7GGk0/qgdzyqB8kk8EcDf9d6MC22khBTQiDXsU= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16/go.mod h1:07Z8HJqS8Rw4XlZ+ok3D3NM/X/in8mvcGLvl0Zb5wrA= github.com/celestiaorg/go-square v1.1.0 h1:K4tBL5PCJwDtpBfyDxxZ3N962aC9VYb5/bw3LjagEtY= From 4ac2c73dcf9ab266c2a72f55434455b27d2fac45 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 4 Oct 2024 12:22:23 -0700 Subject: [PATCH 046/106] fixes godocs --- test/util/genesis/genesis.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/util/genesis/genesis.go b/test/util/genesis/genesis.go index 83eab54250..f0fadf0b59 100644 --- a/test/util/genesis/genesis.go +++ b/test/util/genesis/genesis.go @@ -73,7 +73,7 @@ func NewDefaultGenesis() *Genesis { return g } -// WithModifier adds a genesis modifier to the genesis. +// WithModifiers adds a genesis modifier to the genesis. func (g *Genesis) WithModifiers(ops ...Modifier) *Genesis { g.genOps = append(g.genOps, ops...) return g @@ -97,7 +97,7 @@ func (g *Genesis) WithGenesisTime(genesisTime time.Time) *Genesis { return g } -// WithAccounts adds the given validators to the genesis. +// WithValidators adds the given validators to the genesis. func (g *Genesis) WithValidators(vals ...Validator) *Genesis { for _, val := range vals { err := g.NewValidator(val) @@ -180,7 +180,7 @@ func (g *Genesis) AddValidator(val Validator) error { return nil } -// Creates a new validator account and adds it to the genesis. +// NewValidator creates a new validator account and adds it to the genesis. func (g *Genesis) NewValidator(val Validator) error { // Add the validator's genesis account if err := g.NewAccount(val.KeyringAccount); err != nil { From 0e3c631c143588549c49a17919147058a356833c Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 4 Oct 2024 12:22:42 -0700 Subject: [PATCH 047/106] adds a test for v3 in biglbokcs --- test/e2e/benchmark/main.go | 1 + test/e2e/benchmark/throughput.go | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/test/e2e/benchmark/main.go b/test/e2e/benchmark/main.go index be4eb1e126..b41819c99e 100644 --- a/test/e2e/benchmark/main.go +++ b/test/e2e/benchmark/main.go @@ -18,6 +18,7 @@ func main() { {"LargeNetworkBigBlock8MB", LargeNetworkBigBlock8MB}, {"LargeNetworkBigBlock32MB", LargeNetworkBigBlock32MB}, {"LargeNetworkBigBlock64MB", LargeNetworkBigBlock64MB}, + {"TwoNodeBigBlock8MBV3", TwoNodeBigBlock8MBV3}, } // check the test name passed as an argument and run it diff --git a/test/e2e/benchmark/throughput.go b/test/e2e/benchmark/throughput.go index cee2a7a335..e24d59f3b2 100644 --- a/test/e2e/benchmark/throughput.go +++ b/test/e2e/benchmark/throughput.go @@ -6,6 +6,7 @@ import ( "time" "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" + v3 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v3" "github.com/celestiaorg/celestia-app/v3/test/e2e/testnet" "k8s.io/apimachinery/pkg/api/resource" ) @@ -138,11 +139,18 @@ func runBenchmarkTest(logger *log.Logger, testName string, manifest Manifest) er } func TwoNodeBigBlock8MB(logger *log.Logger) error { + manifest := bigBlockManifest + manifest.MaxBlockBytes = 8 * testnet.MB + return runBenchmarkTest(logger, "TwoNodeBigBlock8MB", manifest) +} + +func TwoNodeBigBlock8MBV3(logger *log.Logger) error { manifest := bigBlockManifest manifest.MaxBlockBytes = 8 * testnet.MB manifest.CelestiaAppVersion = "pr-3882" manifest.TxClientVersion = "pr-3882" - return runBenchmarkTest(logger, "TwoNodeBigBlock8MB", manifest) + manifest.GenesisAppVersion = v3.Version + return runBenchmarkTest(logger, "TwoNodeBigBlock8MBV3", manifest) } func TwoNodeBigBlock8MBLatency(logger *log.Logger) error { From cdba0b76a795459efc36e055c855d16e8c2280f8 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 4 Oct 2024 12:23:55 -0700 Subject: [PATCH 048/106] allows access to the cometbft node in testnode --- app/test/integration_test.go | 1 + test/util/testnode/network.go | 1 + test/util/testnode/node_interaction_api.go | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/app/test/integration_test.go b/app/test/integration_test.go index aec6d86e46..1c38836c6f 100644 --- a/app/test/integration_test.go +++ b/app/test/integration_test.go @@ -54,6 +54,7 @@ func (s *IntegrationTestSuite) SetupSuite() { cfg := testnode.DefaultConfig().WithFundedAccounts(s.accounts...) cctx, _, _ := testnode.NewNetwork(t, cfg) + cctx.GetTMNode().ConsensusStateTimeoutsByHeight(0) s.cctx = cctx s.ecfg = encoding.MakeConfig(app.ModuleEncodingRegisters...) diff --git a/test/util/testnode/network.go b/test/util/testnode/network.go index 4c0421c895..eab7384c91 100644 --- a/test/util/testnode/network.go +++ b/test/util/testnode/network.go @@ -33,6 +33,7 @@ func NewNetwork(t testing.TB, config *Config) (cctx Context, rpcAddr, grpcAddr s }) cctx = NewContext(ctx, config.Genesis.Keyring(), config.TmConfig, config.Genesis.ChainID, config.AppConfig.API.Address) + cctx.tmNode = tmNode cctx, stopNode, err := StartNode(tmNode, cctx) require.NoError(t, err) diff --git a/test/util/testnode/node_interaction_api.go b/test/util/testnode/node_interaction_api.go index 162840c819..f03f71ecfd 100644 --- a/test/util/testnode/node_interaction_api.go +++ b/test/util/testnode/node_interaction_api.go @@ -22,6 +22,7 @@ import ( abci "github.com/tendermint/tendermint/abci/types" tmconfig "github.com/tendermint/tendermint/config" tmrand "github.com/tendermint/tendermint/libs/rand" + "github.com/tendermint/tendermint/node" rpctypes "github.com/tendermint/tendermint/rpc/core/types" ) @@ -33,6 +34,7 @@ type Context struct { goContext context.Context client.Context apiAddress string + tmNode *node.Node } func NewContext(goContext context.Context, keyring keyring.Keyring, tmConfig *tmconfig.Config, chainID, apiAddress string) Context { @@ -50,6 +52,9 @@ func NewContext(goContext context.Context, keyring keyring.Keyring, tmConfig *tm return Context{goContext: goContext, Context: clientContext, apiAddress: apiAddress} } +func (c *Context) GetTMNode() *node.Node { + return c.tmNode +} func (c *Context) GoContext() context.Context { return c.goContext } From e160793dab9e3d0b42f32cc44ee4fad3ee9fa64e Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 4 Oct 2024 12:25:11 -0700 Subject: [PATCH 049/106] updates Timeouts test --- test/e2e/timeouts.go | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/test/e2e/timeouts.go b/test/e2e/timeouts.go index b4e5e7e189..d0f5f2521a 100644 --- a/test/e2e/timeouts.go +++ b/test/e2e/timeouts.go @@ -16,15 +16,16 @@ import ( // committed. func Timeouts(logger *log.Logger) error { ctx := context.Background() - testNet, err := testnet.New(ctx, "E2ESimple", seed, nil, "test") + testNet, err := testnet.New(ctx, "Timeouts", seed, nil, "test") testnet.NoError("failed to create testnet", err) + logger.Println("Genesis app version is", testNet.GetGenesisAppVersion()) defer testNet.Cleanup(ctx) latestVersion := "pr-3882" testnet.NoError("failed to get latest version", err) - logger.Println("Running E2ESimple test", "version", latestVersion) + logger.Println("Running Timeouts test", "version", latestVersion) logger.Println("Creating testnet validators") testnet.NoError("failed to create genesis nodes", @@ -33,18 +34,33 @@ func Timeouts(logger *log.Logger) error { logger.Println("Creating txsim") endpoints, err := testNet.RemoteGRPCEndpoints(ctx) testnet.NoError("failed to get remote gRPC endpoints", err) - err = testNet.CreateTxClient(ctx, "txsim", testnet.TxsimVersion, 10, - "100-2000", 100, testnet.DefaultResources, endpoints[0]) + err = testNet.CreateTxClient(ctx, "txsim", latestVersion, 60, + "20000", 6, 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(ctx)) + // We set the timeouts intentionally far from the default values to make sure + // that the configs do not take effect rather timeouts are set based on the + // app version in the genesis or the block headers + testnet.NoError("failed to setup testnets", testNet.Setup(ctx, + testnet.WithTimeoutPropose(1*time.Second), + testnet.WithTimeoutCommit(30*time.Second))) logger.Println("Starting testnets") - testnet.NoError("failed to start testnets", testNet.Start(ctx)) + // only start 3/4 of the nodes + testnet.NoError("failed to start testnets", testNet.Start(ctx, 0, 1, 2, 3)) - logger.Println("Waiting for 30 seconds to produce blocks") - time.Sleep(30 * time.Second) + logger.Println("Waiting for some time to produce blocks") + time.Sleep(60 * time.Second) + // + //// now start the last node + //testNet.Start(ctx, 3) + // + //logger.Println("Waiting for some time for the last node to catch" + + // " up and" + + // " produce blocks") + //time.Sleep(120 * time.Second) + // TODO can extend the test by turning off one of the nodes and checking if the network still works logger.Println("Reading blockchain headers") blockchain, err := testnode.ReadBlockchainHeaders(ctx, testNet.Node(0).AddressRPC()) @@ -61,5 +77,14 @@ func Timeouts(logger *log.Logger) error { if totalTxs < 10 { return fmt.Errorf("expected at least 10 transactions, got %d", totalTxs) } + blockTimes := testnode.CalculateBlockTime(blockchain) + stats := testnode.CalculateStats(blockTimes) + targetBlockTime := 6 * time.Second + targetBlockTimeIsReached := (stats.Avg < targetBlockTime+1*time.Second) && + (stats.Avg > targetBlockTime-1*time.Second) + if !targetBlockTimeIsReached { + return fmt.Errorf("expected block time to be around %v+-1s, got %v", + targetBlockTime, stats.Avg) + } return nil } From f10dd3b65ad0b6db4c4aa318cabe3f1c66b3fb21 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 4 Oct 2024 12:25:51 -0700 Subject: [PATCH 050/106] adds util to get genesis app version in e2e tests --- test/e2e/testnet/testnet.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/e2e/testnet/testnet.go b/test/e2e/testnet/testnet.go index fc1ed6f67e..891b937d9e 100644 --- a/test/e2e/testnet/testnet.go +++ b/test/e2e/testnet/testnet.go @@ -457,3 +457,8 @@ func (t *Testnet) Node(i int) *Node { func (t *Testnet) Nodes() []*Node { return t.nodes } + +func (t *Testnet) GetGenesisAppVersion() uint64 { + return t.genesis.ConsensusParams.Version.AppVersion + +} From 2d818d66c8ed763253ee958f078fd960f36c6600 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 4 Oct 2024 12:26:02 -0700 Subject: [PATCH 051/106] includes timeouts test in the main --- test/e2e/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/test/e2e/main.go b/test/e2e/main.go index 0928779dbb..6e3070220d 100644 --- a/test/e2e/main.go +++ b/test/e2e/main.go @@ -24,6 +24,7 @@ func main() { {"MinorVersionCompatibility", MinorVersionCompatibility}, {"MajorUpgradeToV2", MajorUpgradeToV2}, {"E2ESimple", E2ESimple}, + {"Timeouts", Timeouts}, } // check if a specific test is passed and run it From 24978007ffb6975936fb136b2adc64712ab19124 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 4 Oct 2024 12:26:37 -0700 Subject: [PATCH 052/106] updates testnet to delay the start of some of the genesis nodes --- test/e2e/testnet/testnet.go | 60 ++++++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/test/e2e/testnet/testnet.go b/test/e2e/testnet/testnet.go index 891b937d9e..19965a3e24 100644 --- a/test/e2e/testnet/testnet.go +++ b/test/e2e/testnet/testnet.go @@ -52,10 +52,12 @@ func New(ctx context.Context, name string, seed int64, grafana *GrafanaInfo, cha kn.HandleStopSignal(ctx) + g := genesis.NewDefaultGenesis().WithChainID(chainID).WithModifiers(genesisModifiers...) + //g.ConsensusParams.Version.AppVersion = v3.Version return &Testnet{ seed: seed, nodes: make([]*Node, 0), - genesis: genesis.NewDefaultGenesis().WithChainID(chainID).WithModifiers(genesisModifiers...), + genesis: g, keygen: newKeyGenerator(seed), grafana: grafana, knuu: kn, @@ -360,14 +362,31 @@ func (t *Testnet) RemoteRPCEndpoints(ctx context.Context) ([]string, error) { // WaitToSync waits for the started nodes to sync with the network and move // past the genesis block. -func (t *Testnet) WaitToSync(ctx context.Context) error { +func (t *Testnet) WaitToSync(ctx context.Context, indices ...int) error { genesisNodes := make([]*Node, 0) for _, node := range t.nodes { if node.StartHeight == 0 { genesisNodes = append(genesisNodes, node) } } - for _, node := range genesisNodes { + + // filter genesis nodes based on indices + filteredGenesisNodes := make([]*Node, 0) + if len(indices) != 0 { + for i, node := range genesisNodes { + if !isInIndices(i, indices) { + continue + } + filteredGenesisNodes = append(filteredGenesisNodes, node) + } + } else { + filteredGenesisNodes = genesisNodes + } + + for i, node := range filteredGenesisNodes { + if len(indices) != 0 && !isInIndices(i, indices) { + continue + } log.Info().Str("name", node.Name).Msg( "waiting for node to sync") client, err := node.Client() @@ -395,19 +414,44 @@ func (t *Testnet) WaitToSync(ctx context.Context) error { } return nil } +func isInIndices(i int, indices []int) bool { + for _, index := range indices { + if i == index { + return true + } + } + return false +} // StartNodes starts the testnet nodes and setup proxies. // It does not wait for the nodes to produce blocks. // For that, use WaitToSync. -func (t *Testnet) StartNodes(ctx context.Context) error { +func (t *Testnet) StartNodes(ctx context.Context, indices ...int) error { genesisNodes := make([]*Node, 0) + // identify genesis nodes for _, node := range t.nodes { if node.StartHeight == 0 { genesisNodes = append(genesisNodes, node) } } + + // filter genesis nodes based on indices + filteredGenesisNodes := make([]*Node, 0) + if len(indices) != 0 { + for i, node := range genesisNodes { + if !isInIndices(i, indices) { + continue + } + filteredGenesisNodes = append(filteredGenesisNodes, node) + } + } else { + filteredGenesisNodes = genesisNodes + + } + // start genesis nodes asynchronously - for _, node := range genesisNodes { + // if indices are provided, only start the nodes at those indices + for _, node := range filteredGenesisNodes { err := node.StartAsync(ctx) if err != nil { return fmt.Errorf("node %s failed to start: %w", node.Name, err) @@ -415,7 +459,7 @@ func (t *Testnet) StartNodes(ctx context.Context) error { } log.Info().Msg("create endpoint proxies for genesis nodes") // wait for instances to be running - for _, node := range genesisNodes { + for _, node := range filteredGenesisNodes { err := node.WaitUntilStartedAndCreateProxy(ctx) if err != nil { log.Err(err).Str("name", node.Name).Str("version", @@ -428,9 +472,9 @@ func (t *Testnet) StartNodes(ctx context.Context) error { return nil } -func (t *Testnet) Start(ctx context.Context) error { +func (t *Testnet) Start(ctx context.Context, indices ...int) error { // start nodes and setup proxies - err := t.StartNodes(ctx) + err := t.StartNodes(ctx, indices...) if err != nil { return err } From 7280b4f841c88bb45f912182436f29ba2f391166 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 4 Oct 2024 12:58:23 -0700 Subject: [PATCH 053/106] fixes an issue with starting a subset of nodes --- test/e2e/testnet/testnet.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/testnet/testnet.go b/test/e2e/testnet/testnet.go index 19965a3e24..94e398378c 100644 --- a/test/e2e/testnet/testnet.go +++ b/test/e2e/testnet/testnet.go @@ -480,12 +480,12 @@ func (t *Testnet) Start(ctx context.Context, indices ...int) error { } // wait for nodes to sync log.Info().Msg("waiting for genesis nodes to sync") - err = t.WaitToSync(ctx) + err = t.WaitToSync(ctx, indices...) if err != nil { return err } - return t.StartTxClients(ctx) + return t.StartTxClients(ctx, indices...) } func (t *Testnet) Cleanup(ctx context.Context) { From 1fddc7b9602f4a18ec9688b60699e8171c1e3d1b Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 4 Oct 2024 12:58:43 -0700 Subject: [PATCH 054/106] starts tx clients seletively --- test/e2e/testnet/testnet.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/e2e/testnet/testnet.go b/test/e2e/testnet/testnet.go index 94e398378c..9786699174 100644 --- a/test/e2e/testnet/testnet.go +++ b/test/e2e/testnet/testnet.go @@ -200,8 +200,11 @@ func (t *Testnet) CreateTxClient( return nil } -func (t *Testnet) StartTxClients(ctx context.Context) error { - for _, txsim := range t.txClients { +func (t *Testnet) StartTxClients(ctx context.Context, indices ...int) error { + for i, txsim := range t.txClients { + if len(indices) != 0 && !isInIndices(i, indices) { + continue + } err := txsim.Instance.Execution().StartAsync(ctx) if err != nil { log.Err(err). From 6c6f247981201e7b1c172047dd3b0815e80741ab Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 4 Oct 2024 12:58:57 -0700 Subject: [PATCH 055/106] delays one of the validators --- test/e2e/timeouts.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/e2e/timeouts.go b/test/e2e/timeouts.go index d0f5f2521a..90580f7702 100644 --- a/test/e2e/timeouts.go +++ b/test/e2e/timeouts.go @@ -48,18 +48,18 @@ func Timeouts(logger *log.Logger) error { logger.Println("Starting testnets") // only start 3/4 of the nodes - testnet.NoError("failed to start testnets", testNet.Start(ctx, 0, 1, 2, 3)) + testnet.NoError("failed to start testnets", testNet.Start(ctx, 0, 1, 2)) logger.Println("Waiting for some time to produce blocks") time.Sleep(60 * time.Second) - // - //// now start the last node - //testNet.Start(ctx, 3) - // - //logger.Println("Waiting for some time for the last node to catch" + - // " up and" + - // " produce blocks") - //time.Sleep(120 * time.Second) + + // now start the last node + testNet.Start(ctx, 3) + + logger.Println("Waiting for some time for the last node to catch" + + " up and" + + " produce blocks") + time.Sleep(120 * time.Second) // TODO can extend the test by turning off one of the nodes and checking if the network still works logger.Println("Reading blockchain headers") From 853abb7f3e32614c67dfe14146f5c4f434d882c0 Mon Sep 17 00:00:00 2001 From: sanaz Date: Mon, 7 Oct 2024 10:37:50 -0700 Subject: [PATCH 056/106] adds a log message to indicate the remainder of validators could not start --- test/e2e/timeouts.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/e2e/timeouts.go b/test/e2e/timeouts.go index 90580f7702..a5c5bc4af4 100644 --- a/test/e2e/timeouts.go +++ b/test/e2e/timeouts.go @@ -54,7 +54,8 @@ func Timeouts(logger *log.Logger) error { time.Sleep(60 * time.Second) // now start the last node - testNet.Start(ctx, 3) + testnet.NoError("failed to start the remaining portion of testnets"+ + " validators", testNet.Start(ctx, 3)) logger.Println("Waiting for some time for the last node to catch" + " up and" + From 910e2df741bc56a2fd4c357b7f178bd9746bc341 Mon Sep 17 00:00:00 2001 From: sanaz Date: Tue, 8 Oct 2024 13:03:47 -0700 Subject: [PATCH 057/106] bumps core to a version with a fix to the start time after the genesis block --- app/test/timeouts_test.go | 1 + go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 app/test/timeouts_test.go diff --git a/app/test/timeouts_test.go b/app/test/timeouts_test.go new file mode 100644 index 0000000000..4879f7a483 --- /dev/null +++ b/app/test/timeouts_test.go @@ -0,0 +1 @@ +package app diff --git a/go.mod b/go.mod index e5dea44f32..f3a2e4e4a0 100644 --- a/go.mod +++ b/go.mod @@ -247,5 +247,5 @@ replace ( github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004191934-9865ebe79261 + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241008195619-3347fe7e2ee7 ) diff --git a/go.sum b/go.sum index e95da4ac2f..059cbfe62b 100644 --- a/go.sum +++ b/go.sum @@ -317,8 +317,8 @@ github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8w 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.42.0-tm-v0.34.35.0.20241004191934-9865ebe79261 h1:UU62Up87NY4l6ugV61sgcSUGY2wzdjBVkHzmIEIqC1Q= -github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241004191934-9865ebe79261/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241008195619-3347fe7e2ee7 h1:luhEzPIMtfjdhOGc5qLiWsjvS9dOhN98Dd3O/oKIfdY= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241008195619-3347fe7e2ee7/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16 h1:f+fTe7GGk0/qgdzyqB8kk8EcDf9d6MC22khBTQiDXsU= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16/go.mod h1:07Z8HJqS8Rw4XlZ+ok3D3NM/X/in8mvcGLvl0Zb5wrA= github.com/celestiaorg/go-square v1.1.0 h1:K4tBL5PCJwDtpBfyDxxZ3N962aC9VYb5/bw3LjagEtY= From 8fa70a33c69e5788e21ab18e5581faa5b51a1f4b Mon Sep 17 00:00:00 2001 From: sanaz Date: Tue, 8 Oct 2024 13:04:07 -0700 Subject: [PATCH 058/106] adds an integration test for timeouts --- app/test/integration_test.go | 2 - app/test/timeouts_test.go | 92 +++++++++++++++++++++++++++++++++++- 2 files changed, 91 insertions(+), 3 deletions(-) diff --git a/app/test/integration_test.go b/app/test/integration_test.go index 1c38836c6f..65562597a9 100644 --- a/app/test/integration_test.go +++ b/app/test/integration_test.go @@ -54,7 +54,6 @@ func (s *IntegrationTestSuite) SetupSuite() { cfg := testnode.DefaultConfig().WithFundedAccounts(s.accounts...) cctx, _, _ := testnode.NewNetwork(t, cfg) - cctx.GetTMNode().ConsensusStateTimeoutsByHeight(0) s.cctx = cctx s.ecfg = encoding.MakeConfig(app.ModuleEncodingRegisters...) @@ -179,7 +178,6 @@ func (s *IntegrationTestSuite) TestMaxBlockSize() { require.NoError(t, s.cctx.WaitForNextBlock()) } } - func (s *IntegrationTestSuite) TestUnwrappedPFBRejection() { t := s.T() diff --git a/app/test/timeouts_test.go b/app/test/timeouts_test.go index 4879f7a483..465ea54119 100644 --- a/app/test/timeouts_test.go +++ b/app/test/timeouts_test.go @@ -1 +1,91 @@ -package app +package app_test + +import ( + "testing" + "time" + + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" + "github.com/celestiaorg/celestia-app/v3/test/util/testfactory" + "github.com/celestiaorg/celestia-app/v3/test/util/testnode" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/stretchr/testify/suite" + + "github.com/celestiaorg/celestia-app/v3/app" + "github.com/celestiaorg/celestia-app/v3/app/encoding" + "github.com/celestiaorg/celestia-app/v3/pkg/user" +) + +func TestTimeoutTestSuite(t *testing.T) { + if testing.Short() { + t.Skip("skipping app/test/timeouts_test in short mode.") + } + suite.Run(t, &TimeoutTestSuite{}) +} + +type TimeoutTestSuite struct { + suite.Suite + + ecfg encoding.Config + accounts []string + cctx testnode.Context +} + +const ( + timeoutPropose = 7 * time.Second + timeoutCommit = 8 * time.Second +) + +func (s *TimeoutTestSuite) SetupSuite() { + t := s.T() + s.accounts = testnode.RandomAccounts(142) + + cfg := testnode.DefaultConfig().WithFundedAccounts(s.accounts...) + cfg.TmConfig.Consensus.TimeoutPropose = timeoutPropose + cfg.TmConfig.Consensus.TimeoutCommit = timeoutCommit + + cctx, _, _ := testnode.NewNetwork(t, cfg) + + s.cctx = cctx + s.ecfg = encoding.MakeConfig(app.ModuleEncodingRegisters...) + + require.NoError(t, cctx.WaitForNextBlock()) + + for _, acc := range s.accounts { + addr := testfactory.GetAddress(s.cctx.Keyring, acc) + _, _, err := user.QueryAccount(s.cctx.GoContext(), s.cctx.GRPCClient, s.cctx.InterfaceRegistry, addr) + require.NoError(t, err) + } +} + +// TestConfigTimeoutsOverride verifies that the timeouts specified in the +// configs are not used, +// and instead the timeouts are overridden by the ABCI InitChain response +// depending on the genesis app version. +func (s *TimeoutTestSuite) TestConfigTimeoutsOverride() { + t := s.T() + + require.NoError(t, s.cctx.WaitForBlocks(2)) + + tmNode := s.cctx.GetTMNode() + configTimeoutPropose := tmNode.Config().Consensus.TimeoutPropose.Seconds() + configTimeoutCommit := tmNode.Config().Consensus.TimeoutCommit.Seconds() + + // double-check the config timeouts are the same as the ones we set + assert.Equal(t, timeoutPropose.Seconds(), configTimeoutPropose) + assert.Equal(t, timeoutCommit.Seconds(), configTimeoutCommit) + + // read the timeouts from the state at height 1 i.e., the genesis block + state1, err := s.cctx.GetTMNode().ConsensusStateTimeoutsByHeight(1) + require.NoError(t, err) + + // state timeouts should not match the timeouts of the config + assert.True(t, configTimeoutPropose != state1.TimeoutPropose.Seconds()) + assert.True(t, configTimeoutCommit != state1.TimeoutCommit.Seconds()) + + // state timeouts should match the timeouts of the latest version of the app + assert.Equal(t, appconsts.GetTimeoutCommit(appconsts.LatestVersion), state1.TimeoutCommit) + assert.Equal(t, appconsts.GetTimeoutPropose(appconsts.LatestVersion), state1.TimeoutPropose) + +} From b86606c0eddfca0cb01f8782555be5986f41a931 Mon Sep 17 00:00:00 2001 From: sanaz Date: Tue, 8 Oct 2024 13:14:24 -0700 Subject: [PATCH 059/106] clarifies some comments --- app/test/timeouts_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/test/timeouts_test.go b/app/test/timeouts_test.go index 465ea54119..0f009216dc 100644 --- a/app/test/timeouts_test.go +++ b/app/test/timeouts_test.go @@ -66,7 +66,7 @@ func (s *TimeoutTestSuite) SetupSuite() { func (s *TimeoutTestSuite) TestConfigTimeoutsOverride() { t := s.T() - require.NoError(t, s.cctx.WaitForBlocks(2)) + require.NoError(t, s.cctx.WaitForBlocks(1)) tmNode := s.cctx.GetTMNode() configTimeoutPropose := tmNode.Config().Consensus.TimeoutPropose.Seconds() @@ -76,11 +76,12 @@ func (s *TimeoutTestSuite) TestConfigTimeoutsOverride() { assert.Equal(t, timeoutPropose.Seconds(), configTimeoutPropose) assert.Equal(t, timeoutCommit.Seconds(), configTimeoutCommit) - // read the timeouts from the state at height 1 i.e., the genesis block + // read the timeouts from the state at height 1 i.e., + //the state after applying the genesis file state1, err := s.cctx.GetTMNode().ConsensusStateTimeoutsByHeight(1) require.NoError(t, err) - // state timeouts should not match the timeouts of the config + // state timeouts should NOT match the timeouts of the config assert.True(t, configTimeoutPropose != state1.TimeoutPropose.Seconds()) assert.True(t, configTimeoutCommit != state1.TimeoutCommit.Seconds()) From 6bb63baf07f518f8506a1eace49ea2fcfd4e804c Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 9 Oct 2024 12:17:43 -0700 Subject: [PATCH 060/106] bumps core to the version with new endpoints for timeouts --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 545bd42f0d..f9aa82cd59 100644 --- a/go.mod +++ b/go.mod @@ -247,5 +247,5 @@ replace ( github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241008195619-3347fe7e2ee7 + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241009184011-66f3f21155f4 ) diff --git a/go.sum b/go.sum index 96593f45ea..0af0ed65c2 100644 --- a/go.sum +++ b/go.sum @@ -317,8 +317,8 @@ github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8w 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.42.0-tm-v0.34.35.0.20241008195619-3347fe7e2ee7 h1:luhEzPIMtfjdhOGc5qLiWsjvS9dOhN98Dd3O/oKIfdY= -github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241008195619-3347fe7e2ee7/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241009184011-66f3f21155f4 h1:8dLww6fU7CQqV0GNoiqakidhYk5kEpdHqE7MOYEHcJ8= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241009184011-66f3f21155f4/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16 h1:f+fTe7GGk0/qgdzyqB8kk8EcDf9d6MC22khBTQiDXsU= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16/go.mod h1:07Z8HJqS8Rw4XlZ+ok3D3NM/X/in8mvcGLvl0Zb5wrA= github.com/celestiaorg/go-square v1.1.1 h1:Cy3p8WVspVcyOqHM8BWFuuYPwMitO1pYGe+ImILFZRA= From 104740dd982029d1ecdf8c1e9d62b928b64862f9 Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 9 Oct 2024 12:17:55 -0700 Subject: [PATCH 061/106] fixes timeouts e2e test --- test/e2e/timeouts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/timeouts.go b/test/e2e/timeouts.go index a5c5bc4af4..b8d8e70fb2 100644 --- a/test/e2e/timeouts.go +++ b/test/e2e/timeouts.go @@ -35,7 +35,7 @@ func Timeouts(logger *log.Logger) error { endpoints, err := testNet.RemoteGRPCEndpoints(ctx) testnet.NoError("failed to get remote gRPC endpoints", err) err = testNet.CreateTxClient(ctx, "txsim", latestVersion, 60, - "20000", 6, testnet.DefaultResources, endpoints[0]) + "20000", 6, testnet.DefaultResources, endpoints[0], map[int64]uint64{}) testnet.NoError("failed to create tx client", err) logger.Println("Setting up testnets") From e7d990b105a9678718f8e633bc13247ba2c4c244 Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 9 Oct 2024 12:18:19 -0700 Subject: [PATCH 062/106] verifies timeouts at the end of v3 upgrade tests --- test/e2e/major_upgrade_v3.go | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index 22723125f2..687b8ee3ae 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -7,6 +7,7 @@ import ( "time" "github.com/celestiaorg/celestia-app/v3/app" + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" v3 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v3" "github.com/celestiaorg/celestia-app/v3/test/e2e/testnet" @@ -72,7 +73,6 @@ func MajorUpgradeToV3(logger *log.Logger) error { for _, node := range testNet.Nodes() { client, err := node.Client() testnet.NoError("failed to get client", err) - upgradeComplete := false lastHeight := int64(0) for !upgradeComplete { @@ -89,6 +89,27 @@ func MajorUpgradeToV3(logger *log.Logger) error { lastHeight = resp.Header.Height } } + + for h := int64(1); h <= lastHeight; h++ { + block, err := client.Block(ctx, &h) + testnet.NoError("failed to get header", err) + + // timeouts of the next height are set based on the block at the current height + // so, we retrieve the timeouts of the next height to see if they + // are set according to the block at the current height + tInfo, err := client.ConsensusTimeoutsInfo(ctx, h+1) + testnet.NoError("failed to get consensus timeouts info", err) + + if appconsts.GetTimeoutCommit(block.Block.Header.Version.App) != tInfo.TimeoutCommit { + return fmt.Errorf("timeout commit mismatch at height %d: got %v, expected %v", + block.Block.Header.Height, tInfo.TimeoutCommit, appconsts.GetTimeoutCommit(block.Block.Header.Version.App)) + } + if appconsts.GetTimeoutPropose(block.Block.Header.Version.App) != tInfo.TimeoutPropose { + return fmt.Errorf("timeout commit mismatch at height %d: got %v, expected %v", + block.Block.Header.Height, tInfo.TimeoutPropose, appconsts.GetTimeoutPropose(block.Block.Header.Version.App)) + } + + } } return nil From fb2fdab40e4da584a3df9b363b78917e2467d5c5 Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 9 Oct 2024 13:37:21 -0700 Subject: [PATCH 063/106] adds further logs and checks the initial timeouts --- test/e2e/major_upgrade_v3.go | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index 687b8ee3ae..718729ed3a 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -15,7 +15,7 @@ import ( func MajorUpgradeToV3(logger *log.Logger) error { numNodes := 4 - upgradeHeightV3 := int64(20) + upgradeHeightV3 := int64(4) ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -28,7 +28,7 @@ func MajorUpgradeToV3(logger *log.Logger) error { // HACKHACK: use a version of celestia-app built from a commit on this PR. // This can be removed after the PR is merged to main and we override the // upgrade height delay to one block in a new Docker image. - version := "1a20c01" + version := "pr-3882" logger.Println("Running major upgrade to v3 test", "version", version) @@ -66,9 +66,26 @@ func MajorUpgradeToV3(logger *log.Logger) error { timer := time.NewTimer(10 * time.Minute) defer timer.Stop() - ticker := time.NewTicker(3 * time.Second) + ticker := time.NewTicker(30 * time.Second) defer ticker.Stop() + // checking initial timeouts + logger.Println("checking initial timeouts") + for _, node := range testNet.Nodes() { + client, err := node.Client() + tInfo, err := client.ConsensusTimeoutsInfo(ctx, 1) + testnet.NoError("failed to get consensus timeouts info", err) + logger.Printf("timeout commit: %v, timeout propose: %v", tInfo.TimeoutCommit, tInfo.TimeoutPropose) + if appconsts.GetTimeoutCommit(v2.Version) != tInfo.TimeoutCommit { + return fmt.Errorf("timeout commit mismatch at height 1: got %v, expected %v", + tInfo.TimeoutCommit, appconsts.GetTimeoutCommit(v2.Version)) + } + if appconsts.GetTimeoutPropose(v2.Version) != tInfo.TimeoutPropose { + return fmt.Errorf("timeout propose mismatch at height 1: got %v, "+ + "expected %v", + tInfo.TimeoutPropose, appconsts.GetTimeoutPropose(v2.Version)) + } + } logger.Println("waiting for upgrade") for _, node := range testNet.Nodes() { client, err := node.Client() @@ -87,9 +104,14 @@ func MajorUpgradeToV3(logger *log.Logger) error { } logger.Printf("height %v", resp.Header.Height) lastHeight = resp.Header.Height + tInfo, err := client.ConsensusTimeoutsInfo(ctx, lastHeight+1) + testnet.NoError("failed to get consensus timeouts info", err) + logger.Printf("timeout commit: %v, timeout propose: %v", tInfo.TimeoutCommit, tInfo.TimeoutPropose) } } + logger.Println("upgrade is completed") + for h := int64(1); h <= lastHeight; h++ { block, err := client.Block(ctx, &h) testnet.NoError("failed to get header", err) @@ -105,7 +127,8 @@ func MajorUpgradeToV3(logger *log.Logger) error { block.Block.Header.Height, tInfo.TimeoutCommit, appconsts.GetTimeoutCommit(block.Block.Header.Version.App)) } if appconsts.GetTimeoutPropose(block.Block.Header.Version.App) != tInfo.TimeoutPropose { - return fmt.Errorf("timeout commit mismatch at height %d: got %v, expected %v", + return fmt.Errorf("timeout propose mismatch at height %d: got"+ + " %v, expected %v", block.Block.Header.Height, tInfo.TimeoutPropose, appconsts.GetTimeoutPropose(block.Block.Header.Version.App)) } From 81d8415f4dbcdd28e7c7270a2a053a9fc97c29f5 Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 9 Oct 2024 15:38:10 -0700 Subject: [PATCH 064/106] reduces upgrade delay --- pkg/appconsts/global_consts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/appconsts/global_consts.go b/pkg/appconsts/global_consts.go index 2903da0414..c21f507137 100644 --- a/pkg/appconsts/global_consts.go +++ b/pkg/appconsts/global_consts.go @@ -30,7 +30,7 @@ const ( // DefaultUpgradeHeightDelay is the number of blocks after a quorum has been // reached that the chain should upgrade to the new version. Assuming a block // interval of 12 seconds, this is 7 days. - DefaultUpgradeHeightDelay = int64(7 * 24 * 60 * 60 / 12) // 7 days * 24 hours * 60 minutes * 60 seconds / 12 seconds per block = 50,400 blocks. + DefaultUpgradeHeightDelay = 3 // int64( 7 * 24 * 60 * 60 / 12) // 7 days * 24 hours * 60 minutes * 60 seconds / 12 seconds per block = 50,400 blocks. ) var ( From 75d7a9a4a080758ebe3a06dbdf7dee0ab37b2df3 Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 9 Oct 2024 16:11:20 -0700 Subject: [PATCH 065/106] reorganizes the test to check timeouts after upgrade is complete --- test/e2e/major_upgrade_v3.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index 718729ed3a..2a4a779b08 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -11,6 +11,7 @@ import ( v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" v3 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v3" "github.com/celestiaorg/celestia-app/v3/test/e2e/testnet" + zlog "github.com/rs/zerolog/log" ) func MajorUpgradeToV3(logger *log.Logger) error { @@ -87,6 +88,9 @@ func MajorUpgradeToV3(logger *log.Logger) error { } } logger.Println("waiting for upgrade") + + // wait for the upgrade to complete + var upgradedHeight int64 for _, node := range testNet.Nodes() { client, err := node.Client() testnet.NoError("failed to get client", err) @@ -101,6 +105,9 @@ func MajorUpgradeToV3(logger *log.Logger) error { testnet.NoError("failed to get header", err) if resp.Header.Version.App == v3.Version { upgradeComplete = true + if upgradedHeight == 0 { + upgradedHeight = resp.Header.Height + } } logger.Printf("height %v", resp.Header.Height) lastHeight = resp.Header.Height @@ -111,8 +118,16 @@ func MajorUpgradeToV3(logger *log.Logger) error { } logger.Println("upgrade is completed") + zlog.Info().Str("name", node.Name).Msg("upgrade is completed") + + } - for h := int64(1); h <= lastHeight; h++ { + // now check if the timeouts are set correctly + zlog.Info().Int("upgradedHeight", int(upgradedHeight)).Msg("checking timeouts") + for _, node := range testNet.Nodes() { + zlog.Info().Str("name", node.Name).Msg("checking timeouts") + for h := int64(1); h <= upgradedHeight+4; h++ { + client, err := node.Client() block, err := client.Block(ctx, &h) testnet.NoError("failed to get header", err) @@ -131,8 +146,8 @@ func MajorUpgradeToV3(logger *log.Logger) error { " %v, expected %v", block.Block.Header.Height, tInfo.TimeoutPropose, appconsts.GetTimeoutPropose(block.Block.Header.Version.App)) } - } + zlog.Info().Str("name", node.Name).Msg("timeouts are checked") } return nil From 79595cdac2bba302d09466485b65339431643763 Mon Sep 17 00:00:00 2001 From: sanaz Date: Wed, 9 Oct 2024 16:19:52 -0700 Subject: [PATCH 066/106] creates one client for all the height checks --- test/e2e/major_upgrade_v3.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index 2a4a779b08..472caef8a8 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -63,6 +63,7 @@ func MajorUpgradeToV3(logger *log.Logger) error { logger.Println("Setting up testnet") testnet.NoError("Failed to setup testnet", testNet.Setup(ctx)) logger.Println("Starting testnet") + // start one of the nodes with delay testnet.NoError("Failed to start testnet", testNet.Start(ctx)) timer := time.NewTimer(10 * time.Minute) @@ -74,6 +75,7 @@ func MajorUpgradeToV3(logger *log.Logger) error { logger.Println("checking initial timeouts") for _, node := range testNet.Nodes() { client, err := node.Client() + testnet.NoError("failed to get client", err) tInfo, err := client.ConsensusTimeoutsInfo(ctx, 1) testnet.NoError("failed to get consensus timeouts info", err) logger.Printf("timeout commit: %v, timeout propose: %v", tInfo.TimeoutCommit, tInfo.TimeoutPropose) @@ -117,7 +119,6 @@ func MajorUpgradeToV3(logger *log.Logger) error { } } - logger.Println("upgrade is completed") zlog.Info().Str("name", node.Name).Msg("upgrade is completed") } @@ -125,9 +126,10 @@ func MajorUpgradeToV3(logger *log.Logger) error { // now check if the timeouts are set correctly zlog.Info().Int("upgradedHeight", int(upgradedHeight)).Msg("checking timeouts") for _, node := range testNet.Nodes() { + client, err := node.Client() + testnet.NoError("failed to get client", err) zlog.Info().Str("name", node.Name).Msg("checking timeouts") for h := int64(1); h <= upgradedHeight+4; h++ { - client, err := node.Client() block, err := client.Block(ctx, &h) testnet.NoError("failed to get header", err) From aaa1b63ef935d0c32083335fbf11b9f857fcc765 Mon Sep 17 00:00:00 2001 From: sanaz Date: Thu, 10 Oct 2024 18:47:01 -0700 Subject: [PATCH 067/106] bumps core --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f9aa82cd59..7377b1b227 100644 --- a/go.mod +++ b/go.mod @@ -247,5 +247,5 @@ replace ( github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241009184011-66f3f21155f4 + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241011012711-f74d19b18a40 ) diff --git a/go.sum b/go.sum index 0af0ed65c2..fc35c3a862 100644 --- a/go.sum +++ b/go.sum @@ -317,8 +317,8 @@ github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8w 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.42.0-tm-v0.34.35.0.20241009184011-66f3f21155f4 h1:8dLww6fU7CQqV0GNoiqakidhYk5kEpdHqE7MOYEHcJ8= -github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241009184011-66f3f21155f4/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241011012711-f74d19b18a40 h1:Fcla8ikHSOiqK4VI6IeI2Viev/XrdlLyygq3hEyuRtk= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241011012711-f74d19b18a40/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16 h1:f+fTe7GGk0/qgdzyqB8kk8EcDf9d6MC22khBTQiDXsU= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16/go.mod h1:07Z8HJqS8Rw4XlZ+ok3D3NM/X/in8mvcGLvl0Zb5wrA= github.com/celestiaorg/go-square v1.1.1 h1:Cy3p8WVspVcyOqHM8BWFuuYPwMitO1pYGe+ImILFZRA= From 66109629aef48a0d80c4853e45cf12a7e679086a Mon Sep 17 00:00:00 2001 From: sanaz Date: Thu, 10 Oct 2024 21:10:58 -0700 Subject: [PATCH 068/106] fixes comments --- app/test/integration_test.go | 1 + app/test/timeouts_test.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/test/integration_test.go b/app/test/integration_test.go index 65562597a9..aec6d86e46 100644 --- a/app/test/integration_test.go +++ b/app/test/integration_test.go @@ -178,6 +178,7 @@ func (s *IntegrationTestSuite) TestMaxBlockSize() { require.NoError(t, s.cctx.WaitForNextBlock()) } } + func (s *IntegrationTestSuite) TestUnwrappedPFBRejection() { t := s.T() diff --git a/app/test/timeouts_test.go b/app/test/timeouts_test.go index 0f009216dc..7336ef9b37 100644 --- a/app/test/timeouts_test.go +++ b/app/test/timeouts_test.go @@ -77,7 +77,7 @@ func (s *TimeoutTestSuite) TestConfigTimeoutsOverride() { assert.Equal(t, timeoutCommit.Seconds(), configTimeoutCommit) // read the timeouts from the state at height 1 i.e., - //the state after applying the genesis file + // the state after applying the genesis file state1, err := s.cctx.GetTMNode().ConsensusStateTimeoutsByHeight(1) require.NoError(t, err) From bcd9cae30a1de1dae76e943a5bcffba01f11ab9d Mon Sep 17 00:00:00 2001 From: sanaz Date: Thu, 10 Oct 2024 21:11:28 -0700 Subject: [PATCH 069/106] deletes stale todo --- app/app.go | 1 - 1 file changed, 1 deletion(-) diff --git a/app/app.go b/app/app.go index a5267f840b..00dc0649b3 100644 --- a/app/app.go +++ b/app/app.go @@ -806,7 +806,6 @@ func (app *App) InitializeAppVersion(ctx sdk.Context) { // OfferSnapshot is a wrapper around the baseapp's OfferSnapshot method. It is // needed to mount stores for the appropriate app version. -// TODO [Q]: How about taking care of v3 version in this call? func (app *App) OfferSnapshot(req abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot { if app.IsSealed() { // If the app is sealed, keys have already been mounted so this can From b0f614c2fbfa9832df086f4c25deb86bc0353b7e Mon Sep 17 00:00:00 2001 From: sanaz Date: Thu, 10 Oct 2024 21:13:00 -0700 Subject: [PATCH 070/106] restores the original version of the script --- scripts/single-node.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/single-node.sh b/scripts/single-node.sh index 9bc18fe4f1..b6a6e6486a 100755 --- a/scripts/single-node.sh +++ b/scripts/single-node.sh @@ -4,7 +4,7 @@ # Stop script execution if an error is encountered set -o errexit -# Stop scyript execution if an undefined variable is used +# Stop script execution if an undefined variable is used set -o nounset if ! [ -x "$(command -v celestia-appd)" ] @@ -89,12 +89,6 @@ createGenesis() { trace_push_batch_size=1000 sed -i.bak -e "s/^trace_push_batch_size *=.*/trace_push_batch_size = \"$trace_push_batch_size\"/" ${CELESTIA_APP_HOME}/config/config.toml - timeout_propose="100s" - sed -i.bak -e "s/^timeout_propose *=.*/timeout_propose = \"$timeout_propose\"/" ${CELESTIA_APP_HOME}/config/config.toml - - timeout_commit="900s" - sed -i.bak -e "s/^timeout_commit *=.*/timeout_commit = \"$timeout_commit\"/" ${CELESTIA_APP_HOME}/config/config.toml - echo "Tracing is set up with the ability to pull traced data from the node on the address http://127.0.0.1${trace_pull_address}" } From be5d05ae09b2409d157aed32dde84a46af62a4bf Mon Sep 17 00:00:00 2001 From: sanaz Date: Thu, 10 Oct 2024 21:13:21 -0700 Subject: [PATCH 071/106] renames Timeouts to VersionedTimeouts --- test/e2e/main.go | 2 +- test/e2e/timeouts.go | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/e2e/main.go b/test/e2e/main.go index bf4a8c9348..72ff3c8a8d 100644 --- a/test/e2e/main.go +++ b/test/e2e/main.go @@ -25,7 +25,7 @@ func main() { {"MajorUpgradeToV2", MajorUpgradeToV2}, {"MajorUpgradeToV3", MajorUpgradeToV3}, {"E2ESimple", E2ESimple}, - {"Timeouts", Timeouts}, + {"VersionedTimeouts", VersionedTimeouts}, } // check if a specific test is passed and run it diff --git a/test/e2e/timeouts.go b/test/e2e/timeouts.go index b8d8e70fb2..56705a3318 100644 --- a/test/e2e/timeouts.go +++ b/test/e2e/timeouts.go @@ -11,30 +11,30 @@ import ( "github.com/celestiaorg/celestia-app/v3/test/util/testnode" ) -// Timeouts runs a simple testnet with 4 validators. It submits both MsgPayForBlobs +// VersionedTimeouts runs a simple testnet with 4 validators. It submits both MsgPayForBlobs // and MsgSends over 30 seconds and then asserts that at least 10 transactions were // committed. -func Timeouts(logger *log.Logger) error { +func VersionedTimeouts(logger *log.Logger) error { ctx := context.Background() - testNet, err := testnet.New(ctx, "Timeouts", seed, nil, "test") + testNet, err := testnet.New(ctx, "VersionedTimeouts", seed, nil, "test") testnet.NoError("failed to create testnet", err) logger.Println("Genesis app version is", testNet.GetGenesisAppVersion()) defer testNet.Cleanup(ctx) - latestVersion := "pr-3882" - testnet.NoError("failed to get latest version", err) + // TODO, this needs to be updated to get the latest version from the app + version := "pr-3882" - logger.Println("Running Timeouts test", "version", latestVersion) + logger.Println("Running VersionedTimeouts test", "version", version) logger.Println("Creating testnet validators") testnet.NoError("failed to create genesis nodes", - testNet.CreateGenesisNodes(ctx, 4, latestVersion, 10000000, 0, testnet.DefaultResources, true)) + testNet.CreateGenesisNodes(ctx, 4, version, 10000000, 0, testnet.DefaultResources, true)) logger.Println("Creating txsim") endpoints, err := testNet.RemoteGRPCEndpoints(ctx) testnet.NoError("failed to get remote gRPC endpoints", err) - err = testNet.CreateTxClient(ctx, "txsim", latestVersion, 60, + err = testNet.CreateTxClient(ctx, "txsim", version, 60, "20000", 6, testnet.DefaultResources, endpoints[0], map[int64]uint64{}) testnet.NoError("failed to create tx client", err) From cd066e6a620a4e7cc407bbbacc3d71bddf4b27aa Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 11 Oct 2024 14:04:12 -0700 Subject: [PATCH 072/106] bumps core --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7377b1b227..89c3d459ee 100644 --- a/go.mod +++ b/go.mod @@ -247,5 +247,5 @@ replace ( github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241011012711-f74d19b18a40 + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241011205050-363058a623c9 ) diff --git a/go.sum b/go.sum index fc35c3a862..dfeba251d8 100644 --- a/go.sum +++ b/go.sum @@ -317,8 +317,8 @@ github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8w 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.42.0-tm-v0.34.35.0.20241011012711-f74d19b18a40 h1:Fcla8ikHSOiqK4VI6IeI2Viev/XrdlLyygq3hEyuRtk= -github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241011012711-f74d19b18a40/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241011205050-363058a623c9 h1:+amEUQPnauGPQTx/lo8umoMaHsrzcU8aYqeLdmCn4/0= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241011205050-363058a623c9/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16 h1:f+fTe7GGk0/qgdzyqB8kk8EcDf9d6MC22khBTQiDXsU= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16/go.mod h1:07Z8HJqS8Rw4XlZ+ok3D3NM/X/in8mvcGLvl0Zb5wrA= github.com/celestiaorg/go-square v1.1.1 h1:Cy3p8WVspVcyOqHM8BWFuuYPwMitO1pYGe+ImILFZRA= From b2b6baa2d6c45138e757a3c35139226a638e0cc1 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 11 Oct 2024 15:51:06 -0700 Subject: [PATCH 073/106] adds reminder to change hardcoded versions --- test/e2e/benchmark/throughput.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/e2e/benchmark/throughput.go b/test/e2e/benchmark/throughput.go index e24d59f3b2..ca4bb8d573 100644 --- a/test/e2e/benchmark/throughput.go +++ b/test/e2e/benchmark/throughput.go @@ -147,6 +147,8 @@ func TwoNodeBigBlock8MB(logger *log.Logger) error { func TwoNodeBigBlock8MBV3(logger *log.Logger) error { manifest := bigBlockManifest manifest.MaxBlockBytes = 8 * testnet.MB + // HACKHACK: use a version of celestia-app built from a commit on this PR. + // This can be removed after the PR is merged to main. manifest.CelestiaAppVersion = "pr-3882" manifest.TxClientVersion = "pr-3882" manifest.GenesisAppVersion = v3.Version From ae4fbc35728360ba902270f23dfdf4d2e565126c Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 11 Oct 2024 15:54:49 -0700 Subject: [PATCH 074/106] removes ABCI info check --- test/e2e/major_upgrade_v2.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/test/e2e/major_upgrade_v2.go b/test/e2e/major_upgrade_v2.go index 75dd3ba60b..cd3f3ab41b 100644 --- a/test/e2e/major_upgrade_v2.go +++ b/test/e2e/major_upgrade_v2.go @@ -75,20 +75,7 @@ func MajorUpgradeToV2(logger *log.Logger) error { if resp.Header.Version.App != v1.Version { return fmt.Errorf("version mismatch before upgrade: expected %d, got %d", v1.Version, resp.Header.Version.App) } - - abciInfo, err := client.ABCIInfo(ctx) - testnet.NoError("failed to get ABCI info", err) - if abciInfo.Response.LastBlockHeight <= heightBefore { - if abciInfo.Response.AppVersion != v1.Version { - return fmt.Errorf("version mismatch before upgrade: expected %d, got %d", v1.Version, abciInfo.Response.AppVersion) - } - if abciInfo.Response.Timeouts.TimeoutCommit != 5*time.Second { - return fmt.Errorf("timeout mismatch before upgrade: expected %v, got %v", 5*time.Second, abciInfo.Response.Timeouts.TimeoutCommit) - } - if abciInfo.Response.Timeouts.TimeoutPropose != 5*time.Second { - return fmt.Errorf("timeout mismatch before upgrade: expected %v, got %v", 5*time.Second, abciInfo.Response.Timeouts.TimeoutPropose) - } - } + resp, err = client.Header(ctx, &upgradeHeight) testnet.NoError("failed to get header", err) if resp.Header.Version.App != v2.Version { From 7a993f170faa17ebf99b74378ad940dd9a8851ae Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 11 Oct 2024 15:55:26 -0700 Subject: [PATCH 075/106] removes a new line --- test/e2e/major_upgrade_v2.go | 1 - 1 file changed, 1 deletion(-) diff --git a/test/e2e/major_upgrade_v2.go b/test/e2e/major_upgrade_v2.go index cd3f3ab41b..0206cbddb9 100644 --- a/test/e2e/major_upgrade_v2.go +++ b/test/e2e/major_upgrade_v2.go @@ -75,7 +75,6 @@ func MajorUpgradeToV2(logger *log.Logger) error { if resp.Header.Version.App != v1.Version { return fmt.Errorf("version mismatch before upgrade: expected %d, got %d", v1.Version, resp.Header.Version.App) } - resp, err = client.Header(ctx, &upgradeHeight) testnet.NoError("failed to get header", err) if resp.Header.Version.App != v2.Version { From 1be795acf6b6e7c8ebc1d9be5a40355b0ca40852 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 11 Oct 2024 15:56:26 -0700 Subject: [PATCH 076/106] adds a newline --- test/e2e/major_upgrade_v2.go | 1 + 1 file changed, 1 insertion(+) diff --git a/test/e2e/major_upgrade_v2.go b/test/e2e/major_upgrade_v2.go index 0206cbddb9..cd3f3ab41b 100644 --- a/test/e2e/major_upgrade_v2.go +++ b/test/e2e/major_upgrade_v2.go @@ -75,6 +75,7 @@ func MajorUpgradeToV2(logger *log.Logger) error { if resp.Header.Version.App != v1.Version { return fmt.Errorf("version mismatch before upgrade: expected %d, got %d", v1.Version, resp.Header.Version.App) } + resp, err = client.Header(ctx, &upgradeHeight) testnet.NoError("failed to get header", err) if resp.Header.Version.App != v2.Version { From 4621a6bd223dc00359b8d5d8ce45dde29f2c1215 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 11 Oct 2024 16:07:51 -0700 Subject: [PATCH 077/106] pass upgrade schedule flag only if one is available --- test/e2e/testnet/txsimNode.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/e2e/testnet/txsimNode.go b/test/e2e/testnet/txsimNode.go index bfa21da875..c63062598b 100644 --- a/test/e2e/testnet/txsimNode.go +++ b/test/e2e/testnet/txsimNode.go @@ -78,10 +78,13 @@ func CreateTxClient( fmt.Sprintf("--blob %d", blobSequences), fmt.Sprintf("--blob-amounts %d", blobsPerSeq), fmt.Sprintf("--blob-sizes %s", blobRange), - fmt.Sprintf("--upgrade-schedule %s", stringifyUpgradeSchedule(upgradeSchedule)), fmt.Sprintf("--blob-share-version %d", share.ShareVersionZero), } + if len(upgradeSchedule) > 0 { + args = append(args, fmt.Sprintf("--upgrade-schedule %s", stringifyUpgradeSchedule(upgradeSchedule))) + } + if err := instance.Build().SetArgs(args...); err != nil { return nil, err } From 3ea0ca5bd589d7212dbd429eaca8365ff2f35dc9 Mon Sep 17 00:00:00 2001 From: sanaz Date: Fri, 11 Oct 2024 16:12:33 -0700 Subject: [PATCH 078/106] deletes a comment --- test/e2e/major_upgrade_v3.go | 1 - 1 file changed, 1 deletion(-) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index 472caef8a8..0763ea10bb 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -63,7 +63,6 @@ func MajorUpgradeToV3(logger *log.Logger) error { logger.Println("Setting up testnet") testnet.NoError("Failed to setup testnet", testNet.Setup(ctx)) logger.Println("Starting testnet") - // start one of the nodes with delay testnet.NoError("Failed to start testnet", testNet.Start(ctx)) timer := time.NewTimer(10 * time.Minute) From e8affab148b8a8e39778f974516c8a033ed47ef5 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Mon, 14 Oct 2024 15:26:45 -0500 Subject: [PATCH 079/106] fix: tests using app wrapper in testnode --- app/test/timeouts_test.go | 92 ------------------------------- go.mod | 2 +- go.sum | 4 +- pkg/appconsts/v1/app_consts.go | 4 ++ pkg/appconsts/v2/app_consts.go | 4 ++ pkg/appconsts/v3/app_consts.go | 4 +- pkg/appconsts/versioned_consts.go | 18 ++++-- test/e2e/major_upgrade_v3.go | 81 +++++++++++---------------- test/txsim/run_test.go | 2 + test/util/testnode/app_wrapper.go | 33 +++++++++++ test/util/testnode/config.go | 8 ++- x/signal/keeper_test.go | 2 +- 12 files changed, 100 insertions(+), 154 deletions(-) delete mode 100644 app/test/timeouts_test.go create mode 100644 test/util/testnode/app_wrapper.go diff --git a/app/test/timeouts_test.go b/app/test/timeouts_test.go deleted file mode 100644 index 7336ef9b37..0000000000 --- a/app/test/timeouts_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package app_test - -import ( - "testing" - "time" - - "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" - "github.com/celestiaorg/celestia-app/v3/test/util/testfactory" - "github.com/celestiaorg/celestia-app/v3/test/util/testnode" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/stretchr/testify/suite" - - "github.com/celestiaorg/celestia-app/v3/app" - "github.com/celestiaorg/celestia-app/v3/app/encoding" - "github.com/celestiaorg/celestia-app/v3/pkg/user" -) - -func TestTimeoutTestSuite(t *testing.T) { - if testing.Short() { - t.Skip("skipping app/test/timeouts_test in short mode.") - } - suite.Run(t, &TimeoutTestSuite{}) -} - -type TimeoutTestSuite struct { - suite.Suite - - ecfg encoding.Config - accounts []string - cctx testnode.Context -} - -const ( - timeoutPropose = 7 * time.Second - timeoutCommit = 8 * time.Second -) - -func (s *TimeoutTestSuite) SetupSuite() { - t := s.T() - s.accounts = testnode.RandomAccounts(142) - - cfg := testnode.DefaultConfig().WithFundedAccounts(s.accounts...) - cfg.TmConfig.Consensus.TimeoutPropose = timeoutPropose - cfg.TmConfig.Consensus.TimeoutCommit = timeoutCommit - - cctx, _, _ := testnode.NewNetwork(t, cfg) - - s.cctx = cctx - s.ecfg = encoding.MakeConfig(app.ModuleEncodingRegisters...) - - require.NoError(t, cctx.WaitForNextBlock()) - - for _, acc := range s.accounts { - addr := testfactory.GetAddress(s.cctx.Keyring, acc) - _, _, err := user.QueryAccount(s.cctx.GoContext(), s.cctx.GRPCClient, s.cctx.InterfaceRegistry, addr) - require.NoError(t, err) - } -} - -// TestConfigTimeoutsOverride verifies that the timeouts specified in the -// configs are not used, -// and instead the timeouts are overridden by the ABCI InitChain response -// depending on the genesis app version. -func (s *TimeoutTestSuite) TestConfigTimeoutsOverride() { - t := s.T() - - require.NoError(t, s.cctx.WaitForBlocks(1)) - - tmNode := s.cctx.GetTMNode() - configTimeoutPropose := tmNode.Config().Consensus.TimeoutPropose.Seconds() - configTimeoutCommit := tmNode.Config().Consensus.TimeoutCommit.Seconds() - - // double-check the config timeouts are the same as the ones we set - assert.Equal(t, timeoutPropose.Seconds(), configTimeoutPropose) - assert.Equal(t, timeoutCommit.Seconds(), configTimeoutCommit) - - // read the timeouts from the state at height 1 i.e., - // the state after applying the genesis file - state1, err := s.cctx.GetTMNode().ConsensusStateTimeoutsByHeight(1) - require.NoError(t, err) - - // state timeouts should NOT match the timeouts of the config - assert.True(t, configTimeoutPropose != state1.TimeoutPropose.Seconds()) - assert.True(t, configTimeoutCommit != state1.TimeoutCommit.Seconds()) - - // state timeouts should match the timeouts of the latest version of the app - assert.Equal(t, appconsts.GetTimeoutCommit(appconsts.LatestVersion), state1.TimeoutCommit) - assert.Equal(t, appconsts.GetTimeoutPropose(appconsts.LatestVersion), state1.TimeoutPropose) - -} diff --git a/go.mod b/go.mod index 9fe929e4f2..e2b631c81e 100644 --- a/go.mod +++ b/go.mod @@ -260,5 +260,5 @@ replace ( github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241011205050-363058a623c9 + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241014174725-23e3fb130177 ) diff --git a/go.sum b/go.sum index 6512ccd0da..e7ec197868 100644 --- a/go.sum +++ b/go.sum @@ -317,8 +317,8 @@ github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8w 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.42.0-tm-v0.34.35.0.20241011205050-363058a623c9 h1:+amEUQPnauGPQTx/lo8umoMaHsrzcU8aYqeLdmCn4/0= -github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241011205050-363058a623c9/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241014174725-23e3fb130177 h1:oQqT2MrX6CFMDlo5GfjnjPFgzYt+eqF4KnkXS66rhAU= +github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241014174725-23e3fb130177/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16 h1:f+fTe7GGk0/qgdzyqB8kk8EcDf9d6MC22khBTQiDXsU= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16/go.mod h1:07Z8HJqS8Rw4XlZ+ok3D3NM/X/in8mvcGLvl0Zb5wrA= github.com/celestiaorg/go-square v1.1.1 h1:Cy3p8WVspVcyOqHM8BWFuuYPwMitO1pYGe+ImILFZRA= diff --git a/pkg/appconsts/v1/app_consts.go b/pkg/appconsts/v1/app_consts.go index 72b040f819..5d81f0d715 100644 --- a/pkg/appconsts/v1/app_consts.go +++ b/pkg/appconsts/v1/app_consts.go @@ -1,7 +1,11 @@ package v1 +import "time" + const ( Version uint64 = 1 SquareSizeUpperBound int = 128 SubtreeRootThreshold int = 64 + TimeoutPropose = time.Millisecond * 10000 + TimeoutCommit = time.Millisecond * 11000 ) diff --git a/pkg/appconsts/v2/app_consts.go b/pkg/appconsts/v2/app_consts.go index d5829e84c5..eb944fa68c 100644 --- a/pkg/appconsts/v2/app_consts.go +++ b/pkg/appconsts/v2/app_consts.go @@ -1,7 +1,11 @@ package v2 +import "time" + const ( Version uint64 = 2 SquareSizeUpperBound int = 128 SubtreeRootThreshold int = 64 + TimeoutPropose = time.Millisecond * 10000 + TimeoutCommit = time.Millisecond * 11000 ) diff --git a/pkg/appconsts/v3/app_consts.go b/pkg/appconsts/v3/app_consts.go index f146f60068..bb705bb5e6 100644 --- a/pkg/appconsts/v3/app_consts.go +++ b/pkg/appconsts/v3/app_consts.go @@ -9,6 +9,6 @@ const ( TxSizeCostPerByte uint64 = 10 GasPerBlobByte uint32 = 8 MaxTxSize int = 2097152 // 2 MiB in bytes - TimeoutPropose = time.Second * 3 - TimeoutCommit = time.Second * 1 + TimeoutPropose = time.Millisecond * 3500 + TimeoutCommit = time.Millisecond * 4200 ) diff --git a/pkg/appconsts/versioned_consts.go b/pkg/appconsts/versioned_consts.go index dbc3e084e8..786b6f8317 100644 --- a/pkg/appconsts/versioned_consts.go +++ b/pkg/appconsts/versioned_consts.go @@ -4,6 +4,8 @@ import ( "strconv" "time" + v1 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v1" + v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" v3 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v3" ) @@ -56,18 +58,22 @@ var ( func GetTimeoutPropose(v uint64) time.Duration { switch v { - case v3.Version: - return v3.TimeoutPropose - default: + case v1.Version: + return TimeoutPropose + case v2.Version: return TimeoutPropose + default: + return v3.TimeoutPropose } } func GetTimeoutCommit(v uint64) time.Duration { switch v { - case v3.Version: - return v3.TimeoutCommit - default: + case v1.Version: + return TimeoutCommit + case v2.Version: return TimeoutCommit + default: + return v3.TimeoutCommit } } diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index 0763ea10bb..fcd12a0f6b 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -7,7 +7,6 @@ import ( "time" "github.com/celestiaorg/celestia-app/v3/app" - "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" v3 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v3" "github.com/celestiaorg/celestia-app/v3/test/e2e/testnet" @@ -70,24 +69,6 @@ func MajorUpgradeToV3(logger *log.Logger) error { ticker := time.NewTicker(30 * time.Second) defer ticker.Stop() - // checking initial timeouts - logger.Println("checking initial timeouts") - for _, node := range testNet.Nodes() { - client, err := node.Client() - testnet.NoError("failed to get client", err) - tInfo, err := client.ConsensusTimeoutsInfo(ctx, 1) - testnet.NoError("failed to get consensus timeouts info", err) - logger.Printf("timeout commit: %v, timeout propose: %v", tInfo.TimeoutCommit, tInfo.TimeoutPropose) - if appconsts.GetTimeoutCommit(v2.Version) != tInfo.TimeoutCommit { - return fmt.Errorf("timeout commit mismatch at height 1: got %v, expected %v", - tInfo.TimeoutCommit, appconsts.GetTimeoutCommit(v2.Version)) - } - if appconsts.GetTimeoutPropose(v2.Version) != tInfo.TimeoutPropose { - return fmt.Errorf("timeout propose mismatch at height 1: got %v, "+ - "expected %v", - tInfo.TimeoutPropose, appconsts.GetTimeoutPropose(v2.Version)) - } - } logger.Println("waiting for upgrade") // wait for the upgrade to complete @@ -112,9 +93,6 @@ func MajorUpgradeToV3(logger *log.Logger) error { } logger.Printf("height %v", resp.Header.Height) lastHeight = resp.Header.Height - tInfo, err := client.ConsensusTimeoutsInfo(ctx, lastHeight+1) - testnet.NoError("failed to get consensus timeouts info", err) - logger.Printf("timeout commit: %v, timeout propose: %v", tInfo.TimeoutCommit, tInfo.TimeoutPropose) } } @@ -122,33 +100,40 @@ func MajorUpgradeToV3(logger *log.Logger) error { } - // now check if the timeouts are set correctly - zlog.Info().Int("upgradedHeight", int(upgradedHeight)).Msg("checking timeouts") - for _, node := range testNet.Nodes() { - client, err := node.Client() - testnet.NoError("failed to get client", err) - zlog.Info().Str("name", node.Name).Msg("checking timeouts") - for h := int64(1); h <= upgradedHeight+4; h++ { - block, err := client.Block(ctx, &h) - testnet.NoError("failed to get header", err) - - // timeouts of the next height are set based on the block at the current height - // so, we retrieve the timeouts of the next height to see if they - // are set according to the block at the current height - tInfo, err := client.ConsensusTimeoutsInfo(ctx, h+1) - testnet.NoError("failed to get consensus timeouts info", err) - - if appconsts.GetTimeoutCommit(block.Block.Header.Version.App) != tInfo.TimeoutCommit { - return fmt.Errorf("timeout commit mismatch at height %d: got %v, expected %v", - block.Block.Header.Height, tInfo.TimeoutCommit, appconsts.GetTimeoutCommit(block.Block.Header.Version.App)) - } - if appconsts.GetTimeoutPropose(block.Block.Header.Version.App) != tInfo.TimeoutPropose { - return fmt.Errorf("timeout propose mismatch at height %d: got"+ - " %v, expected %v", - block.Block.Header.Height, tInfo.TimeoutPropose, appconsts.GetTimeoutPropose(block.Block.Header.Version.App)) - } + // check if the timeouts are set correctly + + rpcNode := testNet.Nodes()[0] + client, err := rpcNode.Client() + testnet.NoError("failed to get client", err) + blockTimes := make([]time.Duration, 0, 7) + latestBlockTime := time.Time{} + nilTime := time.Time{} + for h := int64(upgradedHeight - 4); h <= upgradedHeight+4; h++ { + resp, err := client.Header(ctx, nil) + testnet.NoError("failed to get header", err) + if latestBlockTime.Equal(nilTime) { + continue } - zlog.Info().Str("name", node.Name).Msg("timeouts are checked") + + blockTime := resp.Header.Time + blockDur := blockTime.Sub(latestBlockTime) + blockTimes = append(blockTimes, blockDur) + latestBlockTime = blockTime + } + + if len(blockTimes) < 7 { + testnet.NoError("", fmt.Errorf("not enough block times collected: %v", len(blockTimes))) + } + + startDur := blockTimes[0] + endDur := blockTimes[len(blockTimes)-1] + + if startDur < time.Second*10 { + testnet.NoError("", fmt.Errorf("blocks for v2 are too short %v", len(blockTimes))) + } + + if endDur > time.Second*7 { + testnet.NoError("", fmt.Errorf("blocks for v3 are too long %v", len(blockTimes))) } return nil diff --git a/test/txsim/run_test.go b/test/txsim/run_test.go index 4a922f15a1..d17c5768d2 100644 --- a/test/txsim/run_test.go +++ b/test/txsim/run_test.go @@ -170,6 +170,8 @@ func TestTxSimUpgrade(t *testing.T) { WithFundedAccounts("txsim-master") cctx, _, grpcAddr := testnode.NewNetwork(t, cfg) + time.Sleep(time.Second * 2) + // updrade to v3 at height 20 sequences := []txsim.Sequence{ txsim.NewUpgradeSequence(v3.Version, 20), diff --git a/test/util/testnode/app_wrapper.go b/test/util/testnode/app_wrapper.go new file mode 100644 index 0000000000..a16287acda --- /dev/null +++ b/test/util/testnode/app_wrapper.go @@ -0,0 +1,33 @@ +package testnode + +import ( + "time" + + "github.com/celestiaorg/celestia-app/v3/app" + v1 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v1" + v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" + sdk "github.com/cosmos/cosmos-sdk/types" + abci "github.com/tendermint/tendermint/abci/types" +) + +func GetTimeoutCommit(v uint64) time.Duration { + switch v { + case v1.Version: + return time.Millisecond * 500 + case v2.Version: + return time.Millisecond * 500 + default: + return time.Millisecond * 100 + } +} + +func WrapEndBlocker(app *app.App, timeoutCommit time.Duration) func(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { + currentAppVersion := app.AppVersion() + endBlocker := func(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { + resp := app.EndBlocker(ctx, req) + resp.Timeouts.TimeoutCommit = GetTimeoutCommit(currentAppVersion) + return resp + } + + return endBlocker +} diff --git a/test/util/testnode/config.go b/test/util/testnode/config.go index 7062735a4c..68b56adf91 100644 --- a/test/util/testnode/config.go +++ b/test/util/testnode/config.go @@ -174,7 +174,7 @@ func DefaultTendermintConfig() *tmconfig.Config { func DefaultAppCreator() srvtypes.AppCreator { return func(_ log.Logger, _ tmdb.DB, _ io.Writer, _ srvtypes.AppOptions) srvtypes.Application { encodingConfig := encoding.MakeConfig(app.ModuleEncodingRegisters...) - return app.New( + app := app.New( log.NewNopLogger(), tmdb.NewMemDB(), nil, // trace store @@ -184,13 +184,15 @@ func DefaultAppCreator() srvtypes.AppCreator { simapp.EmptyAppOptions{}, baseapp.SetMinGasPrices(fmt.Sprintf("%v%v", appconsts.DefaultMinGasPrice, app.BondDenom)), ) + app.SetEndBlocker(WrapEndBlocker(app, time.Millisecond*0)) + return app } } func CustomAppCreator(minGasPrice string) srvtypes.AppCreator { return func(_ log.Logger, _ tmdb.DB, _ io.Writer, _ srvtypes.AppOptions) srvtypes.Application { encodingConfig := encoding.MakeConfig(app.ModuleEncodingRegisters...) - return app.New( + app := app.New( log.NewNopLogger(), tmdb.NewMemDB(), nil, // trace store @@ -200,6 +202,8 @@ func CustomAppCreator(minGasPrice string) srvtypes.AppCreator { simapp.EmptyAppOptions{}, baseapp.SetMinGasPrices(minGasPrice), ) + app.SetEndBlocker(WrapEndBlocker(app, time.Millisecond*0)) + return app } } diff --git a/x/signal/keeper_test.go b/x/signal/keeper_test.go index 71627a8417..470c371b31 100644 --- a/x/signal/keeper_test.go +++ b/x/signal/keeper_test.go @@ -426,7 +426,7 @@ func TestGetUpgrade(t *testing.T) { got, err := upgradeKeeper.GetUpgrade(ctx, &types.QueryGetUpgradeRequest{}) require.NoError(t, err) assert.Equal(t, v2.Version, got.Upgrade.AppVersion) - assert.Equal(t, appconsts.DefaultUpgradeHeightDelay, got.Upgrade.UpgradeHeight) + assert.Equal(t, int64(appconsts.DefaultUpgradeHeightDelay), got.Upgrade.UpgradeHeight) }) } From 3762a2d0ce77b2bc1eedcb3161d45ea5ed62fd8f Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Mon, 14 Oct 2024 16:38:29 -0500 Subject: [PATCH 080/106] chore: linter --- app/test/upgrade_test.go | 1 - test/e2e/major_upgrade_v2.go | 2 +- test/e2e/testnet/testnet.go | 2 +- test/util/testnode/node_interaction_api.go | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test/upgrade_test.go b/app/test/upgrade_test.go index a363d03633..5a4a5485e8 100644 --- a/app/test/upgrade_test.go +++ b/app/test/upgrade_test.go @@ -151,7 +151,6 @@ func TestAppUpgradeV3(t *testing.T) { RequestEndBlock{Height: initialHeight + appconsts.DefaultUpgradeHeightDelay}) require.Equal(t, appconsts.GetTimeoutCommit(v3.Version), respEndBlock.Timeouts.TimeoutCommit) require.Equal(t, appconsts.GetTimeoutPropose(v3.Version), respEndBlock.Timeouts.TimeoutPropose) - } // TestAppUpgradeV2 verifies that the all module's params are overridden during an diff --git a/test/e2e/major_upgrade_v2.go b/test/e2e/major_upgrade_v2.go index 4c92dd4a53..3e44eb0bc3 100644 --- a/test/e2e/major_upgrade_v2.go +++ b/test/e2e/major_upgrade_v2.go @@ -85,7 +85,7 @@ func MajorUpgradeToV2(logger *log.Logger) error { if resp.Header.Version.App != v1.Version { return fmt.Errorf("version mismatch before upgrade: expected %d, got %d", v1.Version, resp.Header.Version.App) } - + resp, err = client.Header(ctx, &upgradeHeight) testnet.NoError("failed to get header", err) if resp.Header.Version.App != v2.Version { diff --git a/test/e2e/testnet/testnet.go b/test/e2e/testnet/testnet.go index 36c0a8b3fb..9cfe6c4d1e 100644 --- a/test/e2e/testnet/testnet.go +++ b/test/e2e/testnet/testnet.go @@ -424,6 +424,7 @@ func (t *Testnet) WaitToSync(ctx context.Context, indices ...int) error { } return nil } + func isInIndices(i int, indices []int) bool { for _, index := range indices { if i == index { @@ -456,7 +457,6 @@ func (t *Testnet) StartNodes(ctx context.Context, indices ...int) error { } } else { filteredGenesisNodes = genesisNodes - } // start genesis nodes asynchronously diff --git a/test/util/testnode/node_interaction_api.go b/test/util/testnode/node_interaction_api.go index f03f71ecfd..896ac474ca 100644 --- a/test/util/testnode/node_interaction_api.go +++ b/test/util/testnode/node_interaction_api.go @@ -55,6 +55,7 @@ func NewContext(goContext context.Context, keyring keyring.Keyring, tmConfig *tm func (c *Context) GetTMNode() *node.Node { return c.tmNode } + func (c *Context) GoContext() context.Context { return c.goContext } From 3ceae069abf245f427381cefcf04b178df2c751e Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Mon, 14 Oct 2024 16:46:15 -0500 Subject: [PATCH 081/106] chore: linter --- test/e2e/major_upgrade_v3.go | 2 +- test/util/testnode/app_wrapper.go | 16 +--------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index 50ac7d23ba..f33c5652d8 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -117,7 +117,7 @@ func MajorUpgradeToV3(logger *log.Logger) error { blockTimes := make([]time.Duration, 0, 7) latestBlockTime := time.Time{} nilTime := time.Time{} - for h := int64(upgradedHeight - 4); h <= upgradedHeight+4; h++ { + for h := upgradedHeight - 4; h <= upgradedHeight+4; h++ { resp, err := client.Header(ctx, nil) testnet.NoError("failed to get header", err) if latestBlockTime.Equal(nilTime) { diff --git a/test/util/testnode/app_wrapper.go b/test/util/testnode/app_wrapper.go index a16287acda..31506ba427 100644 --- a/test/util/testnode/app_wrapper.go +++ b/test/util/testnode/app_wrapper.go @@ -4,28 +4,14 @@ import ( "time" "github.com/celestiaorg/celestia-app/v3/app" - v1 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v1" - v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" sdk "github.com/cosmos/cosmos-sdk/types" abci "github.com/tendermint/tendermint/abci/types" ) -func GetTimeoutCommit(v uint64) time.Duration { - switch v { - case v1.Version: - return time.Millisecond * 500 - case v2.Version: - return time.Millisecond * 500 - default: - return time.Millisecond * 100 - } -} - func WrapEndBlocker(app *app.App, timeoutCommit time.Duration) func(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { - currentAppVersion := app.AppVersion() endBlocker := func(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { resp := app.EndBlocker(ctx, req) - resp.Timeouts.TimeoutCommit = GetTimeoutCommit(currentAppVersion) + resp.Timeouts.TimeoutCommit = timeoutCommit return resp } From bdcf68eb61fe20ddb53baff1f70bfcaedf4caec0 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Mon, 14 Oct 2024 20:43:48 -0500 Subject: [PATCH 082/106] fix: block until the first block is created in testnode --- x/blobstream/integration_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x/blobstream/integration_test.go b/x/blobstream/integration_test.go index a8f19bf4b6..61bc6544d7 100644 --- a/x/blobstream/integration_test.go +++ b/x/blobstream/integration_test.go @@ -46,6 +46,8 @@ func (s *BlobstreamIntegrationSuite) SetupSuite() { cctx, _, _ := testnode.NewNetwork(t, cfg) s.ecfg = encoding.MakeConfig(app.ModuleEncodingRegisters...) s.cctx = cctx + + require.NoError(t, s.cctx.WaitForNextBlock()) } func (s *BlobstreamIntegrationSuite) TestBlobstream() { From 955a6584636b88fe6fcae9ad0e3e331796d2489f Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Tue, 15 Oct 2024 07:15:36 -0500 Subject: [PATCH 083/106] chore: review feedback --- pkg/appconsts/global_consts.go | 2 +- pkg/appconsts/v1/app_consts.go | 4 +- pkg/appconsts/v2/app_consts.go | 4 +- pkg/appconsts/versioned_consts.go | 8 +-- test/e2e/benchmark/main.go | 1 - test/e2e/benchmark/throughput.go | 12 ---- test/e2e/main.go | 1 - test/e2e/major_upgrade_v3.go | 9 ++- test/e2e/timeouts.go | 103 ------------------------------ test/txsim/run_test.go | 2 +- test/util/testnode/app_wrapper.go | 4 +- test/util/testnode/config.go | 4 +- test/util/testnode/read.go | 64 ------------------- 13 files changed, 19 insertions(+), 199 deletions(-) delete mode 100644 test/e2e/timeouts.go diff --git a/pkg/appconsts/global_consts.go b/pkg/appconsts/global_consts.go index c5d0feaef5..424d4bbe3f 100644 --- a/pkg/appconsts/global_consts.go +++ b/pkg/appconsts/global_consts.go @@ -30,7 +30,7 @@ const ( // DefaultUpgradeHeightDelay is the number of blocks after a quorum has been // reached that the chain should upgrade to the new version. Assuming a block // interval of 12 seconds, this is 7 days. - DefaultUpgradeHeightDelay = 3 // int64( 7 * 24 * 60 * 60 / 12) // 7 days * 24 hours * 60 minutes * 60 seconds / 12 seconds per block = 50,400 blocks. + DefaultUpgradeHeightDelay = int64(7 * 24 * 60 * 60 / 12) // 7 days * 24 hours * 60 minutes * 60 seconds / 12 seconds per block = 50,400 blocks. ) var ( diff --git a/pkg/appconsts/v1/app_consts.go b/pkg/appconsts/v1/app_consts.go index 5d81f0d715..14135b9686 100644 --- a/pkg/appconsts/v1/app_consts.go +++ b/pkg/appconsts/v1/app_consts.go @@ -6,6 +6,6 @@ const ( Version uint64 = 1 SquareSizeUpperBound int = 128 SubtreeRootThreshold int = 64 - TimeoutPropose = time.Millisecond * 10000 - TimeoutCommit = time.Millisecond * 11000 + TimeoutPropose = time.Second * 10 + TimeoutCommit = time.Second * 11 ) diff --git a/pkg/appconsts/v2/app_consts.go b/pkg/appconsts/v2/app_consts.go index eb944fa68c..f76be2e8af 100644 --- a/pkg/appconsts/v2/app_consts.go +++ b/pkg/appconsts/v2/app_consts.go @@ -6,6 +6,6 @@ const ( Version uint64 = 2 SquareSizeUpperBound int = 128 SubtreeRootThreshold int = 64 - TimeoutPropose = time.Millisecond * 10000 - TimeoutCommit = time.Millisecond * 11000 + TimeoutPropose = time.Second * 10 + TimeoutCommit = time.Second * 11 ) diff --git a/pkg/appconsts/versioned_consts.go b/pkg/appconsts/versioned_consts.go index 786b6f8317..ada838b1a2 100644 --- a/pkg/appconsts/versioned_consts.go +++ b/pkg/appconsts/versioned_consts.go @@ -59,9 +59,9 @@ var ( func GetTimeoutPropose(v uint64) time.Duration { switch v { case v1.Version: - return TimeoutPropose + return v1.TimeoutPropose case v2.Version: - return TimeoutPropose + return v2.TimeoutPropose default: return v3.TimeoutPropose } @@ -70,9 +70,9 @@ func GetTimeoutPropose(v uint64) time.Duration { func GetTimeoutCommit(v uint64) time.Duration { switch v { case v1.Version: - return TimeoutCommit + return v1.TimeoutCommit case v2.Version: - return TimeoutCommit + return v2.TimeoutCommit default: return v3.TimeoutCommit } diff --git a/test/e2e/benchmark/main.go b/test/e2e/benchmark/main.go index b41819c99e..be4eb1e126 100644 --- a/test/e2e/benchmark/main.go +++ b/test/e2e/benchmark/main.go @@ -18,7 +18,6 @@ func main() { {"LargeNetworkBigBlock8MB", LargeNetworkBigBlock8MB}, {"LargeNetworkBigBlock32MB", LargeNetworkBigBlock32MB}, {"LargeNetworkBigBlock64MB", LargeNetworkBigBlock64MB}, - {"TwoNodeBigBlock8MBV3", TwoNodeBigBlock8MBV3}, } // check the test name passed as an argument and run it diff --git a/test/e2e/benchmark/throughput.go b/test/e2e/benchmark/throughput.go index 4fa3a1dc84..75bf1bdf6c 100644 --- a/test/e2e/benchmark/throughput.go +++ b/test/e2e/benchmark/throughput.go @@ -6,7 +6,6 @@ import ( "time" "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" - v3 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v3" "github.com/celestiaorg/celestia-app/v3/test/e2e/testnet" "k8s.io/apimachinery/pkg/api/resource" ) @@ -140,17 +139,6 @@ func TwoNodeBigBlock8MB(logger *log.Logger) error { return runBenchmarkTest(logger, "TwoNodeBigBlock8MB", manifest) } -func TwoNodeBigBlock8MBV3(logger *log.Logger) error { - manifest := bigBlockManifest - manifest.MaxBlockBytes = 8 * testnet.MB - // HACKHACK: use a version of celestia-app built from a commit on this PR. - // This can be removed after the PR is merged to main. - manifest.CelestiaAppVersion = "pr-3882" - manifest.TxClientVersion = "pr-3882" - manifest.GenesisAppVersion = v3.Version - return runBenchmarkTest(logger, "TwoNodeBigBlock8MBV3", manifest) -} - func TwoNodeBigBlock8MBLatency(logger *log.Logger) error { manifest := bigBlockManifest manifest.MaxBlockBytes = 8 * testnet.MB diff --git a/test/e2e/main.go b/test/e2e/main.go index f41e31d70c..768907e2cf 100644 --- a/test/e2e/main.go +++ b/test/e2e/main.go @@ -25,7 +25,6 @@ func main() { {"MajorUpgradeToV2", MajorUpgradeToV2}, {"MajorUpgradeToV3", MajorUpgradeToV3}, {"E2ESimple", E2ESimple}, - {"VersionedTimeouts", VersionedTimeouts}, } // check if a specific test is passed and run it diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index f33c5652d8..537b7d7fc7 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -110,24 +110,23 @@ func MajorUpgradeToV3(logger *log.Logger) error { } // check if the timeouts are set correctly - rpcNode := testNet.Nodes()[0] client, err := rpcNode.Client() testnet.NoError("failed to get client", err) blockTimes := make([]time.Duration, 0, 7) latestBlockTime := time.Time{} - nilTime := time.Time{} for h := upgradedHeight - 4; h <= upgradedHeight+4; h++ { resp, err := client.Header(ctx, nil) testnet.NoError("failed to get header", err) - if latestBlockTime.Equal(nilTime) { + blockTime := resp.Header.Time + if latestBlockTime.Equal(time.Time{}) { + latestBlockTime = blockTime continue } - blockTime := resp.Header.Time blockDur := blockTime.Sub(latestBlockTime) - blockTimes = append(blockTimes, blockDur) latestBlockTime = blockTime + blockTimes = append(blockTimes, blockDur) } if len(blockTimes) < 7 { diff --git a/test/e2e/timeouts.go b/test/e2e/timeouts.go deleted file mode 100644 index d09c26efae..0000000000 --- a/test/e2e/timeouts.go +++ /dev/null @@ -1,103 +0,0 @@ -package main - -import ( - "context" - "fmt" - "log" - "time" - - "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" - "github.com/celestiaorg/celestia-app/v3/test/e2e/testnet" - "github.com/celestiaorg/celestia-app/v3/test/util/testnode" - "github.com/celestiaorg/knuu/pkg/knuu" -) - -// VersionedTimeouts runs a simple testnet with 4 validators. It submits both MsgPayForBlobs -// and MsgSends over 30 seconds and then asserts that at least 10 transactions were -// committed. -func VersionedTimeouts(logger *log.Logger) error { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - scope := fmt.Sprintf("%s_%s", "VersionedTimeouts", time.Now().Format(timeFormat)) - kn, err := knuu.New(ctx, knuu.Options{ - Scope: scope, - ProxyEnabled: true, - }) - testnet.NoError("failed to initialize Knuu", err) - - kn.HandleStopSignal(ctx) - logger.Printf("Knuu initialized with scope %s", kn.Scope) - testNet, err := testnet.New(kn, testnet.Options{ChainID: "test"}) - testnet.NoError("failed to create testnet", err) - - logger.Println("Genesis app version is", testNet.Genesis().ConsensusParams.Version.AppVersion) - defer testNet.Cleanup(ctx) - - // TODO, this needs to be updated to get the latest version from the app - version := "pr-3882" - - logger.Println("Running VersionedTimeouts test", "version", version) - - logger.Println("Creating testnet validators") - testnet.NoError("failed to create genesis nodes", - testNet.CreateGenesisNodes(ctx, 4, version, 10000000, 0, testnet.DefaultResources, true)) - - logger.Println("Creating txsim") - endpoints, err := testNet.RemoteGRPCEndpoints(ctx) - testnet.NoError("failed to get remote gRPC endpoints", err) - err = testNet.CreateTxClient(ctx, "txsim", version, 60, - "20000", 6, testnet.DefaultResources, endpoints[0], map[int64]uint64{}) - testnet.NoError("failed to create tx client", err) - - logger.Println("Setting up testnets") - // We set the timeouts intentionally far from the default values to make sure - // that the configs do not take effect rather timeouts are set based on the - // app version in the genesis or the block headers - testnet.NoError("failed to setup testnets", testNet.Setup(ctx, - testnet.WithTimeoutPropose(1*time.Second), - testnet.WithTimeoutCommit(30*time.Second))) - - logger.Println("Starting testnets") - // only start 3/4 of the nodes - testnet.NoError("failed to start testnets", testNet.Start(ctx, 0, 1, 2)) - - logger.Println("Waiting for some time to produce blocks") - time.Sleep(60 * time.Second) - - // now start the last node - testnet.NoError("failed to start the remaining portion of testnets"+ - " validators", testNet.Start(ctx, 3)) - - logger.Println("Waiting for some time for the last node to catch" + - " up and" + - " produce blocks") - time.Sleep(120 * time.Second) - // TODO can extend the test by turning off one of the nodes and checking if the network still works - - logger.Println("Reading blockchain headers") - blockchain, err := testnode.ReadBlockchainHeaders(ctx, testNet.Node(0).AddressRPC()) - testnet.NoError("failed to read blockchain headers", err) - - totalTxs := 0 - for _, blockMeta := range blockchain { - version := blockMeta.Header.Version.App - if appconsts.LatestVersion != version { - return fmt.Errorf("expected app version %d, got %d in blockMeta %d", appconsts.LatestVersion, version, blockMeta.Header.Height) - } - totalTxs += blockMeta.NumTxs - } - if totalTxs < 10 { - return fmt.Errorf("expected at least 10 transactions, got %d", totalTxs) - } - blockTimes := testnode.CalculateBlockTime(blockchain) - stats := testnode.CalculateStats(blockTimes) - targetBlockTime := 6 * time.Second - targetBlockTimeIsReached := (stats.Avg < targetBlockTime+1*time.Second) && - (stats.Avg > targetBlockTime-1*time.Second) - if !targetBlockTimeIsReached { - return fmt.Errorf("expected block time to be around %v+-1s, got %v", - targetBlockTime, stats.Avg) - } - return nil -} diff --git a/test/txsim/run_test.go b/test/txsim/run_test.go index d17c5768d2..d4cbdf22ba 100644 --- a/test/txsim/run_test.go +++ b/test/txsim/run_test.go @@ -170,7 +170,7 @@ func TestTxSimUpgrade(t *testing.T) { WithFundedAccounts("txsim-master") cctx, _, grpcAddr := testnode.NewNetwork(t, cfg) - time.Sleep(time.Second * 2) + require.NoError(t, cctx.WaitForNextBlock()) // updrade to v3 at height 20 sequences := []txsim.Sequence{ diff --git a/test/util/testnode/app_wrapper.go b/test/util/testnode/app_wrapper.go index 31506ba427..e885f4c4ed 100644 --- a/test/util/testnode/app_wrapper.go +++ b/test/util/testnode/app_wrapper.go @@ -8,7 +8,9 @@ import ( abci "github.com/tendermint/tendermint/abci/types" ) -func WrapEndBlocker(app *app.App, timeoutCommit time.Duration) func(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { +// wrapEndBlocker overrides the app's endblocker to set the timeout commit to a +// different value for testnode. +func wrapEndBlocker(app *app.App, timeoutCommit time.Duration) func(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { endBlocker := func(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { resp := app.EndBlocker(ctx, req) resp.Timeouts.TimeoutCommit = timeoutCommit diff --git a/test/util/testnode/config.go b/test/util/testnode/config.go index 68b56adf91..f6233e2113 100644 --- a/test/util/testnode/config.go +++ b/test/util/testnode/config.go @@ -184,7 +184,7 @@ func DefaultAppCreator() srvtypes.AppCreator { simapp.EmptyAppOptions{}, baseapp.SetMinGasPrices(fmt.Sprintf("%v%v", appconsts.DefaultMinGasPrice, app.BondDenom)), ) - app.SetEndBlocker(WrapEndBlocker(app, time.Millisecond*0)) + app.SetEndBlocker(wrapEndBlocker(app, time.Millisecond*0)) return app } } @@ -202,7 +202,7 @@ func CustomAppCreator(minGasPrice string) srvtypes.AppCreator { simapp.EmptyAppOptions{}, baseapp.SetMinGasPrices(minGasPrice), ) - app.SetEndBlocker(WrapEndBlocker(app, time.Millisecond*0)) + app.SetEndBlocker(wrapEndBlocker(app, time.Millisecond*0)) return app } } diff --git a/test/util/testnode/read.go b/test/util/testnode/read.go index 234652cc7c..f4b5572a75 100644 --- a/test/util/testnode/read.go +++ b/test/util/testnode/read.go @@ -3,9 +3,6 @@ package testnode import ( "context" "fmt" - "math" - "sort" - "time" "github.com/celestiaorg/celestia-app/v3/app" "github.com/celestiaorg/celestia-app/v3/app/encoding" @@ -99,67 +96,6 @@ func reverseSlice[T any](s []T) { } } -type HeightTime struct { - Height int64 - Time time.Duration -} - -func CalculateBlockTime(blockMetas []*types.BlockMeta) []HeightTime { - // sort by Height in ascending order - sort.Slice(blockMetas, func(i, j int) bool { - return blockMetas[i].Header.Height < blockMetas[j].Header.Height - }) - - var result []HeightTime - for i := 0; i < len(blockMetas)-1; i++ { - // the time difference between the current header and the next one - timeDiff := blockMetas[i+1].Header.Time.Sub(blockMetas[i].Header.Time) - // shift the time difference to the next height - result = append(result, HeightTime{Height: blockMetas[i+1].Header.Height, Time: timeDiff}) - } - return result -} - -type Stats struct { - Min time.Duration - Max time.Duration - Avg time.Duration - Std time.Duration -} - -func CalculateStats(heightTimes []HeightTime) Stats { - var min, max, sum time.Duration - var count int64 - var variance float64 - - for i, ht := range heightTimes { - if i == 0 || ht.Time < min { - min = ht.Time - } - if i == 0 || ht.Time > max { - max = ht.Time - } - sum += ht.Time - count++ - } - - avg := time.Duration(int64(sum) / count) - - for _, ht := range heightTimes { - diff := float64(ht.Time - avg) - variance += diff * diff - } - - std := time.Duration(math.Sqrt(variance / float64(count))) - - return Stats{ - Min: min, - Max: max, - Avg: avg, - Std: std, - } -} - func ReadBlockHeights(ctx context.Context, rpcAddress string, fromHeight, toHeight int64) ([]*types.Block, error) { client, err := http.New(rpcAddress, "/websocket") if err != nil { From 3fc1c5aba7d4b65eb94261393b05019f9efce9c2 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Tue, 15 Oct 2024 07:18:02 -0500 Subject: [PATCH 084/106] chore: linter --- x/signal/keeper_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/signal/keeper_test.go b/x/signal/keeper_test.go index 470c371b31..71627a8417 100644 --- a/x/signal/keeper_test.go +++ b/x/signal/keeper_test.go @@ -426,7 +426,7 @@ func TestGetUpgrade(t *testing.T) { got, err := upgradeKeeper.GetUpgrade(ctx, &types.QueryGetUpgradeRequest{}) require.NoError(t, err) assert.Equal(t, v2.Version, got.Upgrade.AppVersion) - assert.Equal(t, int64(appconsts.DefaultUpgradeHeightDelay), got.Upgrade.UpgradeHeight) + assert.Equal(t, appconsts.DefaultUpgradeHeightDelay, got.Upgrade.UpgradeHeight) }) } From 558802c6e10909b3ca32c8f89c4d984f43dcccd2 Mon Sep 17 00:00:00 2001 From: Evan Forbes <42654277+evan-forbes@users.noreply.github.com> Date: Tue, 15 Oct 2024 07:36:11 -0500 Subject: [PATCH 085/106] Update test/e2e/major_upgrade_v3.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- test/e2e/major_upgrade_v3.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index 537b7d7fc7..2512eaf8a2 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -115,17 +115,19 @@ func MajorUpgradeToV3(logger *log.Logger) error { testnet.NoError("failed to get client", err) blockTimes := make([]time.Duration, 0, 7) latestBlockTime := time.Time{} + blockTimes := make([]time.Duration, 0, 7) + var prevBlockTime time.Time for h := upgradedHeight - 4; h <= upgradedHeight+4; h++ { - resp, err := client.Header(ctx, nil) + resp, err := client.Header(ctx, &h) testnet.NoError("failed to get header", err) blockTime := resp.Header.Time - if latestBlockTime.Equal(time.Time{}) { - latestBlockTime = blockTime + if prevBlockTime.IsZero() { + prevBlockTime = blockTime continue } - blockDur := blockTime.Sub(latestBlockTime) - latestBlockTime = blockTime + blockDur := blockTime.Sub(prevBlockTime) + prevBlockTime = blockTime blockTimes = append(blockTimes, blockDur) } From 4f220d3119510e287f46ef50dc4a6cdaeeb6f7f0 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Tue, 15 Oct 2024 07:45:31 -0500 Subject: [PATCH 086/106] chore: silly coderabit --- test/e2e/major_upgrade_v3.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index 2512eaf8a2..d56f1178fa 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -114,8 +114,6 @@ func MajorUpgradeToV3(logger *log.Logger) error { client, err := rpcNode.Client() testnet.NoError("failed to get client", err) blockTimes := make([]time.Duration, 0, 7) - latestBlockTime := time.Time{} - blockTimes := make([]time.Duration, 0, 7) var prevBlockTime time.Time for h := upgradedHeight - 4; h <= upgradedHeight+4; h++ { resp, err := client.Header(ctx, &h) From 0bfab8ed311d40e38bee5a61e47d8eaae7b0bbaa Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Tue, 15 Oct 2024 10:06:26 -0500 Subject: [PATCH 087/106] chore: test --- pkg/appconsts/global_consts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/appconsts/global_consts.go b/pkg/appconsts/global_consts.go index 424d4bbe3f..211b29b495 100644 --- a/pkg/appconsts/global_consts.go +++ b/pkg/appconsts/global_consts.go @@ -30,7 +30,7 @@ const ( // DefaultUpgradeHeightDelay is the number of blocks after a quorum has been // reached that the chain should upgrade to the new version. Assuming a block // interval of 12 seconds, this is 7 days. - DefaultUpgradeHeightDelay = int64(7 * 24 * 60 * 60 / 12) // 7 days * 24 hours * 60 minutes * 60 seconds / 12 seconds per block = 50,400 blocks. + DefaultUpgradeHeightDelay = 1 //int64(7 * 24 * 60 * 60 / 6) // 7 days * 24 hours * 60 minutes * 60 seconds / 12 seconds per block = 50,400 blocks. ) var ( From 5a71dd73289720e737e72b3f4158a91ab45999b7 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Tue, 15 Oct 2024 11:04:33 -0500 Subject: [PATCH 088/106] chore: test --- test/e2e/major_upgrade_v3.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index d56f1178fa..fe732ff02e 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -76,9 +76,9 @@ func MajorUpgradeToV3(logger *log.Logger) error { logger.Println("Starting testnet") testnet.NoError("Failed to start testnet", testNet.Start(ctx)) - timer := time.NewTimer(10 * time.Minute) + timer := time.NewTimer(20 * time.Minute) defer timer.Stop() - ticker := time.NewTicker(30 * time.Second) + ticker := time.NewTicker(10 * time.Second) defer ticker.Stop() logger.Println("waiting for upgrade") From 8f57f47169ca1ec07d615f5078d35032d379e39a Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Tue, 15 Oct 2024 12:08:42 -0500 Subject: [PATCH 089/106] fix: test --- test/e2e/major_upgrade_v3.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index fe732ff02e..a10d8e3380 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -40,7 +40,7 @@ func MajorUpgradeToV3(logger *log.Logger) error { // HACKHACK: use a version of celestia-app built from a commit on this PR. // This can be removed after the PR is merged to main and we override the // upgrade height delay to one block in a new Docker image. - version := "pr-3882" + version := "5a71dd73289720e737e72b3f4158a91ab45999b7" logger.Println("Running major upgrade to v3 test", "version", version) @@ -115,7 +115,7 @@ func MajorUpgradeToV3(logger *log.Logger) error { testnet.NoError("failed to get client", err) blockTimes := make([]time.Duration, 0, 7) var prevBlockTime time.Time - for h := upgradedHeight - 4; h <= upgradedHeight+4; h++ { + for h := upgradeHeightV3 - 4; h <= upgradeHeightV3+4; h++ { resp, err := client.Header(ctx, &h) testnet.NoError("failed to get header", err) blockTime := resp.Header.Time From c9ece2a6e6f9f2a99c4cf0168cb696dde56c54af Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Tue, 15 Oct 2024 12:09:49 -0500 Subject: [PATCH 090/106] chore: update version --- test/e2e/major_upgrade_v3.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index a10d8e3380..927bb5745f 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -40,7 +40,7 @@ func MajorUpgradeToV3(logger *log.Logger) error { // HACKHACK: use a version of celestia-app built from a commit on this PR. // This can be removed after the PR is merged to main and we override the // upgrade height delay to one block in a new Docker image. - version := "5a71dd73289720e737e72b3f4158a91ab45999b7" + version := "8f57f47169ca1ec07d615f5078d35032d379e39a" logger.Println("Running major upgrade to v3 test", "version", version) From 78455691ee909bdf67f23a4e1f355d85755c6fe1 Mon Sep 17 00:00:00 2001 From: Evan Forbes <42654277+evan-forbes@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:15:47 -0500 Subject: [PATCH 091/106] Update test/e2e/benchmark/benchmark.go Co-authored-by: Rootul P --- test/e2e/benchmark/benchmark.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/benchmark/benchmark.go b/test/e2e/benchmark/benchmark.go index 1dec58b3de..5af7b8539e 100644 --- a/test/e2e/benchmark/benchmark.go +++ b/test/e2e/benchmark/benchmark.go @@ -22,8 +22,8 @@ type BenchmarkTest struct { manifest *Manifest } -// NewBenchmarkTest wraps around testnet.New to create a new benchmark test -// it may modify genesis consensus parameters based on manifest +// NewBenchmarkTest wraps around testnet.New to create a new benchmark test. +// It may modify genesis consensus parameters based on manifest. func NewBenchmarkTest(name string, manifest *Manifest) (*BenchmarkTest, error) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() From 8a0c432049b0ec7ba64232a68655148b71fa8bb0 Mon Sep 17 00:00:00 2001 From: Evan Forbes <42654277+evan-forbes@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:32:23 -0500 Subject: [PATCH 092/106] Update cmd/celestia-appd/cmd/start.go Co-authored-by: Rootul P --- cmd/celestia-appd/cmd/start.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmd/celestia-appd/cmd/start.go b/cmd/celestia-appd/cmd/start.go index 072d724922..763f1b6cd5 100644 --- a/cmd/celestia-appd/cmd/start.go +++ b/cmd/celestia-appd/cmd/start.go @@ -113,8 +113,6 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. } serverCtx := server.GetServerContextFromCmd(cmd) - serverCtx.Logger.Info("starting node with timeout_propose: ", - serverCtx.Config.Consensus.TimeoutPropose.Seconds()) clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err From fc6a897a4b707b96f829f9c617960711e35eb8a7 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Tue, 15 Oct 2024 17:41:29 -0500 Subject: [PATCH 093/106] fix: use official release of core and correct height delay --- go.mod | 2 +- go.sum | 4 ++-- local_devnet/docker-compose.yml | 4 ++++ pkg/appconsts/global_consts.go | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index e2b631c81e..7ad4054fc1 100644 --- a/go.mod +++ b/go.mod @@ -260,5 +260,5 @@ replace ( github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.12.4 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 - github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241014174725-23e3fb130177 + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.43.0-tm-v0.34.35 ) diff --git a/go.sum b/go.sum index e7ec197868..22fd80bf43 100644 --- a/go.sum +++ b/go.sum @@ -317,8 +317,8 @@ github.com/celestiaorg/bittwister v0.0.0-20231213180407-65cdbaf5b8c7 h1:nxplQi8w 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.42.0-tm-v0.34.35.0.20241014174725-23e3fb130177 h1:oQqT2MrX6CFMDlo5GfjnjPFgzYt+eqF4KnkXS66rhAU= -github.com/celestiaorg/celestia-core v1.42.0-tm-v0.34.35.0.20241014174725-23e3fb130177/go.mod h1:/fK0n3ps09t5uErBQe1QZbrE81L81MNUzWpFyWQLDT0= +github.com/celestiaorg/celestia-core v1.43.0-tm-v0.34.35 h1:L4GTm+JUXhB0a/nGPMq6jEqqe6THuYSQ8m2kUCtZYqw= +github.com/celestiaorg/celestia-core v1.43.0-tm-v0.34.35/go.mod h1:bFr0lAGwaJ0mOHSBmib5/ca5pbBf1yKWGPs93Td0HPw= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16 h1:f+fTe7GGk0/qgdzyqB8kk8EcDf9d6MC22khBTQiDXsU= github.com/celestiaorg/cosmos-sdk v1.25.0-sdk-v0.46.16/go.mod h1:07Z8HJqS8Rw4XlZ+ok3D3NM/X/in8mvcGLvl0Zb5wrA= github.com/celestiaorg/go-square v1.1.1 h1:Cy3p8WVspVcyOqHM8BWFuuYPwMitO1pYGe+ImILFZRA= diff --git a/local_devnet/docker-compose.yml b/local_devnet/docker-compose.yml index 15c0a38704..1cf768d53d 100644 --- a/local_devnet/docker-compose.yml +++ b/local_devnet/docker-compose.yml @@ -6,6 +6,7 @@ services: container_name: core0 build: context: .. + dockerfile: ./docker/Dockerfile expose: - "26660" # for prometheus ports: @@ -31,6 +32,7 @@ services: container_name: core1 build: context: .. + dockerfile: ./docker/Dockerfile expose: - "26660" # for prometheus depends_on: @@ -59,6 +61,7 @@ services: container_name: core2 build: context: .. + dockerfile: ./docker/Dockerfile expose: - "26660" # for prometheus depends_on: @@ -87,6 +90,7 @@ services: container_name: core3 build: context: .. + dockerfile: ./docker/Dockerfile expose: - "26660" # for prometheus depends_on: diff --git a/pkg/appconsts/global_consts.go b/pkg/appconsts/global_consts.go index 211b29b495..d0574a1333 100644 --- a/pkg/appconsts/global_consts.go +++ b/pkg/appconsts/global_consts.go @@ -30,7 +30,7 @@ const ( // DefaultUpgradeHeightDelay is the number of blocks after a quorum has been // reached that the chain should upgrade to the new version. Assuming a block // interval of 12 seconds, this is 7 days. - DefaultUpgradeHeightDelay = 1 //int64(7 * 24 * 60 * 60 / 6) // 7 days * 24 hours * 60 minutes * 60 seconds / 12 seconds per block = 50,400 blocks. + DefaultUpgradeHeightDelay = int64(7 * 24 * 60 * 60 / 6) // 7 days * 24 hours * 60 minutes * 60 seconds / 12 seconds per block = 50,400 blocks. ) var ( From b9b1df8a6382cf895daab4fe4ed03bc1031baf01 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Tue, 15 Oct 2024 18:46:08 -0500 Subject: [PATCH 094/106] chore: try to unflake blobstream test --- test/util/testnode/config.go | 2 +- x/blobstream/integration_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/util/testnode/config.go b/test/util/testnode/config.go index f6233e2113..0ec6e7920e 100644 --- a/test/util/testnode/config.go +++ b/test/util/testnode/config.go @@ -184,7 +184,7 @@ func DefaultAppCreator() srvtypes.AppCreator { simapp.EmptyAppOptions{}, baseapp.SetMinGasPrices(fmt.Sprintf("%v%v", appconsts.DefaultMinGasPrice, app.BondDenom)), ) - app.SetEndBlocker(wrapEndBlocker(app, time.Millisecond*0)) + app.SetEndBlocker(wrapEndBlocker(app, time.Millisecond*30)) return app } } diff --git a/x/blobstream/integration_test.go b/x/blobstream/integration_test.go index 61bc6544d7..7bb03a49ee 100644 --- a/x/blobstream/integration_test.go +++ b/x/blobstream/integration_test.go @@ -47,7 +47,7 @@ func (s *BlobstreamIntegrationSuite) SetupSuite() { s.ecfg = encoding.MakeConfig(app.ModuleEncodingRegisters...) s.cctx = cctx - require.NoError(t, s.cctx.WaitForNextBlock()) + require.NoError(t, s.cctx.WaitForBlocks(10)) } func (s *BlobstreamIntegrationSuite) TestBlobstream() { From 8c019af12a85885553a57016969713aa70a47c5e Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Tue, 15 Oct 2024 19:05:45 -0500 Subject: [PATCH 095/106] chore: reduce lieklyhood of flakes and be explicit about a flake failure --- test/e2e/major_upgrade_v3.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index 927bb5745f..2d02e1a565 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -78,7 +78,7 @@ func MajorUpgradeToV3(logger *log.Logger) error { timer := time.NewTimer(20 * time.Minute) defer timer.Stop() - ticker := time.NewTicker(10 * time.Second) + ticker := time.NewTicker(3 * time.Second) defer ticker.Stop() logger.Println("waiting for upgrade") @@ -113,13 +113,21 @@ func MajorUpgradeToV3(logger *log.Logger) error { rpcNode := testNet.Nodes()[0] client, err := rpcNode.Client() testnet.NoError("failed to get client", err) - blockTimes := make([]time.Duration, 0, 7) + + startHeight := upgradeHeightV3 - 5 + endHeight := upgradedHeight + 1 + blockTimes := make([]time.Duration, 0, endHeight-startHeight) var prevBlockTime time.Time - for h := upgradeHeightV3 - 4; h <= upgradeHeightV3+4; h++ { + + for h := startHeight; h < endHeight; h++ { resp, err := client.Header(ctx, &h) testnet.NoError("failed to get header", err) blockTime := resp.Header.Time - if prevBlockTime.IsZero() { + + if h == startHeight { + if resp.Header.Version.App != v2.Version { + return fmt.Errorf("start height %v was app version 2, this is a flake and the start height needs to be reduced", startHeight) + } prevBlockTime = blockTime continue } @@ -129,10 +137,6 @@ func MajorUpgradeToV3(logger *log.Logger) error { blockTimes = append(blockTimes, blockDur) } - if len(blockTimes) < 7 { - testnet.NoError("", fmt.Errorf("not enough block times collected: %v", len(blockTimes))) - } - startDur := blockTimes[0] endDur := blockTimes[len(blockTimes)-1] From e13b96cf9d3b40a6fb674ac17041f72661ba534e Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Tue, 15 Oct 2024 19:07:38 -0500 Subject: [PATCH 096/106] chore: correct error --- test/e2e/major_upgrade_v3.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index 2d02e1a565..92e21d53ce 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -126,7 +126,7 @@ func MajorUpgradeToV3(logger *log.Logger) error { if h == startHeight { if resp.Header.Version.App != v2.Version { - return fmt.Errorf("start height %v was app version 2, this is a flake and the start height needs to be reduced", startHeight) + return fmt.Errorf("expected start height %v was app version 2", startHeight) } prevBlockTime = blockTime continue From b9aca24ac49152eefd8775bc603ded661b8c0100 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Tue, 15 Oct 2024 20:14:19 -0500 Subject: [PATCH 097/106] fix: whoops don't change the upgrade height delay --- pkg/appconsts/global_consts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/appconsts/global_consts.go b/pkg/appconsts/global_consts.go index 60f0c129f7..ca73aa8fee 100644 --- a/pkg/appconsts/global_consts.go +++ b/pkg/appconsts/global_consts.go @@ -30,7 +30,7 @@ const ( // DefaultUpgradeHeightDelay is the number of blocks after a quorum has been // reached that the chain should upgrade to the new version. Assuming a block // interval of 12 seconds, this is 7 days. - DefaultUpgradeHeightDelay = int64(7 * 24 * 60 * 60 / 6) // 7 days * 24 hours * 60 minutes * 60 seconds / 12 seconds per block = 50,400 blocks. + DefaultUpgradeHeightDelay = int64(7 * 24 * 60 * 60 / 12) // 7 days * 24 hours * 60 minutes * 60 seconds / 12 seconds per block = 50,400 blocks. ) var ( From 6c70dac7ce849046c8e7dbbb32f68614ef523cb9 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 16 Oct 2024 07:39:06 -0500 Subject: [PATCH 098/106] chore: remove unused method --- test/util/testnode/node_interaction_api.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/util/testnode/node_interaction_api.go b/test/util/testnode/node_interaction_api.go index 896ac474ca..a5c175e86d 100644 --- a/test/util/testnode/node_interaction_api.go +++ b/test/util/testnode/node_interaction_api.go @@ -52,10 +52,6 @@ func NewContext(goContext context.Context, keyring keyring.Keyring, tmConfig *tm return Context{goContext: goContext, Context: clientContext, apiAddress: apiAddress} } -func (c *Context) GetTMNode() *node.Node { - return c.tmNode -} - func (c *Context) GoContext() context.Context { return c.goContext } From 61a747baeff12a779ac54d5f8d8fb50ebc57e398 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 16 Oct 2024 07:49:30 -0500 Subject: [PATCH 099/106] chore: removed indice filtering step --- test/e2e/testnet/testnet.go | 66 +++++++------------------------------ 1 file changed, 11 insertions(+), 55 deletions(-) diff --git a/test/e2e/testnet/testnet.go b/test/e2e/testnet/testnet.go index 9cfe6c4d1e..7cc74fb011 100644 --- a/test/e2e/testnet/testnet.go +++ b/test/e2e/testnet/testnet.go @@ -212,11 +212,8 @@ func (t *Testnet) CreateTxClient( return nil } -func (t *Testnet) StartTxClients(ctx context.Context, indices ...int) error { - for i, txsim := range t.txClients { - if len(indices) != 0 && !isInIndices(i, indices) { - continue - } +func (t *Testnet) StartTxClients(ctx context.Context) error { + for _, txsim := range t.txClients { err := txsim.Instance.Execution().StartAsync(ctx) if err != nil { log.Err(err). @@ -372,7 +369,7 @@ func (t *Testnet) RemoteRPCEndpoints(ctx context.Context) ([]string, error) { // WaitToSync waits for the started nodes to sync with the network and move // past the genesis block. -func (t *Testnet) WaitToSync(ctx context.Context, indices ...int) error { +func (t *Testnet) WaitToSync(ctx context.Context) error { genesisNodes := make([]*Node, 0) for _, node := range t.nodes { if node.StartHeight == 0 { @@ -380,23 +377,7 @@ func (t *Testnet) WaitToSync(ctx context.Context, indices ...int) error { } } - // filter genesis nodes based on indices - filteredGenesisNodes := make([]*Node, 0) - if len(indices) != 0 { - for i, node := range genesisNodes { - if !isInIndices(i, indices) { - continue - } - filteredGenesisNodes = append(filteredGenesisNodes, node) - } - } else { - filteredGenesisNodes = genesisNodes - } - - for i, node := range filteredGenesisNodes { - if len(indices) != 0 && !isInIndices(i, indices) { - continue - } + for _, node := range genesisNodes { log.Info().Str("name", node.Name).Msg( "waiting for node to sync") client, err := node.Client() @@ -425,51 +406,26 @@ func (t *Testnet) WaitToSync(ctx context.Context, indices ...int) error { return nil } -func isInIndices(i int, indices []int) bool { - for _, index := range indices { - if i == index { - return true - } - } - return false -} - // StartNodes starts the testnet nodes and setup proxies. // It does not wait for the nodes to produce blocks. // For that, use WaitToSync. -func (t *Testnet) StartNodes(ctx context.Context, indices ...int) error { +func (t *Testnet) StartNodes(ctx context.Context) error { genesisNodes := make([]*Node, 0) // identify genesis nodes for _, node := range t.nodes { if node.StartHeight == 0 { genesisNodes = append(genesisNodes, node) } - } - - // filter genesis nodes based on indices - filteredGenesisNodes := make([]*Node, 0) - if len(indices) != 0 { - for i, node := range genesisNodes { - if !isInIndices(i, indices) { - continue - } - filteredGenesisNodes = append(filteredGenesisNodes, node) - } - } else { - filteredGenesisNodes = genesisNodes - } - // start genesis nodes asynchronously - // if indices are provided, only start the nodes at those indices - for _, node := range filteredGenesisNodes { err := node.StartAsync(ctx) if err != nil { return fmt.Errorf("node %s failed to start: %w", node.Name, err) } } + log.Info().Msg("create endpoint proxies for genesis nodes") // wait for instances to be running - for _, node := range filteredGenesisNodes { + for _, node := range genesisNodes { err := node.WaitUntilStartedAndCreateProxy(ctx) if err != nil { log.Err(err).Str("name", node.Name).Str("version", @@ -482,20 +438,20 @@ func (t *Testnet) StartNodes(ctx context.Context, indices ...int) error { return nil } -func (t *Testnet) Start(ctx context.Context, indices ...int) error { +func (t *Testnet) Start(ctx context.Context) error { // start nodes and setup proxies - err := t.StartNodes(ctx, indices...) + err := t.StartNodes(ctx) if err != nil { return err } // wait for nodes to sync log.Info().Msg("waiting for genesis nodes to sync") - err = t.WaitToSync(ctx, indices...) + err = t.WaitToSync(ctx) if err != nil { return err } - return t.StartTxClients(ctx, indices...) + return t.StartTxClients(ctx) } func (t *Testnet) Cleanup(ctx context.Context) { From 07c1fc98836d040ed48a9ae84e76969def2ab656 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 16 Oct 2024 08:42:10 -0500 Subject: [PATCH 100/106] refactor: test --- test/e2e/major_upgrade_v3.go | 65 +++++++++++++++++++++++++++++------- 1 file changed, 53 insertions(+), 12 deletions(-) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index 92e21d53ce..e43ad48f83 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -7,10 +7,12 @@ import ( "time" "github.com/celestiaorg/celestia-app/v3/app" + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" v3 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v3" "github.com/celestiaorg/celestia-app/v3/test/e2e/testnet" "github.com/celestiaorg/knuu/pkg/knuu" + tmtypes "github.com/tendermint/tendermint/types" ) func MajorUpgradeToV3(logger *log.Logger) error { @@ -115,17 +117,23 @@ func MajorUpgradeToV3(logger *log.Logger) error { testnet.NoError("failed to get client", err) startHeight := upgradeHeightV3 - 5 - endHeight := upgradedHeight + 1 - blockTimes := make([]time.Duration, 0, endHeight-startHeight) + endHeight := upgradedHeight + 5 + + type versionDuration struct { + dur time.Duration + block *tmtypes.Block + } + + blockSummaries := make([]versionDuration, 0, endHeight-startHeight) var prevBlockTime time.Time for h := startHeight; h < endHeight; h++ { - resp, err := client.Header(ctx, &h) + resp, err := client.Block(ctx, &h) testnet.NoError("failed to get header", err) - blockTime := resp.Header.Time + blockTime := resp.Block.Time if h == startHeight { - if resp.Header.Version.App != v2.Version { + if resp.Block.Version.App != v2.Version { return fmt.Errorf("expected start height %v was app version 2", startHeight) } prevBlockTime = blockTime @@ -134,18 +142,51 @@ func MajorUpgradeToV3(logger *log.Logger) error { blockDur := blockTime.Sub(prevBlockTime) prevBlockTime = blockTime - blockTimes = append(blockTimes, blockDur) + blockSummaries = append(blockSummaries, versionDuration{dur: blockDur, block: resp.Block}) } - startDur := blockTimes[0] - endDur := blockTimes[len(blockTimes)-1] + preciseUpgradeHeight := 0 + multipleRounds := 0 + for _, b := range blockSummaries { + + // check for the precise upgrade height and skip, as the block time + // won't match due to the off by 1 nature of the block time. + if b.block.Version.App == v3.Version && preciseUpgradeHeight == 0 { + preciseUpgradeHeight = int(b.block.Height) + continue + } + + // don't test heights with multiple rounds as the times are off and fail + // later if there are too many + if b.block.LastCommit.Round > 0 { + multipleRounds++ + continue + } + + if b.dur > appconsts.GetTimeoutCommit(b.block.Version.App) { + return fmt.Errorf( + "block was too slow for corresponding version: version %v duration %v upgrade height %v height %v", + b.block.Version.App, + b.dur, + preciseUpgradeHeight, + b.block.Height, + ) + } + + if b.dur < appconsts.GetTimeoutCommit(b.block.Version.App) { + return fmt.Errorf( + "block was too fast for corresponding version: version %v duration %v upgrade height %v height %v", + b.block.Version.App, + b.dur, + preciseUpgradeHeight, + b.block.Height, + ) + } - if startDur < time.Second*10 { - testnet.NoError("", fmt.Errorf("blocks for v2 are too short %v", len(blockTimes))) } - if endDur > time.Second*7 { - testnet.NoError("", fmt.Errorf("blocks for v3 are too long %v", len(blockTimes))) + if multipleRounds > 2 { + return fmt.Errorf("too many multiple rounds for test to be reliable: %d", multipleRounds) } return nil From d969f68fee6e3317670e639bffb9ab924a5499f4 Mon Sep 17 00:00:00 2001 From: Evan Forbes <42654277+evan-forbes@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:58:16 -0500 Subject: [PATCH 101/106] feat!: version `UpgradeHeightDelay` (#3980) ## Overview closes #3978 #3979 this is just a nice to have for v3. If we're worried about this causing issues at all, we should just postpone this imo. --- app/app.go | 2 +- app/module/configurator_test.go | 2 +- app/test/upgrade_test.go | 12 ++++++++---- pkg/appconsts/global_consts.go | 19 ------------------- pkg/appconsts/v1/app_consts.go | 4 ++++ pkg/appconsts/v2/app_consts.go | 4 ++++ pkg/appconsts/v3/app_consts.go | 4 ++++ pkg/appconsts/versioned_consts.go | 20 ++++++++++++++++++++ x/signal/integration_test.go | 2 +- x/signal/keeper.go | 15 +++++---------- x/signal/keeper_test.go | 8 ++++---- 11 files changed, 52 insertions(+), 40 deletions(-) diff --git a/app/app.go b/app/app.go index 00dc0649b3..b13e8f7f3f 100644 --- a/app/app.go +++ b/app/app.go @@ -280,7 +280,7 @@ func New( ), ) - app.SignalKeeper = signal.NewKeeper(appCodec, keys[signaltypes.StoreKey], app.StakingKeeper, appconsts.UpgradeHeightDelay()) + app.SignalKeeper = signal.NewKeeper(appCodec, keys[signaltypes.StoreKey], app.StakingKeeper) app.IBCKeeper = ibckeeper.NewKeeper( appCodec, diff --git a/app/module/configurator_test.go b/app/module/configurator_test.go index ed504c9ac3..a93713938a 100644 --- a/app/module/configurator_test.go +++ b/app/module/configurator_test.go @@ -37,7 +37,7 @@ func TestConfigurator(t *testing.T) { stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) require.NoError(t, stateStore.LoadLatestVersion()) - keeper := signal.NewKeeper(config.Codec, storeKey, nil, 0) + keeper := signal.NewKeeper(config.Codec, storeKey, nil) require.NotNil(t, keeper) upgradeModule := signal.NewAppModule(keeper) manager, err := module.NewManager([]module.VersionedModule{ diff --git a/app/test/upgrade_test.go b/app/test/upgrade_test.go index 5a4a5485e8..4c2677c8e0 100644 --- a/app/test/upgrade_test.go +++ b/app/test/upgrade_test.go @@ -37,6 +37,10 @@ func TestAppUpgradeV3(t *testing.T) { if testing.Short() { t.Skip("skipping TestAppUpgradeV3 in short mode") } + + appconsts.OverrideUpgradeHeightDelayStr = "1" + defer func() { appconsts.OverrideUpgradeHeightDelayStr = "" }() + testApp, genesis := SetupTestAppWithUpgradeHeight(t, 3) upgradeFromV1ToV2(t, testApp) @@ -102,7 +106,7 @@ func TestAppUpgradeV3(t *testing.T) { // brace yourselfs, this part may take a while initialHeight := int64(4) - for height := initialHeight; height < initialHeight+appconsts.DefaultUpgradeHeightDelay; height++ { + for height := initialHeight; height < initialHeight+appconsts.UpgradeHeightDelay(v2.Version); height++ { appVersion := v2.Version _ = testApp.BeginBlock(abci.RequestBeginBlock{ Header: tmproto.Header{ @@ -112,7 +116,7 @@ func TestAppUpgradeV3(t *testing.T) { }) endBlockResp = testApp.EndBlock(abci.RequestEndBlock{ - Height: 3 + appconsts.DefaultUpgradeHeightDelay, + Height: 3 + appconsts.UpgradeHeightDelay(v2.Version), }) require.Equal(t, appconsts.GetTimeoutCommit(appVersion), endBlockResp.Timeouts.TimeoutCommit) @@ -137,7 +141,7 @@ func TestAppUpgradeV3(t *testing.T) { _ = testApp.BeginBlock(abci.RequestBeginBlock{ Header: tmproto.Header{ ChainID: genesis.ChainID, - Height: initialHeight + appconsts.DefaultUpgradeHeightDelay, + Height: initialHeight + appconsts.UpgradeHeightDelay(v3.Version), Version: tmversion.Consensus{App: 3}, }, }) @@ -148,7 +152,7 @@ func TestAppUpgradeV3(t *testing.T) { require.Equal(t, abci.CodeTypeOK, deliverTxResp.Code, deliverTxResp.Log) respEndBlock := testApp.EndBlock(abci. - RequestEndBlock{Height: initialHeight + appconsts.DefaultUpgradeHeightDelay}) + RequestEndBlock{Height: initialHeight + appconsts.UpgradeHeightDelay(v3.Version)}) require.Equal(t, appconsts.GetTimeoutCommit(v3.Version), respEndBlock.Timeouts.TimeoutCommit) require.Equal(t, appconsts.GetTimeoutPropose(v3.Version), respEndBlock.Timeouts.TimeoutPropose) } diff --git a/pkg/appconsts/global_consts.go b/pkg/appconsts/global_consts.go index ca73aa8fee..ce6f7d71ee 100644 --- a/pkg/appconsts/global_consts.go +++ b/pkg/appconsts/global_consts.go @@ -1,8 +1,6 @@ package appconsts import ( - "strconv" - "github.com/celestiaorg/go-square/v2/share" "github.com/celestiaorg/rsmt2d" "github.com/tendermint/tendermint/pkg/consts" @@ -26,11 +24,6 @@ const ( // BondDenom defines the native staking denomination BondDenom = "utia" - - // DefaultUpgradeHeightDelay is the number of blocks after a quorum has been - // reached that the chain should upgrade to the new version. Assuming a block - // interval of 12 seconds, this is 7 days. - DefaultUpgradeHeightDelay = int64(7 * 24 * 60 * 60 / 12) // 7 days * 24 hours * 60 minutes * 60 seconds / 12 seconds per block = 50,400 blocks. ) var ( @@ -51,18 +44,6 @@ var ( SupportedShareVersions = share.SupportedShareVersions ) -// UpgradeHeightDelay returns the delay in blocks after a quorum has been reached that the chain should upgrade to the new version. -func UpgradeHeightDelay() int64 { - if OverrideUpgradeHeightDelayStr != "" { - parsedValue, err := strconv.ParseInt(OverrideUpgradeHeightDelayStr, 10, 64) - if err != nil { - panic("Invalid OverrideUpgradeHeightDelayStr value") - } - return parsedValue - } - return DefaultUpgradeHeightDelay -} - // HashLength returns the length of a hash in bytes. func HashLength() int { return hashLength diff --git a/pkg/appconsts/v1/app_consts.go b/pkg/appconsts/v1/app_consts.go index 14135b9686..873d3ec18a 100644 --- a/pkg/appconsts/v1/app_consts.go +++ b/pkg/appconsts/v1/app_consts.go @@ -8,4 +8,8 @@ const ( SubtreeRootThreshold int = 64 TimeoutPropose = time.Second * 10 TimeoutCommit = time.Second * 11 + // UpgradeHeightDelay is the number of blocks after a quorum has been + // reached that the chain should upgrade to the new version. Assuming a block + // interval of 12 seconds, this is 7 days. + UpgradeHeightDelay = int64(7 * 24 * 60 * 60 / 12) // 7 days * 24 hours * 60 minutes * 60 seconds / 12 seconds per block = 50,400 blocks. ) diff --git a/pkg/appconsts/v2/app_consts.go b/pkg/appconsts/v2/app_consts.go index f76be2e8af..d02a97079b 100644 --- a/pkg/appconsts/v2/app_consts.go +++ b/pkg/appconsts/v2/app_consts.go @@ -8,4 +8,8 @@ const ( SubtreeRootThreshold int = 64 TimeoutPropose = time.Second * 10 TimeoutCommit = time.Second * 11 + // UpgradeHeightDelay is the number of blocks after a quorum has been + // reached that the chain should upgrade to the new version. Assuming a block + // interval of 12 seconds, this is 7 days. + UpgradeHeightDelay = int64(7 * 24 * 60 * 60 / 12) // 7 days * 24 hours * 60 minutes * 60 seconds / 12 seconds per block = 50,400 blocks. ) diff --git a/pkg/appconsts/v3/app_consts.go b/pkg/appconsts/v3/app_consts.go index bb705bb5e6..3f9279518d 100644 --- a/pkg/appconsts/v3/app_consts.go +++ b/pkg/appconsts/v3/app_consts.go @@ -11,4 +11,8 @@ const ( MaxTxSize int = 2097152 // 2 MiB in bytes TimeoutPropose = time.Millisecond * 3500 TimeoutCommit = time.Millisecond * 4200 + // UpgradeHeightDelay is the number of blocks after a quorum has been + // reached that the chain should upgrade to the new version. Assuming a block + // interval of 12 seconds, this is 7 days. + UpgradeHeightDelay = int64(7 * 24 * 60 * 60 / 6) // 7 days * 24 hours * 60 minutes * 60 seconds / 6 seconds per block = 100,800 blocks. ) diff --git a/pkg/appconsts/versioned_consts.go b/pkg/appconsts/versioned_consts.go index ada838b1a2..2455e87791 100644 --- a/pkg/appconsts/versioned_consts.go +++ b/pkg/appconsts/versioned_consts.go @@ -77,3 +77,23 @@ func GetTimeoutCommit(v uint64) time.Duration { return v3.TimeoutCommit } } + +// UpgradeHeightDelay returns the delay in blocks after a quorum has been reached that the chain should upgrade to the new version. +func UpgradeHeightDelay(v uint64) int64 { + if OverrideUpgradeHeightDelayStr != "" { + parsedValue, err := strconv.ParseInt(OverrideUpgradeHeightDelayStr, 10, 64) + if err != nil { + panic("Invalid OverrideUpgradeHeightDelayStr value") + } + return parsedValue + } + switch v { + case v1.Version: + return v1.UpgradeHeightDelay + case v2.Version: + return v2.UpgradeHeightDelay + default: + return v3.UpgradeHeightDelay + + } +} diff --git a/x/signal/integration_test.go b/x/signal/integration_test.go index 23b8158dd2..c3dd2419dd 100644 --- a/x/signal/integration_test.go +++ b/x/signal/integration_test.go @@ -77,7 +77,7 @@ func TestUpgradeIntegration(t *testing.T) { require.False(t, shouldUpgrade) require.EqualValues(t, 0, version) - ctx = ctx.WithBlockHeight(ctx.BlockHeight() + appconsts.DefaultUpgradeHeightDelay) + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + appconsts.UpgradeHeightDelay(version)) shouldUpgrade, version = app.SignalKeeper.ShouldUpgrade(ctx) require.True(t, shouldUpgrade) diff --git a/x/signal/keeper.go b/x/signal/keeper.go index 0a23d93119..3ee13a9708 100644 --- a/x/signal/keeper.go +++ b/x/signal/keeper.go @@ -5,6 +5,7 @@ import ( "encoding/binary" sdkmath "cosmossdk.io/math" + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" "github.com/celestiaorg/celestia-app/v3/x/signal/types" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -41,10 +42,6 @@ type Keeper struct { // stakingKeeper is used to fetch validators to calculate the total power // signalled to a version. stakingKeeper StakingKeeper - - // upgradeHeightDelayBlocks is the number of blocks after a quorum has been - // reached that the chain should upgrade to the new version - upgradeHeightDelayBlocks int64 } // NewKeeper returns a signal keeper. @@ -52,13 +49,11 @@ func NewKeeper( binaryCodec codec.BinaryCodec, storeKey storetypes.StoreKey, stakingKeeper StakingKeeper, - upgradeHeightDelayBlocks int64, ) Keeper { return Keeper{ - binaryCodec: binaryCodec, - storeKey: storeKey, - stakingKeeper: stakingKeeper, - upgradeHeightDelayBlocks: upgradeHeightDelayBlocks, + binaryCodec: binaryCodec, + storeKey: storeKey, + stakingKeeper: stakingKeeper, } } @@ -109,7 +104,7 @@ func (k *Keeper) TryUpgrade(ctx context.Context, _ *types.MsgTryUpgrade) (*types } upgrade := types.Upgrade{ AppVersion: version, - UpgradeHeight: sdkCtx.BlockHeader().Height + k.upgradeHeightDelayBlocks, + UpgradeHeight: sdkCtx.BlockHeader().Height + appconsts.UpgradeHeightDelay(version), } k.setUpgrade(sdkCtx, upgrade) } diff --git a/x/signal/keeper_test.go b/x/signal/keeper_test.go index 71627a8417..f79d1c3884 100644 --- a/x/signal/keeper_test.go +++ b/x/signal/keeper_test.go @@ -69,7 +69,7 @@ func TestGetVotingPowerThreshold(t *testing.T) { t.Run(tc.name, func(t *testing.T) { config := encoding.MakeConfig(app.ModuleEncodingRegisters...) stakingKeeper := newMockStakingKeeper(tc.validators) - k := signal.NewKeeper(config.Codec, nil, stakingKeeper, appconsts.DefaultUpgradeHeightDelay) + k := signal.NewKeeper(config.Codec, nil, stakingKeeper) got := k.GetVotingPowerThreshold(sdk.Context{}) assert.Equal(t, tc.want, got, fmt.Sprintf("want %v, got %v", tc.want.String(), got.String())) }) @@ -183,7 +183,7 @@ func TestTallyingLogic(t *testing.T) { require.False(t, shouldUpgrade) // should be false because upgrade height hasn't been reached. require.Equal(t, uint64(0), version) - ctx = ctx.WithBlockHeight(ctx.BlockHeight() + appconsts.DefaultUpgradeHeightDelay) + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + appconsts.UpgradeHeightDelay(version)) shouldUpgrade, version = upgradeKeeper.ShouldUpgrade(ctx) require.True(t, shouldUpgrade) // should be true because upgrade height has been reached. @@ -426,7 +426,7 @@ func TestGetUpgrade(t *testing.T) { got, err := upgradeKeeper.GetUpgrade(ctx, &types.QueryGetUpgradeRequest{}) require.NoError(t, err) assert.Equal(t, v2.Version, got.Upgrade.AppVersion) - assert.Equal(t, appconsts.DefaultUpgradeHeightDelay, got.Upgrade.UpgradeHeight) + assert.Equal(t, appconsts.UpgradeHeightDelay(v2.Version), got.Upgrade.UpgradeHeight) }) } @@ -452,7 +452,7 @@ func setup(t *testing.T) (signal.Keeper, sdk.Context, *mockStakingKeeper) { ) config := encoding.MakeConfig(app.ModuleEncodingRegisters...) - upgradeKeeper := signal.NewKeeper(config.Codec, signalStore, mockStakingKeeper, appconsts.DefaultUpgradeHeightDelay) + upgradeKeeper := signal.NewKeeper(config.Codec, signalStore, mockStakingKeeper) return upgradeKeeper, mockCtx, mockStakingKeeper } From 528fa8cceeeefdf5db695e3c32f4fe0bdbc374ed Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 16 Oct 2024 13:51:28 -0500 Subject: [PATCH 102/106] chore: delete appconsts.Timeouts --- pkg/appconsts/consensus_consts.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/appconsts/consensus_consts.go b/pkg/appconsts/consensus_consts.go index c26e4078eb..14944cbc88 100644 --- a/pkg/appconsts/consensus_consts.go +++ b/pkg/appconsts/consensus_consts.go @@ -3,11 +3,9 @@ package appconsts import "time" const ( - TimeoutPropose = time.Second * 10 - TimeoutCommit = time.Second * 11 // GoalBlockTime is the target time interval between blocks. Since the block // interval isn't enforced at consensus, the real block interval isn't // guaranteed to exactly match GoalBlockTime. GoalBlockTime is currently targeted // through static timeouts (i.e. TimeoutPropose, TimeoutCommit). - GoalBlockTime = time.Second * 15 + GoalBlockTime = time.Second * 6 ) From 9669f8c996b445637132231bff70ed1d53c0f6ab Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 16 Oct 2024 13:56:17 -0500 Subject: [PATCH 103/106] fix: MajorUpgradeToV3 --- test/e2e/major_upgrade_v3.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index e43ad48f83..74fa4884ab 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -163,16 +163,6 @@ func MajorUpgradeToV3(logger *log.Logger) error { continue } - if b.dur > appconsts.GetTimeoutCommit(b.block.Version.App) { - return fmt.Errorf( - "block was too slow for corresponding version: version %v duration %v upgrade height %v height %v", - b.block.Version.App, - b.dur, - preciseUpgradeHeight, - b.block.Height, - ) - } - if b.dur < appconsts.GetTimeoutCommit(b.block.Version.App) { return fmt.Errorf( "block was too fast for corresponding version: version %v duration %v upgrade height %v height %v", From 7383fa040c41036c9462d3cf3bffba69ca70ddcb Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 16 Oct 2024 13:59:35 -0500 Subject: [PATCH 104/106] use latest version instead of a commit --- test/e2e/major_upgrade_v3.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index 74fa4884ab..1c8ece5c24 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -39,12 +39,8 @@ func MajorUpgradeToV3(logger *log.Logger) error { defer testNet.Cleanup(ctx) - // HACKHACK: use a version of celestia-app built from a commit on this PR. - // This can be removed after the PR is merged to main and we override the - // upgrade height delay to one block in a new Docker image. - version := "8f57f47169ca1ec07d615f5078d35032d379e39a" - - logger.Println("Running major upgrade to v3 test", "version", version) + latestVersion, err := testnet.GetLatestVersion() + testnet.NoError("failed to get latest version", err) consensusParams := app.DefaultConsensusParams() consensusParams.Version.AppVersion = v2.Version // Start the test on v2 @@ -53,13 +49,13 @@ func MajorUpgradeToV3(logger *log.Logger) error { preloader, err := testNet.NewPreloader() testnet.NoError("failed to create preloader", err) - err = preloader.AddImage(ctx, testnet.DockerImageName(version)) + err = preloader.AddImage(ctx, testnet.DockerImageName(latestVersion)) testnet.NoError("failed to add image", err) defer func() { _ = preloader.EmptyImages(ctx) }() logger.Println("Creating genesis nodes") for i := 0; i < numNodes; i++ { - err := testNet.CreateGenesisNode(ctx, version, 10000000, 0, testnet.DefaultResources, true) + err := testNet.CreateGenesisNode(ctx, latestVersion, 10000000, 0, testnet.DefaultResources, true) testnet.NoError("failed to create genesis node", err) } @@ -70,7 +66,7 @@ func MajorUpgradeToV3(logger *log.Logger) error { upgradeHeightV3: v3.Version, } - err = testNet.CreateTxClient(ctx, "txsim", version, 1, "100-2000", 100, testnet.DefaultResources, endpoints[0], upgradeSchedule) + err = testNet.CreateTxClient(ctx, "txsim", latestVersion, 1, "100-2000", 100, testnet.DefaultResources, endpoints[0], upgradeSchedule) testnet.NoError("failed to create tx client", err) logger.Println("Setting up testnet") From bcf42234a53b7083087d4d8f0cbda44cc600dd84 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 16 Oct 2024 14:11:44 -0500 Subject: [PATCH 105/106] fix: check e2e for decrease in time --- test/e2e/major_upgrade_v3.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/e2e/major_upgrade_v3.go b/test/e2e/major_upgrade_v3.go index 1c8ece5c24..35cb79b045 100644 --- a/test/e2e/major_upgrade_v3.go +++ b/test/e2e/major_upgrade_v3.go @@ -18,7 +18,7 @@ import ( func MajorUpgradeToV3(logger *log.Logger) error { testName := "MajorUpgradeToV3" numNodes := 4 - upgradeHeightV3 := int64(10) + upgradeHeightV3 := int64(40) ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -169,6 +169,17 @@ func MajorUpgradeToV3(logger *log.Logger) error { ) } + // check if the time decreased for v3 + if b.block.Version.App == v3.Version && b.dur > appconsts.GetTimeoutCommit(b.block.Version.App)+5 { + return fmt.Errorf( + "block was too slow for corresponding version: version %v duration %v upgrade height %v height %v", + b.block.Version.App, + b.dur, + preciseUpgradeHeight, + b.block.Height, + ) + } + } if multipleRounds > 2 { From fbbd9e613628225edae690d91a2525ba8f50c15c Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 16 Oct 2024 14:24:41 -0500 Subject: [PATCH 106/106] fix: don't update the goal block time for now --- pkg/appconsts/consensus_consts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/appconsts/consensus_consts.go b/pkg/appconsts/consensus_consts.go index 14944cbc88..43aa335f93 100644 --- a/pkg/appconsts/consensus_consts.go +++ b/pkg/appconsts/consensus_consts.go @@ -7,5 +7,5 @@ const ( // interval isn't enforced at consensus, the real block interval isn't // guaranteed to exactly match GoalBlockTime. GoalBlockTime is currently targeted // through static timeouts (i.e. TimeoutPropose, TimeoutCommit). - GoalBlockTime = time.Second * 6 + GoalBlockTime = time.Second * 15 )