Commit Graph

14059 Commits

Author SHA1 Message Date
Jason Rhinelander 0db9520ebc
Merge pull request #1561 from jagerman/prefer-system-libs
Prefer system libs
2022-05-30 18:53:51 -03:00
Jason Rhinelander 5acbb9d23a
Merge pull request #1559 from darcys22/version-10-1-0
bump version to 10.1.0
2022-05-30 18:00:06 -03:00
Jason Rhinelander 72b6553a8a
Merge pull request #1560 from darcys22/mainnet-hardfork-19
add mainnet hardfork details for HF19
2022-05-30 17:59:07 -03:00
Jason Rhinelander 5f140e4572
Update release codename 2022-05-30 17:13:27 -03:00
Jason Rhinelander 6b785958b4
Clean up sys-or-submodule code, support system fmt, rename loki-mq
Synced up with oxen-storage-server.

Also rename loki-mq submodule to oxen-mq.
2022-05-30 15:59:03 -03:00
Jason Rhinelander 507a9d22ea
Better version tag generation (from oxenss/lokinet) 2022-05-30 15:16:50 -03:00
Sean Darcy 8c1a5c2d65 add mainnet hardfork details for HF19 2022-05-30 20:06:30 +10:00
Sean Darcy f3b6742572 bump version to 10.1.0 2022-05-30 19:48:44 +10:00
Jason Rhinelander d229bc77ed
Merge pull request #1486 from jagerman/wallet-csv-export-fixes
Wallet csv export fixes
2022-05-29 20:30:55 -03:00
Jason Rhinelander 80ca0d770b
Merge pull request #1558 from jagerman/genesis-block-scanning
Add ifdef'd code to scan the genesis block
2022-05-29 20:30:30 -03:00
Jason Rhinelander 5ff7db6a8e
Make version.cpp depend on .git/index
Sometimes it doesn't get updated (and so the version ends up with the
wrong hash in it).  This will fix that.
2022-05-27 21:51:37 -03:00
Jason Rhinelander ad88c57b8a
Fix governance fee calculation
Governance fee wasn't being multiplied by BATCH_REWARD_FACTOR before
being inserted into the rewards table.
2022-05-27 21:40:47 -03:00
Jason Rhinelander 4cd7e629a9
Remove testnet hack 2022-05-27 21:40:36 -03:00
Jason Rhinelander 76f5a9a33c
Add ifdef'd code to scan the genesis block
This code is virtually never needed, except when we reset
testnet/devnet, but is useful to have on hand for such cases.
2022-05-27 16:44:28 -03:00
Jason Rhinelander 3fa9572f42
Reset testnet governance wallet
Uses the same wallet keys and genesis tx as devnet.
2022-05-27 15:52:26 -03:00
Jason Rhinelander f12bb8b3f9
Merge compilation fix 2022-05-27 15:28:54 -03:00
Jason Rhinelander e9e8e93669
Fix wrong change value in outputs sent to self
We figure out, when parsing a blockchain-confirmed transaction, what the
change is but never properly set that in the new
confirmed_transfer_details entry that we create from the
unconfirmed_transfer_details, and the latter only has the *actual*
change but doesn't know about outputs we sent to ourself.

This commit fixes it by updating the change value when such a case
occurs, which fixes a wrong output & running total bug in csv exports.
2022-05-27 15:28:54 -03:00
Jason Rhinelander 69300f0a15
Fix invalid balance in view wallet csv export with imported key images
Received inputs were being handled incorrectly when importing key
images: only the *first* payment received was being removed, but it
can easily happen that we have multiple payments to ourselves in the
same wallet (for example, if we send a fixed amount to ourselves then
almost always send two non-zero amounts to ourself: the amount + the
change).

This would result in (n-1) "in" outputs for the transaction still
showing up in the output, along with the "out" transaction (which
contains the overall net transfer amount).  For example:

