Code Monkey home page Code Monkey logo

desmos-contracts's People

Contributors

dadamu avatar dependabot[bot] avatar leobragaz avatar manu0466 avatar riccardom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

desmos-contracts's Issues

POAP: Clarification Needed in poap-contract README.md

Feature description

While reading the README.md of the poap-contract, I noticed a potential discrepancy in the description. Specifically, the line 3 states that the contract "allows users who has a Desmos profile to mint POAP nft via cw721-poap contract". However, it appears that there is no actual validation in this contract to verify the Desmos profile of the users. Moreover, as per the ADR-002, it seems that the user profile validation is handled by the POAP manager.

Implementation proposal

I propose to review and revise the README.md of the poap-contract. The language should reflect the actual operations and validations performed by the contract. If the user profile validation is handled by the POAP manager as per ADR-002, then this fact should be fixed in the README to avoid confusion.

POAP: Possible Redundancies in Timestamp Validations

Feature description

There seem to be more checks on timestamps than necessary. Both in the Instantiate and Execute message validations, startTime is checked to be strictly less than endTime.
The necessity of this strict inequality (i.e., why startTime and endTime cannot be equal) is not clearly stated.

Moreover, during the execution of update_event_info (execute_update_event_info), it's checked that the event has not started and has not ended. However, it might be sufficient to just check if the event hasn't started, because if it has, the operation is no longer possible even if the event has not ended. While the second check could be left to enhance error understanding (i.e., the event has already started and ended), it might not be necessary.

On the other hand, in the Instantiate function, we are sure (due to validation) that endTime > startTime. So if startTime is greater than the current timestamp, endTime must also be greater. Therefore, this check might be redundant and not provide additional understanding in terms of error comprehension.

Implementation proposal

The validations in the Instantiate and Execute messages should be reviewed, specifically those relating to the comparison of startTime and endTime. The necessity of the strict inequality should be justified, or the validations should be modified to allow for startTime and endTime to be equal.

Also, it could be worthwhile to simplify the checks in execute_update_event_info to just verify whether the event has started, if no further clarification for error understanding is needed.

Lastly, the check in Instantiate where startTime > current timestamp guarantees endTime > current timestamp value. For this reason, the latter seems superfluous and could be removed without negatively impacting error comprehension. This change could simplify the logic and make the code more concise.

POAP: Possible Oversight in README Regarding MintTo Function

Feature description

It seems there might be a discrepancy in the poap contract README specifically in the description of the MintTo function

### MintTo
Allows the minter to mint a POAP token to a recipient in the event period if the contract enables mint. This message has the following parameter:
In the code, MintTo calls the execute_mint() function, passing the check_authorized_to_mint parameter as true. Therefore, it performs the following check:
// Check if who is performing the action is the minter
if check_authorized_to_mint && info.sender != config.minter && info.sender != config.admin {
return Err(ContractError::Unauthorized {});
}

Thus, both the admin and the minter can mint a token, contradicting the README, which states that "the minter can mint a POAP token if the contract enables mint". Moreover, the minter and the admin are able to mint the token even if the "mint is not enabled".
// Check if the mint is enabled
if !bypass_mint_enable && !config.mint_enabled {
return Err(ContractError::MintDisabled {});
}

Implementation proposal

The README should correctly reflect the code's functionality. In this case, it should clarify that both the admin and the minter are able to mint a token and that they bypass the mint_enabled check.

Use trait to split the querier for the modules

To split queriers by modules, applying trait would be a proper way to have more scalability, which is similar as golang interface.
With it, we can build mock libraries in the each module packages.

The sample is as follows:

pub trait SubspacesQuerier {
    fn query_subspaces(&self, pagination: Option<PageRequest>) ->  StdResult<QuerySubspacesResponse>;
    fn query_subspace(&self, subspace_id: u64) -> StdResult<QuerySubspaceResponse>;
    ...
}

impl <'a> SubspacesQuerier for DesmosQuerier<'a> {
    fn query_subspaces(&self, pagination: Option<PageRequest>) ->  StdResult<QuerySubspacesResponse>{
        ...implement code
    }
    fn query_subspace(&self, subspace_id: u64) -> StdResult<QuerySubspaceResponse>{
        ...implement code
    }
}

Query from contract halt the chain

I tried to perform a custom query to the desmos chain through a contract but it ends with chain stopped and this error:

thread '<unnamed>' panicked at 'rwlock read lock would result in deadlock', /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/sys/unix/rwlock.rs:47:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal error: exitsyscall: syscall frame is no longer valid

goroutine 30 [running, locked to thread]:
runtime.throw(0x5a1ea28, 0x2d)
	runtime/panic.go:1116 +0x72 fp=0xc003891ef8 sp=0xc003891ec8 pc=0x403bb52
runtime.exitsyscall()
	runtime/proc.go:3233 +0x22c fp=0xc003891f28 sp=0xc003891ef8 pc=0x406f2ac
runtime.cgocall(0x55dfcb0, 0xc003892008, 0x3200000000000000)
	runtime/cgocall.go:152 +0x9e fp=0xc003891f60 sp=0xc003891f28 pc=0x400855e
github.com/CosmWasm/wasmvm/api._C2func_query(0x8106680, 0x8004600, 0x20, 0x20, 0x8004700, 0x9f, 0x9f, 0x8004620, 0x2b, 0x2b, ...)
	_cgo_gotypes.go:372 +0x75 fp=0xc003892008 sp=0xc003891f60 pc=0x53877b5
github.com/CosmWasm/wasmvm/api.Query.func1(0x8106680, 0x8004600, 0x20, 0x20, 0x8004700, 0x9f, 0x9f, 0x8004620, 0x2b, 0x2b, ...)
	github.com/CosmWasm/[email protected]/api/lib.go:231 +0x1e5 fp=0xc003892138 sp=0xc003892008 pc=0x538db65
github.com/CosmWasm/wasmvm/api.Query(0x8106680, 0xc0005db320, 0x20, 0x20, 0xc0013ca0a0, 0x9f, 0xa0, 0xc0013ae570, 0x2b, 0x30, ...)
	github.com/CosmWasm/[email protected]/api/lib.go:231 +0x4d4 fp=0xc003892388 sp=0xc003892138 pc=0x538c714
github.com/CosmWasm/wasmvm.(*VM).Query(0xc000df2e00, 0xc0005db320, 0x20, 0x20, 0x7b, 0x60508417, 0xd2bfa90, 0xc000eda1f0, 0x9, 0xc0013ae8a0, ...)
	github.com/CosmWasm/[email protected]/lib.go:184 +0x265 fp=0xc0038924d8 sp=0xc003892388 pc=0x538f625
