/home/travis/build/loki-project/loki-core/src/cryptonote_basic/tx_extra.h:422:20: error: enclosing class of constexpr non-static member function ‘void cryptonote::tx_extra_loki_name_system::set_field(lns::extra_field)’ is not a literal type
constexpr void set_field (lns::extra_field bit) { fields = static_cast<lns::extra_field>(static_cast<uint8_t>(fields) | static_cast<uint8_t>(bit)); }
Updates are granular and can update individual fields of a LNS TX,
meaning when we reorg- restoring a record to its proper state can
potentially require searching further back than the detach height.
The following scenario, copied from a comment in loki_name_system.cpp
-----------------------------------------------------------------------------------------------
Detach Logic: Simple Case
-----------------------------------------------------------------------------------------------
LNS Buy @ Height 100: LNS Record={field1=a1, field2=b1, field3=c1}
LNS Update @ Height 200: LNS Record={field1=a2 }
LNS Update @ Height 300: LNS Record={ field2=b2 }
LNS Update @ Height 400: LNS Record={ field3=c2}
Blockchain detaches to height 301, the target LNS record now looks like
{field1=a2, field2=b2, field3=c1}
Our current LNS record looks like
{field1=a2, field2=b2, field3=c3}
To rebuild our record, find the closest LNS Update that is earlier than the
detach height. If we run out of transactions to run back to, then the LNS
entry is just deleted.
-----------------------------------------------------------------------------------------------
Detach Logic: Advance Case
-----------------------------------------------------------------------------------------------
LNS Buy @ Height 100: LNS Record={field1=a1, field2=b1, field3=c1}
LNS Update @ Height 200: LNS Record={field1=a2 }
LNS Update @ Height 300: LNS Record={ field2=b2 }
LNS Update @ Height 400: LNS Record={ field3=c2}
LNS Update @ Height 500: LNS Record={field1=a3, field2=b3, field3=c3}
LNS Update @ Height 600: LNS Record={ field3=c4}
Blockchain detaches to height 401, the target LNS record now looks like
{field1=a2, field2=b2, field3=c2}
Our current LNS record looks like
{field1=a3, field2=b3, field3=c4}
To get all the fields back, we can't just replay the latest LNS update
transactions in reverse chronological order back to the detach height,
otherwise we miss the update to field1=a2 and field2=b2.
To rebuild our LNS record, we need to iterate back until we find all the
TX's that updated the LNS field(s) until all fields have been reverted to
a state representative of pre-detach height.
i.e. Go back to the closest LNS record to the detach height, at height 300.
Next, iterate back until all LNS fields have been updated at a point in
time before the detach height (i.e. height 200 with field=a2).
So that when adding new fields to records, updating the helper will
trigger compile errors on pre-existing record checks. There have been
several updates to mapping records that weren't being tested over the
lifetime of implementing LNS.
Hardcoded checkpoints are not expected after HF13. At some point during
the previous releases's testing period we added a hardcoded checkpoint
because we redid the hardforking blocks on testnet due to some
incompatible changes- but were tenable to reboot the network on a small
network like the testnet.
This commit deletes the checkpoint instead of adding an exception so as
to not require letting the service node list accept hardcoded
checkpoints after HF13, or worse, if somehow a corrupt checkpoint was
added to the DB somehow, and on retrieval we return a checkpoint with no
signatures, this could sneak through as it'd be detected as a hardcoded
checkpoint once loaded from the DB.
We could provide an exception if it was a checkpoint on height 127XXX
and it was testnet, but this is too intrusive change to the conditional
for an insignifcant testing change.
Everywhere still uses crypto::hash for the name_hash due to being the
most compact storage form except for the LNS DB which uses base64 so
that it can be indexes in SQL for speed.
But at the boundary between requesting and accessing the DB entry, the
hash gets converted into a base64 representation of the hash.
We opt for base64 as it is more compact than storing the hex
representation.
This adds the loki-mq dependency and replaces SNNetwork with it (along
with some syntax updates for how loki-mq changed a bit from SNNetwork).
This also replaces common/hex.h and common/string_view.h with loki-mq's
faster (hex) and more complete and tested (string_view) implementations.
The archaic (i.e. decade old) cmake usage here really got in the way of
trying to properly use newer libraries (like lokimq), so this undertakes
overhauling it considerably to make it much more sane (and significantly
reduce the size).
I left more of the architecture-specific bits in the top-level
CMakeLists.txt intact; most of the efforts here are about properly
loading dependencies, specifying dependencies and avoiding a whole pile
of cmake antipatterns.
This bumps the required cmake version to 3.5, which is what xenial comes
with.
- extensive use of interface libraries to include libraries,
definitions, and include paths
- use Boost::whatever instead of ${Boost_WHATEVER_LIBRARY}. The
interface targets are (again) much better as they also give you any
needed include or linking flags without needing to worry about them.
- don't list header files when building things. This has *never* been
correct cmake usage (cmake has always known how to wallet_rpc_headers
the headers that .cpp files include to know about build changes).
- remove the loki_add_library monstrosity; it breaks target names and
makes compiling less efficient because the author couldn't figure out
how to link things together.
- make loki_add_executable take the output filename, and set the output
path to bin/ and install to bin because *every single usage* of
loki_add_executable was immediately followed by setting the output
filename and setting the output path to bin/ and installing to bin.
- move a bunch of crap that is only used in one particular
src/whatever/CMakeLists.txt into that particular CMakeLists.txt instead
of the top level CMakeLists.txt (or src/CMakeLists.txt).
- Remove a bunch of redundant dependencies; most of them look like they
were just copy-and-pasted in, and many more aren't needed (since they
are implied by the PUBLIC linking of other dependencies).
- Removed `die` since it just does a FATAL_ERROR, but adds color (which
is useless since CMake already makes FATAL_ERRORs perfectly visible).
- Change the way LOKI_DAEMON_AND_WALLET_ONLY works to just change the
make targets to daemon and simplewallet rather than changing the build
process (this should make it faster, too, since there are various other
things that will be excluded).
* Adds GET_SERVICE_NODE_STATUS RPC endpoint to lokid
Previously the getting the service node status was only available in the
lokid console. This commit adds the endpoint to the RPC server
* removed unnecessary variable, allow for json in request