- Alice sends 100 + 12.3 change to herself.
- Bob has Alice's view keys, opens a view-only wallet, sees 100 and 12.3
  as two separate inputs from the same transaction.
- Alice provides a key image export to Bob to verify the account
- Bob imports.

Bob's export would now show:

    in 12.3
    out 0

(The inputs of the same transaction are apparently ordered randomly, so
it could also be 'in 100'/'out 0')

and the running total would be 12.3 too high (or 100 too high if the 100
got left instead of the 12.3).

This fixes it by removing *all* matching payments when we import key
images instead of just the first one.
2022-05-27 15:28:54 -03:00
Jason Rhinelander 70954ff373
CSV export-related code and output cleanups
Cleans up some messy code.

Reformats the CSV output to be a little cleaner (in both code and
result), using fmt:
- change second "amount" field to "sent_amount"
- don't unnecessarily quote the subaddr indices field (only quote when
  more than one need to be listed as comma-separated).
- change "checkpoint" field output to "yes"/"no" rather than
  "checkpointed"/"no".
- Adds spacing between fields which makes it a little easier to read and
  should still parse identically.
- Date format also changes somewhat (because fmt is now formatting it)
  and includes " UTC" to clarify.
2022-05-27 15:28:54 -03:00
Jason Rhinelander 184d61bb80
wallet2 code simplifications and cleanups
Miscellanous crap that I couldn't help but cleanup while working in
wallet2 to solve the export csv issues:

- To celebrate the 10 year anniversary of god inventing `auto` we
  replace some obtuse code that was trying to make itself look bigger by
  typing out massive obvious types.
- Remove the single remaining tab in wallet2.cpp to get wallet2.cpp from
  being 99.9993% tab-free too 100.0000000% tab free.
- Fix THROW_WALLET_EXCEPTION_IF calls that checked for not-found *after*
  another check that already dereferenced the iterator.
- Make `get_attribute` interface less stupid by returning an optional
  string instead of a bool with an out string argument.
- Simplify various std::holds_alternative + var::get combinations with a
  single std::get_if.
- Optimize and DRY hex conversion of payment id in make_transfer_view.
  The existing code was duplicated 4 times but also was inefficiently
  performing extra string allocations via multiple substr calls.
- Loki -> Oxen in a wallet error message.
- Initialize confirmed_transfer_details members inline rather than using
  an obtuse constructor.
- Apply some C++17 `if` initializer syntatic sugar.
- Don't use `0 != pointer` to test for null
- Don't use a linear scan of a std::vector to do what an unordered_set
  is meant to to.
