Commit graph

9410 commits

Author SHA1 Message Date
Sean
7b882ac5ae
Merge pull request #1386 from darcys22/api-list-stakes
Api for staked amount on pending transactions
2021-04-15 11:21:00 +10:00
Jason Rhinelander
9e9830da0e Remove limit on burned fee
The reason behind the limit is that the burn amount was supposed to be
encoded using varint encoding and therefore the limit was to make sure
that once we figured out the final burn amount and put it in, we were
guaranteed not to be making the TX extra any bigger (just in case that
could end up making the overall tx get a couple bytes bigger and break
the tx size limit).

However, it never actually *used* varint encoding: instead it is encoded
as a raw, full size uint64_t value of 8 bytes regardless of the value,
so this check is not actually doing anything.  (And if we changed it
to a varint we'd break the protocol, so just leave it).

It also turns out that this comment was wrong:

    This value (~4398 OXEN) was chosen because it's unlikely to ever be
    needed to be burned in a single transaction

Also I hear that some users really do need more than 640kB RAM. ;-)
2021-04-15 10:58:03 +10:00
Jason Rhinelander
563a4984e4 Make extra burn apply to any tx type, not just blink/ONS 2021-04-15 10:58:03 +10:00
Jason Rhinelander
56088ba274 Switch burn= parsing to use parse_amount 2021-04-15 10:58:03 +10:00
Sean Darcy
71ab07f032 merge conflicts 2021-04-15 10:58:03 +10:00
Sean
b4c483b9bf
Merge pull request #1403 from darcys22/1402-ons-names-for-transfers
Support for ONS wallet mappings
2021-04-15 10:49:51 +10:00
Sean Darcy
3993e6594c rename ons_owners_by_names merge wallet and session name check 2021-04-14 17:25:53 +10:00
Sean
4dd3825e66
Update src/cryptonote_core/oxen_name_system.cpp
Co-authored-by: Jason Rhinelander <jason@imaginary.ca>
2021-04-14 16:28:55 +10:00
Sean
1c730d9084
simplify encrypted wallet length check
Co-authored-by: Jason Rhinelander <jason@imaginary.ca>
2021-04-14 16:28:30 +10:00
Sean Darcy
961e14f50b refactor wallet decrypting 2021-04-14 16:27:23 +10:00
Sean Darcy
3f38d00796 Remove magic numbers and enforce nettype for is_valid_address 2021-04-14 15:12:29 +10:00
Sean
4e147ea863
Update src/cryptonote_core/oxen_name_system.cpp
Co-authored-by: Jason Rhinelander <jason@imaginary.ca>
2021-04-14 14:12:36 +10:00
Sean Darcy
ffa94f306a to readable value shows wallet address 2021-04-14 12:00:32 +10:00
Sean Darcy
3765e4e91f ONS purchase guesses wallet if the value is address 2021-04-12 15:10:24 +10:00
Sean Darcy
3030277b6a Move RPC for ons resolve address into ons resolve and decrypt wallet side 2021-04-12 10:27:57 +10:00
Sean Darcy
52ecd26b0d bump HF 2021-04-12 10:27:57 +10:00
Sean Darcy
83230fb4f5 big and small int binding for sqlite statements 2021-04-12 10:27:57 +10:00
Sean Darcy
8023b59867 rebrand lns -> ons 2021-04-12 10:27:57 +10:00
Sean Darcy
928ad2c668 Enable ONS mapping type=wallet and resolve ONS wallet addresses 2021-04-12 10:27:57 +10:00
Sean Darcy
b28494c769 return string of CSV data rather than write to file 2021-04-12 10:25:28 +10:00
Sean Darcy
8660b85408 added new wallet RPC method for export transfers 2021-04-12 10:12:24 +10:00
Jason Rhinelander
bb42e781af Remove unused, unenforced blockchain testing endpoint 2021-04-08 14:50:03 -03:00
Jason Rhinelander
ce9d0a9c1e Storage server RPC improvements
Improves the oxend<->storage server communications protocol:

