Git Product home page Git Product logo

graphene's Introduction

Intro for new developers

This is a quick introduction to get new developers up to speed on Graphene.

Starting Graphene

For Ubuntu 14.04 LTS users, see this link first: https://github.com/cryptonomex/graphene/wiki/build-ubuntu

and then proceed with:

git clone https://github.com/cryptonomex/graphene.git
cd graphene
git submodule update --init --recursive
cmake -DCMAKE_BUILD_TYPE=Debug .
make
./programs/witness_node/witness_node

This will launch the witness node. If you would like to launch the command-line wallet, you must first specify a port for communication with the witness node. To do this, add text to witness_node_data_dir/config.ini as follows, then restart the node:

rpc-endpoint = 127.0.0.1:8090

Then, in a separate terminal window, start the command-line wallet cli_wallet:

./programs/cli_wallet/cli_wallet

To set your iniital password to 'password' use:

>>> set_password password
>>> unlock password

To import your initial balance:

>>> import_balance nathan [5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3] true

If you send private keys over this connection, rpc-endpoint should be bound to localhost for security.

A list of CLI wallet commands is available here.

Code coverage testing

Check how much code is covered by unit tests, using gcov/lcov (see http://ltp.sourceforge.net/coverage/lcov.php ).

cmake -D ENABLE_COVERAGE_TESTING=true -D CMAKE_BUILD_TYPE=Debug .
make
lcov --capture --initial --directory . --output-file base.info --no-external
libraries/fc/bloom_test
libraries/fc/task_cancel_test
libraries/fc/api
libraries/fc/blind
libraries/fc/ecc_test test
libraries/fc/real128_test
libraries/fc/lzma_test README.md
libraries/fc/ntp_test
tests/intense_test
tests/app_test
tests/chain_bench
tests/chain_test
tests/performance_test
lcov --capture --directory . --output-file test.info --no-external
lcov --add-tracefile base.info --add-tracefile test.info --output-file total.info
lcov -o interesting.info -r total.info libraries/fc/vendor/\* libraries/fc/tests/\* tests/\*
mkdir -p lcov
genhtml interesting.info --output-directory lcov --prefix `pwd`

Now open lcov/index.html in a browser.

Unit testing

We use the Boost unit test framework for unit testing. Most unit tests reside in the chain_test build target.

Witness node

The role of the witness node is to broadcast transactions, download blocks, and optionally sign them.

./witness_node --rpc-endpoint 127.0.0.1:8090 --enable-stale-production -w '"1.6.0"' '"1.6.1"' '"1.6.2"' '"1.6.3"' '"1.6.4"' '"1.6.5"' '"1.6.6"' '"1.6.7"' '"1.6.8"' '"1.6.9"' '"1.6.10"' '"1.6.11"' '"1.6.12"' '"1.6.13"' '"1.6.14"' '"1.6.15"' '"1.6.16"' '"1.6.17"' '"1.6.18"' '"1.6.19"' '"1.6.20"' '"1.6.21"' '"1.6.22"' '"1.6.23"' '"1.6.24"' '"1.6.25"' '"1.6.26"' '"1.6.27"' '"1.6.28"' '"1.6.29"' '"1.6.30"' '"1.6.31"' '"1.6.32"' '"1.6.33"' '"1.6.34"' '"1.6.35"' '"1.6.36"' '"1.6.37"' '"1.6.38"' '"1.6.39"' '"1.6.40"' '"1.6.41"' '"1.6.42"' '"1.6.43"' '"1.6.44"' '"1.6.45"' '"1.6.46"' '"1.6.47"' '"1.6.48"' '"1.6.49"' '"1.6.50"' '"1.6.51"' '"1.6.52"' '"1.6.53"' '"1.6.54"' '"1.6.55"' '"1.6.56"' '"1.6.57"' '"1.6.58"' '"1.6.59"' '"1.6.60"' '"1.6.61"' '"1.6.62"' '"1.6.63"' '"1.6.64"' '"1.6.65"' '"1.6.66"' '"1.6.67"' '"1.6.68"' '"1.6.69"' '"1.6.70"' '"1.6.71"' '"1.6.72"' '"1.6.73"' '"1.6.74"' '"1.6.75"' '"1.6.76"' '"1.6.77"' '"1.6.78"' '"1.6.79"' '"1.6.80"' '"1.6.81"' '"1.6.82"' '"1.6.83"' '"1.6.84"' '"1.6.85"' '"1.6.86"' '"1.6.87"' '"1.6.88"' '"1.6.89"' '"1.6.90"' '"1.6.91"' '"1.6.92"' '"1.6.93"' '"1.6.94"' '"1.6.95"' '"1.6.96"' '"1.6.97"' '"1.6.98"' '"1.6.99"' '"1.6.100"'

Running specific tests

  • tests/chain_tests -t block_tests/name_of_test

Using the API

We provide several different API's. Each API has its own ID. When running witness_node, initially two API's are available: API 0 provides read-only access to the database, while API 1 is used to login and gain access to additional, restricted API's.

Here is an example using wscat package from npm for websockets:

$ npm install -g wscat
$ wscat -c ws://127.0.0.1:8090
> {"id":1, "method":"call", "params":[0,"get_accounts",[["1.2.0"]]]}
< {"id":1,"result":[{"id":"1.2.0","annotations":[],"membership_expiration_date":"1969-12-31T23:59:59","registrar":"1.2.0","referrer":"1.2.0","lifetime_referrer":"1.2.0","network_fee_percentage":2000,"lifetime_referrer_fee_percentage":8000,"referrer_rewards_percentage":0,"name":"committee-account","owner":{"weight_threshold":1,"account_auths":[],"key_auths":[],"address_auths":[]},"active":{"weight_threshold":6,"account_auths":[["1.2.5",1],["1.2.6",1],["1.2.7",1],["1.2.8",1],["1.2.9",1],["1.2.10",1],["1.2.11",1],["1.2.12",1],["1.2.13",1],["1.2.14",1]],"key_auths":[],"address_auths":[]},"options":{"memo_key":"GPH1111111111111111111111111111111114T1Anm","voting_account":"1.2.0","num_witness":0,"num_committee":0,"votes":[],"extensions":[]},"statistics":"2.7.0","whitelisting_accounts":[],"blacklisting_accounts":[]}]}

We can do the same thing using an HTTP client such as curl for API's which do not require login or other session state:

$ curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0, "get_accounts", [["1.2.0"]]], "id": 1}' http://127.0.0.1:8090/rpc
{"id":1,"result":[{"id":"1.2.0","annotations":[],"membership_expiration_date":"1969-12-31T23:59:59","registrar":"1.2.0","referrer":"1.2.0","lifetime_referrer":"1.2.0","network_fee_percentage":2000,"lifetime_referrer_fee_percentage":8000,"referrer_rewards_percentage":0,"name":"committee-account","owner":{"weight_threshold":1,"account_auths":[],"key_auths":[],"address_auths":[]},"active":{"weight_threshold":6,"account_auths":[["1.2.5",1],["1.2.6",1],["1.2.7",1],["1.2.8",1],["1.2.9",1],["1.2.10",1],["1.2.11",1],["1.2.12",1],["1.2.13",1],["1.2.14",1]],"key_auths":[],"address_auths":[]},"options":{"memo_key":"GPH1111111111111111111111111111111114T1Anm","voting_account":"1.2.0","num_witness":0,"num_committee":0,"votes":[],"extensions":[]},"statistics":"2.7.0","whitelisting_accounts":[],"blacklisting_accounts":[]}]}

