diff --git a/.github/auto_request_review.yml b/.github/auto_request_review.yml index fcaed3c592..a00957c0e3 100644 --- a/.github/auto_request_review.yml +++ b/.github/auto_request_review.yml @@ -12,7 +12,3 @@ options: ignored_keywords: - DO NOT REVIEW enable_group_assignment: false - - # Randomly pick reviewers up to this number. - # Do not set this option if you'd like to assign all matching reviewers. - number_of_reviewers: 2 diff --git a/app/ante/ante.go b/app/ante/ante.go index dd65fdd120..89b6c1d050 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -42,7 +42,7 @@ func NewAnteHandler( ante.NewValidateMemoDecorator(accountKeeper), // Ensure the tx's gas limit is > the gas consumed based on the tx size. // Side effect: consumes gas from the gas meter. - ante.NewConsumeGasForTxSizeDecorator(accountKeeper), + NewConsumeGasForTxSizeDecorator(accountKeeper), // Ensure the feepayer (fee granter or first signer) has enough funds to pay for the tx. // Ensure the gas price >= network min gas price if app version >= 2. // Side effect: deducts fees from the fee payer. Sets the tx priority in context. diff --git a/app/ante/min_fee_test.go b/app/ante/min_fee_test.go index 30912813c4..fc66e11a67 100644 --- a/app/ante/min_fee_test.go +++ b/app/ante/min_fee_test.go @@ -9,7 +9,6 @@ import ( "github.com/celestiaorg/celestia-app/v3/app/ante" "github.com/celestiaorg/celestia-app/v3/app/encoding" "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" - v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" "github.com/celestiaorg/celestia-app/v3/test/util/testnode" "github.com/celestiaorg/celestia-app/v3/x/minfee" "github.com/cosmos/cosmos-sdk/codec" @@ -58,7 +57,7 @@ func TestValidateTxFee(t *testing.T) { { name: "bad tx; fee below required minimum", fee: sdk.NewCoins(sdk.NewInt64Coin(appconsts.BondDenom, feeAmount-1)), - gasLimit: uint64(float64(feeAmount) / v2.NetworkMinGasPrice), + gasLimit: uint64(float64(feeAmount) / appconsts.DefaultNetworkMinGasPrice), appVersion: uint64(2), isCheckTx: false, expErr: true, @@ -66,7 +65,7 @@ func TestValidateTxFee(t *testing.T) { { name: "good tx; fee equal to required minimum", fee: sdk.NewCoins(sdk.NewInt64Coin(appconsts.BondDenom, feeAmount)), - gasLimit: uint64(float64(feeAmount) / v2.NetworkMinGasPrice), + gasLimit: uint64(float64(feeAmount) / appconsts.DefaultNetworkMinGasPrice), appVersion: uint64(2), isCheckTx: false, expErr: false, @@ -74,7 +73,7 @@ func TestValidateTxFee(t *testing.T) { { name: "good tx; fee above required minimum", fee: sdk.NewCoins(sdk.NewInt64Coin(appconsts.BondDenom, feeAmount+1)), - gasLimit: uint64(float64(feeAmount) / v2.NetworkMinGasPrice), + gasLimit: uint64(float64(feeAmount) / appconsts.DefaultNetworkMinGasPrice), appVersion: uint64(2), isCheckTx: false, expErr: false, @@ -82,7 +81,7 @@ func TestValidateTxFee(t *testing.T) { { name: "good tx; with no fee (v1)", fee: sdk.NewCoins(sdk.NewInt64Coin(appconsts.BondDenom, feeAmount)), - gasLimit: uint64(float64(feeAmount) / v2.NetworkMinGasPrice), + gasLimit: uint64(float64(feeAmount) / appconsts.DefaultNetworkMinGasPrice), appVersion: uint64(1), isCheckTx: false, expErr: false, @@ -143,7 +142,7 @@ func TestValidateTxFee(t *testing.T) { ctx = ctx.WithMinGasPrices(sdk.DecCoins{validatorMinGasPriceCoin}) - networkMinGasPriceDec, err := sdk.NewDecFromStr(fmt.Sprintf("%f", v2.NetworkMinGasPrice)) + networkMinGasPriceDec, err := sdk.NewDecFromStr(fmt.Sprintf("%f", appconsts.DefaultNetworkMinGasPrice)) require.NoError(t, err) subspace, _ := paramsKeeper.GetSubspace(minfee.ModuleName) diff --git a/app/ante/tx_size.go b/app/ante/tx_size.go new file mode 100644 index 0000000000..356f6f2646 --- /dev/null +++ b/app/ante/tx_size.go @@ -0,0 +1,151 @@ +package ante + +import ( + "encoding/hex" + + "cosmossdk.io/errors" + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" + v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" + "github.com/cosmos/cosmos-sdk/codec/legacy" + "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + "github.com/cosmos/cosmos-sdk/x/auth/ante" + "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + auth "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +var ( + // Simulation signature values used to estimate gas consumption. + key = make([]byte, secp256k1.PubKeySize) + simSecp256k1Pubkey = &secp256k1.PubKey{Key: key} + simSecp256k1Sig [64]byte +) + +func init() { + // Decodes a valid hex string into a sepc256k1Pubkey for use in transaction simulation + bz, _ := hex.DecodeString("035AD6810A47F073553FF30D2FCC7E0D3B1C0B74B61A1AAA2582344037151E143A") + copy(key, bz) + simSecp256k1Pubkey.Key = key +} + +// ConsumeTxSizeGasDecorator will take in parameters and consume gas proportional +// to the size of tx before calling next AnteHandler. Note, the gas costs will be +// slightly over estimated due to the fact that any given signing account may need +// to be retrieved from state. +// +// CONTRACT: If simulate=true, then signatures must either be completely filled +// in or empty. +// CONTRACT: To use this decorator, signatures of transaction must be represented +// as legacytx.StdSignature otherwise simulate mode will incorrectly estimate gas cost. + +// The code was copied from celestia's fork of the cosmos-sdk: +// https://github.com/celestiaorg/cosmos-sdk/blob/release/v0.46.x-celestia/x/auth/ante/basic.go +// In app versions v2 and below, the txSizeCostPerByte used for gas cost estimation is taken from the auth module. +// In app v3 and above, the versioned constant appconsts.TxSizeCostPerByte is used. +type ConsumeTxSizeGasDecorator struct { + ak ante.AccountKeeper +} + +func NewConsumeGasForTxSizeDecorator(ak ante.AccountKeeper) ConsumeTxSizeGasDecorator { + return ConsumeTxSizeGasDecorator{ + ak: ak, + } +} + +func (cgts ConsumeTxSizeGasDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { + sigTx, ok := tx.(authsigning.SigVerifiableTx) + if !ok { + return ctx, errors.Wrap(sdkerrors.ErrTxDecode, "invalid tx type") + } + params := cgts.ak.GetParams(ctx) + + consumeGasForTxSize(ctx, sdk.Gas(len(ctx.TxBytes())), params) + + // simulate gas cost for signatures in simulate mode + if simulate { + // in simulate mode, each element should be a nil signature + sigs, err := sigTx.GetSignaturesV2() + if err != nil { + return ctx, err + } + n := len(sigs) + + for i, signer := range sigTx.GetSigners() { + // if signature is already filled in, no need to simulate gas cost + if i < n && !isIncompleteSignature(sigs[i].Data) { + continue + } + + var pubkey cryptotypes.PubKey + + acc := cgts.ak.GetAccount(ctx, signer) + + // use placeholder simSecp256k1Pubkey if sig is nil + if acc == nil || acc.GetPubKey() == nil { + pubkey = simSecp256k1Pubkey + } else { + pubkey = acc.GetPubKey() + } + + // use stdsignature to mock the size of a full signature + simSig := legacytx.StdSignature{ //nolint:staticcheck // this will be removed when proto is ready + Signature: simSecp256k1Sig[:], + PubKey: pubkey, + } + + sigBz := legacy.Cdc.MustMarshal(simSig) + txBytes := sdk.Gas(len(sigBz) + 6) + + // If the pubkey is a multi-signature pubkey, then we estimate for the maximum + // number of signers. + if _, ok := pubkey.(*multisig.LegacyAminoPubKey); ok { + txBytes *= params.TxSigLimit + } + + consumeGasForTxSize(ctx, txBytes, params) + } + } + + return next(ctx, tx, simulate) +} + +// isIncompleteSignature tests whether SignatureData is fully filled in for simulation purposes +func isIncompleteSignature(data signing.SignatureData) bool { + if data == nil { + return true + } + + switch data := data.(type) { + case *signing.SingleSignatureData: + return len(data.Signature) == 0 + case *signing.MultiSignatureData: + if len(data.Signatures) == 0 { + return true + } + for _, s := range data.Signatures { + if isIncompleteSignature(s) { + return true + } + } + } + + return false +} + +// consumeGasForTxSize consumes gas based on the size of the transaction. +// It uses different parameters depending on the app version. +func consumeGasForTxSize(ctx sdk.Context, txBytes uint64, params auth.Params) { + // For app v2 and below we should get txSizeCostPerByte from auth module + if ctx.BlockHeader().Version.App <= v2.Version { + ctx.GasMeter().ConsumeGas(params.TxSizeCostPerByte*txBytes, "txSize") + } else { + // From v3 onwards, we should get txSizeCostPerByte from appconsts + txSizeCostPerByte := appconsts.TxSizeCostPerByte(ctx.BlockHeader().Version.App) + ctx.GasMeter().ConsumeGas(txSizeCostPerByte*txBytes, "txSize") + } +} diff --git a/app/ante/tx_size_test.go b/app/ante/tx_size_test.go new file mode 100644 index 0000000000..6b6bdbd80b --- /dev/null +++ b/app/ante/tx_size_test.go @@ -0,0 +1,197 @@ +package ante_test + +import ( + "fmt" + "strings" + "testing" + + "github.com/celestiaorg/celestia-app/v3/app" + "github.com/celestiaorg/celestia-app/v3/app/ante" + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" + v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" + testutil "github.com/celestiaorg/celestia-app/v3/test/util" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/tx" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/crypto/types/multisig" + "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/testutil/testdata" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + xauthsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/tendermint/tendermint/proto/tendermint/version" +) + +const TxSizeCostPerByte = 8 + +func setup() (*app.App, sdk.Context, client.Context, error) { + app, _, _ := testutil.NewTestAppWithGenesisSet(app.DefaultConsensusParams()) + ctx := app.NewContext(false, tmproto.Header{}) + params := authtypes.DefaultParams() + // Override default with a different TxSizeCostPerByte value for testing + params.TxSizeCostPerByte = TxSizeCostPerByte + app.AccountKeeper.SetParams(ctx, params) + ctx = ctx.WithBlockHeight(1) + + // Set up TxConfig. + encodingConfig := simapp.MakeTestEncodingConfig() + // We're using TestMsg encoding in the test, so register it here. + encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) + testdata.RegisterInterfaces(encodingConfig.InterfaceRegistry) + + clientCtx := client.Context{}. + WithTxConfig(encodingConfig.TxConfig) + + return app, ctx, clientCtx, nil +} + +func TestConsumeGasForTxSize(t *testing.T) { + app, ctx, clientCtx, err := setup() + require.NoError(t, err) + var txBuilder client.TxBuilder + + // keys and addresses + priv1, _, addr1 := testdata.KeyTestPubAddr() + + // msg and signatures + msg := testdata.NewTestMsg(addr1) + feeAmount := testdata.NewTestFeeAmount() + gasLimit := testdata.NewTestGasLimit() + + cgtsd := ante.NewConsumeGasForTxSizeDecorator(app.AccountKeeper) + antehandler := sdk.ChainAnteDecorators(cgtsd) + + testCases := []struct { + version uint64 + name string + sigV2 signing.SignatureV2 + }{ + {v2.Version, "SingleSignatureData v2", signing.SignatureV2{PubKey: priv1.PubKey()}}, + {v2.Version, "MultiSignatureData v2", signing.SignatureV2{PubKey: priv1.PubKey(), Data: multisig.NewMultisig(2)}}, + {appconsts.LatestVersion, fmt.Sprintf("SingleSignatureData v%d", appconsts.LatestVersion), signing.SignatureV2{PubKey: priv1.PubKey()}}, + {appconsts.LatestVersion, fmt.Sprintf("MultiSignatureData v%d", appconsts.LatestVersion), signing.SignatureV2{PubKey: priv1.PubKey(), Data: multisig.NewMultisig(2)}}, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + // set the version + ctx = app.NewContext(false, tmproto.Header{Version: version.Consensus{ + App: tc.version, + }}) + + txBuilder = clientCtx.TxConfig.NewTxBuilder() + require.NoError(t, txBuilder.SetMsgs(msg)) + txBuilder.SetFeeAmount(feeAmount) + txBuilder.SetGasLimit(gasLimit) + txBuilder.SetMemo(strings.Repeat("01234567890", 10)) + + privs, accNums, accSeqs := []cryptotypes.PrivKey{priv1}, []uint64{0}, []uint64{0} + tx, err := createTestTx(txBuilder, clientCtx, privs, accNums, accSeqs, ctx.ChainID()) + require.NoError(t, err) + + txBytes, err := clientCtx.TxConfig.TxJSONEncoder()(tx) + require.Nil(t, err, "Cannot marshal tx: %v", err) + + // expected TxSizeCostPerByte is different for each version + var txSizeCostPerByte uint64 + if tc.version == v2.Version { + txSizeCostPerByte = TxSizeCostPerByte + } else { + txSizeCostPerByte = appconsts.TxSizeCostPerByte(tc.version) + } + + expectedGas := sdk.Gas(len(txBytes)) * txSizeCostPerByte + + // set suite.ctx with TxBytes manually + ctx = ctx.WithTxBytes(txBytes) + + // track how much gas is necessary to retrieve parameters + beforeGas := ctx.GasMeter().GasConsumed() + app.AccountKeeper.GetParams(ctx) + afterGas := ctx.GasMeter().GasConsumed() + expectedGas += afterGas - beforeGas + + beforeGas = ctx.GasMeter().GasConsumed() + ctx, err = antehandler(ctx, tx, false) + require.Nil(t, err, "ConsumeTxSizeGasDecorator returned error: %v", err) + + // require that decorator consumes expected amount of gas + consumedGas := ctx.GasMeter().GasConsumed() - beforeGas + require.Equal(t, expectedGas, consumedGas, "Decorator did not consume the correct amount of gas") + + // simulation must not underestimate gas of this decorator even with nil signatures + txBuilder, err := clientCtx.TxConfig.WrapTxBuilder(tx) + require.NoError(t, err) + require.NoError(t, txBuilder.SetSignatures(tc.sigV2)) + tx = txBuilder.GetTx() + + simTxBytes, err := clientCtx.TxConfig.TxJSONEncoder()(tx) + require.Nil(t, err, "Cannot marshal tx: %v", err) + // require that simulated tx is smaller than tx with signatures + require.True(t, len(simTxBytes) < len(txBytes), "simulated tx still has signatures") + + // Set suite.ctx with smaller simulated TxBytes manually + ctx = ctx.WithTxBytes(simTxBytes) + + beforeSimGas := ctx.GasMeter().GasConsumed() + + // run antehandler with simulate=true + ctx, err = antehandler(ctx, tx, true) + consumedSimGas := ctx.GasMeter().GasConsumed() - beforeSimGas + + // require that antehandler passes and does not underestimate decorator cost + require.Nil(t, err, "ConsumeTxSizeGasDecorator returned error: %v", err) + require.True(t, consumedSimGas >= expectedGas, "Simulate mode underestimates gas on AnteDecorator. Simulated cost: %d, expected cost: %d", consumedSimGas, expectedGas) + }) + } +} + +// createTestTx creates a test tx given multiple inputs. +func createTestTx(txBuilder client.TxBuilder, clientCtx client.Context, privs []cryptotypes.PrivKey, accNums []uint64, accSeqs []uint64, chainID string) (xauthsigning.Tx, error) { + // First round: we gather all the signer infos. We use the "set empty + // signature" hack to do that. + sigsV2 := make([]signing.SignatureV2, 0, len(privs)) + for i, priv := range privs { + sigV2 := signing.SignatureV2{ + PubKey: priv.PubKey(), + Data: &signing.SingleSignatureData{ + SignMode: clientCtx.TxConfig.SignModeHandler().DefaultMode(), + Signature: nil, + }, + Sequence: accSeqs[i], + } + + sigsV2 = append(sigsV2, sigV2) + } + err := txBuilder.SetSignatures(sigsV2...) + if err != nil { + return nil, err + } + + // Second round: all signer infos are set, so each signer can sign. + sigsV2 = []signing.SignatureV2{} + for i, priv := range privs { + signerData := xauthsigning.SignerData{ + ChainID: chainID, + AccountNumber: accNums[i], + Sequence: accSeqs[i], + } + sigV2, err := tx.SignWithPrivKey( + clientCtx.TxConfig.SignModeHandler().DefaultMode(), signerData, + txBuilder, priv, clientCtx.TxConfig, accSeqs[i]) + if err != nil { + return nil, err + } + + sigsV2 = append(sigsV2, sigV2) + } + err = txBuilder.SetSignatures(sigsV2...) + if err != nil { + return nil, err + } + + return txBuilder.GetTx(), nil +} diff --git a/app/app.go b/app/app.go index 71c519305e..d31d33fcbf 100644 --- a/app/app.go +++ b/app/app.go @@ -12,6 +12,7 @@ import ( "github.com/celestiaorg/celestia-app/v3/app/posthandler" 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" "github.com/celestiaorg/celestia-app/v3/pkg/proof" blobkeeper "github.com/celestiaorg/celestia-app/v3/x/blob/keeper" blobtypes "github.com/celestiaorg/celestia-app/v3/x/blob/types" @@ -108,6 +109,7 @@ var maccPerms = map[string][]string{ const ( v1 = appv1.Version v2 = appv2.Version + v3 = appv3.Version DefaultInitialVersion = v1 ) @@ -340,11 +342,11 @@ func New( packetforwardkeeper.DefaultForwardTransferPacketTimeoutTimestamp, // forward timeout packetforwardkeeper.DefaultRefundTransferPacketTimeoutTimestamp, // refund timeout ) - // PacketForwardMiddleware is used only for version 2. - transferStack = module.NewVersionedIBCModule(packetForwardMiddleware, transferStack, v2, v2) + // PacketForwardMiddleware is used only for version >= 2. + transferStack = module.NewVersionedIBCModule(packetForwardMiddleware, transferStack, v2, v3) // Token filter wraps packet forward middleware and is thus the first module in the transfer stack. tokenFilterMiddelware := tokenfilter.NewIBCMiddleware(transferStack) - transferStack = module.NewVersionedIBCModule(tokenFilterMiddelware, transferStack, v1, v2) + transferStack = module.NewVersionedIBCModule(tokenFilterMiddelware, transferStack, v1, v3) app.EvidenceKeeper = *evidencekeeper.NewKeeper( appCodec, @@ -541,17 +543,8 @@ func (app *App) Info(req abci.RequestInfo) abci.ResponseInfo { // // Side-effect: calls baseapp.Init() func (app *App) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain) { - // genesis must always contain the consensus params. The validator set however is derived from the - // initial genesis state. The genesis must always contain a non zero app version which is the initial - // version that the chain starts on - if req.ConsensusParams == nil || req.ConsensusParams.Version == nil { - panic("no consensus params set") - } - if req.ConsensusParams.Version.AppVersion == 0 { - panic("app version 0 is not accepted. Please set an app version in the genesis") - } + req = setDefaultAppVersion(req) appVersion := req.ConsensusParams.Version.AppVersion - // mount the stores for the provided app version if it has not already been mounted if app.AppVersion() == 0 && !app.IsSealed() { app.mountKeysAndInit(appVersion) @@ -567,10 +560,26 @@ func (app *App) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain return res } +// setDefaultAppVersion sets the default app version in the consensus params if +// it was 0. This is needed because chains (e.x. mocha-4) did not explicitly set +// an app version in genesis.json. +func setDefaultAppVersion(req abci.RequestInitChain) abci.RequestInitChain { + if req.ConsensusParams == nil { + panic("no consensus params set") + } + if req.ConsensusParams.Version == nil { + panic("no version set in consensus params") + } + if req.ConsensusParams.Version.AppVersion == 0 { + req.ConsensusParams.Version.AppVersion = v1 + } + return req +} + // mountKeysAndInit mounts the keys for the provided app version and then // invokes baseapp.Init(). func (app *App) mountKeysAndInit(appVersion uint64) { - app.BaseApp.Logger().Debug(fmt.Sprintf("mounting KV stores for app version %v", appVersion)) + app.BaseApp.Logger().Info(fmt.Sprintf("mounting KV stores for app version %v", appVersion)) app.MountKVStores(app.versionedKeys(appVersion)) // Invoke load latest version for its side-effect of invoking baseapp.Init() @@ -585,9 +594,9 @@ func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.Res if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { panic(err) } - - app.UpgradeKeeper.SetModuleVersionMap(ctx, app.manager.GetVersionMap(req.ConsensusParams.Version.AppVersion)) - return app.manager.InitGenesis(ctx, app.appCodec, genesisState, req.ConsensusParams.Version.AppVersion) + appVersion := req.ConsensusParams.Version.AppVersion + app.UpgradeKeeper.SetModuleVersionMap(ctx, app.manager.GetVersionMap(appVersion)) + return app.manager.InitGenesis(ctx, app.appCodec, genesisState, appVersion) } // LoadHeight loads a particular height diff --git a/app/app_test.go b/app/app_test.go index 5e99ec522c..16bca43ec7 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -1,10 +1,13 @@ package app_test import ( + "encoding/json" "testing" "github.com/celestiaorg/celestia-app/v3/app" "github.com/celestiaorg/celestia-app/v3/app/encoding" + "github.com/celestiaorg/celestia-app/v3/test/util" + "github.com/celestiaorg/celestia-app/v3/test/util/testnode" "github.com/celestiaorg/celestia-app/v3/x/minfee" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/snapshots" @@ -13,6 +16,7 @@ import ( "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmdb "github.com/tendermint/tm-db" ) @@ -52,6 +56,61 @@ func TestNew(t *testing.T) { }) } +func TestInitChain(t *testing.T) { + logger := log.NewNopLogger() + db := tmdb.NewMemDB() + traceStore := &NoopWriter{} + invCheckPeriod := uint(1) + encodingConfig := encoding.MakeConfig(app.ModuleEncodingRegisters...) + upgradeHeight := int64(0) + appOptions := NoopAppOptions{} + testApp := app.New(logger, db, traceStore, invCheckPeriod, encodingConfig, upgradeHeight, appOptions) + genesisState, _, _ := util.GenesisStateWithSingleValidator(testApp, "account") + appStateBytes, err := json.MarshalIndent(genesisState, "", " ") + require.NoError(t, err) + genesis := testnode.DefaultConfig().Genesis + + type testCase struct { + name string + request abci.RequestInitChain + wantPanic bool + } + testCases := []testCase{ + { + name: "should panic if consensus params not set", + request: abci.RequestInitChain{}, + wantPanic: true, + }, + { + name: "should not panic on a genesis that does not contain an app version", + request: abci.RequestInitChain{ + Time: genesis.GenesisTime, + ChainId: genesis.ChainID, + ConsensusParams: &abci.ConsensusParams{ + Block: &abci.BlockParams{}, + Evidence: &genesis.ConsensusParams.Evidence, + Validator: &genesis.ConsensusParams.Validator, + Version: &tmproto.VersionParams{}, // explicitly set to empty to remove app version., + }, + AppStateBytes: appStateBytes, + InitialHeight: 0, + }, + wantPanic: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + application := app.New(logger, db, traceStore, invCheckPeriod, encodingConfig, upgradeHeight, appOptions) + if tc.wantPanic { + assert.Panics(t, func() { application.InitChain(tc.request) }) + } else { + assert.NotPanics(t, func() { application.InitChain(tc.request) }) + } + }) + } +} + func TestOfferSnapshot(t *testing.T) { logger := log.NewNopLogger() db := tmdb.NewMemDB() diff --git a/app/check_tx.go b/app/check_tx.go index 0867cd2436..f76b37880f 100644 --- a/app/check_tx.go +++ b/app/check_tx.go @@ -41,9 +41,8 @@ func (app *App) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx { switch req.Type { // new transactions must be checked in their entirety case abci.CheckTxType_New: - // FIXME: we have a hardcoded subtree root threshold here. This is because we can't access - // the app version because the context is not initialized - err := blobtypes.ValidateBlobTx(app.txConfig, btx, appconsts.DefaultSubtreeRootThreshold) + appVersion := app.AppVersion() + err := blobtypes.ValidateBlobTx(app.txConfig, btx, appconsts.SubtreeRootThreshold(appVersion), appVersion) if err != nil { return sdkerrors.ResponseCheckTxWithEvents(err, 0, 0, []abci.Event{}, false) } diff --git a/app/module/versioned_ibc_module_test.go b/app/module/versioned_ibc_module_test.go index 8d2fb23d0e..57f94ec9f9 100644 --- a/app/module/versioned_ibc_module_test.go +++ b/app/module/versioned_ibc_module_test.go @@ -23,7 +23,7 @@ func TestVersionedIBCModule(t *testing.T) { mockWrappedModule := mocks.NewMockIBCModule(ctrl) mockNextModule := mocks.NewMockIBCModule(ctrl) - versionedModule := module.NewVersionedIBCModule(mockWrappedModule, mockNextModule, 2, 2) + versionedModule := module.NewVersionedIBCModule(mockWrappedModule, mockNextModule, 2, 3) testCases := []struct { name string diff --git a/app/modules.go b/app/modules.go index a89f418205..d629a99073 100644 --- a/app/modules.go +++ b/app/modules.go @@ -96,75 +96,75 @@ func (app *App) setupModuleManager(skipGenesisInvariants bool) error { app.manager, err = module.NewManager([]module.VersionedModule{ { Module: genutil.NewAppModule(app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx, app.txConfig), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: auth.NewAppModule(app.appCodec, app.AccountKeeper, nil), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: bank.NewAppModule(app.appCodec, app.BankKeeper, app.AccountKeeper), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: capability.NewAppModule(app.appCodec, *app.CapabilityKeeper), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: feegrantmodule.NewAppModule(app.appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: gov.NewAppModule(app.appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: mint.NewAppModule(app.appCodec, app.MintKeeper, app.AccountKeeper), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: slashing.NewAppModule(app.appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: distr.NewAppModule(app.appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: staking.NewAppModule(app.appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: evidence.NewAppModule(app.EvidenceKeeper), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: authzmodule.NewAppModule(app.appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: ibc.NewAppModule(app.IBCKeeper), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: params.NewAppModule(app.ParamsKeeper), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: transfer.NewAppModule(app.TransferKeeper), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: blob.NewAppModule(app.appCodec, app.BlobKeeper), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v3, }, { Module: blobstream.NewAppModule(app.appCodec, app.BlobstreamKeeper), @@ -172,19 +172,19 @@ func (app *App) setupModuleManager(skipGenesisInvariants bool) error { }, { Module: signal.NewAppModule(app.SignalKeeper), - FromVersion: v2, ToVersion: v2, + FromVersion: v2, ToVersion: v3, }, { Module: minfee.NewAppModule(app.ParamsKeeper), - FromVersion: v2, ToVersion: v2, + FromVersion: v2, ToVersion: v3, }, { Module: packetforward.NewAppModule(app.PacketForwardKeeper), - FromVersion: v2, ToVersion: v2, + FromVersion: v2, ToVersion: v3, }, { Module: ica.NewAppModule(nil, &app.ICAHostKeeper), - FromVersion: v2, ToVersion: v2, + FromVersion: v2, ToVersion: v3, }, }) if err != nil { @@ -303,7 +303,7 @@ func allStoreKeys() []string { // versionedStoreKeys returns the store keys for each app version. func versionedStoreKeys() map[uint64][]string { return map[uint64][]string{ - 1: { + v1: { authtypes.StoreKey, authzkeeper.StoreKey, banktypes.StoreKey, @@ -321,7 +321,7 @@ func versionedStoreKeys() map[uint64][]string { stakingtypes.StoreKey, upgradetypes.StoreKey, }, - 2: { + v2: { authtypes.StoreKey, authzkeeper.StoreKey, banktypes.StoreKey, @@ -341,6 +341,26 @@ func versionedStoreKeys() map[uint64][]string { stakingtypes.StoreKey, upgradetypes.StoreKey, }, + v3: { // same as v2 + authtypes.StoreKey, + authzkeeper.StoreKey, + banktypes.StoreKey, + blobtypes.StoreKey, + capabilitytypes.StoreKey, + distrtypes.StoreKey, + evidencetypes.StoreKey, + feegrant.StoreKey, + govtypes.StoreKey, + ibchost.StoreKey, + ibctransfertypes.StoreKey, + icahosttypes.StoreKey, + minttypes.StoreKey, + packetforwardtypes.StoreKey, + signaltypes.StoreKey, + slashingtypes.StoreKey, + stakingtypes.StoreKey, + upgradetypes.StoreKey, + }, } } diff --git a/app/prepare_proposal.go b/app/prepare_proposal.go index 78049a1ad4..a34c64bd7d 100644 --- a/app/prepare_proposal.go +++ b/app/prepare_proposal.go @@ -1,13 +1,16 @@ package app import ( + "fmt" "time" "github.com/celestiaorg/celestia-app/v3/app/ante" "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" "github.com/celestiaorg/celestia-app/v3/pkg/da" - square "github.com/celestiaorg/go-square/v2" - "github.com/celestiaorg/go-square/v2/share" + shares "github.com/celestiaorg/go-square/shares" + square "github.com/celestiaorg/go-square/square" + squarev2 "github.com/celestiaorg/go-square/v2" + sharev2 "github.com/celestiaorg/go-square/v2/share" "github.com/cosmos/cosmos-sdk/telemetry" abci "github.com/tendermint/tendermint/abci/types" core "github.com/tendermint/tendermint/proto/tendermint/types" @@ -27,7 +30,7 @@ func (app *App) PrepareProposal(req abci.RequestPrepareProposal) abci.ResponsePr Height: req.Height, Time: req.Time, Version: version.Consensus{ - App: app.BaseApp.AppVersion(), + App: app.AppVersion(), }, }) handler := ante.NewAnteHandler( @@ -47,10 +50,31 @@ func (app *App) PrepareProposal(req abci.RequestPrepareProposal) abci.ResponsePr // Build the square from the set of valid and prioritised transactions. // The txs returned are the ones used in the square and block. - dataSquare, txs, err := square.Build(txs, - app.MaxEffectiveSquareSize(sdkCtx), - appconsts.SubtreeRootThreshold(app.GetBaseApp().AppVersion()), + var ( + dataSquareBytes [][]byte + err error + size uint64 ) + switch app.AppVersion() { + case v3: + var dataSquare squarev2.Square + dataSquare, txs, err = squarev2.Build(txs, + app.MaxEffectiveSquareSize(sdkCtx), + appconsts.SubtreeRootThreshold(app.GetBaseApp().AppVersion()), + ) + dataSquareBytes = sharev2.ToBytes(dataSquare) + size = uint64(dataSquare.Size()) + case v2, v1: + var dataSquare square.Square + dataSquare, txs, err = square.Build(txs, + app.MaxEffectiveSquareSize(sdkCtx), + appconsts.SubtreeRootThreshold(app.GetBaseApp().AppVersion()), + ) + dataSquareBytes = shares.ToBytes(dataSquare) + size = uint64(dataSquare.Size()) + default: + err = fmt.Errorf("unsupported app version: %d", app.AppVersion()) + } if err != nil { panic(err) } @@ -58,7 +82,7 @@ func (app *App) PrepareProposal(req abci.RequestPrepareProposal) abci.ResponsePr // Erasure encode the data square to create the extended data square (eds). // Note: uses the nmt wrapper to construct the tree. See // pkg/wrapper/nmt_wrapper.go for more information. - eds, err := da.ExtendShares(share.ToBytes(dataSquare)) + eds, err := da.ExtendShares(dataSquareBytes) if err != nil { app.Logger().Error( "failure to erasure the data square while creating a proposal block", @@ -84,7 +108,7 @@ func (app *App) PrepareProposal(req abci.RequestPrepareProposal) abci.ResponsePr return abci.ResponsePrepareProposal{ BlockData: &core.Data{ Txs: txs, - SquareSize: uint64(dataSquare.Size()), + SquareSize: size, Hash: dah.Hash(), // also known as the data root }, } diff --git a/app/process_proposal.go b/app/process_proposal.go index d1b367179c..fc10bb88e2 100644 --- a/app/process_proposal.go +++ b/app/process_proposal.go @@ -9,8 +9,10 @@ import ( "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" "github.com/celestiaorg/celestia-app/v3/pkg/da" blobtypes "github.com/celestiaorg/celestia-app/v3/x/blob/types" - "github.com/celestiaorg/go-square/v2" - "github.com/celestiaorg/go-square/v2/share" + shares "github.com/celestiaorg/go-square/shares" + square "github.com/celestiaorg/go-square/square" + squarev2 "github.com/celestiaorg/go-square/v2" + sharev2 "github.com/celestiaorg/go-square/v2/share" blobtx "github.com/celestiaorg/go-square/v2/tx" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" @@ -108,7 +110,7 @@ func (app *App) ProcessProposal(req abci.RequestProcessProposal) (resp abci.Resp // - that the sizes match // - that the namespaces match between blob and PFB // - that the share commitment is correct - if err := blobtypes.ValidateBlobTx(app.txConfig, blobTx, subtreeRootThreshold); err != nil { + if err := blobtypes.ValidateBlobTx(app.txConfig, blobTx, subtreeRootThreshold, app.AppVersion()); err != nil { logInvalidPropBlockError(app.Logger(), req.Header, fmt.Sprintf("invalid blob tx %d", idx), err) return reject() } @@ -122,24 +124,40 @@ func (app *App) ProcessProposal(req abci.RequestProcessProposal) (resp abci.Resp } - // Construct the data square from the block's transactions - dataSquare, err := square.Construct( - req.BlockData.Txs, - app.MaxEffectiveSquareSize(sdkCtx), - subtreeRootThreshold, + var ( + dataSquareBytes [][]byte + err error ) - if err != nil { - logInvalidPropBlockError(app.Logger(), req.Header, "failure to compute data square from transactions:", err) + + switch app.AppVersion() { + case v3: + var dataSquare squarev2.Square + dataSquare, err = squarev2.Construct(req.BlockData.Txs, app.MaxEffectiveSquareSize(sdkCtx), subtreeRootThreshold) + dataSquareBytes = sharev2.ToBytes(dataSquare) + // Assert that the square size stated by the proposer is correct + if uint64(dataSquare.Size()) != req.BlockData.SquareSize { + logInvalidPropBlock(app.Logger(), req.Header, "proposed square size differs from calculated square size") + return reject() + } + case v2, v1: + var dataSquare square.Square + dataSquare, err = square.Construct(req.BlockData.Txs, app.MaxEffectiveSquareSize(sdkCtx), subtreeRootThreshold) + dataSquareBytes = shares.ToBytes(dataSquare) + // Assert that the square size stated by the proposer is correct + if uint64(dataSquare.Size()) != req.BlockData.SquareSize { + logInvalidPropBlock(app.Logger(), req.Header, "proposed square size differs from calculated square size") + return reject() + } + default: + logInvalidPropBlock(app.Logger(), req.Header, "unsupported app version") return reject() } - - // Assert that the square size stated by the proposer is correct - if uint64(dataSquare.Size()) != req.BlockData.SquareSize { - logInvalidPropBlock(app.Logger(), req.Header, "proposed square size differs from calculated square size") + if err != nil { + logInvalidPropBlockError(app.Logger(), req.Header, "failure to compute data square from transactions:", err) return reject() } - eds, err := da.ExtendShares(share.ToBytes(dataSquare)) + eds, err := da.ExtendShares(dataSquareBytes) if err != nil { logInvalidPropBlockError(app.Logger(), req.Header, "failure to erasure the data square", err) return reject() diff --git a/app/test/std_sdk_test.go b/app/test/std_sdk_test.go index 75eb932b3f..dc54a030d0 100644 --- a/app/test/std_sdk_test.go +++ b/app/test/std_sdk_test.go @@ -8,7 +8,7 @@ import ( "github.com/celestiaorg/celestia-app/v3/app" "github.com/celestiaorg/celestia-app/v3/app/encoding" "github.com/celestiaorg/celestia-app/v3/app/grpc/tx" - v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" "github.com/celestiaorg/celestia-app/v3/pkg/user" "github.com/celestiaorg/celestia-app/v3/test/util/blobfactory" "github.com/celestiaorg/celestia-app/v3/test/util/testfactory" @@ -307,7 +307,7 @@ func (s *StandardSDKIntegrationTestSuite) TestStandardSDK() { name: "signal a version change", msgFunc: func() (msgs []sdk.Msg, signer string) { valAccount := s.getValidatorAccount() - msg := signal.NewMsgSignalVersion(valAccount, 2) + msg := signal.NewMsgSignalVersion(valAccount, appconsts.LatestVersion+1) return []sdk.Msg{msg}, s.getValidatorName() }, expectedCode: abci.CodeTypeOK, @@ -349,7 +349,7 @@ func (s *StandardSDKIntegrationTestSuite) TestGRPCQueries() { require.NoError(t, err) got, err := resp.NetworkMinGasPrice.Float64() require.NoError(t, err) - assert.Equal(t, v2.NetworkMinGasPrice, got) + assert.Equal(t, appconsts.DefaultNetworkMinGasPrice, got) }) t.Run("testnode can query local min gas price", func(t *testing.T) { serviceClient := nodeservice.NewServiceClient(s.cctx.GRPCClient) diff --git a/app/test/upgrade_test.go b/app/test/upgrade_test.go index 55de8fc486..459a33aefc 100644 --- a/app/test/upgrade_test.go +++ b/app/test/upgrade_test.go @@ -1,21 +1,28 @@ package app_test import ( - "encoding/json" "fmt" "strings" "testing" - "time" app "github.com/celestiaorg/celestia-app/v3/app" "github.com/celestiaorg/celestia-app/v3/app/encoding" + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" 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" + "github.com/celestiaorg/celestia-app/v3/pkg/user" "github.com/celestiaorg/celestia-app/v3/test/util" + "github.com/celestiaorg/celestia-app/v3/test/util/genesis" + "github.com/celestiaorg/celestia-app/v3/test/util/testnode" blobstreamtypes "github.com/celestiaorg/celestia-app/v3/x/blobstream/types" "github.com/celestiaorg/celestia-app/v3/x/minfee" - "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/celestiaorg/celestia-app/v3/x/signal" + signaltypes "github.com/celestiaorg/celestia-app/v3/x/signal/types" + "github.com/celestiaorg/go-square/v2/share" + "github.com/celestiaorg/go-square/v2/tx" sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/params/types/proposal" packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6/packetforward/types" icahosttypes "github.com/cosmos/ibc-go/v6/modules/apps/27-interchain-accounts/host/types" @@ -27,10 +34,119 @@ import ( dbm "github.com/tendermint/tm-db" ) -// TestAppUpgrades verifies that the all module's params are overridden during an +func TestAppUpgradeV3(t *testing.T) { + if testing.Short() { + t.Skip("skipping TestAppUpgradeV3 in short mode") + } + testApp, genesis := SetupTestAppWithUpgradeHeight(t, 3) + upgradeFromV1ToV2(t, testApp) + + ctx := testApp.NewContext(true, tmproto.Header{}) + validators := testApp.StakingKeeper.GetAllValidators(ctx) + valAddr, err := sdk.ValAddressFromBech32(validators[0].OperatorAddress) + require.NoError(t, err) + record, err := genesis.Keyring().Key(testnode.DefaultValidatorAccountName) + require.NoError(t, err) + accAddr, err := record.GetAddress() + require.NoError(t, err) + encCfg := encoding.MakeConfig(app.ModuleEncodingRegisters...) + resp, err := testApp.AccountKeeper.Account(ctx, &authtypes.QueryAccountRequest{ + Address: accAddr.String(), + }) + require.NoError(t, err) + var account authtypes.AccountI + err = encCfg.InterfaceRegistry.UnpackAny(resp.Account, &account) + require.NoError(t, err) + + signer, err := user.NewSigner( + genesis.Keyring(), encCfg.TxConfig, testApp.GetChainID(), v3.Version, + user.NewAccount(testnode.DefaultValidatorAccountName, account.GetAccountNumber(), account.GetSequence()), + ) + require.NoError(t, err) + + upgradeTx, err := signer.CreateTx( + []sdk.Msg{ + signaltypes.NewMsgSignalVersion(valAddr, 3), + signaltypes.NewMsgTryUpgrade(accAddr), + }, + user.SetGasLimitAndGasPrice(100_000, appconsts.DefaultMinGasPrice), + ) + require.NoError(t, err) + testApp.BeginBlock(abci.RequestBeginBlock{ + Header: tmproto.Header{ + ChainID: genesis.ChainID, + Height: 3, + Version: tmversion.Consensus{App: 2}, + }, + }) + + deliverTxResp := testApp.DeliverTx(abci.RequestDeliverTx{ + Tx: upgradeTx, + }) + require.Equal(t, abci.CodeTypeOK, deliverTxResp.Code, deliverTxResp.Log) + + endBlockResp := testApp.EndBlock(abci.RequestEndBlock{ + Height: 3, + }) + require.Equal(t, v2.Version, endBlockResp.ConsensusParamUpdates.Version.AppVersion) + testApp.Commit() + require.NoError(t, signer.IncrementSequence(testnode.DefaultValidatorAccountName)) + + ctx = testApp.NewContext(true, tmproto.Header{}) + getUpgradeResp, err := testApp.SignalKeeper.GetUpgrade(ctx, &signaltypes.QueryGetUpgradeRequest{}) + require.NoError(t, err) + require.Equal(t, v3.Version, getUpgradeResp.Upgrade.AppVersion) + + // brace yourselfs, this part may take a while + initialHeight := int64(4) + for height := initialHeight; height < initialHeight+signal.DefaultUpgradeHeightDelay; height++ { + _ = testApp.BeginBlock(abci.RequestBeginBlock{ + Header: tmproto.Header{ + Height: height, + Version: tmversion.Consensus{App: 2}, + }, + }) + + endBlockResp = testApp.EndBlock(abci.RequestEndBlock{ + Height: 3 + signal.DefaultUpgradeHeightDelay, + }) + + _ = testApp.Commit() + } + require.Equal(t, v3.Version, endBlockResp.ConsensusParamUpdates.Version.AppVersion) + + // confirm that an authored blob tx works + blob, err := share.NewV1Blob(share.RandomBlobNamespace(), []byte("hello world"), accAddr.Bytes()) + require.NoError(t, err) + blobTxBytes, _, err := signer.CreatePayForBlobs( + testnode.DefaultValidatorAccountName, + []*share.Blob{blob}, + user.SetGasLimitAndGasPrice(200_000, appconsts.DefaultMinGasPrice), + ) + require.NoError(t, err) + blobTx, _, err := tx.UnmarshalBlobTx(blobTxBytes) + require.NoError(t, err) + + _ = testApp.BeginBlock(abci.RequestBeginBlock{ + Header: tmproto.Header{ + ChainID: genesis.ChainID, + Height: initialHeight + signal.DefaultUpgradeHeightDelay, + Version: tmversion.Consensus{App: 3}, + }, + }) + + deliverTxResp = testApp.DeliverTx(abci.RequestDeliverTx{ + Tx: blobTx.Tx, + }) + require.Equal(t, abci.CodeTypeOK, deliverTxResp.Code, deliverTxResp.Log) + + _ = testApp.EndBlock(abci.RequestEndBlock{}) +} + +// TestAppUpgradeV2 verifies that the all module's params are overridden during an // upgrade from v1 -> v2 and the app version changes correctly. -func TestAppUpgrades(t *testing.T) { - NetworkMinGasPriceDec, err := sdk.NewDecFromStr(fmt.Sprintf("%f", v2.NetworkMinGasPrice)) +func TestAppUpgradeV2(t *testing.T) { + NetworkMinGasPriceDec, err := sdk.NewDecFromStr(fmt.Sprintf("%f", appconsts.DefaultNetworkMinGasPrice)) require.NoError(t, err) tests := []struct { @@ -122,19 +238,18 @@ func TestBlobstreamRemovedInV2(t *testing.T) { require.Error(t, err) } -func SetupTestAppWithUpgradeHeight(t *testing.T, upgradeHeight int64) (*app.App, keyring.Keyring) { +func SetupTestAppWithUpgradeHeight(t *testing.T, upgradeHeight int64) (*app.App, *genesis.Genesis) { t.Helper() db := dbm.NewMemDB() - chainID := "test_chain" encCfg := encoding.MakeConfig(app.ModuleEncodingRegisters...) testApp := app.New(log.NewNopLogger(), db, nil, 0, encCfg, upgradeHeight, util.EmptyAppOptions{}) - genesisState, _, kr := util.GenesisStateWithSingleValidator(testApp, "account") - stateBytes, err := json.MarshalIndent(genesisState, "", " ") + genesis := genesis.NewDefaultGenesis(). + WithValidators(genesis.NewDefaultValidator(testnode.DefaultValidatorAccountName)). + WithConsensusParams(app.DefaultInitialConsensusParams()) + genDoc, err := genesis.Export() require.NoError(t, err) - infoResp := testApp.Info(abci.RequestInfo{}) - require.EqualValues(t, 0, infoResp.AppVersion) - cp := app.DefaultInitialConsensusParams() + cp := genDoc.ConsensusParams abciParams := &abci.ConsensusParams{ Block: &abci.BlockParams{ MaxBytes: cp.Block.MaxBytes, @@ -147,23 +262,23 @@ func SetupTestAppWithUpgradeHeight(t *testing.T, upgradeHeight int64) (*app.App, _ = testApp.InitChain( abci.RequestInitChain{ - Time: time.Now(), + Time: genDoc.GenesisTime, Validators: []abci.ValidatorUpdate{}, ConsensusParams: abciParams, - AppStateBytes: stateBytes, - ChainId: chainID, + AppStateBytes: genDoc.AppState, + ChainId: genDoc.ChainID, }, ) // assert that the chain starts with version provided in genesis - infoResp = testApp.Info(abci.RequestInfo{}) + infoResp := testApp.Info(abci.RequestInfo{}) require.EqualValues(t, app.DefaultInitialConsensusParams().Version.AppVersion, infoResp.AppVersion) - supportedVersions := []uint64{v1.Version, v2.Version} + supportedVersions := []uint64{v1.Version, v2.Version, v3.Version} require.Equal(t, supportedVersions, testApp.SupportedVersions()) _ = testApp.Commit() - return testApp, kr + return testApp, genesis } func upgradeFromV1ToV2(t *testing.T, testApp *app.App) { diff --git a/cmd/celestia-appd/cmd/start.go b/cmd/celestia-appd/cmd/start.go index 04c64173c3..763f1b6cd5 100644 --- a/cmd/celestia-appd/cmd/start.go +++ b/cmd/celestia-appd/cmd/start.go @@ -4,7 +4,6 @@ package cmd // start command flag. import ( - "errors" "fmt" "io" "net" @@ -566,37 +565,30 @@ func addCommands( ) } -// checkBBR checks is bbr is configured to be used as a congestion control algo. +// checkBBR checks if BBR is enabled. func checkBBR(command *cobra.Command) error { const ( - errorMsg = ` -// The BBR congestion control algorithm does not appear to be enabled in this -// system's kernel. This is important for the p2p stack to be performant. -// -// to enable bbr call: -// + warning = ` +The BBR (Bottleneck Bandwidth and Round-trip propagation time) congestion control algorithm is not enabled in this system's kernel. +BBR is important for the performance of the p2p stack. + +To enable BBR: sudo modprobe tcp_bbr net.core.default_qdisc=fq net.ipv4.tcp_congestion_control=bbr sudo sysctl -p -// -// and can be verified to be running using -// + +Then verify BBR is enabled: sysctl net.ipv4.tcp_congestion_control -// This might not work for all systems, you might have to search online to -// figure out how to enable bbr for your system. -// -// While this node will get worse performance using something other than bbr, -// If you need to bypass this block use the "--force-no-bbr true" flag. - ` +This node will get worse p2p performance using a different congestion control algorithm. +If you need to bypass this check use the --force-no-bbr flag. +` ) - noBBRErr := errors.New(errorMsg) - forceNoBBR, err := command.Flags().GetBool(FlagForceNoBBR) if err != nil { - return noBBRErr + return err } if forceNoBBR { return nil @@ -605,11 +597,13 @@ sysctl net.ipv4.tcp_congestion_control cmd := exec.Command("sysctl", "net.ipv4.tcp_congestion_control") output, err := cmd.Output() if err != nil { - return err + fmt.Print(warning) + return fmt.Errorf("failed to execute 'sysctl net.ipv4.tcp_congestion_control' %w", err) } if !strings.Contains(string(output), "bbr") { - return noBBRErr + fmt.Print(warning) + return fmt.Errorf("BBR not enabled because output %v does not contain 'bbr'", string(output)) } return nil diff --git a/docs/maintainers/release-guide.md b/docs/maintainers/release-guide.md index 7260e95192..33d181aaab 100644 --- a/docs/maintainers/release-guide.md +++ b/docs/maintainers/release-guide.md @@ -27,7 +27,7 @@ The target audience for this guide is maintainers of this repo. In general, the ## Official Release -Follow the [creating a release candidate](#creating-a-release-candidate) section with the following considerations: +Follow the [creating a release candidate](#creating-a-release-candidate) section with the following considerations: - The version tag should not include the `-rc` suffix. - The release notes should contain an **Upgrade Notice** section with notable changes for node operators or library consumers. diff --git a/docs/release-notes/release-notes.md b/docs/release-notes/release-notes.md index 5cc49d1010..c5031566e5 100644 --- a/docs/release-notes/release-notes.md +++ b/docs/release-notes/release-notes.md @@ -8,7 +8,7 @@ This guide provides notes for major version releases. These notes may be helpful If you are a consensus node operator, please follow the communication channels listed under [network upgrades](https://docs.celestia.org/nodes/participate#network-upgrades) to learn when this release is recommended for each network (e.g. Mocha, Mainnet Beta). -Consensus node operators are expected to upgrade to this release _prior_ to the Lemongrass hardfork if they intend to continue participating in the network. The command used to start the [consensus node](https://docs.celestia.org/nodes/consensus-node#start-the-consensus-node) or [validator node](https://docs.celestia.org/nodes/validator-node#run-the-validator-node) will accept an additional `--v2-upgrade-height` flag. See [this table](https://docs.celestia.org/nodes/hardfork-process#lemongrass-hardfork) for upgrade heights for each network. +Consensus node operators are expected to upgrade to this release _prior_ to the Lemongrass hardfork if they intend to continue participating in the network. The command used to start the [consensus node](https://docs.celestia.org/nodes/consensus-node#start-the-consensus-node) or [validator node](https://docs.celestia.org/nodes/validator-node#run-the-validator-node) will accept an additional `--v2-upgrade-height` flag. See [this table](https://docs.celestia.org/nodes/network-upgrade-process#lemongrass-network-upgrade) for upgrade heights for each network. Consensus node operators should enable the BBR (Bottleneck Bandwidth and Round-trip propagation time) congestion control algorithm. See [#3812](https://github.com/celestiaorg/celestia-app/pull/3812). diff --git a/go.mod b/go.mod index b6b9b48739..5802cd499f 100644 --- a/go.mod +++ b/go.mod @@ -6,8 +6,9 @@ require ( cosmossdk.io/errors v1.0.1 cosmossdk.io/math v1.3.0 github.com/celestiaorg/blobstream-contracts/v3 v3.1.0 - github.com/celestiaorg/go-square/v2 v2.0.0-rc2 - github.com/celestiaorg/knuu v0.14.0 + github.com/celestiaorg/go-square v1.1.0 + github.com/celestiaorg/go-square/v2 v2.0.0 + github.com/celestiaorg/knuu v0.15.2 github.com/celestiaorg/nmt v0.22.1 github.com/celestiaorg/rsmt2d v0.14.0 github.com/cosmos/cosmos-proto v1.0.0-beta.5 @@ -30,10 +31,11 @@ require ( github.com/tendermint/tendermint v0.34.29 github.com/tendermint/tm-db v0.6.7 golang.org/x/exp v0.0.0-20240213143201-ec583247a57a - google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 - google.golang.org/grpc v1.65.0 + 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 gopkg.in/yaml.v2 v2.4.0 + k8s.io/apimachinery v0.31.1 ) require ( @@ -83,27 +85,25 @@ 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.5.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 github.com/ethereum/c-kzg-4844 v1.0.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect + github.com/go-ini/ini v1.67.0 // indirect 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 github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-openapi/swag v0.22.4 // indirect github.com/go-playground/validator/v10 v10.11.2 // indirect - github.com/goccy/go-json v0.10.2 // indirect + github.com/goccy/go-json v0.10.3 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/gateway v1.1.0 // indirect github.com/golang/glog v1.2.1 // indirect @@ -121,8 +121,8 @@ require ( github.com/gorilla/handlers v1.5.2 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grafana/otel-profiling-go v0.5.1 // indirect - github.com/grafana/pyroscope-go v1.1.1 // indirect - github.com/grafana/pyroscope-go/godeltaprof v0.1.6 // indirect + github.com/grafana/pyroscope-go v1.1.2 // indirect + github.com/grafana/pyroscope-go/godeltaprof v0.1.8 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect @@ -143,11 +143,10 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/joho/godotenv v1.5.1 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.6 // indirect - github.com/klauspost/cpuid/v2 v2.2.7 // indirect + 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/libp2p/go-buffer-pool v0.1.0 // indirect @@ -160,20 +159,18 @@ require ( github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/minio/md5-simd v1.1.2 // indirect - github.com/minio/minio-go/v7 v7.0.70 // indirect + github.com/minio/minio-go/v7 v7.0.74 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect - github.com/moby/docker-image-spec v1.3.1 // indirect - github.com/moby/spdystream v0.2.0 // indirect + github.com/moby/spdystream v0.4.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/onsi/ginkgo v1.16.5 // indirect - github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect github.com/pkg/errors v0.9.1 // indirect @@ -203,6 +200,7 @@ require ( github.com/tklauser/numcpus v0.6.1 // indirect github.com/ugorji/go/codec v1.2.9 // indirect github.com/ulikunitz/xz v0.5.10 // indirect + github.com/x448/float16 v0.8.4 // indirect github.com/zondax/hid v0.9.2 // indirect github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.6 // indirect @@ -210,34 +208,31 @@ require ( 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/exporters/otlp/otlptrace v1.24.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/proto/otlp v1.1.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.23.0 // indirect - golang.org/x/net v0.25.0 // indirect - golang.org/x/oauth2 v0.20.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/term v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/crypto v0.26.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/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-20240528184218-531527333157 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.28.2 // indirect - k8s.io/apimachinery v0.28.2 // indirect - k8s.io/client-go v0.28.2 // indirect - k8s.io/klog/v2 v2.120.1 // indirect + k8s.io/api v0.30.2 // indirect + k8s.io/client-go v0.30.2 // indirect + k8s.io/klog/v2 v2.130.1 // indirect k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect - k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect nhooyr.io/websocket v1.8.6 // indirect rsc.io/tmplfunc v0.0.3 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect @@ -252,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.40.0-tm-v0.34.29 + github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.41.0-tm-v0.34.29 ) diff --git a/go.sum b/go.sum index cbcbd380ad..46a0053db2 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,14 +317,16 @@ 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.40.0-tm-v0.34.29 h1:J79TAjizxwIvm7/k+WI3PPH1aFj4AjOSjajoq5UzAwI= -github.com/celestiaorg/celestia-core v1.40.0-tm-v0.34.29/go.mod h1:5jJ5magtH7gQOwSYfS/m5fliIS7irKunLV7kLNaD8o0= +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/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/v2 v2.0.0-rc2 h1:4D+ASgZGYVCsffc2uhPagACrvNiLZu9/CqNYvnlHCgg= -github.com/celestiaorg/go-square/v2 v2.0.0-rc2/go.mod h1:eeaU8f8jBpk3ZS/gaDZIlTesJR2F51QAmveNzWH6aEU= -github.com/celestiaorg/knuu v0.14.0 h1:96uaDHTzlTfhDLrAiygq9Ewow7UzOzGAbUvMwws1S4A= -github.com/celestiaorg/knuu v0.14.0/go.mod h1:5x/+tlLebBSfLmmSBm2ps6aLjnKLn5bOaZpUfI5FpsA= +github.com/celestiaorg/go-square v1.1.0 h1:K4tBL5PCJwDtpBfyDxxZ3N962aC9VYb5/bw3LjagEtY= +github.com/celestiaorg/go-square v1.1.0/go.mod h1:1EXMErhDrWJM8B8V9hN7dqJ2kUTClfwdqMOmF9yQUa0= +github.com/celestiaorg/go-square/v2 v2.0.0 h1:U5QV8/de5lc7glosfgyHhcxbFwNuwU4+6aYZ2RgjM04= +github.com/celestiaorg/go-square/v2 v2.0.0/go.mod h1:y0BolG0tRM7UN1sAQyDDUkT+aMJPwFIjviVvnCB62C0= +github.com/celestiaorg/knuu v0.15.2 h1:l6MrFTfDfrNtbvOLSjD/YzRpaaBFIIvlWIYXRNNL1/s= +github.com/celestiaorg/knuu v0.15.2/go.mod h1:hTKu4uGH/Dx7eaYgT26coKx/vbALEQdLdYOwNxkAIG0= github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4 h1:CJdIpo8n5MFP2MwK0gSRcOVlDlFdQJO1p+FqdxYzmvc= github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4/go.mod h1:fzuHnhzj1pUygGz+1ZkB3uQbEUL4htqCGJ4Qs2LwMZA= github.com/celestiaorg/nmt v0.22.1 h1:t7fqoP5MJ8mBns5DB2XjfcPxQpS3CKMkY+v+BEkDxYc= @@ -404,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.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= -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= @@ -478,14 +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.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= -github.com/distribution/reference v0.5.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 h1:NEAxTwEjxV6VbBMBoGG3zPqbiJosIApZjxlbrG9q3/g= -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= @@ -549,6 +544,8 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= @@ -567,6 +564,8 @@ github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= +github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= @@ -581,8 +580,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= @@ -595,8 +594,9 @@ github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaL github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= @@ -611,17 +611,18 @@ github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5Nq github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= +github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= 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= @@ -733,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-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-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= @@ -779,10 +780,10 @@ github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWm github.com/gorilla/websocket v1.5.0/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.1 h1:PQoUU9oWtO3ve/fgIiklYuGilvsm8qaGhlY4Vw6MAcQ= -github.com/grafana/pyroscope-go v1.1.1/go.mod h1:Mw26jU7jsL/KStNSGGuuVYdUq7Qghem5P8aXYXSXG88= -github.com/grafana/pyroscope-go/godeltaprof v0.1.6 h1:nEdZ8louGAplSvIJi1HVp7kWvFvdiiYg3COLlTwJiFo= -github.com/grafana/pyroscope-go/godeltaprof v0.1.6/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE= +github.com/grafana/pyroscope-go v1.1.2 h1:7vCfdORYQMCxIzI3NlYAs3FcBP760+gWuYWOyiVyYx8= +github.com/grafana/pyroscope-go v1.1.2/go.mod h1:HSSmHo2KRn6FasBA4vK7BMiQqyQq8KSuBKvrhkXxYPU= +github.com/grafana/pyroscope-go/godeltaprof v0.1.8 h1:iwOtYXeeVSAeYefJNaxDytgjKtUuKQbJqgAIjlnicKg= +github.com/grafana/pyroscope-go/godeltaprof v0.1.8/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU= github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= @@ -793,8 +794,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= @@ -894,8 +893,6 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGw github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= -github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= -github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= @@ -925,13 +922,12 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= -github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= -github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM= +github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/klauspost/reedsolomon v1.12.1 h1:NhWgum1efX1x58daOBGCFWcxtEhOhXKKl1HAPQUp03Q= @@ -1009,8 +1005,8 @@ github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= -github.com/minio/minio-go/v7 v7.0.70 h1:1u9NtMgfK1U42kUxcsl5v0yj6TEOPR497OAQxpJnn2g= -github.com/minio/minio-go/v7 v7.0.70/go.mod h1:4yBA8v80xGA30cfM3fz0DKYMXunWl/AV/6tWEs9ryzo= +github.com/minio/minio-go/v7 v7.0.74 h1:fTo/XlPBTSpo3BAMshlwKL5RspXRv9us5UeHEGYCFe0= +github.com/minio/minio-go/v7 v7.0.74/go.mod h1:qydcVzV8Hqtj1VtEocfxbmVFa2siu6HGa+LDEPogjD8= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -1031,12 +1027,8 @@ github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8oh github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= -github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= -github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= -github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= -github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8= +github.com/moby/spdystream v0.4.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -1045,8 +1037,6 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= -github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= @@ -1056,6 +1046,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= @@ -1082,14 +1074,14 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= -github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= -github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= +github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= 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= @@ -1189,8 +1181,8 @@ github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRr github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -1198,8 +1190,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= @@ -1217,7 +1209,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= @@ -1333,6 +1324,8 @@ github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+ github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= @@ -1376,10 +1369,6 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1: 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/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0 h1:1wp/gyxsuYtuE/JFxsQRtcCDtMrO2qMvlfXALU5wkzI= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0/go.mod h1:gbTHmghkGgqxMomVQQMur1Nba4M0MQ8AYThXDUjsJ38= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.18.0 h1:hSWWvDjXHVLq9DkmB+77fl8v7+t+yYiS+eNkiplDK54= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.18.0/go.mod h1:zG7KQql1WjZCaUJd+L/ReSYx4bjbYJxg5ws9ws+mYes= go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= @@ -1392,8 +1381,6 @@ go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+ go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA= go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= -go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1433,8 +1420,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.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +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/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= @@ -1542,8 +1529,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1569,8 +1556,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= -golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1585,8 +1572,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1699,14 +1686,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.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.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/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.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +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/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= @@ -1717,8 +1704,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.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +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/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= @@ -1791,8 +1778,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= -golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1978,10 +1965,10 @@ google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= -google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 h1:7whR9kGa5LUwFtpLm2ArCEejtnxlGeLbAyjFY8sGNFw= -google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157/go.mod h1:99sLkeliLXfdj2J75X3Ho+rrVCaJze0uwN7zDDkjPVU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +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/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= @@ -2024,8 +2011,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo= +google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -2083,10 +2070,7 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= -gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -2096,18 +2080,18 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -k8s.io/api v0.28.2 h1:9mpl5mOb6vXZvqbQmankOfPIGiudghwCoLl1EYfUZbw= -k8s.io/api v0.28.2/go.mod h1:RVnJBsjU8tcMq7C3iaRSGMeaKt2TWEUXcpIt/90fjEg= -k8s.io/apimachinery v0.28.2 h1:KCOJLrc6gu+wV1BYgwik4AF4vXOlVJPdiqn0yAWWwXQ= -k8s.io/apimachinery v0.28.2/go.mod h1:RdzF87y/ngqk9H4z3EL2Rppv5jj95vGS/HaFXrLDApU= -k8s.io/client-go v0.28.2 h1:DNoYI1vGq0slMBN/SWKMZMw0Rq+0EQW6/AK4v9+3VeY= -k8s.io/client-go v0.28.2/go.mod h1:sMkApowspLuc7omj1FOSUxSoqjr+d5Q0Yc0LOFnYFJY= -k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= -k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/api v0.30.2 h1:+ZhRj+28QT4UOH+BKznu4CBgPWgkXO7XAvMcMl0qKvI= +k8s.io/api v0.30.2/go.mod h1:ULg5g9JvOev2dG0u2hig4Z7tQ2hHIuS+m8MNZ+X6EmI= +k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U= +k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/client-go v0.30.2 h1:sBIVJdojUNPDU/jObC+18tXWcTJVcwyqS9diGdWHk50= +k8s.io/client-go v0.30.2/go.mod h1:JglKSWULm9xlJLx4KCkfLLQ7XwtlbflV6uFFSHTMgVs= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= diff --git a/pkg/appconsts/initial_consts.go b/pkg/appconsts/initial_consts.go index 1f97adf951..18cafc969d 100644 --- a/pkg/appconsts/initial_consts.go +++ b/pkg/appconsts/initial_consts.go @@ -17,10 +17,6 @@ const ( // maximum number of bytes allowed in a valid block. DefaultMaxBytes = DefaultGovMaxSquareSize * DefaultGovMaxSquareSize * share.ContinuationSparseShareContentSize - // DefaultGasPerBlobByte is the default gas cost deducted per byte of blob - // included in a PayForBlobs txn - DefaultGasPerBlobByte = 8 - // DefaultMinGasPrice is the default min gas price that gets set in the app.toml file. // The min gas price acts as a filter. Transactions below that limit will not pass // a nodes `CheckTx` and thus not be proposed by that node. @@ -30,6 +26,11 @@ const ( // to unbond in a proof of stake system. Any validator within this // time can be subject to slashing under conditions of misbehavior. DefaultUnbondingTime = 3 * 7 * 24 * time.Hour + + // DefaultNetworkMinGasPrice is used by x/minfee to prevent transactions from being + // included in a block if they specify a gas price lower than this. + // Only applies to app version >= 2 + DefaultNetworkMinGasPrice = 0.000001 // utia ) var DefaultUpperBoundMaxBytes = DefaultSquareSizeUpperBound * DefaultSquareSizeUpperBound * share.ContinuationSparseShareContentSize diff --git a/pkg/appconsts/v2/app_consts.go b/pkg/appconsts/v2/app_consts.go index 2ef7a4075c..d5829e84c5 100644 --- a/pkg/appconsts/v2/app_consts.go +++ b/pkg/appconsts/v2/app_consts.go @@ -4,7 +4,4 @@ const ( Version uint64 = 2 SquareSizeUpperBound int = 128 SubtreeRootThreshold int = 64 - // NetworkMinGasPrice is used by x/minfee to prevent transactions from being - // included in a block if they specify a gas price lower than this. - NetworkMinGasPrice float64 = 0.000001 // utia ) diff --git a/pkg/appconsts/v3/app_consts.go b/pkg/appconsts/v3/app_consts.go new file mode 100644 index 0000000000..3fa92f49a0 --- /dev/null +++ b/pkg/appconsts/v3/app_consts.go @@ -0,0 +1,9 @@ +package v3 + +const ( + Version uint64 = 3 + SquareSizeUpperBound int = 128 + SubtreeRootThreshold int = 64 + TxSizeCostPerByte uint64 = 10 + GasPerBlobByte uint32 = 8 +) diff --git a/pkg/appconsts/versioned_consts.go b/pkg/appconsts/versioned_consts.go index 67c3c8a8f2..7bb1088a8b 100644 --- a/pkg/appconsts/versioned_consts.go +++ b/pkg/appconsts/versioned_consts.go @@ -1,12 +1,11 @@ package appconsts import ( - 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" ) const ( - LatestVersion = v2.Version + LatestVersion = v3.Version ) // SubtreeRootThreshold works as a target upper bound for the number of subtree @@ -18,15 +17,25 @@ const ( // // The rationale for this value is described in more detail in ADR-013. func SubtreeRootThreshold(_ uint64) int { - return v1.SubtreeRootThreshold + return v3.SubtreeRootThreshold } // SquareSizeUpperBound imposes an upper bound on the max effective square size. func SquareSizeUpperBound(_ uint64) int { - return v1.SquareSizeUpperBound + return v3.SquareSizeUpperBound +} + +func TxSizeCostPerByte(_ uint64) uint64 { + return v3.TxSizeCostPerByte +} + +func GasPerBlobByte(_ uint64) uint32 { + return v3.GasPerBlobByte } var ( DefaultSubtreeRootThreshold = SubtreeRootThreshold(LatestVersion) DefaultSquareSizeUpperBound = SquareSizeUpperBound(LatestVersion) + DefaultTxSizeCostPerByte = TxSizeCostPerByte(LatestVersion) + DefaultGasPerBlobByte = GasPerBlobByte(LatestVersion) ) diff --git a/pkg/appconsts/versioned_consts_test.go b/pkg/appconsts/versioned_consts_test.go index 6fb5cfc48d..da29d71241 100644 --- a/pkg/appconsts/versioned_consts_test.go +++ b/pkg/appconsts/versioned_consts_test.go @@ -1,7 +1,6 @@ package appconsts_test import ( - "fmt" "testing" "github.com/stretchr/testify/require" @@ -9,52 +8,69 @@ import ( "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" 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" ) -func TestSubtreeRootThreshold(t *testing.T) { +func TestVersionedConsts(t *testing.T) { testCases := []struct { - version uint64 - expected int + name string + version uint64 + expectedConstant interface{} + got interface{} }{ { - version: v1.Version, - expected: v1.SubtreeRootThreshold, + name: "SubtreeRootThreshold v1", + version: v1.Version, + expectedConstant: v1.SubtreeRootThreshold, + got: appconsts.SubtreeRootThreshold(v1.Version), }, { - version: v2.Version, - expected: v2.SubtreeRootThreshold, + name: "SubtreeRootThreshold v2", + version: v2.Version, + expectedConstant: v2.SubtreeRootThreshold, + got: appconsts.SubtreeRootThreshold(v2.Version), + }, + { + name: "SubtreeRootThreshold v3", + version: v3.Version, + expectedConstant: v3.SubtreeRootThreshold, + got: appconsts.SubtreeRootThreshold(v3.Version), + }, + { + name: "SquareSizeUpperBound v1", + version: v1.Version, + expectedConstant: v1.SquareSizeUpperBound, + got: appconsts.SquareSizeUpperBound(v1.Version), + }, + { + name: "SquareSizeUpperBound v2", + version: v2.Version, + expectedConstant: v2.SquareSizeUpperBound, + got: appconsts.SquareSizeUpperBound(v2.Version), + }, + { + name: "SquareSizeUpperBound v3", + version: v3.Version, + expectedConstant: v3.SquareSizeUpperBound, + got: appconsts.SquareSizeUpperBound(v3.Version), }, - } - - for _, tc := range testCases { - name := fmt.Sprintf("version %v", tc.version) - t.Run(name, func(t *testing.T) { - got := appconsts.SubtreeRootThreshold(tc.version) - require.Equal(t, tc.expected, got) - }) - } -} - -func TestSquareSizeUpperBound(t *testing.T) { - testCases := []struct { - version uint64 - expected int - }{ { - version: v1.Version, - expected: v1.SquareSizeUpperBound, + name: "TxSizeCostPerByte v3", + version: v3.Version, + expectedConstant: v3.TxSizeCostPerByte, + got: appconsts.TxSizeCostPerByte(v3.Version), }, { - version: v2.Version, - expected: v2.SquareSizeUpperBound, + name: "GasPerBlobByte v3", + version: v3.Version, + expectedConstant: v3.GasPerBlobByte, + got: appconsts.GasPerBlobByte(v3.Version), }, } for _, tc := range testCases { - name := fmt.Sprintf("version %v", tc.version) - t.Run(name, func(t *testing.T) { - got := appconsts.SquareSizeUpperBound(tc.version) - require.Equal(t, tc.expected, got) + t.Run(tc.name, func(t *testing.T) { + require.Equal(t, tc.expectedConstant, tc.got) }) } } diff --git a/pkg/wrapper/README.md b/pkg/wrapper/README.md index e58188bd7a..cacbd55dda 100644 --- a/pkg/wrapper/README.md +++ b/pkg/wrapper/README.md @@ -76,9 +76,9 @@ One namespace ID is located in the first `NamespaceIDSize` bytes, while the othe ## References - Namespaced Merkle tree specifications: -- Celestia original data square specification: -- Celestia constants: -- Celestia reserved namespace IDs: +- Celestia original data square specification: +- Celestia constants: +- Celestia reserved namespace IDs: [nmtlink]: https://github.com/celestiaorg/nmt/blob/master/docs/spec/nmt.md [nmtwrapper-link]: https://github.com/celestiaorg/celestia-app/blob/main/pkg/wrapper/nmt_wrapper.go diff --git a/scripts/arabica-block-sync.sh b/scripts/arabica-block-sync.sh new file mode 100755 index 0000000000..1b911ccdfb --- /dev/null +++ b/scripts/arabica-block-sync.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# This script starts a consensus node on Arabica and block syncs from genesis to +# the tip of the chain. + +# Stop script execution if an error is encountered +set -o errexit +# Stop script execution if an undefined variable is used +set -o nounset + +CHAIN_ID="arabica-11" +NODE_NAME="node-name" +SEEDS="827583022cc6ce65cf762115642258f937c954cd@validator-1.celestia-arabica-11.com:26656,74e42b39f512f844492ff09e30af23d54579b7bc@validator-2.celestia-arabica-11.com:26656,00d577159b2eb1f524ef9c37cb389c020a2c38d2@validator-3.celestia-arabica-11.com:26656,b2871b6dc2e18916d07264af0e87c456c2bba04f@validator-4.celestia-arabica-11.com:26656" + +CELESTIA_APP_HOME="${HOME}/.celestia-app" +CELESTIA_APP_VERSION=$(celestia-appd version 2>&1) + +echo "celestia-app home: ${CELESTIA_APP_HOME}" +echo "celestia-app version: ${CELESTIA_APP_VERSION}" +echo "" + +# Ask the user for confirmation before deleting the existing celestia-app home +# directory. +read -p "Are you sure you want to delete: $CELESTIA_APP_HOME? [y/n] " response + +# Check the user's response +if [ "$response" != "y" ]; then + # Exit if the user did not respond with "y" + echo "You must delete $CELESTIA_APP_HOME to continue." + exit 1 +fi + +echo "Deleting $CELESTIA_APP_HOME..." +rm -r "$CELESTIA_APP_HOME" + +echo "Initializing config files..." +celestia-appd init ${NODE_NAME} --chain-id ${CHAIN_ID} > /dev/null 2>&1 # Hide output to reduce terminal noise + +echo "Settings seeds in config.toml..." +sed -i.bak -e "s/^seeds *=.*/seeds = \"$SEEDS\"/" $CELESTIA_APP_HOME/config/config.toml + +echo "Downloading genesis file..." +celestia-appd download-genesis ${CHAIN_ID} + +echo "Starting celestia-appd..." +celestia-appd start --v2-upgrade-height 1751707 --force-no-bbr diff --git a/scripts/arabica.sh b/scripts/arabica.sh index fe88e26c89..d09b9d8441 100755 --- a/scripts/arabica.sh +++ b/scripts/arabica.sh @@ -57,4 +57,4 @@ echo "Downloading genesis file..." celestia-appd download-genesis ${CHAIN_ID} echo "Starting celestia-appd..." -celestia-appd start --v2-upgrade-height 1751707 +celestia-appd start --v2-upgrade-height 1751707 --force-no-bbr diff --git a/scripts/mainnet.sh b/scripts/mainnet.sh index 317fe5dbdc..aa92e13326 100755 --- a/scripts/mainnet.sh +++ b/scripts/mainnet.sh @@ -1,5 +1,8 @@ #!/bin/sh +# This script starts a consensus node on Mainnet Beta and state syncs to the tip +# of the chain. + # Stop script execution if an error is encountered set -o errexit # Stop script execution if an undefined variable is used @@ -10,6 +13,7 @@ NODE_NAME="node-name" SEEDS="e6116822e1a5e283d8a85d3ec38f4d232274eaf3@consensus-full-seed-1.celestia-bootstrap.net:26656,cf7ac8b19ff56a9d47c75551bd4864883d1e24b5@consensus-full-seed-2.celestia-bootstrap.net:26656" CELESTIA_APP_HOME="${HOME}/.celestia-app" CELESTIA_APP_VERSION=$(celestia-appd version 2>&1) +RPC="https://celestia-rpc.polkachu.com:443" echo "celestia-app home: ${CELESTIA_APP_HOME}" echo "celestia-app version: ${CELESTIA_APP_VERSION}" @@ -35,10 +39,20 @@ celestia-appd init ${NODE_NAME} --chain-id ${CHAIN_ID} > /dev/null 2>&1 # Hide o echo "Settings seeds in config.toml..." sed -i.bak -e "s/^seeds *=.*/seeds = \"$SEEDS\"/" $CELESTIA_APP_HOME/config/config.toml +LATEST_HEIGHT=$(curl -s $RPC/block | jq -r .result.block.header.height); +BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \ +TRUST_HASH=$(curl -s "$RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) + +echo "Block height: $BLOCK_HEIGHT" +echo "Trust hash: $TRUST_HASH" +echo "Enabling state sync in config.toml..." +sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \ +s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$RPC,$RPC\"| ; \ +s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \ +s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.celestia-app/config/config.toml + echo "Downloading genesis file..." celestia-appd download-genesis ${CHAIN_ID} > /dev/null 2>&1 # Hide output to reduce terminal noise -echo "Starting celestia-appd in the background and piping logs to mainnet.log" -nohup celestia-appd start > "${HOME}/mainnet.log" 2>&1 & - -echo "You can check the node's status via: celestia-appd status" +echo "Starting celestia-appd..." +celestia-appd start --v2-upgrade-height 2371495 diff --git a/scripts/mocha-block-sync.sh b/scripts/mocha-block-sync.sh new file mode 100755 index 0000000000..3f8795dd6e --- /dev/null +++ b/scripts/mocha-block-sync.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# This script starts a consensus node on Mocha and block syncs from genesis to +# the tip of the chain. This is expected to take a few weeks. + +# Stop script execution if an error is encountered +set -o errexit +# Stop script execution if an undefined variable is used +set -o nounset + +CHAIN_ID="mocha-4" +NODE_NAME="node-name" +SEEDS="ee9f90974f85c59d3861fc7f7edb10894f6ac3c8@seed-mocha.pops.one:26656,258f523c96efde50d5fe0a9faeea8a3e83be22ca@seed.mocha-4.celestia.aviaone.com:20279,5d0bf034d6e6a8b5ee31a2f42f753f1107b3a00e@celestia-testnet-seed.itrocket.net:11656,7da0fb48d6ef0823bc9770c0c8068dd7c89ed4ee@celest-test-seed.theamsolutions.info:443" + +CELESTIA_APP_HOME="${HOME}/.celestia-app" +CELESTIA_APP_VERSION=$(celestia-appd version 2>&1) + +echo "celestia-app home: ${CELESTIA_APP_HOME}" +echo "celestia-app version: ${CELESTIA_APP_VERSION}" +echo "" + +# Ask the user for confirmation before deleting the existing celestia-app home +# directory. +read -p "Are you sure you want to delete: $CELESTIA_APP_HOME? [y/n] " response + +# Check the user's response +if [ "$response" != "y" ]; then + # Exit if the user did not respond with "y" + echo "You must delete $CELESTIA_APP_HOME to continue." + exit 1 +fi + +echo "Deleting $CELESTIA_APP_HOME..." +rm -r "$CELESTIA_APP_HOME" + +echo "Initializing config files..." +celestia-appd init ${NODE_NAME} --chain-id ${CHAIN_ID} > /dev/null 2>&1 # Hide output to reduce terminal noise + +echo "Settings seeds in config.toml..." +sed -i.bak -e "s/^seeds *=.*/seeds = \"$SEEDS\"/" $CELESTIA_APP_HOME/config/config.toml + +echo "Downloading genesis file..." +celestia-appd download-genesis ${CHAIN_ID} > /dev/null 2>&1 # Hide output to reduce terminal noise + +echo "Starting celestia-appd..." +celestia-appd start --v2-upgrade-height 2585031 --force-no-bbr diff --git a/scripts/mocha.sh b/scripts/mocha.sh index 5447eb9e3b..56c0e89480 100755 --- a/scripts/mocha.sh +++ b/scripts/mocha.sh @@ -57,4 +57,4 @@ echo "Downloading genesis file..." celestia-appd download-genesis ${CHAIN_ID} > /dev/null 2>&1 # Hide output to reduce terminal noise echo "Starting celestia-appd..." -celestia-appd start --v2-upgrade-height 2585031 +celestia-appd start --v2-upgrade-height 2585031 --force-no-bbr diff --git a/specs/src/parameters_v2.md b/specs/src/parameters_v2.md index 7555dd8761..9bd3e63f25 100644 --- a/specs/src/parameters_v2.md +++ b/specs/src/parameters_v2.md @@ -54,6 +54,7 @@ hardcoded in the application or they are blocked by the `x/paramfilter` module. | mint.DisinflationRate | 0.10 (10%) | The rate at which the inflation rate decreases each year. | False | | mint.InitialInflationRate | 0.08 (8%) | The inflation rate the network starts at. | False | | mint.TargetInflationRate | 0.015 (1.5%) | The inflation rate that the network aims to stabilize at. | False | +| packetfowardmiddleware.FeePercentage | 0 | % of the forwarded packet amount which will be subtracted and distributed to the community pool. | True | | slashing.DowntimeJailDuration | 1 min | Duration of time a validator must stay jailed. | True | | slashing.MinSignedPerWindow | 0.75 (75%) | The percentage of SignedBlocksWindow that must be signed not to get jailed. | True | | slashing.SignedBlocksWindow | 5000 | The range of blocks used to count for downtime. | True | diff --git a/specs/src/parameters_v3.md b/specs/src/parameters_v3.md new file mode 100644 index 0000000000..491e4834c1 --- /dev/null +++ b/specs/src/parameters_v3.md @@ -0,0 +1,72 @@ +# Parameters v3 + +The parameters below represent the parameters for app version 3. + +Note that not all of these parameters are changeable via governance. This list +also includes parameter that require a hardfork to change due to being manually +hardcoded in the application or they are blocked by the `x/paramfilter` module. + +## Global parameters + +| Parameter | Default | Summary | Changeable via Governance | +|-------------------|---------|------------------------------------------------------------------------------------------------------------------------|---------------------------| +| MaxBlockSizeBytes | 100MiB | Hardcoded value in CometBFT for the protobuf encoded block. | False | +| MaxSquareSize | 128 | Hardcoded maximum square size determined per shares per row or column for the original data square (not yet extended). | False | + +## Module parameters + +| Module.Parameter | Default | Summary | Changeable via Governance | +|-----------------------------------------------|---------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|---------------------------| +| auth.MaxMemoCharacters | 256 | Largest allowed size for a memo in bytes. | True | +| auth.SigVerifyCostED25519 | 590 | Gas used to verify Ed25519 signature. | True | +| auth.SigVerifyCostSecp256k1 | 1000 | Gas used to verify secp256k1 signature. | True | +| auth.TxSigLimit | 7 | Max number of signatures allowed in a multisig transaction. | True | +| auth.TxSizeCostPerByte | 10 | Gas used per transaction byte. | False | +| bank.SendEnabled | true | Allow transfers. | False | +| blob.GasPerBlobByte | 8 | Gas used per blob byte. | False | +| blob.GovMaxSquareSize | 64 | Governance parameter for the maximum square size of the original data square. | True | +| consensus.block.MaxBytes | 1974272 bytes (~1.88 MiB) | Governance parameter for the maximum size of the protobuf encoded block. | True | +| consensus.block.MaxGas | -1 | Maximum gas allowed per block (-1 is infinite). | True | +| consensus.block.TimeIotaMs | 1000 | Minimum time added to the time in the header each block. | False | +| consensus.evidence.MaxAgeDuration | 1814400000000000 (21 days) | The maximum age of evidence before it is considered invalid in nanoseconds. This value should be identical to the unbonding period. | True | +| consensus.evidence.MaxAgeNumBlocks | 120960 | The maximum number of blocks before evidence is considered invalid. This value will stop CometBFT from pruning block data. | True | +| consensus.evidence.MaxBytes | 1MiB | Maximum size in bytes used by evidence in a given block. | True | +| consensus.validator.PubKeyTypes | Ed25519 | The type of public key used by validators. | False | +| consensus.Version.AppVersion | 2 | Determines protocol rules used for a given height. Incremented by the application upon an upgrade. | True | +| distribution.BaseProposerReward | 0 | Reward in the mint denomination for proposing a block. | True | +| distribution.BonusProposerReward | 0 | Extra reward in the mint denomination for proposers based on the voting power included in the commit. | True | +| distribution.CommunityTax | 0.02 (2%) | Percentage of the inflation sent to the community pool. | True | +| distribution.WithdrawAddrEnabled | true | Enables delegators to withdraw funds to a different address. | True | +| gov.DepositParams.MaxDepositPeriod | 604800000000000 (1 week) | Maximum period for token holders to deposit on a proposal in nanoseconds. | True | +| gov.DepositParams.MinDeposit | 10_000_000_000 utia (10,000 TIA) | Minimum deposit for a proposal to enter voting period. | True | +| gov.TallyParams.Quorum | 0.334 (33.4%) | Minimum percentage of total stake needed to vote for a result to be considered valid. | True | +| gov.TallyParams.Threshold | 0.50 (50%) | Minimum proportion of Yes votes for proposal to pass. | True | +| gov.TallyParams.VetoThreshold | 0.334 (33.4%) | Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. | True | +| gov.VotingParams.VotingPeriod | 604800000000000 (1 week) | Duration of the voting period in nanoseconds. | True | +| ibc.ClientGenesis.AllowedClients | []string{"06-solomachine", "07-tendermint"} | List of allowed IBC light clients. | True | +| ibc.ConnectionGenesis.MaxExpectedTimePerBlock | 7500000000000 (75 seconds) | Maximum expected time per block in nanoseconds under normal operation. | True | +| ibc.Transfer.ReceiveEnabled | true | Enable receiving tokens via IBC. | True | +| ibc.Transfer.SendEnabled | true | Enable sending tokens via IBC. | True | +| icahost.HostEnabled | True | Enables or disables the Inter-Chain Accounts host module. | True | +| icahost.AllowMessages | [icaAllowMessages] | Defines a list of sdk message typeURLs allowed to be executed on a host chain. | True | +| minfee.NetworkMinGasPrice | 0.000001 utia | All transactions must have a gas price greater than or equal to this value. | True | +| mint.BondDenom | utia | Denomination that is inflated and sent to the distribution module account. | False | +| mint.DisinflationRate | 0.10 (10%) | The rate at which the inflation rate decreases each year. | False | +| mint.InitialInflationRate | 0.08 (8%) | The inflation rate the network starts at. | False | +| mint.TargetInflationRate | 0.015 (1.5%) | The inflation rate that the network aims to stabilize at. | False | +| packetfowardmiddleware.FeePercentage | 0 | % of the forwarded packet amount which will be subtracted and distributed to the community pool. | True | +| slashing.DowntimeJailDuration | 1 min | Duration of time a validator must stay jailed. | True | +| slashing.MinSignedPerWindow | 0.75 (75%) | The percentage of SignedBlocksWindow that must be signed not to get jailed. | True | +| slashing.SignedBlocksWindow | 5000 | The range of blocks used to count for downtime. | True | +| slashing.SlashFractionDoubleSign | 0.02 (2%) | Percentage slashed after a validator is jailed for double signing. | True | +| slashing.SlashFractionDowntime | 0.00 (0%) | Percentage slashed after a validator is jailed for downtime. | True | +| staking.BondDenom | utia | Bondable coin denomination. | False | +| staking.HistoricalEntries | 10000 | Number of historical entries to persist in store. | True | +| staking.MaxEntries | 7 | Maximum number of entries in the redelegation queue. | True | +| staking.MaxValidators | 100 | Maximum number of validators. | True | +| staking.MinCommissionRate | 0.05 (5%) | Minimum commission rate used by all validators. | True | +| staking.UnbondingTime | 1814400 (21 days) | Duration of time for unbonding in seconds. | False | + +Note: none of the mint module parameters are governance modifiable because they have been converted into hardcoded constants. See the x/mint README.md for more details. + +[icaAllowMessages]: https://github.com/rootulp/celestia-app/blob/8caa5807df8d15477554eba953bd056ae72d4503/app/ica_host.go#L3-L18 diff --git a/specs/src/specs/ante_handler.md b/specs/src/specs/ante_handler.md deleted file mode 100644 index 12710bdb85..0000000000 --- a/specs/src/specs/ante_handler.md +++ /dev/null @@ -1 +0,0 @@ -# AnteHandler diff --git a/specs/src/specs/ante_handler_v1.md b/specs/src/specs/ante_handler_v1.md deleted file mode 100644 index a5c3cb3fdf..0000000000 --- a/specs/src/specs/ante_handler_v1.md +++ /dev/null @@ -1 +0,0 @@ -# AnteHandler v1 diff --git a/specs/src/specs/ante_handler_v2.md b/specs/src/specs/ante_handler_v2.md deleted file mode 100644 index 9ebb88a269..0000000000 --- a/specs/src/specs/ante_handler_v2.md +++ /dev/null @@ -1 +0,0 @@ -# AnteHandler v2 diff --git a/specs/src/specs/block_proposer.md b/specs/src/specs/block_proposer.md deleted file mode 100644 index a29ade0863..0000000000 --- a/specs/src/specs/block_proposer.md +++ /dev/null @@ -1 +0,0 @@ -# Block Proposer diff --git a/specs/src/specs/block_validity_rules.md b/specs/src/specs/block_validity_rules.md deleted file mode 100644 index 204d783573..0000000000 --- a/specs/src/specs/block_validity_rules.md +++ /dev/null @@ -1 +0,0 @@ -# Block Validity Rules diff --git a/specs/src/specs/cat_pool.md b/specs/src/specs/cat_pool.md deleted file mode 100644 index eb6559023a..0000000000 --- a/specs/src/specs/cat_pool.md +++ /dev/null @@ -1 +0,0 @@ -# CAT Pool diff --git a/specs/src/specs/consensus.md b/specs/src/specs/consensus.md deleted file mode 100644 index 5cfc2c950c..0000000000 --- a/specs/src/specs/consensus.md +++ /dev/null @@ -1 +0,0 @@ -# Consensus diff --git a/specs/src/specs/data_square_layout.md b/specs/src/specs/data_square_layout.md deleted file mode 100644 index 4be6fe18f6..0000000000 --- a/specs/src/specs/data_square_layout.md +++ /dev/null @@ -1 +0,0 @@ -# Data Square Layout diff --git a/specs/src/specs/data_structures.md b/specs/src/specs/data_structures.md deleted file mode 100644 index c73ca16086..0000000000 --- a/specs/src/specs/data_structures.md +++ /dev/null @@ -1 +0,0 @@ -# Data Structures diff --git a/specs/src/specs/fraud_proofs.md b/specs/src/specs/fraud_proofs.md deleted file mode 100644 index 8f33083bce..0000000000 --- a/specs/src/specs/fraud_proofs.md +++ /dev/null @@ -1 +0,0 @@ -# Fraud Proofs diff --git a/specs/src/specs/multisig.md b/specs/src/specs/multisig.md deleted file mode 100644 index 206d574852..0000000000 --- a/specs/src/specs/multisig.md +++ /dev/null @@ -1 +0,0 @@ -# Multisig diff --git a/specs/src/specs/namespace.md b/specs/src/specs/namespace.md deleted file mode 100644 index aae590a94d..0000000000 --- a/specs/src/specs/namespace.md +++ /dev/null @@ -1 +0,0 @@ -# Namespace diff --git a/specs/src/specs/networking.md b/specs/src/specs/networking.md deleted file mode 100644 index 048579a4c1..0000000000 --- a/specs/src/specs/networking.md +++ /dev/null @@ -1 +0,0 @@ -# Networking diff --git a/specs/src/specs/parameters.md b/specs/src/specs/parameters.md deleted file mode 100644 index 04f9547d32..0000000000 --- a/specs/src/specs/parameters.md +++ /dev/null @@ -1 +0,0 @@ -# Parameters diff --git a/specs/src/specs/parameters_v1.md b/specs/src/specs/parameters_v1.md deleted file mode 100644 index eae5f5081a..0000000000 --- a/specs/src/specs/parameters_v1.md +++ /dev/null @@ -1 +0,0 @@ -# Parameters v1 diff --git a/specs/src/specs/parameters_v2.md b/specs/src/specs/parameters_v2.md deleted file mode 100644 index 0aa1503bd2..0000000000 --- a/specs/src/specs/parameters_v2.md +++ /dev/null @@ -1 +0,0 @@ -# Parameters v2 diff --git a/specs/src/specs/public_key_cryptography.md b/specs/src/specs/public_key_cryptography.md deleted file mode 100644 index 5234fcb002..0000000000 --- a/specs/src/specs/public_key_cryptography.md +++ /dev/null @@ -1 +0,0 @@ -# Public-Key Cryptography diff --git a/specs/src/specs/resource_pricing.md b/specs/src/specs/resource_pricing.md deleted file mode 100644 index 7b2572cdb6..0000000000 --- a/specs/src/specs/resource_pricing.md +++ /dev/null @@ -1 +0,0 @@ -# Resource Pricing diff --git a/specs/src/specs/shares.md b/specs/src/specs/shares.md deleted file mode 100644 index 806e046c43..0000000000 --- a/specs/src/specs/shares.md +++ /dev/null @@ -1 +0,0 @@ -# Shares diff --git a/specs/src/specs/state_machine_modules.md b/specs/src/specs/state_machine_modules.md deleted file mode 100644 index 58c122c799..0000000000 --- a/specs/src/specs/state_machine_modules.md +++ /dev/null @@ -1 +0,0 @@ -# State Machine Modules diff --git a/specs/src/specs/state_machine_modules_v1.md b/specs/src/specs/state_machine_modules_v1.md deleted file mode 100644 index ec8a32dd68..0000000000 --- a/specs/src/specs/state_machine_modules_v1.md +++ /dev/null @@ -1 +0,0 @@ -# State Machine Modules v1 diff --git a/specs/src/specs/state_machine_modules_v2.md b/specs/src/specs/state_machine_modules_v2.md deleted file mode 100644 index ce9a0bb852..0000000000 --- a/specs/src/specs/state_machine_modules_v2.md +++ /dev/null @@ -1 +0,0 @@ -# State Machine Modules v2 diff --git a/test/e2e/benchmark/benchmark.go b/test/e2e/benchmark/benchmark.go index 456f8da0dd..81b2748cb1 100644 --- a/test/e2e/benchmark/benchmark.go +++ b/test/e2e/benchmark/benchmark.go @@ -7,10 +7,11 @@ import ( "log" "time" + "github.com/tendermint/tendermint/pkg/trace" + "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/tendermint/tendermint/pkg/trace" ) type BenchmarkTest struct { @@ -20,7 +21,7 @@ type BenchmarkTest struct { func NewBenchmarkTest(name string, manifest *Manifest) (*BenchmarkTest, error) { // create a new testnet - testNet, err := testnet.New(name, seed, + testNet, err := testnet.New(context.Background(), name, seed, testnet.GetGrafanaInfoFromEnvVar(), manifest.ChainID, manifest.GetGenesisModifiers()...) if err != nil { @@ -35,28 +36,27 @@ func NewBenchmarkTest(name string, manifest *Manifest) (*BenchmarkTest, error) { // There will be manifest.Validators validators and manifest.TxClients 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() testnet.NoError("failed to create genesis nodes", - b.CreateGenesisNodes(b.manifest.Validators, + b.CreateGenesisNodes(ctx, b.manifest.Validators, b.manifest.CelestiaAppVersion, b.manifest.SelfDelegation, - b.manifest.UpgradeHeight, b.manifest.ValidatorResource)) + b.manifest.UpgradeHeight, b.manifest.ValidatorResource, b.manifest.DisableBBR)) // enable latency if specified in the manifest if b.manifest.EnableLatency { for _, node := range b.Nodes() { - if err := node.Instance.EnableBitTwister(); err != nil { - return fmt.Errorf("failed to enable bit twister: %v", err) - } + node.EnableNetShaper() } } // obtain the GRPC endpoints of the validators - gRPCEndpoints, err := b.RemoteGRPCEndpoints() + gRPCEndpoints, err := b.RemoteGRPCEndpoints(ctx) testnet.NoError("failed to get validators GRPC endpoints", err) log.Println("validators GRPC endpoints", gRPCEndpoints) // create tx clients and point them to the validators log.Println("Creating tx clients") - err = b.CreateTxClients(b.manifest.TxClientVersion, + err = b.CreateTxClients(ctx, b.manifest.TxClientVersion, b.manifest.BlobSequences, b.manifest.BlobSizes, b.manifest.BlobsPerSeq, @@ -64,7 +64,7 @@ func (b *BenchmarkTest) SetupNodes() error { testnet.NoError("failed to create tx clients", err) log.Println("Setting up testnet") - testnet.NoError("failed to setup testnet", b.Setup( + testnet.NoError("failed to setup testnet", b.Setup(ctx, testnet.WithPerPeerBandwidth(b.manifest.PerPeerBandwidth), testnet.WithTimeoutPropose(b.manifest.TimeoutPropose), testnet.WithTimeoutCommit(b.manifest.TimeoutCommit), @@ -78,21 +78,18 @@ func (b *BenchmarkTest) SetupNodes() error { log.Println("reading trace push config") if pushConfig, err := trace.GetPushConfigFromEnv(); err == nil { log.Print("Setting up trace push config") + envVars := map[string]string{ + trace.PushBucketName: pushConfig.BucketName, + trace.PushRegion: pushConfig.Region, + trace.PushAccessKey: pushConfig.AccessKey, + trace.PushKey: pushConfig.SecretKey, + trace.PushDelay: fmt.Sprintf("%d", pushConfig.PushDelay), + } for _, node := range b.Nodes() { - if err = node.Instance.SetEnvironmentVariable(trace.PushBucketName, pushConfig.BucketName); err != nil { - return fmt.Errorf("failed to set TRACE_PUSH_BUCKET_NAME: %v", err) - } - if err = node.Instance.SetEnvironmentVariable(trace.PushRegion, pushConfig.Region); err != nil { - return fmt.Errorf("failed to set TRACE_PUSH_REGION: %v", err) - } - if err = node.Instance.SetEnvironmentVariable(trace.PushAccessKey, pushConfig.AccessKey); err != nil { - return fmt.Errorf("failed to set TRACE_PUSH_ACCESS_KEY: %v", err) - } - if err = node.Instance.SetEnvironmentVariable(trace.PushKey, pushConfig.SecretKey); err != nil { - return fmt.Errorf("failed to set TRACE_PUSH_SECRET_KEY: %v", err) - } - if err = node.Instance.SetEnvironmentVariable(trace.PushDelay, fmt.Sprintf("%d", pushConfig.PushDelay)); err != nil { - return fmt.Errorf("failed to set TRACE_PUSH_DELAY: %v", err) + for key, value := range envVars { + if err = node.Instance.Build().SetEnvironmentVariable(key, value); err != nil { + return fmt.Errorf("failed to set %s: %v", key, err) + } } } } @@ -101,20 +98,22 @@ func (b *BenchmarkTest) SetupNodes() error { } // Run runs the benchmark test for the specified duration in the manifest. -func (b *BenchmarkTest) Run() error { +func (b *BenchmarkTest) Run(ctx context.Context) error { log.Println("Starting benchmark testnet") log.Println("Starting nodes") - err := b.StartNodes() - if err != nil { + if err := b.StartNodes(ctx); err != nil { return fmt.Errorf("failed to start testnet: %v", err) } // add latency if specified in the manifest if b.manifest.EnableLatency { for _, node := range b.Nodes() { - if err = node.Instance.SetLatencyAndJitter(b.manifest.LatencyParams. - Latency, b.manifest.LatencyParams.Jitter); err != nil { + err := node.SetLatencyAndJitter( + b.manifest.LatencyParams.Latency, + b.manifest.LatencyParams.Jitter, + ) + if err != nil { return fmt.Errorf("failed to set latency and jitter: %v", err) } } @@ -122,15 +121,13 @@ func (b *BenchmarkTest) Run() error { // wait for the nodes to sync log.Println("Waiting for nodes to sync") - err = b.WaitToSync() - if err != nil { + if err := b.WaitToSync(ctx); err != nil { return err } // start tx clients log.Println("Starting tx clients") - err = b.StartTxClients() - if err != nil { + if err := b.StartTxClients(ctx); err != nil { return fmt.Errorf("failed to start tx clients: %v", err) } diff --git a/test/e2e/benchmark/manifest.go b/test/e2e/benchmark/manifest.go index f130069657..64b319fcc8 100644 --- a/test/e2e/benchmark/manifest.go +++ b/test/e2e/benchmark/manifest.go @@ -78,6 +78,8 @@ type Manifest struct { UpgradeHeight int64 GovMaxSquareSize int64 + + DisableBBR bool } func (m *Manifest) GetGenesisModifiers() []genesis.Modifier { @@ -103,12 +105,16 @@ func (m *Manifest) summary() string { if m.EnableLatency { latency = 1 } + bbr := 1 + if m.DisableBBR { + bbr = 0 + } maxBlockMB := m.MaxBlockBytes / testnet.MB - summary := fmt.Sprintf("v%d-t%d-b%d-bw%dmb-tc%d-tp%d-l%d-%s-%dmb", + summary := fmt.Sprintf("v%d-t%d-b%d-bw%dmb-tc%d-tp%d-l%d-%s-br%d-%dmb", m.Validators, m.TxClients, m.BlobSequences, m.PerPeerBandwidth/testnet.MB, m.TimeoutCommit/time.Second, m.TimeoutPropose/time.Second, - latency, m.Mempool, maxBlockMB) + latency, m.Mempool, bbr, maxBlockMB) if len(summary) > 50 { return summary[:50] } diff --git a/test/e2e/benchmark/throughput.go b/test/e2e/benchmark/throughput.go index b919093d8a..337d700525 100644 --- a/test/e2e/benchmark/throughput.go +++ b/test/e2e/benchmark/throughput.go @@ -1,11 +1,13 @@ package main import ( + "context" "log" "time" "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" "github.com/celestiaorg/celestia-app/v3/test/e2e/testnet" + "k8s.io/apimachinery/pkg/api/resource" ) const ( @@ -17,16 +19,16 @@ var bigBlockManifest = Manifest{ Validators: 2, TxClients: 2, ValidatorResource: testnet.Resources{ - MemoryRequest: "12Gi", - MemoryLimit: "12Gi", - CPU: "8", - Volume: "20Gi", + MemoryRequest: resource.MustParse("12Gi"), + MemoryLimit: resource.MustParse("12Gi"), + CPU: resource.MustParse("8"), + Volume: resource.MustParse("20Gi"), }, TxClientsResource: testnet.Resources{ - MemoryRequest: "1Gi", - MemoryLimit: "3Gi", - CPU: "2", - Volume: "1Gi", + MemoryRequest: resource.MustParse("1Gi"), + MemoryLimit: resource.MustParse("3Gi"), + CPU: resource.MustParse("2"), + Volume: resource.MustParse("1Gi"), }, SelfDelegation: 10000000, // @TODO Update the CelestiaAppVersion and TxClientVersion to the latest @@ -51,6 +53,7 @@ var bigBlockManifest = Manifest{ TestDuration: 5 * time.Minute, LocalTracingType: "local", PushTrace: true, + DisableBBR: true, } func TwoNodeSimple(logger *log.Logger) error { @@ -88,19 +91,23 @@ func TwoNodeSimple(logger *log.Logger) error { DownloadTraces: false, TestDuration: 3 * time.Minute, TxClients: 2, + DisableBBR: true, } benchTest, err := NewBenchmarkTest(testName, &manifest) testnet.NoError("failed to create benchmark test", err) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + defer func() { log.Print("Cleaning up testnet") - benchTest.Cleanup() + benchTest.Cleanup(ctx) }() testnet.NoError("failed to setup nodes", benchTest.SetupNodes()) - testnet.NoError("failed to run the benchmark test", benchTest.Run()) + testnet.NoError("failed to run the benchmark test", benchTest.Run(ctx)) testnet.NoError("failed to check results", benchTest.CheckResults(1*testnet.MB)) @@ -114,13 +121,16 @@ func runBenchmarkTest(logger *log.Logger, testName string, manifest Manifest) er benchTest, err := NewBenchmarkTest(testName, &manifest) testnet.NoError("failed to create benchmark test", err) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + defer func() { log.Print("Cleaning up testnet") - benchTest.Cleanup() + benchTest.Cleanup(ctx) }() testnet.NoError("failed to setup nodes", benchTest.SetupNodes()) - testnet.NoError("failed to run the benchmark test", benchTest.Run()) + testnet.NoError("failed to run the benchmark test", benchTest.Run(ctx)) expectedBlockSize := int64(0.90 * float64(manifest.MaxBlockBytes)) testnet.NoError("failed to check results", benchTest.CheckResults(expectedBlockSize)) diff --git a/test/e2e/main.go b/test/e2e/main.go index c133e00a6d..0928779dbb 100644 --- a/test/e2e/main.go +++ b/test/e2e/main.go @@ -10,7 +10,7 @@ const ( seed = 42 ) -type TestFunc func(*log.Logger) error +type TestFunc func(logger *log.Logger) error type Test struct { Name string diff --git a/test/e2e/major_upgrade_v2.go b/test/e2e/major_upgrade_v2.go index f595be542d..db21d65306 100644 --- a/test/e2e/major_upgrade_v2.go +++ b/test/e2e/major_upgrade_v2.go @@ -12,51 +12,50 @@ import ( v1 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v1" v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" "github.com/celestiaorg/celestia-app/v3/test/e2e/testnet" - "github.com/celestiaorg/knuu/pkg/knuu" "github.com/tendermint/tendermint/rpc/client/http" ) func MajorUpgradeToV2(logger *log.Logger) error { - latestVersion, err := testnet.GetLatestVersion() - testnet.NoError("failed to get latest version", err) - - logger.Println("Running major upgrade to v2 test", "version", latestVersion) - numNodes := 4 upgradeHeight := int64(10) ctx, cancel := context.WithCancel(context.Background()) defer cancel() logger.Println("Creating testnet") - testNet, err := testnet.New("runMajorUpgradeToV2", seed, nil, "test") + testNet, err := testnet.New(ctx, "runMajorUpgradeToV2", seed, nil, "test") testnet.NoError("failed to create testnet", err) - defer testNet.Cleanup() + defer testNet.Cleanup(ctx) + + latestVersion, err := testnet.GetLatestVersion() + testnet.NoError("failed to get latest version", err) + + logger.Println("Running major upgrade to v2 test", "version", latestVersion) testNet.SetConsensusParams(app.DefaultInitialConsensusParams()) - preloader, err := knuu.NewPreloader() + preloader, err := testNet.NewPreloader() testnet.NoError("failed to create preloader", err) - defer func() { _ = preloader.EmptyImages() }() - testnet.NoError("failed to add image", preloader.AddImage(testnet.DockerImageName(latestVersion))) + defer func() { _ = preloader.EmptyImages(ctx) }() + testnet.NoError("failed to add image", preloader.AddImage(ctx, testnet.DockerImageName(latestVersion))) logger.Println("Creating genesis nodes") for i := 0; i < numNodes; i++ { - err := testNet.CreateGenesisNode(latestVersion, 10000000, upgradeHeight, testnet.DefaultResources) + err := testNet.CreateGenesisNode(ctx, latestVersion, 10000000, upgradeHeight, testnet.DefaultResources, true) testnet.NoError("failed to create genesis node", err) } logger.Println("Creating txsim") - endpoints, err := testNet.RemoteGRPCEndpoints() + endpoints, err := testNet.RemoteGRPCEndpoints(ctx) testnet.NoError("failed to get remote gRPC endpoints", err) - err = testNet.CreateTxClient("txsim", testnet.TxsimVersion, 1, "100-2000", 100, testnet.DefaultResources, endpoints[0]) + err = testNet.CreateTxClient(ctx, "txsim", testnet.TxsimVersion, 1, "100-2000", 100, testnet.DefaultResources, endpoints[0]) testnet.NoError("failed to create tx client", err) logger.Println("Setting up testnet") - testnet.NoError("Failed to setup testnet", testNet.Setup()) + testnet.NoError("Failed to setup testnet", testNet.Setup(ctx)) logger.Println("Starting testnet") - testnet.NoError("Failed to start testnet", testNet.Start()) + testnet.NoError("Failed to start testnet", testNet.Start(ctx)) heightBefore := upgradeHeight - 1 for i := 0; i < numNodes; i++ { @@ -90,7 +89,7 @@ func MajorUpgradeToV2(logger *log.Logger) error { return fmt.Errorf("failed to get height: %w", err) } - if err := node.Upgrade(latestVersion); err != nil { + if err := node.Upgrade(ctx, latestVersion); err != nil { return fmt.Errorf("failed to restart node: %w", err) } diff --git a/test/e2e/minor_version_compatibility.go b/test/e2e/minor_version_compatibility.go index d0fd6314e9..c13d93f23c 100644 --- a/test/e2e/minor_version_compatibility.go +++ b/test/e2e/minor_version_compatibility.go @@ -15,7 +15,6 @@ import ( v1 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v1" v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" "github.com/celestiaorg/celestia-app/v3/test/e2e/testnet" - "github.com/celestiaorg/knuu/pkg/knuu" ) func MinorVersionCompatibility(logger *log.Logger) error { @@ -32,43 +31,45 @@ func MinorVersionCompatibility(logger *log.Logger) error { r := rand.New(rand.NewSource(seed)) logger.Println("Running minor version compatibility test", "versions", versions) - testNet, err := testnet.New("runMinorVersionCompatibility", seed, nil, "test") - testnet.NoError("failed to create testnet", err) - ctx, cancel := context.WithCancel(context.Background()) defer cancel() - defer testNet.Cleanup() + testNet, err := testnet.New(ctx, "runMinorVersionCompatibility", seed, nil, "test") + testnet.NoError("failed to create testnet", err) + + defer testNet.Cleanup(ctx) testNet.SetConsensusParams(app.DefaultInitialConsensusParams()) // preload all docker images - preloader, err := knuu.NewPreloader() + preloader, err := testNet.NewPreloader() testnet.NoError("failed to create preloader", err) - defer func() { _ = preloader.EmptyImages() }() + defer func() { _ = preloader.EmptyImages(ctx) }() for _, v := range versions { - testnet.NoError("failed to add image", preloader.AddImage(testnet.DockerImageName(v.String()))) + testnet.NoError("failed to add image", preloader.AddImage(ctx, testnet.DockerImageName(v.String()))) } for i := 0; i < numNodes; i++ { // each node begins with a random version within the same major version set v := versions.Random(r).String() logger.Println("Starting node", "node", i, "version", v) - testnet.NoError("failed to create genesis node", testNet.CreateGenesisNode(v, 10000000, 0, testnet.DefaultResources)) + + testnet.NoError("failed to create genesis node", + testNet.CreateGenesisNode(ctx, v, 10000000, 0, testnet.DefaultResources, false)) } logger.Println("Creating txsim") - endpoints, err := testNet.RemoteGRPCEndpoints() + endpoints, err := testNet.RemoteGRPCEndpoints(ctx) testnet.NoError("failed to get remote gRPC endpoints", err) - err = testNet.CreateTxClient("txsim", testnet.TxsimVersion, 1, "100-2000", 100, testnet.DefaultResources, endpoints[0]) + err = testNet.CreateTxClient(ctx, "txsim", testnet.TxsimVersion, 1, "100-2000", 100, testnet.DefaultResources, endpoints[0]) testnet.NoError("failed to create tx client", err) // start the testnet logger.Println("Setting up testnet") - testnet.NoError("Failed to setup testnet", testNet.Setup()) + testnet.NoError("Failed to setup testnet", testNet.Setup(ctx)) logger.Println("Starting testnet") - testnet.NoError("Failed to start testnet", testNet.Start()) + testnet.NoError("Failed to start testnet", testNet.Start(ctx)) for i := 0; i < len(versions)*2; i++ { // FIXME: skip the first node because we need them available to @@ -84,10 +85,10 @@ func MinorVersionCompatibility(logger *log.Logger) error { newVersion := versions.Random(r).String() logger.Println("Upgrading node", "node", i%numNodes+1, "version", newVersion) - testnet.NoError("failed to upgrade node", testNet.Node(i%numNodes).Upgrade(newVersion)) + testnet.NoError("failed to upgrade node", testNet.Node(i%numNodes).Upgrade(ctx, newVersion)) time.Sleep(10 * time.Second) // wait for the node to reach two more heights - testnet.NoError("failed to wait for height", waitForHeight(ctx, client, heightBefore+2, 30*time.Second)) + testnet.NoError("failed to wait for height", waitForHeight(ctx, client, heightBefore+2, time.Minute)) } heights := make([]int64, 4) diff --git a/test/e2e/simple.go b/test/e2e/simple.go index 6673129f41..7999c726a0 100644 --- a/test/e2e/simple.go +++ b/test/e2e/simple.go @@ -15,37 +15,39 @@ import ( // and MsgSends over 30 seconds and then asserts that at least 10 transactions were // committed. func E2ESimple(logger *log.Logger) error { - latestVersion, err := testnet.GetLatestVersion() - testnet.NoError("failed to get latest version", err) + ctx := context.Background() + testNet, err := testnet.New(ctx, "E2ESimple", seed, nil, "test") + testnet.NoError("failed to create testnet", err) - logger.Println("Running simple e2e test", "version", latestVersion) + defer testNet.Cleanup(ctx) - testNet, err := testnet.New("E2ESimple", seed, nil, "test") - testnet.NoError("failed to create testnet", err) + latestVersion, err := testnet.GetLatestVersion() + testnet.NoError("failed to get latest version", err) - defer testNet.Cleanup() + logger.Println("Running E2ESimple test", "version", latestVersion) logger.Println("Creating testnet validators") - testnet.NoError("failed to create genesis nodes", testNet.CreateGenesisNodes(4, latestVersion, 10000000, 0, testnet.DefaultResources)) + 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() + endpoints, err := testNet.RemoteGRPCEndpoints(ctx) testnet.NoError("failed to get remote gRPC endpoints", err) - err = testNet.CreateTxClient("txsim", testnet.TxsimVersion, 10, + 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()) + testnet.NoError("failed to setup testnets", testNet.Setup(ctx)) logger.Println("Starting testnets") - testnet.NoError("failed to start testnets", testNet.Start()) + 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(context.Background(), testNet.Node(0).AddressRPC()) + blockchain, err := testnode.ReadBlockchainHeaders(ctx, testNet.Node(0).AddressRPC()) testnet.NoError("failed to read blockchain headers", err) totalTxs := 0 diff --git a/test/e2e/testnet/defaults.go b/test/e2e/testnet/defaults.go index 1ea4bbb585..6c6da2cbf9 100644 --- a/test/e2e/testnet/defaults.go +++ b/test/e2e/testnet/defaults.go @@ -1,10 +1,12 @@ package testnet +import "k8s.io/apimachinery/pkg/api/resource" + var DefaultResources = Resources{ - MemoryRequest: "400Mi", - MemoryLimit: "400Mi", - CPU: "300m", - Volume: "1Gi", + MemoryRequest: resource.MustParse("400Mi"), + MemoryLimit: resource.MustParse("400Mi"), + CPU: resource.MustParse("300m"), + Volume: resource.MustParse("1Gi"), } const ( diff --git a/test/e2e/testnet/node.go b/test/e2e/testnet/node.go index addbc98066..14293da5fc 100644 --- a/test/e2e/testnet/node.go +++ b/test/e2e/testnet/node.go @@ -2,12 +2,11 @@ package testnet import ( + "context" "fmt" "os" "path/filepath" - "github.com/celestiaorg/celestia-app/v3/test/util/genesis" - "github.com/celestiaorg/knuu/pkg/knuu" serverconfig "github.com/cosmos/cosmos-sdk/server/config" "github.com/rs/zerolog/log" "github.com/tendermint/tendermint/config" @@ -18,6 +17,13 @@ import ( "github.com/tendermint/tendermint/privval" "github.com/tendermint/tendermint/rpc/client/http" "github.com/tendermint/tendermint/types" + "k8s.io/apimachinery/pkg/api/resource" + + "github.com/celestiaorg/celestia-app/v3/test/util/genesis" + "github.com/celestiaorg/knuu/pkg/instance" + "github.com/celestiaorg/knuu/pkg/knuu" + "github.com/celestiaorg/knuu/pkg/sidecars/netshaper" + "github.com/celestiaorg/knuu/pkg/sidecars/observability" ) const ( @@ -41,7 +47,9 @@ type Node struct { SignerKey crypto.PrivKey NetworkKey crypto.PrivKey SelfDelegation int64 - Instance *knuu.Instance + Instance *instance.Instance + sidecars []instance.SidecarManager + netShaper *netshaper.NetShaper // a reference to the netshaper sidecar rpcProxyHost string // FIXME: This does not work currently with the reverse proxy @@ -80,16 +88,17 @@ func (n *Node) PullBlockSummaryTraces(path string) ([]trace.Event[schema.BlockSu // Resources defines the resource requirements for a Node. type Resources struct { // MemoryRequest specifies the initial memory allocation for the Node. - MemoryRequest string + MemoryRequest resource.Quantity // MemoryLimit specifies the maximum memory allocation for the Node. - MemoryLimit string + MemoryLimit resource.Quantity // CPU specifies the CPU allocation for the Node. - CPU string + CPU resource.Quantity // Volume specifies the storage volume allocation for the Node. - Volume string + Volume resource.Quantity } func NewNode( + ctx context.Context, name, version string, startHeight, selfDelegation int64, peers []string, @@ -97,79 +106,93 @@ func NewNode( upgradeHeight int64, resources Resources, grafana *GrafanaInfo, + kn *knuu.Knuu, + disableBBR bool, ) (*Node, error) { - instance, err := knuu.NewInstance(name) + knInstance, err := kn.NewInstance(name) if err != nil { return nil, err } - err = instance.SetImage(DockerImageName(version)) + err = knInstance.Build().SetImage(ctx, DockerImageName(version)) if err != nil { return nil, err } - if err := instance.AddPortTCP(rpcPort); err != nil { - return nil, err - } - if err := instance.AddPortTCP(p2pPort); err != nil { - return nil, err - } - if err := instance.AddPortTCP(grpcPort); err != nil { - return nil, err - } - if err := instance.AddPortTCP(tracingPort); err != nil { - return nil, err + for _, port := range []int{rpcPort, p2pPort, grpcPort, tracingPort} { + if err := knInstance.Network().AddPortTCP(port); err != nil { + return nil, err + } } + var sidecars []instance.SidecarManager if grafana != nil { + obsySc := observability.New() + // add support for metrics - if err := instance.SetPrometheusEndpoint(prometheusPort, fmt.Sprintf("knuu-%s", knuu.Scope()), "1m"); err != nil { + if err := obsySc.SetPrometheusEndpoint(prometheusPort, fmt.Sprintf("knuu-%s", kn.Scope), "1m"); err != nil { return nil, fmt.Errorf("setting prometheus endpoint: %w", err) } - if err := instance.SetJaegerEndpoint(14250, 6831, 14268); err != nil { + if err := obsySc.SetJaegerEndpoint(14250, 6831, 14268); err != nil { return nil, fmt.Errorf("error setting jaeger endpoint: %v", err) } - if err := instance.SetOtlpExporter(grafana.Endpoint, grafana.Username, grafana.Token); err != nil { + if err := obsySc.SetOtlpExporter(grafana.Endpoint, grafana.Username, grafana.Token); err != nil { return nil, fmt.Errorf("error setting otlp exporter: %v", err) } - if err := instance.SetJaegerExporter("jaeger-collector.jaeger-cluster.svc.cluster.local:14250"); err != nil { + if err := obsySc.SetJaegerExporter("jaeger-collector.jaeger-cluster.svc.cluster.local:14250"); err != nil { return nil, fmt.Errorf("error setting jaeger exporter: %v", err) } + sidecars = append(sidecars, obsySc) } - err = instance.SetMemory(resources.MemoryRequest, resources.MemoryLimit) + err = knInstance.Resources().SetMemory(resources.MemoryRequest, resources.MemoryLimit) if err != nil { return nil, err } - err = instance.SetCPU(resources.CPU) + err = knInstance.Resources().SetCPU(resources.CPU) if err != nil { return nil, err } - err = instance.AddVolumeWithOwner(remoteRootDir, resources.Volume, 10001) + err = knInstance.Storage().AddVolumeWithOwner(remoteRootDir, resources.Volume, 10001) if err != nil { return nil, err } args := []string{"start", fmt.Sprintf("--home=%s", remoteRootDir), "--rpc.laddr=tcp://0.0.0.0:26657"} + if disableBBR { + args = append(args, "--force-no-bbr") + } if upgradeHeight != 0 { args = append(args, fmt.Sprintf("--v2-upgrade-height=%d", upgradeHeight)) } - err = instance.SetArgs(args...) - if err != nil { + if err := knInstance.Build().SetArgs(args...); err != nil { return nil, err } return &Node{ Name: name, - Instance: instance, + Instance: knInstance, Version: version, StartHeight: startHeight, InitialPeers: peers, SignerKey: signerKey, NetworkKey: networkKey, SelfDelegation: selfDelegation, + sidecars: sidecars, }, nil } -func (n *Node) Init(genesis *types.GenesisDoc, peers []string, configOptions ...Option) error { +func (n *Node) EnableNetShaper() { + n.netShaper = netshaper.New() + n.sidecars = append(n.sidecars, n.netShaper) +} + +func (n *Node) SetLatencyAndJitter(latency, jitter int64) error { + if n.netShaper == nil { + return fmt.Errorf("netshaper is not enabled") + } + return n.netShaper.SetLatencyAndJitter(latency, jitter) +} + +func (n *Node) Init(ctx context.Context, genesis *types.GenesisDoc, peers []string, configOptions ...Option) error { if len(peers) == 0 { return fmt.Errorf("no peers provided") } @@ -190,7 +213,7 @@ func (n *Node) Init(genesis *types.GenesisDoc, peers []string, configOptions ... } // Create and write the config file - cfg, err := MakeConfig(n, configOptions...) + cfg, err := MakeConfig(ctx, n, configOptions...) if err != nil { return fmt.Errorf("making config: %w", err) } @@ -235,12 +258,17 @@ func (n *Node) Init(genesis *types.GenesisDoc, peers []string, configOptions ... return fmt.Errorf("writing address book: %w", err) } - err = n.Instance.Commit() - if err != nil { + if err := n.Instance.Build().Commit(ctx); err != nil { return fmt.Errorf("committing instance: %w", err) } - if err = n.Instance.AddFolder(nodeDir, remoteRootDir, "10001:10001"); err != nil { + for _, sc := range n.sidecars { + if err := n.Instance.Sidecars().Add(ctx, sc); err != nil { + return fmt.Errorf("adding sidecar: %w", err) + } + } + + if err = n.Instance.Storage().AddFolder(nodeDir, remoteRootDir, "10001:10001"); err != nil { return fmt.Errorf("copying over node %s directory: %w", n.Name, err) } return nil @@ -249,8 +277,8 @@ func (n *Node) Init(genesis *types.GenesisDoc, peers []string, configOptions ... // AddressP2P returns a P2P endpoint address for the node. This is used for // populating the address book. This will look something like: // 3314051954fc072a0678ec0cbac690ad8676ab98@61.108.66.220:26656 -func (n Node) AddressP2P(withID bool) string { - ip, err := n.Instance.GetIP() +func (n Node) AddressP2P(ctx context.Context, withID bool) string { + ip, err := n.Instance.Network().GetIP(ctx) if err != nil { panic(err) } @@ -275,8 +303,8 @@ func (n Node) AddressRPC() string { // } // RemoteAddressGRPC retrieves the gRPC endpoint address of a node within the cluster. -func (n Node) RemoteAddressGRPC() (string, error) { - ip, err := n.Instance.GetIP() +func (n Node) RemoteAddressGRPC(ctx context.Context) (string, error) { + ip, err := n.Instance.Network().GetIP(ctx) if err != nil { return "", err } @@ -284,8 +312,8 @@ func (n Node) RemoteAddressGRPC() (string, error) { } // RemoteAddressRPC retrieves the RPC endpoint address of a node within the cluster. -func (n Node) RemoteAddressRPC() (string, error) { - ip, err := n.Instance.GetIP() +func (n Node) RemoteAddressRPC(ctx context.Context) (string, error) { + ip, err := n.Instance.Network().GetIP(ctx) if err != nil { return "", err } @@ -296,8 +324,8 @@ func (n Node) AddressTracing() string { return n.traceProxyHost } -func (n Node) RemoteAddressTracing() (string, error) { - ip, err := n.Instance.GetIP() +func (n Node) RemoteAddressTracing(ctx context.Context) (string, error) { + ip, err := n.Instance.Network().GetIP(ctx) if err != nil { return "", err } @@ -313,24 +341,25 @@ func (n Node) Client() (*http.HTTP, error) { return http.New(n.AddressRPC(), "/websocket") } -func (n *Node) Start() error { - if err := n.StartAsync(); err != nil { +func (n *Node) Start(ctx context.Context) error { + if err := n.StartAsync(ctx); err != nil { return err } - return n.WaitUntilStartedAndForwardPorts() + return n.WaitUntilStartedAndCreateProxy(ctx) } -func (n *Node) StartAsync() error { - return n.Instance.StartAsync() +func (n *Node) StartAsync(ctx context.Context) error { + return n.Instance.Execution().StartAsync(ctx) } -func (n *Node) WaitUntilStartedAndForwardPorts() error { - if err := n.Instance.WaitInstanceIsRunning(); err != nil { +func (n *Node) WaitUntilStartedAndCreateProxy(ctx context.Context) error { + if err := n.Instance.Execution().WaitInstanceIsRunning(ctx); err != nil { return err } - err, rpcProxyHost := n.Instance.AddHost(rpcPort) + // TODO: It is recommended to use AddHostWithReadyCheck for the proxy + rpcProxyHost, err := n.Instance.Network().AddHost(ctx, rpcPort) if err != nil { return err } @@ -343,7 +372,8 @@ func (n *Node) WaitUntilStartedAndForwardPorts() error { // } // n.grpcProxyHost = grpcProxyHost - err, traceProxyHost := n.Instance.AddHost(tracingPort) + // TODO: It is recommended to use AddHostWithReadyCheck for the proxy + traceProxyHost, err := n.Instance.Network().AddHost(ctx, tracingPort) if err != nil { return err } @@ -364,12 +394,12 @@ func (n *Node) GenesisValidator() genesis.Validator { } } -func (n *Node) Upgrade(version string) error { - if err := n.Instance.SetImageInstant(DockerImageName(version)); err != nil { +func (n *Node) Upgrade(ctx context.Context, version string) error { + if err := n.Instance.Execution().UpgradeImage(ctx, DockerImageName(version)); err != nil { return err } - return n.Instance.WaitInstanceIsRunning() + return n.Instance.Execution().WaitInstanceIsRunning(ctx) } func DockerImageName(version string) string { diff --git a/test/e2e/testnet/setup.go b/test/e2e/testnet/setup.go index 620b46cb66..d7db215c34 100644 --- a/test/e2e/testnet/setup.go +++ b/test/e2e/testnet/setup.go @@ -1,6 +1,7 @@ package testnet import ( + "context" "fmt" "strings" "time" @@ -12,14 +13,14 @@ import ( "github.com/tendermint/tendermint/p2p/pex" ) -func MakeConfig(node *Node, opts ...Option) (*config.Config, error) { +func MakeConfig(ctx context.Context, node *Node, opts ...Option) (*config.Config, error) { cfg := app.DefaultConsensusConfig() cfg.TxIndex.Indexer = "kv" cfg.Consensus.TimeoutPropose = config.DefaultConsensusConfig().TimeoutPropose cfg.Consensus.TimeoutCommit = config.DefaultConsensusConfig().TimeoutCommit cfg.Moniker = node.Name cfg.RPC.ListenAddress = "tcp://0.0.0.0:26657" - cfg.P2P.ExternalAddress = fmt.Sprintf("tcp://%v", node.AddressP2P(false)) + cfg.P2P.ExternalAddress = fmt.Sprintf("tcp://%v", node.AddressP2P(ctx, false)) cfg.P2P.PersistentPeers = strings.Join(node.InitialPeers, ",") cfg.Instrumentation.Prometheus = true diff --git a/test/e2e/testnet/testnet.go b/test/e2e/testnet/testnet.go index 4b3beebe99..6b4ff136ed 100644 --- a/test/e2e/testnet/testnet.go +++ b/test/e2e/testnet/testnet.go @@ -13,6 +13,7 @@ import ( "github.com/celestiaorg/celestia-app/v3/app/encoding" "github.com/celestiaorg/celestia-app/v3/test/util/genesis" "github.com/celestiaorg/knuu/pkg/knuu" + "github.com/celestiaorg/knuu/pkg/preloader" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/rs/zerolog/log" @@ -26,26 +27,43 @@ type Testnet struct { keygen *keyGenerator grafana *GrafanaInfo txClients []*TxSim + knuu *knuu.Knuu } -func New(name string, seed int64, grafana *GrafanaInfo, chainID string, +func New(ctx context.Context, name string, seed int64, grafana *GrafanaInfo, chainID string, genesisModifiers ...genesis.Modifier) ( *Testnet, error, ) { identifier := fmt.Sprintf("%s_%s", name, time.Now().Format("20060102_150405")) - if err := knuu.InitializeWithScope(identifier); err != nil { + kn, err := knuu.New(ctx, knuu.Options{ + Scope: identifier, + ProxyEnabled: true, + // if the tests timeout, pass the timeout option + // Timeout: 120 * time.Minute, + }) + if err != nil { return nil, err } + log.Info().Str("scope", kn.Scope).Msg("Knuu initialized") + return &Testnet{ seed: seed, nodes: make([]*Node, 0), genesis: genesis.NewDefaultGenesis().WithChainID(chainID).WithModifiers(genesisModifiers...), keygen: newKeyGenerator(seed), grafana: grafana, + knuu: kn, }, nil } +func (t *Testnet) NewPreloader() (*preloader.Preloader, error) { + if t.knuu == nil { + return nil, errors.New("knuu is not initialized") + } + return preloader.New(t.knuu.SystemDependencies) +} + func (t *Testnet) SetConsensusParams(params *tmproto.ConsensusParams) { t.genesis.WithConsensusParams(params) } @@ -54,12 +72,14 @@ func (t *Testnet) SetConsensusMaxBlockSize(size int64) { t.genesis.ConsensusParams.Block.MaxBytes = size } -func (t *Testnet) CreateGenesisNode(version string, selfDelegation, upgradeHeight int64, resources Resources) error { +func (t *Testnet) CreateGenesisNode(ctx context.Context, version string, selfDelegation, upgradeHeight int64, resources Resources, disableBBR bool) error { signerKey := t.keygen.Generate(ed25519Type) networkKey := t.keygen.Generate(ed25519Type) - node, err := NewNode(fmt.Sprintf("val%d", len(t.nodes)), version, 0, - selfDelegation, nil, signerKey, networkKey, upgradeHeight, resources, - t.grafana) + node, err := NewNode(ctx, + fmt.Sprintf("val%d", len(t.nodes)), version, 0, + selfDelegation, nil, signerKey, networkKey, + upgradeHeight, resources, t.grafana, t.knuu, disableBBR, + ) if err != nil { return err } @@ -70,16 +90,17 @@ func (t *Testnet) CreateGenesisNode(version string, selfDelegation, upgradeHeigh return nil } -func (t *Testnet) CreateGenesisNodes(num int, version string, selfDelegation, upgradeHeight int64, resources Resources) error { +func (t *Testnet) CreateGenesisNodes(ctx context.Context, num int, version string, selfDelegation, upgradeHeight int64, resources Resources, disableBBR bool) error { for i := 0; i < num; i++ { - if err := t.CreateGenesisNode(version, selfDelegation, upgradeHeight, resources); err != nil { + if err := t.CreateGenesisNode(ctx, version, selfDelegation, upgradeHeight, resources, disableBBR); err != nil { return err } } return nil } -func (t *Testnet) CreateTxClients(version string, +func (t *Testnet) CreateTxClients(ctx context.Context, + version string, sequences int, blobRange string, blobPerSequence int, @@ -88,7 +109,7 @@ func (t *Testnet) CreateTxClients(version string, ) error { for i, grpcEndpoint := range grpcEndpoints { name := fmt.Sprintf("txsim%d", i) - err := t.CreateTxClient(name, version, sequences, + err := t.CreateTxClient(ctx, name, version, sequences, blobRange, blobPerSequence, resources, grpcEndpoint) if err != nil { log.Err(err).Str("name", name). @@ -114,8 +135,9 @@ func (t *Testnet) CreateTxClients(version string, // pollTime: time in seconds between each sequence // resources: resources to be allocated to the txsim // grpcEndpoint: grpc endpoint of the node to which the txsim will connect and send transactions -func (t *Testnet) CreateTxClient(name, - version string, +func (t *Testnet) CreateTxClient( + ctx context.Context, + name, version string, sequences int, blobRange string, blobPerSequence int, @@ -135,15 +157,15 @@ func (t *Testnet) CreateTxClient(name, } // Create a txsim node using the key stored in the txsimKeyringDir - txsim, err := CreateTxClient(name, version, grpcEndpoint, t.seed, - sequences, blobRange, blobPerSequence, 1, resources, txsimRootDir) + txsim, err := CreateTxClient(ctx, name, version, grpcEndpoint, t.seed, + sequences, blobRange, blobPerSequence, 1, resources, txsimRootDir, t.knuu) if err != nil { log.Err(err). Str("name", name). Msg("error creating txsim") return err } - err = txsim.Instance.Commit() + err = txsim.Instance.Build().Commit(ctx) if err != nil { log.Err(err). Str("name", name). @@ -152,7 +174,7 @@ func (t *Testnet) CreateTxClient(name, } // copy over the keyring directory to the txsim instance - err = txsim.Instance.AddFolder(txsimKeyringDir, txsimRootDir, "10001:10001") + err = txsim.Instance.Storage().AddFolder(txsimKeyringDir, txsimRootDir, "10001:10001") if err != nil { log.Err(err). Str("directory", txsimKeyringDir). @@ -165,9 +187,9 @@ func (t *Testnet) CreateTxClient(name, return nil } -func (t *Testnet) StartTxClients() error { +func (t *Testnet) StartTxClients(ctx context.Context) error { for _, txsim := range t.txClients { - err := txsim.Instance.StartWithoutWait() + err := txsim.Instance.Execution().StartAsync(ctx) if err != nil { log.Err(err). Str("name", txsim.Name). @@ -180,7 +202,7 @@ func (t *Testnet) StartTxClients() error { } // wait for txsims to start for _, txsim := range t.txClients { - err := txsim.Instance.WaitInstanceIsRunning() + err := txsim.Instance.Execution().WaitInstanceIsRunning(ctx) if err != nil { return fmt.Errorf("txsim %s failed to run: %w", txsim.Name, err) } @@ -232,12 +254,14 @@ func (t *Testnet) CreateAccount(name string, tokens int64, txsimKeyringDir strin return kr, nil } -func (t *Testnet) CreateNode(version string, startHeight, upgradeHeight int64, resources Resources) error { +func (t *Testnet) CreateNode(ctx context.Context, version string, startHeight, upgradeHeight int64, resources Resources, disableBBR bool) error { signerKey := t.keygen.Generate(ed25519Type) networkKey := t.keygen.Generate(ed25519Type) - node, err := NewNode(fmt.Sprintf("val%d", len(t.nodes)), version, - startHeight, 0, nil, signerKey, networkKey, upgradeHeight, resources, - t.grafana) + node, err := NewNode(ctx, + fmt.Sprintf("val%d", len(t.nodes)), version, + startHeight, 0, nil, signerKey, networkKey, + upgradeHeight, resources, t.grafana, t.knuu, disableBBR, + ) if err != nil { return err } @@ -245,7 +269,7 @@ func (t *Testnet) CreateNode(version string, startHeight, upgradeHeight int64, r return nil } -func (t *Testnet) Setup(configOpts ...Option) error { +func (t *Testnet) Setup(ctx context.Context, configOpts ...Option) error { genesis, err := t.genesis.Export() if err != nil { return err @@ -257,11 +281,11 @@ func (t *Testnet) Setup(configOpts ...Option) error { peers := make([]string, 0, len(t.nodes)-1) for _, peer := range t.nodes { if peer.Name != node.Name { - peers = append(peers, peer.AddressP2P(true)) + peers = append(peers, peer.AddressP2P(ctx, true)) } } - err := node.Init(genesis, peers, configOpts...) + err := node.Init(ctx, genesis, peers, configOpts...) if err != nil { return err } @@ -289,10 +313,10 @@ func (t *Testnet) RPCEndpoints() []string { // RemoteGRPCEndpoints retrieves the gRPC endpoint addresses of the // testnet's validator nodes. -func (t *Testnet) RemoteGRPCEndpoints() ([]string, error) { +func (t *Testnet) RemoteGRPCEndpoints(ctx context.Context) ([]string, error) { grpcEndpoints := make([]string, len(t.nodes)) for idx, node := range t.nodes { - grpcEP, err := node.RemoteAddressGRPC() + grpcEP, err := node.RemoteAddressGRPC(ctx) if err != nil { return nil, err } @@ -311,10 +335,10 @@ func (t *Testnet) GetGenesisValidators() []genesis.Validator { // RemoteRPCEndpoints retrieves the RPC endpoint addresses of the testnet's // validator nodes. -func (t *Testnet) RemoteRPCEndpoints() ([]string, error) { +func (t *Testnet) RemoteRPCEndpoints(ctx context.Context) ([]string, error) { rpcEndpoints := make([]string, len(t.nodes)) for idx, node := range t.nodes { - grpcEP, err := node.RemoteAddressRPC() + grpcEP, err := node.RemoteAddressRPC(ctx) if err != nil { return nil, err } @@ -325,7 +349,7 @@ func (t *Testnet) RemoteRPCEndpoints() ([]string, error) { // WaitToSync waits for the started nodes to sync with the network and move // past the genesis block. -func (t *Testnet) WaitToSync() error { +func (t *Testnet) WaitToSync(ctx context.Context) error { genesisNodes := make([]*Node, 0) for _, node := range t.nodes { if node.StartHeight == 0 { @@ -340,7 +364,7 @@ func (t *Testnet) WaitToSync() error { return fmt.Errorf("failed to initialize client for node %s: %w", node.Name, err) } for i := 0; i < 10; i++ { - resp, err := client.Status(context.Background()) + resp, err := client.Status(ctx) if err == nil { if resp.SyncInfo.LatestBlockHeight > 0 { log.Info().Int("attempts", i).Str("name", node.Name).Msg( @@ -361,10 +385,10 @@ func (t *Testnet) WaitToSync() error { return nil } -// StartNodes starts the testnet nodes and forwards the ports. +// 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() error { +func (t *Testnet) StartNodes(ctx context.Context) error { genesisNodes := make([]*Node, 0) for _, node := range t.nodes { if node.StartHeight == 0 { @@ -373,56 +397,45 @@ func (t *Testnet) StartNodes() error { } // start genesis nodes asynchronously for _, node := range genesisNodes { - err := node.StartAsync() + err := node.StartAsync(ctx) if err != nil { return fmt.Errorf("node %s failed to start: %w", node.Name, err) } } - log.Info().Msg("forwarding ports for genesis nodes") + log.Info().Msg("create endpoint proxies for genesis nodes") // wait for instances to be running for _, node := range genesisNodes { - err := node.WaitUntilStartedAndForwardPorts() + err := node.WaitUntilStartedAndCreateProxy(ctx) if err != nil { + log.Err(err).Str("name", node.Name).Str("version", + node.Version).Msg("failed to start and forward ports") return fmt.Errorf("node %s failed to start: %w", node.Name, err) } + log.Info().Str("name", node.Name).Str("version", + node.Version).Msg("started and ports forwarded") } return nil } -func (t *Testnet) Start() error { - // start nodes and forward ports - err := t.StartNodes() +func (t *Testnet) Start(ctx context.Context) error { + // start nodes and setup proxies + 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() + err = t.WaitToSync(ctx) if err != nil { return err } - return t.StartTxClients() + return t.StartTxClients(ctx) } -func (t *Testnet) Cleanup() { - // cleanup txsim - for _, txsim := range t.txClients { - err := txsim.Instance.Destroy() - if err != nil { - log.Err(err). - Str("name", txsim.Name). - Msg("txsim failed to cleanup") - } - } - // cleanup nodes - for _, node := range t.nodes { - err := node.Instance.Destroy() - if err != nil { - log.Err(err). - Str("name", node.Name). - Msg("node failed to cleanup") - } +func (t *Testnet) Cleanup(ctx context.Context) { + if err := t.knuu.CleanUp(ctx); err != nil { + log.Err(err).Msg("failed to cleanup knuu") } } diff --git a/test/e2e/testnet/txsimNode.go b/test/e2e/testnet/txsimNode.go index 994d87a831..66bd005f3e 100644 --- a/test/e2e/testnet/txsimNode.go +++ b/test/e2e/testnet/txsimNode.go @@ -2,8 +2,10 @@ package testnet import ( + "context" "fmt" + "github.com/celestiaorg/knuu/pkg/instance" "github.com/celestiaorg/knuu/pkg/knuu" "github.com/rs/zerolog/log" ) @@ -18,10 +20,11 @@ func txsimDockerImageName(version string) string { type TxSim struct { Name string - Instance *knuu.Instance + Instance *instance.Instance } func CreateTxClient( + ctx context.Context, name, version string, endpoint string, seed int64, @@ -31,8 +34,9 @@ func CreateTxClient( pollTime int, resources Resources, volumePath string, + knuu *knuu.Knuu, ) (*TxSim, error) { - instance, err := knuu.NewInstance(name) + txIns, err := knuu.NewInstance(name) if err != nil { return nil, err } @@ -41,7 +45,7 @@ func CreateTxClient( Str("name", name). Str("image", image). Msg("setting image for tx client") - err = instance.SetImage(image) + err = txIns.Build().SetImage(ctx, image) if err != nil { log.Err(err). Str("name", name). @@ -49,15 +53,15 @@ func CreateTxClient( Msg("failed to set image for tx client") return nil, err } - err = instance.SetMemory(resources.MemoryRequest, resources.MemoryLimit) + err = txIns.Resources().SetMemory(resources.MemoryRequest, resources.MemoryLimit) if err != nil { return nil, err } - err = instance.SetCPU(resources.CPU) + err = txIns.Resources().SetCPU(resources.CPU) if err != nil { return nil, err } - err = instance.AddVolumeWithOwner(volumePath, resources.Volume, 10001) + err = txIns.Storage().AddVolumeWithOwner(volumePath, resources.Volume, 10001) if err != nil { return nil, err } @@ -71,13 +75,12 @@ func CreateTxClient( fmt.Sprintf("-s %s ", blobRange), } - err = instance.SetArgs(args...) - if err != nil { + if err := txIns.Build().SetArgs(args...); err != nil { return nil, err } return &TxSim{ Name: name, - Instance: instance, + Instance: txIns, }, nil } diff --git a/tools/blocketa/README.md b/tools/blocketa/README.md index c4968e2c22..f7de7539b5 100644 --- a/tools/blocketa/README.md +++ b/tools/blocketa/README.md @@ -15,4 +15,4 @@ arrivalTime: 2024-08-28 17:24:23.483542677 +0000 UTC ``` > [!NOTE] -> The block time is currently hard-coded. If you're running this for a network with a different block time, you'll need to update the `blockTime` constant in the main.go file. You can use https://www.mintscan.io/celestia/block/ or the blocktime tool. +> The block time is currently hard-coded. If you're running this for a network with a different block time, you'll need to update the `blockTime` constant in the main.go file. You can use [https://www.mintscan.io/celestia/block](https://www.mintscan.io/celestia/block/) or the blocktime tool. diff --git a/tools/blocketa/main.go b/tools/blocketa/main.go index 54c21c66a1..7706ffd431 100644 --- a/tools/blocketa/main.go +++ b/tools/blocketa/main.go @@ -14,7 +14,7 @@ const ( // blockTime is the observed average time between blocks. You can update this // value based on the block time on https://www.mintscan.io/celestia/block/ or // the output from the blocktime tool. - blockTime = 12.05 // seconds between blocks for Mocha + blockTime = 11.75 // seconds between blocks on Mainnet Beta. // exampleArabicaRPC is an example node RPC endpoint for the Arabica testnet. exampleArabicaRPC = "https://rpc.celestia-arabica-11.com:443" @@ -22,11 +22,17 @@ const ( // exampleMochaRPC is an example node RPC endpoint for the Mocha testnet. exampleMochaRPC = "https://celestia-mocha-rpc.publicnode.com:443" + // exampleMainnetHeight is an example node RPC endpoint for Mainnet Beta. + exampleMainnetRPC = "https://celestia-rpc.publicnode.com:443" + // exampleArabicaHeight is an example block height for the Arabica testnet. exampleArabicaHeight = 1751707 // exampleMochaHeight is an example block height for the Mocha testnet. exampleMochaHeight = 2585031 + + // exampleMainnetHeight is an example block height for Mainnet Beta. + exampleMainnetHeight = 2371495 ) func main() { @@ -40,6 +46,7 @@ func Run() error { fmt.Printf("Usage: %s \n", os.Args[0]) fmt.Printf("Example: %s %s %v\n", os.Args[0], exampleArabicaRPC, exampleArabicaHeight) fmt.Printf("Example: %s %s %v\n", os.Args[0], exampleMochaRPC, exampleMochaHeight) + fmt.Printf("Example: %s %s %v\n", os.Args[0], exampleMainnetRPC, exampleMainnetHeight) return nil } @@ -65,7 +72,7 @@ func Run() error { } diffInBlockHeight := targetBlockHeight - currentHeight diffInSeconds := blockTime * float64(diffInBlockHeight) - diffInTime, err := time.ParseDuration(fmt.Sprintf("%vs", diffInSeconds)) + diffInTime, err := time.ParseDuration(fmt.Sprintf("%.0fs", diffInSeconds)) if err != nil { return err } diff --git a/tools/blockheight/main.go b/tools/blockheight/main.go index c20342aec9..e309b29b6f 100644 --- a/tools/blockheight/main.go +++ b/tools/blockheight/main.go @@ -14,13 +14,25 @@ const ( // blockTime is the observed average time between blocks. You can update this // value based on the block time on https://www.mintscan.io/celestia/block/ or // the output from the blocktime tool. - blockTime = 11.30 // seconds between blocks for Arabica + blockTime = 11.75 // seconds between blocks on Mainnet Beta. - // exampleNodeRPC is an example node RPC endpoint for the Arabica testnet. - exampleNodeRPC = "https://rpc.celestia-arabica-11.com:443" + // exampleArabicaRPC is an example node RPC endpoint for the Arabica testnet. + exampleArabicaRPC = "https://rpc.celestia-arabica-11.com:443" - // targetTime is an example target time for the block height prediction. - targetTime = "2024-08-14T14:00:00" + // exampleMochaRPC is an example node RPC endpoint for the Mocha testnet. + exampleMochaRPC = "https://celestia-mocha-rpc.publicnode.com:443" + + // exampleMainnetHeight is an example node RPC endpoint for Mainnet Beta. + exampleMainnetRPC = "https://celestia-rpc.publicnode.com:443" + + // exampleArabicaTime is an example target time for the block height prediction. + exampleArabicaTime = "2024-08-19T14:00:00" + + // exampleMochaTime is an example target time for the block height prediction. + exampleMochaTime = "2024-08-28T14:00:00" + + // exampleMainnetTime is an example target time for the block height prediction. + exampleMainnetTime = "2024-09-18T14:00:00" // layout is the expected time format for targetTime. layout = "2006-01-02T15:04:05" @@ -35,7 +47,9 @@ func main() { func Run() error { if len(os.Args) < 3 { fmt.Printf("Usage: %s \n", os.Args[0]) - fmt.Printf("Example: %s %s %s\n", os.Args[0], exampleNodeRPC, targetTime) + fmt.Printf("Example: %s %s %s\n", os.Args[0], exampleArabicaRPC, exampleArabicaTime) + fmt.Printf("Example: %s %s %s\n", os.Args[0], exampleMochaRPC, exampleMochaTime) + fmt.Printf("Example: %s %s %s\n", os.Args[0], exampleMainnetRPC, exampleMainnetTime) return nil } diff --git a/x/blob/README.md b/x/blob/README.md index 3f1e0484ae..efa1f74858 100644 --- a/x/blob/README.md +++ b/x/blob/README.md @@ -49,6 +49,7 @@ message Params { `GasPerBlobByte` is the amount of gas that is consumed per byte of blob data when a `MsgPayForBlobs` is processed. Currently, the default value is 8. This value is set below that of normal transaction gas consumption, which is 10. +`GasPerBlobByte` was a governance-modifiable parameter in v1 and v2. In app v3 and above, it is a versioned parameter, meaning it can only be changed through hard fork upgrades. #### `GovMaxSquareSize` diff --git a/x/blob/ante/ante.go b/x/blob/ante/ante.go index fe58eae87c..3c5249b291 100644 --- a/x/blob/ante/ante.go +++ b/x/blob/ante/ante.go @@ -1,6 +1,8 @@ package ante import ( + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" + v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" "github.com/celestiaorg/celestia-app/v3/x/blob/types" "cosmossdk.io/errors" @@ -33,8 +35,12 @@ func (d MinGasPFBDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool // NOTE: here we assume only one PFB per transaction if pfb, ok := m.(*types.MsgPayForBlobs); ok { if gasPerByte == 0 { - // lazily fetch the gas per byte param - gasPerByte = d.k.GasPerBlobByte(ctx) + if ctx.BlockHeader().Version.App <= v2.Version { + // lazily fetch the gas per byte param + gasPerByte = d.k.GasPerBlobByte(ctx) + } else { + gasPerByte = appconsts.GasPerBlobByte(ctx.BlockHeader().Version.App) + } } gasToConsume := pfb.Gas(gasPerByte) if gasToConsume > txGas { diff --git a/x/blob/ante/ante_test.go b/x/blob/ante/ante_test.go index e1f16e2b7a..6be76d77d9 100644 --- a/x/blob/ante/ante_test.go +++ b/x/blob/ante/ante_test.go @@ -1,15 +1,20 @@ package ante_test import ( + "fmt" "testing" "github.com/celestiaorg/celestia-app/v3/app" "github.com/celestiaorg/celestia-app/v3/app/encoding" + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" + v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" ante "github.com/celestiaorg/celestia-app/v3/x/blob/ante" blob "github.com/celestiaorg/celestia-app/v3/x/blob/types" "github.com/celestiaorg/go-square/v2/share" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/tendermint/tendermint/proto/tendermint/version" ) const ( @@ -22,8 +27,9 @@ func TestPFBAnteHandler(t *testing.T) { testCases := []struct { name string pfb *blob.MsgPayForBlobs - txGas uint64 + txGas func(uint32) uint32 gasConsumed uint64 + versions []uint64 wantErr bool }{ { @@ -32,8 +38,11 @@ func TestPFBAnteHandler(t *testing.T) { // 1 share = 512 bytes = 5120 gas BlobSizes: []uint32{uint32(share.AvailableBytesFromSparseShares(1))}, }, - txGas: share.ShareSize * testGasPerBlobByte, + txGas: func(testGasPerBlobByte uint32) uint32 { + return share.ShareSize * testGasPerBlobByte + }, gasConsumed: 0, + versions: []uint64{v2.Version, appconsts.LatestVersion}, wantErr: false, }, { @@ -41,8 +50,11 @@ func TestPFBAnteHandler(t *testing.T) { pfb: &blob.MsgPayForBlobs{ BlobSizes: []uint32{uint32(share.AvailableBytesFromSparseShares(1)), uint32(share.AvailableBytesFromSparseShares(2))}, }, - txGas: 3 * share.ShareSize * testGasPerBlobByte, + txGas: func(testGasPerBlobByte uint32) uint32 { + return 3 * share.ShareSize * testGasPerBlobByte + }, gasConsumed: 0, + versions: []uint64{v2.Version, appconsts.LatestVersion}, wantErr: false, }, { @@ -51,8 +63,11 @@ func TestPFBAnteHandler(t *testing.T) { // 2 share = 1024 bytes = 10240 gas BlobSizes: []uint32{uint32(share.AvailableBytesFromSparseShares(1) + 1)}, }, - txGas: 2*share.ShareSize*testGasPerBlobByte - 1, + txGas: func(testGasPerBlobByte uint32) uint32 { + return 2*share.ShareSize*testGasPerBlobByte - 1 + }, gasConsumed: 0, + versions: []uint64{v2.Version, appconsts.LatestVersion}, wantErr: true, }, { @@ -60,8 +75,11 @@ func TestPFBAnteHandler(t *testing.T) { pfb: &blob.MsgPayForBlobs{ BlobSizes: []uint32{uint32(share.AvailableBytesFromSparseShares(1)), uint32(share.AvailableBytesFromSparseShares(2))}, }, - txGas: 3*share.ShareSize*testGasPerBlobByte - 1, + txGas: func(testGasPerBlobByte uint32) uint32 { + return 3*share.ShareSize*testGasPerBlobByte - 1 + }, gasConsumed: 0, + versions: []uint64{v2.Version, appconsts.LatestVersion}, wantErr: true, }, { @@ -70,8 +88,11 @@ func TestPFBAnteHandler(t *testing.T) { // 1 share = 512 bytes = 5120 gas BlobSizes: []uint32{uint32(share.AvailableBytesFromSparseShares(1))}, }, - txGas: share.ShareSize*testGasPerBlobByte + 10000 - 1, + txGas: func(testGasPerBlobByte uint32) uint32 { + return share.ShareSize*testGasPerBlobByte + 10000 - 1 + }, gasConsumed: 10000, + versions: []uint64{v2.Version, appconsts.LatestVersion}, wantErr: true, }, { @@ -80,26 +101,43 @@ func TestPFBAnteHandler(t *testing.T) { // 1 share = 512 bytes = 5120 gas BlobSizes: []uint32{uint32(share.AvailableBytesFromSparseShares(10))}, }, - txGas: 1000000, + txGas: func(_ uint32) uint32 { + return 1000000 + }, gasConsumed: 10000, + versions: []uint64{v2.Version, appconsts.LatestVersion}, wantErr: false, }, } for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - anteHandler := ante.NewMinGasPFBDecorator(mockBlobKeeper{}) - ctx := sdk.Context{}.WithGasMeter(sdk.NewGasMeter(tc.txGas)).WithIsCheckTx(true) - ctx.GasMeter().ConsumeGas(tc.gasConsumed, "test") - txBuilder := txConfig.NewTxBuilder() - require.NoError(t, txBuilder.SetMsgs(tc.pfb)) - tx := txBuilder.GetTx() - _, err := anteHandler.AnteHandle(ctx, tx, false, func(ctx sdk.Context, _ sdk.Tx, _ bool) (sdk.Context, error) { return ctx, nil }) - if tc.wantErr { - require.Error(t, err) - } else { - require.NoError(t, err) - } - }) + for _, currentVersion := range tc.versions { + t.Run(fmt.Sprintf("%s v%d", tc.name, currentVersion), func(t *testing.T) { + anteHandler := ante.NewMinGasPFBDecorator(mockBlobKeeper{}) + var gasPerBlobByte uint32 + if currentVersion == v2.Version { + gasPerBlobByte = testGasPerBlobByte + } else { + gasPerBlobByte = appconsts.GasPerBlobByte(currentVersion) + } + + ctx := sdk.NewContext(nil, tmproto.Header{ + Version: version.Consensus{ + App: currentVersion, + }, + }, true, nil).WithGasMeter(sdk.NewGasMeter(uint64(tc.txGas(gasPerBlobByte)))).WithIsCheckTx(true) + + ctx.GasMeter().ConsumeGas(tc.gasConsumed, "test") + txBuilder := txConfig.NewTxBuilder() + require.NoError(t, txBuilder.SetMsgs(tc.pfb)) + tx := txBuilder.GetTx() + _, err := anteHandler.AnteHandle(ctx, tx, false, func(ctx sdk.Context, _ sdk.Tx, _ bool) (sdk.Context, error) { return ctx, nil }) + if tc.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } } } diff --git a/x/blob/keeper/gas_test.go b/x/blob/keeper/gas_test.go index 8c7bd534ff..a1e17a2bdd 100644 --- a/x/blob/keeper/gas_test.go +++ b/x/blob/keeper/gas_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "testing" + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" "github.com/celestiaorg/celestia-app/v3/x/blob/types" "github.com/celestiaorg/go-square/v2/share" sdk "github.com/cosmos/cosmos-sdk/types" @@ -23,33 +24,33 @@ func TestPayForBlobGas(t *testing.T) { { name: "1 byte blob", // occupies 1 share msg: types.MsgPayForBlobs{BlobSizes: []uint32{1}}, - wantGasConsumed: uint64(1*share.ShareSize*types.DefaultGasPerBlobByte + paramLookUpCost), // 1 share * 512 bytes per share * 8 gas per byte + 1060 gas for fetching param = 5156 gas + wantGasConsumed: uint64(1*share.ShareSize*appconsts.GasPerBlobByte(appconsts.LatestVersion) + paramLookUpCost), // 1 share * 512 bytes per share * 8 gas per byte + 1060 gas for fetching param = 5156 gas }, { name: "100 byte blob", // occupies 1 share msg: types.MsgPayForBlobs{BlobSizes: []uint32{100}}, - wantGasConsumed: uint64(1*share.ShareSize*types.DefaultGasPerBlobByte + paramLookUpCost), + wantGasConsumed: uint64(1*share.ShareSize*appconsts.GasPerBlobByte(appconsts.LatestVersion) + paramLookUpCost), }, { name: "1024 byte blob", // occupies 3 shares because share prefix (e.g. namespace, info byte) msg: types.MsgPayForBlobs{BlobSizes: []uint32{1024}}, - wantGasConsumed: uint64(3*share.ShareSize*types.DefaultGasPerBlobByte + paramLookUpCost), // 3 shares * 512 bytes per share * 8 gas per byte + 1060 gas for fetching param = 13348 gas + wantGasConsumed: uint64(3*share.ShareSize*appconsts.GasPerBlobByte(appconsts.LatestVersion) + paramLookUpCost), // 3 shares * 512 bytes per share * 8 gas per byte + 1060 gas for fetching param = 13348 gas }, { name: "3 blobs, 1 share each", msg: types.MsgPayForBlobs{BlobSizes: []uint32{1, 1, 1}}, - wantGasConsumed: uint64(3*share.ShareSize*types.DefaultGasPerBlobByte + paramLookUpCost), // 3 shares * 512 bytes per share * 8 gas per byte + 1060 gas for fetching param = 13348 gas + wantGasConsumed: uint64(3*share.ShareSize*appconsts.GasPerBlobByte(appconsts.LatestVersion) + paramLookUpCost), // 3 shares * 512 bytes per share * 8 gas per byte + 1060 gas for fetching param = 13348 gas }, { name: "3 blobs, 6 shares total", msg: types.MsgPayForBlobs{BlobSizes: []uint32{1024, 800, 100}}, - wantGasConsumed: uint64(6*share.ShareSize*types.DefaultGasPerBlobByte + paramLookUpCost), // 6 shares * 512 bytes per share * 8 gas per byte + 1060 gas for fetching param = 25636 gas + wantGasConsumed: uint64(6*share.ShareSize*appconsts.GasPerBlobByte(appconsts.LatestVersion) + paramLookUpCost), // 6 shares * 512 bytes per share * 8 gas per byte + 1060 gas for fetching param = 25636 gas }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - k, stateStore, _ := CreateKeeper(t) + k, stateStore, _ := CreateKeeper(t, appconsts.LatestVersion) ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, nil) _, err := k.PayForBlobs(sdk.WrapSDKContext(ctx), &tc.msg) require.NoError(t, err) @@ -62,7 +63,7 @@ func TestPayForBlobGas(t *testing.T) { func TestChangingGasParam(t *testing.T) { msg := types.MsgPayForBlobs{BlobSizes: []uint32{1024}} - k, stateStore, _ := CreateKeeper(t) + k, stateStore, _ := CreateKeeper(t, appconsts.LatestVersion) tempCtx := sdk.NewContext(stateStore, tmproto.Header{}, false, nil) ctx1 := sdk.NewContext(stateStore, tmproto.Header{}, false, nil) diff --git a/x/blob/keeper/genesis_test.go b/x/blob/keeper/genesis_test.go index d291deebf8..120f9cb21e 100644 --- a/x/blob/keeper/genesis_test.go +++ b/x/blob/keeper/genesis_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "testing" + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" "github.com/celestiaorg/celestia-app/v3/x/blob" "github.com/celestiaorg/celestia-app/v3/x/blob/types" "github.com/stretchr/testify/require" @@ -13,7 +14,7 @@ func TestGenesis(t *testing.T) { Params: types.DefaultParams(), } - k, _, ctx := CreateKeeper(t) + k, _, ctx := CreateKeeper(t, appconsts.LatestVersion) blob.InitGenesis(ctx, *k, genesisState) got := blob.ExportGenesis(ctx, *k) require.NotNil(t, got) diff --git a/x/blob/keeper/grpc_query_params_test.go b/x/blob/keeper/grpc_query_params_test.go index 70f60860ee..e8c367cd35 100644 --- a/x/blob/keeper/grpc_query_params_test.go +++ b/x/blob/keeper/grpc_query_params_test.go @@ -3,13 +3,14 @@ package keeper_test import ( "testing" + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" "github.com/celestiaorg/celestia-app/v3/x/blob/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" ) func TestParamsQuery(t *testing.T) { - keeper, _, ctx := CreateKeeper(t) + keeper, _, ctx := CreateKeeper(t, appconsts.LatestVersion) wctx := sdk.WrapSDKContext(ctx) params := types.DefaultParams() keeper.SetParams(ctx, params) diff --git a/x/blob/keeper/keeper.go b/x/blob/keeper/keeper.go index 72a3fb7605..a7e0f3cc71 100644 --- a/x/blob/keeper/keeper.go +++ b/x/blob/keeper/keeper.go @@ -4,6 +4,8 @@ import ( "context" "fmt" + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" + v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" "github.com/celestiaorg/celestia-app/v3/x/blob/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -43,7 +45,14 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { func (k Keeper) PayForBlobs(goCtx context.Context, msg *types.MsgPayForBlobs) (*types.MsgPayForBlobsResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) - gasToConsume := types.GasToConsume(msg.BlobSizes, k.GasPerBlobByte(ctx)) + // GasPerBlobByte is a versioned param from version 3 onwards. + var gasToConsume uint64 + if ctx.BlockHeader().Version.App <= v2.Version { + gasToConsume = types.GasToConsume(msg.BlobSizes, k.GasPerBlobByte(ctx)) + } else { + gasToConsume = types.GasToConsume(msg.BlobSizes, appconsts.GasPerBlobByte(ctx.BlockHeader().Version.App)) + } + ctx.GasMeter().ConsumeGas(gasToConsume, payForBlobGasDescriptor) err := ctx.EventManager().EmitTypedEvent( diff --git a/x/blob/keeper/keeper_test.go b/x/blob/keeper/keeper_test.go index e3da5cb12a..8fee7f81a8 100644 --- a/x/blob/keeper/keeper_test.go +++ b/x/blob/keeper/keeper_test.go @@ -27,7 +27,7 @@ import ( // TestPayForBlobs verifies the attributes on the emitted event. func TestPayForBlobs(t *testing.T) { - k, _, ctx := CreateKeeper(t) + k, _, ctx := CreateKeeper(t, appconsts.LatestVersion) signer := "celestia15drmhzw5kwgenvemy30rqqqgq52axf5wwrruf7" namespace := share.MustNewV0Namespace(bytes.Repeat([]byte{1}, share.NamespaceVersionZeroIDSize)) namespaces := [][]byte{namespace.Bytes()} @@ -72,7 +72,7 @@ func createMsgPayForBlob(t *testing.T, signer string, namespace share.Namespace, return msg } -func CreateKeeper(t *testing.T) (*keeper.Keeper, store.CommitMultiStore, sdk.Context) { +func CreateKeeper(t *testing.T, version uint64) (*keeper.Keeper, store.CommitMultiStore, sdk.Context) { storeKey := sdk.NewKVStoreKey(paramtypes.StoreKey) tStoreKey := storetypes.NewTransientStoreKey(paramtypes.TStoreKey) @@ -87,7 +87,7 @@ func CreateKeeper(t *testing.T) (*keeper.Keeper, store.CommitMultiStore, sdk.Con ctx := sdk.NewContext(stateStore, tmproto.Header{ Version: tmversion.Consensus{ Block: 1, - App: 1, + App: version, }, }, false, nil) diff --git a/x/blob/keeper/params_test.go b/x/blob/keeper/params_test.go index 9431ef3828..53f5dbca20 100644 --- a/x/blob/keeper/params_test.go +++ b/x/blob/keeper/params_test.go @@ -3,12 +3,13 @@ package keeper_test import ( "testing" + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" "github.com/celestiaorg/celestia-app/v3/x/blob/types" "github.com/stretchr/testify/require" ) func TestGetParams(t *testing.T) { - k, _, ctx := CreateKeeper(t) + k, _, ctx := CreateKeeper(t, appconsts.LatestVersion) params := types.DefaultParams() k.SetParams(ctx, params) diff --git a/x/blob/types/blob_tx.go b/x/blob/types/blob_tx.go index 1f6273f10c..8089e247ef 100644 --- a/x/blob/types/blob_tx.go +++ b/x/blob/types/blob_tx.go @@ -3,6 +3,7 @@ package types import ( "bytes" + v3 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v3" "github.com/celestiaorg/go-square/v2/inclusion" "github.com/celestiaorg/go-square/v2/share" "github.com/celestiaorg/go-square/v2/tx" @@ -35,7 +36,7 @@ func NewV1Blob(ns share.Namespace, data []byte, signer sdk.AccAddress) (*share.B // ValidateBlobTx performs stateless checks on the BlobTx to ensure that the // blobs attached to the transaction are valid. -func ValidateBlobTx(txcfg client.TxEncodingConfig, bTx *tx.BlobTx, subtreeRootThreshold int) error { +func ValidateBlobTx(txcfg client.TxEncodingConfig, bTx *tx.BlobTx, subtreeRootThreshold int, appVersion uint64) error { if bTx == nil { return ErrNoBlobs } @@ -79,6 +80,9 @@ func ValidateBlobTx(txcfg client.TxEncodingConfig, bTx *tx.BlobTx, subtreeRootTh // If share version is 1, assert that the signer in the blob // matches the signer in the msgPFB. if blob.ShareVersion() == share.ShareVersionOne { + if appVersion < v3.Version { + return ErrUnsupportedShareVersion.Wrapf("share version %d is not supported in %d. Supported from v3 onwards", blob.ShareVersion(), appVersion) + } if !bytes.Equal(blob.Signer(), signer) { return ErrInvalidBlobSigner.Wrapf("blob signer %s does not match msgPFB signer %s", sdk.AccAddress(blob.Signer()).String(), msgPFB.Signer) } diff --git a/x/blob/types/blob_tx_test.go b/x/blob/types/blob_tx_test.go index 1a2d8295dc..a1867e2d92 100644 --- a/x/blob/types/blob_tx_test.go +++ b/x/blob/types/blob_tx_test.go @@ -251,7 +251,7 @@ func TestValidateBlobTx(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - err := types.ValidateBlobTx(encCfg.TxConfig, tt.getTx(), appconsts.DefaultSubtreeRootThreshold) + err := types.ValidateBlobTx(encCfg.TxConfig, tt.getTx(), appconsts.DefaultSubtreeRootThreshold, appconsts.LatestVersion) if tt.expectedErr != nil { assert.ErrorIs(t, err, tt.expectedErr, tt.name) } diff --git a/x/blob/types/payforblob.go b/x/blob/types/payforblob.go index 92eca0a4d7..b49eb05394 100644 --- a/x/blob/types/payforblob.go +++ b/x/blob/types/payforblob.go @@ -10,7 +10,6 @@ import ( "github.com/celestiaorg/go-square/v2/share" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" - auth "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/tendermint/tendermint/crypto/merkle" "golang.org/x/exp/slices" ) @@ -162,10 +161,9 @@ func EstimateGas(blobSizes []uint32, gasPerByte uint32, txSizeCost uint64) uint6 return GasToConsume(blobSizes, gasPerByte) + (txSizeCost * BytesPerBlobInfo * uint64(len(blobSizes))) + PFBGasFixedCost } -// DefaultEstimateGas runs EstimateGas with the system defaults. The network may change these values -// through governance, thus this function should predominantly be used in testing. +// DefaultEstimateGas runs EstimateGas with the system defaults. func DefaultEstimateGas(blobSizes []uint32) uint64 { - return EstimateGas(blobSizes, appconsts.DefaultGasPerBlobByte, auth.DefaultTxSizeCostPerByte) + return EstimateGas(blobSizes, appconsts.DefaultGasPerBlobByte, appconsts.DefaultTxSizeCostPerByte) } // ValidateBlobNamespace returns an error if the provided namespace is an diff --git a/x/minfee/grpc_query_test.go b/x/minfee/grpc_query_test.go index a7ab0fdfef..9e797ee828 100644 --- a/x/minfee/grpc_query_test.go +++ b/x/minfee/grpc_query_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/celestiaorg/celestia-app/v3/app" - v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" testutil "github.com/celestiaorg/celestia-app/v3/test/util" "github.com/celestiaorg/celestia-app/v3/x/minfee" sdk "github.com/cosmos/cosmos-sdk/types" @@ -24,5 +24,5 @@ func TestQueryNetworkMinGasPrice(t *testing.T) { require.NoError(t, err) // Check the response - require.Equal(t, v2.NetworkMinGasPrice, resp.NetworkMinGasPrice.MustFloat64()) + require.Equal(t, appconsts.DefaultNetworkMinGasPrice, resp.NetworkMinGasPrice.MustFloat64()) } diff --git a/x/minfee/params.go b/x/minfee/params.go index ef17044d7c..2f1edc3ee8 100644 --- a/x/minfee/params.go +++ b/x/minfee/params.go @@ -3,7 +3,7 @@ package minfee import ( "fmt" - v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" + "github.com/celestiaorg/celestia-app/v3/pkg/appconsts" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) @@ -18,7 +18,7 @@ var ( ) func init() { - DefaultNetworkMinGasPriceDec, err := sdk.NewDecFromStr(fmt.Sprintf("%f", v2.NetworkMinGasPrice)) + DefaultNetworkMinGasPriceDec, err := sdk.NewDecFromStr(fmt.Sprintf("%f", appconsts.DefaultNetworkMinGasPrice)) if err != nil { panic(err) } diff --git a/x/signal/integration_test.go b/x/signal/integration_test.go index 434b9cf882..fb016e0813 100644 --- a/x/signal/integration_test.go +++ b/x/signal/integration_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/celestiaorg/celestia-app/v3/app" + v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" testutil "github.com/celestiaorg/celestia-app/v3/test/util" "github.com/celestiaorg/celestia-app/v3/x/signal" "github.com/celestiaorg/celestia-app/v3/x/signal/types" @@ -19,17 +20,19 @@ import ( // simulates an upgrade scenario with a single validator which signals for the version change, checks the quorum // has been reached and then calls TryUpgrade, asserting that the upgrade module returns the new app version func TestUpgradeIntegration(t *testing.T) { - app, _ := testutil.SetupTestAppWithGenesisValSet(app.DefaultConsensusParams()) + cp := app.DefaultConsensusParams() + cp.Version.AppVersion = v2.Version + app, _ := testutil.SetupTestAppWithGenesisValSet(cp) ctx := sdk.NewContext(app.CommitMultiStore(), tmtypes.Header{ Version: tmversion.Consensus{ - App: 1, + App: v2.Version, }, }, false, tmlog.NewNopLogger()) goCtx := sdk.WrapSDKContext(ctx) ctx = sdk.UnwrapSDKContext(goCtx) res, err := app.SignalKeeper.VersionTally(goCtx, &types.QueryVersionTallyRequest{ - Version: 2, + Version: 3, }) require.NoError(t, err) require.EqualValues(t, 0, res.VotingPower) @@ -40,12 +43,12 @@ func TestUpgradeIntegration(t *testing.T) { _, err = app.SignalKeeper.SignalVersion(ctx, &types.MsgSignalVersion{ ValidatorAddress: valAddr.String(), - Version: 2, + Version: 3, }) require.NoError(t, err) res, err = app.SignalKeeper.VersionTally(goCtx, &types.QueryVersionTallyRequest{ - Version: 2, + Version: 3, }) require.NoError(t, err) require.EqualValues(t, 1, res.VotingPower) @@ -65,7 +68,7 @@ func TestUpgradeIntegration(t *testing.T) { // returns an error because an upgrade is pending. _, err = app.SignalKeeper.SignalVersion(ctx, &types.MsgSignalVersion{ ValidatorAddress: valAddr.String(), - Version: 3, + Version: 4, }) require.Error(t, err) require.ErrorIs(t, err, types.ErrUpgradePending) @@ -78,5 +81,5 @@ func TestUpgradeIntegration(t *testing.T) { shouldUpgrade, version = app.SignalKeeper.ShouldUpgrade(ctx) require.True(t, shouldUpgrade) - require.EqualValues(t, 2, version) + require.EqualValues(t, 3, version) }