- pass storage server HTTPS port as part of the storage server ping
(which already carries the also-required OMQ port) rather than needing
to provide it when starting up oxend.  --storage-server-port is now
obsolete (and ignored, if specified).
- Fix up the internal API to use `storage_https_port` and
`storage_omq_port` rather than `storage_port` and `storage_lmq_port`.
- Redo and the SS ping RPC endpoint so that it is less verbose and more
closely matches the lokinet endpoint; instead of:

    { "version_major": 2, "version_minor": 0, "version_patch": 9, "storage_lmq_port": 22222 }

we now expect:

    { "version": [2,0,9], "https_port": 11111, "omq_port": 22222 }

- Tweaks the (not-yet-released) SS proof key names: "s"->"shp" and "slp"->"sop"
2021-04-08 13:42:33 -03:00
Jason Rhinelander
2f5ec0e1e6 lmq -> omq internal rename
More rebrand updates to rename lmq (lokimq) internals with omq (oxenmq).
2021-04-08 13:38:51 -03:00
Jason Rhinelander
944ff226d0
Merge pull request #1407 from jagerman/network-test-fixes
Network test fixes
2021-04-07 18:39:07 -03:00
Sean
2d68e889d7
Merge pull request #1424 from jagerman/sn-status-cleanup
print_sn_status cleanup
2021-03-29 13:30:30 +11:00
Jason Rhinelander
c8371384ce
Merge pull request #1408 from jagerman/wallet-lock-fix
Wallet lock fix
2021-03-28 22:11:12 -03:00
Jason Rhinelander
b1344e919c Show both all & some reasons
Suffix "(some)" onto reasons in any but not in all.
2021-03-28 22:08:19 -03:00
Jason Rhinelander
1c2db6fe34 Move Current Status to the bottom of the status list
This makes it easier to pick out at a glance.

Also adds "Current Status: awaiting contributions" if not fully
contributed.
2021-03-28 22:08:19 -03:00
Jason Rhinelander
7d78f48305 Current Status: ACTIVE; fallback to any (or no) reasons
The status doesn't have a nice way to tell it is active or awaiting
contributions, so add it.

If "all" reasons don't give any results then try showing the "any"
reasons, and if that doesn't work, show a "reason(s) not available"
message.
2021-03-28 22:08:19 -03:00
Jason Rhinelander
5a05bd5e41 Make print_sn_status more compact
- Put SS/lokinet version on same line
- make checkpoint/pulse/timestamp/timesync each take one line instead of
  three
- instead of [height,round,vote] for pulse just print [height,vote] and
add a '+R' on height if for a pulse round > 0.
- remove the space after the , in the checkpoint/pulse/etc. lines to
save a little
2021-03-28 22:08:19 -03:00
Jason Rhinelander
9194defd20 Fix RPC to return coded strings, not readable; shorten codes
The RPC was returning readable strings instead of coded strings.

Also shorten the returned codes because they were a bit lengthy, and
document them in the RPC comment.
2021-03-26 18:57:49 -03:00
Jason Rhinelander
e4e48f983a Show decomm reasons in oxend status 2021-03-26 17:40:35 -03:00
Jason Rhinelander
9fae78d68a Expose reasons in rpc tx_extra details 2021-03-26 17:22:15 -03:00
Jason Rhinelander
9f7b7ed666 Invert and/or logic for reason codes
Fixes broadcast reasons being set to 0.
2021-03-26 17:19:10 -03:00
Sean Darcy
ded6e6bbf4 Add multiple decommission reasons to output. 2021-03-26 15:25:12 -03:00
Sean Darcy
b631575c32 enum type 2021-03-26 15:25:12 -03:00
Sean Darcy
10c3c3f0df print reason for decommission 2021-03-26 15:25:12 -03:00
Jason Rhinelander
b73ae8fd0c Retrofit versioning to state change serialization
This reinterprets the leading "state" as a version field, if >= 4, and
otherwise keeps it as the state value if < 4.

It is done in such a way as to remain the same round-trip (i.e. if we
deserialize it and then reserialize) so as to not break existing
signature verification.