API 0 is accessible using regular JSON-RPC:

$ curl --data '{"jsonrpc": "2.0", "method": "get_accounts", "params": [["1.2.0"]], "id": 1}' http://127.0.0.1:8090/rpc

Accessing restricted API's

You can restrict API's to particular users by specifying an apiaccess file in config.ini. Here is an example apiaccess file which allows user bytemaster with password supersecret to access four different API's, while allowing any other user to access the three public API's necessary to use the wallet:

{
   "permission_map" :
   [
      [
         "bytemaster",
         {
            "password_hash_b64" : "9e9GF7ooXVb9k4BoSfNIPTelXeGOZ5DrgOYMj94elaY=",
            "password_salt_b64" : "INDdM6iCi/8=",
            "allowed_apis" : ["database_api", "network_broadcast_api", "history_api", "network_node_api"]
         }
      ],
      [
         "*",
         {
            "password_hash_b64" : "*",
            "password_salt_b64" : "*",
            "allowed_apis" : ["database_api", "network_broadcast_api", "history_api"]
         }
      ]
   ]
}

Passwords are stored in base64 as salted sha256 hashes. A simple Python script, saltpass.py is avaliable to obtain hash and salt values from a password. A single asterisk "*" may be specified as username or password hash to accept any value.

With the above configuration, here is an example of how to call add_node from the network_node API:

{"id":1, "method":"call", "params":[1,"login",["bytemaster", "supersecret"]]}
{"id":2, "method":"call", "params":[1,"network_node",[]]}
{"id":3, "method":"call", "params":[2,"add_node",["127.0.0.1:9090"]]}

Note, the call to network_node is necessary to obtain the correct API identifier for the network API. It is not guaranteed that the network API identifier will always be 2.

Since the network_node API requires login, it is only accessible over the websocket RPC. Our doxygen documentation contains the most up-to-date information about API's for the witness node and the wallet. If you want information which is not available from an API, it might be available from the database; it is fairly simple to write API methods to expose database methods.

Running private testnet

See the documentation if you want to run a private testnet.

