Commit Graph

2514 Commits

Author SHA1 Message Date
Jacek Sieka fc10f5121a protect against data after initial request
spec requires that channel is closed

also, avoid some unnecessary futures
2020-09-18 21:34:07 +03:00
zah 7c688bffda
Address #1586 (#1596) 2020-09-18 18:34:13 +02:00
Mamy Ratsimbazafy ea4ec6a785
Upgrade blst (#1682)
* Bump BLST

* Test for https://github.com/supranational/blst/issues/22 regression

* Use SHA256 from BLST + bump nim-blscurve to reenable fno-tree-vectorize

* SHA256 on non-blst platforms import fixes

* import fixes again

* can't prefix with nimcrypto

* address review comment [skip ci]

* {.noInit.} on the digests
2020-09-18 16:55:55 +02:00
tersec e106549efe
keep REJECT/IGNORE of messages failing validation for libp2p scoring (#1676)
* keep REJECT/IGNORE status of messages failing validation for libp2p scoring

* fix test suite
2020-09-18 13:53:09 +02:00
Jacek Sieka 000a0ecc52
initial e2store file format description (#1355)
This is one way we could organize the flat file storage for blocks - the
alternative would be to not do `type` in the file itself, but have a
single type per file which arguably is simpler but may become annoying.

Another potential restriction would be to require that blocks are
ordered - with this format, it's a little bit more involved to recreate
an index file, and it's easy to accidentally build in assumptions about
the block order in the main data file.
2020-09-17 23:23:54 +02:00
Sacha Saint-Leger e4b4b29320
Update medalla.md (#1685)
minor edits + clarifications
2020-09-17 20:25:21 +02:00
Sacha Saint-Leger 4c0bdffd4c
Update medalla.md (#1681)
explain syncv2 string and terminal status bar
2020-09-17 18:39:49 +02:00
Dmitriy Ryajov 2f89e2ab4e
drop subscribePeer, it's called from pubsub now (#1677) 2020-09-17 11:40:21 +02:00
Sacha Saint-Leger 6bde3b85a7
Book edits: master is now the preferred branch (#1675)
* Update medalla.md

remove `cd devel`

* Update medalla-troubleshooting.md

edits to make clear that master is now the recommended branch
2020-09-17 00:26:51 +02:00
Jacek Sieka dcf8a6b05d
improve slot processing speeds (#1670)
about 40% better slot processing times (with LTO enabled) - these don't
do BLS but are used
heavily during replay (state transition = slot + block transition)

tests using a recent medalla state and advancing it 1000 slots:

```
./ncli slots --preState2:state-302271-3c1dbf19-c1f944bf.ssz --slot:1000
--postState2:xx.ssz
```
pre:

```

All time are ms
Average,       StdDev,          Min,          Max,      Samples,
Test
Validation is turned off meaning that no BLS operations are performed
39.236,        0.000,       39.236,       39.236,            1,
Load state from file
0.049,        0.002,        0.046,        0.063,          968,
Apply slot
256.504,       81.008,      213.471,      591.902,           32,
Apply epoch slot
28.597,        0.000,       28.597,       28.597,            1,
Save state to file
```

cast:
```
All time are ms
Average,       StdDev,          Min,          Max,      Samples,
Test
Validation is turned off meaning that no BLS operations are performed
37.079,        0.000,       37.079,       37.079,            1,
Load state from file
0.042,        0.002,        0.040,        0.090,          968,
Apply slot
215.552,       68.763,      180.155,      500.103,           32,
Apply epoch slot
25.106,        0.000,       25.106,       25.106,            1,
Save state to file
```

cast+rewards:
```
All time are ms
Average,       StdDev,          Min,          Max,      Samples,
Test
Validation is turned off meaning that no BLS operations are performed
40.049,        0.000,       40.049,       40.049,            1,
Load state from file
0.048,        0.001,        0.045,        0.060,          968,
Apply slot
164.981,       76.273,      142.099,      477.868,           32,
Apply epoch slot
28.498,        0.000,       28.498,       28.498,            1,
Save state to file
```

cast+rewards+shr
```
All time are ms
Average,       StdDev,          Min,          Max,      Samples,
Test
Validation is turned off meaning that no BLS operations are performed
12.898,        0.000,       12.898,       12.898,            1,
Load state from file
0.039,        0.002,        0.038,        0.054,          968,
Apply slot
139.971,       68.797,      120.088,      428.844,           32,
Apply epoch slot
24.761,        0.000,       24.761,       24.761,            1,
Save state to file

```
2020-09-16 20:59:33 +00:00
Ștefan Talpalaru 4b38619c4f better handling of Ctrl+C during `make update` (#1588) 2020-09-16 19:21:59 +02:00
nbc-bump-bot[bot] f901c8d55a auto-bump nim-libp2p (#1659)
Co-authored-by: = <arnetheduck@users.noreply.github.com>
2020-09-16 19:21:59 +02:00
Mamy Ratsimbazafy 702b346965 Opt-in Slashing protection + interchange (#1643)
* Slashing protection + interchange initial commit

* Restrict the when UseSlashingProtection dance in other modules

* Integrate slashing tests in other all_tests

* Add attestation slashing protection support

* Add a message that mention if built with/without slashing protection

* no op the initialization proc

* test slashing protection in Jenkins (temp)

* where to configure NIMFLAGS in Jenkins ...

* Jenkins -> ensure Built with slashing protection

* Add slashing protection complete import

* use Opt.get(otherwise)

* Don't use negation in proc name

* Turn slashing protection on by default
2020-09-16 19:21:59 +02:00
Eugene Kabanov 8b492ed1ce PeerPool fixes. (#1654)
* Refactor peer_pool.
Fix eth2_network peer counters.
Fix PeerPool do not allow to add more peers when empty space available.

* Remove unused imports.

* Add test for a bug.

* Fix eth2_network disconnect should deletePeer not release.
More PeerPool refactoring.
2020-09-16 19:21:59 +02:00
tersec 67f3bd203e close block_sim database; remove code duplication in exit_pool (#1656) 2020-09-16 19:21:59 +02:00
Eugene Kabanov 66ba5d072a Fix sync_manager.nim not rewarding peers for good responses. (#1660) 2020-09-16 19:21:59 +02:00
nbc-bump-bot[bot] 3f129d06dc auto-bump nim-libp2p (#1606)
Co-authored-by: = <arnetheduck@users.noreply.github.com>
2020-09-16 19:21:59 +02:00
tersec f566a84f5c enable topic unsubscribing and attestation subnet cycling (#1646)
* enable topic unsubscribing and attestation subnet cycling

* remove refences to states

* waitFor -> await

* revert exit pool changes for a cleaner PR
2020-09-16 19:21:59 +02:00
Eugene Kabanov 0b029220ee Bump chronos to fix memory leaks. (#1648) 2020-09-16 19:21:59 +02:00
Jacek Sieka 20dd38fdf9 fix some todo (#1645)
* remove some superfluous gcsafes
* remove getTailState (unused)
* don't store old epochrefs in blocks
* document attestation pool a bit
* remove `pcs =` cruft from log
2020-09-16 19:21:59 +02:00
tersec 804b152d1d [WIP] skeleton of attester slashing pool & validators (#1639)
* skeleton of attester slashing pool & validators

* add skeleton for proposer slashings and voluntary exits; rename pool to more inclusive exit pool to stay consistent with all three; ensure is initialized by beacon_node so is safe to merge, even if it doesn't do much yet
2020-09-16 19:21:59 +02:00
Ștefan Talpalaru aabb47e46c reorder startup steps (#1642)
so the Ctr+C hook and the metrics server go before the potentially slow
`BeaconNode.init()`
2020-09-16 19:21:59 +02:00
Sacha Saint-Leger 942743a356 update medalla guide: advanced options (WIP) (#1623)
* update medalla guide: advanced options

* minor edits
2020-09-16 19:21:59 +02:00
Sacha Saint-Leger 1be5832f9a Update medalla-troubleshooting.md (#1635) 2020-09-16 19:21:59 +02:00
Sacha Saint-Leger 9a99c9b60e Update medalla-troubleshooting.md (#1633)
Add database pruning subsection
2020-09-16 19:21:59 +02:00
tersec 002bdb834d cleanly close kvstore databases and bump nim-eth (#1630)
* cleanly close kvstore databases

* close databases for all subcommands and during error conditions
2020-09-16 19:21:59 +02:00
Kim De Mey 87e3ef7c56 Bump nim-eth to use lrucache for discovery sessions (#1622) 2020-09-16 19:21:59 +02:00
Jacek Sieka bcbc7acd18 remove chronos future tracking from default build (#1628)
uses a lot of memory, specially during sync
2020-09-16 19:21:59 +02:00
tersec c08b786e77 add ncli_db subcommand to prune database of unnecessary blocks and states (#1593)
* add ncli_db subcommand to prune database of unnecessary blocks, states, and state roots

* tweak comments

* reduce default aggressiveness in pruning old states

* move copyPrunedDatabase() to ncli_db, as it's not generally useful as part of beacon_chain_db and doesn't use any internal interfaces
2020-09-16 19:21:59 +02:00
Eugene Kabanov dcdb5dfade Syncing V2 (#1602)
* Syncing workers now not bound to peers.
Sync status is now printed in statusbar.

* Add `SyncQueue.outSlot` to statusbar too.

* Add `inRangeEvent` and `rangeAge` parameter.

* Fix rangeAge is not depends on SyncQueue latest slot.
Fix syncManager to start from latest local head slot.

* Add notInRange event.

* Remove suspects field.
2020-09-16 19:21:59 +02:00
Jacek Sieka 1d3e2935f2 await validator duties (#1626)
Validator duties proceed slot-by-slot - we should not start a new
validator duty iteration before the previous one is gone or we might run
into consistency and voting issues
2020-09-16 19:21:59 +02:00
Jacek Sieka 04b49cae35 Quick fix to prune some states, pending smarter state storage (#1624)
* Quick fix to prune some states, pending smarter state storage

Adverse effects might include slow rewinds - typically the protocol
doesn't ask for pre-finalized states but RPC might

* document issue, add test

* fix cache miss log
2020-09-16 19:21:59 +02:00
Eugene Kabanov de238c62b7 Bump chronos to help investigate Index problem. (#1625) 2020-09-16 19:21:59 +02:00
Jacek Sieka 07e7916b30 fix req/resp protocol (#1621)
per spec, we must half-close request stream - not doing so may lead to
failure of the other end to start processing our request leading to
timeouts.

In particular, this fixes many sync problems that have been seen on
medalla.

* remove safeClose - close no longer raises
* use per-chunk timeouts in request processing
2020-09-16 19:21:59 +02:00
Sacha Saint-Leger 67ba595ce4 fix low peer count command typo (#1619) 2020-09-16 19:21:59 +02:00
Jacek Sieka 6bd0b760ad bump libp2p, introduce AsyncQueue BufferStream (#1599)
* Syncing workers now not bound to peers.
Sync status is now printed in statusbar.

* Add `SyncQueue.outSlot` to statusbar too.

* Add `inRangeEvent` and `rangeAge` parameter.

* Fix rangeAge is not depends on SyncQueue latest slot.
Fix syncManager to start from latest local head slot.

* Add notInRange event.

* bump libp2p, introduce AsyncQueue BufferStream

* bump

Co-authored-by: cheatfate <eugene.kabanov@status.im>
2020-09-16 19:21:59 +02:00
tersec 78ec548313 use V=1 in Jenkinsfile (#1618) 2020-09-16 19:21:59 +02:00
tersec 3a603d303f match log filenames more precisely for logtrace analysis (#1617)
* match log filenames more precisely for logtrace analysis
2020-09-16 19:21:59 +02:00
Dustin Brody 0c5cae701e remove obsolete comment 2020-09-16 19:21:59 +02:00
tersec cb1a5cf2ca Fix some warnings and hints and partly revert #1610 (#1615)
* address some XDeclaredButNotUsed, ConvFromXtoItselfNotNeeded, and UnusedImport hints and warnings

* partly revert #1610
2020-09-16 19:21:59 +02:00
tersec 45dd971955 mark comments documenting functions as a whole as such (#1613) 2020-09-16 19:21:59 +02:00
Jacek Sieka 7e3f20236f better state cache reuse (#1612) 2020-09-16 19:21:59 +02:00
tersec 1f9cd8ce2b stop discarding future epochs; remove a StateCache() construction (#1610)
* stop discarding non-existent future epochs during epoch state transitions; remove a pointless StateCache() construction in advance_slots()

* update nbench to pass StateCache to process_slots()
2020-09-16 19:21:59 +02:00
Jacek Sieka 1b16ad10b1 bump libp2p (#1609) 2020-09-16 19:21:59 +02:00
Jacek Sieka 625e0912de simplify libp2p logging (#1605)
and a few other small logging fixes
2020-09-16 19:21:59 +02:00
nbc-bump-bot[bot] 5a55ca8f47 auto-bump nim-libp2p (#1604)
Co-authored-by: = <arnetheduck@users.noreply.github.com>
2020-09-16 19:21:59 +02:00
Jacek Sieka a095a1e24d bump chronos (#1598)
* bump chronos

this reverts backwards-incompatible changes to CancelledError and
resores other functionality.

chronos metrics are lost and will need to be reimplemented.

* bump
2020-09-16 19:21:59 +02:00
tersec d69ab20d47 address issue #1552 (#1601) 2020-09-16 19:21:59 +02:00
Jacek Sieka 29e56232a7 avoid hash tree root calculation when loading blocks from database (#1572) 2020-09-16 19:21:59 +02:00
Ștefan Talpalaru c2384246bc support spaces in $(MAKE) (#1603) 2020-09-16 19:21:59 +02:00