This lets us properly serialize/deserialize both old, reasonless state
change txes *and* new state change txes with a reason field.  Without
this syncing failed because we'd hit a state change tx and couldn't
parse it properly.  (But we also can't just "upgrade" to the new version
because that would change the serialized value and break signatures).
2021-03-26 15:25:12 -03:00
Sean Darcy
f8a704bbe4 enumeration 2021-03-26 15:25:12 -03:00
Sean Darcy
d3f7b218e0 add new decommision reasons from time sync PR 2021-03-26 15:25:12 -03:00
Sean Darcy
dd04aad87c serializing and deserializing obligation votes 2021-03-26 15:25:12 -03:00
Sean Darcy
9733e853ef build the reasons into the dereg transaction 2021-03-26 15:25:12 -03:00
Sean Darcy
a87736a318 reason field in tx_extra serialised 2021-03-26 15:25:12 -03:00
Sean Darcy
b4ec2263ae moved bitmask processing to if the testing failed 2021-03-26 15:25:12 -03:00
Sean Darcy
cebc9d949a reason bitmask 2021-03-26 15:25:12 -03:00
Sean Darcy
cf4549c2a9 start testing for reason 2021-03-26 15:25:12 -03:00
Sean Darcy
99ad4b5c31 added new reason field to status change 2021-03-26 15:25:12 -03:00
Sean Darcy
41f389b128 Test suite fix for HF18
Governance reward calculations were hard-coded for == HF17 rather than
>= 17, so for HF18 it was falling back to the old "add up all the
values" method that we used to use.  Updated it to support HF18, and add
a static_assert that will fail to compile (without a fix) when we add
HF19.

Also some minor cleanups (mostly indent changes for unnecessary blocks
-- ignore whitespace when looking at the diff).
2021-03-26 14:05:06 -03:00
Jason Rhinelander
c02e692a4f Disable upnp router poking by default
It tends to slow down startup/shutdown and probably isn't very useful
for Oxen's network (see #1419)
2021-03-25 20:58:12 -03:00
Jason Rhinelander
10a19d98de Avoid calling get_net_config() too early
m_nettype won't be set properly during construction so we can't call
get_net_config() in the constructor arguments here; set a reasonable
value and then update during actual initialization instead.
2021-03-25 12:44:30 -03:00
Jason Rhinelander
2fb0dbcaa3 Tweak uptime proof times; reduce times for testnet
This makes uptime proof times network-dependent, and tweaks them a bit.
Also converts the times to type-safe std::chrono types rather than
macros.

Mainnet/testnet/devnet:

- Send the first proof 30s after startup rather than waiting 2 minutes.
- Check for whether we need to send a proof every 30s rather than every
5mins.

Mainnet:

Other times unchanged.

Testnet/devnet:

- Send proofs every 10min instead of 1h, and consider nodes to be down
after 21m instead of 2h5m.

Fakechain:

- Send 5s after startup, check every 5s, and send every 1min.
- Expiry after 2min5s