github.com/CosmWasm/wasmd/x/wasm/internal/keeper.Keeper.QuerySmart(0x5e4be20, 0xc0000d4190, 0x5e8bc20, 0xc0000ea430, 0x5e4be20, 0xc0004d7fe0, 0x5e86500, 0xc0000ea430, 0x5e86500, 0xc0000ea430, ...)
	github.com/CosmWasm/[email protected]/x/wasm/internal/keeper/keeper.go:460 +0x5d6 fp=0xc003893368 sp=0xc0038924d8 pc=0x5401516
github.com/CosmWasm/wasmd/x/wasm/internal/keeper.grpcQuerier.SmartContractState(0xc000ff7970, 0x5e6e6e0, 0xc0013c4330, 0xc0013c4360, 0x0, 0x0, 0x0)
	github.com/CosmWasm/[email protected]/x/wasm/internal/keeper/querier.go:177 +0x3a5 fp=0xc0038941a0 sp=0xc003893368 pc=0x540a8e5
github.com/CosmWasm/wasmd/x/wasm/internal/types._Query_SmartContractState_Handler(0x58a9360, 0xc000ff7970, 0x5e6e6e0, 0xc0013c4330, 0xc001132a50, 0x0, 0x5e6e6e0, 0xc0013c4330, 0x20, 0x20)
	github.com/CosmWasm/[email protected]/x/wasm/internal/types/query.pb.go:1227 +0x214 fp=0xc003894210 sp=0xc0038941a0 pc=0x53b1e74
github.com/cosmos/cosmos-sdk/baseapp.(*GRPCQueryRouter).RegisterService.func1(0x5e6e660, 0xc000040078, 0x5e85e80, 0xc001384cc0, 0xb, 0x0, 0xc000eda1f0, 0x9, 0x7b, 0xd2bfa90, ...)
	github.com/cosmos/[email protected]/baseapp/grpcrouter.go:92 +0x20c fp=0xc003894718 sp=0xc003894210 pc=0x4d9916c
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).handleQueryGRPC(0xc0000e71e0, 0xc0000d6980, 0xc000ef8180, 0x5c, 0xc0, 0xc0013ae000, 0x2f, 0x7b, 0x0, 0x0, ...)
	github.com/cosmos/[email protected]/baseapp/abci.go:562 +0x127 fp=0xc003894d90 sp=0xc003894718 pc=0x4d8dca7
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).Query(0xc0000e71e0, 0xc000ef8180, 0x5c, 0xc0, 0xc0013ae000, 0x2f, 0x7b, 0x0, 0x0, 0x0, ...)
	github.com/cosmos/[email protected]/baseapp/abci.go:406 +0x8ef fp=0xc003894ff8 sp=0xc003894d90 pc=0x4d8c5cf
github.com/tendermint/tendermint/abci/client.(*localClient).QuerySync(0xc0013bb380, 0xc000ef8180, 0x5c, 0xc0, 0xc0013ae000, 0x2f, 0x0, 0x0, 0x0, 0x0, ...)
	github.com/tendermint/[email protected]/abci/client/local_client.go:250 +0x10e fp=0xc003895168 sp=0xc003894ff8 pc=0x4a52aae
github.com/tendermint/tendermint/proxy.(*appConnQuery).QuerySync(0xc00059d1d0, 0xc000ef8180, 0x5c, 0xc0, 0xc0013ae000, 0x2f, 0x0, 0x0, 0x40df745, 0x56b8c80, ...)
	github.com/tendermint/[email protected]/proxy/app_conn.go:159 +0x68 fp=0xc0038951d0 sp=0xc003895168 pc=0x4a55ec8
github.com/tendermint/tendermint/rpc/core.ABCIQuery(0xc000e7c100, 0xc0013ae000, 0x2f, 0xc000ef8180, 0x5c, 0xc0, 0x0, 0x0, 0x0, 0x0, ...)
	github.com/tendermint/[email protected]/rpc/core/abci.go:20 +0x103 fp=0xc003895288 sp=0xc0038951d0 pc=0x4d0ac03
runtime.call128(0xc0013823f0, 0x5c407e0, 0xc000e7e4e0, 0x4000000058)
	runtime/asm_amd64.s:542 +0x59 fp=0xc003895318 sp=0xc003895288 pc=0x4072cd9
reflect.Value.call(0x57883c0, 0x5c407e0, 0x13, 0x59aaf1e, 0x4, 0xc001388180, 0x5, 0x5, 0xc001388198, 0xc000e7e480, ...)
	reflect/value.go:476 +0x8c7 fp=0xc003895530 sp=0xc003895318 pc=0x40d76c7
reflect.Value.Call(0x57883c0, 0x5c407e0, 0x13, 0xc001388180, 0x5, 0x5, 0x1, 0x5, 0x0)
	reflect/value.go:337 +0xb9 fp=0xc0038955b0 sp=0xc003895530 pc=0x40d6bb9
github.com/tendermint/tendermint/rpc/jsonrpc/server.makeJSONRPCHandler.func1(0x5e67ae0, 0xc000e7c060, 0xc0005be200)
	github.com/tendermint/[email protected]/rpc/jsonrpc/server/http_json_handler.go:100 +0xa05 fp=0xc003895948 sp=0xc0038955b0 pc=0x4b8b085
github.com/tendermint/tendermint/rpc/jsonrpc/server.handleInvalidJSONRPCPaths.func1(0x5e67ae0, 0xc000e7c060, 0xc0005be200)
	github.com/tendermint/[email protected]/rpc/jsonrpc/server/http_json_handler.go:124 +0x9c fp=0xc003895980 sp=0xc003895948 pc=0x4b8bddc
net/http.HandlerFunc.ServeHTTP(0xc0000eb420, 0x5e67ae0, 0xc000e7c060, 0xc0005be200)
	net/http/server.go:2042 +0x44 fp=0xc0038959a8 sp=0xc003895980 pc=0x45e86c4
net/http.(*ServeMux).ServeHTTP(0xc0011a0640, 0x5e67ae0, 0xc000e7c060, 0xc0005be200)
	net/http/server.go:2417 +0x1ad fp=0xc003895a08 sp=0xc0038959a8 pc=0x45ea6ed
github.com/tendermint/tendermint/rpc/jsonrpc/server.maxBytesHandler.ServeHTTP(0x5e2c340, 0xc0011a0640, 0xf4240, 0x5e67ae0, 0xc000e7c060, 0xc0005be200)
	github.com/tendermint/[email protected]/rpc/jsonrpc/server/http_server.go:234 +0xd4 fp=0xc003895a48 sp=0xc003895a08 pc=0x4b85074
