terra-money / classic-core Goto Github PK
View Code? Open in Web Editor NEWGO implementation of the Terra Protocol
Home Page: https://www.terra.money
License: Other
GO implementation of the Terra Protocol
Home Page: https://www.terra.money
License: Other
Currently the cosmos vesting account has cliffs and daily linear vesting. We need a more complicated vesting structure for Terra presale investors.
smrAvgMonth is currently computed as the rolling average of individual smr's. The correct implementation separately sums seigniorage and taxes over the month, then computes the appropriate ratio once.
Sum seigniorage over the month (S)
Sum taxes over the month (T)
Return S / (S + T)
There is no document which explains about gas, gas prices and fee.
Ecosystem builder should be able to get information from doc about fee system include tax.
returned error message from LCD is following:
E[2019-04-23|17:10:35.750] Panic in RPC HTTP handler module=rest-server err="runtime error: invalid memory address or nil pointer dereference" stack="
runtime error: invalid memory address or nil pointer dereference" stack="goroutine 5559 [running]:
runtime/debug.Stack(0xc0020aead0, 0x4a30980, 0x57dab20)
/usr/local/go/src/runtime/debug/stack.go:24 +0x9d
github.com/tendermint/tendermint/rpc/lib/server.RecoverAndLogHandler.func1.1(0xc0032d54a0, 0x505bbe0, 0xc000c08fb0, 0xbf27cf6d52818898, 0x7383d94f45f, 0x57f3f60, 0xc002bd0000)
go/pkg/mod/github.com/tendermint/[email protected]/rpc/lib/server/http_server.go:140 +0x552
panic(0x4a30980, 0x57dab20)
/usr/local/go/src/runtime/panic.go:522 +0x1b5
github.com/cosmos/cosmos-sdk/types.NewResponseFormatBroadcastTxCommit(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
go/pkg/mod/github.com/cosmos/[email protected]/types/result.go:110 +0x58
github.com/cosmos/cosmos-sdk/client/context.CLIContext.BroadcastTxCommit(0xc0001e4ee0, 0xc000c08f70, 0x5074f40, 0xc000c0d520, 0x0, 0x0, 0x50416c0, 0xc0000ce000, 0x4b4a524, 0x4, ...)
go/pkg/mod/github.com/cosmos/[email protected]/client/context/broadcast.go:46 +0x3f1
github.com/cosmos/cosmos-sdk/client/context.CLIContext.BroadcastTx(0xc0001e4ee0, 0xc000c08f70, 0x5074f40, 0xc000c0d520, 0x0, 0x0, 0x50416c0, 0xc0000ce000, 0x4b4a524, 0x4, ...)
go/pkg/mod/github.com/cosmos/[email protected]/client/context/broadcast.go:23 +0x212
github.com/cosmos/cosmos-sdk/client/tx.BroadcastTxRequest.func1(0x5056ae0, 0xc0032d54a0, 0xc002bd0200)
go/pkg/mod/github.com/cosmos/[email protected]/client/tx/broadcast.go:54 +0x2b6
net/http.HandlerFunc.ServeHTTP(0xc000c0d040, 0x5056ae0, 0xc0032d54a0, 0xc002bd0200)
/usr/local/go/src/net/http/server.go:1995 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0001c8e40, 0x5056ae0, 0xc0032d54a0, 0xc002bd0000)
go/pkg/mod/github.com/gorilla/[email protected]/mux.go:212 +0xe3
github.com/tendermint/tendermint/rpc/lib/server.maxBytesHandler.ServeHTTP(0x5040500, 0xc0001c8e40, 0xf4240, 0x5056ae0, 0xc0032d54a0, 0xc002bd0000)
go/pkg/mod/github.com/tendermint/[email protected]/rpc/lib/server/http_server.go:185 +0xd0
github.com/tendermint/tendermint/rpc/lib/server.RecoverAndLogHandler.func1(0x5057160, 0xc002857ea0, 0xc002bd0000)
go/pkg/mod/github.com/tendermint/[email protected]/rpc/lib/server/http_server.go:158 +0x317
net/http.HandlerFunc.ServeHTTP(0xc00099e060, 0x5057160, 0xc002857ea0, 0xc002bd0000)
/usr/local/go/src/net/http/server.go:1995 +0x44
net/http.serverHandler.ServeHTTP(0xc0000ec410, 0x5057160, 0xc002857ea0, 0xc002bd0000)
/usr/local/go/src/net/http/server.go:2774 +0xa8
net/http.(*conn).serve(0xc002bce000, 0x505b060, 0xc002bac180)
/usr/local/go/src/net/http/server.go:1878 +0x851
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2884 +0x2f4
"
Just a branding issue, but we are currently pulling in gaiad.toml instead of our own terrad.toml. Let's host terrad.toml on our github and pull from there instead.
Reasoning
Current swapcoin function does not have any safety feature to protect from abuse or manipulation of oracle&swapcoin
Lacking of safety feature might result in catastrophic minting with inappropriate exchange rates.
Introduction of safety limits can restrict the magnitude of risk and gives time to prevent further manipulations.
Example of possible risk
Oracle script or market price api malfunctioning which leads to huge distortion of exchange rates -> arbitrageur abuse the distorted oracle price to make huge gains from swapcoin
Cartelling of oracle voters to distort oracle price resulting in execution of unfair swapcoin
Instant market price manipulation leads to temporarily popped exchange ratio which might lead to excessive minting from distorted market prices.
Frequent abuse of swapcoin might result in unreasonably strong dilution effect on Luna because of too much minting in short time.
Suggestion of safety limits on swapcoin
24h limit on swapcoin minting : 24h maximum amount of minting of each token by swapcoin methodology.
Halt mechanism on excessive volatility of Luna : temporary(24h) halt mechanism of swapcoin method when the percentage change of oracle price of Luna in 1h exceeds certain limit.
Above limit parameters should be chosen by governance voting after proper discussion and can be changed also via governance.
Some response tag is formatted as bytes of variable raw value.
Response tag should be formatted as string or bytes of string.
resolved by #30
In /x/budget/keeper.go:203, CandQueueIterateExpired function iterates wrong range.
Status:
[candidate-queue:1000001:1,
candidate-queue:1000002:2]
Given Param:
(endBlock = 2)
Expectation:
empty iteration
Real:
[candidate-queue:1000001:1,
candidate-queue:1000002:2]
Reason:
candiate-queue:1 < [candidate-queue:1000001:1, candidate-queue:1000002:2] < candidate-queue:2
Suggestion:
Change CandQueueIterateExpired to iterate only for the given {endBlock} or fill "0"s.
I didn't set the fee when I sent the tx.
The fee is Null but paid(1000mluna).
terrad version --long
cosmos-sdk: 0.0.7-5-g2fb73e4
git commit:
vendor hash:
build tags:
go version go1.12.1 linux/amd64
1. terracli q account terra1nvtzp6jk50q734lpvsxf84d3pezg85p8lqgnyf --chain-id=soju-0007 --output=json | jq
{
"type": "auth/Account",
"value": {
"address": "terra1nvtzp6jk50q734lpvsxf84d3pezg85p8lqgnyf",
"coins": [
{
"denom": "mluna",
"amount": "10000000"
}
],
"public_key": null,
"account_number": "39",
"sequence": "0"
}
}
2. terracli tx send terra1tusfpgvjrplqg2fm7wacy4slzjmnzswcfn9puj 1000000mluna --from=J $chain
{"chain_id":"soju-0007","account_number":"39","sequence":"0","fee":{"amount":null,"gas":"200000"},"msgs":[{"type":"cosmos-sdk/MsgSend","value":{"from_address":"terra1nvtzp6jk50q734lpvsxf84d3pezg85p8lqgnyf","to_address":"terra1tusfpgvjrplqg2fm7wacy4slzjmnzswcfn9puj","amount":[{"denom":"mluna","amount":"1000000"}]}}],"memo":""}
"fee":{"amount":null,"gas":"200000"},"
3. terracli q account terra1nvtzp6jk50q734lpvsxf84d3pezg85p8lqgnyf --chain-id=soju-0007 --output=json | jq
{
"type": "auth/Account",
"value": {
"address": "terra1nvtzp6jk50q734lpvsxf84d3pezg85p8lqgnyf",
"coins": [
{
"denom": "mluna",
"amount": "8999000"
}
],
"public_key": {
"type": "tendermint/PubKeySecp256k1",
"value": "A0HT0WtwAFbNtkm1T7AQ6w2xJpVjDKRhyaHK4DzJSfWx"
},
"account_number": "39",
"sequence": "1"
}
}
For example, change from 'cosmos-sdk/Send' to 'Send'.
Try and test clean terra core build.
Install terra core and build in clean environment; Ensure clean build and test.
resolved by #28
Cosmos SDK has moved from gomalinter to golangci-lint: cosmos/cosmos-sdk#3933
We should do the same.
Resolved by #33
In "terra/cmd/terracli/main.go", treasuryClient is referencing "terra/x/oracle/client".
treasuryClient has to reference "terra/x/treasury/client"
resolved by #26
Related issues on cosmos side:
cosmos/cosmos-sdk#3510
cosmos/cosmos-sdk#2321
Solution: we will be representing all assets on Columbus to be 10^-6 the value of the actual asset (for example, 10^6 "luna" coins on the mainnet will be 1 Luna token traded on an exchange). This is conceptually similar to Bitcoin's satoshis and Eth's Gwei.
TODO: think of new names for Luna and Terra's dust tokens.
resolved by #35
Currently there is no way to know swapped ask coin amount.
Records exact swapped amount to transaction log per msg.
Change the link on " Please skip to Genesis & Seeds."
app, staking, bank modules on Cosmos SDK have stress benchmark tests. We need the same for budget / oracle / treasury
Research comes up with simulation scenarios, and devs implement
Currently we have multiple branches used in development - delete all and leave only develop and master
I hope this topic leads to fruitful discussion among validator community members for better possible adjustment strategies.
Hello, Terra-project team.
I want to connect terra testnet(soju-0006).
So, i built terra core from master branch and performed "terrad init {myname}".
And i changed ~/.terra/config/genesis.json to genesis.json of soju-0006 (https://github.com/terra-project/networks/blob/master/soju-0006/genesis.json).
Also i added seeds and persistent_peers at config.toml
But my terra node can not connect to soju-0006...
How can i join testnet?
P.S. I can not access at https://explorer.terra.money/validators
E[2019-04-11|02:19:09.692] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=0
E[2019-04-11|02:19:09.696] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=0
E[2019-04-11|02:19:09.697] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=0
E[2019-04-11|02:19:09.697] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=0
E[2019-04-11|02:19:10.401] Error dialing peer module=p2p err="auth failure: secrect conn failed: EOF"
E[2019-04-11|02:19:11.955] Error dialing peer module=p2p err="auth failure: secrect conn failed: EOF"
E[2019-04-11|02:19:12.273] Error dialing peer module=p2p err="auth failure: secrect conn failed: EOF"
E[2019-04-11|02:19:12.319] Error dialing peer module=p2p err="auth failure: secrect conn failed: EOF"
E[2019-04-11|02:19:39.692] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=1
E[2019-04-11|02:19:39.697] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=1
E[2019-04-11|02:19:39.697] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=1
E[2019-04-11|02:19:39.697] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=1
E[2019-04-11|02:20:09.692] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=2
E[2019-04-11|02:20:09.696] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=2
E[2019-04-11|02:20:09.696] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=2
E[2019-04-11|02:20:09.696] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=2
E[2019-04-11|02:20:39.692] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=3
E[2019-04-11|02:20:39.696] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=3
E[2019-04-11|02:20:39.696] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=3
E[2019-04-11|02:20:39.697] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=3
E[2019-04-11|02:21:09.692] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=4
E[2019-04-11|02:21:09.696] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=4
E[2019-04-11|02:21:09.696] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=4
E[2019-04-11|02:21:09.697] Dialing failed module=pex [email protected]:26656 err="auth failure: secrect conn failed: EOF" attempts=4
E[2019-04-11|02:21:15.523] Failed to reconnect to peer. Beginning exponential backoff module=p2p [email protected]:26656 elapsed=2m3.249245147s
E[2019-04-11|02:21:21.549] Failed to reconnect to peer. Beginning exponential backoff module=p2p [email protected]:26656 elapsed=2m9.230493235s
E[2019-04-11|02:21:22.503] Failed to reconnect to peer. Beginning exponential backoff module=p2p [email protected]:26656 elapsed=2m12.10110046s
E[2019-04-11|02:21:23.689] Failed to reconnect to peer. Beginning exponential backoff module=p2p [email protected]:26656 elapsed=2m11.734292071s
--amount and --validator are unknown flags for
terracli tx staking delegate
--amount=10luna
--validator=
--from=<key_name>
--chain-id=<chain_id>
Shouldn't it be?
terracli tx staking delegate [validator] [amount]
--from=<key_name>
--chain-id=<chain_id>
the route to "budget/program" is added.
but queryAllProgramHandler & querier not implemented yet.
unit indicators (TRL, SRL, MRL) in treasury are currently being computed over the total issuance of Luna; this should be computed over the total count of bonded tokens, as per research's direction
Add stakingKeeper.GetValidatorSet() to the treasuryKeeper, and have unitIndicator() function div over the size of the totalbondedtokens of the valset instead of the total Luna issuance in the mint module.
How to start the terrad main network
Startup error now:
[2019-05-08|11:44:32.079] Starting ABCI with Tendermint module=main
ERROR: Error during handshake: Error on replay: Validator set is nil in genesis and still empty after InitChain
need to check all client modules.
On Windows10, I executed
git clone -b develop --single-branch https://github.com/terra-project/core
in c:/go/src
and executed
go build
in c:/go/src/core
then there is a message like :
can't load package: package github.com/terra-project/core: unknown import path "github.com/terra-project/core": cannot find module providing package github.com/terra-project/core
The budget module does not have a querier test. Create one by benchmarking oracle and treasury modules.
Currently, MsgPriceFeed tallies the moment the vote is submitted. This can allow validators to redelegate their stake to another affiliated miner, thereby voting multiple times.
MsgPriceFeed tallies to a PriceVote object, and the vote's weight is computed and stored to be the validator's BondedTokens() weight at the moment the vote is stored. This allows the validator to redelegate tokens to another validator ad infinitum (might be limits, but doubt it) to profit. In the lighter case, this will allow crafty validators to reap a higher reward, and in the more aggregious case allow them to corrupt the oracle price feed.
Mirror the tally method for the budget module, for storing the address of the validator when the msg is handled, and tally the weights for each validator during the oracle settlement period.
The current docs are centered around deployment of tokens. We need docs that display core functionality of the Terra ecosystem.
Create docs that mirror key functions explained in the white paper.
From:
MRL(t+1) = 52 week MRL MA(t) + X
to:
MRL(t+1) = 52 week MRL MA(t) * X
The current docs do not currently reflect our deployment schemes.
The following scenarios should be updated in the docs:
docs branches currently has the setup mirroring Cosmos' gaia testnet.
Batching Chai transaction errs on MsgMultiSend
For MsgMultiSend transactions on Chai, the system errors with ErrInsufficientBalance the user does not have the balance for a transaction.
User flow:
Edit x/pay/handler.go#handleMsgMultiSend to balance out transactions (cancel out inputs and outputs) to not return an insufficientBalanceError
Cosmos SDK has changed the GetSigners() function in Msg definitions, to sort the json after marshalling:
https://github.com/cosmos/cosmos-sdk/blob/develop/x/gov/msgs.go#L78-L81
REST API updates(budget, market, oracle, treasury) need to be applied to Swagger
Transferring Luna results in an error in the pay module
Currently the pay module tries to levy a tax on all token transfers. In order to do so, it queries the oracle module for the correct exchange rate between TerraSDR and the target asset to compute the tax cap. Given that Luna is not tracked by the oracle, this results in an error.
Add an escape condition for Luna transfers (perhaps luna transfers should not be taxed?)
@nplatias please weigh in
Resolved by #41
Currently programID and voterAddress data is being stored in the context store key instead of the value body.
No issues, but probably should be stored in a marshal-able object for cleanliness and readbility.
when i use 'make' command
(60/60) Wrote gonum.org/v1/gonum@master
go install -tags "netgo" -ldflags "-X github.com/terra-project/terra/version.Version=0.0.3-201-g7105278 -X terra/version.Version=0.0.3-201-g7105278" ./cmd/terrad
cmd/terrad/main.go:22:2: cannot find package "terra/app" in any of:
/home/eunsung/go/src/core/vendor/terra/app (vendor tree)
/usr/lib/go-1.10/src/terra/app (from $GOROOT)
/home/eunsung/go/src/terra/app (from $GOPATH)
cmd/terrad/main.go:23:2: cannot find package "terra/cmd/init" in any of:
/home/eunsung/go/src/core/vendor/terra/cmd/init (vendor tree)
/usr/lib/go-1.10/src/terra/cmd/init (from $GOROOT)
/home/eunsung/go/src/terra/cmd/init (from $GOPATH)
cmd/terrad/main.go:6:2: cannot find package "terra/types/util" in any of:
/home/eunsung/go/src/core/vendor/terra/types/util (vendor tree)
/usr/lib/go-1.10/src/terra/types/util (from $GOROOT)
/home/eunsung/go/src/terra/types/util (from $GOPATH)
cmd/terrad/main.go:7:2: cannot find package "terra/version" in any of:
/home/eunsung/go/src/core/vendor/terra/version (vendor tree)
/usr/lib/go-1.10/src/terra/version (from $GOROOT)
/home/eunsung/go/src/terra/version (from $GOPATH)
Makefile:39: recipe for target 'install' failed
make: *** [install] Error 1
Integrate [email protected] and release 0.8.0.
URLs in budget APIs are kebab-case.
how about to change this?
For some ecosystem, they need to know exact amount of tax they paid. However, currently there is no way to know it except calculating with two more query (tax-rate and tax-cap).
Records exact tax amount to transaction log per msg.
We have no continuous integration frameworks set up. We should integrate circleCI for all pushes to the develop branch.
Mostly already aligned, but someone should do a final sweep to align coding style.
We are currently missing comments / have misaligned formats in major modules. This should change.
Network: columbus-drill
CLI Version: 0.1.0-rc0
$ terracli query distr validator-outstanding-rewards --trust-node
ERROR: {"codespace":"sdk","code":6,"message":"incorrectly formatted request data; UnmarshalJSON cannot decode empty bytes"}
Also, isn't it outstanding-rewards
not validator-outstanding-rewards
?
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.