Questions

  • Is there a way to generate help with parameter names and method descriptions?

    Yes. Documentation of the code base, including APIs, can be generated using Doxygen. Simply run doxygen in this directory.

    If both Doxygen and perl are available in your build environment, the CLI wallet's help and gethelp commands will display help generated from the doxygen documentation.

    If your CLI wallet's help command displays descriptions without parameter names like signed_transaction transfer(string, string, string, string, string, bool) it means CMake was unable to find Doxygen or perl during configuration. If found, the output should look like this: signed_transaction transfer(string from, string to, string amount, string asset_symbol, string memo, bool broadcast)

  • Is there a way to allow external program to drive cli_wallet via websocket, JSONRPC, or HTTP?

    Yes. External programs may connect to the CLI wallet and make its calls over a websockets API. To do this, run the wallet in server mode, i.e. cli_wallet -s "127.0.0.1:9999" and then have the external program connect to it over the specified port (in this example, port 9999).

  • Is there a way to access methods which require login over HTTP?

    No. Login is inherently a stateful process (logging in changes what the server will do for certain requests, that's kind of the point of having it). If you need to track state across HTTP RPC calls, you must maintain a session across multiple connections. This is a famous source of security vulnerabilities for HTTP applications. Additionally, HTTP is not really designed for "server push" notifications, and we would have to figure out a way to queue notifications for a polling client.

    Websockets solves all these problems. If you need to access Graphene's stateful methods, you need to use Websockets.

  • What is the meaning of a.b.c numbers?

    The first number specifies the space. Space 1 is for protocol objects, 2 is for implementation objects. Protocol space objects can appear on the wire, for example in the binary form of transactions. Implementation space objects cannot appear on the wire and solely exist for implementation purposes, such as optimization or internal bookkeeping.

    The second number specifies the type. The type of the object determines what fields it has. For a complete list of type ID's, see enum object_type and enum impl_object_type in types.hpp.

    The third number specifies the instance. The instance of the object is different for each individual object.

  • The answer to the previous question was really confusing. Can you make it clearer?

    All account ID's are of the form 1.2.x. If you were the 9735th account to be registered, your account's ID will be 1.2.9735. Account 0 is special (it's the "committee account," which is controlled by the committee members and has a few abilities and restrictions other accounts do not).

    All asset ID's are of the form 1.3.x. If you were the 29th asset to be registered, your asset's ID will be 1.3.29. Asset 0 is special (it's BTS, which is considered the "core asset").

    The first and second number together identify the kind of thing you're talking about (1.2 for accounts, 1.3 for assets). The third number identifies the particular thing.

  • How do I get the network_add_nodes command to work? Why is it so complicated?

    You need to follow the instructions in the "Accessing restricted API's" section to allow a username/password access to the network_node API. Then you need to pass the username/password to the cli_wallet on the command line or in a config file.

    It's set up this way so that the default configuration is secure even if the RPC port is publicly accessible. It's fine if your witness_node allows the general public to query the database or broadcast transactions (in fact, this is how the hosted web UI works). It's less fine if your witness_node allows the general public to control which p2p nodes it's connecting to. Therefore the API to add p2p connections needs to be set up with proper access controls.

graphene's People

Contributors

abitmore avatar bytemaster avatar chronoscrypto avatar clayop avatar emfrias avatar erkan-yilmaz avatar maqifrnswa avatar matzfan avatar nathanielhourt avatar pmconrad avatar ryanrfox avatar svk31 avatar theoreticalbts avatar troglodactyl avatar vikramrajkumar avatar vor0220 avatar wackou avatar xeroc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graphene's Issues

Define Default Special Accounts

  1. Genesis Account ( no owner authority, active authority set to weighted approval voting of stakeholders) - this account has the special ability to propose changes to blockchain parameters with 2 week delay
  2. Witness Account - no owner, active set to currently elected witnesses
  3. Delegate Account - no owner, active set to currently elected delegates, no delay on actions, but no special permissions
  4. Temp Account - no owner, no active, balance must be 0 after every transaction. This can be used as the fee payer in certain circumstances.
  5. Burn Account (no owner or active keys, funds sent here can never be moved)

create vesting balance objects with various policies

Currently the manually created VBO operation doesn't allow the user to specify a policy. This should be changed to allow the policy to be specified.

Add a VBO policy that has an absolute time at which it becomes 100% vested and otherwise 0% vested.

These objects can be useful for companies wishing to IPO on a blockchain but where they don't want investors to have instant liquidity that competes against other attempts to sell IPO funds.

Create account transaction is rejecting due to fee paying account...

Do I need to update something in my transaction?

10 assert_exception: Assert Exception\nfee_paying_account->is_lifetime_member()

{"ref_block_num":0,"ref_block_prefix":1434050043,"relative_expiration":0,"operations":[[6,{"fee":{"amount":"0","asset_id":"1.4.0"},"fee_paying_account":"1.3.11","key_data":[1,"GPH88N4QKA8SHTcGzCg9XR9yd9QBubtFvaDFxxg6WGaWiuzQK5BXk"]}],[6,{"fee":{"amount":"0","asset_id":"1.4.0"},"fee_paying_account":"1.3.11","key_data":[1,"GPH8bzbNHyeU57nDkfQ8FSNSwV63HZ87onFg9A2A2dnFqVbx4AJdy"]}],[7,{"fee":{"amount":"0","asset_id":"1.4.0"},"registrar":"1.3.11","referrer":"1.3.0","referrer_percent":0,"name":"account-zfc39","owner":{"weight_threshold":1,"auths":[["0.2.0",1]]},"active":{"weight_threshold":1,"auths":[["0.2.1",1]]},"voting_account":"1.3.0","memo_key":"0.2.1","num_witness":0,"num_committee":0,"vote":[]}]],"signatures":[["1.2.1","205848db789c70159597d6306c3a889fa0443cdd730c807972c2ecb0251aa9ab2b77c33cb090e3945c7cfdc879e583e6423dcd24069f35ba1b1c07be09e61cb845"]]}

database_fixture is ripe for refactoring

Here are the problems with database_fixture:

  • Reliance on macros makes single stepping through tests difficult with GDB.
  • "trx" object being modified by macros makes it effectively a global variable. Functions / macros use trx for both input and output.
  • Many methods in .hpp could be moved to .cpp file, speed compiling, iterative development of new database_fixture method doesn't need to recompile every test .cpp file (as long as signature in header doesn't change)
  • Poor naming conventions in some places (e.g. genesis_account should be genesis_account_id)

compile error on windows

win7x64, vs2013

1>D:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\memory(932): error C2664: 'boost::asio::basic_waitable_timerstd::chrono::steady_clock,boost::asio::wait_traits<Clock,boost::asio::waitable_timer_service<Clock,WaitTraits>>::basic_waitable_timer(const boost::asio::basic_waitable_timer<Clock,WaitTraits,boost::asio::waitable_timer_service<Clock,WaitTraits>> &)' : cannot convert argument 2 from 'boost::chrono::milliseconds' to 'const std::chrono::time_pointstd::chrono::system_clock,std::chrono::system_clock::duration &'
1> with
1> [
1> Clock=std::chrono::steady_clock
1> , WaitTraits=boost::asio::wait_traitsstd::chrono::steady_clock
1> ]
1> Reason: cannot convert from 'boost::chrono::milliseconds' to 'const std::chrono::time_pointstd::chrono::system_clock,std::chrono::system_clock::duration'
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1> D:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\memory(1003) : see reference to function template instantiation 'std::_Ref_count_obj<_Ty>::_Ref_count_objstd::reference_wrapper<boost::asio::io_service,boost::chrono::duration<int_least64_t,boost::milli>>(std::reference_wrapperboost::asio::io_service &&,boost::chrono::duration<int_least64_t,boost::milli> &&)' being compiled
1> with
1> [
1> _Ty=boost::asio::steady_timer
1> ]
1> D:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\memory(1003) : see reference to function template instantiation 'std::_Ref_count_obj<_Ty>::_Ref_count_objstd::reference_wrapper<boost::asio::io_service,boost::chrono::duration<int_least64_t,boost::milli>>(std::reference_wrapperboost::asio::io_service &&,boost::chrono::duration<int_least64_t,boost::milli> &&)' being compiled
1> with
1> [
1> _Ty=boost::asio::steady_timer
1> ]
1> d:\code\graphene\graphene\libraries\fc\vendor\websocketpp\websocketpp/transport/asio/connection.hpp(317) : see reference to function template instantiation 'std::shared_ptrboost::asio::steady_timer std::make_sharedboost::asio::steady_timer,std::reference_wrapperboost::asio::io_service,boost::chrono::milliseconds(std::reference_wrapperboost::asio::io_service &&,boost::chrono::milliseconds &&)' being compiled
1> d:\code\graphene\graphene\libraries\fc\vendor\websocketpp\websocketpp/transport/asio/connection.hpp(313) : while compiling class template member function 'websocketpp::transport::asio::connection::timer_ptr websocketpp::transport::asio::connection::set_timer(long,websocketpp::transport::timer_handler)'
1> with
1> [
1> config=fc::http::detail::asio_with_stub_log::transport_config
1> ]
1> d:\code\graphene\graphene\libraries\fc\vendor\websocketpp\websocketpp/transport/asio/endpoint.hpp(833) : see reference to function template instantiation 'websocketpp::transport::asio::connection::timer_ptr websocketpp::transport::asio::connection::set_timer(long,websocketpp::transport::timer_handler)' being compiled
1> with
1> [
1> config=fc::http::detail::asio_with_stub_log::transport_config
1> ]
1> d:\code\graphene\graphene\libraries\fc\vendor\websocketpp\websocketpp/transport/asio/endpoint.hpp(77) : see reference to class template instantiation 'websocketpp::transport::asio::connection' being compiled
1> with
1> [
1> config=fc::http::detail::asio_with_stub_log::transport_config
1> ]
1> d:\code\graphene\graphene\libraries\fc\vendor\websocketpp\websocketpp/endpoint.hpp(42) : see reference to class template instantiation 'websocketpp::transport::asio::endpointfc::http::detail::asio_with_stub_log::transport_config' being compiled
1> d:\code\graphene\graphene\libraries\fc\vendor\websocketpp\websocketpp/roles/server_endpoint.hpp(44) : see reference to class template instantiation 'websocketpp::endpointwebsocketpp::connection<config,config>' being compiled
1> with
1> [
1> config=fc::http::detail::asio_with_stub_log
1> ]
1> d:\code\graphene\graphene\libraries\fc\src\network\http\websocket.cpp(264) : see reference to class template instantiation 'websocketpp::serverfc::http::detail::asio_with_stub_log' being compiled

Split configurable account options into a struct

The account object needs to have a struct of user-changeable options (like assets do) and account_update_operation should contain this struct.

The objective here is to split the configurable fields on account object into a separate struct, which can be validated on its own and updated wholesale. This means that the account_create_operation and account_update_operation formats will change, making it a hard fork. In return for this, we get code simplicity and efficiency, as more validity checks can be performed statically in validate() without needing chain state, and updating the account is a simple copy of a struct rather than a long series of convoluted invariant checks based on which optionals may or may not be set, and then updating fields based on the optionals.

The struct definition and changes to the operations MUST be finished by launch, at which point this issue is no longer hard-forking but merely a refactor. Storing the options separately in the account object can be deferred as it is not a hard-forking change, but we should aim to have it done by launch anyways.

market history

As far as I can tell there's no api call to get the market history for a given market. We'll need this to construct price history charts in the GUI and to display the order history.

Cleanup and finish advanced UIA features

current code somewhat matches original bitshares advanced uia attempt and can be improved

e.g. whitelist handling can be streamlined more

also explicitly handle that there are at least 3 different asset types in the system: core, uia, and mia

Also need to figure out UIA retraction

Implement Cycle Detection on Account Update

It will only be able to detect cycles within the recursion depth limit. I think this should be done client side and by certain witness nodes. It can be implemented "after the fact" and thus is low priority.

cli_wallet hang after http rpc call

Steps:

  1. cli_wallet -r
  2. curl -v --data '{"jsonrpc": "2.0", "method": "info", "params": [], "id": 1}' http://localhost:8091/rpc

Logs:

  • cli_wallet
locked >>> here...
2585869ms th_a       main.cpp:170                  operator()           ] .
  • curl
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8091 (#0)
> POST /rpc HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:8091
> Accept: */*
> Content-Length: 59
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 59 out of 59 bytes

By the way, if give in a wrong method, curl will receive an error, but the wallet won't die.

Market order history API call

We're not going to do this for a while. For now you can subscribe to the market in the wallet and build it up there.

fork_database errors after running testnet

After running a one-node testnet for a couple days, I see a console filled with errors like this:

1350002ms th_a       witness.cpp:171               block_production_loo ] slot: 12135 scheduled_witness: 1.7.5 scheduled_time: 2015-06-11T14:22:30 now: 2015-06-11T14:22:30 
1350002ms th_a       witness.cpp:174               block_production_loo ] Witness 1.7.5 production slot has arrived; generating a block now...
1350004ms th_a       db_block.cpp:95               push_block           ] new_block.id(): 000047f68cc2fcfb8a73c61159c2ad5c2e30b578 new_block.previous: 000047f50b1a4d42b7628765c71ffefaf00b6b6d 
1350004ms th_a       witness.cpp:193               block_production_loo ] Got exception while generating block:
10 assert_exception: Assert Exception
itr != _index.get<block_id>().end(): 
    {}
    th_a  fork_database.cpp:51 push_block

    {"new_block":{"previous":"000047f50b1a4d42b7628765c71ffefaf00b6b6d","timestamp":"2015-06-11T14:22:30","witness":"1.7.5","next_secret_hash":"36bf2d457e392647d4ac0eae019759b085ac7108ac81aa9323150bbe","previous_secret":"c030935fe20354343fce9032499e8b2d9cb646235a9d2588c557e26c","transaction_merkle_root":"0000000000000000000000000000000000000000","extensions":[],"delegate_signature":"2060cf93a8e14a07e911989ffd09bbc06bd40a6c2d9c2a4a6207ee11054482db621166b8774c17b6e0178fe11e503a611717913a41f7c54d95ff4f8633115abf11","transactions":[]}}
    th_a  db_block.cpp:180 push_block

    {"witness_id":"1.7.5"}
    th_a  db_block.cpp:287 generate_block

I have witness_node_data_dir for this if it might contain useful info. (No logs, unfortunately.)

is_valid_name() is not RFC 1035 compliant

RFC 1035 specifies the following format for domain names:

<domain> ::= <subdomain> | " "
<subdomain> ::= <label> | <subdomain> "." <label>
<label> ::= <letter> [ [ <ldh-str> ] <let-dig> ]
<ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>
<let-dig-hyp> ::= <let-dig> | "-"
<let-dig> ::= <letter> | <digit>

This is much different from the algorithm implemented in is_valid_name().

We need:

  • A unit test for only this specific function, verifying it produces the correct result for many examples of valid and invalid names.
  • An unambiguous specification in the form of BNF rule(s), state machine diagram(s) and/or regular expression(s).

FC's safe multiplication...isn't.

Class fc::safe has following specification:

*  This type is designed to provide automatic checks for
*  integer overflow and default initialization. It will
*  throw an exception on overflow conditions.

And then defines this multiplication operator:

safe& operator *= ( safe v ) { value *= v.value; return *this; }

I'm pretty sure this operator implementation is not compliant with the class spec.

transaction_object should only store tx hash

AFAIK transaction_object is only used for duplicate checking in validation. For this purpose a tx hash is sufficient, and will provide a good deal of space savings, as well as eliminating the dynamic memory allocation overhead for variable-length fields in signed_transaction.

Withdraw permission specification is inconsistent

The withdraw_permission_create doc comment in operations.hpp states: "Only one withdrawal may occur per period for a given permission. Any subsequent withdrawals will fail until the next period begins, even if the sum of all withdrawals within a given period does not exceed the withdrawal limit."

The withdraw_permission_object doc comment in withdraw_permission_object.hpp states: "Any number of withdraws may be made so long as the total amount withdrawn is less than the limit for any given period."

These requirements are inconsistent...

Underlying transport error

Trying to set up a witness node (not sure if I have permissions to do this, so I figured I'd get it squared away in here), get these results:

vor0220@vor0220-ubuntu:~/graphene$ ./programs/witness_node/witness_node
1123088ms th_a       application.cpp:156           startup              ] Allocating all stake to 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
1123088ms th_a       db_management.cpp:38          open                 ] Open database in /home/vor0220/graphene/witness_node_data_dir/blockchain
1123088ms th_a       object_database.cpp:101       open                 ] Open object_database in /home/vor0220/graphene/witness_node_data_dir/blockchain
1123211ms th_a       object_database.cpp:117       open                 ] next_ids: ["1.2.2","1.3.12","1.4.1","1.5.0","1.6.10","1.7.10","1.8.0","1.9.0","1.10.0","1.12.0","1.13.0","1.14.0","1.15.0","1.16.0","1.17.0","1.18.0","1.19.0","2.0.1","2.1.1","2.3.1","2.4.0","2.6.2","2.7.12","2.9.0","2.10.1","2.11.0","2.12.1","5.0.2"] 
1123292ms th_a       thread.cpp:95                 thread               ] name:p2p tid:139777624717056
1123379ms th_a       application.cpp:85            reset_p2p_node       ] Configured p2p node to listen on 0.0.0.0:54272
1123380ms th_a       thread.cpp:95                 thread               ] name:ntp tid:139777595348736
1123380ms th_a       witness.cpp:81                plugin_startup       ] No witnesses configured! Please add witness IDs and private keys to configuration.
1123380ms th_a       main.cpp:120                  main                 ] Started witness node on a chain with 0 blocks.
1123380ms ntp        ntp.cpp:77                    request_now          ] resolving... ["pool.ntp.org",123]
1123396ms ntp        ntp.cpp:81                    request_now          ] sending request to 67.18.187.111:123

And then when trying to start up the wallet client, I get this:

vor0220@vor0220-ubuntu:~/graphene$ ./programs/cli_wallet/cli_wallet 
Logging RPC to file: logs/rpc/rpc.log
1155951ms th_a       main.cpp:108                  main                 ] key_to_wif( genesis_private_key ): 5K9KhCCAgNSAJdaoYkZQp8DJaQYjauHUhUB37bbiDi9qMQE3uSY 
1155953ms th_a       main.cpp:111                  main                 ] key_to_wif( nathan_private_key ): 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 
0 exception: unspecified
Underlying Transport Error
    {"message":"Underlying Transport Error"}
    asio  websocket.cpp:421 operator()

    {"uri":"ws://localhost:8090"}
    th_a  websocket.cpp:606 connect

Where should we put specifications?

In particular, I have written this file: https://gitlab.bitshares.org/dlarimer/graphene/blob/64fdf24e4526d0c5f84e2397ec40ee7eaf6d9145/doc/witness-rng.md

This is a normative specification of how the witness scheduler's RNG works. Anyone should be able to independently implement the RNG based on this document.

It does not seem to belong in a doc comment on the witness scheduler class, as the doc comment is deeply tied to the names of methods and other implementation details. The spec is at a higher level of abstraction than our particular implementation.

It does not seem to belong in its current home in the doc/ subdirectory of this repo, because things were moved away from there in the past (see e.g. 32c8f8ca9e7933cc3197d5172c96fcb8e1ceb561).

It does not seem to belong in https://github.com/graphene as that repo seems to be dedicated to stuff at the "marketing layer," like blog posts. This file is quite clearly highly specific technical documentation.

I am not aware of any other places we are currently putting documentation. So please figure out where this file belongs and put it there. In addition, please include a URL of the new location in the commit message or this ticket.

Genesis initialization of bit commitment secrets needs to be revised

Genesis secrets for init witnesses are currently based on genesis_private_key. This won't be doable for real init witnesses with real private keys.

Since the bit commitment needs to support a "never committed" state to deal with new witnesses who have never produced a block, we should simply set the genesis witnesses to this state.

get_short_orders crashes the witness node

get_short_orders SHILL 1 get_short_orders 1.4.1 5 etc..

From cli_wallet or gui websocket, here's the error:

3350016ms th_a       witness.cpp:166               block_production_loo ] Generated block #11582 with timestamp 2015-06-08T12:55:50 at time 2015-06-08T12:55:50
witness_node: /home/sigve/Dev/graphene/graphene/libraries/chain/include/graphene/chain/asset_object.hpp:192: const graphene::chain::asset_bitasset_data_object& graphene::chain::asset_object::bitasset_data(const DB&) const [with DB = graphene::chain::database]: Assertion `bitasset_data_id' failed.
Aborted (core dumped)

Vesting vs Non-Vesting Fees

Only fees above a certain threshold defined by consensus must vest. This means that in practice only the following fees require vesting:

  1. Premium Name Registration
  2. Lifetime and Annual Memberships
  3. Large Data Transactions
  4. Symbol Name Registration

Other fees (transfers, market orders, etc) will be below the threshold and thus vest immediately.

Compilation error

Running make after cmake brings up this error in Ubuntu 14.04 LTS

Scanning dependencies of target leveldb
[ 0%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/db/version_set.cc.o
[ 0%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/db/log_reader.cc.o
[ 1%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/db/table_cache.cc.o
[ 1%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/db/memtable.cc.o
In file included from /home/vor0220/graphene/libraries/leveldb/util/arena.h:9:0,
from /home/vor0220/graphene/libraries/leveldb/db/skiplist.h:33,
from /home/vor0220/graphene/libraries/leveldb/db/memtable.h:11,
from /home/vor0220/graphene/libraries/leveldb/db/memtable.cc:5:
/home/vor0220/graphene/libraries/leveldb/db/memtable.cc: In member function ‘void leveldb::MemTable::Add(leveldb::SequenceNumber, leveldb::ValueType, const leveldb::Slice&, const leveldb::Slice&)’:
/home/vor0220/graphene/libraries/leveldb/db/memtable.cc:104:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
assert((p + val_size) - buf == encoded_len);
^
[ 2%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/db/filename.cc.o
[ 2%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/db/db_impl.cc.o
[ 2%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/db/log_writer.cc.o
[ 3%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/db/c.cc.o
[ 3%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/db/builder.cc.o
[ 4%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/db/dbformat.cc.o
[ 4%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/db/repair.cc.o
[ 4%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/db/db_iter.cc.o
[ 5%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/db/dumpfile.cc.o
[ 5%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/db/write_batch.cc.o
[ 6%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/db/version_edit.cc.o
[ 6%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/helpers/memenv/memenv.cc.o
[ 6%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/table/two_level_iterator.cc.o
[ 7%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/table/format.cc.o
[ 7%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/table/block.cc.o
[ 8%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/table/block_builder.cc.o
[ 8%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/table/merger.cc.o
[ 8%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/table/table_builder.cc.o
[ 9%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/table/table.cc.o
[ 9%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/table/filter_block.cc.o
[ 10%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/table/iterator.cc.o
[ 10%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/util/testharness.cc.o
[ 10%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/util/coding.cc.o
[ 11%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/util/arena.cc.o
[ 11%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/util/env_win.cc.o
[ 12%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/util/env_posix.cc.o
[ 12%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/util/status.cc.o
[ 12%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/util/comparator.cc.o
[ 13%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/util/cache.cc.o
[ 13%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/util/hash.cc.o
[ 14%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/util/options.cc.o
[ 14%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/util/env.cc.o
[ 14%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/util/filter_policy.cc.o
[ 15%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/util/bloom.cc.o
/home/vor0220/graphene/libraries/leveldb/util/bloom.cc: In member function ‘virtual void leveldb::{anonymous}::BloomFilterPolicy::CreateFilter(const leveldb::Slice_, int, std::string_) const’:
/home/vor0220/graphene/libraries/leveldb/util/bloom.cc:50:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (size_t i = 0; i < n; i++) {
^
[ 15%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/util/logging.cc.o
/home/vor0220/graphene/libraries/leveldb/util/logging.cc: In function ‘bool leveldb::ConsumeDecimalNumber(leveldb::Slice_, uint64_t_)’:
/home/vor0220/graphene/libraries/leveldb/util/logging.cc:58:53: warning: comparison between signed and unsigned integer expressions [-Wsign-compare](v == kMaxUint64/10 && delta > kMaxUint64%10)) {
^
[ 16%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/util/histogram.cc.o
[ 16%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/util/testutil.cc.o
[ 16%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/util/crc32c.cc.o
[ 17%] Building CXX object CMakeFiles/leveldb.dir/libraries/leveldb/port/port_posix.cc.o
Linking CXX static library libleveldb.a
[ 17%] Built target leveldb
Scanning dependencies of target udt
[ 18%] Building CXX object libraries/fc/vendor/udt4/CMakeFiles/udt.dir/src/api.cpp.o
[ 18%] Building CXX object libraries/fc/vendor/udt4/CMakeFiles/udt.dir/src/buffer.cpp.o
[ 18%] Building CXX object libraries/fc/vendor/udt4/CMakeFiles/udt.dir/src/cache.cpp.o
[ 19%] Building CXX object libraries/fc/vendor/udt4/CMakeFiles/udt.dir/src/ccc.cpp.o
[ 19%] Building CXX object libraries/fc/vendor/udt4/CMakeFiles/udt.dir/src/channel.cpp.o
[ 20%] Building CXX object libraries/fc/vendor/udt4/CMakeFiles/udt.dir/src/common.cpp.o
[ 20%] Building CXX object libraries/fc/vendor/udt4/CMakeFiles/udt.dir/src/core.cpp.o
[ 20%] Building CXX object libraries/fc/vendor/udt4/CMakeFiles/udt.dir/src/epoll.cpp.o
[ 21%] Building CXX object libraries/fc/vendor/udt4/CMakeFiles/udt.dir/src/list.cpp.o
[ 21%] Building CXX object libraries/fc/vendor/udt4/CMakeFiles/udt.dir/src/md5.cpp.o
[ 22%] Building CXX object libraries/fc/vendor/udt4/CMakeFiles/udt.dir/src/packet.cpp.o
[ 22%] Building CXX object libraries/fc/vendor/udt4/CMakeFiles/udt.dir/src/queue.cpp.o
[ 22%] Building CXX object libraries/fc/vendor/udt4/CMakeFiles/udt.dir/src/window.cpp.o
Linking CXX static library libudt_debug.a
[ 22%] Built target udt
Scanning dependencies of target easylzma_static
[ 22%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/pavlov/BraIA64.c.o
[ 23%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/pavlov/Bcj2.c.o
[ 23%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/pavlov/Bra.c.o
/home/vor0220/graphene/libraries/fc/vendor/easylzma/src/pavlov/Bra.c: In function ‘SPARC_Convert’:
/home/vor0220/graphene/libraries/fc/vendor/easylzma/src/pavlov/Bra.c:107:25: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
if (data[i] == 0x40 && (data[i + 1] & 0xC0) == 0x00 ||
^
[ 23%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/pavlov/Bra86.c.o
[ 24%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/pavlov/LzmaEnc.c.o
/home/vor0220/graphene/libraries/fc/vendor/easylzma/src/pavlov/LzmaEnc.c: In function ‘LzmaEnc_Alloc’:
/home/vor0220/graphene/libraries/fc/vendor/easylzma/src/pavlov/LzmaEnc.c:1916:8: warning: variable ‘btMode’ set but not used [-Wunused-but-set-variable]
Bool btMode;
^
[ 24%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/pavlov/7zStream.c.o
[ 25%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/pavlov/LzmaLib.c.o
[ 25%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/pavlov/7zBuf.c.o
[ 25%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/pavlov/7zFile.c.o
[ 26%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/pavlov/7zBuf2.c.o
[ 26%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/pavlov/Alloc.c.o
[ 27%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/pavlov/LzmaDec.c.o
[ 27%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/pavlov/7zCrc.c.o
[ 27%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/pavlov/LzFind.c.o
[ 28%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/lzma_header.c.o
[ 28%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/lzip_header.c.o
[ 29%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/compress.c.o
[ 29%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/decompress.c.o
[ 29%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/lzma_c.c.o
[ 30%] Building C object libraries/fc/vendor/easylzma/src/CMakeFiles/easylzma_static.dir/common_internal.c.o
Linking C static library libeasylzma_static_debug.a
[ 30%] Built target easylzma_static
Scanning dependencies of target fc
[ 31%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/rpc/state.cpp.o
[ 31%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/uint128.cpp.o
[ 31%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/real128.cpp.o
[ 32%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/variant.cpp.o
[ 32%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/exception.cpp.o
[ 33%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/variant_object.cpp.o
[ 33%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/thread/thread.cpp.o
[ 33%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/thread/thread_specific.cpp.o
[ 34%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/thread/future.cpp.o
[ 34%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/thread/task.cpp.o
[ 35%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/thread/spin_lock.cpp.o
[ 35%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/thread/spin_yield_lock.cpp.o
[ 35%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/thread/mutex.cpp.o
/home/vor0220/graphene/libraries/fc/src/thread/mutex.cpp: In destructor ‘fc::mutex::~mutex()’:
/home/vor0220/graphene/libraries/fc/src/thread/mutex.cpp:18:16: warning: unused variable ‘c’ [-Wunused-variable]
context* c = m_blist;
^
[ 36%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/thread/non_preemptable_scope_check.cpp.o
[ 36%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/asio.cpp.o
[ 37%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/string.cpp.o
[ 37%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/shared_ptr.cpp.o
[ 37%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/time.cpp.o
[ 38%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/utf8.cpp.o
[ 38%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/io/iostream.cpp.o
[ 39%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/io/datastream.cpp.o
[ 39%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/io/buffered_iostream.cpp.o
[ 39%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/io/fstream.cpp.o
[ 40%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/io/sstream.cpp.o
[ 40%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/io/json.cpp.o
[ 41%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/io/varint.cpp.o
[ 41%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/io/console.cpp.o
[ 41%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/filesystem.cpp.o
[ 42%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/interprocess/process.cpp.o
[ 42%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/interprocess/signals.cpp.o
[ 43%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/interprocess/file_mapping.cpp.o
[ 43%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/interprocess/mmap_struct.cpp.o
[ 43%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/rpc/json_connection.cpp.o
[ 44%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/rpc/cli.cpp.o
[ 44%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/log/log_message.cpp.o
[ 45%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/log/logger.cpp.o
[ 45%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/log/appender.cpp.o
[ 45%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/log/console_appender.cpp.o
[ 46%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/log/file_appender.cpp.o
[ 46%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/log/gelf_appender.cpp.o
[ 47%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/log/logger_config.cpp.o
[ 47%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/openssl.cpp.o
[ 47%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/aes.cpp.o
/home/vor0220/graphene/libraries/fc/src/crypto/aes.cpp: In constructor ‘fc::aes_encoder::aes_encoder()’:
/home/vor0220/graphene/libraries/fc/src/crypto/aes.cpp:32:14: warning: unused variable ‘init’ [-Wunused-variable]
static int init = init_openssl();
^
In file included from /home/vor0220/graphene/libraries/fc/include/fc/safe.hpp:2:0,
from /home/vor0220/graphene/libraries/fc/include/fc/io/raw_fwd.hpp:6,
from /home/vor0220/graphene/libraries/fc/include/fc/crypto/sha256.hpp:5,
from /home/vor0220/graphene/libraries/fc/include/fc/crypto/aes.hpp:3,
from /home/vor0220/graphene/libraries/fc/src/crypto/aes.cpp:1:
/home/vor0220/graphene/libraries/fc/src/crypto/aes.cpp: In member function ‘uint32_t fc::aes_encoder::encode(const char_, uint32_t, char_)’:
/home/vor0220/graphene/libraries/fc/src/crypto/aes.cpp:73:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
FC_ASSERT( ciphertext_len == plaintext_len, "", ("ciphertext_len",ciphertext_len)("plaintext_len",plaintext_len) );
^
/home/vor0220/graphene/libraries/fc/include/fc/exception/exception.hpp:308:30: note: in definition of macro ‘FC_EXPAND_MACRO’
#define FC_EXPAND_MACRO( x ) x
^
/home/vor0220/graphene/libraries/fc/include/fc/exception/exception.hpp:315:11: note: in expansion of macro ‘UNLIKELY’
if( UNLIKELY(!(TEST)) )
^
/home/vor0220/graphene/libraries/fc/src/crypto/aes.cpp:73:5: note: in expansion of macro ‘FC_ASSERT’
FC_ASSERT( ciphertext_len == plaintext_len, "", ("ciphertext_len",ciphertext_len)("plaintext_len",plaintext_len) );
^
/home/vor0220/graphene/libraries/fc/src/crypto/aes.cpp: In constructor ‘fc::aes_decoder::aes_decoder()’:
/home/vor0220/graphene/libraries/fc/src/crypto/aes.cpp:100:14: warning: unused variable ‘init’ [-Wunused-variable]
static int init = init_openssl();
^
In file included from /home/vor0220/graphene/libraries/fc/include/fc/safe.hpp:2:0,
from /home/vor0220/graphene/libraries/fc/include/fc/io/raw_fwd.hpp:6,
from /home/vor0220/graphene/libraries/fc/include/fc/crypto/sha256.hpp:5,
from /home/vor0220/graphene/libraries/fc/include/fc/crypto/aes.hpp:3,
from /home/vor0220/graphene/libraries/fc/src/crypto/aes.cpp:1:
/home/vor0220/graphene/libraries/fc/src/crypto/aes.cpp: In member function ‘uint32_t fc::aes_decoder::decode(const char_, uint32_t, char_)’:
/home/vor0220/graphene/libraries/fc/src/crypto/aes.cpp:140:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
FC_ASSERT( ciphertxt_len == plaintext_len, "", ("ciphertxt_len",ciphertxt_len)("plaintext_len",plaintext_len) );
^
/home/vor0220/graphene/libraries/fc/include/fc/exception/exception.hpp:308:30: note: in definition of macro ‘FC_EXPAND_MACRO’
#define FC_EXPAND_MACRO( x ) x
^
/home/vor0220/graphene/libraries/fc/include/fc/exception/exception.hpp:315:11: note: in expansion of macro ‘UNLIKELY’
if( UNLIKELY(!(TEST)) )
^
/home/vor0220/graphene/libraries/fc/src/crypto/aes.cpp:140:5: note: in expansion of macro ‘FC_ASSERT’
FC_ASSERT( ciphertxt_len == plaintext_len, "", ("ciphertxt_len",ciphertxt_len)("plaintext_len",plaintext_len) );
^
[ 48%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/crc.cpp.o
[ 48%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/city.cpp.o
[ 49%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/base32.cpp.o
[ 49%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/base36.cpp.o
[ 49%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/base58.cpp.o
[ 50%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/base64.cpp.o
[ 50%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/bigint.cpp.o
[ 51%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/hex.cpp.o
[ 51%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/sha1.cpp.o
[ 51%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/ripemd160.cpp.o
[ 52%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/sha256.cpp.o
[ 52%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/sha224.cpp.o
[ 53%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/sha512.cpp.o
[ 53%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/dh.cpp.o
[ 53%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/blowfish.cpp.o
[ 54%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/elliptic_common.cpp.o
[ 54%] Building CXX object libraries/fc/CMakeFiles/fc.dir/src/crypto/elliptic_impl_priv.cpp.o
/home/vor0220/graphene/libraries/fc/src/crypto/elliptic_impl_priv.cpp:3:23: fatal error: secp256k1.h: No such file or directory
#include <secp256k1.h>
^
compilation terminated.
make[2]: *** [libraries/fc/CMakeFiles/fc.dir/src/crypto/elliptic_impl_priv.cpp.o] Error 1
make[1]: *** [libraries/fc/CMakeFiles/fc.dir/all] Error 2
make: *** [all] Error 2

running again and investigating.

Complete Genesis Initialization

Define a JSON format for the complete genesis state, sufficient to launch as a smooth upgrade from BitShares. Implement loading of this genesis state into the object graph, and test building a chain off of that initialization complete with transactions which claim genesis stakes, transfer assets, etc.

Need to make sure that account withdrawals work for imported PTS and BTC addresses in addition to BTS addresses.

Rework init_genesis

  • Allow creation of allocation targets with name and key explicitly specified
  • Include initial chain parameters in genesis
  • Initial set of committee members/delegates

Update Blackswan Handling

After short orders were removed, this needs to be updated:

  1. All margin positions are force closed at the swan price
  2. Collateral received goes into a force-settlement fund
  3. No new margin positions can be created for this asset
  4. No more price feed updates
  5. Force settlement happens without delay at the swan price, deducting from force-settlement fund
  6. No more asset updates may be issued.

API call to get all accounts whitelisted by a particular account

Currently white lists are tracked on the account that is being whitelisted rather than the accounts that re doing the whitelisting. We need to maintain a reverse index to facilitate a user interface that enables exchanges to enumerate their white list.

For now the exchange user interface can simply have a form that allows them to check to see if an account is white listed and either add/remove them.

market subscription results differ from get_short_orders/get_limit_orders

The results from a market subscription return a very different object for the same order type compared to the get_short_orders and get_limit_orders calls, there might be a reason for this but would it be possible to harmonise them to use the same structures?

get_limit_orders 1.4.1 1.4.0 1:
[{
    "id": "1.8.3",
    "expiration": "2015-06-13T19:24:54",
    "seller": "1.3.11",
    "for_sale": 9791100,
    "sell_price": {
      "base": {
        "amount": 9900000,
        "asset_id": "1.4.0"
      },
      "quote": {
        "amount": 10000,
        "asset_id": "1.4.1"
      }
    }
  }]

market sub result:

[[1, {
   "amount_to_sell": {
      "amount": 5, 
      "asset_id": "1.4.0"
   },
   "expiration": "2020-01-01T00:00:00",
   "fee": {
      "amount": 0, 
      "asset_id": "1.4.0"
   },
   "fill_or_kill": false,
   "min_to_receive": {
      "amount": 800, 
      "asset_id": "1.4.1"
   },
   "seller": "1.3.11"
}]
,[1,"1.8.1"]]

Transfer Whitelist / Reputation to a new account name.

A user should be able to transfer their white list permissions to a new account name without consulting with all of the individual white list authorities. This is slightly more work for the authorities because they will have to scan the database and update their records when they see this transfer operation.

Only transfer and not copy. Some Web of Trust implementations may imply uniqueness.

How does this impact voting applications?

get_market and get_markets

Can we have two api calls that return an individual market or a list of all markets with some basic market info, at the very least the current top ask/bid, and maybe some volume data if possible? Similar to how it works in Bitshares 1.0 but with a working "status" field

Add receiver name to transfer operation

This name would allow users to "send to a name" without having to fear being cheated by a light wallet server doing a bad name->id resolution. This validation could be skipped by everyone but witness nodes and could be performed as a pre-check (only on propagation of the transaction) because the name/id mapping cannot be changed.

The only "con" with this approach is it would increase the size of a transfer operation.

This fits in with the philosophy of including any assumed or implied state in the transaction.

This same technique could be used for any operation where it is assumed an asset is changing owners:

account_transfer
transfer
others??

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.