Also remove the cmake debug option for short proofs since the fakechain
changes above basically incorporate what it did.
2021-03-25 11:46:23 -03:00
Jason Rhinelander
5d94419d13 Switch out unmaintained testnet seed node 2021-03-25 11:46:04 -03:00
Sean
650ea6f4a2
bump HF versions (#1420)
* bump HF versions, schedule testnet HF
2021-03-24 21:17:58 -03:00
Jason Rhinelander
c719d45518 Fix lokimq -> oxenmq namespace that crept in
A recent PR started off prior to the rebrand code and was apparently
still using the legacy header names.
2021-03-16 21:09:43 -03:00
Chris Buccella
adfaf31133 Fix URL in the wallet welcome message
A string replace in commit 432dc31 swapped loki.network -> oxen.network
Update to use oxen.io
2021-03-15 15:58:41 -03:00
Jason Rhinelander
2d97fa841c Fix lock time calculation
BLOCKS_EXPECTED_IN_DAYS isn't a macro, so this was (currently) warning
about the actual division being integer division.
2021-03-01 21:05:24 -04:00
Jason Rhinelander
0ff5740dde
Merge pull request #1396 from darcys22/unused-variable-warning
Clear unused variable warning in simplewallet
2021-03-01 21:04:22 -04:00
Jason Rhinelander
4c1d03576e
Merge pull request #1370 from darcys22/1366-uptime-proof-version-details
Uptime proof version details + bt-encoded proofs
2021-03-01 17:36:35 -04:00
Jason Rhinelander
8320410205 Add scary warnings before revealing seed/spendkey 2021-02-26 14:15:33 -04:00
Jason Rhinelander
311563bee1 Make sure we don't skip block 0 2021-02-26 14:14:57 -04:00
Jason Rhinelander
e5dd9b389a Fix double-counting in coinbase tx sum
The coinbase tx sum rpc call had an off-by-one error that made it
double-count a block the first time it was reloaded at any height.  This
caused the deviation of oxen.observer and lokiblocks.com emissions
counts (because one is being called more frequently than the other), and
caused *both* to grow too quickly over time.
2021-02-26 14:14:57 -04:00
Jason Rhinelander
5b558aa230 Add SN rewards to miner block, even if 0
Network validation expects N outputs when there are N contributors, but
if any of the received contribution amounts was 0 we were skipping it,
leading to a block that failed validation.

This happened at blocks 739994 and 740010 when recently registered SNs
*with* a contributor reached the top of the reward list with a 100% fee;
this caused the second SN reward recipient amount to be 0, which then
got left off the block and then failed block validation.

This doesn't require a hard fork to fix -- it just requires block
producers to update to start including the 0 payout in such cases which
makes the network happy with the block.

(This may result in some stalls when we hit those SNs again, but as long
as enough of the network has upgraded we should unstall when an upgraded
node gets randomly selected to produce a backup block).
2021-02-26 14:10:32 -04:00
Jason Rhinelander
faed99a373 Fix exception when given a relative --log-file 2021-02-16 23:47:58 -04:00
Jason Rhinelander
438a47c5e6 Fix main exceptions resulting in no output
If `main` throws an exception before the log system is initialized then
the error message just got lost; this fixes it to print to stderr if
that happens.
2021-02-16 23:46:41 -04:00
Sean Darcy
90232dd217 shorten wire names 2021-02-09 11:54:27 +11:00
Sean Darcy
2ba4438e6a RPC to return SS and lokinet versions, renaming variables 2021-02-09 11:54:19 +11:00
Sean Darcy
b720e8ace6 Serialize the uptime proof using btencoding 2021-02-09 11:54:00 +11:00
Sean Darcy
c0de851d1d Added versions for SS and lokinet to be saved to core, generate_uptime_proof adds them to the proof 2021-02-09 11:52:31 +11:00
Alex Opie
049de234e0 Drop log level of wallet-closing logs
#1398
2021-02-02 21:40:27 -04:00
Alex Opie
f218e988a6 Always close the wallet the same way, and safely
This especially includes stopping the long-poll
loop thread, which otherwise causes a segfault.

Fixes #1398
2021-02-02 21:40:27 -04:00
Alex Opie
3e9f10f4ab Initialise m_should_use_bootstrap_daemon
This boolean is otherwise uninitialised, leading
to unpredictable behaviour.

Fixes #1400
2021-02-02 19:01:35 -04:00
Sean Darcy
168899738d clear unused variable error in simplewallet 2021-01-25 13:59:48 +11:00
Sean Darcy
098a9cb853 wallet api to have hardfork version 2021-01-19 11:47:38 -04:00
Sean Darcy
10057a077f call the staking transferred function if available rather than returning amount 2021-01-19 11:47:36 -04:00
Sean Darcy
e0eeab5eb7 need to setup the amount() to return the correct staked amount 2021-01-19 11:46:51 -04:00
Jason Rhinelander
466a1317d2 Rename lokimq -> oxenmq 2021-01-14 19:35:00 -04:00
Jason Rhinelander
e4ad50e1b3 Fix another potential windows rename failure 2021-01-14 12:49:00 -04:00
Jason Rhinelander
2861648627 Merge remote-tracking branch 'origin/stable' into dev 2021-01-08 19:36:58 -04:00
Jason Rhinelander
265dca70ed Remove mining-related functions from wallet api 2021-01-08 18:16:06 -04:00
Jason Rhinelander
37159b2ba0 Export symbols and strip debug symbols from android static lib
This massively reduces the size.
2021-01-08 18:15:25 -04:00
Jason Rhinelander
eca6b6ad8d Disable Trezor by default
Trezor support currently doesn't work (Trezor's hardware wallet is
hard-coded for a Monero net-id), and this saves needing to muck around
with protobuf.
2021-01-08 18:15:25 -04:00
Jason Rhinelander
4a87622a8e Fix a couple missed .oxen LNS suffixes 2021-01-07 23:50:27 -04:00
Jason Rhinelander
43b7ab3866 Fix a couple missed .oxen LNS suffixes 2021-01-07 23:16:09 -04:00
Jason Rhinelander
db58370e87 Config file migration fixes
The loki.conf -> oxen.conf migration wasn't working right when there is
also a ~/.loki -> ~/.oxen migration happening, so this rewrites it to
work properly:

