The Infrastructure of Decentralized Exchange
This repository hosts OKTC
, the implementation of the OKTC based on the Cosmos SDK.
Note: Requires Go 1.20
Refer to the documentation.
⛓️ EVM & Wasm $ IBC-compatible, OKTC is a L1 blockchain network built on top of Cosmos SDK that aims for optimal interoperability and performance ✨
Home Page: https://www.okx.com/oktc
License: Other
The Infrastructure of Decentralized Exchange
This repository hosts OKTC
, the implementation of the OKTC based on the Cosmos SDK.
Note: Requires Go 1.20
Refer to the documentation.
command input:
1、okchaincli tx gov submit-proposal param-change /root/data/distrcommunitytax.json --from val0 --fees 0.00200000okt -y -b block -o json"
distrcommunitytax.json content:
{
"title": "Staking Param Change",
"description": "Update max validators",
"changes": [
{
"subspace": "distribution",
"key": "communitytax",
"value": "1.1"
}
],
"deposit": [
{
"denom": "okt",
"amount": "100"
}
],
"height": "1410"
}
result :
CONSENSUS FAILURE!!! module=consensus err="negative coin amount" stack="goroutine 265 [running]:\nruntime/debug.Stack(0xc000e30818, 0x12ae180, 0x18d58c0)\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x9d\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine.func2(0xc000606000, 0x16c0ee0)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:612 +0x57\npanic(0x12ae180, 0x18d58c0)\n\t/usr/local/go/src/runtime/panic.go:969 +0x166\ngithub.com/cosmos/cosmos-sdk/types.DecCoins.Sub(...)\n\t/go/pkg/mod/github.com/okex/[email protected]/types/dec_coin.go:278\ngithub.com/okex/okchain/x/distribution/keeper.Keeper.allocateByEqual(0x190db40, 0xc000119ad0, 0xc001018000, 0xc001018000, 0x190db40, 0xc000119b00, 0x190db80, 0xc000f16020, 0xc000387d00, 0xc, ...)\n\t/go/src/github.com/okex/okchain/x/distribution/keeper/allocation.go:103 +0x8f0\ngithub.com/okex/okchain/x/distribution/keeper.Keeper.AllocateTokens(0x190db40, 0xc000119ad0, 0xc001018000, 0xc001018000, 0x190db40, 0xc000119b00, 0x190db80, 0xc000f16020, 0xc000387d00, 0xc, ...)\n\t/go/src/github.com/okex/okchain/x/distribution/keeper/allocation.go:66 +0xa53\ngithub.com/okex/okchain/x/distribution.BeginBlocker(0x191f040, 0xc000132040, 0x19324e0, 0xc0042a1f80, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/src/github.com/okex/okchain/x/distribution/abci.go:26 +0x2b1\ngithub.com/okex/okchain/x/distribution.AppModule.BeginBlock(...)\n\t/go/src/github.com/okex/okchain/x/distribution/module.go:131\ngithub.com/cosmos/cosmos-sdk/types/module.(*Manager).BeginBlock(0xc001018f50, 0x191f040, 0xc000132040, 0x19324e0, 0xc0042a1f80, 0xa, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/pkg/mod/github.com/okex/[email protected]/types/module/module.go:290 +0x1ca\ngithub.com/okex/okchain/app/protocol.(*ProtocolV0).BeginBlocker(...)\n\t/go/src/github.com/okex/okchain/app/protocol/protocol_v0.go:463\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).BeginBlock(0xc000e9c000, 0xc00462cbc0, 0x20, 0x20, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/pkg/mod/github.com/okex/[email protected]/baseapp/baseapp.go:680 +0x469\ngithub.com/okex/okchain/app.(*OKChainApp).BeginBlock(0xc0001340f8, 0xc00462cbc0, 0x20, 0x20, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/src/github.com/okex/okchain/app/abci.go:46 +0x325\ngithub.com/tendermint/tendermint/abci/client.(*localClient).BeginBlockSync(0xc00110b140, 0xc00462cbc0, 0x20, 0x20, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/pkg/mod/github.com/okex/[email protected]/abci/client/local_client.go:231 +0xf8\ngithub.com/tendermint/tendermint/proxy.(*appConnConsensus).BeginBlockSync(0xc0002ad150, 0xc00462cbc0, 0x20, 0x20, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/pkg/mod/github.com/okex/[email protected]/proxy/app_conn.go:69 +0x6b\ngithub.com/tendermint/tendermint/state.execBlockOnProxyApp(0x191fac0, 0xc0002eb120, 0x192afc0, 0xc0002ad150, 0xc0013492c0, 0x19355e0, 0xc000134948, 0xf0bf, 0x3c, 0xc00521cc80)\n\t/go/pkg/mod/github.com/okex/[email protected]/state/execution.go:288 +0x3dd\ngithub.com/tendermint/tendermint/state.(*BlockExecutor).ApplyBlock(0xc0000bbab0, 0xa, 0x0, 0xc000ee3750, 0x7, 0xc000ee3760, 0x7, 0xf0bf, 0x3c, 0xc00521cc80, ...)\n\t/go/pkg/mod/github.com/okex/[email protected]/state/execution.go:139 +0x139\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).finalizeCommit(0xc000606000, 0xf0c0)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1453 +0x96e\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).tryFinalizeCommit(0xc000606000, 0xf0c0)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1370 +0x383\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).enterCommit.func1(0xc000606000, 0x0, 0xf0c0)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1305 +0x90\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).enterCommit(0xc000606000, 0xf0c0, 0x0)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1342 +0x689\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).addVote(0xc000606000, 0xc001a11360, 0xc001066150, 0x28, 0x12ae3c0, 0xc0001fb1a8, 0x16c21d8)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1822 +0xb34\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).tryAddVote(0xc000606000, 0xc001a11360, 0xc001066150, 0x28, 0xc001a0c240, 0xc001a0c360, 0x30)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1651 +0x59\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).handleMsg(0xc000606000, 0x18fa2c0, 0xc0052bf9f0, 0xc001066150, 0x28)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:708 +0x525\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine(0xc000606000, 0x0)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:643 +0x709\ncreated by github.com/tendermint/tendermint/consensus.(*ConsensusState).OnStart\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:335 +0x13a\n"
v0.10.3
command input:
1、okchaincli tx distr withdraw-rewards okchainvaloper1g7znsf24w4jc3xfca88pq9kmlyjdare6mph5rx --from val0 -a 1 -y
-b block --fees 0.002okt
result :
height: 0
txhash: 70921B4DEA5674C4ABDCE0C2E15F729B443B02AA63A803009670D50F7DE11294
code: 4
data: ""
rawlog: '{"codespace":"sdk","code":4,"message":"signature verification failed; verify
correct account sequence, chain-id and message format. Expected message format:
{\"account_number\":\"2\",\"chain_id\":\"okchain\",\"fee\":{\"amount\":[{\"amount\":\"0.00200000\",\"denom\":\"okt\"}],\"gas\":\"200000\"},\"memo\":\"\",\"msgs\":[{\"type\":\"okchain/distribution/MsgWithdrawReward\",\"value\":{\"validator_address\":\"okchainvaloper1alq9na49n9yycysh889rl90g9nhe58lcs50wu5\"}}],\"sequence\":\"15\"}"}'
logs: []
info: ""
gaswanted: 0
gasused: 19615
codespace: ""
tx: null
timestamp: ""
events: []
v0.10.1
The reference to base fee 0.0125okt still remains in backend module. Please make sure the modification to the dynamic base fee.
master - e0292f5
code in okex/okchain/x/backend/types/tx.go
:
func buildTransactionsTransfer(msg tokenTypes.MsgSend, txHash string, ctx sdk.Context, tokenKeeper TokenKeeper,
timestamp int64) (*Transaction, *Transaction) {
decCoins := msg.Amount
txFrom := &Transaction{
TxHash: txHash,
Address: msg.FromAddress.String(),
Type: TxTypeTransfer,
Side: TxSideFrom,
Symbol: decCoins[0].Denom,
Quantity: decCoins[0].Amount.String(),
Fee: tokenKeeper.GetParams(ctx).FeeBase.String(), // TODO: get fee from params
Timestamp: timestamp,
}
txTo := &Transaction{
TxHash: txHash,
Address: msg.ToAddress.String(),
Type: TxTypeTransfer,
Side: TxSideTo,
Symbol: decCoins[0].Denom,
Quantity: decCoins[0].Amount.String(),
Fee: sdk.DecCoin{Denom: common.NativeToken, Amount: sdk.ZeroDec()}.String(),
Timestamp: timestamp,
}
return txFrom, txTo
}
focus on the part of field Fee
above.
In my opinion, the txhash should be offered when the fee of a tx is demanded.
Dynamically change log level
Dynamically change log level without restarting okchaind.
The way enhances the debuggability.
command input:
$ okchaincli query gov proposals
Error:
ERROR: No matching proposals found
v0.10.0
update default fee of token:
It is desired to make it easy get all validators back by a new REST param - “all”.
The REST query of validators only gets the ones with a specific status back at present.
Same error type is expected in case of token pair not existing in dex module.
Different error types returned in case of token pair not existing in dex module, which is confused and should be optimized.
Return same error type in case of token pair not existing.
When I search the token moudle's params,return the send_fee message; but the token moudle no longer provides the send function
command input:
1、okchaincli query token params
result :
feeissue:
denom: okt
amount: "20000.00000000"
feemint:
denom: okt
amount: "2000.00000000"
feeburn:
denom: okt
amount: "10.00000000"
feemodify:
denom: okt
amount: "0.00000000"
feesend:
denom: okt
amount: "0.00000000"
feemultisend:
denom: okt
amount: "0.01000000"
feechown:
denom: okt
amount: "10.00000000"
v0.10.1
The operator A dexlist tokenpair aaa_bbb,the other operator B can dexlist bbb_aaa sucessfully,this operation should fail
v0.10.3
Duplicated votes query information will be showed by rest way of votes query on a specific validators.
Start the chain and complete the delegation and multi-voting.
$ okchaincli tx staking delegate 1024okt --from captain -y -b block --fees 0.002okt
$ okchaincli tx staking vote okchainvaloper1alq9na49n9yycysh889rl90g9nhe58lcs50wu5,okchainvaloper1svzxp4ts5le2s4zugx34ajt6shz2hg42a3gl7g --from turing -y -b block --fees 0.002okt
Then query the votes on a validator by rest way:
http://localhost:26659/okchain/v1/staking/validators/okchainvaloper1alq9na49n9yycysh889rl90g9nhe58lcs50wu5/votes
It will be showed on Chrome:
[
{
"voter_address": "okchain10q0rk5qnyag7wfvvt7rtphlw589m7frsmyq4ya",
"votes": "4435657919.37171456"
},
{
"voter_address": "okchain10q0rk5qnyag7wfvvt7rtphlw589m7frsmyq4ya",
"votes": "4435657919.37171456"
}
]
when I query the parameters of params module,no correct information returned
command input:
1、$ okchaincli query params params
result:
Querying subcommands
Usage:
okchaincli query [command]
Aliases:
query, q
Available Commands:
account Query account balance
tendermint-validator-set Get the full tendermint validator set at given height
block Get verified data for a the block at given height
txs Query for paginated transactions that match a set of events
tx Query for a transaction by hash in a committed block
staking Querying commands for the staking module
gov Querying commands for the governance module
backend Querying commands for the backend module
upgrade Querying commands for the upgrade module
slashing Querying commands for the slashing module
supply Querying commands for the supply module
token Querying commands for the token module
dex Querying commands for the dex module
order Querying commands for the order module
debug Debugging subcommands
mint Querying commands for the minting module
distr Querying commands for the distribution module
Flags:
-h, --help help for query
Global Flags:
--chain-id string Chain ID of tendermint node
-e, --encoding string Binary encoding (hex|b64|btc) (default "hex")
--home string directory for config and data (default "/root/.okchaincli")
-o, --output string Output format (text|json) (default "text")
--passwd string Pass word of sender (default "12345678")
--trace print out full stack trace on errors
Use "okchaincli query [command] --help" for more information about a command.
v0.10.0
There's no MinSelfDelegationLimit params in staking moudle
command input:
1、okchaincli query staking params -o json
result:
{
"unbonding_time": "1209600000000000",
"max_bonded_validators": 21,
"epoch": 252,
"max_validators_to_vote": 30,
"bond_denom": "okt",
"min_delegation": "0.00010000"
}
users balance of okt should be :2000001.00000000 - 0.25920000 -0.002 = 2000000.73880000 not 000000.74080000
## Version
v0.10.0
#### For Admin Use
- [ ] Not duplicate issue
- [ ] Appropriate labels applied
- [ ] Appropriate contributors tagged
- [ ] Contributor assigned/self-assigned
After the validator destroy,the voter unbond part ofthe delegation 。the return message content needs to be optimized
command input:
1、okchaincli tx staking unbond 1okt --from v100 --fees 0.00200000okt -y -b block -o json --chain-id okchain --node tcp://192.168.80.118:20157
orderTradeFeeRate.json content:
result :
{'height': '65710', 'txhash': 'ADD34F1349CD8E64F960DB0D8B06AF4C8E585411A5CA06F89428BE03FEB75E63', 'code': 106, 'raw_log': '[{"msg_index":0,"success":false,"log":"{\\"codespace\\":\\"staking\\",\\"code\\":106,\\"message\\":\\"failed. validator okchainvaloper1j75jp9zn6wdt8lea3nzcdxl0uxes82d7cq5f66 with zero min self delegation isn\'t allowed to vote. please get rid of it from the voting list by voting other validators again\\"}","events":null}]', 'logs': [{'msg_index': 0, 'success': False, 'log': '{"codespace":"staking","code":106,"message":"failed. validator okchainvaloper1j75jp9zn6wdt8lea3nzcdxl0uxes82d7cq5f66 with zero min self delegation isn\'t allowed to vote. please get rid of it from the voting list by voting other validators again"}', 'events': None}], 'gas_wanted': '200000', 'gas_used': '53747', 'codespace': 'staking', 'events': [{'type': 'message', 'attributes': [{'key': 'action', 'value': 'undelegate'}, {'key': 'fee', 'value': '0.00200000okt'}, {'key': 'sender', 'value': 'okchain12tyll78gy3scgq6fse7p6qr997m20gzq9e3trg'}]}, {'type': 'transfer', 'attributes': [{'key': 'recipient', 'value': 'okchain17xpfvakm2amg962yls6f84z3kell8c5ljresa7'}, {'key': 'amount', 'value': '0.00200000okt'}]}]}
v0.10.3
command input:
$ okchaincli tx gov submit-proposal param-change withdrawperiod.json --from val0 -y -b block
--fees 0.002okt
contents of withdrawperiod.json
{
"title": "Staking Param Change",
"description": "update xxx",
"changes": [
{ "subspace": "dex", "key": "withdrawperiod", "value":"24h0m0s" }
],
"deposit": [
{ "denom": "okt", "amount": "100" }
],
"height":"25514"
}
Error:
height: 24574
txhash: 6B4F79C676273C28E8145217BD72D928E29E045E87C80049F34955791426FEBD
code: 1
data: ""
rawlog: '{"codespace":"sdk","code":1,"message":"recovered: Parameter not registered\nstack:\ngoroutine
251 [running]:\nruntime/debug.Stack(0xc000d80f50, 0x130d7e0, 0x194d860)\n\t/usr/local/go/src/runtime/debug/stack.go:24
+0x9d\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx.func1(0xc000d85bd8,
0xc000d865c0, 0xc000d87b08)\n\t/go/pkg/mod/github.com/okex/[email protected]/baseapp/baseapp.go:897
+0x90\npanic(0x130d7e0, 0x194d860)\n\t/usr/local/go/src/runtime/panic.go:679 +0x1b2\ngithub.com/cosmos/cosmos-sdk/x/params/subspace.Subspace.Update(0xc0003300e0,
0x1988f60, 0xc000454c00, 0x1988fa0, 0xc000454ca0, 0xc000f4b890, 0x3, 0x8, 0xc001137500,
0x199abe0, ...)\n\t/go/pkg/mod/github.com/okex/[email protected]/x/params/subspace/subspace.go:186
+0x501\ngithub.com/okex/okchain/x/params.changeParams(0x199abe0, 0xc000042048, 0x19af820,
0xc0058c2f40, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/src/github.com/okex/okchain/x/params/proposal_handler.go:56
+0x54c\ngithub.com/okex/okchain/x/params.Keeper.CheckMsgSubmitProposal(0xc0003300e0,
0x1988f60, 0xc000454c00, 0x1988fa0, 0xc000454ca0, 0x15345aa, 0x6, 0xc0011371a0,
0xc0011371d0, 0xc0003300e0, ...)\n\t/go/src/github.com/okex/okchain/x/params/proposal_handler.go:130
+0x76e\ngithub.com/okex/okchain/x/gov.handleMsgSubmitProposal(0x199abe0, 0xc000042048,
0x19af820, 0xc0058c2f00, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/src/github.com/okex/okchain/x/gov/handler.go:46
+0x22b\ngithub.com/okex/okchain/x/gov.NewHandler.func1(0x199abe0, 0xc000042048,
0x19af820, 0xc0058c2f00, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/src/github.com/okex/okchain/x/gov/handler.go:23
+0x4de\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runMsgs(0xc00002cc80, 0x199abe0,
0xc000042048, 0x19af820, 0xc0058c2f00, 0xa, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/pkg/mod/github.com/okex/[email protected]/baseapp/baseapp.go:791
+0xc14\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx(0xc00002cc80, 0x102,
0xc0035757a0, 0x107, 0x107, 0x198bc20, 0xc0054f2ba0, 0x0, 0x0, 0x0, ...)\n\t/go/pkg/mod/github.com/okex/[email protected]/baseapp/baseapp.go:967
+0x40f\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).DeliverTx(0xc00002cc80,
0xc0035757a0, 0x107, 0x107, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/pkg/mod/github.com/okex/[email protected]/baseapp/baseapp.go:721
+0x2c1\ngithub.com/okex/okchain/app.(*OKChainApp).DeliverTx(0xc00033a240, 0xc0035757a0,
0x107, 0x107, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/src/github.com/okex/okchain/app/abci.go:19
+0xf3\ngithub.com/tendermint/tendermint/abci/client.(*localClient).DeliverTxAsync(0xc000335380,
0xc0035757a0, 0x107, 0x107, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/go/pkg/mod/github.com/okex/[email protected]/abci/client/local_client.go:88
+0xed\ngithub.com/tendermint/tendermint/proxy.(*appConnConsensus).DeliverTxAsync(0xc00115ef00,
0xc0035757a0, 0x107, 0x107, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/go/pkg/mod/github.com/okex/[email protected]/proxy/app_conn.go:73
+0x5e\ngithub.com/tendermint/tendermint/state.execBlockOnProxyApp(0x199b660, 0xc0011611e0,
0x19a7540, 0xc00115ef00, 0xc003cf90e0, 0x19b23a0, 0xc000010368, 0x5ffd, 0x11, 0xc0046a96e0)\n\t/go/pkg/mod/github.com/okex/[email protected]/state/execution.go:301
+0xab4\ngithub.com/tendermint/tendermint/state.(*BlockExecutor).ApplyBlock(0xc000ad4bd0,
0xa, 0x0, 0xc001158970, 0x7, 0xc001158990, 0x7, 0x5ffd, 0x11, 0xc0046a96e0, ...)\n\t/go/pkg/mod/github.com/okex/[email protected]/state/execution.go:139
+0x139\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).finalizeCommit(0xc00050dc00,
0x5ffe)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1453
+0x96e\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).tryFinalizeCommit(0xc00050dc00,
0x5ffe)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1370
+0x383\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).enterCommit.func1(0xc00050dc00,
0x0, 0x5ffe)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1305
+0x90\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).enterCommit(0xc00050dc00,
0x5ffe, 0x0)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1342
+0x685\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).addVote(0xc00050dc00,
0xc0053e2820, 0x0, 0x0, 0xc000d89ac0, 0x436571, 0x1741670)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1822
+0xb34\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).tryAddVote(0xc00050dc00,
0xc0053e2820, 0x0, 0x0, 0x8, 0xc000d89ad0, 0x4b7fed)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1651
+0x59\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).handleMsg(0xc00050dc00,
0x1974ca0, 0xc0030ce198, 0x0, 0x0)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:708
+0x252\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine(0xc00050dc00,
0x0)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:659
+0x579\ncreated by github.com/tendermint/tendermint/consensus.(*ConsensusState).OnStart\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:335
+0x13a\n"}'
logs: []
info: ""
gaswanted: 200000
gasused: 33541
codespace: sdk
tx: null
timestamp: ""
events: []
v0.10.0
when I query the params of token moudule,base_fee shows 0.0125okt,but in factly the system fee is not fixed
command input:
1、$ okchaincli query token params -o json --chain-id okchain --node tcp://192.168.80.98:20157
result:
{
'base_fee': {
'denom': 'okt',
'amount': '0.01250000'
},
'issue_fee': {
'denom': 'okt',
'amount': '20000.00000000'
},
'mint_fee': {
'denom': 'okt',
'amount': '2000.00000000'
},
'burn_fee': {
'denom': 'okt',
'amount': '10.00000000'
},
'modify_fee': {
'denom': 'okt',
'amount': '0.00000000'
},
'send_fee': {
'denom': 'okt',
'amount': '0.00000000'
},
'multi_send_fee': {
'denom': 'okt',
'amount': '0.01000000'
},
'transfer_ownership_fee': {
'denom': 'okt',
'amount': '10.00000000'
}
}
v0.10.0
The gas flags below are not displayed for new/cancel order transactions
--gas string gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
--gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1)
--gas-prices string Gas prices to determine the transaction fee (e.g. 1okt)
The node cannot start properly when the physical machine where okchain is located is powered off and restarted,
command input:
docker logs like this:
Did you reset Tendermint without resetting your application's data?
goroutine 1 [running]:
github.com/tendermint/tendermint/consensus.assertAppHashEqualsOneFromState(0xc000c53280, 0x20, 0x20, 0xa, 0x0, 0xc000ce9837, 0x7, 0xc000ce9847, 0x7, 0x343b0, ...)
/go/pkg/mod/github.com/okex/[email protected]/consensus/replay.go:497 +0x1e8
github.com/tendermint/tendermint/consensus.(*Handshaker).ReplayBlocks(0xc000496d80, 0xa, 0x0, 0xc000ce9837, 0x7, 0xc000ce9847, 0x7, 0x343b0, 0x113, 0xc000a8d000, ...)
/go/pkg/mod/github.com/okex/[email protected]/consensus/replay.go:375 +0xa8e
github.com/tendermint/tendermint/consensus.(*Handshaker).Handshake(0xc000496d80, 0x19d9540, 0xc00114a4d0, 0xc000e23108, 0x413689)
/go/pkg/mod/github.com/okex/[email protected]/consensus/replay.go:269 +0x605
github.com/tendermint/tendermint/node.doHandshake(0x19d8ac0, 0xc000aa8530, 0xa, 0x0, 0xc000ce9837, 0x7, 0xc000ce9847, 0x7, 0x343b0, 0x113, ...)
/go/pkg/mod/github.com/okex/[email protected]/node/node.go:279 +0x1ee
github.com/tendermint/tendermint/node.NewNode(0xc000df0420, 0x19b9460, 0xc001131180, 0xc000f69880, 0x1999c40, 0xc000f708a0, 0xc000f69a60, 0x17560a0, 0xc000f69a70, 0x19c0720, ...)
/go/pkg/mod/github.com/okex/[email protected]/node/node.go:600 +0x35d
github.com/cosmos/cosmos-sdk/server.startInProcess(0xc000aaff60, 0xc000158e00, 0x1756988, 0x1756990, 0x0, 0x0, 0xc04260)
/go/pkg/mod/github.com/okex/[email protected]/server/start.go:169 +0x576
github.com/cosmos/cosmos-sdk/server.StartCmd.func1(0xc000baa780, 0x2520be0, 0x0, 0x0, 0x0, 0x0)
/go/pkg/mod/github.com/okex/[email protected]/server/start.go:70 +0xed
github.com/spf13/cobra.(*Command).execute(0xc000baa780, 0x2520be0, 0x0, 0x0, 0xc000baa780, 0x2520be0)
/go/pkg/mod/github.com/spf13/[email protected]/command.go:826 +0x465
github.com/spf13/cobra.(*Command).ExecuteC(0xc0004c6c80, 0x1577244, 0xc000e17ed0, 0xbef954)
/go/pkg/mod/github.com/spf13/[email protected]/command.go:914 +0x2fc
github.com/spf13/cobra.(*Command).Execute(...)
/go/pkg/mod/github.com/spf13/[email protected]/command.go:864
github.com/tendermint/tendermint/libs/cli.Executor.Execute(0xc0004c6c80, 0x1756dc8, 0x1558045, 0x10)
/go/pkg/mod/github.com/okex/[email protected]/libs/cli/setup.go:89 +0x3c
main.main()
/go/src/github.com/okex/okchain/cmd/okchaind/main.go:64 +0x8df
panic: state.AppHash does not match AppHash after replay. Got
6FFAC15D8711706F81F35E3C254BE2CB9337DD77BD86A0DB1B699372FCEE3A4A, expected 9568C162083181D0129F717C5490DBC21F57387FC4C3199C202BCB9FC0388358.
State: {{{10 0} 0.32.10} okchain 213936 275 6FDCF23162FD150ABBCD4B0CF85D311F0DCB44BDE589E4EC6A8D94F631C89D3F:1:8E64EB0A2BB6 2020-05-03 09:56:07.331376459 +0000 UTC ValidatorSet{
Proposer: Validator{8E3DECB8BE9120A05FB0011E7386E738AC60F8AA PubKeyEd25519{5B144215E15CB286EE35626FF02B8E2E7912DE43594F04A65E222FFAC2BE333D} VP:1 A:0}
Validators:
Validator{1E6F379E5C07E375F3A128BB57B9C0DE92006ECE PubKeyEd25519{028B541B84931161082466C4D7D41492AC23ACFB9C09DC61BE93DDB0520B7FED} VP:1 A:0}
Validator{8E3DECB8BE9120A05FB0011E7386E738AC60F8AA PubKeyEd25519{5B144215E15CB286EE35626FF02B8E2E7912DE43594F04A65E222FFAC2BE333D} VP:1 A:0}
} ValidatorSet{
Proposer: Validator{1E6F379E5C07E375F3A128BB57B9C0DE92006ECE PubKeyEd25519{028B541B84931161082466C4D7D41492AC23ACFB9C09DC61BE93DDB0520B7FED} VP:1 A:-1}
Validators:
Validator{1E6F379E5C07E375F3A128BB57B9C0DE92006ECE PubKeyEd25519{028B541B84931161082466C4D7D41492AC23ACFB9C09DC61BE93DDB0520B7FED} VP:1 A:-1}
Validator{8E3DECB8BE9120A05FB0011E7386E738AC60F8AA PubKeyEd25519{5B144215E15CB286EE35626FF02B8E2E7912DE43594F04A65E222FFAC2BE333D} VP:1 A:1}
} ValidatorSet{
Proposer: Validator{8E3DECB8BE9120A05FB0011E7386E738AC60F8AA PubKeyEd25519{5B144215E15CB286EE35626FF02B8E2E7912DE43594F04A65E222FFAC2BE333D} VP:1 A:0}
Validators:
Validator{1E6F379E5C07E375F3A128BB57B9C0DE92006ECE PubKeyEd25519{028B541B84931161082466C4D7D41492AC23ACFB9C09DC61BE93DDB0520B7FED} VP:1 A:0}
Validator{8E3DECB8BE9120A05FB0011E7386E738AC60F8AA PubKeyEd25519{5B144215E15CB286EE35626FF02B8E2E7912DE43594F04A65E222FFAC2BE333D} VP:1 A:0}
} 52418 {{22020096 -1 1000} {100000} {[ed25519]}} 1 [] [149 104 193 98 8 49 129 208 18 159 113 124 84 144 219 194 31 87 56 127 196 195 25 156 32 43 203 159 192 56 131 88]}
D[2020-04-30|12:16:11.972][1] AllocateTokens module=distr TotalFee=0.95254582okt
D[2020-04-30|12:16:11.973][1] allocate by equal module=distr okchainvaloper1p6ldld3y8ly5pt4kh4lq848luwmh6skaz37cmy=0.11906822okt
D[2020-04-30|12:16:11.973][1] allocate by equal module=distr okchainvaloper1g7znsf24w4jc3xfca88pq9kmlyjdare6mph5rx=0.11906822okt
D[2020-04-30|12:16:11.973][1] allocate by votes module=distr okchainvaloper1p6ldld3y8ly5pt4kh4lq848luwmh6skaz37cmy=0.23813645okt
D[2020-04-30|12:16:11.973][1] allocate by votes module=distr okchainvaloper1g7znsf24w4jc3xfca88pq9kmlyjdare6mph5rx=0.23813645okt
D[2020-04-30|12:16:11.973][1] allocate by votes module=distr okchainvaloper1alq9na49n9yycysh889rl90g9nhe58lcs50wu5=0.
v0.10.0
okchaind export --for-zero-height
, but it came out about a panic messagepanic: invariant broken: order: locks invariant
token ModuleAccount coins: 0.25919998okt
sum of locks amounts:
CRITICAL please submit the following transaction:
tx crisis invariant-broken order module-account
goroutine 1 [running]:
github.com/cosmos/cosmos-sdk/x/crisis/internal/keeper.Keeper.AssertInvariants(0xc000f32f00, 0xc, 0x10, 0xc000f3a070, 0x19ac3a0, 0xc0000849f0, 0x19ac3e0, 0xc000084a90, 0xc001da7140, 0x6, ...)
/root/go/pkg/mod/github.com/okex/[email protected]/x/crisis/internal/keeper/keeper.go:77 +0x572
github.com/okex/okchain/app.(*OKChainApp).prepForZeroHeightGenesis(0xc0000183d0, 0x19be620, 0xc000042088, 0x19d4420, 0xc00106b2c0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/root/go/src/github.com/okex/okchain/app/export.go:66 +0x185
github.com/okex/okchain/app.(*OKChainApp).ExportAppStateAndValidators(0xc0000183d0, 0xc0010de201, 0x2721de0, 0x0, 0x0, 0x0, 0xc8b001, 0x1, 0x0, 0x0, ...)
/root/go/src/github.com/okex/okchain/app/export.go:25 +0x395
main.exportAppStateAndTMValidators(0x19bf0a0, 0xc0010de280, 0x19d74a0, 0xc0004ac3c8, 0x0, 0x0, 0xffffffffffffffff, 0x416f01, 0x2721de0, 0x0, ...)
/root/go/src/github.com/okex/okchain/cmd/okchaind/main.go:92 +0x2c5
github.com/cosmos/cosmos-sdk/server.ExportCmd.func1(0xc000ff4f00, 0xc000fa9620, 0x0, 0x3, 0x0, 0x0)
/root/go/pkg/mod/github.com/okex/[email protected]/server/export.go:65 +0x2d7
github.com/spf13/cobra.(*Command).execute(0xc000ff4f00, 0xc000fa9590, 0x3, 0x3, 0xc000ff4f00, 0xc000fa9590)
/root/go/pkg/mod/github.com/spf13/[email protected]/command.go:826 +0x465
github.com/spf13/cobra.(*Command).ExecuteC(0xc000fd8280, 0x1575a53, 0xc000bd7ed0, 0xbf3424)
/root/go/pkg/mod/github.com/spf13/[email protected]/command.go:914 +0x2fc
github.com/spf13/cobra.(*Command).Execute(...)
/root/go/pkg/mod/github.com/spf13/[email protected]/command.go:864
github.com/tendermint/tendermint/libs/cli.Executor.Execute(0xc000fd8280, 0x17558c0, 0x1556854, 0x10)
/root/go/pkg/mod/github.com/okex/[email protected]/libs/cli/setup.go:89 +0x3c
main.main()
/root/go/src/github.com/okex/okchain/cmd/okchaind/main.go:64 +0x8df
The same validator withdraw-reward continuously ,when there are no reward to be withdraw,the command execute success with no prompt information
command input:
1、okchaincli tx distr withdraw-rewards okchainvaloper1alq9na49n9yycysh889rl90g9nhe58lcs50wu5 --from val1 -y -b block --fees 0.002okt -o json
2、okchaincli tx distr withdraw-rewards okchainvaloper1alq9na49n9yycysh889rl90g9nhe58lcs50wu5 --from val1 -y -b block --fees 0.002okt -o json
result :
{
'height': '282058',
'txhash': '22C962642C32688A89E8A8F9B1A490023638DB39A08893ACCE65D0EE80EA770C',
'raw_log': '[{"msg_index":0,"success":true,"log":"","events":null}]',
'logs': [{
'msg_index': 0,
'success': True,
'log': '',
'events': None
}],
'gas_wanted': '200000',
'gas_used': '28125',
'events': [{
'type': 'message',
'attributes': [{
'key': 'module',
'value': 'distribution'
}, {
'key': 'sender',
'value': 'okchainvaloper1alq9na49n9yycysh889rl90g9nhe58lcs50wu5'
}, {
'key': 'action',
'value': 'withdraw_validator_commission'
}, {
'key': 'fee',
'value': '0.00200000okt'
}, {
'key': 'sender',
'value': 'okchain1alq9na49n9yycysh889rl90g9nhe58lcv27tfj'
}]
}, {
'type': 'transfer',
'attributes': [{
'key': 'recipient',
'value': 'okchain17xpfvakm2amg962yls6f84z3kell8c5ljresa7'
}, {
'key': 'amount',
'value': '0.00200000okt'
}]
}, {
'type': 'withdraw_commission',
'attributes': [{
'key': 'amount'
}]
}]
}
v0.10.1
As the default value of msd, it seems useless for the adaptable params MinSelfDelegationLimited
in staking params.
Uselessness of the params, MinSelfDelegationLimited
, which could be changed by validator's proposal, makes a waste of params check in func handleMsgCreateValidator(...)...
.
It's better to keep pace with issue #46 by removing the adaptable params MinSelfDelegationLimited
.
vote to val0, then check the distr log information. in the same epoch the power not change,but the val0 allocate by votes increased
command input:
result :
D[2020-05-13|06:34:19.341][1] AllocateTokens module=distr TotalFee=0.95254582okt
D[2020-05-13|06:34:19.341][1] allocate by equal module=distr okchainvaloper1g7znsf24w4jc3xfca88pq9kmlyjdare6mph5rx=0.11668686okt
D[2020-05-13|06:34:19.341][1] allocate by equal module=distr okchainvaloper1alq9na49n9yycysh889rl90g9nhe58lcs50wu5=0.11668686okt
D[2020-05-13|06:34:19.341][1] allocate by votes module=distr okchainvaloper1g7znsf24w4jc3xfca88pq9kmlyjdare6mph5rx=
D[2020-05-13|06:34:19.341][1] allocate by votes module=distr okchainvaloper1alq9na49n9yycysh889rl90g9nhe58lcs50wu5=0.70012115okt
D[2020-05-13|06:34:19.341][1] Send remaining to community pool module=distr remaining=0.01905095okt
D[2020-05-13|06:34:20.355][1] Power module=distr okchainvaloper13c77ew97jys2qhasqy088ph88zkxp792mzevs2=1
D[2020-05-13|06:34:20.355][1] Power module=distr okchainvaloper1usxs075glhcy7jg0gmj47j08kezr6hd7mthj4c=56236561
D[2020-05-13|06:34:20.355][1] AllocateTokens module=distr TotalFee=0.95254582okt
D[2020-05-13|06:34:20.355][1] allocate by equal module=distr okchainvaloper1g7znsf24w4jc3xfca88pq9kmlyjdare6mph5rx=0.11668686okt
D[2020-05-13|06:34:20.355][1] allocate by equal module=distr okchainvaloper1alq9na49n9yycysh889rl90g9nhe58lcs50wu5=0.11668686okt
D[2020-05-13|06:34:20.356][1] allocate by votes module=distr okchainvaloper1g7znsf24w4jc3xfca88pq9kmlyjdare6mph5rx=
D[2020-05-13|06:34:20.356][1] allocate by votes module=distr okchainvaloper1alq9na49n9yycysh889rl90g9nhe58lcs50wu5=0.70012115okt
D[2020-05-13|06:34:20.356][1] Send remaining to community pool module=distr remaining=0.01905095okt
D[2020-05-13|06:34:21.398][1] Power module=distr okchainvaloper13c77ew97jys2qhasqy088ph88zkxp792mzevs2=1
D[2020-05-13|06:34:21.398][1] Power module=distr okchainvaloper1usxs075glhcy7jg0gmj47j08kezr6hd7mthj4c=56236561
D[2020-05-13|06:34:21.398][1] AllocateTokens module=distr TotalFee=0.95454582okt
D[2020-05-13|06:34:21.398][1] allocate by equal module=distr okchainvaloper1g7znsf24w4jc3xfca88pq9kmlyjdare6mph5rx=0.11693186okt
D[2020-05-13|06:34:21.398][1] allocate by equal module=distr okchainvaloper1alq9na49n9yycysh889rl90g9nhe58lcs50wu5=0.11693186okt
D[2020-05-13|06:34:21.399][1] allocate by votes module=distr okchainvaloper1g7znsf24w4jc3xfca88pq9kmlyjdare6mph5rx=0.14031823okt
D[2020-05-13|06:34:21.399][1] allocate by votes module=distr okchainvaloper1alq9na49n9yycysh889rl90g9nhe58lcs50wu5=0.56127292okt
D[2020-05-13|06:34:21.399][1] Send remaining to community pool module=distr remaining=0.01909095okt
D[2020-05-13|06:34:22.391][1] Power module=distr okchainvaloper13c77ew97jys2qhasqy088ph88zkxp792mzevs2=1
D[2020-05-13|06:34:22.391][1] Power module=distr okchainvaloper1usxs075glhcy7jg0gmj47j08kezr6hd7mthj4c=56236561
D[2020-05-13|06:34:22.391][1] AllocateTokens module=distr TotalFee=0.95254582okt
D[2020-05-13|06:34:22.392][1] allocate by equal module=distr okchainvaloper1g7znsf24w4jc3xfca88pq9kmlyjdare6mph5rx=0.11668686okt
D[2020-05-13|06:34:22.392][1] allocate by equal module=distr okchainvaloper1alq9na49n9yycysh889rl90g9nhe58lcs50wu5=0.11668686okt
D[2020-05-13|06:34:22.392][1] allocate by votes module=distr okchainvaloper1g7znsf24w4jc3xfca88pq9kmlyjdare6mph5rx=0.14002423okt
D[2020-05-13|06:34:22.392][1] allocate by votes module=distr okchainvaloper1alq9na49n9yycysh889rl90g9nhe58lcs50wu5=0.56009692okt
D[2020-05-13|06:34:22.392][1] Send remaining to community pool module=distr remaining=0.01905095okt
D[2020-05-13|06:34:23.411][1] Power module=distr okchainvaloper13c77ew97jys2qhasqy088ph88zkxp792mzevs2=1
D[2020-05-13|06:34:23.411][1] Power module=distr okchainvaloper1usxs075glhcy7jg0gmj47j08kezr6hd7mthj4c=56236561
D[2020-05-13|06:34:23.411][1] AllocateTokens module=distr TotalFee=0.95254582okt
v0.10.1
the param community_tax's default value is 0.00000000,it should be 0.02000000
command input:
1、okchaincli query distr params -o json
result :
{'community_tax': '0.00000000', 'withdraw_addr_enabled': True}
v0.10.1
there's not delist command provided for user, so parameters related to delist should not show
command input:
1、okchaincli query dex params -o json --chain-id okchain --node tcp://192.168.80.98:20157
result :
{'list_fee': {'denom': 'okt', 'amount': '20000.00000000'}, 'transfer_ownership_fee': {'denom': 'okt', 'amount': '10.00000000'}, 'delist_max_deposit_period': '86400000000000', 'delist_min_deposit': [{'denom': 'okt', 'amount': '100.00000000'}], 'delist_voting_period': '259200000000000', 'withdraw_period': '259200000000000'}
v0.10.0
Param, min self delegation, is removed from okchaincli. The net failed to start by the both ways of genTx and testnet .
As we know, msd was converted to votes on the validator as the rate 1:1 and the voting power
rounds down the total votes. Validator set will be nil as the zero power if the msd is less than 1okt at the beginning of a validator creation. Maybe it's better to improve the default min self delegation over 1okt.
master - a3741bd
change minSelfDelegation
to be less than 1okt in cmd/okchaind/testnet.go
and it will fail to start the net with an error during InitChain
error during handshake: error on replay: validator set is nil in genesis and still empty after InitChain
14:26:00.894][34885] [ABCI interface] ---> InitChain module=main
Since the order transactions do not charge system fee, so users do not have to input fees
flag for new/cancel order tx
command input:
1、$ okchaincli tx order new --product tcoin-3e2_okt -s SELL -p 1 -q 1 --from v101 -y -b block -o json --chain-id okchain --node tcp://192.168.80.98:20157
result:
{"height":"0","txhash":"6B7FD0A6677C940AC2D891DD01A0C7B6381BA1B7E9D0C1C3232EF9887E3591CB","code":14,"raw_log":"{\"codespace\":\"sdk\",\"code\":14,\"message\":\"insufficient fees; got: \\\"\\\" required: \\\"0.00200000okt\\\"\"}","gas_used":"5069"}
this command should execute successfully,not fail
v0.10.0
command input:
$ okchaincli query staking validator okchain1g7znsf24w4jc3xfca88pq9kmlyjdare68lx3kq -o json --chain-id okchain --trust-node=false --node tcp://192.168.80.98:20157
panic:
Error initializing DB: resource temporarily unavailable
goroutine 1 [running]:
github.com/tendermint/tm-db.NewDB(0x4f3d58d, 0xa, 0x4f3c225, 0x9, 0xc000dbb860, 0x29, 0x0, 0x0)
/Users/yangfan/go/pkg/mod/github.com/tendermint/[email protected]/db.go:72 +0x274
github.com/tendermint/tendermint/lite/proxy.NewVerifier(0x7ffeefbff7fd, 0x7, 0xc000dbb860, 0x29, 0x52d9880, 0xc000e20450, 0x52cfce0, 0x5b997c0, 0xa, 0xc000d52690, ...)
/Users/yangfan/go/pkg/mod/github.com/okex/[email protected]/lite/proxy/verifier.go:30 +0x3aa
github.com/cosmos/cosmos-sdk/client/context.createVerifier(0x7ffeefbff81f, 0x19)
/Users/yangfan/go/pkg/mod/github.com/okex/[email protected]/client/context/context.go:139 +0x39e
github.com/cosmos/cosmos-sdk/client/context.NewCLIContextWithFrom(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/yangfan/go/pkg/mod/github.com/okex/[email protected]/client/context/context.go:79 +0x55e
github.com/cosmos/cosmos-sdk/client/context.NewCLIContext(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/yangfan/go/pkg/mod/github.com/okex/[email protected]/client/context/context.go:105 +0x8e
github.com/okex/okchain/x/staking/client/cli.GetCmdQueryValidator.func1(0xc000da4000, 0xc000d67e00, 0x1, 0x8, 0x0, 0x0)
/Users/yangfan/go/src/github.com/okex/okchain/x/staking/client/cli/query.go:56 +0x5b
github.com/spf13/cobra.(*Command).execute(0xc000da4000, 0xc000d67d00, 0x8, 0x8, 0xc000da4000, 0xc000d67d00)
/Users/yangfan/go/pkg/mod/github.com/spf13/[email protected]/command.go:826 +0x460
github.com/spf13/cobra.(*Command).ExecuteC(0xc000d6a280, 0x483bfd0, 0xc000d6a280, 0x4f395e9)
/Users/yangfan/go/pkg/mod/github.com/spf13/[email protected]/command.go:914 +0x2fb
github.com/spf13/cobra.(*Command).Execute(...)
/Users/yangfan/go/pkg/mod/github.com/spf13/[email protected]/command.go:864
github.com/tendermint/tendermint/libs/cli.Executor.Execute(0xc000d6a280, 0x513baf0, 0x7, 0xc000c96060)
/Users/yangfan/go/pkg/mod/github.com/okex/[email protected]/libs/cli/setup.go:89 +0x3c
main.main()
/Users/yangfan/go/src/github.com/okex/okchain/cmd/okchaincli/main.go:78 +0x646
v0.10.0
command input:
$ okchaincli tx token multi-send --from captain --transfers '[{"to":"okchain1mc6syewprrepkrqn8lzzz2t g6f6tvccu93dn62","amount":"0.02591okt"}]' -b block -y --fees 0.002
panic:
panic: invalid decimal coin expression: 0.02
v0.10.0
command input:
$ okchaincli tx token multi-send --from captain --transfers '[{"to":"okchain1mc6syewprrepkrqn8lzzz2t g6f6tvccu93dn62","amount":"0.02591okt"}]' -b block -y --fees 0.002
(pic is not required)
The function RegisterInvariants
traverses all modules, and every module registers its invariant defined by itself.
However, this process will load the module data from a map
.
Accordingly, if one module doesn't initialize its module account in the stage of initGenesis
, but meanwhile, it tries to get module account in the invariant check, it will initialize the module account in the latter stage.
That is why some module account number is different among the multi nodes, leading to the AppHash
inconsistent eventually, though its phenomenon shows up occasionally.
the commit before https://github.com/okex/okchain/commit/f87c0a3ac0cdc74b576beb6c4c7078b0610c5f78
run in the multi-node network by any way
There's no record in fullnode's sqlite.db After I place an order
command input:
1、okchaincli tx order new --product acoin-e6a_okt -s SELL -p 200 -q 1 --from v101 --fees 0.002okt -y -b block -o json --chain-id okchain --node tcp://192.168.80.98:20157
2、cd /root/okchain_data/full0/okchaind/data
3、sqlite3 sqlite.db
4、select * from orders
result:
sqlite> .tables
deals kline_m120 kline_m3 kline_m60 transactions
fee_details kline_m1440 kline_m30 kline_m720
kline_m1 kline_m15 kline_m360 match_results
kline_m10080 kline_m240 kline_m5 orders
sqlite> select * from orders
...> ;
sqlite>
users balance of okt should be :2000001.00000000 - 0.25920000 -0.002 = 2000000.73880000 not 000000.74080000
## Version
v0.10.0
#### For Admin Use
- [ ] Not duplicate issue
- [ ] Appropriate labels applied
- [ ] Appropriate contributors tagged
- [ ] Contributor assigned/self-assigned
"okchaincli version --long" command Missing return information
v0.10.0
1、excute command "okchaincli version --long",return message like this:
name: ""
server_name: ""
client_name: ""
version: ""
commit: ""
build_tags: ""
go: |
go version go1.13.5 linux/amd64
cosmossdk: ""
tendermint: ""
vendordirhash: ""
when I orders new the Block chain does not block
command input:
1、okchaincli tx order new --product bcoin-13a_okt,bcoin-13a_okt,bcoin-13a_okt,bcoin-13a_okt,bcoin-13a_okt,bcoin-13a_okt,bcoin-13a_okt,bcoin-13a_okt -s BUY,BUY,BUY,BUY,BUY,BUY,BUY,BUY -p 270,271,272,273,274,275,276,277 -q 1,1,1,1,1,1,1,1 --from v101 --gas 500000 --fees 0.5okt -y -b block -o json --chain-id okchain --node tcp://192.168.80.98:20157
okchain logs :
E[2020-05-08|12:24:51.209][1] CONSENSUS FAILURE!!!
module=consensus err="runtime error: invalid memory address or nil pointer dereference" stack="goroutine 280 [running]:\nruntime/debug.Stack(0xc000bf5338, 0x13b5a60, 0x249fc60)\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x9d\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine.func2(0xc00006f180, 0x1755fb0)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:612 +0x57\npanic(0x13b5a60, 0x249fc60)\n\t/usr/local/go/src/runtime/panic.go:522 +0x1b5\ngithub.com/okex/okchain/x/order/match/periodicauction.fillOrderByKey(0x19bfca0, 0xc0000cc040, 0x19d5a40, 0xc0051f6b40, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/src/github.com/okex/okchain/x/order/match/periodicauction/fill.go:154 +0x2ac\ngithub.com/okex/okchain/x/order/match/periodicauction.fillBuyOrders(0x19bfca0, 0xc0000cc040, 0x19d5a40, 0xc0051f6b40, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/src/github.com/okex/okchain/x/order/match/periodicauction/fill.go:35 +0x41a\ngithub.com/okex/okchain/x/order/match/periodicauction.fillDepthBook(0x19bfca0, 0xc0000cc040, 0x19d5a40, 0xc0051f6b40, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/src/github.com/okex/okchain/x/order/match/periodicauction/fill.go:121 +0x100\ngithub.com/okex/okchain/x/order/match/periodicauction.executeMatchedUpdatedProduct(0x19bfca0, 0xc0000cc040, 0x19d5a40, 0xc0051f6b40, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/src/github.com/okex/okchain/x/order/match/periodicauction/match.go:364 +0x274\ngithub.com/okex/okchain/x/order/match/periodicauction.executeMatch(0x19bfca0, 0xc0000cc040, 0x19d5a40, 0xc0051f6b40, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/src/github.com/okex/okchain/x/order/match/periodicauction/match.go:437 +0x2b4\ngithub.com/okex/okchain/x/order/match/periodicauction.matchOrders(0x19bfca0, 0xc0000cc040, 0x19d5a40, 0xc0051f6b40, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/src/github.com/okex/okchain/x/order/match/periodicauction/match.go:304 +0x560\ngithub.com/okex/okchain/x/order/match/periodicauction.(*PaEngine).Run(0x2520be0, 0x19bfca0, 0xc0000cc040, 0x19d5a40, 0xc0051f6b40, 0xa, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/src/github.com/okex/okchain/x/order/match/periodicauction/impl.go:17 +0x104\ngithub.com/okex/okchain/x/order.EndBlocker(0x19bfca0, 0xc0000cc040, 0x19d5a40, 0xc0051f6b40, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/src/github.com/okex/okchain/x/order/endblocker.go:22 +0x16f\ngithub.com/okex/okchain/x/order.AppModule.EndBlock(...)\n\t/go/src/github.com/okex/okchain/x/order/module.go:135\ngithub.com/cosmos/cosmos-sdk/types/module.(*Manager).EndBlock(0xc000ae8af0, 0x19bfca0, 0xc0000cc040, 0x19d5a40, 0xc0051f6b40, 0xa, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/pkg/mod/github.com/okex/[email protected]/types/module/module.go:306 +0x21c\ngithub.com/okex/okchain/app/protocol.(*ProtocolV0).EndBlocker(...)\n\t/go/src/github.com/okex/okchain/app/protocol/protocol_v0.go:468\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).EndBlock(0xc0000c6500, 0x22d78, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc000cca000, 0x7effbe8146d0, 0x0, ...)\n\t/go/pkg/mod/github.com/okex/[email protected]/baseapp/baseapp.go:1002 +0x16a\ngithub.com/okex/okchain/app.(*OKChainApp).EndBlock(0xc000a5c110, 0x22d78, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/go/src/github.com/okex/okchain/app/abci.go:56 +0x1d1\ngithub.com/tendermint/tendermint/abci/client.(*localClient).EndBlockSync(0xc0010b0720, 0x22d78, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)\n\t/go/pkg/mod/github.com/okex/[email protected]/abci/client/local_client.go:239 +0xea\ngithub.com/tendermint/tendermint/proxy.(*appConnConsensus).EndBlockSync(0xc000de4d20, 0x22d78, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc005611290)\n\t/go/pkg/mod/github.com/okex/[email protected]/proxy/app_conn.go:77 +0x51\ngithub.com/tendermint/tendermint/state.execBlockOnProxyApp(0x19c0720, 0xc0000c11c0, 0x19cce60, 0xc000de4d20, 0xc00502c000, 0x19d8ac0, 0xc000a5c300, 0x22d77, 0x1f6, 0xc002bd9520)\n\t/go/pkg/mod/github.com/okex/[email protected]/state/execution.go:308 +0x6f5\ngithub.com/tendermint/tendermint/state.(*BlockExecutor).ApplyBlock(0xc000128070, 0xa, 0x0, 0xc000e2d7c0, 0x7, 0xc000e2d7d0, 0x7, 0x22d77, 0x1f6, 0xc002bd9520, ...)\n\t/go/pkg/mod/github.com/okex/[email protected]/state/execution.go:139 +0x13d\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).finalizeCommit(0xc00006f180, 0x22d78)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1453 +0x99f\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).tryFinalizeCommit(0xc00006f180, 0x22d78)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1370 +0x3e0\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).enterCommit.func1(0xc00006f180, 0x0, 0x22d78)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1305 +0x91\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).enterCommit(0xc00006f180, 0x22d78, 0x0)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1342 +0x680\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).addVote(0xc00006f180, 0xc004ca54a0, 0xc001097110, 0x28, 0xc0031ca000, 0xc004c08900, 0x107)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1822 +0xbfb\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).tryAddVote(0xc00006f180, 0xc004ca54a0, 0xc001097110, 0x28, 0x1414560, 0xed6474601, 0xc005379440)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:1651 +0x5c\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).handleMsg(0xc00006f180, 0x1999ac0, 0xc005e13278, 0xc001097110, 0x28)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:708 +0x260\ngithub.com/tendermint/tendermint/consensus.(*ConsensusState).receiveRoutine(0xc00006f180, 0x0)\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:643 +0x6d3\ncreated by github.com/tendermint/tendermint/consensus.(*ConsensusState).OnStart\n\t/go/pkg/mod/github.com/okex/[email protected]/consensus/state.go:335 +0x13a\n"
v0.10.0
1、excute okchaincli query token params
result :
ERROR: {"codespace":"sdk","code":1,"message":"failed to load state at height 200; version does not exist (latest height: 200)"}
I create a new valitator and delegate enough vote make it to va,until the next epoch .then all nodes stop blocking
command input:
1、okchaincli tx staking proxy bind okchain1rsuy5qrx60xt2j0vk535am5ttpxndjmw6274dk --from v100 --fees 0.00200000okt -y -b block -o json --chain-id okchain --node tcp://192.168.80.98:20157
2、okchaincli tx staking proxy bind okchain1c3je8nsrw9eqvul8dtavfe30my5lsaazl00t7y --from proxy2 -y -b block -o json --chain-id okchain --node tcp://192.168.80.98:20157
3、okchaincli query staking delegator okchain1rsuy5qrx60xt2j0vk535am5ttpxndjmw6274dk --trust-node -o json --chain-id okchain --node tcp://192.168.80.98:20157
4、 okchaincli query staking delegator okchain1xsssjp2ha2mf64c5dsd5g6t469u4yxuzhev4kx --trust-node -o json --chain-id okchain --node tcp://192.168.80.98:20157
result :
3、{
'delegator_address': 'okchain1rsuy5qrx60xt2j0vk535am5ttpxndjmw6274dk',
'validator_address': None,
'shares': '0.00000000',
'tokens': '20.00000000',
'unbonded_tokens': '0.00000000',
'completion_time': '1970-01-01T00:00:00Z',
'is_proxy': True,
'total_delegated_tokens': '50.00000000',
'proxy_address': ''
}
4、{
'delegator_address': 'okchain1xsssjp2ha2mf64c5dsd5g6t469u4yxuzhev4kx',
'validator_address': ['okchainvaloper1alq9na49n9yycysh889rl90g9nhe58lcs50wu5'],
'shares': '168709680.76547520',
'tokens': '20.00000000',
'unbonded_tokens': '0.00000000',
'completion_time': '1970-01-01T00:00:00Z',
'is_proxy': True,
'total_delegated_tokens': '50.00000000',
'proxy_address': ''
}
v0.10.1
There's a wrong tips for query signing-info in slashing module
v0.10.0
Command input:
okchaincli query slashing signing-info -h
Result:
$ <appcli> query slashing signing-info cosmosvalconspub1zcjduepqfhvwcmt7p06fvdgexxhmz0l8c7sgswl7ulv7aulk364x4g5xsw7sr0k2g5
Desired result:
$ <appcli> query slashing signing-info okchainvalconspub1zcjduepqfhvwcmt7p06fvdgexxhmz0l8c7sgswl7ulv7aulk364x4g5xsw7sr0k2g5
As the default value of msd during the validator creation, it's acceptable to remove the field MinSelfDelegation
from MsgCreateValidator technically.
Field MinSelfDelegation
in MsgCreateValidator is useless now.
It's a good idea to make the bytes length of any msg as short as possible for the fees paid.
error during handshake: error on replay: Wrong Block.Data.Txs Number. MaxTxNumPerBlock 0, got 38
command input:
1、okchaincli query distr params
result:
communitytax:
- 34
- 48
- 46
- 48
- 48
- 48
- 48
- 48
- 48
- 48
- 48
- 34
withdrawaddrenabled:
- 116
- 114
- 117
- 101
v0.10.0
When using the code from cosmos-sdk, there is some code in the module of x/distribution without any changing.
I can't get all the match result by backend matches query command, several results are missing
command input:
1、okchaincli tx order new --product acoin-5a8_okt,acoin-5a8_okt,bcoin-13a_okt,bcoin-13a_okt -s BUY,BUY,BUY,BUY -p 230,240,230,240 -q 1,1,1,1 --from v101 --gas 500000 --fees 0.005okt -y -b block -o json --chain-id okchain --node tcp://192.168.80.98:20157
2、okchaincli query backend matches
3、okchaincli tx order new --product acoin-5a8_okt,acoin-5a8_okt,bcoin-13a_okt,bcoin-13a_okt -s BUY,BUY,BUY,BUY -p 230,240,230,240 -q 1,1,1,1 --from v101 --gas 500000 --fees 0.005okt -y -b block -o json --chain-id okchain --node tcp://192.168.80.98:20157
4、okchaincli query backend matches
5、okchaincli tx order new --product acoin-5a8_okt,acoin-5a8_okt,bcoin-13a_okt,bcoin-13a_okt -s BUY,BUY,BUY,BUY -p 230,240,230,240 -q 1,1,1,1 --from v101 --gas 500000 --fees 0.005okt -y -b block -o json --chain-id okchain --node tcp://192.168.80.98:20157
6、okchaincli query backend matches
result :the second matches result didn't return by executing the command "okchaincli query backend matches"
v0.10.0
when there's no tx in block,the mint token's number 0.95064263 =(10000000000*1%)/10519200 per block
the distr module's totalFee is 0.95254582okt per block get by logs
the totalFee should be 0.95064263 * 98% = 0.931629777 not 0.95254582
command input:
1、okchaincli query token info okt
2、cd home/okchain_data
3、tail -f okchaind.log |grep distr
result:
1、description: OK Group Global Utility Token
symbol: okt
originalsymbol: OKT
wholename: OKT
originaltotalsupply: "1000000000.00000000"
totalsupply: "1002059924.31131420"
owner: okchain10q0rk5qnyag7wfvvt7rtphlw589m7frsmyq4ya
mintable: true
D[2020-04-30|12:16:11.972][1] AllocateTokens module=distr TotalFee=0.95254582okt
D[2020-04-30|12:16:11.973][1] allocate by equal module=distr okchainvaloper1p6ldld3y8ly5pt4kh4lq848luwmh6skaz37cmy=0.11906822okt
D[2020-04-30|12:16:11.973][1] allocate by equal module=distr okchainvaloper1g7znsf24w4jc3xfca88pq9kmlyjdare6mph5rx=0.11906822okt
D[2020-04-30|12:16:11.973][1] allocate by votes module=distr okchainvaloper1p6ldld3y8ly5pt4kh4lq848luwmh6skaz37cmy=0.23813645okt
D[2020-04-30|12:16:11.973][1] allocate by votes module=distr okchainvaloper1g7znsf24w4jc3xfca88pq9kmlyjdare6mph5rx=0.23813645okt
D[2020-04-30|12:16:11.973][1] allocate by votes module=distr okchainvaloper1alq9na49n9yycysh889rl90g9nhe58lcs50wu5=0.
v0.10.0
go.sum
is out of date.master
is to use the commit id
or an invariant tag
.v0.10.0
I sell acoin-232 when I don't have enough balance of this token,the prompt message return all kinds of my tokens. That's not very friendly for users
command input:
1、$ okchaincli tx order new --product acoin-232_okt -s SELL -p 99 -q 1 --from v101 --fees 0.002okt -y -b block -o json --chain-id okchain --node tcp://192.168.80.98:20157
result:
{'height': '0', 'txhash': 'FA34C8F6543E86B145ACA1D336B16B24205A58382D558A7DBD6599199E63AA30', 'code': 10, 'raw_log': 'ERROR:\nCodespace: sdk\nCode: 10\nMessage: "insufficient account funds; 0.94100000acoin-232,1.99800000bcoin-f1e,998845.22345400okt is less than 1.00000000acoin-232"\n', 'gas_used': '13532'}
v0.10.0
I create a new valitator and delegate enough vote make it to va,until the next epoch .then all nodes stop blocking
command input:
result :
v0.10.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.