1
0
mirror of synced 2025-01-10 07:46:05 +00:00

155 Commits

Author SHA1 Message Date
gusto
94e384f609
Tree settings for sim overlay (#257)
* Tree settings for sim overlay

* WIP dyn node simulation

* Allow generic settings and states for dispatched nodes

* Update tests
2023-07-18 14:44:23 +03:00
gusto
fe9f2ba006
Updated integration tests cases, increased nightly iteration count (#263) 2023-07-17 21:16:05 +03:00
Al Liu
a59682be54
fix waku feature gate (#260) 2023-07-14 15:59:16 +08:00
Giacomo Pasini
c29a641a9f
Refactor NetworkAdapter (#258)
* Rework NetworkAdapter API

The NetworkAdapter API failed to isolate the internals by
providing a way to send a message to a user-provided channel while
the stream listeners expected specific formats.
Unify network messages under the same enum and simplify sending/
broadcasting messages.

* remove redundant inlines

* use committee.id()

* fmt
2023-07-12 16:12:25 +02:00
Al Liu
9467351c10
Finish View wrapper (#254)
* finish View wrapper
2023-07-12 21:30:22 +08:00
Giacomo Pasini
4745b99996
use type alias for network adapter (#256) 2023-07-12 13:33:58 +02:00
Al Liu
7a776af530
Finish BlockId wrapper (#253)
* finish BlockId wrapper
2023-07-12 19:15:29 +08:00
Al Liu
2135676606
Finish NodeId type wrapper (#252)
* add NodeId wrapper
2023-07-11 23:16:49 +08:00
Giacomo Pasini
da2dba2e51
Add unhappy path tests (#247)
* Make timeout configurable

Add a way to configure the consensus timeout at startup.

* Make leader threshold and timeout configurable in tests

* Add tests for the unhappy path

Add a test for the unhappy path by stopping a node.
The rest of the peers are sufficient to reach a quorum but the
offline node will fail to produce a block when it's its turn as a
leader, thus triggering the recovery procedure twice before the
test is considered complete.

* ignore clippy warning
2023-07-11 11:00:11 +02:00
Youngjoon Lee
2b9769b5b7
feat: add nomos-libp2p crate (for nomos-network backend) (#237)
* feat: add libp2p network backend skeleton

* use tokio runtime managed by Overwatch

* feat: add nomos-libp2p crate

* remove gossipsub_message_id_fn

* clippy

* use next() instead of select_next_some()

* rename send_command to execute_command

* const timeout

* disable authn / msg signing to start from a clean slate

* rename CommandSender to CommandResultSender

* add comments

* move node machinery to networkbackend

* fmt

* logs more network events

---------

Co-authored-by: Giacomo Pasini <g.pasini98@gmail.com>
2023-07-11 10:33:57 +02:00
Al Liu
a0cb738b9f
Finish Committee wrapper (#251)
* Committee type wrapper

---------

Co-authored-by: danielsanchezq <sanchez.quiros.daniel@gmail.com>
2023-07-07 16:08:19 +08:00
Al Liu
95bfd24f6d
Finish CommitteeId wrapper (#249)
* CommitteeId type wrapper

* rewrite committee id logic

* remove unused convert

* use correct way to get committe id by member id

* cleanup and add comment

* Simplify child committees method

---------

Co-authored-by: danielsanchezq <sanchez.quiros.daniel@gmail.com>
2023-07-07 15:38:28 +08:00
gusto
37076aaeeb
Nightly tests (#240)
* Nightly notifications

* Publish discovered regression cases as a PR

* Nightly notifications

* Increase nightly tests runtime

* Extract discordnotify and params

* Groovy script fixes

* Remove unused iterations variable

* Cleanup jenkinsfiles and add verbosity
2023-07-06 16:30:43 +03:00
Youngjoon Lee
8d0360ab3c
fix(fuzz): fix precondition for receive_timeout_qc (#248) 2023-07-06 21:14:26 +09:00
Giacomo Pasini
3607ce7627
Unhappy path fixes (#245)
* Add unhappy path handlers for first view

Nodes resolving the first view were not instructed to handle
possible failures. In particular, no timeouts were configured
and nodes were not listening for timeouts from other nodes.
This commit fixes this by making them use the
same path as every other view.

* Endless timeouts

Keep signaling timeout until consensus is achieved.
This could be helpful in network partitioning where messages could
be lost.

* Ensure consistent committee hash

Sort committee members before hashing to ensure all nodes in the
network obtain a consistent hash

* Fix timeout_qc filtering condition

'>' was used instead of '=='

* Fix new view topic name

'votes' was used instead of 'new-view'

* Fix filtering condition for unhappy path tally

Rogue '!' at the beginning

* Add timeout tally

Filter timeouts to allow only timeouts for the current view
coming from root committee members.
We might want to try to unigy this with happy and unhappy tally.

* Add debug logs

* clippy happy
2023-07-05 15:30:57 +02:00
Al Liu
d0c6df23fc
Implement Rust version tree overlay (#238)
* implement tree overlay in Rust
2023-07-05 17:28:22 +08:00
Giacomo Pasini
90cf29bf86
Better tests (#232)
* add basic integration tests

* add a way to configure overlay threshold

* Save logs to file in case of failure

* Increase number of test nodes to 10

* fix tests

* use fraction instead of tuple

* fmt
2023-07-04 11:39:28 +02:00
Youngjoon Lee
5199ee12e9
fix: add a guard on the view for LeaderProof validation (#233) 2023-07-04 18:31:33 +09:00
Youngjoon Lee
98aa138b87
feat: enforce TimeoutQc to be constructed only by new() (#229) 2023-06-28 23:37:27 +09:00
Al Liu
224a3a53f5
fix tally_by condition (#234) 2023-06-28 17:56:16 +08:00
Al Liu
4a80690c1f
Add a cli arg to support redirect log (#230)
* add cli arg to support redirect log
2023-06-28 17:10:19 +08:00
Youngjoon Lee
8956a3547b
fix: remove Qc.parent_view() that has a bug (#223) 2023-06-27 23:56:36 +09:00
Giacomo Pasini
b884e1ceca
Fix waku backend (#231)
* Fix order of network streams

When fetching a message from the network, we need to first listen
for incoming messages and then look at the storage. If we do this
in the opposite order, there's a brief moment where we've freezed
our view of stored messages and are not yet listening for incoming
ones, thus risking loosing messages.

* Wait for waku db spurious delays

Sometimes waku takes some time (e.g. a few seconds) before making
a received message available through the archive query. Let's
account for this by making repeated calls if the first one is not
successful.

* Add initial network wait

We've observed in testing that even if waku reports that some
peers are connected it can't really deliver a message. To overcome
this limitation, we add a wait at the network service startup.
We know this is not ideal, but Waku will eventually be replaced and
we're looking for a quick fix.

* fmt
2023-06-27 16:29:01 +02:00
gusto
55648e3151
Simulation network broadcast (#225)
* Sim network broadcast method

* Remove list of all nodes in carnot node instance

* Use network broadcast method within nodes

* Add helper method for network payload
2023-06-27 14:20:59 +03:00
Giacomo Pasini
09370dcef8
Integrations tests (#221)
* make config struct fields public

* add basic integration tests

* Add libssl-dev dependency

* fix comments

---------

Co-authored-by: Gusto <bacvinka@gmail.com>
2023-06-27 13:05:09 +02:00
Youngjoon Lee
3eceed5d9a
test(fuzz): more randomness for receive_timeout_qc (#226) 2023-06-27 08:34:16 +09:00
Youngjoon Lee
bdf31b77cb
docs(fuzz): update README (#227) 2023-06-26 23:46:24 +09:00
Youngjoon Lee
2c9d6b1401
test(fuzz): add more invariant checks (#224) 2023-06-26 20:34:12 +09:00
Youngjoon Lee
feb428bf18
fix(fuzz): apply ReceiveSafeBlock & ReceiveUnsafeBlock only when parent exists (#222) 2023-06-26 20:20:55 +09:00
Youngjoon Lee
deeb3eeba0
test(fuzz): add approve_new_view & receive_safe_block_with_aggregated_qc transition (#208) 2023-06-26 18:37:35 +09:00
Giacomo Pasini
8fad13b0cc
Separate nomos node into bin and lib sections (#209) 2023-06-22 16:58:47 +02:00
Al Liu
18bbf63a3f
update simulation app configuration (#217) 2023-06-22 19:50:34 +08:00
Youngjoon Lee
ec3fb62baf
refactor(fuzz): modularize fuzz testing (#211) 2023-06-22 15:15:38 +09:00
Youngjoon Lee
f4194bc728
test(fuzz): add local_timeout & receive_timeout_qc transitions (#207) 2023-06-22 10:58:26 +09:00
Youngjoon Lee
371ba17922
test: consensus-engine fuzz testing (happy path) (#186) 2023-06-21 22:35:32 +09:00
Alberto Soutullo
53a89c33a8
Fixed ident in initial_peers and added relayTopics that was missing (#213) 2023-06-21 14:16:45 +02:00
Alberto Soutullo
3f30bcc0a8
Changed mockpool-node to nomos-node in Dockerfile (#212)
* Changed mockpool-node to nomos-node in Dockerfile

* Deleted old yml and copying correct one
2023-06-21 12:02:56 +02:00
Al Liu
4ccc19f5a3
Support configurable records (#200)
* support configurable records
2023-06-21 16:31:36 +08:00
Al Liu
c74b53be2e
Log message sending failure (#206)
* fix a todo in waku adapter
2023-06-21 16:30:47 +08:00
Giacomo Pasini
2fc10f94f8
Rename mockpool-node to nomos-node (#203) 2023-06-20 17:04:52 +02:00
Youngjoon Lee
f02234f9d1
deps: bump waku-bindings to handle ephemeral field (#160) 2023-06-20 20:58:22 +09:00
Youngjoon Lee
6061ba3f3d
fix: prevent skipping one view when proposing a block in unhappy path (#199) 2023-06-20 00:09:33 +09:00
Youngjoon Lee
2db493c753
build: bump Rust to 1.70.0 to resolve clippy errors (#201) 2023-06-20 00:03:54 +09:00
Daniel Sanchez
bed0b9448d
Simulation unhappy path (#193)
* Use elapsed time

* Added timeout

* Extract tally

* Missing elapsed time

* Fix new view leader behaviour

* Fix tests

* Fix timeout double check

* Fix logs

* TimeoutHandler nitpicks

* Clippy happy

* Fix timeout sub

* Modify discard messages comment
2023-06-19 15:27:14 +02:00
gusto
faacd10172
Remove dummy node from simapp settings and app itself (#196) 2023-06-17 13:38:59 +03:00
Al Liu
40048fa47b
Fix #183: support structured log for sim app. (#184) 2023-06-16 19:26:48 +08:00
gusto
285f899c8a
Update and rename main.yml to master.yml (#194) 2023-06-15 12:48:36 +03:00
Al Liu
9afd6c007c
Simulation conf polish (#181)
* polish Duration ser/deser and support step_time in conf file
2023-06-15 17:42:42 +08:00
Al Liu
b6789b994e
Fix #182: gracefully shutdown (#187)
* finish signal and cleanup
2023-06-15 17:40:29 +08:00
Youngjoon Lee
f631d9b737
fix: prevent approving new views not bigger than the last timeout_qc (#165) 2023-06-15 18:31:52 +09:00