Commit Graph

9389 Commits

Author SHA1 Message Date
Jason Rhinelander c1e7fec54b 9.1.2 hotfix -- fix proofs for older nodes with both pubkeys
bt-encoded proofs have a bug for nodes with different legacy/ed25519
pubkeys that isn't easily solvable (it needs a fix on *both* sender and
receiver ends).  That fix is in here (in uptime_proof.cpp) but that
isn't enough to solve it immediately.

This works around the issue by submitting old-style proofs if we are a
node with different legacy/ed25519 pubkeys.
2021-04-29 21:26:24 -03:00
Jason Rhinelander 208501b0d0 Don't use timestamp from proof
The timestamp inside the proof is only for signature validation, but we
were using it in some places as the uptime proof time, but not updating
it everywhere we needed to.  This fixes it by using our own timestamp
for all local timed events (e.g. when we received it, when the node is
not sending proofs, etc.) to fix the issue.
2021-04-23 02:37:51 -03:00
Jason Rhinelander 422d82e205
Merge pull request #1447 from darcys22/version-bump-9.1.0
Version bump 9.1.0
2021-04-22 03:13:35 -03:00
Sean Darcy c07b713cd5 Mainnet hardfork 18 block and timestamp 2021-04-22 14:06:31 +10:00
Sean Darcy 2f12e84938 Bump versions and minimum versions for uptime proofs 2021-04-22 14:01:56 +10:00
Sean Darcy 411af23b4b Creates a new ons pay_type for show_transfers
The displaying of ONS transactions in show_transfers and
export_transfers previously showed the dummy destination address which
contained zero bytes and converted to a nonsense address. Created a new
ONS type for the display functions and removed the displaying of the destination
address.

In addition refactored how we determine that a transaction was either a
staking, ons or output transaction as we were previously parsing the
tx_extra where the data was already in the
cryptonote::transaction::type.

Finally renamed the wording for staking rewards. Previously "miner" now
"reward"
2021-04-21 15:37:55 +10:00
Sean Darcy 435c187ca0 initialise version and pretty print if no version 2021-04-20 16:22:00 +10:00
Jason Rhinelander dfb3f29bfe Add warning if restoring an ed25519 key to a file name .../key
A couple people have messaged me now because they tried transferring
keys and used the `restore` command on their legacy `key` file, but it
restored an ed25519 key.

This adds a red warning if attempting to restore an ed key to a filename
ending in `/key` with a note about probably wanting the restore-legacy
command instead.
2021-04-20 00:27:48 -03:00
Sean 89f1850355
Merge pull request #1441 from jagerman/testnet-fee-sync-fix
Fixes testnet sync problem caused by retroactivitly dropping the ONS fees
2021-04-20 13:26:57 +10:00
Sean Darcy f151386cbe Serialise extra fields for participation checks 2021-04-20 13:21:22 +10:00
Jason Rhinelander ec5f548db5 Add hack to fix testnet sync
PR #1433 getting merged changed the fees within HF18 on testnet, which
broke syncing/ONS rescanning because the per-merged testnet has higher
fee ONS txes on it.

This adds a hack to allow wrong fees for blocks before yesterday.
2021-04-20 00:20:21 -03:00
Jason Rhinelander fd7c35801f Increase various potentially fatal error log levels
MERROR doesn't come through at default low-logging level so promote them
to MFATAL so it's more obvious where things are failing when they fail.
2021-04-20 00:16:20 -03:00
Sean 2047edcd79
Merge pull request #1439 from jagerman/macos-time-fix
macOS build fix
2021-04-19 15:48:15 +10:00
Sean cdcf7f251b
Merge pull request #1438 from jagerman/swarmid-fix
Swarm id fix
2021-04-19 15:48:06 +10:00
Jason Rhinelander 8e39c84e70 Add a virtual destructor to http_server_base
Clang warns about http_server having a non-virtual destructor; we aren't
actually doing anything that would cause problems, but the warning is
legit and a correct thing to fix.
2021-04-19 01:22:50 -03:00
Jason Rhinelander d205bc4400 Fix time_t conversion on macos
macOS's system_clock apparently only has microsecond resolution while
steady_clock has nanosecond, so the conversion here was failing (because
time_point conversions are only implicit when converting to a more
precise type).
2021-04-19 01:18:14 -03:00
Jason Rhinelander 2c96fa0f6c Don't sort an already-sorted vector
The swarm_ids are std::map keys, which means they are already sorted.

Put an assert in just to be paranoid.
2021-04-19 00:14:47 -03:00
Jason Rhinelander 1fb10d8b1d Fix get_new_swarm_id() returning MAX_ID/2 when single swarm
The important part here is removing this line:

    if (swarm_to_snodes.size() == 1) return MAX_ID / 2;

because, if we end up in a case where we have only one swarm and it
*already* has that ID (e.g. create 2, which will be [MAX/2,0] then drop
0) then this returns a swarm_id that already exists, which is bad
because then we fail to insert the new swarm, a service node gets left
with an unassigned swarm id, and that then causes issues in SS because
that node thinks it is deactivated because it doesn't have a swarm id
(yet it *is* in the active nodes list, so other network members still
try to talk to it).
2021-04-18 23:47:22 -03:00
Jason Rhinelander 7ecef1529d print_sn display tweaks
- decrease indent
- show lokinet address
2021-04-18 22:20:10 -03:00
Jason Rhinelander 33bcf7e70c Add missing lokinet/ss versions to RPC 2021-04-18 22:20:10 -03:00
Jason Rhinelander bdebfda9f8 Re-do how SS ping tests are handled
This moves all the responsibility of ping testing (deciding when it's
unreachable, etc.) into oxend, allowing for better reporting on SS ping
results and eliminating some edge cases that can lead to oxend and
storage server getting "stuck" thinking each is in a different state.
2021-04-18 22:20:10 -03:00
Jason Rhinelander 3b4c8f4a5d Make get_human_time_ago use `seconds` rather than ints 2021-04-18 22:20:10 -03:00
Jason Rhinelander eda03d1590
Merge pull request #1432 from jagerman/ss-updates
Storage server RPC updates
2021-04-18 22:19:13 -03:00
Sean Darcy 137ba14ea3 reduce ONS fee 2021-04-19 09:45:18 +10:00
Sean Darcy 5041dd7726 reduce fees 2021-04-19 09:45:10 +10:00
Sean Darcy 440c4ca7c4 initialise mapping_value 2021-04-16 13:40:35 +10:00
Sean 53602f5a45
Merge pull request #1434 from darcys22/misc-fixes
Misc fixes
2021-04-15 16:47:47 +10:00
Sean Darcy cb8a7d4a43 Use fs::exists from common tools 2021-04-15 15:47:45 +10:00
Sean Darcy d05f514c1f Wrong constant name 2021-04-15 14:23:36 +10:00
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