Commit graph

325 commits

Author SHA1 Message Date
deevope
a3eebbc0ab
verify-chain node client arg (#3678)
* add parameter fast_validation to the api

* arg `verify-chain` on node client

* arg verify chain + read_timeout parameter

* change timeout to 2hours

* update with tromp review

* 2nd comment from tromp
2022-01-07 13:45:48 +00:00
deevope
c92d2e9fba
graceful api shutdown (#3677) 2022-01-07 13:24:54 +00:00
Yeastplume
0170f03e4a
Rust 2021 Macro Warning Cleanup (#3658)
* small warning cleanup

* remove unused imports in tests
2021-11-02 15:10:01 +00:00
Antioch Peverell
89c06ddab7
client invalidateheader and resetchainhead (#3618)
* wip - "reset_head" via owner api functionality

* jsonrpc pass hash in as a string

* sort of works

* not a reorg if we simply accept several blocks at once

* remember to reset header MMR separately
as it is readonly when interacting with txhashset extension

* basic client integration
needs error handling etc.

* reset sync status when reset chain head

* track "denylist" (todo) and validate headers against this via the ctx

* track denylist (header hashes) in chain itself

* header denylist in play

* expose invalidateheader as client cmd

* rework reset_chain_head - rewind txhashset then header MMR
2021-04-29 11:05:05 +01:00
trevyn
9e27e6f9d3
Add migration to config_file_version = 2 (#3634)
* Add config_file_version and migration to version 2

* Generate `config_file_version = 2` as default
2021-04-27 14:33:56 +01:00
Antioch Peverell
34413c1cab
track sync_head on header_sync sync status (#3626)
* track sync_head on header_sync sync status
follow header fork as appropriate

* track highest_diff alongside highest_height on HeaderSync status

* cleanup

* not not
2021-04-06 11:16:20 +01:00
Quentin Le Sceller
0acf380320
Remove unnecessary trailing semicolom (#3619) 2021-03-29 08:55:33 +01:00
Quentin Le Sceller
0259ed23ea
Update copyright year to 2021 (#3592)
* Update copyright year to 2021
2021-03-10 10:14:48 -05:00
Quentin Le Sceller
725622da7a
Remove imports and cleanups (#3590)
* Remove unused import and if else chain
2021-03-08 11:09:41 -05:00
Quentin Le Sceller
45f74c396d
Remove unused imports (#3589)
* Remove unused imports
2021-03-08 10:36:16 -05:00
Blade Doyle
059e6ad545
Mining tui updates (#3584)
* add column ordering, set mining workers table to sort the connected workers to the top by default

* add column ordering, set mining workers table to sort the connected workers to the top by default

* Mining TUI fixes and updates
2021-03-04 09:39:14 -05:00
Quentin Le Sceller
98e183c8b8
Update Client to v2 API (#3582)
* Update Client to v2 API

* Move json-rpc file into api

* Fix json! macro
2021-03-03 14:36:16 -05:00
Alexandre Bury
eefd0eac97
Update to cursive 0.16 (#3547)
* Update to cursive 0.16

* Switch to upstream table view

* Use TableView::set_items_stable

Co-authored-by: Quentin Le Sceller <q.lesceller@gmail.com>
2021-03-03 13:47:41 -05:00
John Tromp
4877f30e2c
override old accept_fee_base setting of 1000000 to new default 500000 (#3539)
* override old accept_fee_base setting of 1000000 to new default 500000

* document exceptional accept_fee_base behaviour in grin-server.toml

* document more accurately
2021-01-06 15:24:11 +00:00
John Tromp
48efb693e2
Fixfees (#3481)
* add FeeFields type

* use FeeFields with ::zero and try_into().unwrap()

* fixed tests

* avoid 0 accept_base_fee

* add aggregate_fee_fields method for transaction

* implement std::fmt::Display trait for FeeFields

* make base_fee argument non-optional in libtx::mod::tx_fee

* add global and thread local accept_fee_base; use to simplify tests

* set unusually high fee base for a change

* revert to optional base fee argument; default coming from either grin-{server,wallet}.toml

* remove optional base fee argument; can be set with global::set_local_accept_fee_base instead

* define constant global::DEFAULT_ACCEPT_FEE_BASE and set global value

* add Transaction::accept_fee() method and use

* Manual (de)ser impl on FeeFields

* fix comment bug

* Serialize FeeFields as int in tx

* allow feefields: u32:into() for tests

* try adding height args everywhere

* make FeeFields shift/fee methods height dependent

* prior to hf4 feefield testing

* rename selected fee_fields back to fee for serialization compatibility

* fix test_fee_fields test, merge conflict, and doctest use of obsolete fee_fields

* make accept_fee height dependent

* Accept any u64 in FeeFields deser

Co-authored-by: Jasper van der Maarel <j@sper.dev>
2020-11-26 18:03:06 +01:00
Antioch Peverell
cbd6c3350d
fix, no more FULL_NODE (#3504) 2020-11-25 18:31:38 +00:00
Antioch Peverell
3efe382e9c
add peer capabilities to tui peers screen (#3490) 2020-11-25 16:29:33 +00:00
John Tromp
f86102b2a6
fixDAA; implement wtema (#3477)
* implement wtema

* reduce FTL from 12 to 5 mins; fix inaccuracies in cuckoo doc

* rename difficulty window for DampedMovingAverage DAA

* fix FTL error msg

* secondary_scale becomes extended nonce past HF4

* secondary_scale change actually belongs in hardfork4 PR

* make future time limit configurable

* define constant global::DEFAULT_FUTURE_TIME_LIMIT and refactor a bit

* fix typos

* as_ref() feels safer than as_mut() :-)

* remove obsolete mut

* make future_time_limit non-mandatory in grin-server.toml
2020-11-25 10:58:39 +00:00
Quentin Le Sceller
cf2a65242d
Rename Floonet to Testnet (#3431)
* Rename Floonet to Testnet

* Fix test

* Rename test and docker
2020-10-07 09:36:02 -04:00
Blade Doyle
dc47beda78
cleanup mining stats (#3439)
* cleanup mining stats; make edge_bits dynamic (last size submitted), dont show bogus stats when no miners are connected

Co-authored-by: Quentin Le Sceller <q.lesceller@gmail.com>
2020-09-16 13:03:42 -04:00
Antioch Peverell
80841f16d2
pass slices around and not refs to vecs (#3404)
* pass slices around and not refs to vecs

* use slice.swap()

* use inputs() not body.inputs
2020-07-27 11:07:18 +01:00
Quentin Le Sceller
0cb1a352d3
Remove wallet from CLI (#3347) 2020-06-12 08:39:53 -04:00
Quentin Le Sceller
093c500fed
Cargo Update (#3338) 2020-06-08 17:15:32 -04:00
Antioch Peverell
e7d2c71ca6
display chain type on tui title bar (#3336) 2020-05-29 09:18:00 -04:00
Antioch Peverell
988a05f023
Enable NRD kernel support (noop) feature flagged (#3303)
* wip

* commit

* add block level validation rule around NRD kernels and HF3 block height

* wip

* test coverage for kernel ser/deser for NRD kernels

* add some type safety around ser/deser of nrd relative height

* cleanup

* cleanup tx sig handling and add tests around NRD kernel sig

* test coverage for chain apply block containing NRD kernel

* verify kernel variants when adding tx to pool
NRD kernels will not be accepted until HF3

* add txpool test for NRD kernel handling

* fix merge

* fix api for NRD kernels

* commit

* wip - feature flag for NRD kernel support

* wip

* global config and thread local feature flag for NRD kernel support

* add feature flag support for NRD kernels
default to false when starting up node
allow it to be set to true in context of individual tests

* feature flag

* explicit testing of NRD kernel via feature flag

* add chain_type and feature flag logging on startup

* PR feedback and cleanup

* PR feedback
2020-05-29 09:56:24 +01:00
hashmap
731528c616
Some optimizsations in TUI (#3325)
* Do not allocate String for static status, use Cow instead, eg we allocate "Running" string at every refresh
* Use static dispatch for Views instead of Box<dyn View>
* Update only the current view
* Simplify Listener trait
2020-05-29 09:55:07 +01:00
Antioch Peverell
6faa0e8d75
thread local chain type vs global chain type (#3327)
* Introduce GLOBAL_CHAIN_TYPE and make CHAIN_TYPE thread_local.
This makes testing more explicit and significantly more robust.

* set_local_chain_type() in tests

* cleanup - weird

* get pool tests working with explicit local chain_type config

* core tests working with explicit local chain_type

* p2p tests working with explicit local chain_type

* store tests working

* cleanup, feedback
2020-05-22 12:51:58 +01:00
hashmap
93f5de3d29
Introduce a pause after calling Cursive.step (#3326)
Currently we call it in a loop without any delays which burns cpu cycles for little value.
On my machine I see decrease of cpu usage from 12% to 6% on a synced node after applying this fix.
2020-05-16 17:12:45 +02:00
Quentin Le Sceller
be4779c923
Less cloning and pattern simplifications (#3305)
* Cleanup 
* Pattern simplification
2020-04-24 11:19:34 +02:00
hashmap
d8c6eef485
Refactor SyncState (#3297)
* Refactor SyncState

Method sync_error() retrun type was simplified.
update_txhashset_download() was  made type safe, which eliminates a runtime enum variant's  check, added an atomic status update
2020-04-20 12:30:04 +02:00
Quentin Le Sceller
4024ee3839
Update Cursive to 0.14 and update backend. (#3291)
* Update Cursive to 0.14

* Replace ncurses backend with crossterm

* Update to latest Cursive code

* Remove git patch
2020-04-17 15:41:55 -04:00
jaspervdm
cf128eb220
Fix rare panic in TUI (#3294) 2020-04-15 10:19:11 -04:00
Antioch Peverell
bab9f41343
go back to storing header_head in the db (#3268)
* go back to storing header_head in the db

* simplify and cleanup
2020-04-10 16:12:53 +01:00
Joseph Goulden
0d2e58e90e
feat: allow DNS names in peers/seeds list and resolve them (#3125)
* feat: allow DNS names in peers/seeds list and resolve them

* tests: add mod for peer tests

* refactor: rename some variables

* chore: use Serde desrialize to resolve DNS names into PeerAddrs

* fix: compile

* fix: add back code to remove duplicate ip addresses from resolved DNS seeds
2020-02-14 14:58:57 +00:00
François Garillot
dcdbdd4bcc
Some simple Option / Result / iterator pattern simplifications (#3205) 2020-01-29 14:20:57 +00:00
Quentin Le Sceller
6e5afe496b Update License to 2020 (#3196) 2020-01-20 11:40:58 +00:00
cadwgan0
8568c77d6e explicit str, rustc 1.34.0 doesn't seem to pick this up otherwise (#3191) 2020-01-15 12:00:33 +00:00
cadwgan0
81a2bbd5e8 TUI peer sort order (#3184)
* alternative tui ordering when values equal

* use closure and Ordering .then chain to clean code
2020-01-08 12:32:15 +00:00
Joseph Goulden
0fba087aa1 fix: panic in TUI table selected item. focus is zero indexed (#3169) 2019-12-12 14:06:06 +00:00
Joseph Goulden
5c7bc3d8cd fix(TUI): Selected column and selected row of table are now preserved when set_items() is called (#3161) 2019-12-10 19:21:03 +00:00
Joseph Goulden
39af7fa202 fix(TUI): Fixed panic when changing order of items in TableView before the number of items in the table is reduced (#3160) 2019-12-10 19:10:17 +00:00
Antioch Peverell
dcfcd3ee79
use saturatig_sub() to avoid a negative value causing an overflow panic (#3139) 2019-11-26 19:05:04 +00:00
Antioch Peverell
78220febed
use try_read_for() with timeout for tui status updates (header and pool stats) (#3129)
* use try_read_for with timeout for tui status updates (header and pool stats)

* rework based on feedback
2019-11-22 12:46:07 +00:00
Quentin Le Sceller
04e7d307ce Replace MimbleWimble by Mimblewimble (#3118)
* Replace MimbleWimble by Mimblewimble

* MimbleWimble->Mimblewimble
2019-11-19 10:49:32 +00:00
Joseph Goulden
6d864a813c fix: split state validation status into kernel and rproof updates. (#3096)
* fix: split state validation status into kernel and rproof updates. And fix sync status for these two states

* fix: show correct number of leaves for pruned MMR as well as unpruned

* docs: better docs for kernel/range proof validation

* fix: ordering of kernel and rproofs validation in TUI

* fix: typo in rangeproofs api and comments
2019-11-17 22:12:10 +01:00
Joseph Goulden
29b871841a fix: for TUI status try to acquire read lock on pmmr_header but if no… (#3119)
fix: for TUI status try to acquire read lock on pmmr_header but if not available just leave the header stats alone
2019-11-15 08:21:42 +01:00
Antioch Peverell
8d2c43d7e8
add tx pool kernel counts to tui status page (#3111)
* add tx pool kernel counts to tui status page

* fix formatting on tui
2019-11-14 16:21:27 +00:00
Joseph Goulden
8ce2bfda58 feat: TUI logs view (#3064)
* fix: add logs page to TUI

* chore: print panic traces to TUI logs

* chore: stop and start tui nicely and a bit of refactoring

* chore: rustfmt

* chore: typo

* chore: use sync_channel for logs

* chore: don't try to unwrap err on try_send log message

* chore: fix compiler/lint warnings

* fix: Only create logs channel if TUI is enabled and resovle other small review comments

* fix: wrap logs in TUI to fix window size

* fix: debug and trace logs appear white in the TUI logs
2019-11-13 09:45:59 -05:00
Joseph Goulden
67057ab36d fix: add shutting down dialog to TUI (#3101)
* fix: add shutting down dialog to the TUI
2019-10-28 13:28:36 +01:00
Quentin Le Sceller
6be6391225 Change 2018 to 2019 in copyright files (#3072) 2019-10-02 09:40:20 +01:00