github.com/tendermint/tendermint/rpc/jsonrpc/server.(*maxBytesHandler).ServeHTTP(0xc0013f9060, 0x5e67ae0, 0xc000e7c060, 0xc0005be200)
	<autogenerated>:1 +0x6c fp=0xc003895a88 sp=0xc003895a48 pc=0x4b8e44c
github.com/tendermint/tendermint/rpc/jsonrpc/server.RecoverAndLogHandler.func1(0x5e682a0, 0xc0013a2000, 0xc0005be200)
	github.com/tendermint/[email protected]/rpc/jsonrpc/server/http_server.go:207 +0x39a fp=0xc003895bc8 sp=0xc003895a88 pc=0x4b8cc9a
net/http.HandlerFunc.ServeHTTP(0xc0013fbce0, 0x5e682a0, 0xc0013a2000, 0xc0005be200)
	net/http/server.go:2042 +0x44 fp=0xc003895bf0 sp=0xc003895bc8 pc=0x45e86c4
net/http.serverHandler.ServeHTTP(0xc000e3c380, 0x5e682a0, 0xc0013a2000, 0xc0005be200)
	net/http/server.go:2843 +0xa3 fp=0xc003895c20 sp=0xc003895bf0 pc=0x45ebdc3
net/http.(*conn).serve(0xc00138e000, 0x5e6e620, 0xc001384080)
	net/http/server.go:1925 +0x8ad fp=0xc003895fc8 sp=0xc003895c20 pc=0x45e74cd
runtime.goexit()
	runtime/asm_amd64.s:1374 +0x1 fp=0xc003895fd0 sp=0xc003895fc8 pc=0x4074581
created by net/http.(*Server).Serve
	net/http/server.go:2969 +0x36c

goroutine 1 [select]:
github.com/cosmos/cosmos-sdk/server/grpc.StartGRPCServer(0x0, 0x0, 0x0, 0x5e92800, 0xc001304a60, 0x0, 0x0, 0x5e77d60, 0xc00111c3b0, 0x5e7b480, ...)
	github.com/cosmos/[email protected]/server/grpc/server.go:37 +0x305
github.com/cosmos/cosmos-sdk/server.startInProcess(0xc00117d880, 0x0, 0x0, 0x0, 0x5e92800, 0xc001304a60, 0x0, 0x0, 0x5e77d60, 0xc00111c3b0, ...)
	github.com/cosmos/[email protected]/server/start.go:307 +0x929
github.com/cosmos/cosmos-sdk/server.StartCmd.func2(0xc00116c500, 0x6b9ca08, 0x0, 0x0, 0x0, 0x0)
	github.com/cosmos/[email protected]/server/start.go:120 +0x169
github.com/spf13/cobra.(*Command).execute(0xc00116c500, 0x6b9ca08, 0x0, 0x0, 0xc00116c500, 0x6b9ca08)
	github.com/spf13/[email protected]/command.go:852 +0x47c
github.com/spf13/cobra.(*Command).ExecuteC(0xc000ff5180, 0x0, 0x0, 0xc000ff9b00)
	github.com/spf13/[email protected]/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/[email protected]/command.go:897
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	github.com/spf13/[email protected]/command.go:890
github.com/cosmos/cosmos-sdk/server/cmd.Execute(0xc000ff5180, 0xc000ff9b00, 0x17, 0x5e8bc20, 0xc00111c3b0)
	github.com/cosmos/[email protected]/server/cmd/execute.go:36 +0x265
main.main()
	github.com/desmos-labs/desmos/app/desmos/main.go:17 +0x45

goroutine 37 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).compactionError(0xc000e8c000)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:91 +0xd1
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:148 +0x42b

goroutine 53 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).compactionError(0xc000e8c700)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:91 +0xd1
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:148 +0x42b

goroutine 10 [select]:
github.com/syndtr/goleveldb/leveldb/util.(*BufferPool).drain(0xc00014a1c0)
	github.com/syndtr/[email protected]/leveldb/util/buffer_pool.go:209 +0x128
created by github.com/syndtr/goleveldb/leveldb/util.NewBufferPool
	github.com/syndtr/[email protected]/leveldb/util/buffer_pool.go:240 +0x18c

goroutine 11 [select]:
github.com/syndtr/goleveldb/leveldb.(*session).refLoop(0xc00018a2d0)
	github.com/syndtr/[email protected]/leveldb/session_util.go:189 +0x60f
created by github.com/syndtr/goleveldb/leveldb.newSession
	github.com/syndtr/[email protected]/leveldb/session.go:93 +0x2bd

goroutine 12 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).compactionError(0xc000d8fc00)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:91 +0xd1
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:148 +0x42b

goroutine 13 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).mpoolDrain(0xc000d8fc00)
	github.com/syndtr/[email protected]/leveldb/db_state.go:101 +0x105
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:149 +0x44d

goroutine 14 [syscall]:
syscall.syscall(0x408d020, 0x31, 0x33, 0x0, 0x0, 0x0, 0x0)
	runtime/sys_darwin.go:63 +0x2e
syscall.fcntl(0x31, 0x33, 0x0, 0xc0012ed2b0, 0xc0038bd348, 0x4013078)
	syscall/zsyscall_darwin_amd64.go:338 +0x58
internal/poll.(*FD).Fsync(0xc0016fa300, 0x0, 0x0)
	internal/poll/fd_fsync_darwin.go:18 +0xa8
os.(*File).Sync(0xc0012ed2b0, 0x1, 0x679d4)
	os/file_posix.go:158 +0x4c
github.com/syndtr/goleveldb/leveldb/storage.(*fileWrap).Sync(0xc0016f8900, 0xc000f22300, 0xc000f97ef8)
	github.com/syndtr/[email protected]/leveldb/storage/file_storage.go:585 +0x32
github.com/syndtr/goleveldb/leveldb.(*tWriter).finish(0xc0016fa360, 0x0, 0x0, 0x0)
	github.com/syndtr/[email protected]/leveldb/table.go:583 +0x1ef
