Commit Graph

13462 Commits

Author SHA1 Message Date
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 d524d560c7
Merge pull request #1369 from darcys22/1363-reason-field-deregistrations
1363 reason field deregistrations
2021-03-28 22:07:49 -03:00
Sean Darcy 057711a026 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-28 22:04:45 -03:00
Chris Buccella b787600579 Add oxend Dockerfile and build script
Add a Dockerfile and build script for:
  - an Ubuntu base container (Ubuntu 20.04 + oxen repo)
  - an oxend container, using the base container
2021-03-29 00:18:21 +00: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
Jason Rhinelander d75fa1e510 Add state_change compilation in test suite
The state_change constructor changed (to include a version + reasons),
this updates the test suite to match.
2021-03-26 15:25:12 -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 4908219809 tests to pass in 0 for reason 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 d164e1a41e
Merge pull request #1422 from jagerman/uptime-proof-tweaks
Tweak uptime proof times; reduce times for testnet
2021-03-25 20:57:55 -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
Chris Buccella bdba579564 Update contribution rules: Monero -> Oxen
CONTRIBUTING.md is shown to all first-time users opening an issue,
so seeing "Monero" at the top is rather disorienting.
2021-03-24 12:29:50 -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 ed48667fe6 Fix removed/deprecated options 2021-02-16 23:52:08 -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
Jason Rhinelander 0a60b69ef0 Update randomx with arm64 patch 2021-02-16 18:56:15 -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