- Replace NULL with nullptr
- eliminate boost::format from wallet2
- eliminate boost::lexical_cast from wallet2
2022-05-27 15:28:54 -03:00
Jason Rhinelander f77378da89
Merge pull request #1557 from darcys22/reset-testnet
reset testnet
2022-05-27 15:28:33 -03:00
Jason Rhinelander 34a550b41f
Merge pull request #1556 from darcys22/enforce-atomic-registrations-hf19
enforce atomic registrations in HF19
2022-05-27 15:06:10 -03:00
Jason Rhinelander 0d40501ca2
Merge pull request #1554 from darcys22/bump-uptime-proof-version-requirements
bump uptime proof checks on version
2022-05-27 15:05:54 -03:00
Jason Rhinelander 48eb4ba138
Revert devnet change
devnet got reset a few days ago already with new rules, don't need to
reset it again.
2022-05-27 15:03:49 -03:00
Jason Rhinelander cc0b90e455
Tweak error message wording for HF19 regs 2022-05-27 14:50:19 -03:00
Sean Darcy d941b581e6
bump uptime proof checks on version 2022-05-27 12:55:48 -03:00
Sean Darcy d63142182c reset testnet 2022-05-27 16:24:56 +10:00
Sean Darcy a1814661d5 enforce atomic registrations in HF19 2022-05-27 16:17:58 +10:00
Sean 307e7b933a
Merge pull request #1555 from darcys22/test-portions-to-amounts
change from portions to atomic amounts
2022-05-27 15:34:49 +10:00
Sean Darcy 56504d35de change from portions to atomic amounts 2022-05-27 15:07:28 +10:00
Sean d2db69a675
Merge pull request #1553 from darcys22/conflicts-from-merge
change in name between branchs
2022-05-27 11:43:26 +10:00
Sean Darcy 64d9dcae67 change in name between branchs 2022-05-27 11:42:48 +10:00
Sean 7161f42c64
Merge pull request #1472 from jagerman/avoid-integer-truncation
Avoid integer truncation in decoy selection
2022-05-27 11:16:54 +10:00
Sean c5fbf96b7d
Merge pull request #1539 from darcys22/prevent-unlocks-small-holdings
Prevent unlocks small holdings
2022-05-27 11:15:29 +10:00
Sean e9a69b6a78
Merge pull request #1550 from jagerman/batch1000
Batching thousanths
2022-05-27 11:15:09 +10:00
Sean d77d791d7d
Merge branch 'dev' into batch1000 2022-05-27 11:14:55 +10:00
Sean a65c0c1dbc
Merge pull request #1544 from darcys22/batching-rpc-endpoints
Adds RPC endpoint for accrued batching balances
2022-05-27 11:10:07 +10:00
Sean 5175503098
Merge pull request #1552 from darcys22/coinbase-payouts
Rename miner_reward to coinbase_payouts and fix minor bug
2022-05-27 11:09:20 +10:00
Sean Darcy a218b81bc0 segfault in block_weight due to nullptr sqlite_db 2022-05-27 10:45:15 +10:00
Sean Darcy 5387ca2cf4
test cases for batching 2022-05-26 15:08:32 -03:00
Jason Rhinelander b9f3877ab3
Add hard_fork to get_info rpc request
It's simple to add and saves a call to HARD_FORK_INFO when all you care
about is the hf number (and not the other hard fork details).
2022-05-26 15:08:08 -03:00
Jason Rhinelander d88d3d0de6
Remove assertion breaking wallet2 on a debug build
wallet2 expects to get back the UINT64_MAX value here for a
fully-reserved service node: if it does, it recognizes the node is full
and goes to look for reserved contribution spots.
2022-05-26 15:08:08 -03:00
Jason Rhinelander c765081946
This is not C. 2022-05-26 15:08:08 -03:00
Jason Rhinelander 902d7afe55
Use an empty vector instead of optional<vector>
We don't do anything differently for a nullopt versus an empty vector,
so just return an empty vector for both not-at-the-hf and no-payments
cases.

(This also fixes a segfault and/or chainsync bug in the previous commit
because the optional is dereferenced without checking when on hf19).
2022-05-26 15:08:08 -03:00
Jason Rhinelander fd4ca4a57c
Ensure we don't produce a HF block with garbage from the db
Fix edge case where the block producer has garbage in the db: the code
that clears it happens when we *accept* the block, but we can end up
here before then, when we produce the block, so just return empty in
such a case.
2022-05-26 15:08:07 -03:00
Jason Rhinelander 4848cacec8
Fix is-service-node detection 2022-05-26 15:08:07 -03:00
Jason Rhinelander c54cbb8394
Reset devnet 2022-05-26 15:08:07 -03:00
Jason Rhinelander a8a3b3dbe6
DEVNET storage port fixes
On devnet we don't have a storage server, and so storage ports are left
uninitialized and effectively become random ports on the network.  This
initializes them to 0, and avoids comparing SS ports for devnet for the
duplicate ip/ports warning.
2022-05-26 15:08:07 -03:00
Jason Rhinelander acf2942859
Fix bugs in thousandths calculations 2022-05-26 15:08:07 -03:00
Jason Rhinelander 589f66f5a4
Fix thousandths tx verification in service_node_list.cpp 2022-05-26 15:08:07 -03:00