github.com/syndtr/goleveldb/leveldb.(*tableCompactionBuilder).flush(0xc0016c52c0, 0x0, 0x0)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:407 +0x4a
github.com/syndtr/goleveldb/leveldb.(*tableCompactionBuilder).run(0xc0016c52c0, 0xc0016fc0b0, 0x0, 0x0)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:528 +0xba5
github.com/syndtr/goleveldb/leveldb.(*DB).compactionTransact(0xc000d8fc00, 0x59bbfeb, 0xb, 0x5e4c920, 0xc0016c52c0)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:186 +0x18c
github.com/syndtr/goleveldb/leveldb.(*DB).tableCompaction(0xc000d8fc00, 0xc0013038c0, 0x5c40300)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:580 +0x64b
github.com/syndtr/goleveldb/leveldb.(*DB).tableAutoCompaction(0xc000d8fc00)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:644 +0x54
github.com/syndtr/goleveldb/leveldb.(*DB).tCompaction(0xc000d8fc00)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:863 +0x2ee
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:155 +0x5a5

goroutine 15 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).mCompaction(0xc000d8fc00)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:773 +0x145
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:156 +0x5c7

goroutine 16 [select]:
github.com/syndtr/goleveldb/leveldb/util.(*BufferPool).drain(0xc00014a540)
	github.com/syndtr/[email protected]/leveldb/util/buffer_pool.go:209 +0x128
created by github.com/syndtr/goleveldb/leveldb/util.NewBufferPool
	github.com/syndtr/[email protected]/leveldb/util/buffer_pool.go:240 +0x18c

goroutine 66 [select]:
github.com/syndtr/goleveldb/leveldb.(*session).refLoop(0xc00018a3c0)
	github.com/syndtr/[email protected]/leveldb/session_util.go:189 +0x60f
created by github.com/syndtr/goleveldb/leveldb.newSession
	github.com/syndtr/[email protected]/leveldb/session.go:93 +0x2bd

goroutine 67 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).compactionError(0xc000d8fdc0)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:91 +0xd1
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:148 +0x42b

goroutine 68 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).mpoolDrain(0xc000d8fdc0)
	github.com/syndtr/[email protected]/leveldb/db_state.go:101 +0x105
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:149 +0x44d

goroutine 69 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).tCompaction(0xc000d8fdc0)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:836 +0x265
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:155 +0x5a5

goroutine 70 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).mCompaction(0xc000d8fdc0)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:773 +0x145
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:156 +0x5c7

goroutine 74 [select]:
github.com/syndtr/goleveldb/leveldb.(*session).refLoop(0xc000db43c0)
	github.com/syndtr/[email protected]/leveldb/session_util.go:189 +0x60f
created by github.com/syndtr/goleveldb/leveldb.newSession
	github.com/syndtr/[email protected]/leveldb/session.go:93 +0x2bd

goroutine 73 [select]:
github.com/syndtr/goleveldb/leveldb/util.(*BufferPool).drain(0xc00014a9a0)
	github.com/syndtr/[email protected]/leveldb/util/buffer_pool.go:209 +0x128
created by github.com/syndtr/goleveldb/leveldb/util.NewBufferPool
	github.com/syndtr/[email protected]/leveldb/util/buffer_pool.go:240 +0x18c

goroutine 75 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).compactionError(0xc00014c1c0)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:91 +0xd1
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:148 +0x42b

goroutine 76 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).mpoolDrain(0xc00014c1c0)
	github.com/syndtr/[email protected]/leveldb/db_state.go:101 +0x105
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:149 +0x44d

goroutine 77 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).tCompaction(0xc00014c1c0)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:836 +0x265
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:155 +0x5a5

goroutine 78 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).mCompaction(0xc00014c1c0)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:773 +0x145
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:156 +0x5c7

goroutine 79 [select]:
github.com/syndtr/goleveldb/leveldb/util.(*BufferPool).drain(0xc00014ac40)
	github.com/syndtr/[email protected]/leveldb/util/buffer_pool.go:209 +0x128
created by github.com/syndtr/goleveldb/leveldb/util.NewBufferPool
	github.com/syndtr/[email protected]/leveldb/util/buffer_pool.go:240 +0x18c

goroutine 80 [select]:
github.com/syndtr/goleveldb/leveldb.(*session).refLoop(0xc000db4d20)
	github.com/syndtr/[email protected]/leveldb/session_util.go:189 +0x60f
created by github.com/syndtr/goleveldb/leveldb.newSession
	github.com/syndtr/[email protected]/leveldb/session.go:93 +0x2bd

goroutine 38 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).mpoolDrain(0xc000e8c000)
	github.com/syndtr/[email protected]/leveldb/db_state.go:101 +0x105
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:149 +0x44d

goroutine 39 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).tCompaction(0xc000e8c000)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:836 +0x265
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:155 +0x5a5

goroutine 40 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).mCompaction(0xc000e8c000)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:773 +0x145
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:156 +0x5c7

goroutine 41 [select]:
github.com/tendermint/tendermint/proxy.(*multiAppConn).killTMOnClientError(0xc0005969c0)
	github.com/tendermint/[email protected]/proxy/multi_app_conn.go:138 +0x174
created by github.com/tendermint/tendermint/proxy.(*multiAppConn).OnStart
	github.com/tendermint/[email protected]/proxy/multi_app_conn.go:118 +0x34e

goroutine 42 [chan receive]:
github.com/tendermint/tendermint/libs/pubsub.(*Server).loop(0xc000148b60, 0xc000e2b2c0, 0xc000e2b2f0)
	github.com/tendermint/[email protected]/libs/pubsub/pubsub.go:324 +0x8c
created by github.com/tendermint/tendermint/libs/pubsub.(*Server).OnStart
	github.com/tendermint/[email protected]/libs/pubsub/pubsub.go:310 +0x68

goroutine 43 [select]:
github.com/syndtr/goleveldb/leveldb/util.(*BufferPool).drain(0xc000e3c1c0)
	github.com/syndtr/[email protected]/leveldb/util/buffer_pool.go:209 +0x128
created by github.com/syndtr/goleveldb/leveldb/util.NewBufferPool
	github.com/syndtr/[email protected]/leveldb/util/buffer_pool.go:240 +0x18c

goroutine 44 [select]:
github.com/syndtr/goleveldb/leveldb.(*session).refLoop(0xc000e60e10)
	github.com/syndtr/[email protected]/leveldb/session_util.go:189 +0x60f
created by github.com/syndtr/goleveldb/leveldb.newSession
	github.com/syndtr/[email protected]/leveldb/session.go:93 +0x2bd

goroutine 45 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).compactionError(0xc000e8c540)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:91 +0xd1
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:148 +0x42b

goroutine 46 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).mpoolDrain(0xc000e8c540)
	github.com/syndtr/[email protected]/leveldb/db_state.go:101 +0x105
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:149 +0x44d

goroutine 47 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).tCompaction(0xc000e8c540)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:836 +0x265
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:155 +0x5a5

