diff --git a/app/app.go b/app/app.go index 8cefc22845..93a3c61a09 100644 --- a/app/app.go +++ b/app/app.go @@ -326,17 +326,22 @@ func New( ) // transfer stack contains (from top to bottom): // - Token Filter + // - Packet Forwarding Middleware // - Transfer var transferStack ibcporttypes.IBCModule transferStack = transfer.NewIBCModule(app.TransferKeeper) - transferStack = tokenfilter.NewIBCMiddleware(transferStack) - transferStack = packetforward.NewIBCMiddleware( + packetForwardMiddleware := packetforward.NewIBCMiddleware( transferStack, app.PacketForwardKeeper, 0, // retries on timeout packetforwardkeeper.DefaultForwardTransferPacketTimeoutTimestamp, // forward timeout packetforwardkeeper.DefaultRefundTransferPacketTimeoutTimestamp, // refund timeout ) + // packetForwardMiddleware is used only for version 2 + transferStack = module.NewVersionedIBCModule(packetForwardMiddleware, transferStack, v2, v2) + // token filter wraps packet forward middleware and is thus the first module in the transfer stack + tokenFilterMiddelware := tokenfilter.NewIBCMiddleware(transferStack) + transferStack = module.NewVersionedIBCModule(tokenFilterMiddelware, transferStack, v1, v2) app.EvidenceKeeper = *evidencekeeper.NewKeeper( appCodec, @@ -498,6 +503,19 @@ func (app *App) migrateModules(ctx sdk.Context, fromVersion, toVersion uint64) e // We wrap Info around baseapp so we can take the app version and // setup the multicommit store. func (app *App) Info(req abci.RequestInfo) abci.ResponseInfo { + if height := app.LastBlockHeight(); height > 0 { + ctx, err := app.CreateQueryContext(height, false) + if err != nil { + panic(err) + } + appVersion := app.GetAppVersionFromParamStore(ctx) + if appVersion > 0 { + app.SetAppVersion(ctx, appVersion) + } else { + app.SetAppVersion(ctx, v1) + } + } + resp := app.BaseApp.Info(req) // mount the stores for the provided app version if resp.AppVersion > 0 && !app.IsSealed() { diff --git a/app/module/ibc.go b/app/module/ibc.go new file mode 100644 index 0000000000..71d24ddb52 --- /dev/null +++ b/app/module/ibc.go @@ -0,0 +1,149 @@ +package module + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v6/modules/core/05-port/types" + exported "github.com/cosmos/ibc-go/v6/modules/core/exported" +) + +func NewVersionedIBCModule( + wrappedModule, nextModule porttypes.IBCModule, + fromVersion, toVersion uint64, +) porttypes.IBCModule { + return &VersionedIBCModule{ + wrappedModule: wrappedModule, + nextModule: nextModule, + fromVersion: fromVersion, + toVersion: toVersion, + } +} + +var _ porttypes.IBCModule = (*VersionedIBCModule)(nil) + +type VersionedIBCModule struct { + wrappedModule, nextModule porttypes.IBCModule + fromVersion, toVersion uint64 +} + +func (v *VersionedIBCModule) OnChanOpenInit( + ctx sdk.Context, + order channeltypes.Order, + connectionHops []string, + portID string, + channelID string, + channelCap *capabilitytypes.Capability, + counterparty channeltypes.Counterparty, + version string, +) (string, error) { + currentAppVersion := ctx.BlockHeader().Version.App + if currentAppVersion >= v.fromVersion && currentAppVersion <= v.toVersion { + return v.wrappedModule.OnChanOpenInit(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, version) + } + return v.nextModule.OnChanOpenInit(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, version) +} + +func (v *VersionedIBCModule) OnChanOpenTry( + ctx sdk.Context, + order channeltypes.Order, + connectionHops []string, + portID, + channelID string, + channelCap *capabilitytypes.Capability, + counterparty channeltypes.Counterparty, + counterpartyVersion string, +) (version string, err error) { + currentAppVersion := ctx.BlockHeader().Version.App + if currentAppVersion >= v.fromVersion && currentAppVersion <= v.toVersion { + return v.wrappedModule.OnChanOpenTry(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion) + } + return v.nextModule.OnChanOpenTry(ctx, order, connectionHops, portID, channelID, channelCap, counterparty, counterpartyVersion) +} + +func (v *VersionedIBCModule) OnChanOpenAck( + ctx sdk.Context, + portID, + channelID string, + counterpartyChannelID string, + counterpartyVersion string, +) error { + currentAppVersion := ctx.BlockHeader().Version.App + if currentAppVersion >= v.fromVersion && currentAppVersion <= v.toVersion { + return v.wrappedModule.OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) + } + return v.nextModule.OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) +} + +func (v *VersionedIBCModule) OnChanOpenConfirm( + ctx sdk.Context, + portID, + channelID string, +) error { + currentAppVersion := ctx.BlockHeader().Version.App + if currentAppVersion >= v.fromVersion && currentAppVersion <= v.toVersion { + return v.wrappedModule.OnChanOpenConfirm(ctx, portID, channelID) + } + return v.nextModule.OnChanOpenConfirm(ctx, portID, channelID) +} + +func (v *VersionedIBCModule) OnChanCloseInit( + ctx sdk.Context, + portID, + channelID string, +) error { + currentVersion := ctx.BlockHeader().Version.App + if currentVersion >= v.fromVersion && currentVersion <= v.toVersion { + return v.wrappedModule.OnChanCloseInit(ctx, portID, channelID) + } + return v.nextModule.OnChanCloseInit(ctx, portID, channelID) +} + +func (v *VersionedIBCModule) OnChanCloseConfirm( + ctx sdk.Context, + portID, + channelID string, +) error { + currentVersion := ctx.BlockHeader().Version.App + if currentVersion >= v.fromVersion && currentVersion <= v.toVersion { + return v.wrappedModule.OnChanCloseConfirm(ctx, portID, channelID) + } + return v.nextModule.OnChanCloseConfirm(ctx, portID, channelID) +} + +func (v *VersionedIBCModule) OnRecvPacket( + ctx sdk.Context, + packet channeltypes.Packet, + relayer sdk.AccAddress, +) exported.Acknowledgement { + currentVersion := ctx.BlockHeader().Version.App + if currentVersion >= v.fromVersion && currentVersion <= v.toVersion { + return v.wrappedModule.OnRecvPacket(ctx, packet, relayer) + } + return v.nextModule.OnRecvPacket(ctx, packet, relayer) +} + +func (v *VersionedIBCModule) OnAcknowledgementPacket( + ctx sdk.Context, + packet channeltypes.Packet, + acknowledgement []byte, + relayer sdk.AccAddress, +) error { + currentVersion := ctx.BlockHeader().Version.App + if currentVersion >= v.fromVersion && currentVersion <= v.toVersion { + return v.wrappedModule.OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer) + } + return v.nextModule.OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer) +} + +func (v *VersionedIBCModule) OnTimeoutPacket( + ctx sdk.Context, + packet channeltypes.Packet, + relayer sdk.AccAddress, +) error { + currentVersion := ctx.BlockHeader().Version.App + if currentVersion >= v.fromVersion && currentVersion <= v.toVersion { + return v.wrappedModule.OnTimeoutPacket(ctx, packet, relayer) + } + return v.nextModule.OnTimeoutPacket(ctx, packet, relayer) +} diff --git a/app/modules.go b/app/modules.go index 85dd05049f..8502ba9984 100644 --- a/app/modules.go +++ b/app/modules.go @@ -167,7 +167,7 @@ func (app *App) setupModuleManager(skipGenesisInvariants bool) error { }, { Module: blobstream.NewAppModule(app.appCodec, app.BlobstreamKeeper), - FromVersion: v1, ToVersion: v2, + FromVersion: v1, ToVersion: v1, }, { Module: signal.NewAppModule(app.SignalKeeper), @@ -299,8 +299,7 @@ func allStoreKeys() []string { } } -// versionedStoreKeys returns the store keys for each app version -// ... I wish there was an easier way than this (like using the modules which are already versioned) +// versionedStoreKeys returns the store keys for each app version. func versionedStoreKeys() map[uint64][]string { return map[uint64][]string{ 1: { @@ -325,7 +324,6 @@ func versionedStoreKeys() map[uint64][]string { authtypes.StoreKey, authzkeeper.StoreKey, banktypes.StoreKey, - blobstreamtypes.StoreKey, capabilitytypes.StoreKey, distrtypes.StoreKey, evidencetypes.StoreKey, diff --git a/app/test/qgb_rpc_test.go b/app/test/qgb_rpc_test.go index 7fd42be5dd..33bd9756ad 100644 --- a/app/test/qgb_rpc_test.go +++ b/app/test/qgb_rpc_test.go @@ -19,7 +19,9 @@ func TestBlobstreamRPCQueries(t *testing.T) { t.Skip("skipping blobstream integration test in short mode.") } ecfg := encoding.MakeConfig(app.ModuleEncodingRegisters...) - cfg := testnode.DefaultConfig().WithModifiers(genesis.SetDataCommitmentWindow(ecfg.Codec, 100)) + cfg := testnode.DefaultConfig(). + WithModifiers(genesis.SetDataCommitmentWindow(ecfg.Codec, 100)). + WithConsensusParams(app.DefaultInitialConsensusParams()) cctx, _, _ := testnode.NewNetwork(t, cfg) diff --git a/go.mod b/go.mod index 7ee5ab962d..5cf2168bc2 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,7 @@ require ( golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de google.golang.org/grpc v1.63.2 - google.golang.org/protobuf v1.33.0 + google.golang.org/protobuf v1.34.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -129,7 +129,7 @@ require ( github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.0 // indirect + github.com/hashicorp/go-getter v1.7.4 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-uuid v1.0.2 // indirect diff --git a/go.sum b/go.sum index 233d4d43aa..4a1f6cfced 100644 --- a/go.sum +++ b/go.sum @@ -821,8 +821,8 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.0 h1:bzrYP+qu/gMrL1au7/aDvkoOVGUJpeKBgbqRHACAFDY= -github.com/hashicorp/go-getter v1.7.0/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.4 h1:3yQjWuxICvSpYwqSayAdKRFcvBl1y/vogCxczWSmix0= +github.com/hashicorp/go-getter v1.7.4/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -2075,8 +2075,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.0 h1:Qo/qEd2RZPCf2nKuorzksSknv0d3ERwp1vFG38gSmH4= +google.golang.org/protobuf v1.34.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/local_devnet/README.md b/local_devnet/README.md new file mode 100644 index 0000000000..f59b3a1ab4 --- /dev/null +++ b/local_devnet/README.md @@ -0,0 +1,136 @@ +# Simple local devnet + +This directory contains a local Celestia devnet that contains four validators, and prometheus/grafana setup to receive metrics from them. + +The docker image used is built locally using the code in the root directory. So, if you made any change on `celestia-app`, you will have them when [building the images](#build-the-images). + +Note: It is necessary to [build the images](#build-the-images) after every change you make so that it is reflected in the network. + +Note 2: If you edit the `go.mod` to contain a local package, for example, using a local version of celestia-core: + +```go +replace github.com/celestiaorg/celestia-core => ../celestia-core +``` + +You will need to push that version to GitHub, then take the commit and change it in the `go.mod` to: + +```go +replace github.com/celestiaorg/celestia-core => github.com/fork_name/celestia-core +``` + +To have those changes reflected when you [build the images](#build-the-images). Otherwise, the build will fail because the directory containing the changes is not part of the docker context. + +## How to run + +### Requirements + +To run the devnet, a working installation of [docker-compose](https://docs.docker.com/compose/install/) is needed. + +Also, make sure you have docker up and running: + +```shell +docker run hello-world +``` + +should return: + +```text +Hello from Docker! +This message shows that your installation appears to be working correctly. + +To generate this message, Docker took the following steps: + 1. The Docker client contacted the Docker daemon. + 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. + (arm64v8) + 3. The Docker daemon created a new container from that image which runs the + executable that produces the output you are currently reading. + 4. The Docker daemon streamed that output to the Docker client, which sent it + to your terminal. + +To try something more ambitious, you can run an Ubuntu container with: + $ docker run -it ubuntu bash + +Share images, automate workflows, and more with a free Docker ID: + https://hub.docker.com/ + +For more examples and ideas, visit: + https://docs.docker.com/get-started/ +``` + +If not, then docker needs to be installed/started directly. + +### Build the images + +To build the images: + +```shell +docker-compose build +``` + +### Start the devnet + +To run all the validators and the telemetry: + +```shell +docker-compose up -d +``` + +If you want to run just a specific instance, you can specify its name: `core0`, `core1`, `core2`, `core3`, which are the validators. Then, `prometheus`, `grafana`, `otel-collector` for the telemetry. + +Example: + +```shell +docker-compose up -d core0 core1 +``` + +Will run only two validators: `core0` and `core1`, and no telemetry. + +Note: Starting `core0` is always needed because it is the only genesis validator. If you don't start it, then the network won't start. For the rest of the workloads, they're optional and any combination of them is allowed. + +### Stop the devnet + +```shell +docker-compose stop +``` + +### Delete the devnet + +```shell +docker-compose down +``` + +## Monitoring + +Monitoring is preconfigured in the `celestia-app/config.toml`. This means that you will have access to the metrics the moment you spin up the devnet along with telemetry. + +### Accessing grafana + +Grafana is exposed in `localhost:3000`. The default credentials are `admin:admin`. Then, you will find predefined data sources to get the metrics from. + +For the dashboards, if you create fresh ones and save them, they will be saved on your machine under `telemetry/grafana`. + +## Updating the configuration + +The four validators use the same genesis, the same comet's config `celestia-app/config.toml`, and the same app config `celestia-app/app.toml`. If you make a change on one of them, you will make the change on the four validators. + +Note: if the network is already running, and you make a change in the files, the changes will not be reflected until you [stop the devnet](#stop-the-devnet), then [start](#start-the-devnet) it again. Also, they will be reflected if you [delete it](#delete-the-devnet) and [start](#start-the-devnet) it again. + +## Sending transactions + +By default, `core0` is exposed to the host network. This means that the RPC is exposed under `localhost:26657` and the gRPC under `localhost:9090` and can be used to query the network. For example, if you have `celestia-appd` already installed: + +```shell +celestia-appd query staking validators +``` + +will return the four validators. + +To send transactions, you will need to first send some tokens to your account: + +```shell +celestia-appd tx bank send core0 --fees 21000utia --chain-id local_devnet --keyring-backend test --keyring-dir local_devnet/celestia-app/core0 -b block +``` + +For example, `` can be `100utia`. + +Then, you can start sending any transaction you want. diff --git a/local_devnet/celestia-app/app.toml b/local_devnet/celestia-app/app.toml new file mode 100644 index 0000000000..ea7ffb68b5 --- /dev/null +++ b/local_devnet/celestia-app/app.toml @@ -0,0 +1,252 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +############################################################################### +### Base Configuration ### +############################################################################### + +# The minimum gas prices a validator is willing to accept for processing a +# transaction. A transaction's fees must meet the minimum of any denomination +# specified in this config (e.g. 0.25token1;0.0001token2). +minimum-gas-prices = "0.002utia" + +# default: the last 362880 states are kept, pruning at 10 block intervals +# nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) +# everything: 2 latest states will be kept; pruning at 10 block intervals. +# custom: allow pruning options to be manually specified through 'pruning-keep-recent', and 'pruning-interval' +pruning = "default" + +# These are applied if and only if the pruning strategy is custom. +pruning-keep-recent = "0" +pruning-interval = "0" + +# HaltHeight contains a non-zero block height at which a node will gracefully +# halt and shutdown that can be used to assist upgrades and testing. +# +# Note: Commitment of state will be attempted on the corresponding block. +halt-height = 0 + +# HaltTime contains a non-zero minimum block time (in Unix seconds) at which +# a node will gracefully halt and shutdown that can be used to assist upgrades +# and testing. +# +# Note: Commitment of state will be attempted on the corresponding block. +halt-time = 0 + +# MinRetainBlocks defines the minimum block height offset from the current +# block being committed, such that all blocks past this offset are pruned +# from Tendermint. It is used as part of the process of determining the +# ResponseCommit.RetainHeight value during ABCI Commit. A value of 0 indicates +# that no blocks should be pruned. +# +# This configuration value is only responsible for pruning Tendermint blocks. +# It has no bearing on application state pruning which is determined by the +# "pruning-*" configurations. +# +# Note: Tendermint block pruning is dependant on this parameter in conunction +# with the unbonding (safety threshold) period, state pruning and state sync +# snapshot parameters to determine the correct minimum value of +# ResponseCommit.RetainHeight. +min-retain-blocks = 0 + +# InterBlockCache enables inter-block caching. +inter-block-cache = true + +# IndexEvents defines the set of events in the form {eventType}.{attributeKey}, +# which informs Tendermint what to index. If empty, all events will be indexed. +# +# Example: +# ["message.sender", "message.recipient"] +index-events = [] + +# IavlCacheSize set the size of the iavl tree cache. +# Default cache size is 50mb. +iavl-cache-size = 781250 + +# IavlDisableFastNode enables or disables the fast node feature of IAVL. +# Default is false. +iavl-disable-fastnode = false + +# EXPERIMENTAL: IAVLLazyLoading enable/disable the lazy loading of iavl store. +# Default is false. +iavl-lazy-loading = false + +# AppDBBackend defines the database backend type to use for the application and snapshots DBs. +# An empty string indicates that a fallback will be used. +# First fallback is the deprecated compile-time types.DBBackend value. +# Second fallback (if the types.DBBackend also isn't set), is the db-backend value set in Tendermint's config.toml. +app-db-backend = "" + +############################################################################### +### Telemetry Configuration ### +############################################################################### + +[telemetry] + +# Prefixed with keys to separate services. +service-name = "" + +# Enabled enables the application telemetry functionality. When enabled, +# an in-memory sink is also enabled by default. Operators may also enabled +# other sinks such as Prometheus. +enabled = false + +# Enable prefixing gauge values with hostname. +enable-hostname = false + +# Enable adding hostname to labels. +enable-hostname-label = false + +# Enable adding service to labels. +enable-service-label = false + +# PrometheusRetentionTime, when positive, enables a Prometheus metrics sink. +prometheus-retention-time = 0 + +# GlobalLabels defines a global set of name/value label tuples applied to all +# metrics emitted using the wrapper functions defined in telemetry package. +# +# Example: +# [["chain_id", "cosmoshub-1"]] +global-labels = [ +] + +############################################################################### +### API Configuration ### +############################################################################### + +[api] + +# Enable defines if the API server should be enabled. +enable = true + +# Swagger defines if swagger documentation should automatically be registered. +swagger = false + +# Address defines the API server to listen on. +address = "tcp://0.0.0.0:1317" + +# MaxOpenConnections defines the number of maximum open connections. +max-open-connections = 1000 + +# RPCReadTimeout defines the Tendermint RPC read timeout (in seconds). +rpc-read-timeout = 10 + +# RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds). +rpc-write-timeout = 0 + +# RPCMaxBodyBytes defines the Tendermint maximum response body (in bytes). +rpc-max-body-bytes = 1000000 + +# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). +enabled-unsafe-cors = false + +############################################################################### +### Rosetta Configuration ### +############################################################################### + +[rosetta] + +# Enable defines if the Rosetta API server should be enabled. +enable = false + +# Address defines the Rosetta API server to listen on. +address = ":8080" + +# Network defines the name of the blockchain that will be returned by Rosetta. +blockchain = "app" + +# Network defines the name of the network that will be returned by Rosetta. +network = "network" + +# Retries defines the number of retries when connecting to the node before failing. +retries = 3 + +# Offline defines if Rosetta server should run in offline mode. +offline = false + +# EnableDefaultSuggestedFee defines if the server should suggest fee by default. +# If 'construction/medata' is called without gas limit and gas price, +# suggested fee based on gas-to-suggest and denom-to-suggest will be given. +enable-fee-suggestion = false + +# GasToSuggest defines gas limit when calculating the fee +gas-to-suggest = 210000 + +# DenomToSuggest defines the defult denom for fee suggestion. +# Price must be in minimum-gas-prices. +denom-to-suggest = "uatom" + +############################################################################### +### gRPC Configuration ### +############################################################################### + +[grpc] + +# Enable defines if the gRPC server should be enabled. +enable = true + +# Address defines the gRPC server address to bind to. +address = "0.0.0.0:9090" + +# MaxRecvMsgSize defines the max message size in bytes the server can receive. +# The default value is 10MB. +max-recv-msg-size = "10485760" + +# MaxSendMsgSize defines the max message size in bytes the server can send. +# The default value is math.MaxInt32. +max-send-msg-size = "2147483647" + +############################################################################### +### gRPC Web Configuration ### +############################################################################### + +[grpc-web] + +# GRPCWebEnable defines if the gRPC-web should be enabled. +# NOTE: gRPC must also be enabled, otherwise, this configuration is a no-op. +enable = true + +# Address defines the gRPC-web server address to bind to. +address = "0.0.0.0:9091" + +# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). +enable-unsafe-cors = false + +############################################################################### +### State Sync Configuration ### +############################################################################### + +# State sync snapshots allow other nodes to rapidly join the network without replaying historical +# blocks, instead downloading and applying a snapshot of the application state at a given height. +[state-sync] + +# snapshot-interval specifies the block interval at which local state sync snapshots are +# taken (0 to disable). +snapshot-interval = 1500 + +# snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all). +snapshot-keep-recent = 2 + +############################################################################### +### Store / State Streaming ### +############################################################################### + +[store] +streamers = [] + +[streamers] +[streamers.file] +keys = ["*", ] +write_dir = "" +prefix = "" + +# output-metadata specifies if output the metadata file which includes the abci request/responses +# during processing the block. +output-metadata = "true" + +# stop-node-on-error specifies if propagate the file streamer errors to consensus state machine. +stop-node-on-error = "true" + +# fsync specifies if call fsync after writing the files. +fsync = "false" diff --git a/local_devnet/celestia-app/config.toml b/local_devnet/celestia-app/config.toml new file mode 100644 index 0000000000..ff5beff4e9 --- /dev/null +++ b/local_devnet/celestia-app/config.toml @@ -0,0 +1,519 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +# NOTE: Any path below can be absolute (e.g. "/var/myawesomeapp/data") or +# relative to the home directory (e.g. "data"). The home directory is +# "$HOME/.cometbft" by default, but could be changed via $CMTHOME env variable +# or --home cmd flag. + +####################################################################### +### Main Base Config Options ### +####################################################################### + +# TCP or UNIX socket address of the ABCI application, +# or the name of an ABCI application compiled in with the CometBFT binary +proxy_app = "tcp://127.0.0.1:26658" + +# A custom human readable name for this node +moniker = "local_devnet" + +# If this node is many blocks behind the tip of the chain, FastSync +# allows them to catchup quickly by downloading blocks in parallel +# and verifying their commits +fast_sync = true + +# Database backend: goleveldb | cleveldb | boltdb | rocksdb | badgerdb +# * goleveldb (github.com/syndtr/goleveldb - most popular implementation) +# - pure go +# - stable +# * cleveldb (uses levigo wrapper) +# - fast +# - requires gcc +# - use cleveldb build tag (go build -tags cleveldb) +# * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt) +# - EXPERIMENTAL +# - may be faster is some use-cases (random reads - indexer) +# - use boltdb build tag (go build -tags boltdb) +# * rocksdb (uses github.com/tecbot/gorocksdb) +# - EXPERIMENTAL +# - requires gcc +# - use rocksdb build tag (go build -tags rocksdb) +# * badgerdb (uses github.com/dgraph-io/badger) +# - EXPERIMENTAL +# - use badgerdb build tag (go build -tags badgerdb) +db_backend = "goleveldb" + +# Database directory +db_dir = "data" + +# Output level for logging, including package level options +log_level = "info" + +# Output format: 'plain' (colored text) or 'json' +log_format = "plain" + +##### additional base config options ##### + +# Path to the JSON file containing the initial validator set and other meta data +genesis_file = "config/genesis.json" + +# Path to the JSON file containing the private key to use as a validator in the consensus protocol +priv_validator_key_file = "config/priv_validator_key.json" + +# Path to the JSON file containing the last sign state of a validator +priv_validator_state_file = "data/priv_validator_state.json" + +# TCP or UNIX socket address for CometBFT to listen on for +# connections from an external PrivValidator process +priv_validator_laddr = "" + +# Path to the JSON file containing the private key to use for node authentication in the p2p protocol +node_key_file = "config/node_key.json" + +# Mechanism to connect to the ABCI application: socket | grpc +abci = "socket" + +# If true, query the ABCI app on connecting to a new peer +# so the app can decide if we should keep the connection or not +filter_peers = false + + +####################################################################### +### Advanced Configuration Options ### +####################################################################### + +####################################################### +### RPC Server Configuration Options ### +####################################################### +[rpc] + +# TCP or UNIX socket address for the RPC server to listen on +laddr = "tcp://0.0.0.0:26657" + +# A list of origins a cross-domain request can be executed from +# Default value '[]' disables cors support +# Use '["*"]' to allow any origin +cors_allowed_origins = [] + +# A list of methods the client is allowed to use with cross-domain requests +cors_allowed_methods = ["HEAD", "GET", "POST", ] + +# A list of non simple headers the client is allowed to use with cross-domain requests +cors_allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time", ] + +# TCP or UNIX socket address for the gRPC server to listen on +# NOTE: This server only supports /broadcast_tx_commit +grpc_laddr = "" + +# Maximum number of simultaneous connections. +# Does not include RPC (HTTP&WebSocket) connections. See max_open_connections +# If you want to accept a larger number than the default, make sure +# you increase your OS limits. +# 0 - unlimited. +# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} +# 1024 - 40 - 10 - 50 = 924 = ~900 +grpc_max_open_connections = 900 + +# Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool +unsafe = false + +# Maximum number of simultaneous connections (including WebSocket). +# Does not include gRPC connections. See grpc_max_open_connections +# If you want to accept a larger number than the default, make sure +# you increase your OS limits. +# 0 - unlimited. +# Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files} +# 1024 - 40 - 10 - 50 = 924 = ~900 +max_open_connections = 900 + +# Maximum number of unique clientIDs that can /subscribe +# If you're using /broadcast_tx_commit, set to the estimated maximum number +# of broadcast_tx_commit calls per block. +max_subscription_clients = 100 + +# Maximum number of unique queries a given client can /subscribe to +# If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to +# the estimated # maximum number of broadcast_tx_commit calls per block. +max_subscriptions_per_client = 5 + +# Experimental parameter to specify the maximum number of events a node will +# buffer, per subscription, before returning an error and closing the +# subscription. Must be set to at least 100, but higher values will accommodate +# higher event throughput rates (and will use more memory). +experimental_subscription_buffer_size = 200 + +# Experimental parameter to specify the maximum number of RPC responses that +# can be buffered per WebSocket client. If clients cannot read from the +# WebSocket endpoint fast enough, they will be disconnected, so increasing this +# parameter may reduce the chances of them being disconnected (but will cause +# the node to use more memory). +# +# Must be at least the same as "experimental_subscription_buffer_size", +# otherwise connections could be dropped unnecessarily. This value should +# ideally be somewhat higher than "experimental_subscription_buffer_size" to +# accommodate non-subscription-related RPC responses. +experimental_websocket_write_buffer_size = 200 + +# If a WebSocket client cannot read fast enough, at present we may +# silently drop events instead of generating an error or disconnecting the +# client. +# +# Enabling this experimental parameter will cause the WebSocket connection to +# be closed instead if it cannot read fast enough, allowing for greater +# predictability in subscription behaviour. +experimental_close_on_slow_client = false + +# How long to wait for a tx to be committed during /broadcast_tx_commit. +# WARNING: Using a value larger than 10s will result in increasing the +# global HTTP write timeout, which applies to all connections and endpoints. +# See https://github.com/tendermint/tendermint/issues/3435 +timeout_broadcast_tx_commit = "50s" + +# Maximum size of request body, in bytes +max_body_bytes = 8388608 + +# Maximum size of request header, in bytes +max_header_bytes = 1048576 + +# The path to a file containing certificate that is used to create the HTTPS server. +# Might be either absolute path or path related to CometBFT's config directory. +# If the certificate is signed by a certificate authority, +# the certFile should be the concatenation of the server's certificate, any intermediates, +# and the CA's certificate. +# NOTE: both tls_cert_file and tls_key_file must be present for CometBFT to create HTTPS server. +# Otherwise, HTTP server is run. +tls_cert_file = "" + +# The path to a file containing matching private key that is used to create the HTTPS server. +# Might be either absolute path or path related to CometBFT's config directory. +# NOTE: both tls-cert-file and tls-key-file must be present for CometBFT to create HTTPS server. +# Otherwise, HTTP server is run. +tls_key_file = "" + +# pprof listen address (https://golang.org/pkg/net/http/pprof) +pprof_laddr = "localhost:6060" + +####################################################### +### P2P Configuration Options ### +####################################################### +[p2p] + +# Address to listen for incoming connections +laddr = "tcp://0.0.0.0:26656" + +# Address to advertise to peers for them to dial +# If empty, will use the same port as the laddr, +# and will introspect on the listener or use UPnP +# to figure out the address. ip and port are required +# example: 159.89.10.97:26656 +external_address = "" + +# Comma separated list of seed nodes to connect to +seeds = "" + +# Comma separated list of nodes to keep persistent connections to +persistent_peers = "" + +# UPNP port forwarding +upnp = false + +# Path to address book +addr_book_file = "config/addrbook.json" + +# Set true for strict address routability rules +# Set false for private or local networks +addr_book_strict = true + +# Maximum number of inbound peers +max_num_inbound_peers = 40 + +# Maximum number of outbound peers to connect to, excluding persistent peers +max_num_outbound_peers = 10 + +# List of node IDs, to which a connection will be (re)established ignoring any existing limits +unconditional_peer_ids = "" + +# Maximum pause when redialing a persistent peer (if zero, exponential backoff is used) +persistent_peers_max_dial_period = "0s" + +# Time to wait before flushing messages out on the connection +flush_throttle_timeout = "100ms" + +# Maximum size of a message packet payload, in bytes +max_packet_msg_payload_size = 1024 + +# Rate at which packets can be sent, in bytes/second +send_rate = 5120000 + +# Rate at which packets can be received, in bytes/second +recv_rate = 5120000 + +# Set true to enable the peer-exchange reactor +pex = true + +# Seed mode, in which node constantly crawls the network and looks for +# peers. If another node asks it for addresses, it responds and disconnects. +# +# Does not work if the peer-exchange reactor is disabled. +seed_mode = false + +# Comma separated list of peer IDs to keep private (will not be gossiped to other peers) +private_peer_ids = "" + +# Toggle to disable guard against peers connecting from the same ip. +allow_duplicate_ip = false + +# Peer connection configuration. +handshake_timeout = "20s" +dial_timeout = "3s" + +####################################################### +### Mempool Configuration Option ### +####################################################### +[mempool] + +# Mempool version to use: +# 1) "v0" - FIFO mempool. +# 2) "v1" - (default) prioritized mempool. +# 3) "v2" - content addressable transaction pool +version = "v1" + +# Recheck (default: true) defines whether CometBFT should recheck the +# validity for all remaining transaction in the mempool after a block. +# Since a block affects the application state, some transactions in the +# mempool may become invalid. If this does not apply to your application, +# you can disable rechecking. +recheck = true +broadcast = true +wal_dir = "" + +# Maximum number of transactions in the mempool +size = 5000 + +# Limit the total size of all txs in the mempool. +# This only accounts for raw transactions (e.g. given 1MB transactions and +# max_txs_bytes=5MB, mempool will only accept 5 transactions). +max_txs_bytes = 39485440 + +# Size of the cache (used to filter transactions we saw earlier) in transactions +cache_size = 10000 + +# Do not remove invalid transactions from the cache (default: false) +# Set to true if it's not possible for any invalid transaction to become valid +# again in the future. +keep-invalid-txs-in-cache = false + +# Maximum size of a single transaction. +# NOTE: the max size of a tx transmitted over the network is {max_tx_bytes}. +max_tx_bytes = 7897088 + +# Maximum size of a batch of transactions to send to a peer +# Including space needed by encoding (one varint per transaction). +# XXX: Unused due to https://github.com/tendermint/tendermint/issues/5796 +max_batch_bytes = 0 + +# ttl-duration, if non-zero, defines the maximum amount of time a transaction +# can exist for in the mempool. +# +# Note, if ttl-num-blocks is also defined, a transaction will be removed if it +# has existed in the mempool at least ttl-num-blocks number of blocks or if it's +# insertion time into the mempool is beyond ttl-duration. +ttl-duration = "1m15s" + +# ttl-num-blocks, if non-zero, defines the maximum number of blocks a transaction +# can exist for in the mempool. +# +# Note, if ttl-duration is also defined, a transaction will be removed if it +# has existed in the mempool at least ttl-num-blocks number of blocks or if +# it's insertion time into the mempool is beyond ttl-duration. +ttl-num-blocks = 5 + +# max-gossip-delay is the maximum allotted time that the reactor expects a transaction to +# arrive before issuing a new request to a different peer +# Only applicable to the v2 / CAT mempool +# Default is 200ms +max-gossip-delay = "0s" + +####################################################### +### State Sync Configuration Options ### +####################################################### +[statesync] +# State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine +# snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in +# the network to take and serve state machine snapshots. State sync is not attempted if the node +# has any local state (LastBlockHeight > 0). The node will have a truncated block history, +# starting from the height of the snapshot. +enable = false + +# RPC servers (comma-separated) for light client verification of the synced state machine and +# retrieval of state data for node bootstrapping. Also needs a trusted height and corresponding +# header hash obtained from a trusted source, and a period during which validators can be trusted. +# +# For Cosmos SDK-based chains, trust_period should usually be about 2/3 of the unbonding time (~2 +# weeks) during which they can be financially punished (slashed) for misbehavior. +rpc_servers = "" +trust_height = 0 +trust_hash = "" +trust_period = "168h0m0s" + +# Time to spend discovering snapshots before initiating a restore. +discovery_time = "15s" + +# Temporary directory for state sync snapshot chunks, defaults to the OS tempdir (typically /tmp). +# Will create a new, randomly named directory within, and remove it when done. +temp_dir = "" + +# The timeout duration before re-requesting a chunk, possibly from a different +# peer (default: 1 minute). +chunk_request_timeout = "10s" + +# The number of concurrent chunk fetchers to run (default: 1). +chunk_fetchers = "4" + +####################################################### +### Fast Sync Configuration Connections ### +####################################################### +[fastsync] + +# Fast Sync version to use: +# 1) "v0" (default) - the legacy fast sync implementation +# "v1" and "v2" are disabled. They have been deprecated and will +# be completely removed in one of the upcoming releases +version = "v0" + +####################################################### +### Consensus Configuration Options ### +####################################################### +[consensus] + +# Experimental: if set to "true", only internal messages will be +# written to the WAL. External messages like votes, proposal, +# block parts, will not be written. +# Use at your own risk! +only_internal_wal = "false" + +wal_file = "data/cs.wal/wal" + +# How long we wait for a proposal block before prevoting nil +timeout_propose = "10s" +# How much timeout_propose increases with each round +timeout_propose_delta = "500ms" +# How long we wait after receiving +2/3 prevotes for “anything” (ie. not a single block or nil) +timeout_prevote = "1s" +# How much the timeout_prevote increases with each round +timeout_prevote_delta = "500ms" +# How long we wait after receiving +2/3 precommits for “anything” (ie. not a single block or nil) +timeout_precommit = "1s" +# How much the timeout_precommit increases with each round +timeout_precommit_delta = "500ms" +# How long we wait after committing a block, before starting on the new +# height (this gives us a chance to receive some more precommits, even +# though we already have +2/3). +timeout_commit = "11s" + +# How many blocks to look back to check existence of the node's consensus votes before joining consensus +# When non-zero, the node will panic upon restart +# if the same consensus key was used to sign {double_sign_check_height} last blocks. +# So, validators should stop the state machine, wait for some blocks, and then restart the state machine to avoid panic. +double_sign_check_height = 0 + +# Make progress as soon as we have all the precommits (as if TimeoutCommit = 0) +skip_timeout_commit = false + +# EmptyBlocks mode and possible interval between empty blocks +create_empty_blocks = true +create_empty_blocks_interval = "0s" + +# Reactor sleep duration parameters +peer_gossip_sleep_duration = "100ms" +peer_query_maj23_sleep_duration = "2s" + +####################################################### +### Storage Configuration Options ### +####################################################### +[storage] + +# Set to true to discard ABCI responses from the state store, which can save a +# considerable amount of disk space. Set to false to ensure ABCI responses are +# persisted. ABCI responses are required for /block_results RPC queries, and to +# reindex events in the command-line tool. +discard_abci_responses = false + +####################################################### +### Transaction Indexer Configuration Options ### +####################################################### +[tx_index] + +# What indexer to use for transactions +# +# The application will set which txs to index. In some cases a node operator will be able +# to decide which txs to index based on configuration set in the application. +# +# Options: +# 1) "null" +# 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). +# - When "kv" is chosen "tx.height" and "tx.hash" will always be indexed. +# 3) "psql" - the indexer services backed by PostgreSQL. +# When "kv" or "psql" is chosen "tx.height" and "tx.hash" will always be indexed. +indexer = "kv" + +# The PostgreSQL connection configuration, the connection format: +# postgresql://:@:/? +psql-conn = "" + +####################################################### +### Instrumentation Configuration Options ### +####################################################### +[instrumentation] + +# When true, Prometheus metrics are served under /metrics on +# PrometheusListenAddr. +# Check out the documentation for the list of available metrics. +prometheus = true + +# Address to listen for Prometheus collector(s) connections +prometheus_listen_addr = ":26660" + +# Maximum number of simultaneous connections. +# If you want to accept a larger number than the default, make sure +# you increase your OS limits. +# 0 - unlimited. +max_open_connections = 3 + +# Instrumentation namespace +namespace = "cometbft" + +# TracePushConfig is the relative path of the push config. +# This second config contains credentials for where and how often to +# push trace data to. For example, if the config is next to this config, +# it would be "push_config.json". +trace_push_config = "" + +# The tracer pull address specifies which address will be used for pull based +# event collection. If empty, the pull based server will not be started. +trace_pull_address = "" + +# The tracer to use for collecting trace data. +trace_type = "noop" + +# The size of the batches that are sent to the database. +trace_push_batch_size = 1000 + +# The list of tables that are updated when tracing. All available tables and +# their schema can be found in the pkg/trace/schema package. It is represented as a +# comma separate string. For example: "consensus_round_state,mempool_tx". +tracing_tables = "mempool_tx,mempool_peer_state,consensus_round_state,consensus_block_parts,consensus_block,consensus_vote" + +# The URL of the pyroscope instance to use for continuous profiling. +# If empty, continuous profiling is disabled. +pyroscope_url = "" + +# When true, tracing data is added to the continuous profiling +# performed by pyroscope. +pyroscope_trace = false + +# pyroscope_profile_types is a list of profile types to be traced with +# pyroscope. Available profile types are: cpu, alloc_objects, alloc_space, +# inuse_objects, inuse_space, goroutines, mutex_count, mutex_duration, +# block_count, block_duration. +pyroscope_profile_types = ["cpu", "alloc_objects", "inuse_objects", "goroutines", "mutex_count", "mutex_duration", "block_count", "block_duration", ] diff --git a/local_devnet/celestia-app/core0/config/gentx/gentx-e3c592c0c2ad4b05cef3791456b0d6dd4da72ed2.json b/local_devnet/celestia-app/core0/config/gentx/gentx-e3c592c0c2ad4b05cef3791456b0d6dd4da72ed2.json new file mode 100644 index 0000000000..f8a9f8c6b0 --- /dev/null +++ b/local_devnet/celestia-app/core0/config/gentx/gentx-e3c592c0c2ad4b05cef3791456b0d6dd4da72ed2.json @@ -0,0 +1 @@ +{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"local_devnet","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"celestia1ue937yczuluexnml0fal4efdzx3dzhg94wcp9m","validator_address":"celestiavaloper1ue937yczuluexnml0fal4efdzx3dzhg9s36cna","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"M2O6qD4fkKcPR+cemsuapvs/tGSTb6P16QinK7o7Vuo="},"value":{"denom":"utia","amount":"5000000000"}}],"memo":"e3c592c0c2ad4b05cef3791456b0d6dd4da72ed2@192.168.11.103:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AhKFsdcYhIAZsHHuZ/kkpOxth9OKvN8lTx36cZMOnOeV"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[{"denom":"utia","amount":"500"}],"gas_limit":"210000","payer":"","granter":""},"tip":null},"signatures":["z6kZgIUTqjbIdzXq+SEw+Dsxg4Y8qNbr9Et8pYZf8p0p4V/7t/GshK8ikeda4yMRAy7TjYA8SyMSKtP4cblvdA=="]} diff --git a/local_devnet/celestia-app/core0/config/node_key.json b/local_devnet/celestia-app/core0/config/node_key.json new file mode 100644 index 0000000000..cb396e1832 --- /dev/null +++ b/local_devnet/celestia-app/core0/config/node_key.json @@ -0,0 +1 @@ +{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"/x+/y3d64W5P/y/vSYtPJZiuHkvo5kOZopyAmPoReIjXgt2dOqPqLBg4Z4SRvN6e0SRwBNrV67Ti391bs/mCbg=="}} \ No newline at end of file diff --git a/local_devnet/celestia-app/core0/config/priv_validator_key.json b/local_devnet/celestia-app/core0/config/priv_validator_key.json new file mode 100644 index 0000000000..0c475d5cc2 --- /dev/null +++ b/local_devnet/celestia-app/core0/config/priv_validator_key.json @@ -0,0 +1,11 @@ +{ + "address": "12C509ED04EA103C84944017B9E7ADE494D486A3", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "M2O6qD4fkKcPR+cemsuapvs/tGSTb6P16QinK7o7Vuo=" + }, + "priv_key": { + "type": "tendermint/PrivKeyEd25519", + "value": "EfyvS5xUynAeiw8XoF/7Z03ZkSGiLMiRnltqxxWxjVIzY7qoPh+Qpw9H5x6ay5qm+z+0ZJNvo/XpCKcrujtW6g==" + } +} \ No newline at end of file diff --git a/local_devnet/celestia-app/core0/keyring-test/core0.info b/local_devnet/celestia-app/core0/keyring-test/core0.info new file mode 100644 index 0000000000..47413a4758 --- /dev/null +++ b/local_devnet/celestia-app/core0/keyring-test/core0.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wNC0yNSAxNTowMzo1OC42MzIzNiArMDEwMCArMDEgbT0rMC4wMzE2MjE2MjYiLCJlbmMiOiJBMjU2R0NNIiwicDJjIjo4MTkyLCJwMnMiOiJMZG5udl9mQnNURFRYbFJSIn0._8h8HisRMf5JfweNR5RVol3AMTwSKHkxws-Mqdv7vqH5IAU4F3I2XA.SImXkaYrajs2KX9K.5h0H24ZIedvCBY1FbCW48_1X7c8a55y8gWUCWhv0PlceAGeXUC28Qd09tvYdOuVJEF2Nms_7RoLa3dCp99pzPXm_R7JXqMMqBFSqkU4prr5RJXafllVCj1mglLqfryt97L7H5eciUYmq1qii1WrhyttM4pbjgQJnxS42mHIxUMcfisoMNCRunEaRTbcg5juD7ezk32hdvP3KStjnAedto68hwvgPTVVVgOdeJQQdPYcyNTfnYxRBM9B60voFR9OrAkASzSRmS5YMk4b9Ph3vtUTTB5gtUUgvdoKjTibBZYiTaLDBxqIVK0hkDfys86nUkrpHU7K63Q3mPhFZusJaXM-bJoRZDMxr5vFO9ydhG3gnH1qzmgrUz4gQgTEBjRkFYT1egggvFDnFhvxhW2fmReXiFwn0-H8ilgysFxHP8YFZOgCTT4lFj6K46Uc.r66jsTodN3ofDMcgsAeGnQ \ No newline at end of file diff --git a/local_devnet/celestia-app/core0/keyring-test/e64b1f1302e7f9934f7f7a7bfae52d11a2d15d05.address b/local_devnet/celestia-app/core0/keyring-test/e64b1f1302e7f9934f7f7a7bfae52d11a2d15d05.address new file mode 100644 index 0000000000..dcb747f4e3 --- /dev/null +++ b/local_devnet/celestia-app/core0/keyring-test/e64b1f1302e7f9934f7f7a7bfae52d11a2d15d05.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wNC0yNSAxNTowMzo1OC42MzM4NDEgKzAxMDAgKzAxIG09KzAuMDMzMTAzMDQzIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiVVlNdHZTRnJIY3REenA5NSJ9.ct2WaJaQlJxmOPkD2kE_7XjVkHyl9FAL-VmNgrSH7H-R42V9oBQBlw.I-ExsP0hPFgfaFGc.DbKn3odg3pSTfLcwRBeEXzInxphgYREpRHyV7n3spTwsoISIPv1txRVdcblgU3YbC7xkZorPKs4R2fHFw4AHPTL8V4iNGfpGfCWs-b0MgWl3kxPLsIKyIEc2xuV1z_YI8z6jWjrvN5HcIjXJIMwCpw57L3iRBTLpUKBcclq9N4XfXIJy8w7PdN9PjEPFEmBEgJ-zCB6BVGisKAaUxXz-p4eT6tbOE7c0aQmbk-wbZKxC6vciGt8.Up6OdKzSHARh6SwUaKWdyA \ No newline at end of file diff --git a/local_devnet/celestia-app/core1/config/node_key.json b/local_devnet/celestia-app/core1/config/node_key.json new file mode 100644 index 0000000000..9faba6db4d --- /dev/null +++ b/local_devnet/celestia-app/core1/config/node_key.json @@ -0,0 +1 @@ +{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"6Bzmn1qiS+qdznTQTSBmtIocwwXSy3b+3+Oio6zY7IoiUY3/QE3KnyFMAadYtzdAY6Yn4dqo/rU4T0PrLOFuVA=="}} \ No newline at end of file diff --git a/local_devnet/celestia-app/core1/config/priv_validator_key.json b/local_devnet/celestia-app/core1/config/priv_validator_key.json new file mode 100644 index 0000000000..c1c5494518 --- /dev/null +++ b/local_devnet/celestia-app/core1/config/priv_validator_key.json @@ -0,0 +1,11 @@ +{ + "address": "E0B63563D528BDA8AA3D26A703FC8EAAD1556016", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "txZzDu84JDYFruXqzpd2HuY15Dwr4Viy31N8rUzdINE=" + }, + "priv_key": { + "type": "tendermint/PrivKeyEd25519", + "value": "bhWQYz9CKoJqHXkTymhuOxfH3qDqF0SsEk2CrfLw/Pu3FnMO7zgkNgWu5erOl3Ye5jXkPCvhWLLfU3ytTN0g0Q==" + } +} diff --git a/local_devnet/celestia-app/core1/keyring-test/56d3d9fcadf711f5bfc4fefd8e92d9171db23229.address b/local_devnet/celestia-app/core1/keyring-test/56d3d9fcadf711f5bfc4fefd8e92d9171db23229.address new file mode 100644 index 0000000000..2d195b5a0f --- /dev/null +++ b/local_devnet/celestia-app/core1/keyring-test/56d3d9fcadf711f5bfc4fefd8e92d9171db23229.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wNC0yNSAxNTowMzo1OS43MDE0MDMgKzAxMDAgKzAxIG09KzAuMDM5Njg2Mzc2IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoia1BUVXZLWXZEWnNWMHgzRSJ9.R0FIfbCIZHQj1mldwwC3BGtOzqE2l6R4dIpai1iQkOsAlpKPeM8xUg.82jhoj7rlJgtq9ge.oR5HVNZbRZxgPCGLJHI4pSy5-xY4hQj1iRyAgk0uErHWx1yQepsPfoGHGMoyRllySy8RHGlc0NTLi_3GMgj-yZHiX_W6DfymRo14_bgh_b1fd0OcTM-K6MBZu7yEEej-MHPd4ZAxfTr20HwS5PzqN6Iwjv_iQniK8WSzAcFrOZCtm4WSBuCDjgQvF20hc3vJQ4HcNqOIsIXkcKvINU0W2Mzud3FpB9O-Ha1kSjAQZu20qgV047w.yyjvn3qddelrHKp3JEgGag \ No newline at end of file diff --git a/local_devnet/celestia-app/core1/keyring-test/core1.info b/local_devnet/celestia-app/core1/keyring-test/core1.info new file mode 100644 index 0000000000..d2f363fc11 --- /dev/null +++ b/local_devnet/celestia-app/core1/keyring-test/core1.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wNC0yNSAxNTowMzo1OS42OTk5NyArMDEwMCArMDEgbT0rMC4wMzgyNTI4MzQiLCJlbmMiOiJBMjU2R0NNIiwicDJjIjo4MTkyLCJwMnMiOiJXNjBVMml2MURWYlFCREwtIn0.yFMcN5IzzMtccBa-EZLkYDdqAqdajNf6HNbvsAEqM0taNUoIUMpo1g.wQ82Gik_x3q-NV-V.BxPCwVbZMKTJLooYWH1xIRMKHb8s3eavMg9PboNo2RQS7IHDkkCk63Nos78XHIJTbUpC-rHOn3BKF0wlaFCbf76QEEwo9Cw_-tBUVqPdI5GI3Lfx9To7B8tpgnrsleTdS-DCUbIPg1JtzMcMCbKarintMTLYQq_3mMGGaJNbspi_P2hsK0AgeCZjaexq0NbE5wmIg7k3OzWSOVECbDKGcYc4EtHXykeYqZn-fMU2PUBa6u4N-QR5GL3NvZPA1gVfoYa8UPrYE1xwwrB9RcLvk4Z5cNhMAK_FqdZiejBrISW-trHsCYxNPIpy0gRuMSQqu2e0P9yELrNtMbWX7jNz5JxWHuo94TUrDWIbkPh3V0IMO2OSScKFCe9UMoPS7jec61zXdKbRbeZj3yUwZ5x7TdnX9UOidQ7oXxF8TxsPwQHJCwk87h_jrAQTNAM.ZP3QOq3StpGBVrldcRuT2Q \ No newline at end of file diff --git a/local_devnet/celestia-app/core2/config/node_key.json b/local_devnet/celestia-app/core2/config/node_key.json new file mode 100644 index 0000000000..ccd2e65dba --- /dev/null +++ b/local_devnet/celestia-app/core2/config/node_key.json @@ -0,0 +1 @@ +{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"Fzw87L+h3k5SqhLmJ9j2ZiJol/yv+nVwtdMSPJV+GZNo5VlY+IcdCt2D/XbahQv+GmpdXqFNYH1i6bakJd5RHA=="}} \ No newline at end of file diff --git a/local_devnet/celestia-app/core2/config/priv_validator_key.json b/local_devnet/celestia-app/core2/config/priv_validator_key.json new file mode 100644 index 0000000000..5a7032cc47 --- /dev/null +++ b/local_devnet/celestia-app/core2/config/priv_validator_key.json @@ -0,0 +1,11 @@ +{ + "address": "BC381AF58CB970ACAF795A003461EE02057C5F92", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "FofILZcGufMCLOtcSc/Vsq5P2qiWv+hQOnmlq+OGYTQ=" + }, + "priv_key": { + "type": "tendermint/PrivKeyEd25519", + "value": "g2mO9OAForIzmS79sXO/9/5k9LEtv/AjuQnzVNDy0NAWh8gtlwa58wIs61xJz9Wyrk/aqJa/6FA6eaWr44ZhNA==" + } +} diff --git a/local_devnet/celestia-app/core2/keyring-test/core2.info b/local_devnet/celestia-app/core2/keyring-test/core2.info new file mode 100644 index 0000000000..b5aaaa0f8a --- /dev/null +++ b/local_devnet/celestia-app/core2/keyring-test/core2.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wNC0yNSAxNTowNDowMC43NjczMTUgKzAxMDAgKzAxIG09KzAuMDM3OTQ5MDQzIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoicEpRbDNNWV9kM3ZxRFNWRSJ9.0R3W56R8NJNQEnKA1L2Qlf2vIRu77VHU_BzF6eonesgFD_CT51c7rA.JWfxHw19OpS6tVbv.t6HgAg2jH8pORP8Lss02l8pRwsJQnobtkHgPbmkOULRXjrL3sqsBhPC2KkxozWr6ZKD1xhnk8dw3dgeAdBEqkiydRUZWg2V7Eyk4REG6xAh6QCskAMVl1DFaokQ1d5jrqU0KRp1pvlkMB_heYf_B0eNTZVwi0yulUb0Xov79hxKbyrO93s1D8cttv_y1AnebIFMlIPBO28GtW_5Z2bP3qI-am8pgarPvLZg7XHMgOs96-rH2XhyVgGoQyFCPp-Rdxsal5ExvMz7ZOg2nakL_SYFTQ-E0FRofPPiSc9idNfSnW1f1_9V9h0Adn38t5vXS_EnWfel-aOTajUx2HdRoaNLt9Y4O2lCGTLhs91RwrqOoDNIbtdi2YC0ID9C3fpf-vFskIz5D78d4oNskSilhYuODQysx79HlOIJECILcIddUJUHe1MKD8oISvx8.tcrxY5v596N5nMNjf2ykyg \ No newline at end of file diff --git a/local_devnet/celestia-app/core2/keyring-test/ff2937f6477de47e5495f9dd863b6dc2d94458fc.address b/local_devnet/celestia-app/core2/keyring-test/ff2937f6477de47e5495f9dd863b6dc2d94458fc.address new file mode 100644 index 0000000000..98c243b876 --- /dev/null +++ b/local_devnet/celestia-app/core2/keyring-test/ff2937f6477de47e5495f9dd863b6dc2d94458fc.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wNC0yNSAxNTowNDowMC43Njg3NjEgKzAxMDAgKzAxIG09KzAuMDM5Mzk1MjkzIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoieVUtVWFQT2xjOXN2bUhfMCJ9.Z0l4fX8DrpmCh5PskdrLeqEhcshRzoS_CorHtdw6yDsw0V0ZuGeMjA.B0BIaKnejhCjSAsg.k76WJ6gNRR28XCkHjHW8PQ2Yj0LIyafepHs7oHPvHNgIwK1K6EJ4zpi38GncEkznFDGoKzOP1h8iUHU2U2FUHQrcAIxUMBdXnIkeHKnOVa5Q0OnxEbiiGigpy9TnfAzuLDNbqXHLzhXg-F4PNIe-BK5Ayoic3SIAr3miZgFxzd2rWAK8-9HvlLDMWXF31MpzBX_4CWeMQuDsc6YWQrwwp4jp2XzBAcOf1KYDh10HGJIJwrJY7co.NDYPNY4mZdXDmoL9IvAn4A \ No newline at end of file diff --git a/local_devnet/celestia-app/core3/config/node_key.json b/local_devnet/celestia-app/core3/config/node_key.json new file mode 100644 index 0000000000..6c571fb577 --- /dev/null +++ b/local_devnet/celestia-app/core3/config/node_key.json @@ -0,0 +1 @@ +{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"H8Qluvmcjt7kflsxqAZ711SrttWqKUdMzDMwmn+IE2BU/TQf05A5BszktAvUSTCKuyz6z1+SkLPnc+HK5FMvtQ=="}} \ No newline at end of file diff --git a/local_devnet/celestia-app/core3/config/priv_validator_key.json b/local_devnet/celestia-app/core3/config/priv_validator_key.json new file mode 100644 index 0000000000..3318cef7de --- /dev/null +++ b/local_devnet/celestia-app/core3/config/priv_validator_key.json @@ -0,0 +1,11 @@ +{ + "address": "223467FF1BD29B323D8CF4AFCFECD5ED1C0D4383", + "pub_key": { + "type": "tendermint/PubKeyEd25519", + "value": "+BDjqMwVmqoQ5skfKtaclG7qoANYCH4Qs8FER3j3Obg=" + }, + "priv_key": { + "type": "tendermint/PrivKeyEd25519", + "value": "EVJrLtp4tcXDtS4bnewrzk3BKqavipm0H7vpfuLTAlL4EOOozBWaqhDmyR8q1pyUbuqgA1gIfhCzwURHePc5uA==" + } +} diff --git a/local_devnet/celestia-app/core3/keyring-test/core3.info b/local_devnet/celestia-app/core3/keyring-test/core3.info new file mode 100644 index 0000000000..972400c8c2 --- /dev/null +++ b/local_devnet/celestia-app/core3/keyring-test/core3.info @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wNC0yNSAxNTowNDowMS44MzQwMjkgKzAxMDAgKzAxIG09KzAuMDM3ODAzMjkzIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoicXNLQzRWaF9xMXdGRkpROSJ9.FpQJtSfFeZ1h3opc_9uN5twpzZeb3UEY27JSQ3B_1bQaApQnm3vY5A.AOxHP14Z_m7LKAoF.lPg6wbheRzrnFQQAIL-mhdcwiUX5iQiBwGq05-_iUFligOnB69nMR2ya3GOUu5-AskoF4ZDtHEFogO9x-mNUnmb-89IDUuYQmAdEg5hoDTQDNp2TFdXKZXM_9D8XT0Nus4TwOKHgIqaHsgEXRxH5gUym3CHufyOyebCII_KmwCjIKEgHGK6lCXkQmEtncYLVuJSHmGd03Qleul-9B8RtqCDQbImcwxoMxnMSazNKuQyMKg6W8eBfTfxDpjy3WiJrrQ0WCUoQcDnV-LAJom2WWeERI3cWXN-YHlKH7YYZCUKal8tCK7TycUDJiV2X3AYti3uLQa9utQb7QTyjzP-QZlyGkkBqOJx4KypRmiFAHX6Q8XmpXSphEvifcnr7uEwQGQGVEYxhDoDyH9sQu1ekcs_R3DO2d4AFhhlL6CrXQEBbvAqPJQiRuDB_wwY.LNWs8i4alO1WbzshC2tUAw \ No newline at end of file diff --git a/local_devnet/celestia-app/core3/keyring-test/eeb259c4fdea3c6fd42463d7a82a21d2cd68713b.address b/local_devnet/celestia-app/core3/keyring-test/eeb259c4fdea3c6fd42463d7a82a21d2cd68713b.address new file mode 100644 index 0000000000..2dbf51f996 --- /dev/null +++ b/local_devnet/celestia-app/core3/keyring-test/eeb259c4fdea3c6fd42463d7a82a21d2cd68713b.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wNC0yNSAxNTowNDowMS44MzU0NzYgKzAxMDAgKzAxIG09KzAuMDM5MjQ5ODc2IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiZXRHaUUwMFF0Ui02UlBMcSJ9.F-TG-PYguFMoc7zcThN7yGTu8HNL-3uFmF8eojkTpX6fyr2VjBwsBA.fG_GRadRcGH-uyNU.02Kg6KG19BybLdhY91f_VNM7S2DzXmYdfas5gOObLi9J9u6W2zeKP-Wz1AiOX-ChYGuFWvSM-q4a0ZQL7dHOwlkX3rxRYemnp48gkhI424al_m0RUhYzQQZO2-mLE6GrYqeLO6kWX_aU0L3TF1a_v1_0nTTafq-eOhKj6RxXKSTs11lxdApnDAVMod25f4rAr94MLdPJ6t6Uecw-30MCEcWQFeJvvL6yfyJXWzhKpsLZniq6Xd8.zMzQtCRywzWq7d3u3qPACQ \ No newline at end of file diff --git a/local_devnet/celestia-app/genesis.json b/local_devnet/celestia-app/genesis.json new file mode 100644 index 0000000000..72444d8af5 --- /dev/null +++ b/local_devnet/celestia-app/genesis.json @@ -0,0 +1,401 @@ +{ + "genesis_time": "2024-04-25T14:03:58.593264Z", + "chain_id": "local_devnet", + "initial_height": "1", + "consensus_params": { + "block": { + "max_bytes": "1974272", + "max_gas": "-1", + "time_iota_ms": "1" + }, + "evidence": { + "max_age_num_blocks": "120961", + "max_age_duration": "1814400000000000", + "max_bytes": "1048576" + }, + "validator": { + "pub_key_types": [ + "ed25519" + ] + }, + "version": { + "app_version": "2" + } + }, + "app_hash": "", + "app_state": { + "auth": { + "params": { + "max_memo_characters": "256", + "tx_sig_limit": "7", + "tx_size_cost_per_byte": "10", + "sig_verify_cost_ed25519": "590", + "sig_verify_cost_secp256k1": "1000" + }, + "accounts": [ + { + "@type": "/cosmos.auth.v1beta1.BaseAccount", + "address": "celestia1ue937yczuluexnml0fal4efdzx3dzhg94wcp9m", + "pub_key": null, + "account_number": "0", + "sequence": "0" + }, + { + "@type": "/cosmos.auth.v1beta1.BaseAccount", + "address": "celestia12mfanl9d7uglt07ylm7caykezuwmyv3fffjqu0", + "pub_key": null, + "account_number": "0", + "sequence": "0" + }, + { + "@type": "/cosmos.auth.v1beta1.BaseAccount", + "address": "celestia1lu5n0aj80hj8u4y4l8wcvwmdctv5gk8unraf8q", + "pub_key": null, + "account_number": "0", + "sequence": "0" + }, + { + "@type": "/cosmos.auth.v1beta1.BaseAccount", + "address": "celestia1a6e9n38aag7xl4pyv0t6s23p6txksufmwj5yts", + "pub_key": null, + "account_number": "0", + "sequence": "0" + } + ] + }, + "authz": { + "authorization": [] + }, + "bank": { + "params": { + "send_enabled": [], + "default_send_enabled": true + }, + "balances": [ + { + "address": "celestia12mfanl9d7uglt07ylm7caykezuwmyv3fffjqu0", + "coins": [ + { + "denom": "utia", + "amount": "1000000000000000" + } + ] + }, + { + "address": "celestia1ue937yczuluexnml0fal4efdzx3dzhg94wcp9m", + "coins": [ + { + "denom": "utia", + "amount": "1000000000000000" + } + ] + }, + { + "address": "celestia1a6e9n38aag7xl4pyv0t6s23p6txksufmwj5yts", + "coins": [ + { + "denom": "utia", + "amount": "1000000000000000" + } + ] + }, + { + "address": "celestia1lu5n0aj80hj8u4y4l8wcvwmdctv5gk8unraf8q", + "coins": [ + { + "denom": "utia", + "amount": "1000000000000000" + } + ] + } + ], + "supply": [ + { + "denom": "utia", + "amount": "4000000000000000" + } + ], + "denom_metadata": [ + { + "description": "The native token of the Celestia network.", + "denom_units": [ + { + "denom": "utia", + "exponent": 0, + "aliases": [ + "microtia" + ] + }, + { + "denom": "TIA", + "exponent": 6, + "aliases": [] + } + ], + "base": "utia", + "display": "TIA", + "name": "TIA", + "symbol": "TIA", + "uri": "", + "uri_hash": "" + } + ] + }, + "blob": { + "params": { + "gas_per_blob_byte": 8, + "gov_max_square_size": "64" + } + }, + "capability": { + "index": "1", + "owners": [] + }, + "crisis": { + "constant_fee": { + "denom": "utia", + "amount": "1000" + } + }, + "distribution": { + "params": { + "community_tax": "0.020000000000000000", + "base_proposer_reward": "0.000000000000000000", + "bonus_proposer_reward": "0.000000000000000000", + "withdraw_addr_enabled": true + }, + "fee_pool": { + "community_pool": [] + }, + "delegator_withdraw_infos": [], + "previous_proposer": "", + "outstanding_rewards": [], + "validator_accumulated_commissions": [], + "validator_historical_rewards": [], + "validator_current_rewards": [], + "delegator_starting_infos": [], + "validator_slash_events": [] + }, + "evidence": { + "evidence": [] + }, + "feegrant": { + "allowances": [] + }, + "genutil": { + "gen_txs": [ + { + "body": { + "messages": [ + { + "@type": "/cosmos.staking.v1beta1.MsgCreateValidator", + "description": { + "moniker": "local_devnet", + "identity": "", + "website": "", + "security_contact": "", + "details": "" + }, + "commission": { + "rate": "0.100000000000000000", + "max_rate": "0.200000000000000000", + "max_change_rate": "0.010000000000000000" + }, + "min_self_delegation": "1", + "delegator_address": "celestia1ue937yczuluexnml0fal4efdzx3dzhg94wcp9m", + "validator_address": "celestiavaloper1ue937yczuluexnml0fal4efdzx3dzhg9s36cna", + "pubkey": { + "@type": "/cosmos.crypto.ed25519.PubKey", + "key": "M2O6qD4fkKcPR+cemsuapvs/tGSTb6P16QinK7o7Vuo=" + }, + "value": { + "denom": "utia", + "amount": "5000000000" + } + } + ], + "memo": "e3c592c0c2ad4b05cef3791456b0d6dd4da72ed2@192.168.11.103:26656", + "timeout_height": "0", + "extension_options": [], + "non_critical_extension_options": [] + }, + "auth_info": { + "signer_infos": [ + { + "public_key": { + "@type": "/cosmos.crypto.secp256k1.PubKey", + "key": "AhKFsdcYhIAZsHHuZ/kkpOxth9OKvN8lTx36cZMOnOeV" + }, + "mode_info": { + "single": { + "mode": "SIGN_MODE_DIRECT" + } + }, + "sequence": "0" + } + ], + "fee": { + "amount": [ + { + "denom": "utia", + "amount": "500" + } + ], + "gas_limit": "210000", + "payer": "", + "granter": "" + }, + "tip": null + }, + "signatures": [ + "z6kZgIUTqjbIdzXq+SEw+Dsxg4Y8qNbr9Et8pYZf8p0p4V/7t/GshK8ikeda4yMRAy7TjYA8SyMSKtP4cblvdA==" + ] + } + ] + }, + "gov": { + "starting_proposal_id": "1", + "deposits": [], + "votes": [], + "proposals": [], + "deposit_params": { + "min_deposit": [ + { + "denom": "utia", + "amount": "10000000000" + } + ], + "max_deposit_period": "60s" + }, + "voting_params": { + "voting_period": "60s" + }, + "tally_params": { + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto_threshold": "0.334000000000000000" + } + }, + "ibc": { + "client_genesis": { + "clients": [], + "clients_consensus": [], + "clients_metadata": [], + "params": { + "allowed_clients": [ + "06-solomachine", + "07-tendermint" + ] + }, + "create_localhost": false, + "next_client_sequence": "0" + }, + "connection_genesis": { + "connections": [], + "client_connection_paths": [], + "next_connection_sequence": "0", + "params": { + "max_expected_time_per_block": "75000000000" + } + }, + "channel_genesis": { + "channels": [], + "acknowledgements": [], + "commitments": [], + "receipts": [], + "send_sequences": [], + "recv_sequences": [], + "ack_sequences": [], + "next_channel_sequence": "0" + } + }, + "interchainaccounts": { + "controller_genesis_state": { + "active_channels": [], + "interchain_accounts": [], + "ports": [], + "params": { + "controller_enabled": false + } + }, + "host_genesis_state": { + "active_channels": [], + "interchain_accounts": [], + "port": "icahost", + "params": { + "host_enabled": true, + "allow_messages": [ + "/ibc.applications.transfer.v1.MsgTransfer", + "/cosmos.bank.v1beta1.MsgSend", + "/cosmos.staking.v1beta1.MsgDelegate", + "/cosmos.staking.v1beta1.MsgBeginRedelegate", + "/cosmos.staking.v1beta1.MsgUndelegate", + "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", + "/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", + "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + "/cosmos.distribution.v1beta1.MsgFundCommunityPool", + "/cosmos.gov.v1.MsgVote", + "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + "/cosmos.feegrant.v1beta1.MsgRevokeAllowance" + ] + } + } + }, + "minfee": { + "global_min_gas_price": "0.002000000000000000" + }, + "mint": { + "bond_denom": "utia" + }, + "packetfowardmiddleware": { + "params": { + "fee_percentage": "0.000000000000000000" + }, + "in_flight_packets": {} + }, + "params": null, + "qgb": { + "params": { + "data_commitment_window": "400" + } + }, + "signal": {}, + "slashing": { + "params": { + "signed_blocks_window": "5000", + "min_signed_per_window": "0.750000000000000000", + "downtime_jail_duration": "60s", + "slash_fraction_double_sign": "0.020000000000000000", + "slash_fraction_downtime": "0.000000000000000000" + }, + "signing_infos": [], + "missed_blocks": [] + }, + "staking": { + "params": { + "unbonding_time": "1814400s", + "max_validators": 100, + "max_entries": 7, + "historical_entries": 10000, + "bond_denom": "utia", + "min_commission_rate": "0.050000000000000000" + }, + "last_total_power": "0", + "last_validator_powers": [], + "validators": [], + "delegations": [], + "unbonding_delegations": [], + "redelegations": [], + "exported": false + }, + "transfer": { + "port_id": "transfer", + "denom_traces": [], + "params": { + "send_enabled": true, + "receive_enabled": true + } + }, + "vesting": {} + } +} diff --git a/local_devnet/docker-compose.yml b/local_devnet/docker-compose.yml new file mode 100644 index 0000000000..15c0a38704 --- /dev/null +++ b/local_devnet/docker-compose.yml @@ -0,0 +1,157 @@ +version: '3' + +services: + core0: + user: "0:0" + container_name: core0 + build: + context: .. + expose: + - "26660" # for prometheus + ports: + - "9090:9090" + - "26657:26657" + entrypoint: [ + "/bin/bash" + ] + command: [ + "/opt/start_core0.sh" + ] + volumes: + - ${PWD}/celestia-app/core0/config/priv_validator_key.json:/opt/config/priv_validator_key.json:ro + - ${PWD}/celestia-app/core0/config/node_key.json:/opt/config/node_key.json:ro + - ${PWD}/celestia-app/core0/keyring-test:/opt/keyring-test:ro + - ${PWD}/celestia-app/config.toml:/opt/config/config.toml:ro + - ${PWD}/celestia-app/app.toml:/opt/config/app.toml:ro + - ${PWD}/celestia-app/genesis.json:/opt/config/genesis.json:rw + - ${PWD}/scripts/start_core0.sh:/opt/start_core0.sh:ro + + core1: + user: "0:0" + container_name: core1 + build: + context: .. + expose: + - "26660" # for prometheus + depends_on: + - core0 + environment: + - MONIKER=core1 + - CELESTIA_HOME=/opt + - AMOUNT=5000000000utia + entrypoint: [ + "/bin/bash" + ] + command: [ + "/opt/start_node_and_create_validator.sh" + ] + volumes: + - ${PWD}/celestia-app/core1/config/priv_validator_key.json:/opt/config/priv_validator_key.json:ro + - ${PWD}/celestia-app/core1/config/node_key.json:/opt/config/node_key.json:ro + - ${PWD}/celestia-app/core1/keyring-test:/opt/keyring-test:ro + - ${PWD}/scripts/start_node_and_create_validator.sh:/opt/start_node_and_create_validator.sh:ro + - ${PWD}/celestia-app/config.toml:/opt/config/config.toml:ro + - ${PWD}/celestia-app/app.toml:/opt/config/app.toml:ro + - ${PWD}/celestia-app/genesis.json:/opt/config/genesis.json:ro + + core2: + user: "0:0" + container_name: core2 + build: + context: .. + expose: + - "26660" # for prometheus + depends_on: + - core0 + environment: + - MONIKER=core2 + - CELESTIA_HOME=/opt + - AMOUNT=5000000000utia + entrypoint: [ + "/bin/bash" + ] + command: [ + "/opt/start_node_and_create_validator.sh" + ] + volumes: + - ${PWD}/celestia-app/core2/config/priv_validator_key.json:/opt/config/priv_validator_key.json:ro + - ${PWD}/celestia-app/core2/config/node_key.json:/opt/config/node_key.json:ro + - ${PWD}/celestia-app/core2/keyring-test:/opt/keyring-test:ro + - ${PWD}/scripts/start_node_and_create_validator.sh:/opt/start_node_and_create_validator.sh:ro + - ${PWD}/celestia-app/config.toml:/opt/config/config.toml:ro + - ${PWD}/celestia-app/app.toml:/opt/config/app.toml:ro + - ${PWD}/celestia-app/genesis.json:/opt/config/genesis.json:ro + + core3: + user: "0:0" + container_name: core3 + build: + context: .. + expose: + - "26660" # for prometheus + depends_on: + - core0 + environment: + - MONIKER=core3 + - CELESTIA_HOME=/opt + - AMOUNT=5000000000utia + entrypoint: [ + "/bin/bash" + ] + command: [ + "/opt/start_node_and_create_validator.sh" + ] + volumes: + - ${PWD}/celestia-app/core3/config/priv_validator_key.json:/opt/config/priv_validator_key.json:ro + - ${PWD}/celestia-app/core3/config/node_key.json:/opt/config/node_key.json:ro + - ${PWD}/celestia-app/core3/keyring-test:/opt/keyring-test:ro + - ${PWD}/scripts/start_node_and_create_validator.sh:/opt/start_node_and_create_validator.sh:ro + - ${PWD}/celestia-app/config.toml:/opt/config/config.toml:ro + - ${PWD}/celestia-app/app.toml:/opt/config/app.toml:ro + - ${PWD}/celestia-app/genesis.json:/opt/config/genesis.json:ro + + prometheus: + container_name: prometheus + image: prom/prometheus + ports: + - "9000:9090" + volumes: + - ${PWD}/telemetry/prometheus:/etc/prometheus + - prometheus-data:/prometheus + # yamllint disable-line rule:line-length + command: --web.enable-lifecycle --config.file=/etc/prometheus/prometheus.yml + extra_hosts: + - "host.docker.internal:host-gateway" + + otel-collector: + container_name: otel-collector + image: otel/opentelemetry-collector + command: ["--config=/root/otel-collector/config.yml"] + volumes: + - ${PWD}/telemetry/otel-collector:/root/otel-collector/ + ports: + - "8888:8888" # Prometheus metrics exposed by the collector + - "8889:8889" # Prometheus exporter metrics + - "55681:55681" + - "13133:13133" # health_check extension + - "4317:4317" # OTLP gRPC receiver + - "4318:4318" # OTLP http receiver + - "4319:4319" # OTLP http receiver + + grafana: + # default credentials: admin:admin + container_name: grafana + image: grafana/grafana:latest + user: "0" + ports: + - "3000:3000" + restart: unless-stopped + volumes: + - ${PWD}/telemetry/grafana/:/etc/grafana/provisioning/ + - ${PWD}/telemetry/grafana/:/var/lib/grafana/dashboards/ + - ${PWD}/telemetry/grafana/datasources/:/var/lib/grafana/datasources/ + - grafana-data:/var/lib/grafana + +volumes: + prometheus-data: + grafana-data: diff --git a/local_devnet/scripts/start_core0.sh b/local_devnet/scripts/start_core0.sh new file mode 100644 index 0000000000..1218ee1386 --- /dev/null +++ b/local_devnet/scripts/start_core0.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# This script starts core0 + +if [[ ! -f /opt/data/priv_validator_state.json ]] +then + mkdir /opt/data + cat < /opt/data/priv_validator_state.json +{ + "height": "0", + "round": 0, + "step": 0 +} +EOF +fi + +/bin/celestia-appd start \ + --moniker core0 \ + --rpc.laddr tcp://0.0.0.0:26657 \ + --home /opt diff --git a/local_devnet/scripts/start_node_and_create_validator.sh b/local_devnet/scripts/start_node_and_create_validator.sh new file mode 100644 index 0000000000..c9ac25f3bb --- /dev/null +++ b/local_devnet/scripts/start_node_and_create_validator.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +# This script starts a Celestia-app, creates a validator with the provided parameters, then +# keeps running it validating blocks. + +# check if environment variables are set +if [[ -z "${CELESTIA_HOME}" || -z "${MONIKER}" || -z "${AMOUNT}" ]] +then + echo "Environment not setup correctly. Please set: CELESTIA_HOME, MONIKER, AMOUNT variables" + exit 1 +fi + +# create necessary structure if doesn't exist +if [[ ! -f ${CELESTIA_HOME}/data/priv_validator_state.json ]] +then + mkdir "${CELESTIA_HOME}"/data + cat < ${CELESTIA_HOME}/data/priv_validator_state.json +{ + "height": "0", + "round": 0, + "step": 0 +} +EOF +fi + +{ + # wait for the node to get up and running + while true + do + status_code=$(curl --write-out '%{http_code}' --silent --output /dev/null localhost:26657/status) + if [[ "${status_code}" -eq 200 ]] ; then + break + fi + echo "Waiting for node to be up..." + sleep 2s + done + + VAL_ADDRESS=$(celestia-appd keys show "${MONIKER}" --keyring-backend test --bech=val --home /opt -a) + # keep retrying to create a validator + while true + do + # create validator + celestia-appd tx staking create-validator \ + --amount="${AMOUNT}" \ + --pubkey="$(celestia-appd tendermint show-validator --home "${CELESTIA_HOME}")" \ + --moniker="${MONIKER}" \ + --chain-id="local_devnet" \ + --commission-rate=0.1 \ + --commission-max-rate=0.2 \ + --commission-max-change-rate=0.01 \ + --min-self-delegation=1000000 \ + --from="${MONIKER}" \ + --keyring-backend=test \ + --home="${CELESTIA_HOME}" \ + --broadcast-mode=block \ + --fees="300000utia" \ + --yes + output=$(celestia-appd query staking validator "${VAL_ADDRESS}" 2>/dev/null) + if [[ -n "${output}" ]] ; then + break + fi + echo "trying to create validator..." + sleep 1s + done +} & + +# start node +celestia-appd start \ +--home="${CELESTIA_HOME}" \ +--moniker="${MONIKER}" \ +--p2p.persistent_peers=e3c592c0c2ad4b05cef3791456b0d6dd4da72ed2@core0:26656 \ +--rpc.laddr=tcp://0.0.0.0:26657 diff --git a/local_devnet/telemetry/grafana/datasources/config.yml b/local_devnet/telemetry/grafana/datasources/config.yml new file mode 100644 index 0000000000..b775f21695 --- /dev/null +++ b/local_devnet/telemetry/grafana/datasources/config.yml @@ -0,0 +1,8 @@ +--- +apiVersion: 1 + +datasources: + - name: Prometheus + type: prometheus + access: proxy + url: http://prometheus:9090 diff --git a/local_devnet/telemetry/otel-collector/config.yml b/local_devnet/telemetry/otel-collector/config.yml new file mode 100644 index 0000000000..c5851a1664 --- /dev/null +++ b/local_devnet/telemetry/otel-collector/config.yml @@ -0,0 +1,24 @@ +--- +extensions: + health_check: + +receivers: + otlp: + protocols: + grpc: + # endpoint: "0.0.0.0:4317" + http: + # endpoint: "0.0.0.0:4318" + +exporters: + prometheus: + endpoint: "otel-collector:8889" + send_timestamps: true + metric_expiration: 1800m + +service: + extensions: [health_check] + pipelines: + metrics: + receivers: [otlp] + exporters: [prometheus] diff --git a/local_devnet/telemetry/prometheus/prometheus.yml b/local_devnet/telemetry/prometheus/prometheus.yml new file mode 100644 index 0000000000..f9056818d7 --- /dev/null +++ b/local_devnet/telemetry/prometheus/prometheus.yml @@ -0,0 +1,36 @@ +--- +global: + scrape_interval: 15s + scrape_timeout: 10s + evaluation_interval: 15s + +scrape_configs: + - job_name: 'collector' + metrics_path: /metrics + honor_timestamps: true + scrape_interval: 15s + scrape_timeout: 10s + scheme: http + static_configs: + - targets: + - 'otel-collector:8889' + - job_name: 'core0' + static_configs: + - targets: ['core0:26660'] + labels: + group: 'Core0' + - job_name: 'core1' + static_configs: + - targets: ['core1:26660'] + labels: + group: 'Core1' + - job_name: 'core2' + static_configs: + - targets: ['core2:26660'] + labels: + group: 'Core2' + - job_name: 'core3' + static_configs: + - targets: ['core3:26660'] + labels: + group: 'Core3' diff --git a/specs/src/specs/state_machine_modules.md b/specs/src/specs/state_machine_modules.md index ae6551e131..1ac2d47b56 100644 --- a/specs/src/specs/state_machine_modules.md +++ b/specs/src/specs/state_machine_modules.md @@ -5,7 +5,6 @@ Celestia app is built using the cosmos-sdk, and follows standard cosmos-sdk modu ## `celestia-app` Specific Modules - [blob](https://github.com/celestiaorg/celestia-app/blob/main/x/blob/README.md) -- [blobstream](https://github.com/celestiaorg/celestia-app/blob/main/x/blobstream/README.md) - [minfee](https://github.com/celestiaorg/celestia-app/blob/main/x/minfee/README.md) - [mint](https://github.com/celestiaorg/celestia-app/blob/main/x/mint/README.md) - [paramfilter](https://github.com/celestiaorg/celestia-app/blob/main/x/paramfilter/README.md) diff --git a/test/interchain/go.mod b/test/interchain/go.mod index e9d7886505..fb556a487e 100644 --- a/test/interchain/go.mod +++ b/test/interchain/go.mod @@ -92,7 +92,7 @@ require ( github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.0 // indirect + github.com/hashicorp/go-getter v1.7.4 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect diff --git a/test/interchain/go.sum b/test/interchain/go.sum index a7032e09a5..513b17708f 100644 --- a/test/interchain/go.sum +++ b/test/interchain/go.sum @@ -567,8 +567,8 @@ github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIv github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.0 h1:bzrYP+qu/gMrL1au7/aDvkoOVGUJpeKBgbqRHACAFDY= -github.com/hashicorp/go-getter v1.7.0/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.4 h1:3yQjWuxICvSpYwqSayAdKRFcvBl1y/vogCxczWSmix0= +github.com/hashicorp/go-getter v1.7.4/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= diff --git a/test/testground/go.mod b/test/testground/go.mod index 7f7cc0acec..8e9c402df2 100644 --- a/test/testground/go.mod +++ b/test/testground/go.mod @@ -109,7 +109,7 @@ require ( github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-getter v1.7.0 // indirect + github.com/hashicorp/go-getter v1.7.4 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect diff --git a/test/testground/go.sum b/test/testground/go.sum index 72f0bfb63c..f4de2502e0 100644 --- a/test/testground/go.sum +++ b/test/testground/go.sum @@ -861,8 +861,8 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.0 h1:bzrYP+qu/gMrL1au7/aDvkoOVGUJpeKBgbqRHACAFDY= -github.com/hashicorp/go-getter v1.7.0/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.4 h1:3yQjWuxICvSpYwqSayAdKRFcvBl1y/vogCxczWSmix0= +github.com/hashicorp/go-getter v1.7.4/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= diff --git a/x/blobstream/README.md b/x/blobstream/README.md index 5042cc214e..0562745406 100644 --- a/x/blobstream/README.md +++ b/x/blobstream/README.md @@ -1,5 +1,8 @@ # `x/blobstream` +> [!NOTE] +> The `x/blobstream` module was enabled for app version 1 and disabled in app version >= 2. + ## Concepts This module contains the [Blobstream](https://blog.celestia.org/celestiums/) state machine implementation. @@ -226,6 +229,9 @@ If all the attestations in store are expired, which is an edge case that should ### Hooks +> [!NOTE] +> Hooks are no-ops for app versions >= 2. + #### Validator unbonding hook When a validator starts unbonding, a [hook](https://github.com/celestiaorg/celestia-app/blob/0629c757ef35a24187a8d7a4c706c7cdc894c8b6/x/qgb/keeper/hooks.go#L23-L34) is executed that [sets](https://github.com/celestiaorg/celestia-app/blob/0629c757ef35a24187a8d7a4c706c7cdc894c8b6/x/qgb/keeper/hooks.go#LL33C2-L33C2) the `LatestUnBondingBlockHeight` to the current block height. This allows creating a new valset that removes that validator from the valset members so that he doesn't need to sign attestations afterwards. diff --git a/x/blobstream/client/suite_test.go b/x/blobstream/client/suite_test.go index a4a7458188..78898ac3f7 100644 --- a/x/blobstream/client/suite_test.go +++ b/x/blobstream/client/suite_test.go @@ -3,6 +3,7 @@ package client_test import ( "testing" + "github.com/celestiaorg/celestia-app/v2/app" "github.com/celestiaorg/celestia-app/v2/test/util/testnode" "github.com/stretchr/testify/suite" tmrand "github.com/tendermint/tendermint/libs/rand" @@ -19,7 +20,7 @@ func (s *CLITestSuite) SetupSuite() { s.T().Skip("skipping Blobstream CLI tests in short mode.") } - cfg := testnode.DefaultConfig() + cfg := testnode.DefaultConfig().WithConsensusParams(app.DefaultInitialConsensusParams()) numAccounts := 120 accounts := make([]string, numAccounts) diff --git a/x/blobstream/integration_test.go b/x/blobstream/integration_test.go index d1f1dbc15d..d49e2728b7 100644 --- a/x/blobstream/integration_test.go +++ b/x/blobstream/integration_test.go @@ -39,7 +39,9 @@ func (s *BlobstreamIntegrationSuite) SetupSuite() { s.accounts = []string{"jimmy"} - cfg := testnode.DefaultConfig().WithFundedAccounts(s.accounts...) + cfg := testnode.DefaultConfig(). + WithFundedAccounts(s.accounts...). + WithConsensusParams(app.DefaultInitialConsensusParams()) cctx, _, _ := testnode.NewNetwork(t, cfg) s.ecfg = encoding.MakeConfig(app.ModuleEncodingRegisters...) s.cctx = cctx diff --git a/x/blobstream/keeper/hooks.go b/x/blobstream/keeper/hooks.go index 603b7171a4..38aaaa691c 100644 --- a/x/blobstream/keeper/hooks.go +++ b/x/blobstream/keeper/hooks.go @@ -22,16 +22,19 @@ func (k Keeper) Hooks() Hooks { } func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { - // When Validator starts Unbonding, Persist the block height in the store - // Later in endblocker, check if there is at least one validator who started + if ctx.BlockHeader().Version.App > 1 { + // no-op if the app version is greater than 1 because blobstream was disabled in v2. + return nil + } + // When Validator starts Unbonding, Persist the block height in the store. + // Later in EndBlocker, check if there is at least one validator who started // unbonding and create a valset request. The reason for creating valset - // requests in endblock is to create only one valset request per block, if - // multiple validators starts unbonding at same block. + // requests in EndBlock is to create only one valset request per block if + // multiple validators start unbonding in the same block. - // this hook IS called for jailing or unbonding triggered by users but it IS + // This hook is called for jailing or unbonding triggered by users but it is // NOT called for jailing triggered in the endblocker therefore we call the // keeper function ourselves there. - h.k.SetLatestUnBondingBlockHeight(ctx, uint64(ctx.BlockHeight())) return nil } @@ -41,6 +44,10 @@ func (h Hooks) BeforeDelegationCreated(_ sdk.Context, _ sdk.AccAddress, _ sdk.Va } func (h Hooks) AfterValidatorCreated(ctx sdk.Context, addr sdk.ValAddress) error { + if ctx.BlockHeader().Version.App > 1 { + // no-op if the app version is greater than 1 because blobstream was disabled in v2. + return nil + } defaultEvmAddr := types.DefaultEVMAddress(addr) // This should practically never happen that we have a collision. It may be // bad UX to reject the attempt to create a validator and require the user to diff --git a/x/blobstream/keeper/hooks_test.go b/x/blobstream/keeper/hooks_test.go new file mode 100644 index 0000000000..e8e769074d --- /dev/null +++ b/x/blobstream/keeper/hooks_test.go @@ -0,0 +1,58 @@ +package keeper_test + +import ( + "testing" + + "github.com/celestiaorg/celestia-app/v2/test/util" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + version "github.com/tendermint/tendermint/proto/tendermint/version" +) + +func TestAfterValidatorBeginUnbonding(t *testing.T) { + testEnv := util.CreateTestEnv(t) + height := int64(1) + + t.Run("should be a no-op if app version is 2", func(t *testing.T) { + ctx := testEnv.Context.WithBlockHeader(tmproto.Header{Version: version.Consensus{App: 2}, Height: height}) + err := testEnv.BlobstreamKeeper.Hooks().AfterValidatorBeginUnbonding(ctx, sdk.ConsAddress{}, sdk.ValAddress{}) + assert.NoError(t, err) + + got := testEnv.BlobstreamKeeper.GetLatestUnBondingBlockHeight(ctx) + assert.Equal(t, uint64(0), got) + }) + t.Run("should set latest unboding height if app version is 1", func(t *testing.T) { + ctx := testEnv.Context.WithBlockHeader(tmproto.Header{Version: version.Consensus{App: 1}, Height: height}) + err := testEnv.BlobstreamKeeper.Hooks().AfterValidatorBeginUnbonding(ctx, sdk.ConsAddress{}, sdk.ValAddress{}) + assert.NoError(t, err) + + got := testEnv.BlobstreamKeeper.GetLatestUnBondingBlockHeight(ctx) + assert.Equal(t, uint64(height), got) + }) +} + +func TestAfterValidatorCreated(t *testing.T) { + testEnv := util.CreateTestEnv(t) + height := int64(1) + valAddress := sdk.ValAddress([]byte("valAddress")) + t.Run("should be a no-op if app version is 2", func(t *testing.T) { + ctx := testEnv.Context.WithBlockHeader(tmproto.Header{Version: version.Consensus{App: 2}, Height: height}) + err := testEnv.BlobstreamKeeper.Hooks().AfterValidatorCreated(ctx, valAddress) + assert.NoError(t, err) + + address, ok := testEnv.BlobstreamKeeper.GetEVMAddress(ctx, valAddress) + assert.False(t, ok) + assert.Empty(t, address) + }) + t.Run("should set EVM address if app version is 1", func(t *testing.T) { + ctx := testEnv.Context.WithBlockHeader(tmproto.Header{Version: version.Consensus{App: 1}, Height: height}) + err := testEnv.BlobstreamKeeper.Hooks().AfterValidatorCreated(ctx, valAddress) + assert.NoError(t, err) + + address, ok := testEnv.BlobstreamKeeper.GetEVMAddress(ctx, valAddress) + assert.True(t, ok) + assert.Equal(t, common.HexToAddress("0x0000000000000000000076616C41646472657373"), address) + }) +} diff --git a/x/blobstream/module.go b/x/blobstream/module.go index cfd7f195a7..a6669ec2f2 100644 --- a/x/blobstream/module.go +++ b/x/blobstream/module.go @@ -5,8 +5,6 @@ import ( "encoding/json" "fmt" - bscmd "github.com/celestiaorg/celestia-app/v2/x/blobstream/client" - "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" @@ -79,14 +77,16 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *r } } -// GetTxCmd returns the capability module's root tx command. +// GetTxCmd returns no command because the blobstream module was disabled in app +// version 2. func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return bscmd.GetTxCmd() + return nil } -// GetQueryCmd returns the capability module's root query command. +// GetQueryCmd returns no command because the blobstream module was disabled in +// app version 2. func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return bscmd.GetQueryCmd() + return nil } // ----------------------------------------------------------------------------