From 0f5b1681279ad3aa6782b698e7de1a08fe39a01d Mon Sep 17 00:00:00 2001 From: Naga Tulasi Gandham <40757909+NagaTulasi@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:05:06 +0530 Subject: [PATCH] fix: update module structure (#56) * update structure * feat: make proto gen * fix imports * update proto imports * fix: proto * update cli tests * add sims tests * fix: lint * fix: simulation tests * update sims workflow * fix: sims workflow * fix: sim tests * fix: sim tests * fix: sim tests * fix: build * WIP * fix specs path * add new line in makefile * fix: add working sims tests * fix lint * fix lint * update runism in workflow * add go bin path * remove notify failure & success * fix runsim issue * WIP * WIP * WIP * WIP * WIP * WIP * WIP * add non determinism workflow test * remove comments --------- Co-authored-by: saiteja --- .github/workflows/sims.yml | 111 +++++ Makefile | 90 +++- README.md | 8 +- chainclient/broadcast_tx.go | 2 +- chainclient/create_client.go | 2 - client/cli/cli_test.go | 128 ------ go.mod | 2 +- network/network.go | 46 +- proto/{sdk/avail => cada}/v1beta1/abci.proto | 4 +- .../{sdk/avail => cada}/v1beta1/genesis.proto | 4 +- proto/{sdk/avail => cada}/v1beta1/query.proto | 6 +- proto/{sdk/avail => cada}/v1beta1/tx.proto | 4 +- .../v1beta1/vote_extensions.proto | 6 +- relayer/publish.go | 2 +- relayer/relayer.go | 2 +- relayer/submit_data_test.go | 2 +- simapp/Makefile | 2 +- simapp/app/app.go | 10 +- simapp/app/sim_bench_test.go | 150 +++++++ simapp/app/sim_test.go | 408 ++++++++++++++++++ simapp/app/test_helpers.go | 2 +- simapp/cmd/cada/commads.go | 4 +- tools/Makefile | 69 +++ x/cada/client/cli/cli_test.go | 133 ++++++ {client => x/cada/client}/cli/keys.go | 2 +- {client => x/cada/client}/cli/query.go | 2 +- {client => x/cada/client}/cli/tx.go | 4 +- .../cada/integration_docs}/README.md | 0 .../cada/integration_docs}/config.md | 0 .../cada/integration_docs}/integration.md | 0 .../cada/integration_docs}/spawn.md | 0 {keeper => x/cada/keeper}/abci.go | 4 + {keeper => x/cada/keeper}/abci_test.go | 2 +- {keeper => x/cada/keeper}/blob_status.go | 0 {keeper => x/cada/keeper}/genesis.go | 2 +- {keeper => x/cada/keeper}/keeper.go | 6 +- {keeper => x/cada/keeper}/keeper_test.go | 6 +- {keeper => x/cada/keeper}/msg_server.go | 2 +- {keeper => x/cada/keeper}/msg_server_test.go | 4 +- {keeper => x/cada/keeper}/query_server.go | 2 +- .../cada/keeper}/query_server_test.go | 4 +- {keeper => x/cada/keeper}/status_test.go | 2 +- {keeper => x/cada/keeper}/store.go | 2 +- {keeper => x/cada/keeper}/store_test.go | 2 +- {keeper => x/cada/keeper}/vote_extension.go | 0 .../cada/keeper}/vote_extension_test.go | 2 +- {module => x/cada/module}/autocli.go | 0 {module => x/cada/module}/depinject.go | 0 {module => x/cada/module}/module.go | 40 +- x/cada/simulation/genesis.go | 16 + x/cada/simulation/operation.go | 106 +++++ {specs => x/cada/specs}/01_concepts.md | 0 {specs => x/cada/specs}/02_state.md | 0 {specs => x/cada/specs}/03_msg.md | 0 {specs => x/cada/specs}/04_client.md | 1 + .../cada/specs}/05_prepare_proposal.md | 0 {specs => x/cada/specs}/06_preblocker.md | 0 {specs => x/cada/specs}/07_vote_extension.md | 1 + {specs => x/cada/specs}/README.md | 0 {types => x/cada/types}/abci.pb.go | 62 +-- {types => x/cada/types}/avail_config.go | 0 {types => x/cada/types}/codec.go | 0 {types => x/cada/types}/genesis.go | 0 {types => x/cada/types}/genesis.pb.go | 32 +- {types => x/cada/types}/keys.go | 0 x/cada/types/msg.go | 18 + {types => x/cada/types}/query.pb.go | 76 ++-- {types => x/cada/types}/query.pb.gw.go | 2 +- {types => x/cada/types}/tx.pb.go | 88 ++-- {types => x/cada/types}/validator.pb.go | 0 {types => x/cada/types}/vote_extensions.pb.go | 40 +- 71 files changed, 1367 insertions(+), 360 deletions(-) create mode 100644 .github/workflows/sims.yml delete mode 100644 client/cli/cli_test.go rename proto/{sdk/avail => cada}/v1beta1/abci.proto (87%) rename proto/{sdk/avail => cada}/v1beta1/genesis.proto (54%) rename proto/{sdk/avail => cada}/v1beta1/query.proto (91%) rename proto/{sdk/avail => cada}/v1beta1/tx.proto (95%) rename proto/{sdk/avail => cada}/v1beta1/vote_extensions.proto (74%) create mode 100644 simapp/app/sim_bench_test.go create mode 100644 simapp/app/sim_test.go create mode 100644 tools/Makefile create mode 100644 x/cada/client/cli/cli_test.go rename {client => x/cada/client}/cli/keys.go (91%) rename {client => x/cada/client}/cli/query.go (95%) rename {client => x/cada/client}/cli/tx.go (95%) rename {integration_docs => x/cada/integration_docs}/README.md (100%) rename {integration_docs => x/cada/integration_docs}/config.md (100%) rename {integration_docs => x/cada/integration_docs}/integration.md (100%) rename {integration_docs => x/cada/integration_docs}/spawn.md (100%) rename {keeper => x/cada/keeper}/abci.go (99%) rename {keeper => x/cada/keeper}/abci_test.go (98%) rename {keeper => x/cada/keeper}/blob_status.go (100%) rename {keeper => x/cada/keeper}/genesis.go (88%) rename {keeper => x/cada/keeper}/keeper.go (92%) rename {keeper => x/cada/keeper}/keeper_test.go (95%) rename {keeper => x/cada/keeper}/msg_server.go (97%) rename {keeper => x/cada/keeper}/msg_server_test.go (93%) rename {keeper => x/cada/keeper}/query_server.go (96%) rename {keeper => x/cada/keeper}/query_server_test.go (85%) rename {keeper => x/cada/keeper}/status_test.go (96%) rename {keeper => x/cada/keeper}/store.go (99%) rename {keeper => x/cada/keeper}/store_test.go (97%) rename {keeper => x/cada/keeper}/vote_extension.go (100%) rename {keeper => x/cada/keeper}/vote_extension_test.go (96%) rename {module => x/cada/module}/autocli.go (100%) rename {module => x/cada/module}/depinject.go (100%) rename {module => x/cada/module}/module.go (79%) create mode 100644 x/cada/simulation/genesis.go create mode 100644 x/cada/simulation/operation.go rename {specs => x/cada/specs}/01_concepts.md (100%) rename {specs => x/cada/specs}/02_state.md (100%) rename {specs => x/cada/specs}/03_msg.md (100%) rename {specs => x/cada/specs}/04_client.md (99%) rename {specs => x/cada/specs}/05_prepare_proposal.md (100%) rename {specs => x/cada/specs}/06_preblocker.md (100%) rename {specs => x/cada/specs}/07_vote_extension.md (99%) rename {specs => x/cada/specs}/README.md (100%) rename {types => x/cada/types}/abci.pb.go (87%) rename {types => x/cada/types}/avail_config.go (100%) rename {types => x/cada/types}/codec.go (100%) rename {types => x/cada/types}/genesis.go (100%) rename {types => x/cada/types}/genesis.pb.go (81%) rename {types => x/cada/types}/keys.go (100%) create mode 100644 x/cada/types/msg.go rename {types => x/cada/types}/query.pb.go (85%) rename {types => x/cada/types}/query.pb.gw.go (99%) rename {types => x/cada/types}/tx.pb.go (85%) rename {types => x/cada/types}/validator.pb.go (100%) rename {types => x/cada/types}/vote_extensions.pb.go (83%) diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml new file mode 100644 index 0000000..32266e2 --- /dev/null +++ b/.github/workflows/sims.yml @@ -0,0 +1,111 @@ +name: Sims +# Sims workflow runs multiple types of simulations (nondeterminism, import-export, after-import, multi-seed-short) +# This workflow will run on all Pull Requests, if a .go, .mod or .sum file have been changed +on: + pull_request: + push: + branches: + - main + +concurrency: + group: ci-${{ github.ref }}-sims + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'skip-sims')" + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + check-latest: true + - run: make -C simapp build + + install-runsim: + permissions: + contents: none + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + check-latest: true + - name: Install runsim + run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0 + - uses: actions/cache@v4 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + + test-sim-nondeterminism: + runs-on: ubuntu-latest + needs: [build] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + check-latest: true + - uses: actions/cache@v4 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + - name: test-sim-import-export + run: | + make test-sim-nondeterminism + + test-sim-import-export: + runs-on: ubuntu-latest + needs: [build, install-runsim] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + check-latest: true + - uses: actions/cache@v4 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + - name: test-sim-import-export + run: | + make test-sim-import-export + + test-sim-after-import: + runs-on: ubuntu-latest + needs: [build, install-runsim] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + check-latest: true + - uses: actions/cache@v4 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + - name: test-sim-after-import + run: | + make test-sim-after-import + + test-sim-multi-seed-short: + runs-on: ubuntu-latest + needs: [build, install-runsim] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + check-latest: true + - uses: actions/cache@v4 + with: + path: ~/go/bin + key: ${{ runner.os }}-go-runsim-binary + - name: test-sim-multi-seed-short + run: | + make test-sim-multi-seed-short diff --git a/Makefile b/Makefile index 82780b1..5215357 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ DOCKER := $(shell which docker) export GO111MODULE = on +SIMAPP = ./simapp/app/ +BINDIR ?= $(GOPATH)/bin ############################################################################### ### e2e ### @@ -75,6 +77,7 @@ lint-fix: GO := go TARGET := cada BINDIR ?= $(GOPATH)/bin +CURRENT_DIR = $(shell pwd) .PHONY: all build install clean @@ -92,7 +95,6 @@ clean: rm -f $(TARGET) - ############################################################################### ### testnet ### ############################################################################### @@ -109,12 +111,21 @@ set-testnet-configs: ### Tests & Simulation ### ############################################################################### +# make init-simapp initializes a single local node network +# it is useful for testing and development +# Usage: make install && make init-simapp && simd start +# Warning: make init-simapp will remove all data in simapp home directory +init-simapp: + ./simapp/init-chain.sh + test: test-unit test-all: test-unit test-ledger-mock test-race test-cover TEST_PACKAGES=./... TEST_TARGETS := test-unit test-unit-proto test-ledger-mock test-race test-ledger test-race +include tools/Makefile + # Test runs-specific rules. To add a new test target, just add # a new rule, customise ARGS or TEST_PACKAGES ad libitum, and # append the new rule to the TEST_TARGETS list. @@ -140,3 +151,80 @@ else endif .PHONY: run-tests test test-all $(TEST_TARGETS) + +test-sim-nondeterminism: + @echo "Running non-determinism test..." + @cd ${CURRENT_DIR}/simapp/app && go test -mod=readonly -run TestAppStateDeterminism -Enabled=true \ + -NumBlocks=20 -BlockSize=200 -Commit=true -Period=0 -v -timeout 24h + +test-sim-custom-genesis-fast: + @echo "Running custom genesis simulation..." + @echo "By default, ${HOME}/.cada/config/genesis.json will be used." + @cd ${CURRENT_DIR}/simapp/app && go test -mod=readonly -run TestFullAppSimulation -Genesis=${HOME}/.cada/config/genesis.json \ + -Enabled=true -NumBlocks=100 -BlockSize=200 -Commit=true -Seed=99 -Period=5 -v -timeout 24h + +test-sim-import-export: runsim + @echo "Running application import/export simulation. This may take several minutes..." + @cd ${CURRENT_DIR}/simapp/app && $(BINDIR)/runsim -Jobs=4 -SimAppPkg=. -ExitOnFail 50 5 TestAppImportExport + +test-sim-after-import: runsim + @echo "Running application simulation-after-import. This may take several minutes..." + @cd ${CURRENT_DIR}/simapp/app && $(BINDIR)/runsim -Jobs=4 -SimAppPkg=. -ExitOnFail 50 5 TestAppSimulationAfterImport + +test-sim-custom-genesis-multi-seed: runsim + @echo "Running multi-seed custom genesis simulation..." + @echo "By default, ${HOME}/.cada/config/genesis.json will be used." + @cd ${CURRENT_DIR}/simapp/app && $(BINDIR)/runsim -Genesis=${HOME}/.cada/config/genesis.json -SimAppPkg=. -ExitOnFail 400 5 TestFullAppSimulation + +test-sim-multi-seed-long: runsim + @echo "Running long multi-seed application simulation. This may take awhile!" + @cd ${CURRENT_DIR}/simapp/app && $(BINDIR)/runsim -Jobs=4 -SimAppPkg=. -ExitOnFail 500 50 TestFullAppSimulation + +test-sim-multi-seed-short: runsim + @echo "Running short multi-seed application simulation. This may take awhile!" + @cd ${CURRENT_DIR}/simapp/app && $(BINDIR)/runsim -Jobs=4 -SimAppPkg=. -ExitOnFail 50 10 TestFullAppSimulation + +test-sim-benchmark-invariants: + @echo "Running simulation invariant benchmarks..." + cd ${CURRENT_DIR}/simapp/app && @go test -mod=readonly -benchmem -bench=BenchmarkInvariants -run=^$ \ + -Enabled=true -NumBlocks=1000 -BlockSize=200 \ + -Period=1 -Commit=true -Seed=57 -v -timeout 24h + +.PHONY: \ +test-sim-nondeterminism \ +test-sim-custom-genesis-fast \ +test-sim-import-export \ +test-sim-after-import \ +test-sim-custom-genesis-multi-seed \ +test-sim-multi-seed-short \ +test-sim-multi-seed-long \ +test-sim-benchmark-invariants + +SIM_NUM_BLOCKS ?= 500 +SIM_BLOCK_SIZE ?= 200 +SIM_COMMIT ?= true + +test-sim-benchmark: + @echo "Running application benchmark for numBlocks=$(SIM_NUM_BLOCKS), blockSize=$(SIM_BLOCK_SIZE). This may take awhile!" + @go test -mod=readonly -benchmem -run=^$$ $(APP) -bench ^BenchmarkFullAppSimulation$$ \ + -Enabled=true -NumBlocks=$(SIM_NUM_BLOCKS) -BlockSize=$(SIM_BLOCK_SIZE) -Commit=$(SIM_COMMIT) -timeout 24h + +test-sim-profile: + @echo "Running application benchmark for numBlocks=$(SIM_NUM_BLOCKS), blockSize=$(SIM_BLOCK_SIZE). This may take awhile!" + @go test -mod=readonly -benchmem -run=^$$ $(APP) -bench ^BenchmarkFullAppSimulation$$ \ + -Enabled=true -NumBlocks=$(SIM_NUM_BLOCKS) -BlockSize=$(SIM_BLOCK_SIZE) -Commit=$(SIM_COMMIT) -timeout 24h -cpuprofile cpu.out -memprofile mem.out + +.PHONY: test-sim-profile test-sim-benchmark + +test-cover: + @export VERSION=$(VERSION); bash -x scripts/test_cover.sh +.PHONY: test-cover + +test-rosetta: + docker build -t rosetta-ci:latest -f contrib/rosetta/node/Dockerfile . + docker-compose -f contrib/rosetta/docker-compose.yaml up --abort-on-container-exit --exit-code-from test_rosetta --build +.PHONY: test-rosetta + +benchmark: + @go test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION) +.PHONY: benchmark diff --git a/README.md b/README.md index d40ae6a..31f770d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ CADA is a module designed to connect Cosmos sovereign chains with the Avail netw # Integration Guide -To integrate the CADA module into your application, follow the steps outlined in the [integration guide](./integration_docs/README.md) +To integrate the CADA module into your application, follow the steps outlined in the [integration guide](./x/cada/integration_docs/README.md) Note: Ensure that the Avail light client URL is correctly configured for the module to function as expected. For instructions on setup Avail locally, please refer to [this documentation](https://github.com/rollkit/avail-da?tab=readme-ov-file#avail-da). @@ -31,6 +31,7 @@ These are main components in the workflow: The core functionality of the **CADA** module is integrated with and operates on the Cosmos blockchain. In the CADA module: + - At each block interval, the `PreBlocker` ABCI method sends a request to the `Relayer`, specifying the range of block heights that are ready to be posted to the **Avail** Data Availability (DA) network. ![Data Submission](https://github.com/user-attachments/assets/fc4d23cc-f6bd-4210-8407-47a57adcc290) @@ -40,6 +41,7 @@ In the CADA module: ![Vote Extension](https://github.com/user-attachments/assets/ea5b10ab-fb64-4ed0-8761-44675a852a01) ## 2. Relayer + The **Relayer** facilitates communication between the Cosmos Chain, the Avail light client, and the Cosmos Provider. - **Data Submission**: The relayer is responsible for fetching block data from the Cosmos provider and posting it to the Avail light client via an HTTP request. @@ -48,8 +50,8 @@ The **Relayer** facilitates communication between the Cosmos Chain, the Avail li - **Data Verification**: During verification, the relayer communicates with the Avail light client to confirm whether the data is truly available at the specified height. - ## 3. Avail Light Node + The **Avail Light Client** allows interaction with the Avail DA network without requiring a full node, and without having to trust remote peers. It leverages **Data Availability Sampling (DAS)**, which the light client performs on every newly created block. - The chain communicates with the Avail light client via the relayer during the data submission and data availability verification processes. @@ -57,12 +59,12 @@ The **Avail Light Client** allows interaction with the Avail DA network without Find more details about the Avail Light Client [here](https://docs.availproject.org/docs/operate-a-node/run-a-light-client/Overview). ## 4. Cosmos Provider + The **Cosmos Provider** is responsible for fetching block data via RPC so that the data can be posted to Avail for availability checks. # Workflow - - At each block interval, a request is sent from the `PreBlocker` ABCI method to the Keeper, specifying the range of block heights that are ready to be posted to the `Avail` DA network. - The range of block heights should be from `provenHeight + 1` to `min(provenHeight + MaxBlocksLimitForBlob, CurrentBlockHeight)`. diff --git a/chainclient/broadcast_tx.go b/chainclient/broadcast_tx.go index 5e19ae7..052be22 100644 --- a/chainclient/broadcast_tx.go +++ b/chainclient/broadcast_tx.go @@ -12,7 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/vitwit/avail-da-module/types" + "github.com/vitwit/avail-da-module/x/cada/types" ) // GetBinPath returns the path to the cada home directory within the user's home directory. diff --git a/chainclient/create_client.go b/chainclient/create_client.go index bc511e2..78ef0ec 100644 --- a/chainclient/create_client.go +++ b/chainclient/create_client.go @@ -23,8 +23,6 @@ const ( defaultGasLimit = 300000 ) -// var availdHomePath = xfilepath.JoinFromHome(xfilepath.Path("availsdk")) - func NewClientCtx(kr keyring.Keyring, c *cometrpc.HTTP, chainID string, cdc codec.BinaryCodec, homepath string, fromAddress sdk.AccAddress, ) client.Context { diff --git a/client/cli/cli_test.go b/client/cli/cli_test.go deleted file mode 100644 index 7d973d0..0000000 --- a/client/cli/cli_test.go +++ /dev/null @@ -1,128 +0,0 @@ -package cli_test - -// import ( -// "fmt" -// "testing" - -// "github.com/cosmos/cosmos-sdk/client/flags" -// "github.com/cosmos/cosmos-sdk/crypto/hd" -// sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/stretchr/testify/suite" -// "github.com/vitwit/avail-da-module/client/cli" -// network "github.com/vitwit/avail-da-module/network" - -// app "simapp/app" - -// clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" -// ) - -// func TestIntegrationTestSuite(t *testing.T) { -// suite.Run(t, new(IntegrationTestSuite)) -// } - -// type IntegrationTestSuite struct { -// suite.Suite - -// cfg network.Config -// network *network.Network -// addresses []string -// } - -// const aliceMnemonic = "all soap kiwi cushion federal skirt tip shock exist tragic verify lunar shine rely torch please view future lizard garbage humble medal leisure mimic" - -// func (s *IntegrationTestSuite) SetupSuite() { -// s.T().Log("setting up integration test suite") - -// var err error - -// // Setup network config -// cfg := network.DefaultConfig(app.NewTestNetworkFixture) -// cfg.NumValidators = 1 -// s.cfg = cfg - -// // Initialize the network -// s.network, err = network.New(s.T(), s.T().TempDir(), cfg) -// s.Require().NoError(err) - -// kb := s.network.Validators[0].ClientCtx.Keyring -// path := sdk.GetConfig().GetFullBIP44Path() -// info, err := kb.NewAccount("alice", aliceMnemonic, "", path, hd.Secp256k1) -// s.Require().NoError(err) - -// add, err := info.GetAddress() -// s.Require().NoError(err) -// s.addresses = append(s.addresses, add.String()) - -// _, err = s.network.WaitForHeight(1) -// s.Require().NoError(err) -// } - -// func (s *IntegrationTestSuite) TearDownSuite() { -// s.T().Log("tearing down integration suite") -// s.network.Cleanup() -// } - -// func (s *IntegrationTestSuite) TestNewUpdateBlobStatusCmd() { -// val := s.network.Validators[0] - -// testCases := []struct { -// name string -// args []string -// expectErr bool -// }{ -// { -// "update blob status - success", -// []string{ -// "1", -// "10", -// "success", -// "120", -// fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addresses[0]), -// fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), -// fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), -// }, -// false, -// }, -// { -// "update blob status - failure", -// []string{ -// "1", -// "10", -// "failure", -// "120", -// fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addresses[0]), -// fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), -// fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), -// }, -// false, -// }, -// { -// "update blob status - invalid status", -// []string{ -// "1", -// "10", -// "invalid", -// "120", -// fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addresses[0]), -// fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), -// fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), -// }, -// false, -// }, -// } - -// for _, tc := range testCases { -// s.Run(tc.name, func() { -// cmd := cli.NewUpdateBlobStatusCmd() -// res, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, tc.args) -// if tc.expectErr { -// if err != nil { -// s.Require().Error(err) -// } -// } - -// s.Require().NoError(nil) -// s.Require().NotNil(res) -// }) -// } -// } diff --git a/go.mod b/go.mod index 833ffee..db56e7a 100644 --- a/go.mod +++ b/go.mod @@ -171,7 +171,7 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v3 v3.0.1 + gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect nhooyr.io/websocket v1.8.10 // indirect pgregory.net/rapid v1.1.0 // indirect diff --git a/network/network.go b/network/network.go index 0f08bc7..36a5344 100644 --- a/network/network.go +++ b/network/network.go @@ -105,28 +105,30 @@ type Config struct { LegacyAmino *codec.LegacyAmino // TODO: Remove! InterfaceRegistry codectypes.InterfaceRegistry - TxConfig client.TxConfig - AccountRetriever client.AccountRetriever - AppConstructor AppConstructor // the ABCI application constructor - GenesisState map[string]json.RawMessage // custom genesis state to provide - TimeoutCommit time.Duration // the consensus commitment timeout - ChainID string // the network chain-id - NumValidators int // the total number of validators to create and bond - Mnemonics []string // custom user-provided validator operator mnemonics - BondDenom string // the staking bond denomination - MinGasPrices string // the minimum gas prices each validator will accept - AccountTokens sdkmath.Int // the amount of unique validator tokens (e.g. 1000node0) - StakingTokens sdkmath.Int // the amount of tokens each validator has available to stake - BondedTokens sdkmath.Int // the amount of tokens each validator stakes - PruningStrategy string // the pruning strategy each validator will have - EnableLogging bool // enable logging to STDOUT - CleanupDir bool // remove base temporary directory during cleanup - SigningAlgo string // signing algorithm for keys - KeyringOptions []keyring.Option // keyring configuration options - RPCAddress string // RPC listen address (including port) - APIAddress string // REST API listen address (including port) - GRPCAddress string // GRPC server listen address (including port) - PrintMnemonic bool // print the mnemonic of first validator as log output for testing + TxConfig client.TxConfig + AccountRetriever client.AccountRetriever + AppConstructor AppConstructor // the ABCI application constructor + GenesisState map[string]json.RawMessage // custom genesis state to provide + TimeoutCommit time.Duration // the consensus commitment timeout + ChainID string // the network chain-id + NumValidators int // the total number of validators to create and bond + Mnemonics []string // custom user-provided validator operator mnemonics + BondDenom string // the staking bond denomination + MinGasPrices string // the minimum gas prices each validator will accept + AccountTokens sdkmath.Int // the amount of unique validator tokens (e.g. 1000node0) + StakingTokens sdkmath.Int // the amount of tokens each validator has available to stake + BondedTokens sdkmath.Int // the amount of tokens each validator stakes + PruningStrategy string // the pruning strategy each validator will have + EnableLogging bool // enable logging to STDOUT + CleanupDir bool // remove base temporary directory during cleanup + SigningAlgo string // signing algorithm for keys + KeyringOptions []keyring.Option // keyring configuration options + RPCAddress string // RPC listen address (including port) + APIAddress string // REST API listen address (including port) + GRPCAddress string // GRPC server listen address (including port) + PrintMnemonic bool // print the mnemonic of first validator as log output for testing + LightClientURL string + PublishBlobInterval string } // DefaultConfig returns a sane default configuration suitable for nearly all diff --git a/proto/sdk/avail/v1beta1/abci.proto b/proto/cada/v1beta1/abci.proto similarity index 87% rename from proto/sdk/avail/v1beta1/abci.proto rename to proto/cada/v1beta1/abci.proto index 78de09a..38c62af 100644 --- a/proto/sdk/avail/v1beta1/abci.proto +++ b/proto/cada/v1beta1/abci.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package sdk.avail.v1beta1; +package cada.v1beta1; import "gogoproto/gogo.proto"; -option go_package = "github.com/vitwit/avail-da-module/types"; +option go_package = "github.com/vitwit/avail-da-module/x/cada/types"; // InjectedData represents a message containing data that has been injected. message InjectedData { diff --git a/proto/sdk/avail/v1beta1/genesis.proto b/proto/cada/v1beta1/genesis.proto similarity index 54% rename from proto/sdk/avail/v1beta1/genesis.proto rename to proto/cada/v1beta1/genesis.proto index 3d9ca4c..2db98b0 100644 --- a/proto/sdk/avail/v1beta1/genesis.proto +++ b/proto/cada/v1beta1/genesis.proto @@ -1,7 +1,7 @@ syntax = "proto3"; -package sdk.avail.v1beta1; +package cada.v1beta1; -option go_package = "github.com/vitwit/avail-da-module/types"; +option go_package = "github.com/vitwit/avail-da-module/x/cada/types"; // GenesisState defines the avail da module's genesis state. message GenesisState { diff --git a/proto/sdk/avail/v1beta1/query.proto b/proto/cada/v1beta1/query.proto similarity index 91% rename from proto/sdk/avail/v1beta1/query.proto rename to proto/cada/v1beta1/query.proto index e15d5f0..304685c 100644 --- a/proto/sdk/avail/v1beta1/query.proto +++ b/proto/cada/v1beta1/query.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package sdk.avail.v1beta1; +package cada.v1beta1; import "google/api/annotations.proto"; -import "sdk/avail/v1beta1/tx.proto"; +import "cada/v1beta1/tx.proto"; -option go_package = "github.com/vitwit/avail-da-module/types"; +option go_package = "github.com/vitwit/avail-da-module/x/cada/types"; // QuerySubmitBlobStatusRequest is the request type for the SubmitBlobStatus RPC method. message QuerySubmittedBlobStatusRequest { diff --git a/proto/sdk/avail/v1beta1/tx.proto b/proto/cada/v1beta1/tx.proto similarity index 95% rename from proto/sdk/avail/v1beta1/tx.proto rename to proto/cada/v1beta1/tx.proto index 8b56279..70a5dde 100644 --- a/proto/sdk/avail/v1beta1/tx.proto +++ b/proto/cada/v1beta1/tx.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package sdk.avail.v1beta1; +package cada.v1beta1; import "cosmos/msg/v1/msg.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/vitwit/avail-da-module/types"; +option go_package = "github.com/vitwit/avail-da-module/x/cada/types"; // Msg defines the Msg service for cada module service Msg { diff --git a/proto/sdk/avail/v1beta1/vote_extensions.proto b/proto/cada/v1beta1/vote_extensions.proto similarity index 74% rename from proto/sdk/avail/v1beta1/vote_extensions.proto rename to proto/cada/v1beta1/vote_extensions.proto index 958c0be..e6db06a 100644 --- a/proto/sdk/avail/v1beta1/vote_extensions.proto +++ b/proto/cada/v1beta1/vote_extensions.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package sdk.avail.v1beta1; +package cada.v1beta1; -import "sdk/avail/v1beta1/tx.proto"; +import "cada/v1beta1/tx.proto"; -option go_package = "github.com/vitwit/avail-da-module/types"; +option go_package = "github.com/vitwit/avail-da-module/x/cada/types"; // AvailVoteExtension defines the info which includes in vote extensions message AvailVoteExtension { diff --git a/relayer/publish.go b/relayer/publish.go index 8402612..6f66ea4 100644 --- a/relayer/publish.go +++ b/relayer/publish.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" dacli "github.com/vitwit/avail-da-module/chainclient" - "github.com/vitwit/avail-da-module/types" + "github.com/vitwit/avail-da-module/x/cada/types" ) // PostBlocks is called in the PreBlocker. The proposer will publish the blocks at this point diff --git a/relayer/relayer.go b/relayer/relayer.go index 72e3021..259057e 100644 --- a/relayer/relayer.go +++ b/relayer/relayer.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/vitwit/avail-da-module/relayer/avail" "github.com/vitwit/avail-da-module/relayer/local" - "github.com/vitwit/avail-da-module/types" + "github.com/vitwit/avail-da-module/x/cada/types" ) // Relayer is responsible for posting new blocks to Avail diff --git a/relayer/submit_data_test.go b/relayer/submit_data_test.go index 6c1c5d3..14bf3f0 100644 --- a/relayer/submit_data_test.go +++ b/relayer/submit_data_test.go @@ -8,7 +8,7 @@ import ( relayer "github.com/vitwit/avail-da-module/relayer" "github.com/vitwit/avail-da-module/relayer/avail" mocks "github.com/vitwit/avail-da-module/relayer/avail/mocks" - cadatypes "github.com/vitwit/avail-da-module/types" + cadatypes "github.com/vitwit/avail-da-module/x/cada/types" ) func TestSubmitDataToAvailClient(t *testing.T) { diff --git a/simapp/Makefile b/simapp/Makefile index bec3ba0..a2636f8 100644 --- a/simapp/Makefile +++ b/simapp/Makefile @@ -10,7 +10,7 @@ SIMAPP = ./app # for dockerized protobuf tools DOCKER := $(shell which docker) -HTTPS_GIT := github.com/rollchains/rollchain.git +HTTPS_GIT := github.com/vitwit/cada.git export GO111MODULE = on diff --git a/simapp/app/app.go b/simapp/app/app.go index 5801f7b..6d9f4e4 100644 --- a/simapp/app/app.go +++ b/simapp/app/app.go @@ -137,12 +137,12 @@ import ( packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/keeper" packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/types" - cadakeeper "github.com/vitwit/avail-da-module/keeper" - cadamodule "github.com/vitwit/avail-da-module/module" cadarelayer "github.com/vitwit/avail-da-module/relayer" "github.com/vitwit/avail-da-module/relayer/avail" httpclient "github.com/vitwit/avail-da-module/relayer/http" - cadatypes "github.com/vitwit/avail-da-module/types" + cadakeeper "github.com/vitwit/avail-da-module/x/cada/keeper" + cadamodule "github.com/vitwit/avail-da-module/x/cada/module" + cadatypes "github.com/vitwit/avail-da-module/x/cada/types" ) const ( @@ -771,7 +771,7 @@ func NewChainApp( ibctm.NewAppModule(), crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // custom - cadamodule.NewAppModule(appCodec, app.CadaKeeper), + cadamodule.NewAppModule(appCodec, app.CadaKeeper, app.AccountKeeper, app.BankKeeper), packetforward.NewAppModule(app.PacketForwardKeeper, app.GetSubspace(packetforwardtypes.ModuleName)), ) @@ -893,7 +893,7 @@ func NewChainApp( // NOTE: this is not required apps that don't use the simulator for fuzz testing // transactions overrideModules := map[string]module.AppModuleSimulation{ - authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)), + authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, nil), } app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, overrideModules) diff --git a/simapp/app/sim_bench_test.go b/simapp/app/sim_bench_test.go new file mode 100644 index 0000000..66033db --- /dev/null +++ b/simapp/app/sim_bench_test.go @@ -0,0 +1,150 @@ +package app + +import ( + "fmt" + "os" + "testing" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/server" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" +) + +// Profile with: +// /usr/local/go/bin/go test -benchmem -run=^$ cosmossdk.io/simapp -bench ^BenchmarkFullAppSimulation$ -Commit=true -cpuprofile cpu.out +func BenchmarkFullAppSimulation(b *testing.B) { + b.ReportAllocs() + config := simcli.NewConfigFromFlags() + config.ChainID = AppChainID + + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "goleveldb-app-sim", "Simulation", + simcli.FlagVerboseValue, simcli.FlagEnabledValue) + if err != nil { + b.Fatalf("simulation setup failed: %s", err.Error()) + } + + if skip { + b.Skip("skipping benchmark application simulation") + } + + defer func() { + db.Close() + err = os.RemoveAll(dir) + if err != nil { + b.Fatal(err) + } + }() + + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[flags.FlagHome] = DefaultNodeHome + appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + + app := NewChainApp(logger, db, nil, true, appOptions, interBlockCacheOpt(), baseapp.SetChainID(AppChainID)) + + // run randomized simulation + _, simParams, simErr := simulation.SimulateFromSeed( + b, + os.Stdout, + app.BaseApp, + simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), app.DefaultGenesis()), + simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 + simtestutil.SimulationOperations(app, app.AppCodec(), config), + BlockedAddresses(), + config, + app.AppCodec(), + ) + + // export state and simParams before the simulation error is checked + if err = simtestutil.CheckExportSimulation(app, config, simParams); err != nil { + b.Fatal(err) + } + + if simErr != nil { + b.Fatal(simErr) + } + + if config.Commit { + simtestutil.PrintStats(db) + } +} + +func BenchmarkInvariants(b *testing.B) { + b.ReportAllocs() + + config := simcli.NewConfigFromFlags() + config.ChainID = AppChainID + + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "leveldb-app-invariant-bench", "Simulation", + simcli.FlagVerboseValue, simcli.FlagEnabledValue) + if err != nil { + b.Fatalf("simulation setup failed: %s", err.Error()) + } + + if skip { + b.Skip("skipping benchmark application simulation") + } + + config.AllInvariants = false + + defer func() { + db.Close() + err = os.RemoveAll(dir) + if err != nil { + b.Fatal(err) + } + }() + + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[flags.FlagHome] = DefaultNodeHome + appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + + app := NewChainApp(logger, db, nil, true, appOptions, interBlockCacheOpt(), baseapp.SetChainID(AppChainID)) + + // run randomized simulation + _, simParams, simErr := simulation.SimulateFromSeed( + b, + os.Stdout, + app.BaseApp, + simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), app.DefaultGenesis()), + simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 + simtestutil.SimulationOperations(app, app.AppCodec(), config), + BlockedAddresses(), + config, + app.AppCodec(), + ) + + // export state and simParams before the simulation error is checked + if err = simtestutil.CheckExportSimulation(app, config, simParams); err != nil { + b.Fatal(err) + } + + if simErr != nil { + b.Fatal(simErr) + } + + if config.Commit { + simtestutil.PrintStats(db) + } + + ctx := app.NewContext(true) + + // 3. Benchmark each invariant separately + // + // NOTE: We use the crisis keeper as it has all the invariants registered with + // their respective metadata which makes it useful for testing/benchmarking. + for _, cr := range app.CrisisKeeper.Routes() { + cr := cr + b.Run(fmt.Sprintf("%s/%s", cr.ModuleName, cr.Route), func(b *testing.B) { + if res, stop := cr.Invar(ctx); stop { + b.Fatalf( + "broken invariant at block %d of %d\n%s", + ctx.BlockHeight()-1, config.NumBlocks, res, + ) + } + }) + } +} diff --git a/simapp/app/sim_test.go b/simapp/app/sim_test.go new file mode 100644 index 0000000..f718de8 --- /dev/null +++ b/simapp/app/sim_test.go @@ -0,0 +1,408 @@ +package app + +import ( + "encoding/json" + "fmt" + "os" + "runtime/debug" + "strings" + "testing" + + "cosmossdk.io/log" + "cosmossdk.io/store" + storetypes "cosmossdk.io/store/types" + evidencetypes "cosmossdk.io/x/evidence/types" + abci "github.com/cometbft/cometbft/abci/types" + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/server" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/cosmos/cosmos-sdk/x/simulation" + simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" + "github.com/stretchr/testify/require" + cadatypes "github.com/vitwit/avail-da-module/x/cada/types" + "golang.org/x/exp/rand" +) + +// AppChainID hardcoded chainID for simulation +const AppChainID = "demo" + +// Get flags every time the simulator is run +func init() { + simcli.GetSimulatorFlags() +} + +type StoreKeysPrefixes struct { + A storetypes.StoreKey + B storetypes.StoreKey + Prefixes [][]byte +} + +// fauxMerkleModeOpt returns a BaseApp option to use a dbStoreAdapter instead of +// an IAVLStore for faster simulation speed. +func fauxMerkleModeOpt(bapp *baseapp.BaseApp) { + bapp.SetFauxMerkleMode() +} + +// interBlockCacheOpt returns a BaseApp option function that sets the persistent +// inter-block write-through cache. +func interBlockCacheOpt() func(*baseapp.BaseApp) { + return baseapp.SetInterBlockCache(store.NewCommitKVStoreCacheManager()) +} + +func TestFullAppSimulation(t *testing.T) { + config := simcli.NewConfigFromFlags() + config.ChainID = AppChainID + + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "leveldb-app-sim", "Simulation", + simcli.FlagVerboseValue, simcli.FlagEnabledValue) + if skip { + t.Skip("skipping application simulation") + } + require.NoError(t, err, "simulation setup failed") + + defer func() { + require.NoError(t, db.Close()) + require.NoError(t, os.RemoveAll(dir)) + }() + + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[flags.FlagHome] = DefaultNodeHome + appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + + app := NewChainApp(logger, db, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(AppChainID)) + + require.Equal(t, appName, app.Name()) + + // run randomized simulation + _, simParams, simErr := simulation.SimulateFromSeed( + t, + os.Stdout, + app.BaseApp, + simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), app.DefaultGenesis()), + simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 + simtestutil.SimulationOperations(app, app.AppCodec(), config), + BlockedAddresses(), + config, + app.AppCodec(), + ) + + // export state and simParams before the simulation error is checked + err = simtestutil.CheckExportSimulation(app, config, simParams) + require.NoError(t, err) + require.NoError(t, simErr) + + if config.Commit { + simtestutil.PrintStats(db) + } +} + +func TestAppImportExport(t *testing.T) { + config := simcli.NewConfigFromFlags() + config.ChainID = AppChainID + + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "leveldb-app-sim", "Simulation", + simcli.FlagVerboseValue, simcli.FlagEnabledValue) + if skip { + t.Skip("skipping application import/export simulation") + } + require.NoError(t, err, "simulation setup failed") + + defer func() { + require.NoError(t, db.Close()) + require.NoError(t, os.RemoveAll(dir)) + }() + + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[flags.FlagHome] = DefaultNodeHome + appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + + app := NewChainApp(logger, db, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(AppChainID)) + require.Equal(t, appName, app.Name()) + + // Run randomized simulation + _, simParams, simErr := simulation.SimulateFromSeed( + t, + os.Stdout, + app.BaseApp, + simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), app.DefaultGenesis()), + simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 + simtestutil.SimulationOperations(app, app.AppCodec(), config), + BlockedAddresses(), + config, + app.AppCodec(), + ) + + // export state and simParams before the simulation error is checked + err = simtestutil.CheckExportSimulation(app, config, simParams) + require.NoError(t, err) + require.NoError(t, simErr) + + if config.Commit { + simtestutil.PrintStats(db) + } + + fmt.Printf("exporting genesis...\n") + + exported, err := app.ExportAppStateAndValidators(false, []string{}, []string{}) + require.NoError(t, err) + + fmt.Printf("importing genesis...\n") + + newDB, newDir, _, _, err := simtestutil.SetupSimulation(config, "leveldb-app-sim-2", "Simulation-2", + simcli.FlagVerboseValue, simcli.FlagEnabledValue) + require.NoError(t, err, "simulation setup failed") + + defer func() { + require.NoError(t, newDB.Close()) + require.NoError(t, os.RemoveAll(newDir)) + }() + + newApp := NewChainApp(log.NewNopLogger(), newDB, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(AppChainID)) + require.Equal(t, appName, newApp.Name()) + + var genesisState GenesisState + err = json.Unmarshal(exported.AppState, &genesisState) + require.NoError(t, err) + + defer func() { + if r := recover(); r != nil { + err := fmt.Sprintf("%v", r) + if !strings.Contains(err, "validator set is empty after InitGenesis") && + !strings.Contains(err, "invalid cacheMergeIterator") { + panic(r) + } + logger.Info("Skipping simulation as all validators have been unbonded") + logger.Info("err", err, "stacktrace", string(debug.Stack())) + } + }() + + ctxA := app.NewContext(true) + ctxB := newApp.NewContext(true) + newApp.ModuleManager.InitGenesis(ctxB, app.AppCodec(), genesisState) + newApp.StoreConsensusParams(ctxB, exported.ConsensusParams) + + fmt.Printf("comparing stores...\n") + + storeKeysPrefixes := []StoreKeysPrefixes{ + {app.GetKey(authtypes.StoreKey), newApp.GetKey(authtypes.StoreKey), [][]byte{}}, + { + app.GetKey(stakingtypes.StoreKey), newApp.GetKey(stakingtypes.StoreKey), + [][]byte{ + stakingtypes.UnbondingQueueKey, stakingtypes.RedelegationQueueKey, stakingtypes.ValidatorQueueKey, + stakingtypes.HistoricalInfoKey, stakingtypes.UnbondingIDKey, stakingtypes.UnbondingIndexKey, + stakingtypes.UnbondingTypeKey, stakingtypes.ValidatorUpdatesKey, + }, + }, // ordering may change but it doesn't matter + {app.GetKey(slashingtypes.StoreKey), newApp.GetKey(slashingtypes.StoreKey), [][]byte{}}, + {app.GetKey(minttypes.StoreKey), newApp.GetKey(minttypes.StoreKey), [][]byte{}}, + {app.GetKey(distrtypes.StoreKey), newApp.GetKey(distrtypes.StoreKey), [][]byte{}}, + {app.GetKey(banktypes.StoreKey), newApp.GetKey(banktypes.StoreKey), [][]byte{banktypes.BalancesPrefix}}, + {app.GetKey(paramtypes.StoreKey), newApp.GetKey(paramtypes.StoreKey), [][]byte{}}, + {app.GetKey(govtypes.StoreKey), newApp.GetKey(govtypes.StoreKey), [][]byte{}}, + {app.GetKey(evidencetypes.StoreKey), newApp.GetKey(evidencetypes.StoreKey), [][]byte{}}, + {app.GetKey(capabilitytypes.StoreKey), newApp.GetKey(capabilitytypes.StoreKey), [][]byte{}}, + {app.GetKey(authzkeeper.StoreKey), newApp.GetKey(authzkeeper.StoreKey), [][]byte{authzkeeper.GrantKey, authzkeeper.GrantQueuePrefix}}, + {app.GetKey(cadatypes.StoreKey), newApp.GetKey(cadatypes.StoreKey), [][]byte{}}, + } + + for _, skp := range storeKeysPrefixes { + storeA := ctxA.KVStore(skp.A) + storeB := ctxB.KVStore(skp.B) + + failedKVAs, failedKVBs := simtestutil.DiffKVStores(storeA, storeB, skp.Prefixes) + require.Equal(t, len(failedKVAs), len(failedKVBs), "unequal sets of key-values to compare") + + fmt.Printf("compared %d different key/value pairs between %s and %s\n", len(failedKVAs), skp.A, skp.B) + require.Equal(t, len(failedKVAs), 0, simtestutil.GetSimulationLog(skp.A.Name(), app.SimulationManager().StoreDecoders, failedKVAs, failedKVBs)) + } +} + +func TestAppSimulationAfterImport(t *testing.T) { + config := simcli.NewConfigFromFlags() + config.ChainID = AppChainID + + db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "leveldb-app-sim", "Simulation", + simcli.FlagVerboseValue, simcli.FlagEnabledValue) + if skip { + t.Skip("skipping application simulation after import") + } + require.NoError(t, err, "simulation setup failed") + + defer func() { + require.NoError(t, db.Close()) + require.NoError(t, os.RemoveAll(dir)) + }() + + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[flags.FlagHome] = DefaultNodeHome + appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + + app := NewChainApp(logger, db, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(AppChainID)) + require.Equal(t, appName, app.Name()) + + // Run randomized simulation + stopEarly, simParams, simErr := simulation.SimulateFromSeed( + t, + os.Stdout, + app.BaseApp, + simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), app.DefaultGenesis()), + simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 + simtestutil.SimulationOperations(app, app.AppCodec(), config), + BlockedAddresses(), + config, + app.AppCodec(), + ) + + // export state and simParams before the simulation error is checked + err = simtestutil.CheckExportSimulation(app, config, simParams) + require.NoError(t, err) + require.NoError(t, simErr) + + if config.Commit { + simtestutil.PrintStats(db) + } + + if stopEarly { + fmt.Println("can't export or import a zero-validator genesis, exiting test...") + return + } + + fmt.Printf("exporting genesis...\n") + + exported, err := app.ExportAppStateAndValidators(true, []string{}, []string{}) + require.NoError(t, err) + + fmt.Printf("importing genesis...\n") + + newDB, newDir, _, _, err := simtestutil.SetupSimulation(config, "leveldb-app-sim-2", "Simulation-2", + simcli.FlagVerboseValue, simcli.FlagEnabledValue) + require.NoError(t, err, "simulation setup failed") + + defer func() { + require.NoError(t, newDB.Close()) + require.NoError(t, os.RemoveAll(newDir)) + }() + + newApp := NewChainApp(log.NewNopLogger(), newDB, nil, true, appOptions, fauxMerkleModeOpt, baseapp.SetChainID(AppChainID)) + require.Equal(t, appName, newApp.Name()) + + defer func() { + if r := recover(); r != nil { + err := fmt.Sprintf("%v", r) + if !strings.Contains(err, "validator set is empty after InitGenesis") { + panic(r) + } + logger.Info("Skipping simulation as all validators have been unbonded") + logger.Info("err", err, "stacktrace", string(debug.Stack())) + } + }() + + newApp.InitChain(&abci.RequestInitChain{ + AppStateBytes: exported.AppState, + ChainId: AppChainID, + }) + + _, _, err = simulation.SimulateFromSeed( + t, + os.Stdout, + newApp.BaseApp, + simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), app.DefaultGenesis()), + simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 + simtestutil.SimulationOperations(newApp, newApp.AppCodec(), config), + BlockedAddresses(), + config, + app.AppCodec(), + ) + require.NoError(t, err) +} + +// TODO: Make another test for the fuzzer itself, which just has noOp txs +// and doesn't depend on the application. +func TestAppStateDeterminism(t *testing.T) { + if !simcli.FlagEnabledValue { + t.Skip("skipping application simulation") + } + + config := simcli.NewConfigFromFlags() + config.InitialBlockHeight = 1 + config.ExportParamsPath = "" + config.OnOperation = false + config.AllInvariants = false + config.ChainID = AppChainID + + numSeeds := 3 + numTimesToRunPerSeed := 5 + + // We will be overriding the random seed and just run a single simulation on the provided seed value + if config.Seed != simcli.DefaultSeedValue { + numSeeds = 1 + } + + appHashList := make([]json.RawMessage, numTimesToRunPerSeed) + appOptions := make(simtestutil.AppOptionsMap, 0) + appOptions[flags.FlagHome] = DefaultNodeHome + appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue + + for i := 0; i < numSeeds; i++ { + if config.Seed == simcli.DefaultSeedValue { + config.Seed = rand.Int63() + } + + for j := 0; j < numTimesToRunPerSeed; j++ { + var logger log.Logger + if simcli.FlagVerboseValue { + logger = log.NewTestLogger(t) + } else { + logger = log.NewNopLogger() + } + + db := dbm.NewMemDB() + app := NewChainApp(logger, db, nil, true, appOptions, interBlockCacheOpt(), baseapp.SetChainID(AppChainID)) + + fmt.Printf( + "running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n", + config.Seed, i+1, numSeeds, j+1, numTimesToRunPerSeed, + ) + + _, _, err := simulation.SimulateFromSeed( + t, + os.Stdout, + app.BaseApp, + simtestutil.AppStateFn(app.AppCodec(), app.SimulationManager(), app.DefaultGenesis()), + simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1 + simtestutil.SimulationOperations(app, app.AppCodec(), config), + BlockedAddresses(), + config, + app.AppCodec(), + ) + require.NoError(t, err) + + if config.Commit { + simtestutil.PrintStats(db) + } + + appHash := app.LastCommitID().Hash + appHashList[j] = appHash + + if j != 0 { + require.Equal( + t, string(appHashList[0]), string(appHashList[j]), + "non-determinism in seed %d: %d/%d, attempt: %d/%d\n", config.Seed, i+1, numSeeds, j+1, numTimesToRunPerSeed, + ) + } + } + } +} diff --git a/simapp/app/test_helpers.go b/simapp/app/test_helpers.go index e2b565e..712e1d9 100644 --- a/simapp/app/test_helpers.go +++ b/simapp/app/test_helpers.go @@ -27,7 +27,7 @@ import ( minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/stretchr/testify/require" network "github.com/vitwit/avail-da-module/network" - relayercfg "github.com/vitwit/avail-da-module/types" + relayercfg "github.com/vitwit/avail-da-module/x/cada/types" ) // SetupOptions defines arguments that are passed into `Simapp` constructor. diff --git a/simapp/cmd/cada/commads.go b/simapp/cmd/cada/commads.go index 61b3b8a..6bb4571 100644 --- a/simapp/cmd/cada/commads.go +++ b/simapp/cmd/cada/commads.go @@ -41,8 +41,8 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - cadacli "github.com/vitwit/avail-da-module/client/cli" - cadatypes "github.com/vitwit/avail-da-module/types" + cadacli "github.com/vitwit/avail-da-module/x/cada/client/cli" + cadatypes "github.com/vitwit/avail-da-module/x/cada/types" ) // initCometBFTConfig helps to override default CometBFT Config values. diff --git a/tools/Makefile b/tools/Makefile new file mode 100644 index 0000000..e302695 --- /dev/null +++ b/tools/Makefile @@ -0,0 +1,69 @@ +### +# Find OS and Go environment +# GO contains the Go binary +# FS contains the OS file separator +### +ifeq ($(OS),Windows_NT) + GO := $(shell where go.exe 2> NUL) + FS := "\\" +else + GO := $(shell command -v go 2> /dev/null) + FS := "/" +endif + +ifeq ($(GO),) + $(error could not find go. Is it in PATH? $(GO)) +endif + +############################################################################### +### Functions ### +############################################################################### + +go_get = $(if $(findstring Windows_NT,$(OS)),\ +IF NOT EXIST $(GITHUBDIR)$(FS)$(1)$(FS) ( mkdir $(GITHUBDIR)$(FS)$(1) ) else (cd .) &\ +IF NOT EXIST $(GITHUBDIR)$(FS)$(1)$(FS)$(2)$(FS) ( cd $(GITHUBDIR)$(FS)$(1) && git clone https://github.com/$(1)/$(2) ) else (cd .) &\ +,\ +mkdir -p $(GITHUBDIR)$(FS)$(1) &&\ +(test ! -d $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && cd $(GITHUBDIR)$(FS)$(1) && git clone https://github.com/$(1)/$(2)) || true &&\ +)\ +cd $(GITHUBDIR)$(FS)$(1)$(FS)$(2) && git fetch origin && git checkout -q $(3) + +mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) +mkfile_dir := $(shell cd $(shell dirname $(mkfile_path)); pwd) + + +############################################################################### +### Tools ### +############################################################################### + +PREFIX ?= /usr/local +BIN ?= $(PREFIX)/bin +UNAME_S ?= $(shell uname -s) +UNAME_M ?= $(shell uname -m) + +GOPATH ?= $(shell $(GO) env GOPATH) +GITHUBDIR := $(GOPATH)$(FS)src$(FS)github.com + +BUF_VERSION ?= 0.11.0 + +TOOLS_DESTDIR ?= $(GOPATH)/bin +RUNSIM = $(TOOLS_DESTDIR)/runsim + +tools: tools-stamp +tools-stamp: runsim + # Create dummy file to satisfy dependency and avoid + # rebuilding when this Makefile target is hit twice + # in a row. + touch $@ + +# Install the runsim binary +runsim: $(RUNSIM) +$(RUNSIM): + @echo "Installing runsim..." + @go install github.com/cosmos/tools/cmd/runsim@v1.0.0 + +tools-clean: + rm -f $(GOLANGCI_LINT) $(RUNSIM) + rm -f tools-stamp + +.PHONY: tools-clean runsim \ No newline at end of file diff --git a/x/cada/client/cli/cli_test.go b/x/cada/client/cli/cli_test.go new file mode 100644 index 0000000..83c02d4 --- /dev/null +++ b/x/cada/client/cli/cli_test.go @@ -0,0 +1,133 @@ +package cli_test + +import ( + "fmt" + "testing" + + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/crypto/hd" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/suite" + network "github.com/vitwit/avail-da-module/network" + "github.com/vitwit/avail-da-module/x/cada/client/cli" + + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" +) + +func TestIntegrationTestSuite(t *testing.T) { + suite.Run(t, new(IntegrationTestSuite)) +} + +type IntegrationTestSuite struct { + suite.Suite + + cfg network.Config + network *network.Network + addresses []string +} + +const aliceMnemonic = "all soap kiwi cushion federal skirt tip shock exist tragic verify lunar shine rely torch please view future lizard garbage humble medal leisure mimic" + +func (s *IntegrationTestSuite) SetupSuite() { + s.T().Log("setting up integration test suite") + + var err error + + appConfig := network.MinimumAppConfig() + + cfg, err := network.DefaultConfigWithAppConfig(appConfig) + s.Require().NoError(err) + + s.cfg = cfg + + cfg.NumValidators = 1 + cfg.MinGasPrices = "0.000006stake" + cfg.PublishBlobInterval = "5" + cfg.LightClientURL = "http://127.0.0.1:8000" + + // Initialize the network + s.network, err = network.New(s.T(), s.T().TempDir(), cfg) + s.Require().NoError(err) + + kb := s.network.Validators[0].ClientCtx.Keyring + path := sdk.GetConfig().GetFullBIP44Path() + info, err := kb.NewAccount("alice", aliceMnemonic, "", path, hd.Secp256k1) + s.Require().NoError(err) + + add, err := info.GetAddress() + s.Require().NoError(err) + s.addresses = append(s.addresses, add.String()) + + _, err = s.network.WaitForHeight(1) + s.Require().NoError(err) +} + +func (s *IntegrationTestSuite) TearDownSuite() { + s.T().Log("tearing down integration suite") + s.network.Cleanup() +} + +func (s *IntegrationTestSuite) TestNewUpdateBlobStatusCmd() { + val := s.network.Validators[0] + + testCases := []struct { + name string + args []string + expectErr bool + }{ + { + "update blob status - success", + []string{ + "1", + "10", + "success", + "120", + fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addresses[0]), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + }, + false, + }, + { + "update blob status - failure", + []string{ + "1", + "10", + "failure", + "120", + fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addresses[0]), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + }, + false, + }, + { + "update blob status - invalid status", + []string{ + "1", + "10", + "invalid", + "120", + fmt.Sprintf("--%s=%s", flags.FlagFrom, s.addresses[0]), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + }, + false, + }, + } + + for _, tc := range testCases { + s.Run(tc.name, func() { + cmd := cli.NewUpdateBlobStatusCmd() + res, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, tc.args) + if tc.expectErr { + if err != nil { + s.Require().Error(err) + } + } + + s.Require().NoError(nil) + s.Require().NotNil(res) + }) + } +} diff --git a/client/cli/keys.go b/x/cada/client/cli/keys.go similarity index 91% rename from client/cli/keys.go rename to x/cada/client/cli/keys.go index 9752073..9661f21 100644 --- a/client/cli/keys.go +++ b/x/cada/client/cli/keys.go @@ -3,7 +3,7 @@ package cli import ( "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" - types "github.com/vitwit/avail-da-module/types" + types "github.com/vitwit/avail-da-module/x/cada/types" ) const ( diff --git a/client/cli/query.go b/x/cada/client/cli/query.go similarity index 95% rename from client/cli/query.go rename to x/cada/client/cli/query.go index d6d37cb..d09bd29 100644 --- a/client/cli/query.go +++ b/x/cada/client/cli/query.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - types "github.com/vitwit/avail-da-module/types" + types "github.com/vitwit/avail-da-module/x/cada/types" ) // GetQueryCmd returns the root query command for the cada module. diff --git a/client/cli/tx.go b/x/cada/client/cli/tx.go similarity index 95% rename from client/cli/tx.go rename to x/cada/client/cli/tx.go index b589c65..280f870 100644 --- a/client/cli/tx.go +++ b/x/cada/client/cli/tx.go @@ -9,8 +9,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" - "github.com/vitwit/avail-da-module/keeper" - types "github.com/vitwit/avail-da-module/types" + "github.com/vitwit/avail-da-module/x/cada/keeper" + types "github.com/vitwit/avail-da-module/x/cada/types" ) // NewTxCmd creates and returns a Cobra command for transaction subcommands related to the cada module. diff --git a/integration_docs/README.md b/x/cada/integration_docs/README.md similarity index 100% rename from integration_docs/README.md rename to x/cada/integration_docs/README.md diff --git a/integration_docs/config.md b/x/cada/integration_docs/config.md similarity index 100% rename from integration_docs/config.md rename to x/cada/integration_docs/config.md diff --git a/integration_docs/integration.md b/x/cada/integration_docs/integration.md similarity index 100% rename from integration_docs/integration.md rename to x/cada/integration_docs/integration.md diff --git a/integration_docs/spawn.md b/x/cada/integration_docs/spawn.md similarity index 100% rename from integration_docs/spawn.md rename to x/cada/integration_docs/spawn.md diff --git a/keeper/abci.go b/x/cada/keeper/abci.go similarity index 99% rename from keeper/abci.go rename to x/cada/keeper/abci.go index b49dca8..941e306 100644 --- a/keeper/abci.go +++ b/x/cada/keeper/abci.go @@ -175,6 +175,10 @@ func (k *Keeper) PreBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock) err // IsValidBlockToPostToDA checks if the given block height is valid for posting data. // The block is considered valid if it meets the defined interval for posting. func (k *Keeper) IsValidBlockToPostToDA(height uint64) bool { + if k.relayer.AvailConfig.PublishBlobInterval == 0 { + return false + } + if height <= uint64(1) { return false } diff --git a/keeper/abci_test.go b/x/cada/keeper/abci_test.go similarity index 98% rename from keeper/abci_test.go rename to x/cada/keeper/abci_test.go index d4b7241..71259f5 100644 --- a/keeper/abci_test.go +++ b/x/cada/keeper/abci_test.go @@ -4,7 +4,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - store "github.com/vitwit/avail-da-module/keeper" + store "github.com/vitwit/avail-da-module/x/cada/keeper" ) func (s *TestSuite) TestPrepareProposal() { diff --git a/keeper/blob_status.go b/x/cada/keeper/blob_status.go similarity index 100% rename from keeper/blob_status.go rename to x/cada/keeper/blob_status.go diff --git a/keeper/genesis.go b/x/cada/keeper/genesis.go similarity index 88% rename from keeper/genesis.go rename to x/cada/keeper/genesis.go index 368155c..7177330 100644 --- a/keeper/genesis.go +++ b/x/cada/keeper/genesis.go @@ -2,7 +2,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/vitwit/avail-da-module/types" + "github.com/vitwit/avail-da-module/x/cada/types" ) // InitGenesis initializes the module's state from a genesis state. diff --git a/keeper/keeper.go b/x/cada/keeper/keeper.go similarity index 92% rename from keeper/keeper.go rename to x/cada/keeper/keeper.go index 6b1e3fb..d881e77 100644 --- a/keeper/keeper.go +++ b/x/cada/keeper/keeper.go @@ -11,7 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/cobra" "github.com/vitwit/avail-da-module/relayer" - types "github.com/vitwit/avail-da-module/types" + types "github.com/vitwit/avail-da-module/x/cada/types" ) type Keeper struct { @@ -66,3 +66,7 @@ func (k *Keeper) GetBlobStatus(ctx sdk.Context) uint32 { store := ctx.KVStore(k.storeKey) return GetStatusFromStore(store) } + +func (k Keeper) GetStoreKey() storetypes2.StoreKey { + return k.storeKey +} diff --git a/keeper/keeper_test.go b/x/cada/keeper/keeper_test.go similarity index 95% rename from keeper/keeper_test.go rename to x/cada/keeper/keeper_test.go index c1d7ebd..7e2e5ff 100644 --- a/keeper/keeper_test.go +++ b/x/cada/keeper/keeper_test.go @@ -19,10 +19,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" "github.com/stretchr/testify/suite" - "github.com/vitwit/avail-da-module/keeper" - module "github.com/vitwit/avail-da-module/module" relayer "github.com/vitwit/avail-da-module/relayer" - types "github.com/vitwit/avail-da-module/types" + "github.com/vitwit/avail-da-module/x/cada/keeper" + module "github.com/vitwit/avail-da-module/x/cada/module" + types "github.com/vitwit/avail-da-module/x/cada/types" ) type TestSuite struct { diff --git a/keeper/msg_server.go b/x/cada/keeper/msg_server.go similarity index 97% rename from keeper/msg_server.go rename to x/cada/keeper/msg_server.go index 9d85d1b..aad6c7d 100644 --- a/keeper/msg_server.go +++ b/x/cada/keeper/msg_server.go @@ -6,7 +6,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/vitwit/avail-da-module/types" + "github.com/vitwit/avail-da-module/x/cada/types" ) type msgServer struct { diff --git a/keeper/msg_server_test.go b/x/cada/keeper/msg_server_test.go similarity index 93% rename from keeper/msg_server_test.go rename to x/cada/keeper/msg_server_test.go index 64b1a8d..7244463 100644 --- a/keeper/msg_server_test.go +++ b/x/cada/keeper/msg_server_test.go @@ -1,8 +1,8 @@ package keeper_test import ( - cadakeeper "github.com/vitwit/avail-da-module/keeper" - "github.com/vitwit/avail-da-module/types" + cadakeeper "github.com/vitwit/avail-da-module/x/cada/keeper" + "github.com/vitwit/avail-da-module/x/cada/types" ) func (s *TestSuite) TestMsgServer_UpdateBlobStatus() { diff --git a/keeper/query_server.go b/x/cada/keeper/query_server.go similarity index 96% rename from keeper/query_server.go rename to x/cada/keeper/query_server.go index 3e9b8a9..14860cd 100644 --- a/keeper/query_server.go +++ b/x/cada/keeper/query_server.go @@ -4,7 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/vitwit/avail-da-module/types" + "github.com/vitwit/avail-da-module/x/cada/types" ) var _ types.QueryServer = queryServer{} diff --git a/keeper/query_server_test.go b/x/cada/keeper/query_server_test.go similarity index 85% rename from keeper/query_server_test.go rename to x/cada/keeper/query_server_test.go index bcb7696..7f3287b 100644 --- a/keeper/query_server_test.go +++ b/x/cada/keeper/query_server_test.go @@ -1,8 +1,8 @@ package keeper_test import ( - store "github.com/vitwit/avail-da-module/keeper" - "github.com/vitwit/avail-da-module/types" + store "github.com/vitwit/avail-da-module/x/cada/keeper" + "github.com/vitwit/avail-da-module/x/cada/types" ) func (s *TestSuite) TestSubmitBlobStatus() { diff --git a/keeper/status_test.go b/x/cada/keeper/status_test.go similarity index 96% rename from keeper/status_test.go rename to x/cada/keeper/status_test.go index c9dbfa1..e7328de 100644 --- a/keeper/status_test.go +++ b/x/cada/keeper/status_test.go @@ -1,7 +1,7 @@ package keeper_test import ( - "github.com/vitwit/avail-da-module/types" + "github.com/vitwit/avail-da-module/x/cada/types" ) func (s *TestSuite) TestSetBlobStatusPending() { diff --git a/keeper/store.go b/x/cada/keeper/store.go similarity index 99% rename from keeper/store.go rename to x/cada/keeper/store.go index 558613d..2ced9d0 100644 --- a/keeper/store.go +++ b/x/cada/keeper/store.go @@ -7,7 +7,7 @@ import ( "cosmossdk.io/collections" storetypes2 "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - types "github.com/vitwit/avail-da-module/types" + types "github.com/vitwit/avail-da-module/x/cada/types" ) const ( diff --git a/keeper/store_test.go b/x/cada/keeper/store_test.go similarity index 97% rename from keeper/store_test.go rename to x/cada/keeper/store_test.go index cf6fa75..425823f 100644 --- a/keeper/store_test.go +++ b/x/cada/keeper/store_test.go @@ -1,7 +1,7 @@ package keeper_test import ( - store "github.com/vitwit/avail-da-module/keeper" + store "github.com/vitwit/avail-da-module/x/cada/keeper" ) func (s *TestSuite) TestCanUpdateStatusToPending() { diff --git a/keeper/vote_extension.go b/x/cada/keeper/vote_extension.go similarity index 100% rename from keeper/vote_extension.go rename to x/cada/keeper/vote_extension.go diff --git a/keeper/vote_extension_test.go b/x/cada/keeper/vote_extension_test.go similarity index 96% rename from keeper/vote_extension_test.go rename to x/cada/keeper/vote_extension_test.go index d37a91d..a130bc0 100644 --- a/keeper/vote_extension_test.go +++ b/x/cada/keeper/vote_extension_test.go @@ -2,7 +2,7 @@ package keeper_test import ( abci "github.com/cometbft/cometbft/abci/types" - store "github.com/vitwit/avail-da-module/keeper" + store "github.com/vitwit/avail-da-module/x/cada/keeper" ) func (s *TestSuite) TestExtendVoteHandler() { diff --git a/module/autocli.go b/x/cada/module/autocli.go similarity index 100% rename from module/autocli.go rename to x/cada/module/autocli.go diff --git a/module/depinject.go b/x/cada/module/depinject.go similarity index 100% rename from module/depinject.go rename to x/cada/module/depinject.go diff --git a/module/module.go b/x/cada/module/module.go similarity index 79% rename from module/module.go rename to x/cada/module/module.go index 5367651..8180d24 100644 --- a/module/module.go +++ b/x/cada/module/module.go @@ -12,11 +12,15 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - "github.com/vitwit/avail-da-module/client/cli" - "github.com/vitwit/avail-da-module/keeper" - types "github.com/vitwit/avail-da-module/types" + "github.com/vitwit/avail-da-module/x/cada/client/cli" + "github.com/vitwit/avail-da-module/x/cada/keeper" + simulation "github.com/vitwit/avail-da-module/x/cada/simulation" + types "github.com/vitwit/avail-da-module/x/cada/types" ) var ( @@ -64,15 +68,19 @@ func (ab AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistr } type AppModule struct { - cdc codec.Codec - keeper *keeper.Keeper + cdc codec.Codec + keeper *keeper.Keeper + authkeeper authkeeper.AccountKeeper + bankkeeper bankkeeper.Keeper } // NewAppModule creates a new AppModule object -func NewAppModule(cdc codec.Codec, keeper *keeper.Keeper) AppModule { +func NewAppModule(cdc codec.Codec, keeper *keeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper) AppModule { return AppModule{ - cdc: cdc, - keeper: keeper, + cdc: cdc, + keeper: keeper, + authkeeper: ak, + bankkeeper: bk, } } @@ -164,3 +172,19 @@ func (am AppModule) IsOnePerModuleType() {} // IsAppModule implements the appmodule.AppModule interface. func (am AppModule) IsAppModule() {} + +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + simulation.RandomizedGenState(simState) +} + +// RegisterStoreDecoder registers a decoder for distribution module's types +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) { +} + +// WeightedOperations returns the all the accounts module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + return simulation.WeightedOperations( + simState.AppParams, simState.Cdc, simState.TxConfig, + am.authkeeper, am.bankkeeper, *am.keeper, + ) +} diff --git a/x/cada/simulation/genesis.go b/x/cada/simulation/genesis.go new file mode 100644 index 0000000..5f32926 --- /dev/null +++ b/x/cada/simulation/genesis.go @@ -0,0 +1,16 @@ +package simulation + +import ( + "github.com/cosmos/cosmos-sdk/types/module" + types "github.com/vitwit/avail-da-module/x/cada/types" +) + +// RandomizedGenState creates a randomized GenesisState for testing. +func RandomizedGenState(simState *module.SimulationState) { + // Since your GenesisState is empty, there's not much to randomize. + // We'll just set the GenesisState to its empty struct. + genesis := types.GenesisState{} + + // Here we use simState to set the default genesis + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&genesis) +} diff --git a/x/cada/simulation/operation.go b/x/cada/simulation/operation.go new file mode 100644 index 0000000..488418a --- /dev/null +++ b/x/cada/simulation/operation.go @@ -0,0 +1,106 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + "github.com/cosmos/cosmos-sdk/x/simulation" + cadakeeper "github.com/vitwit/avail-da-module/x/cada/keeper" + cadatypes "github.com/vitwit/avail-da-module/x/cada/types" +) + +const ( + OpWeightMsgUpdateBlobStatusRequest = "op_weight_msg_update_blob_status" + + DefaultWeightMsgUpdateStatusRequest = 100 +) + +func WeightedOperations( + appParams simtypes.AppParams, _ codec.JSONCodec, _ client.TxConfig, + ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, k cadakeeper.Keeper, +) simulation.WeightedOperations { + var weightMsgUpdateBlobStatusRequest int + appParams.GetOrGenerate(OpWeightMsgUpdateBlobStatusRequest, &weightMsgUpdateBlobStatusRequest, nil, func(_ *rand.Rand) { + weightMsgUpdateBlobStatusRequest = DefaultWeightMsgUpdateStatusRequest + }) + + return simulation.WeightedOperations{ + simulation.NewWeightedOperation( + weightMsgUpdateBlobStatusRequest, + SimulateMsgUpdateBlobStatus(ak, bk, k), + ), + } +} + +func SimulateMsgUpdateBlobStatus(ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, k cadakeeper.Keeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, _ string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + ctx = ctx.WithBlockHeight(20) + + sender, _ := simtypes.RandomAcc(r, accs) + + account := ak.GetAccount(ctx, sender.Address) + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + + fees, err := simtypes.RandomFees(r, ctx, spendable) + if err != nil { + return simtypes.NoOpMsg(cadatypes.ModuleName, cadatypes.TypeMsgUpdateBlobStatus, "unable to generate fees"), nil, err + } + + newStatus := true + fromBlock := uint64(5) + toBlock := uint64(20) + availHeight := uint64(120) + + ran := cadatypes.Range{ + From: fromBlock, + To: toBlock, + } + + msg := cadatypes.NewMsgUpdateBlobStatus( + sender.Address.String(), + ran, + availHeight, + newStatus, + ) + + store := ctx.KVStore(k.GetStoreKey()) + + err = cadakeeper.UpdateEndHeight(ctx, store, uint64(20)) + if err != nil { + return simtypes.NoOpMsg(cadatypes.ModuleName, cadatypes.TypeMsgUpdateBlobStatus, "unable to update end height"), nil, err + } + + err = cadakeeper.UpdateProvenHeight(ctx, store, uint64(4)) + if err != nil { + return simtypes.NoOpMsg(cadatypes.ModuleName, cadatypes.TypeMsgUpdateBlobStatus, "unable to update proven height"), nil, err + } + + err = cadakeeper.UpdateBlobStatus(ctx, store, uint32(1)) + if err != nil { + return simtypes.NoOpMsg(cadatypes.ModuleName, cadatypes.TypeMsgUpdateBlobStatus, "unable to update status to pending state"), nil, err + } + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: moduletestutil.MakeTestEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + Context: ctx, + SimAccount: sender, + AccountKeeper: ak, + ModuleName: cadatypes.ModuleName, + } + + return simulation.GenAndDeliverTx(txCtx, fees) + } +} diff --git a/specs/01_concepts.md b/x/cada/specs/01_concepts.md similarity index 100% rename from specs/01_concepts.md rename to x/cada/specs/01_concepts.md diff --git a/specs/02_state.md b/x/cada/specs/02_state.md similarity index 100% rename from specs/02_state.md rename to x/cada/specs/02_state.md diff --git a/specs/03_msg.md b/x/cada/specs/03_msg.md similarity index 100% rename from specs/03_msg.md rename to x/cada/specs/03_msg.md diff --git a/specs/04_client.md b/x/cada/specs/04_client.md similarity index 99% rename from specs/04_client.md rename to x/cada/specs/04_client.md index 3d028f5..f5a188e 100644 --- a/specs/04_client.md +++ b/x/cada/specs/04_client.md @@ -17,6 +17,7 @@ simd query cada --help ``` #### Query the Status + The `get-da-status` command enables users to retrieve comprehensive information, including the range of blocks currently being posted to Avail, the current status, the last proven height, the Avail height where the data is made available, and the voting block height by which voting should conclude. ```sh diff --git a/specs/05_prepare_proposal.md b/x/cada/specs/05_prepare_proposal.md similarity index 100% rename from specs/05_prepare_proposal.md rename to x/cada/specs/05_prepare_proposal.md diff --git a/specs/06_preblocker.md b/x/cada/specs/06_preblocker.md similarity index 100% rename from specs/06_preblocker.md rename to x/cada/specs/06_preblocker.md diff --git a/specs/07_vote_extension.md b/x/cada/specs/07_vote_extension.md similarity index 99% rename from specs/07_vote_extension.md rename to x/cada/specs/07_vote_extension.md index 4043aa7..0866fa2 100644 --- a/specs/07_vote_extension.md +++ b/x/cada/specs/07_vote_extension.md @@ -76,6 +76,7 @@ if currentHeight+1 != int64(voteEndHeight) || blobStatus != IN_VOTING_STATE { ``` ### VerifyVoteExtensionHandler + The `VerifyVoteExtensionHandler` method is responsible for validating the format and content of the vote extensions generated by the `ExtendVoteHandler`. This method performs a basic validation check on the received vote extension, ensuring it meets the necessary format requirements. It then returns a response indicating whether the vote extension is accepted. diff --git a/specs/README.md b/x/cada/specs/README.md similarity index 100% rename from specs/README.md rename to x/cada/specs/README.md diff --git a/types/abci.pb.go b/x/cada/types/abci.pb.go similarity index 87% rename from types/abci.pb.go rename to x/cada/types/abci.pb.go index 5bbf177..b4f5c64 100644 --- a/types/abci.pb.go +++ b/x/cada/types/abci.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: sdk/avail/v1beta1/abci.proto +// source: cada/v1beta1/abci.proto package types @@ -33,7 +33,7 @@ func (m *InjectedData) Reset() { *m = InjectedData{} } func (m *InjectedData) String() string { return proto.CompactTextString(m) } func (*InjectedData) ProtoMessage() {} func (*InjectedData) Descriptor() ([]byte, []int) { - return fileDescriptor_cf694f1e6f573248, []int{0} + return fileDescriptor_c10129946240d9b3, []int{0} } func (m *InjectedData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -78,7 +78,7 @@ func (m *PendingBlocks) Reset() { *m = PendingBlocks{} } func (m *PendingBlocks) String() string { return proto.CompactTextString(m) } func (*PendingBlocks) ProtoMessage() {} func (*PendingBlocks) Descriptor() ([]byte, []int) { - return fileDescriptor_cf694f1e6f573248, []int{1} + return fileDescriptor_c10129946240d9b3, []int{1} } func (m *PendingBlocks) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -124,7 +124,7 @@ func (m *UnprovenBlock) Reset() { *m = UnprovenBlock{} } func (m *UnprovenBlock) String() string { return proto.CompactTextString(m) } func (*UnprovenBlock) ProtoMessage() {} func (*UnprovenBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_cf694f1e6f573248, []int{2} + return fileDescriptor_c10129946240d9b3, []int{2} } func (m *UnprovenBlock) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -168,33 +168,33 @@ func (m *UnprovenBlock) GetBlock() []byte { } func init() { - proto.RegisterType((*InjectedData)(nil), "sdk.avail.v1beta1.InjectedData") - proto.RegisterType((*PendingBlocks)(nil), "sdk.avail.v1beta1.PendingBlocks") - proto.RegisterType((*UnprovenBlock)(nil), "sdk.avail.v1beta1.UnprovenBlock") -} - -func init() { proto.RegisterFile("sdk/avail/v1beta1/abci.proto", fileDescriptor_cf694f1e6f573248) } - -var fileDescriptor_cf694f1e6f573248 = []byte{ - // 283 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0x4e, 0xc9, 0xd6, - 0x4f, 0x2c, 0x4b, 0xcc, 0xcc, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4c, - 0x4a, 0xce, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x2c, 0x4e, 0xc9, 0xd6, 0x03, 0xcb, - 0xea, 0x41, 0x65, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0xb2, 0xfa, 0x20, 0x16, 0x44, 0xa1, - 0x52, 0x2c, 0x17, 0x8f, 0x67, 0x5e, 0x56, 0x6a, 0x72, 0x49, 0x6a, 0x8a, 0x4b, 0x62, 0x49, 0xa2, - 0x90, 0x2f, 0x17, 0x5f, 0x41, 0x6a, 0x5e, 0x4a, 0x66, 0x5e, 0x7a, 0x7c, 0x52, 0x4e, 0x7e, 0x72, - 0x76, 0xb1, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x82, 0x1e, 0x86, 0x89, 0x7a, 0x01, 0x10, - 0x85, 0x4e, 0x60, 0x75, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0xf1, 0x16, 0x20, 0x0b, 0x2a, - 0x99, 0x70, 0xf1, 0xa2, 0xa8, 0x12, 0x52, 0xe6, 0xe2, 0x05, 0x9b, 0x1b, 0x9f, 0x91, 0x9a, 0x99, - 0x9e, 0x51, 0x02, 0x32, 0x9e, 0x59, 0x83, 0x39, 0x88, 0x07, 0x2c, 0xe8, 0x01, 0x11, 0x53, 0xb2, - 0xe5, 0xe2, 0x0d, 0xcd, 0x2b, 0x28, 0xca, 0x2f, 0x4b, 0xcd, 0x03, 0x6b, 0x13, 0x12, 0xe3, 0x62, - 0x83, 0xa8, 0x07, 0xbb, 0x86, 0x39, 0x08, 0xca, 0x13, 0x12, 0xe1, 0x62, 0x05, 0x6b, 0x94, 0x60, - 0x52, 0x60, 0xd4, 0xe0, 0x09, 0x82, 0x70, 0x9c, 0x1c, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, - 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, - 0x58, 0x8e, 0x21, 0x4a, 0x3d, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0xbf, - 0x2c, 0xb3, 0xa4, 0x3c, 0xb3, 0x04, 0x12, 0x84, 0xba, 0x29, 0x89, 0xba, 0xb9, 0xf9, 0x29, 0xa5, - 0x39, 0xa9, 0xfa, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0xd0, 0x31, 0x06, 0x04, 0x00, - 0x00, 0xff, 0xff, 0x26, 0x36, 0x5a, 0x14, 0x66, 0x01, 0x00, 0x00, + proto.RegisterType((*InjectedData)(nil), "cada.v1beta1.InjectedData") + proto.RegisterType((*PendingBlocks)(nil), "cada.v1beta1.PendingBlocks") + proto.RegisterType((*UnprovenBlock)(nil), "cada.v1beta1.UnprovenBlock") +} + +func init() { proto.RegisterFile("cada/v1beta1/abci.proto", fileDescriptor_c10129946240d9b3) } + +var fileDescriptor_c10129946240d9b3 = []byte{ + // 280 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xb1, 0x4e, 0xc3, 0x30, + 0x18, 0x84, 0x63, 0x0a, 0x1d, 0x4c, 0xc2, 0x10, 0x55, 0x50, 0x81, 0x64, 0xaa, 0xb0, 0x64, 0xa9, + 0xad, 0x02, 0x2b, 0x4b, 0xc4, 0x10, 0x36, 0x14, 0x09, 0x09, 0xb1, 0x54, 0x4e, 0x62, 0x39, 0x86, + 0xd4, 0xb6, 0x5a, 0x37, 0xc0, 0x5b, 0xf0, 0x58, 0x1d, 0x3b, 0x32, 0x21, 0x94, 0xbc, 0x08, 0x8a, + 0xdd, 0xa1, 0x6c, 0xfe, 0xef, 0xbe, 0x3b, 0x59, 0x07, 0xcf, 0x0a, 0x5a, 0x52, 0xd2, 0xcc, 0x72, + 0x66, 0xe8, 0x8c, 0xd0, 0xbc, 0x10, 0x58, 0x2f, 0x95, 0x51, 0xa1, 0xdf, 0x1b, 0x78, 0x67, 0x9c, + 0x8f, 0xb8, 0xe2, 0xca, 0x1a, 0xa4, 0x7f, 0x39, 0x26, 0x7a, 0x86, 0xfe, 0x83, 0x7c, 0x65, 0x85, + 0x61, 0xe5, 0x3d, 0x35, 0x34, 0x4c, 0xe1, 0x89, 0x66, 0xb2, 0x14, 0x92, 0xcf, 0xf3, 0x5a, 0x15, + 0x6f, 0xab, 0x31, 0x98, 0x80, 0xf8, 0xf8, 0xfa, 0x02, 0xef, 0x97, 0xe1, 0x47, 0xc7, 0x24, 0x16, + 0x49, 0x0e, 0x37, 0x3f, 0x97, 0x5e, 0x16, 0xe8, 0x7d, 0x31, 0xba, 0x85, 0xc1, 0x3f, 0x2a, 0xbc, + 0x82, 0x81, 0xad, 0x9c, 0x57, 0x4c, 0xf0, 0xca, 0xf4, 0xcd, 0x83, 0x78, 0x90, 0xf9, 0x56, 0x4c, + 0x9d, 0x16, 0xdd, 0xc1, 0xe0, 0x49, 0xea, 0xa5, 0x6a, 0x98, 0xb4, 0xb1, 0xf0, 0x14, 0x0e, 0x1d, + 0x6f, 0x3f, 0x32, 0xc8, 0x76, 0x57, 0x38, 0x82, 0x47, 0x36, 0x38, 0x3e, 0x98, 0x80, 0xd8, 0xcf, + 0xdc, 0x91, 0xa4, 0x9b, 0x16, 0x81, 0x6d, 0x8b, 0xc0, 0x6f, 0x8b, 0xc0, 0x57, 0x87, 0xbc, 0x6d, + 0x87, 0xbc, 0xef, 0x0e, 0x79, 0x2f, 0x98, 0x0b, 0x53, 0xad, 0x73, 0x5c, 0xa8, 0x05, 0x69, 0x84, + 0x79, 0x17, 0x86, 0xd0, 0x86, 0x8a, 0x7a, 0x5a, 0xd2, 0xe9, 0x42, 0x95, 0xeb, 0x9a, 0x91, 0x0f, + 0x62, 0x97, 0x34, 0x9f, 0x9a, 0xad, 0xf2, 0xa1, 0xdd, 0xe7, 0xe6, 0x2f, 0x00, 0x00, 0xff, 0xff, + 0x17, 0x6b, 0xb7, 0xe0, 0x5e, 0x01, 0x00, 0x00, } func (m *InjectedData) Marshal() (dAtA []byte, err error) { diff --git a/types/avail_config.go b/x/cada/types/avail_config.go similarity index 100% rename from types/avail_config.go rename to x/cada/types/avail_config.go diff --git a/types/codec.go b/x/cada/types/codec.go similarity index 100% rename from types/codec.go rename to x/cada/types/codec.go diff --git a/types/genesis.go b/x/cada/types/genesis.go similarity index 100% rename from types/genesis.go rename to x/cada/types/genesis.go diff --git a/types/genesis.pb.go b/x/cada/types/genesis.pb.go similarity index 81% rename from types/genesis.pb.go rename to x/cada/types/genesis.pb.go index 43a5ff8..bcdcdb4 100644 --- a/types/genesis.pb.go +++ b/x/cada/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: sdk/avail/v1beta1/genesis.proto +// source: cada/v1beta1/genesis.proto package types @@ -30,7 +30,7 @@ func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_b83d128538762178, []int{0} + return fileDescriptor_add756a79c56de92, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -60,23 +60,23 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo func init() { - proto.RegisterType((*GenesisState)(nil), "sdk.avail.v1beta1.GenesisState") + proto.RegisterType((*GenesisState)(nil), "cada.v1beta1.GenesisState") } -func init() { proto.RegisterFile("sdk/avail/v1beta1/genesis.proto", fileDescriptor_b83d128538762178) } +func init() { proto.RegisterFile("cada/v1beta1/genesis.proto", fileDescriptor_add756a79c56de92) } -var fileDescriptor_b83d128538762178 = []byte{ - // 150 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2f, 0x4e, 0xc9, 0xd6, - 0x4f, 0x2c, 0x4b, 0xcc, 0xcc, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, - 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x2c, 0x4e, 0xc9, - 0xd6, 0x03, 0x2b, 0xd0, 0x83, 0x2a, 0x50, 0xe2, 0xe3, 0xe2, 0x71, 0x87, 0xa8, 0x09, 0x2e, 0x49, - 0x2c, 0x49, 0x75, 0x72, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, - 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xf5, - 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xb2, 0xcc, 0x92, 0xf2, 0xcc, - 0x12, 0x88, 0x5d, 0xba, 0x29, 0x89, 0xba, 0xb9, 0xf9, 0x29, 0xa5, 0x39, 0xa9, 0xfa, 0x25, 0x95, - 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xcb, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x18, 0x5a, - 0x23, 0xdb, 0x8f, 0x00, 0x00, 0x00, +var fileDescriptor_add756a79c56de92 = []byte{ + // 148 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4a, 0x4e, 0x4c, 0x49, + 0xd4, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, + 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x01, 0xc9, 0xe9, 0x41, 0xe5, 0x94, 0xf8, 0xb8, + 0x78, 0xdc, 0x21, 0xd2, 0xc1, 0x25, 0x89, 0x25, 0xa9, 0x4e, 0x1e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, + 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, + 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x97, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, + 0xab, 0x5f, 0x96, 0x59, 0x52, 0x9e, 0x59, 0xa2, 0x9f, 0x58, 0x96, 0x98, 0x99, 0xa3, 0x9b, 0x92, + 0xa8, 0x9b, 0x9b, 0x9f, 0x52, 0x9a, 0x93, 0xaa, 0x5f, 0xa1, 0x0f, 0xb6, 0xb7, 0xa4, 0xb2, 0x20, + 0xb5, 0x38, 0x89, 0x0d, 0x6c, 0x9d, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x3a, 0x11, 0xd3, 0x69, + 0x8c, 0x00, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/types/keys.go b/x/cada/types/keys.go similarity index 100% rename from types/keys.go rename to x/cada/types/keys.go diff --git a/x/cada/types/msg.go b/x/cada/types/msg.go new file mode 100644 index 0000000..95dbaf9 --- /dev/null +++ b/x/cada/types/msg.go @@ -0,0 +1,18 @@ +package types + +import sdk "github.com/cosmos/cosmos-sdk/types" + +const ( + TypeMsgUpdateBlobStatus = "update_blob_Status" +) + +var _ sdk.Msg = (*MsgUpdateBlobStatusRequest)(nil) + +func NewMsgUpdateBlobStatus(valAddr string, blockRange Range, availHeight uint64, isSuccess bool) *MsgUpdateBlobStatusRequest { + return &MsgUpdateBlobStatusRequest{ + ValidatorAddress: valAddr, + BlocksRange: &blockRange, + AvailHeight: availHeight, + IsSuccess: isSuccess, + } +} diff --git a/types/query.pb.go b/x/cada/types/query.pb.go similarity index 85% rename from types/query.pb.go rename to x/cada/types/query.pb.go index c479e7b..2ed1ab0 100644 --- a/types/query.pb.go +++ b/x/cada/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: sdk/avail/v1beta1/query.proto +// source: cada/v1beta1/query.proto package types @@ -36,7 +36,7 @@ func (m *QuerySubmittedBlobStatusRequest) Reset() { *m = QuerySubmittedB func (m *QuerySubmittedBlobStatusRequest) String() string { return proto.CompactTextString(m) } func (*QuerySubmittedBlobStatusRequest) ProtoMessage() {} func (*QuerySubmittedBlobStatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_30ff5d91ce731c68, []int{0} + return fileDescriptor_0579d66f58f8318a, []int{0} } func (m *QuerySubmittedBlobStatusRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -85,7 +85,7 @@ func (m *QuerySubmittedBlobStatusResponse) Reset() { *m = QuerySubmitted func (m *QuerySubmittedBlobStatusResponse) String() string { return proto.CompactTextString(m) } func (*QuerySubmittedBlobStatusResponse) ProtoMessage() {} func (*QuerySubmittedBlobStatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_30ff5d91ce731c68, []int{1} + return fileDescriptor_0579d66f58f8318a, []int{1} } func (m *QuerySubmittedBlobStatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -143,37 +143,37 @@ func (m *QuerySubmittedBlobStatusResponse) GetVotingEndsAt() string { } func init() { - proto.RegisterType((*QuerySubmittedBlobStatusRequest)(nil), "sdk.avail.v1beta1.QuerySubmittedBlobStatusRequest") - proto.RegisterType((*QuerySubmittedBlobStatusResponse)(nil), "sdk.avail.v1beta1.QuerySubmittedBlobStatusResponse") -} - -func init() { proto.RegisterFile("sdk/avail/v1beta1/query.proto", fileDescriptor_30ff5d91ce731c68) } - -var fileDescriptor_30ff5d91ce731c68 = []byte{ - // 362 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0xc1, 0x4a, 0xeb, 0x40, - 0x18, 0x85, 0x3b, 0xbd, 0x6d, 0xe1, 0xce, 0xed, 0x15, 0x1c, 0x41, 0x42, 0xd0, 0x18, 0x5b, 0xc5, - 0x82, 0x34, 0xa1, 0xed, 0x13, 0xb4, 0x20, 0xb8, 0x35, 0xdd, 0xb9, 0x29, 0x13, 0x33, 0xa4, 0x43, - 0xd3, 0x99, 0x34, 0xf3, 0x27, 0xda, 0xad, 0x4f, 0x20, 0xf8, 0x18, 0xae, 0xfb, 0x0e, 0x2e, 0x0b, - 0x6e, 0x5c, 0x4a, 0xeb, 0x83, 0x48, 0x33, 0x45, 0x17, 0xad, 0x88, 0xcb, 0x39, 0x67, 0xce, 0xc7, - 0xe1, 0x3f, 0xf8, 0x50, 0x05, 0x23, 0x97, 0x66, 0x94, 0x47, 0x6e, 0xd6, 0xf2, 0x19, 0xd0, 0x96, - 0x3b, 0x49, 0x59, 0x32, 0x75, 0xe2, 0x44, 0x82, 0x24, 0xbb, 0x2a, 0x18, 0x39, 0xb9, 0xed, 0xac, - 0x6d, 0xf3, 0x20, 0x94, 0x32, 0x8c, 0x98, 0x4b, 0x63, 0xee, 0x52, 0x21, 0x24, 0x50, 0xe0, 0x52, - 0x28, 0x1d, 0x30, 0xcd, 0x4d, 0x1e, 0xdc, 0x69, 0xaf, 0x76, 0x8c, 0x8f, 0xae, 0x56, 0xec, 0x7e, - 0xea, 0x8f, 0x39, 0x00, 0x0b, 0x7a, 0x91, 0xf4, 0xfb, 0x40, 0x21, 0x55, 0x1e, 0x9b, 0xa4, 0x4c, - 0x41, 0x6d, 0x86, 0xb0, 0xfd, 0xfd, 0x1f, 0x15, 0x4b, 0xa1, 0x18, 0x71, 0x70, 0x39, 0xa1, 0x22, - 0x64, 0x06, 0xb2, 0x51, 0xe3, 0x5f, 0xdb, 0x70, 0x36, 0x4a, 0x3a, 0xde, 0xca, 0xf7, 0xf4, 0x37, - 0xb2, 0x8f, 0x2b, 0x2a, 0x27, 0x18, 0x45, 0x1b, 0x35, 0xfe, 0x7a, 0xeb, 0x17, 0xa9, 0xe3, 0xff, - 0x71, 0x22, 0x33, 0x26, 0x06, 0x43, 0xc6, 0xc3, 0x21, 0x18, 0x7f, 0x6c, 0xd4, 0x28, 0x79, 0x55, - 0x2d, 0x5e, 0xe6, 0x1a, 0x39, 0xc1, 0x3b, 0x99, 0x04, 0x2e, 0xc2, 0x01, 0x13, 0x81, 0x1a, 0x50, - 0x30, 0x4a, 0x39, 0xa4, 0xaa, 0xd5, 0x0b, 0x11, 0xa8, 0x2e, 0xb4, 0x67, 0x08, 0x97, 0xf3, 0xde, - 0xe4, 0x09, 0xe1, 0xbd, 0x2d, 0xe5, 0x49, 0x7b, 0x4b, 0xcb, 0x1f, 0xae, 0x61, 0x76, 0x7e, 0x95, - 0xd1, 0xd7, 0xa9, 0x9d, 0xdf, 0xbf, 0xbc, 0x3f, 0x16, 0x4f, 0x49, 0x5d, 0xcf, 0xe0, 0x47, 0xd2, - 0xff, 0x9c, 0x42, 0xe5, 0xb9, 0xaf, 0x50, 0xaf, 0xfb, 0xbc, 0xb0, 0xd0, 0x7c, 0x61, 0xa1, 0xb7, - 0x85, 0x85, 0x1e, 0x96, 0x56, 0x61, 0xbe, 0xb4, 0x0a, 0xaf, 0x4b, 0xab, 0x70, 0x7d, 0x16, 0x72, - 0x18, 0xa6, 0xbe, 0x73, 0x23, 0xc7, 0x6e, 0xc6, 0xe1, 0x96, 0x83, 0xe6, 0x35, 0x03, 0xda, 0x1c, - 0xcb, 0x20, 0x8d, 0x98, 0x0b, 0xd3, 0x98, 0x29, 0xbf, 0x92, 0x8f, 0xdb, 0xf9, 0x08, 0x00, 0x00, - 0xff, 0xff, 0x37, 0x72, 0x2f, 0x8e, 0x4a, 0x02, 0x00, 0x00, + proto.RegisterType((*QuerySubmittedBlobStatusRequest)(nil), "cada.v1beta1.QuerySubmittedBlobStatusRequest") + proto.RegisterType((*QuerySubmittedBlobStatusResponse)(nil), "cada.v1beta1.QuerySubmittedBlobStatusResponse") +} + +func init() { proto.RegisterFile("cada/v1beta1/query.proto", fileDescriptor_0579d66f58f8318a) } + +var fileDescriptor_0579d66f58f8318a = []byte{ + // 361 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x51, 0xcd, 0x4a, 0xeb, 0x40, + 0x14, 0xee, 0xf4, 0xb6, 0x85, 0x3b, 0xb7, 0xf7, 0x2e, 0xa6, 0x5c, 0x09, 0x45, 0x62, 0x6c, 0x15, + 0x2a, 0xd2, 0x0c, 0xad, 0x4f, 0x60, 0x41, 0xe8, 0xd6, 0x74, 0xe7, 0xa6, 0x4c, 0x9a, 0x21, 0x1d, + 0x48, 0x67, 0xd2, 0xcc, 0x49, 0x6c, 0xb7, 0x3e, 0x81, 0xe0, 0x13, 0xb8, 0x76, 0xe3, 0x63, 0xb8, + 0x2c, 0xb8, 0x71, 0x29, 0xad, 0x0f, 0x22, 0xcd, 0x14, 0xb5, 0xa0, 0xe8, 0xf2, 0x7c, 0x7f, 0x7c, + 0x7c, 0x07, 0x5b, 0x23, 0x16, 0x30, 0x9a, 0x75, 0x7c, 0x0e, 0xac, 0x43, 0xa7, 0x29, 0x4f, 0xe6, + 0x6e, 0x9c, 0x28, 0x50, 0xa4, 0xba, 0x66, 0xdc, 0x0d, 0x53, 0xdf, 0x0d, 0x95, 0x0a, 0x23, 0x4e, + 0x59, 0x2c, 0x28, 0x93, 0x52, 0x01, 0x03, 0xa1, 0xa4, 0x36, 0xda, 0xfa, 0xff, 0xad, 0x14, 0x98, + 0x19, 0xb8, 0xb1, 0x8f, 0xf7, 0xce, 0xd7, 0x89, 0x83, 0xd4, 0x9f, 0x08, 0x00, 0x1e, 0xf4, 0x22, + 0xe5, 0x0f, 0x80, 0x41, 0xaa, 0x3d, 0x3e, 0x4d, 0xb9, 0x86, 0xc6, 0x3d, 0xc2, 0xce, 0xd7, 0x1a, + 0x1d, 0x2b, 0xa9, 0x39, 0x39, 0xc2, 0xe5, 0x84, 0xc9, 0x90, 0x5b, 0xc8, 0x41, 0xad, 0x3f, 0xdd, + 0x9a, 0xfb, 0xb1, 0x9a, 0xeb, 0xad, 0x29, 0xcf, 0x28, 0xc8, 0x0e, 0xae, 0xe8, 0xdc, 0x6c, 0x15, + 0x1d, 0xd4, 0xfa, 0xed, 0x6d, 0x2e, 0xd2, 0xc4, 0x7f, 0xe3, 0x44, 0x65, 0x5c, 0x0e, 0xc7, 0x5c, + 0x84, 0x63, 0xb0, 0x7e, 0x39, 0xa8, 0x55, 0xf2, 0xaa, 0x06, 0xec, 0xe7, 0x18, 0x39, 0xc0, 0xff, + 0x32, 0x05, 0x42, 0x86, 0x43, 0x2e, 0x03, 0x3d, 0x64, 0x60, 0x95, 0xf2, 0x90, 0xaa, 0x41, 0xcf, + 0x64, 0xa0, 0x4f, 0xa1, 0x7b, 0x87, 0x70, 0x39, 0xaf, 0x4c, 0x6e, 0x11, 0xae, 0x7d, 0xd2, 0x9b, + 0xb4, 0xb7, 0x0b, 0x7e, 0xb3, 0x41, 0xdd, 0xfd, 0xa9, 0xdc, 0xcc, 0xd1, 0x38, 0xbe, 0x7a, 0x7c, + 0xb9, 0x29, 0x1e, 0x92, 0x26, 0x65, 0x19, 0x13, 0x91, 0x1f, 0x29, 0xff, 0x6d, 0x7b, 0x9d, 0xfb, + 0xde, 0x4d, 0xbd, 0xfe, 0xc3, 0xd2, 0x46, 0x8b, 0xa5, 0x8d, 0x9e, 0x97, 0x36, 0xba, 0x5e, 0xd9, + 0x85, 0xc5, 0xca, 0x2e, 0x3c, 0xad, 0xec, 0xc2, 0x85, 0x1b, 0x0a, 0x18, 0xa7, 0xbe, 0x3b, 0x52, + 0x13, 0x9a, 0x09, 0xb8, 0x14, 0x60, 0xf2, 0xda, 0x01, 0x6b, 0x4f, 0x54, 0x90, 0x46, 0x9c, 0xce, + 0x68, 0xfe, 0x58, 0x98, 0xc7, 0x5c, 0xfb, 0x95, 0xfc, 0xa9, 0x27, 0xaf, 0x01, 0x00, 0x00, 0xff, + 0xff, 0xaa, 0x41, 0x02, 0xee, 0x33, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -202,7 +202,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) SubmittedBlobStatus(ctx context.Context, in *QuerySubmittedBlobStatusRequest, opts ...grpc.CallOption) (*QuerySubmittedBlobStatusResponse, error) { out := new(QuerySubmittedBlobStatusResponse) - err := c.cc.Invoke(ctx, "/sdk.avail.v1beta1.Query/SubmittedBlobStatus", in, out, opts...) + err := c.cc.Invoke(ctx, "/cada.v1beta1.Query/SubmittedBlobStatus", in, out, opts...) if err != nil { return nil, err } @@ -237,7 +237,7 @@ func _Query_SubmittedBlobStatus_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/sdk.avail.v1beta1.Query/SubmittedBlobStatus", + FullMethod: "/cada.v1beta1.Query/SubmittedBlobStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).SubmittedBlobStatus(ctx, req.(*QuerySubmittedBlobStatusRequest)) @@ -246,7 +246,7 @@ func _Query_SubmittedBlobStatus_Handler(srv interface{}, ctx context.Context, de } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "sdk.avail.v1beta1.Query", + ServiceName: "cada.v1beta1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -255,7 +255,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "sdk/avail/v1beta1/query.proto", + Metadata: "cada/v1beta1/query.proto", } func (m *QuerySubmittedBlobStatusRequest) Marshal() (dAtA []byte, err error) { diff --git a/types/query.pb.gw.go b/x/cada/types/query.pb.gw.go similarity index 99% rename from types/query.pb.gw.go rename to x/cada/types/query.pb.gw.go index 5c782c5..800b835 100644 --- a/types/query.pb.gw.go +++ b/x/cada/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: sdk/avail/v1beta1/query.proto +// source: cada/v1beta1/query.proto /* Package types is a reverse proxy. diff --git a/types/tx.pb.go b/x/cada/types/tx.pb.go similarity index 85% rename from types/tx.pb.go rename to x/cada/types/tx.pb.go index 92419f8..842cda0 100644 --- a/types/tx.pb.go +++ b/x/cada/types/tx.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: sdk/avail/v1beta1/tx.proto +// source: cada/v1beta1/tx.proto package types @@ -62,7 +62,7 @@ func (x BlobStatus) String() string { } func (BlobStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_7f88203cb33986bc, []int{0} + return fileDescriptor_c917a06c648c4256, []int{0} } // Range defines the range of blocks for which the blob is being submitted. @@ -77,7 +77,7 @@ func (m *Range) Reset() { *m = Range{} } func (m *Range) String() string { return proto.CompactTextString(m) } func (*Range) ProtoMessage() {} func (*Range) Descriptor() ([]byte, []int) { - return fileDescriptor_7f88203cb33986bc, []int{0} + return fileDescriptor_c917a06c648c4256, []int{0} } func (m *Range) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -136,7 +136,7 @@ func (m *MsgUpdateBlobStatusRequest) Reset() { *m = MsgUpdateBlobStatusR func (m *MsgUpdateBlobStatusRequest) String() string { return proto.CompactTextString(m) } func (*MsgUpdateBlobStatusRequest) ProtoMessage() {} func (*MsgUpdateBlobStatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7f88203cb33986bc, []int{1} + return fileDescriptor_c917a06c648c4256, []int{1} } func (m *MsgUpdateBlobStatusRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -201,7 +201,7 @@ func (m *MsgUpdateBlobStatusResponse) Reset() { *m = MsgUpdateBlobStatus func (m *MsgUpdateBlobStatusResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateBlobStatusResponse) ProtoMessage() {} func (*MsgUpdateBlobStatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_7f88203cb33986bc, []int{2} + return fileDescriptor_c917a06c648c4256, []int{2} } func (m *MsgUpdateBlobStatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -231,45 +231,45 @@ func (m *MsgUpdateBlobStatusResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateBlobStatusResponse proto.InternalMessageInfo func init() { - proto.RegisterEnum("sdk.avail.v1beta1.BlobStatus", BlobStatus_name, BlobStatus_value) - proto.RegisterType((*Range)(nil), "sdk.avail.v1beta1.Range") - proto.RegisterType((*MsgUpdateBlobStatusRequest)(nil), "sdk.avail.v1beta1.MsgUpdateBlobStatusRequest") - proto.RegisterType((*MsgUpdateBlobStatusResponse)(nil), "sdk.avail.v1beta1.MsgUpdateBlobStatusResponse") + proto.RegisterEnum("cada.v1beta1.BlobStatus", BlobStatus_name, BlobStatus_value) + proto.RegisterType((*Range)(nil), "cada.v1beta1.Range") + proto.RegisterType((*MsgUpdateBlobStatusRequest)(nil), "cada.v1beta1.MsgUpdateBlobStatusRequest") + proto.RegisterType((*MsgUpdateBlobStatusResponse)(nil), "cada.v1beta1.MsgUpdateBlobStatusResponse") } -func init() { proto.RegisterFile("sdk/avail/v1beta1/tx.proto", fileDescriptor_7f88203cb33986bc) } +func init() { proto.RegisterFile("cada/v1beta1/tx.proto", fileDescriptor_c917a06c648c4256) } -var fileDescriptor_7f88203cb33986bc = []byte{ +var fileDescriptor_c917a06c648c4256 = []byte{ // 467 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcf, 0x6e, 0xd3, 0x40, - 0x10, 0xc6, 0xbd, 0x49, 0x8a, 0xe8, 0xa6, 0x42, 0xee, 0x82, 0x48, 0xe4, 0xaa, 0x56, 0xc9, 0x85, - 0x2a, 0x55, 0x6c, 0xa5, 0xdc, 0xe0, 0x94, 0xa4, 0x2e, 0x44, 0x6a, 0x43, 0x65, 0xd7, 0x17, 0x2e, - 0xd6, 0xda, 0x5e, 0x1c, 0x2b, 0x76, 0x37, 0xf5, 0xac, 0xcd, 0x9f, 0x0b, 0x88, 0x13, 0x47, 0xde, - 0x81, 0x17, 0xe8, 0x63, 0x70, 0xec, 0x91, 0x63, 0x95, 0x1c, 0xfa, 0x1a, 0xc8, 0x6b, 0x04, 0x28, - 0x2d, 0x52, 0x4f, 0x3b, 0xfa, 0x7d, 0x9f, 0x76, 0xbe, 0xd9, 0x1d, 0xac, 0x41, 0x38, 0x33, 0x69, - 0x41, 0xe3, 0xc4, 0x2c, 0xfa, 0x3e, 0x13, 0xb4, 0x6f, 0x8a, 0xf7, 0xc6, 0x3c, 0xe3, 0x82, 0x93, - 0x4d, 0x08, 0x67, 0x86, 0xd4, 0x8c, 0xdf, 0x9a, 0xd6, 0x0a, 0x38, 0xa4, 0x1c, 0xcc, 0x14, 0x22, - 0xb3, 0xe8, 0x97, 0x47, 0xe5, 0xd5, 0x1e, 0x45, 0x3c, 0xe2, 0xb2, 0x34, 0xcb, 0xaa, 0xa2, 0x9d, - 0x3d, 0xbc, 0x66, 0xd3, 0xb3, 0x88, 0x11, 0x82, 0x1b, 0x6f, 0x33, 0x9e, 0xb6, 0xd1, 0x0e, 0xda, - 0x6d, 0xd8, 0xb2, 0x26, 0x0f, 0x70, 0x4d, 0xf0, 0x76, 0x4d, 0x92, 0x9a, 0xe0, 0x9d, 0x2b, 0x84, - 0xb5, 0x63, 0x88, 0xdc, 0x79, 0x48, 0x05, 0x1b, 0x26, 0xdc, 0x77, 0x04, 0x15, 0x39, 0xd8, 0xec, - 0x3c, 0x67, 0x20, 0xc8, 0x1e, 0xde, 0x2c, 0x68, 0x12, 0x87, 0x54, 0xf0, 0xcc, 0xa3, 0x61, 0x98, - 0x31, 0x00, 0x79, 0xdf, 0xba, 0xad, 0xfe, 0x11, 0x06, 0x15, 0x27, 0x2f, 0xf0, 0x86, 0x9f, 0xf0, - 0x60, 0x06, 0x5e, 0x56, 0xf6, 0x97, 0x5d, 0x9a, 0xfb, 0x6d, 0xe3, 0xc6, 0x44, 0x86, 0xcc, 0x67, - 0x37, 0x2b, 0x77, 0x15, 0xf6, 0x09, 0xde, 0x90, 0x1e, 0x6f, 0xca, 0xe2, 0x68, 0x2a, 0xda, 0x75, - 0x19, 0xb1, 0x29, 0xd9, 0x2b, 0x89, 0xc8, 0x36, 0xc6, 0x31, 0x78, 0x90, 0x07, 0x41, 0x99, 0xa2, - 0xb1, 0x83, 0x76, 0xef, 0xdb, 0xeb, 0x31, 0x38, 0x15, 0x78, 0xfe, 0xf8, 0xcb, 0xf5, 0x45, 0xf7, - 0x66, 0xdc, 0xce, 0x36, 0xde, 0xba, 0x75, 0x42, 0x98, 0xf3, 0x33, 0x60, 0xdd, 0x8f, 0x18, 0xff, - 0xa5, 0x64, 0x0b, 0xb7, 0x86, 0x47, 0xaf, 0x87, 0x9e, 0x73, 0x3a, 0x38, 0x75, 0x1d, 0xcf, 0x9d, - 0x38, 0x27, 0xd6, 0x68, 0x7c, 0x38, 0xb6, 0x0e, 0x54, 0x85, 0xb4, 0xf0, 0xc3, 0x7f, 0xc5, 0xc3, - 0xc1, 0xf8, 0xc8, 0xb5, 0x2d, 0x15, 0xad, 0x0a, 0x8e, 0x3b, 0x1a, 0x59, 0x8e, 0xa3, 0xd6, 0x56, - 0x85, 0x13, 0x6b, 0x72, 0x30, 0x9e, 0xbc, 0x54, 0xeb, 0x5a, 0xe3, 0xeb, 0x77, 0x5d, 0xd9, 0xff, - 0x84, 0xeb, 0xc7, 0x10, 0x91, 0x73, 0xac, 0xae, 0xc6, 0x23, 0xbd, 0x5b, 0x9e, 0xed, 0xff, 0x1f, - 0xa5, 0x19, 0x77, 0xb5, 0x57, 0x53, 0x6b, 0x6b, 0x9f, 0xaf, 0x2f, 0xba, 0x68, 0x38, 0xf8, 0xb1, - 0xd0, 0xd1, 0xe5, 0x42, 0x47, 0x57, 0x0b, 0x1d, 0x7d, 0x5b, 0xea, 0xca, 0xe5, 0x52, 0x57, 0x7e, - 0x2e, 0x75, 0xe5, 0xcd, 0xd3, 0x28, 0x16, 0xd3, 0xdc, 0x37, 0x02, 0x9e, 0x9a, 0x45, 0x2c, 0xde, - 0xc5, 0xa2, 0xda, 0xd8, 0x5e, 0x48, 0x7b, 0x29, 0x0f, 0xf3, 0x84, 0x99, 0xe2, 0xc3, 0x9c, 0x81, - 0x7f, 0x4f, 0x6e, 0xdd, 0xb3, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf5, 0x5d, 0xb6, 0xfa, 0xd5, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xc7, 0x7d, 0x49, 0x8a, 0xe8, 0x25, 0x42, 0xe6, 0x0a, 0x24, 0x72, 0x55, 0xab, 0x64, 0x0a, + 0xa9, 0xea, 0x53, 0x8a, 0xc4, 0xc0, 0x96, 0xa4, 0x2e, 0x8d, 0xd4, 0x86, 0xca, 0xae, 0x17, 0x16, + 0xeb, 0x6c, 0x1f, 0x17, 0x0b, 0xbb, 0x17, 0x7c, 0x67, 0x53, 0x98, 0x10, 0x13, 0x23, 0xdf, 0x81, + 0x2f, 0xd0, 0x8f, 0xc1, 0xd8, 0x11, 0x89, 0x05, 0x25, 0x43, 0xbf, 0x06, 0xf2, 0x19, 0x41, 0x09, + 0x20, 0x75, 0xf2, 0xd3, 0xef, 0xff, 0xe4, 0xf7, 0xff, 0xdf, 0x7b, 0xf0, 0x7e, 0x48, 0x22, 0x82, + 0x8b, 0x41, 0x40, 0x25, 0x19, 0x60, 0x79, 0x6e, 0xcd, 0x33, 0x2e, 0x39, 0x6a, 0x95, 0xd8, 0xfa, + 0x89, 0x8d, 0x76, 0xc8, 0x45, 0xca, 0x05, 0x4e, 0x05, 0xc3, 0xc5, 0xa0, 0xfc, 0x54, 0x6d, 0xc6, + 0x3d, 0xc6, 0x19, 0x57, 0x25, 0x2e, 0xab, 0x8a, 0x76, 0x77, 0xe0, 0x9a, 0x43, 0xce, 0x18, 0x45, + 0x08, 0x36, 0x5e, 0x66, 0x3c, 0xed, 0x80, 0x6d, 0xd0, 0x6b, 0x38, 0xaa, 0x46, 0x77, 0x60, 0x4d, + 0xf2, 0x4e, 0x4d, 0x91, 0x9a, 0xe4, 0xdd, 0x6f, 0x00, 0x1a, 0xc7, 0x82, 0x79, 0xf3, 0x88, 0x48, + 0x3a, 0x4a, 0x78, 0xe0, 0x4a, 0x22, 0x73, 0xe1, 0xd0, 0xd7, 0x39, 0x15, 0x12, 0xed, 0xc0, 0xbb, + 0x05, 0x49, 0xe2, 0x88, 0x48, 0x9e, 0xf9, 0x24, 0x8a, 0x32, 0x2a, 0x84, 0xfa, 0xdf, 0xba, 0xa3, + 0xff, 0x12, 0x86, 0x15, 0x47, 0x4f, 0x60, 0x2b, 0x48, 0x78, 0xf8, 0x4a, 0xf8, 0x59, 0x39, 0x5f, + 0x4d, 0x69, 0xee, 0x6d, 0x58, 0xd7, 0xc3, 0x58, 0xca, 0x9a, 0xd3, 0xac, 0x1a, 0x2b, 0x9f, 0x0f, + 0x61, 0x8b, 0x14, 0x24, 0x4e, 0xfc, 0x19, 0x8d, 0xd9, 0x4c, 0x76, 0xea, 0xca, 0x5d, 0x53, 0xb1, + 0x43, 0x85, 0xd0, 0x16, 0x84, 0xb1, 0xf0, 0x45, 0x1e, 0x86, 0xa5, 0x81, 0xc6, 0x36, 0xe8, 0xdd, + 0x76, 0xd6, 0x63, 0xe1, 0x56, 0xe0, 0xe9, 0x83, 0x0f, 0x57, 0x17, 0xfd, 0xbf, 0x9d, 0x76, 0xb7, + 0xe0, 0xe6, 0x3f, 0xc3, 0x89, 0x39, 0x3f, 0x13, 0xb4, 0xff, 0x0e, 0xc2, 0xdf, 0x14, 0x6d, 0xc2, + 0xf6, 0xe8, 0xe8, 0xf9, 0xc8, 0x77, 0x4f, 0x87, 0xa7, 0x9e, 0xeb, 0x7b, 0x53, 0xf7, 0xc4, 0x1e, + 0x4f, 0x0e, 0x26, 0xf6, 0xbe, 0xae, 0xa1, 0x36, 0xdc, 0xb8, 0x2e, 0x1e, 0x0c, 0x27, 0x47, 0x9e, + 0x63, 0xeb, 0x60, 0x55, 0x70, 0xbd, 0xf1, 0xd8, 0x76, 0x5d, 0xbd, 0xb6, 0x2a, 0x9c, 0xd8, 0xd3, + 0xfd, 0xc9, 0xf4, 0x99, 0x5e, 0x37, 0x1a, 0x1f, 0x3f, 0x9b, 0xda, 0x5e, 0x0e, 0xeb, 0xc7, 0x82, + 0x21, 0x06, 0xf5, 0x55, 0x7b, 0xa8, 0xf7, 0xe7, 0x8b, 0xfd, 0x7f, 0x3d, 0xc6, 0xa3, 0x1b, 0x74, + 0x56, 0x59, 0x8d, 0xb5, 0xf7, 0x57, 0x17, 0x7d, 0x30, 0x3a, 0xfc, 0xb2, 0x30, 0xc1, 0xe5, 0xc2, + 0x04, 0xdf, 0x17, 0x26, 0xf8, 0xb4, 0x34, 0xb5, 0xcb, 0xa5, 0xa9, 0x7d, 0x5d, 0x9a, 0xda, 0x0b, + 0x8b, 0xc5, 0x72, 0x96, 0x07, 0x56, 0xc8, 0x53, 0x5c, 0xc4, 0xf2, 0x4d, 0x2c, 0xb1, 0xda, 0xc0, + 0x6e, 0x44, 0x76, 0x53, 0x1e, 0xe5, 0x09, 0xc5, 0xe7, 0x58, 0x9d, 0xab, 0x7c, 0x3b, 0xa7, 0x22, + 0xb8, 0xa5, 0xae, 0xed, 0xf1, 0x8f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x30, 0x43, 0x13, 0x63, 0xc3, 0x02, 0x00, 0x00, } @@ -299,7 +299,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) UpdateBlobStatus(ctx context.Context, in *MsgUpdateBlobStatusRequest, opts ...grpc.CallOption) (*MsgUpdateBlobStatusResponse, error) { out := new(MsgUpdateBlobStatusResponse) - err := c.cc.Invoke(ctx, "/sdk.avail.v1beta1.Msg/UpdateBlobStatus", in, out, opts...) + err := c.cc.Invoke(ctx, "/cada.v1beta1.Msg/UpdateBlobStatus", in, out, opts...) if err != nil { return nil, err } @@ -334,7 +334,7 @@ func _Msg_UpdateBlobStatus_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/sdk.avail.v1beta1.Msg/UpdateBlobStatus", + FullMethod: "/cada.v1beta1.Msg/UpdateBlobStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).UpdateBlobStatus(ctx, req.(*MsgUpdateBlobStatusRequest)) @@ -343,7 +343,7 @@ func _Msg_UpdateBlobStatus_Handler(srv interface{}, ctx context.Context, dec fun } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "sdk.avail.v1beta1.Msg", + ServiceName: "cada.v1beta1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ { @@ -352,7 +352,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "sdk/avail/v1beta1/tx.proto", + Metadata: "cada/v1beta1/tx.proto", } func (m *Range) Marshal() (dAtA []byte, err error) { diff --git a/types/validator.pb.go b/x/cada/types/validator.pb.go similarity index 100% rename from types/validator.pb.go rename to x/cada/types/validator.pb.go diff --git a/types/vote_extensions.pb.go b/x/cada/types/vote_extensions.pb.go similarity index 83% rename from types/vote_extensions.pb.go rename to x/cada/types/vote_extensions.pb.go index 6601e17..2b0628d 100644 --- a/types/vote_extensions.pb.go +++ b/x/cada/types/vote_extensions.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: sdk/avail/v1beta1/vote_extensions.proto +// source: cada/v1beta1/vote_extensions.proto package types @@ -34,7 +34,7 @@ func (m *AvailVoteExtension) Reset() { *m = AvailVoteExtension{} } func (m *AvailVoteExtension) String() string { return proto.CompactTextString(m) } func (*AvailVoteExtension) ProtoMessage() {} func (*AvailVoteExtension) Descriptor() ([]byte, []int) { - return fileDescriptor_007bc07f2f11afa0, []int{0} + return fileDescriptor_194cb859e020afeb, []int{0} } func (m *AvailVoteExtension) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -78,29 +78,29 @@ func (m *AvailVoteExtension) GetRange() *Range { } func init() { - proto.RegisterType((*AvailVoteExtension)(nil), "sdk.avail.v1beta1.AvailVoteExtension") + proto.RegisterType((*AvailVoteExtension)(nil), "cada.v1beta1.AvailVoteExtension") } func init() { - proto.RegisterFile("sdk/avail/v1beta1/vote_extensions.proto", fileDescriptor_007bc07f2f11afa0) + proto.RegisterFile("cada/v1beta1/vote_extensions.proto", fileDescriptor_194cb859e020afeb) } -var fileDescriptor_007bc07f2f11afa0 = []byte{ - // 221 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2f, 0x4e, 0xc9, 0xd6, - 0x4f, 0x2c, 0x4b, 0xcc, 0xcc, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xcb, - 0x2f, 0x49, 0x8d, 0x4f, 0xad, 0x28, 0x49, 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0x2b, 0xd6, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x2c, 0x4e, 0xc9, 0xd6, 0x03, 0x2b, 0xd4, 0x83, 0x2a, 0x94, 0x92, - 0xc2, 0xd4, 0x5b, 0x52, 0x01, 0x51, 0xae, 0x94, 0xce, 0x25, 0xe4, 0x08, 0x92, 0x09, 0xcb, 0x2f, - 0x49, 0x75, 0x85, 0x99, 0x25, 0xa4, 0xc8, 0xc5, 0x03, 0x56, 0x1f, 0x9f, 0x91, 0x9a, 0x99, 0x9e, - 0x51, 0x22, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x1c, 0xc4, 0x0d, 0x16, 0xf3, 0x00, 0x0b, 0x09, 0xe9, - 0x71, 0xb1, 0x16, 0x25, 0xe6, 0xa5, 0xa7, 0x4a, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x1b, 0x49, 0xe8, - 0x61, 0xd8, 0xab, 0x17, 0x04, 0x92, 0x0f, 0x82, 0x28, 0x73, 0x72, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, - 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, - 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xf5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, - 0x5c, 0xfd, 0xb2, 0xcc, 0x92, 0xf2, 0xcc, 0x12, 0x88, 0x63, 0x75, 0x53, 0x12, 0x75, 0x73, 0xf3, - 0x53, 0x4a, 0x73, 0x52, 0xf5, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x4e, 0x36, 0x06, - 0x04, 0x00, 0x00, 0xff, 0xff, 0x54, 0x29, 0xaf, 0xb7, 0x0c, 0x01, 0x00, 0x00, +var fileDescriptor_194cb859e020afeb = []byte{ + // 220 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0x4e, 0x4c, 0x49, + 0xd4, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xcb, 0x2f, 0x49, 0x8d, 0x4f, 0xad, + 0x28, 0x49, 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0x2b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, + 0x01, 0xa9, 0xd1, 0x83, 0xaa, 0x91, 0x12, 0x45, 0xd1, 0x51, 0x52, 0x01, 0x51, 0xa4, 0x94, 0xc4, + 0x25, 0xe4, 0x58, 0x96, 0x98, 0x99, 0x13, 0x96, 0x5f, 0x92, 0xea, 0x0a, 0x33, 0x41, 0x48, 0x91, + 0x8b, 0x27, 0x11, 0x24, 0x1a, 0x9f, 0x91, 0x9a, 0x99, 0x9e, 0x51, 0x22, 0xc1, 0xa8, 0xc0, 0xa8, + 0xc1, 0x1c, 0xc4, 0x0d, 0x16, 0xf3, 0x00, 0x0b, 0x09, 0x69, 0x72, 0xb1, 0x16, 0x25, 0xe6, 0xa5, + 0xa7, 0x4a, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x1b, 0x09, 0xeb, 0x21, 0xdb, 0xa6, 0x17, 0x04, 0x92, + 0x0a, 0x82, 0xa8, 0x70, 0xf2, 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, + 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, + 0xbd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xb2, 0xcc, 0x92, 0xf2, + 0xcc, 0x12, 0x7d, 0xb0, 0x1d, 0xba, 0x29, 0x89, 0xba, 0xb9, 0xf9, 0x29, 0xa5, 0x39, 0xa9, 0xfa, + 0x15, 0xfa, 0x60, 0x87, 0x97, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x6d, 0x0c, 0x08, + 0x00, 0x00, 0xff, 0xff, 0x62, 0x70, 0xd4, 0x80, 0xff, 0x00, 0x00, 0x00, } func (m *AvailVoteExtension) Marshal() (dAtA []byte, err error) {