goroutine 48 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).mCompaction(0xc000e8c540)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:773 +0x145
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:156 +0x5c7

goroutine 49 [chan receive]:
github.com/tendermint/tendermint/state/txindex.(*IndexerService).OnStart.func1(0x5e655e0, 0xc000f7e480, 0x5e655e0, 0xc000f7e4c0, 0xc00059c670, 0xc00111e420)
	github.com/tendermint/[email protected]/state/txindex/indexer_service.go:53 +0x3af
created by github.com/tendermint/tendermint/state/txindex.(*IndexerService).OnStart
	github.com/tendermint/[email protected]/state/txindex/indexer_service.go:51 +0x1d1

goroutine 82 [select]:
github.com/syndtr/goleveldb/leveldb/util.(*BufferPool).drain(0xc000e3c000)
	github.com/syndtr/[email protected]/leveldb/util/buffer_pool.go:209 +0x128
created by github.com/syndtr/goleveldb/leveldb/util.NewBufferPool
	github.com/syndtr/[email protected]/leveldb/util/buffer_pool.go:240 +0x18c

goroutine 83 [select]:
github.com/syndtr/goleveldb/leveldb.(*session).refLoop(0xc000e605a0)
	github.com/syndtr/[email protected]/leveldb/session_util.go:189 +0x60f
created by github.com/syndtr/goleveldb/leveldb.newSession
	github.com/syndtr/[email protected]/leveldb/session.go:93 +0x2bd

goroutine 54 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).mpoolDrain(0xc000e8c700)
	github.com/syndtr/[email protected]/leveldb/db_state.go:101 +0x105
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:149 +0x44d

goroutine 55 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).tCompaction(0xc000e8c700)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:836 +0x265
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:155 +0x5a5

goroutine 56 [select]:
github.com/syndtr/goleveldb/leveldb.(*DB).mCompaction(0xc000e8c700)
	github.com/syndtr/[email protected]/leveldb/db_compaction.go:773 +0x145
created by github.com/syndtr/goleveldb/leveldb.openDB
	github.com/syndtr/[email protected]/leveldb/db.go:156 +0x5c7

goroutine 57 [IO wait]:
internal/poll.runtime_pollWait(0x86e5d38, 0x72, 0x0)
	runtime/netpoll.go:222 +0x55