- Make loki.conf -> oxen.conf migration leave behind a symlink
- Fix config file migration to also look for ~/.loki/loki.conf, and also
  consider ~/.loki/oxen.conf as a valid load source.  (The ~/.loki
  consideration only happens when data-dir is default *and* neither
  oxen.conf nor loki.conf are found in ~/.oxen).
- *Don't* look for ~/.loki/{loki,oxen}.conf if the default data dir
  (~/.oxen) exists.

Other changes:

- remove the default handling for the config file/log file and put it in
  main instead.  This is non-trivial, and the existing default is broken
  in that if you specify `--data-dir=blah` it still tries to load
  `~/.oxen/oxen.conf` rather than `blah/oxen.conf`.  With this commit it
  now does the expected thing when a data-dir is specified.
- Append /regtest to data-dir when running in --regtest mode.  The
  existing behaviour of clobbering the mainnet data dir is nasty.
2021-01-07 18:40:22 -04:00
Jason Rhinelander
1bde385c59 Eliminate tools::create_directories_if_necessary
We shouldn't actually use it in `main.cpp` because it is called before
the log system is initialized, and it is a wrapper that saves basically
nothing, so just replace it everywhere with direct calls to
fs::create_directories and delete it.
2021-01-07 18:40:22 -04:00
Sean Darcy
b08489648f line break 2021-01-07 18:40:22 -04:00
Sean Darcy
e3319dcfda make lokid.sock and move the .oxen folder migration to before logs initialise folder 2021-01-07 18:40:22 -04:00
Sean Darcy
ae80adb5b1 default directory migration, .loki -> .oxen moved to .main 2021-01-07 18:40:22 -04:00
Jason Rhinelander
27e205d590 Rename loki.conf -> oxen.conf when appropriate
Requires:
- config-file argument is not given
- default DATA/oxen.conf does not exist
- old DATA/loki.conf does exist
2021-01-07 18:40:22 -04:00
Jason Rhinelander
e7bbd5e2e7 Add some color in main.cpp before log init 2021-01-07 18:40:22 -04:00
Jason Rhinelander
3261f7015b Change Loki startup message from green -> cyan 2021-01-07 18:40:22 -04:00
Sean Darcy
fa4e010c3f handle .loki directory, leave .loki namespace 2021-01-07 18:40:22 -04:00
Sean Darcy
e86a039260 poor grammar 2021-01-07 18:40:22 -04:00
Sean Darcy
d0c47ac339 straighten ascii 2021-01-07 18:40:22 -04:00
Sean Darcy
c04276fab4 ascii art 2021-01-07 18:40:22 -04:00
Sean Darcy
441f412ca0 previously used an old monero log version 2021-01-07 18:40:22 -04:00
Sean Darcy
2822747a62 lokinet revert 2021-01-07 18:40:22 -04:00
Sean Darcy
ccd712542d executable names changed 2021-01-07 18:40:18 -04:00
Sean Darcy
0912221329 initial loki -> oxen pass 2021-01-07 18:39:01 -04:00