Tests for small network#29
Tests for small network#29marc-casperlabs merged 19 commits intocasper-network:masterfrom marc-casperlabs:NDRS-93/test-small_network
Conversation
…p-wise main loop execution
| } | ||
|
|
||
| impl Reactor for TestReactor { | ||
| type Event = Event; |
There was a problem hiding this comment.
I think this shows a downside of the current reactor encoding - namely that the Event is an associated type. It means that dispatch_event is dependent on the type of the Event and it will influence how the events are dispatched - where they go, how they're handled (delayed, rejected, etc) but this won't let us test the system as it will run in production. We would be testing a "test reactor".
There was a problem hiding this comment.
That's fine, I think. We're not testing the reactor here, but the networking component!
There was a problem hiding this comment.
So having a bespoke reactor just for doing that seems entirely reasonable to me. Consider it a test rig for a part. When testing car engines, they're initially not put in a car, but on a test stand!
…sockets or tasks behind
29: Temporarily limit trie leaf size r=mpapierski a=Fraser999 This PR introduces a temporary limit on the maximum size for a trie leaf. The limit is expected to be removed again in the next node release, as it will have served its purpose of providing a known upper limit on all trie leafs which will exist at the point of upgrading to the subsequent version. There are four special cases where the limit only generates a log warning but still executes for calls which must not fail under any circumstances. These call through to `TrackingCopy::force_write`, and with the upcoming restrictions to be applied to the auction contract, should never actually exceed the specified limit. Closes [casper-network#2605](casper-network#2605). Co-authored-by: Fraser Hutchison <fraser@casperlabs.io> Co-authored-by: Michał Papierski <michal@casperlabs.io>
scratch state: use a BTreeMap for tracking keys in the cache
# This is the 1st commit message: rebasing # The commit message #2 will be skipped: # WIP # The commit message #3 will be skipped: # WIP # The commit message #4 will be skipped: # wip # The commit message #5 will be skipped: # wip # The commit message #6 will be skipped: # wip # The commit message #7 will be skipped: # wip # The commit message #8 will be skipped: # wip # The commit message #9 will be skipped: # wip # The commit message casper-network#10 will be skipped: # wip # The commit message casper-network#11 will be skipped: # wip # The commit message casper-network#12 will be skipped: # wip # The commit message casper-network#13 will be skipped: # rebasing # The commit message casper-network#14 will be skipped: # wip # The commit message casper-network#15 will be skipped: # wip # The commit message casper-network#16 will be skipped: # wip # The commit message casper-network#17 will be skipped: # wip # The commit message casper-network#18 will be skipped: # wip # The commit message casper-network#19 will be skipped: # wip # The commit message casper-network#20 will be skipped: # rebasing # The commit message casper-network#21 will be skipped: # wip # The commit message casper-network#22 will be skipped: # wip # The commit message casper-network#23 will be skipped: # wip # The commit message casper-network#24 will be skipped: # wip # The commit message casper-network#25 will be skipped: # wip # The commit message casper-network#26 will be skipped: # wip # The commit message casper-network#27 will be skipped: # wip # The commit message casper-network#28 will be skipped: # wip # The commit message casper-network#29 will be skipped: # wip
# This is the 1st commit message: rebasing # The commit message #2 will be skipped: # WIP # The commit message #3 will be skipped: # WIP # The commit message #4 will be skipped: # wip # The commit message #5 will be skipped: # wip # The commit message #6 will be skipped: # wip # The commit message #7 will be skipped: # wip # The commit message #8 will be skipped: # wip # The commit message #9 will be skipped: # wip # The commit message casper-network#10 will be skipped: # wip # The commit message casper-network#11 will be skipped: # wip # The commit message casper-network#12 will be skipped: # wip # The commit message casper-network#13 will be skipped: # rebasing # The commit message casper-network#14 will be skipped: # wip # The commit message casper-network#15 will be skipped: # wip # The commit message casper-network#16 will be skipped: # wip # The commit message casper-network#17 will be skipped: # wip # The commit message casper-network#18 will be skipped: # wip # The commit message casper-network#19 will be skipped: # wip # The commit message casper-network#20 will be skipped: # rebasing # The commit message casper-network#21 will be skipped: # wip # The commit message casper-network#22 will be skipped: # wip # The commit message casper-network#23 will be skipped: # wip # The commit message casper-network#24 will be skipped: # wip # The commit message casper-network#25 will be skipped: # wip # The commit message casper-network#26 will be skipped: # wip # The commit message casper-network#27 will be skipped: # wip # The commit message casper-network#28 will be skipped: # wip # The commit message casper-network#29 will be skipped: # wip # The commit message casper-network#30 will be skipped: # wip # The commit message casper-network#31 will be skipped: # wip # The commit message casper-network#32 will be skipped: # wip
# This is the 1st commit message: rebasing # The commit message #2 will be skipped: # WIP # The commit message #3 will be skipped: # WIP # The commit message #4 will be skipped: # wip # The commit message #5 will be skipped: # wip # The commit message #6 will be skipped: # wip # The commit message #7 will be skipped: # wip # The commit message #8 will be skipped: # wip # The commit message #9 will be skipped: # wip # The commit message casper-network#10 will be skipped: # wip # The commit message casper-network#11 will be skipped: # wip # The commit message casper-network#12 will be skipped: # wip # The commit message casper-network#13 will be skipped: # rebasing # The commit message casper-network#14 will be skipped: # wip # The commit message casper-network#15 will be skipped: # wip # The commit message casper-network#16 will be skipped: # wip # The commit message casper-network#17 will be skipped: # wip # The commit message casper-network#18 will be skipped: # wip # The commit message casper-network#19 will be skipped: # wip # The commit message casper-network#20 will be skipped: # rebasing # The commit message casper-network#21 will be skipped: # wip # The commit message casper-network#22 will be skipped: # wip # The commit message casper-network#23 will be skipped: # wip # The commit message casper-network#24 will be skipped: # wip # The commit message casper-network#25 will be skipped: # wip # The commit message casper-network#26 will be skipped: # wip # The commit message casper-network#27 will be skipped: # wip # The commit message casper-network#28 will be skipped: # wip # The commit message casper-network#29 will be skipped: # wip # The commit message casper-network#30 will be skipped: # wip # The commit message casper-network#31 will be skipped: # wip # The commit message casper-network#32 will be skipped: # wip # The commit message casper-network#33 will be skipped: # wip # The commit message casper-network#34 will be skipped: # wip # The commit message casper-network#35 will be skipped: # wip # The commit message casper-network#36 will be skipped: # wip # The commit message casper-network#37 will be skipped: # wip # The commit message casper-network#38 will be skipped: # wip # The commit message casper-network#39 will be skipped: # wip # The commit message casper-network#40 will be skipped: # rebasing
This PR brings some drastic changes on how the reactor is run: Instead of having a mostly opaque
runfunction, we now use a state-preservingRunnerinstead that can be interrupted.This changes little for production use, but it makes it possible to interrupt and resume event processing of a reactor, controlling its progress from the outside (sans IO tasks). This is very useful when writing tests, which can be expressed very naturally:
This PR demonstrates how to do that, for an example look at
tests.rsofsmall_network, which implements a tiny testing reactor and a networking structure that can run many of these.Other notes:
small_netitself, this is naturally the next item to be fixed.small_net'stest.rscould be reused for testing other components, as it provides a generic interface for running multiple nodes until a condition holds true.Naturally this PR is still a WIP.This has turned up a few issues already that were present before, but I want to fix these in subsequent PRs.