internal/poll.(*pollDesc).wait(0xc000d7e718, 0x72, 0x0, 0x0, 0x59af739)
	internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
	internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Accept(0xc000d7e700, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	internal/poll/fd_unix.go:394 +0x1fc
net.(*netFD).accept(0xc000d7e700, 0xc0005d51a0, 0x4013078, 0xc000066d80)
	net/fd_unix.go:172 +0x45
net.(*TCPListener).accept(0xc0005202a0, 0xc000fc5dc0, 0x4013078, 0x30)
	net/tcpsock_posix.go:139 +0x32
net.(*TCPListener).Accept(0xc0005202a0, 0x5885700, 0xc0005d51a0, 0x5736e20, 0x6b39130)
	net/tcpsock.go:261 +0x65
net/http.(*Server).Serve(0xc000f3c0e0, 0x5e67fe0, 0xc0005202a0, 0x0, 0x0)
	net/http/server.go:2937 +0x266
net/http.(*Server).ListenAndServe(0xc000f3c0e0, 0xc000f3c0e0, 0x15)
	net/http/server.go:2866 +0xb7
net/http.ListenAndServe(...)
	net/http/server.go:3120
github.com/tendermint/tendermint/node.NewNode.func1(0x5e6f520, 0xc0000c1320, 0xc00112bcc0)
	github.com/tendermint/[email protected]/node/node.go:801 +0x145
created by github.com/tendermint/tendermint/node.NewNode
	github.com/tendermint/[email protected]/node/node.go:799 +0x1a0b

goroutine 58 [IO wait]:
internal/poll.runtime_pollWait(0x86e5f08, 0x72, 0x0)
	runtime/netpoll.go:222 +0x55
internal/poll.(*pollDesc).wait(0xc0000a8898, 0x72, 0x0, 0x0, 0x59af739)
	internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
	internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Accept(0xc0000a8880, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	internal/poll/fd_unix.go:394 +0x1fc
net.(*netFD).accept(0xc0000a8880, 0x1, 0xc001132600, 0x100000001)
	net/fd_unix.go:172 +0x45
net.(*TCPListener).accept(0xc000dad920, 0xc0001081e0, 0xc000fbfc90, 0x2)
	net/tcpsock_posix.go:139 +0x32
net.(*TCPListener).Accept(0xc000dad920, 0xc000fbfd01, 0x407179b, 0x40d6f3f37206, 0xc034016e48)
	net/tcpsock.go:261 +0x65
golang.org/x/net/netutil.(*limitListener).Accept(0xc000e1d410, 0xc000fbfda8, 0x18, 0xc000582480, 0x45ec28c)
	golang.org/x/[email protected]/netutil/listen.go:48 +0x4e
net/http.(*Server).Serve(0xc000e3c380, 0x5e67b60, 0xc000e1d410, 0x0, 0x0)
	net/http/server.go:2937 +0x266
github.com/tendermint/tendermint/rpc/jsonrpc/server.Serve(0x5e67b60, 0xc000e1d410, 0x5e2c340, 0xc0011a0640, 0x5e6f520, 0xc00002f1a0, 0xc0005b29f0, 0x0, 0x0)
	github.com/tendermint/[email protected]/rpc/jsonrpc/server/http_server.go:61 +0x1fa
github.com/tendermint/tendermint/node.(*Node).startRPC.func3(0x5e67b60, 0xc000e1d410, 0x5e2c340, 0xc0011a0640, 0x5e6f520, 0xc00002f1a0, 0xc0005b29f0, 0xc000140b00)
	github.com/tendermint/[email protected]/node/node.go:1071 +0x77
created by github.com/tendermint/tendermint/node.(*Node).startRPC
	github.com/tendermint/[email protected]/node/node.go:1070 +0x665

goroutine 59 [IO wait]:
internal/poll.runtime_pollWait(0x86e5e20, 0x72, 0x0)
	runtime/netpoll.go:222 +0x55
internal/poll.(*pollDesc).wait(0xc0000a8918, 0x72, 0x0, 0x0, 0x59af739)
	internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
	internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Accept(0xc0000a8900, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	internal/poll/fd_unix.go:394 +0x1fc
net.(*netFD).accept(0xc0000a8900, 0x1, 0x0, 0x100000001)
	net/fd_unix.go:172 +0x45
net.(*TCPListener).accept(0xc000dad9a0, 0xc0001083c0, 0xc000de3680, 0x2)
	net/tcpsock_posix.go:139 +0x32
net.(*TCPListener).Accept(0xc000dad9a0, 0x1, 0x0, 0x0, 0x0)
	net/tcpsock.go:261 +0x65
golang.org/x/net/netutil.(*limitListener).Accept(0xc000e1d500, 0x0, 0x0, 0x0, 0x0)
	golang.org/x/[email protected]/netutil/listen.go:48 +0x4e
github.com/tendermint/tendermint/p2p.(*MultiplexTransport).acceptPeers(0xc000132100)
	github.com/tendermint/[email protected]/p2p/transport.go:266 +0x6c
created by github.com/tendermint/tendermint/p2p.(*MultiplexTransport).Listen
	github.com/tendermint/[email protected]/p2p/transport.go:259 +0xeb

goroutine 60 [select]:
github.com/tendermint/tendermint/p2p/pex.(*addrBook).saveRoutine(0xc000132300)
	github.com/tendermint/[email protected]/p2p/pex/addrbook.go:499 +0x135
created by github.com/tendermint/tendermint/p2p/pex.(*addrBook).OnStart
	github.com/tendermint/[email protected]/p2p/pex/addrbook.go:161 +0x87

goroutine 61 [select]:
github.com/tendermint/tendermint/p2p/pex.(*Reactor).ensurePeersRoutine(0xc0000ac000)
	github.com/tendermint/[email protected]/p2p/pex/pex_reactor.go:439 +0x165
created by github.com/tendermint/tendermint/p2p/pex.(*Reactor).OnStart
	github.com/tendermint/[email protected]/p2p/pex/pex_reactor.go:167 +0x11e

goroutine 62 [select]:
github.com/tendermint/tendermint/consensus.(*Reactor).peerStatsRoutine(0xc0000a8680)
	github.com/tendermint/[email protected]/consensus/reactor.go:860 +0x14f
created by github.com/tendermint/tendermint/consensus.(*Reactor).OnStart
	github.com/tendermint/[email protected]/consensus/reactor.go:78 +0xf3

goroutine 64 [syscall]:
os/signal.signal_recv(0x0)
	runtime/sigqueue.go:144 +0x9d
os/signal.loop()
	os/signal/signal_unix.go:23 +0x25
created by os/signal.Notify.func1.1
	os/signal/signal.go:150 +0x45

goroutine 65 [chan receive]:
github.com/tendermint/tendermint/libs/autofile.OpenAutoFile.func1(0xc000d0eeb0)
	github.com/tendermint/[email protected]/libs/autofile/autofile.go:81 +0x65
created by github.com/tendermint/tendermint/libs/autofile.OpenAutoFile
	github.com/tendermint/[email protected]/libs/autofile/autofile.go:80 +0x277

goroutine 98 [select]:
github.com/tendermint/tendermint/libs/autofile.(*AutoFile).closeFileRoutine(0xc000d0eeb0)
	github.com/tendermint/[email protected]/libs/autofile/autofile.go:104 +0xb9
created by github.com/tendermint/tendermint/libs/autofile.OpenAutoFile
	github.com/tendermint/[email protected]/libs/autofile/autofile.go:86 +0x299

goroutine 99 [select]:
github.com/tendermint/tendermint/libs/autofile.(*Group).processTicks(0xc0004fb340)
	github.com/tendermint/[email protected]/libs/autofile/group.go:242 +0x115
created by github.com/tendermint/tendermint/libs/autofile.(*Group).OnStart
	github.com/tendermint/[email protected]/libs/autofile/group.go:140 +0x68

goroutine 100 [select]:
github.com/tendermint/tendermint/consensus.(*BaseWAL).processFlushTicks(0xc00002f560)
	github.com/tendermint/[email protected]/consensus/wal.go:144 +0xb8
created by github.com/tendermint/tendermint/consensus.(*BaseWAL).OnStart
	github.com/tendermint/[email protected]/consensus/wal.go:138 +0xc5

goroutine 101 [select]:
github.com/tendermint/tendermint/consensus.(*timeoutTicker).timeoutRoutine(0xc00002ed20)
	github.com/tendermint/[email protected]/consensus/ticker.go:98 +0x14c
created by github.com/tendermint/tendermint/consensus.(*timeoutTicker).OnStart
	github.com/tendermint/[email protected]/consensus/ticker.go:54 +0x3f

goroutine 102 [select]:
github.com/tendermint/tendermint/consensus.(*State).receiveRoutine(0xc000d2e380, 0x0)
	github.com/tendermint/[email protected]/consensus/state.go:751 +0x2b0
created by github.com/tendermint/tendermint/consensus.(*State).OnStart
	github.com/tendermint/[email protected]/consensus/state.go:378 +0x896

goroutine 103 [select]:
github.com/tendermint/tendermint/p2p.(*MultiplexTransport).Accept(0xc000132100, 0xc0000a8700, 0xa, 0x10, 0xc0004d6740, 0x0, 0xc0004d6750, 0xc000e2bbf0, 0xc0000d96d0, 0x0, ...)
	github.com/tendermint/[email protected]/p2p/transport.go:191 +0xfa
github.com/tendermint/tendermint/p2p.(*Switch).acceptRoutine(0xc000f68c60)
	github.com/tendermint/[email protected]/p2p/switch.go:620 +0x168
created by github.com/tendermint/tendermint/p2p.(*Switch).OnStart
	github.com/tendermint/[email protected]/p2p/switch.go:233 +0x19c

goroutine 104 [IO wait]:
internal/poll.runtime_pollWait(0x86e5c50, 0x72, 0x0)
	runtime/netpoll.go:222 +0x55
internal/poll.(*pollDesc).wait(0xc0012e7318, 0x72, 0x0, 0x0, 0x59af739)
	internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
	internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Accept(0xc0012e7300, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	internal/poll/fd_unix.go:394 +0x1fc
net.(*netFD).accept(0xc0012e7300, 0x1, 0xc000dc3a00, 0x100000001)
	net/fd_unix.go:172 +0x45
net.(*TCPListener).accept(0xc0016d6600, 0xc00142cd80, 0xc000dc3a00, 0x2)
	net/tcpsock_posix.go:139 +0x32
net.(*TCPListener).Accept(0xc0016d6600, 0x1, 0x50, 0x583e9c0, 0x1258e6de68ccb801)
	net/tcpsock.go:261 +0x65
golang.org/x/net/netutil.(*limitListener).Accept(0xc0016bcba0, 0x5885700, 0xc0016bcea0, 0x5736e20, 0x6b39130)
	golang.org/x/[email protected]/netutil/listen.go:48 +0x4e
net/http.(*Server).Serve(0xc00014ad20, 0x5e67b60, 0xc0016bcba0, 0x0, 0x0)
	net/http/server.go:2937 +0x266
github.com/tendermint/tendermint/rpc/jsonrpc/server.Serve(0x5e67b60, 0xc0016bcba0, 0x5e2a6c0, 0xc0000ac180, 0x5e6f520, 0xc001330420, 0xc000dc3d00, 0x0, 0x0)
	github.com/tendermint/[email protected]/rpc/jsonrpc/server/http_server.go:61 +0x1fa
github.com/cosmos/cosmos-sdk/server/api.(*Server).Start(0xc000583980, 0x0, 0x0, 0xc0013cd370, 0x7, 0x5a00aa8, 0x1, 0x5a00aa8, 0x1, 0x5a00aa8, ...)
	github.com/cosmos/[email protected]/server/api/server.go:118 +0x37d
github.com/cosmos/cosmos-sdk/server.startInProcess.func2(0xc000583980, 0xc001302360, 0xc00142cd20)
	github.com/cosmos/[email protected]/server/start.go:293 +0x98
created by github.com/cosmos/cosmos-sdk/server.startInProcess
	github.com/cosmos/[email protected]/server/start.go:292 +0xc2c

goroutine 106 [IO wait]:
internal/poll.runtime_pollWait(0x86e5b68, 0x72, 0x0)
	runtime/netpoll.go:222 +0x55
internal/poll.(*pollDesc).wait(0xc0012e7818, 0x72, 0x0, 0x0, 0x59af739)
	internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
	internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Accept(0xc0012e7800, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	internal/poll/fd_unix.go:394 +0x1fc
net.(*netFD).accept(0xc0012e7800, 0xc0016c5188, 0xc000de16b8, 0xc0016c5180)
	net/fd_unix.go:172 +0x45
net.(*TCPListener).accept(0xc0016d7cc0, 0x4013078, 0xc0016c5180, 0xc0016c5208)
	net/tcpsock_posix.go:139 +0x32
net.(*TCPListener).Accept(0xc0016d7cc0, 0xc0016bd830, 0xc000de16b8, 0xc0016c5208, 0x0)
	net/tcpsock.go:261 +0x65
google.golang.org/grpc.(*Server).Serve(0xc000e8ddc0, 0x5e67fe0, 0xc0016d7cc0, 0x0, 0x0)
	google.golang.org/[email protected]/server.go:739 +0x216
github.com/cosmos/cosmos-sdk/server/grpc.StartGRPCServer.func1(0xc000e8ddc0, 0x5e67fe0, 0xc0016d7cc0, 0xc0016919b0, 0xc00142cfc0)
	github.com/cosmos/[email protected]/server/grpc/server.go:31 +0x45
created by github.com/cosmos/cosmos-sdk/server/grpc.StartGRPCServer
	github.com/cosmos/[email protected]/server/grpc/server.go:30 +0x245

goroutine 31 [IO wait]:
internal/poll.runtime_pollWait(0x86e5a80, 0x72, 0x5e2ea20)
	runtime/netpoll.go:222 +0x55
internal/poll.(*pollDesc).wait(0xc001388118, 0x72, 0x5e2ea00, 0x6ab9050, 0x0)
	internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
	internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc001388100, 0xc001382251, 0x1, 0x1, 0x0, 0x0, 0x0)
	internal/poll/fd_unix.go:159 +0x1a5
net.(*netFD).Read(0xc001388100, 0xc001382251, 0x1, 0x1, 0x0, 0xc000122e18, 0x585ae60)
	net/fd_posix.go:55 +0x4f
net.(*conn).Read(0xc00138c000, 0xc001382251, 0x1, 0x1, 0x0, 0x0, 0x0)
	net/net.go:182 +0x8e
net/http.(*connReader).backgroundRead(0xc001382240)
	net/http/server.go:690 +0x58
created by net/http.(*connReader).startBackgroundRead
	net/http/server.go:686 +0xd5

This error happens only when there are some data on chain, like a post (which is what I'm trying to get).
This is the chain code related to the querier and this the one related to the posts module.
I don't think there are problems in the querier since when the chain is empty the smart query works fine.
Maybe it's something related to post serialization?

POAP: Duplication of Checks in mint and mintto Functions

Feature description

Currently, there are identical checks being performed in both the ExecuteMsg:Mint

ExecuteMsg::Mint {} => {
let recipient_addr = info.sender.clone();
execute_mint(deps, env, info, ACTION_MINT, recipient_addr, false, false)
}
and ExecuteMsg:MintTo
ExecuteMsg::MintTo { recipient } => {
let recipient_addr = deps.api.addr_validate(&recipient)?;
execute_mint(deps, env, info, ACTION_MINT_TO, recipient_addr, true, true)
}
which use the same function execute_mint(). This raises a question: why are these checks duplicated, instead of being centralized within the execute_mint() function, similar to how the check for the new admin's address is handled in the execute_update_admin()
let new_admin = deps.api.addr_validate(&admin_address)?;
function?

Implementation proposal

Even if it is not a huge improvement, if there is no specific reason for this duplication, it might be more efficient to consolidate these checks within the execute_mint function. This could enhance code readability and maintainability by avoiding unnecessary repetition.

Add javascript functions to interact with the contracts from client side apps

With the release of the new cosmJS version
we can now start to build some helpers to let people and our frontend devs interact with contracts by using javascript.
Currently the only functions we have inside cw-desmos-filter-posts are to deploy and instantiate the contract.
It would be useful if we can extend those to cover all contract functionalities.

POAP: Considering Use of CW721-non-transferable Instead of CW721-base

Feature description

The current implementation uses a wrapper of CW721-base

pub type Cw721MetadataContract<'a> =
cw721_base::Cw721Contract<'a, Metadata, Empty, Empty, DesmosMsg, DesmosQuery>;
pub type ExecuteMsg = cw721_base::ExecuteMsg<Metadata, Empty>;
pub type QueryMsg = cw721_base::QueryMsg<Empty>;
storing the address of the claimer to whom the POAP is minted
pub struct Metadata {
pub claimer: Addr,
}
However, the NFT remains transferable in this setup. It might be worthwhile to consider whether the implementation should omit the claimer's address and instead set the NFT as non-transferable, binding it indelibly to that address.

Implementation proposal

It would be beneficial to have a discussion on whether the approach of using a CW721-base with claimer information is more advantageous compared to using a CW721-non-transferable for the use case of POAP NFTs. If there's solid reasoning behind the existing design, it should be documented for better understanding. If not, and if the CW721-non-transferable is a more suitable choice, then perhaps the implementation could be reconsidered.

POAP: Questioning Minter Address Change Permission

Feature description

Currently, only the admin has the ability to change the address of the minter in the system

// Check that the sender is the admin
if info.sender != config.admin {
return Err(ContractError::Unauthorized {});
}

In this design, the minter himself cannot delegate his role to another address. It raises the question of whether there's a specific reason for this choice.

Implementation proposal

Could we discuss the possibility of granting the minter permission to delegate their role? If there's a solid justification for the existing design, it would be beneficial to document it for better understanding and clarity. Otherwise, consider updating the system to allow the minter to delegate their role, which might increase flexibility and autonomy for different actors within the system.

Desmos `x/profiles` messages implementation

We need to implement all the custom messages of x/profiles inside the Desmos rust package.
This will be helpful in the future for developers in order to let them easily integrate their custom tokenomics/ToS with anything related to Desmos profiles.
List of messages to be implemented:

  • Save profile
  • Delete profile
  • Request DTag transfer
  • Accept DTag transfer
  • Refuse DTag transfer
  • Cancel DTag transfer
  • Create relationship
  • Delete relationship
  • Block user
  • Unblock user
  • Link chain account
  • Unlink chain
  • Link application
  • Unlink application

Each of them should be implemented and tested inside a single PR.

Add conditional compilation to desmos-std

In order to optimise the usage of desmos-std by devs in their contract, we can add conditional compilation to its packages. Conditional compilation allows to build only the features that are needed in a specific context.
For instance, if someone wants to write a contract which only use subspaces messages, it's useless for them to also include other modules. Including them all will result in:

  • an increased contract size;
  • a higher deployment cost.

To solve these problems, conditional compilation come useful, we just need to:

  1. Updated the config.toml:
...
[features]
profiles = []
subspaces = []
...
  1. Update the code where needed, with macros for features:
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case", tag = "route", content = "msg_data")]
pub enum DesmosMsg {
    #[cfg(feature = "profiles")]
    Profiles(ProfilesMsg),
    #[cfg(feature = "subspaces")]
    Subspaces(SubspacesMsg),
}

Note:
Special thanks to @manu0466 to bring this to my attention

@dadamu what do you think about this?

Add admin and admin checks to filter-posts

Currently everyone on desmos chain has the access to edit the reports_limit number of the filter-posts contract.
This should not be possible, at least not by everyone right now.
We need to implement some admin checks that ensure if the editor is the original deployer of the contract or not.

POAP: Potential Misnaming of the 'MINTER_ADDRESS' State Variable

Feature description

The state variable MINTER_ADDRESS is currently used to store data related to the tokens (POAPs) minted to different wallets (addresses). Here, the address serves as the key, and the value represents the number of POAPs minted to that address

pub const MINTER_ADDRESS: Map<Addr, u32> = Map::new("minter_address");
Given its usage, the name "MINTER_ADDRESS" might not accurately reflect the data it holds.

Implementation proposal

Considering the data held by this state variable, a more descriptive name could be MINTED_TOKENS. This change would make the purpose of this variable clearer to developers who read the code, improving the readability and understandability of the codebase.

POAP: Consider Removing IPFS-Only Validation on POAP URI

Feature description

I'm currently facing a constraint in the validation logic in the msg.rs file (lines 146-151), which requires the POAP URI scheme to be of the IPFS type. While this is explicitly stated in ADR-001, there isn't any clear explanation as to why the URI scheme must specifically be IPFS. This requirement restricts the flexibility in choosing different storage solutions for storing POAP assets and metadata.

Implementation proposal

I propose to make the URI scheme requirement more generic, thus removing the IPFS-only filter. As previously stated, this change will broaden the variety of storage solutions that could be used for storing POAP assets and metadata.

Desmos `x/profiles` queries implementation

As #11, we need to implement also all the custom queries of x/profiles inside the Desmos rust package.
This will help developers when they will implement their own tokenomics if they need something related to the profiles module.
List of queries to be implemented:

  • Query profile
  • Query DTag transfer request
  • Query relationships
  • Query blocks
  • Query Params (optional)
  • Query Chain Links
  • Query Application Links

Each of them should be implemented and tested inside a single PR.

Iterator for data query

The idea is to give to the developers an easier way to query and perform operations with the data present on the chain leveraging the standard Iterator crate of Rust.

Using our current implementation if a developer wants to operate with the app-links need to do something like this:

let profiles_querier = ProfilesQuerier::new(...);
let mut data_available = true;
let mut current_offset: u64 = 0;
while data_available {
    let response = profiles_querier.query_application_links(
       Some(address)), None, None, 
       Some(PageRequest {
           key: None,
           offset: Uint64::from(current_offset),
           limit: Uint64::from(10),
           count_total: false,
           reverse: false,
       }))?;
       if response.links.is_empty() {
           data_available = false
       } else { 
          // Scan app links and perform operations
          current_offset += response.links.len() as u64;
       }
}

With an iterator the same code can be something like this:

let profiles_querier = ProfilesQuerier::new(...);
let it = profiles_querirer.query_application_links_it(Some(address), None, None, 10);
for app_link_result in it {
    let app_link = app_link_result?;
    // Do operations with the fetched app link...
}

Improve `DesmosQuery` and `DesmosMsg` with serde tag

Currently the structure of DesmosMsg is like:

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct DesmosMsg {
    pub route: DesmosRoute,
    pub msg_data: DesmosMsgRoute,
}

It could be simplified with serde tag attribute, say:

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case", tag = "route", content = "msg_data")]
pub enum DesmosMsg {
    Profiles(ProfilesMsg),
    Subspaces(SubspacesMsg),
}

To produce the json like:

{
    "route": "subspace",
    "msg_data": {
        "create_subspace": {
            "name": "test",
            "description": "test",
            "......"
        }
    }
}

We can do the same way to DesmosQuery as well.
It will reduce some code related to DesmosRoute. What do you think? @bragaz

Note:

it will break the current wasm part of modules in the desmos chain since the json format is different from the current one.

Reference: https://serde.rs/enum-representations.html#adjacently-tagged

Move desmos-std in its own repository

I think that to pursue maintainability in the future, we should move out desmos-std in its own repository and then import it in all the future smart-contract that we will implement. What do you think @dadamu?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.