6 Commits

Author SHA1 Message Date
Akihito Nakano
5a2a4d649d Scoring (#8)
* Initial implementation for scoring-parameters test plan

* Record the number of BeaconBlock messages received per epoch

* Add attacker module

* Dialing from attackers to a beacon node

* Add debug log

* Add TopicScoreParameter for BeaconBlock

* Rename crate and collect attacker info

* Add dashboards

* Add metrics

* Add topic_msg_sent_counts to dashboard

* Attestations

* rename

* topic_msg_sent_counts

* Make params configurable

* dashboards

* Aggregates per epoch

* Attestations per epoch

* run time

* Remove empty descriptions

* cargo update

* Record the result of sync_committee_aggregates and sync_committee_messages

* Update Messages dashboard

* Topic params for SignedContributionAndProof and SyncCommitteeMessage

* Make get_param() generic

* Use get_param()

* Dashboard: automate run_id

* Dashboard: Add `Settings`

* Set gossipsub config based on lighthouse

* Record peer scores on its own task

* Record metrics on its own task

* Fix invalid gossipsub config

* Remove unnecessary comment lines

* Some cleanup

* Merge main into scoring-parameters

* Add scoring test plan to CI workflow

* Update dashboard

* Fix: discarding correct message

* Add `Cache Misses` to the dashboard

* Avoid unnecessary compiling

* Add Cargo.lock

* Introduce NetworkConfiguration

* Fix clippy warnings

* Upgrade npg

* Add README

* Fix clippy warnings

* Improve qualifications

* Remove debug lines
2022-12-20 12:50:29 +11:00
Age Manning
a260f69580 Gossipsub Simulations (#9)
* episub-sim

* network generation

* mainnet network generation

* no pretty print

* add small network for testing

* upgrade versions, make the thing compile

* checkpoint

* this is ridiculous

* make gen_topology reachable by testground

* add 16 instsances for testing

* add running command

* remove params

* pass new participants param

* update upstream reg

* update upstream reg

* put msg generation back in

* put publishing back in

* adding metrics

* record metrics on intervals

* add gossip max limit

* stop fghting testground. For now

* update README

* Revert "stop fghting testground. For now"

This reverts commit a976c5371b.

* use composition files to get the docker build context a layer up

* fix params and logs

* remove unused files

* cache workspace deps

* cache workspace deps _the right_ way

* updates

* some docs

* Update CI and remove root workspace

* Add duplicates, fix clippy, improve dash

* Reduce message sizes, some debugging

* Update dash and logs

* Add scripts folder

* Fix executor lockup

* fmt and clippy

* Add some docs

* Dot to mermaid

Co-authored-by: Diva M <divma@protonmail.com>
2022-11-29 16:06:53 +11:00
Akihito Nakano
d24d3c82e0 smoke: upgrade dependencies (#6)
* Consolidate dependencies

* Upgrade rust-libp2p from v0.45.1 to v0.48.0

* Improve the barrier function to use `take_until` instead of `select!`

* Install protoc

* Upgrade testground sdk from v0.3 to v0.4

Co-authored-by: Age Manning <Age@AgeManning.com>
2022-11-22 13:34:12 +11:00
Akihito Nakano
cb2d84dcc4 Add emulation test plan (#4)
* Scaffold for a new test and implement sharing test instance information

* Setup discovery

* Subscribe to a topic and wait for `warmup` time to expire

* Add MaliciousBehaviour

* Remove unnecessary dependency

* Add emulation directory to CI

* Fix clippy warning

* Make sure swarm started listening at the time to the barrier

* Handle subscriptions

* Handle PRUNEs and schedule re-graft

* Publish messages

* Print peer scores

* Store scores to InfluxDB

* Store metrics to InfluxDB

* Store more metrics to InfluxDB

* Tweak comments

* Refactor queries

* Store Histogram metrics to InfluxDB

* Tweak scores

* Add `instance_peer_id` tag to the measurements

* Fix wrong field name

* Introduce message_rate

* Parameterize honest node configs

* Tweak comments and update default configs

* Fix deprecation warning (NetworkBehaviourEventProcess) and improve barrier method

* Install protoc

* Add README for emulation crate

* Update emulation/src/attacker.rs

Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com>

* Update emulation/src/honest.rs

Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com>

* Update emulation/src/utils.rs

Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com>

* Update emulation/src/utils.rs

Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com>

* Update emulation/src/utils.rs

Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com>

* Update emulation/src/utils.rs

Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com>

* Remove unnecessary unwrap

* Make some comments to docs

* Remove unnecessary comment

* No need to exclude test plans

because the lock file can be automatically generated

* Move tags commonly used to constants

* Remove plan directory

no longer need to change working-directory since the plans are members of workspace

* cargo update

* Upgrade libp2p from 0.46 to 0.48

* Remove needless patch

* Update libp2p (and prometheus-client)

* Revert to libp2p whose metrics encoding is fixed to `protobuf` to make the test plan work

* Add dashboard

* Add `Peer scores` dashboard

* Add panels to `Gossipsub metrics` dashboard

* invalid_messages_per_topic
* accepted_messages_per_topic
* ignored_messages_per_topic
* rejected_messages_per_topic
* topic_iwant_msgs

* Align the timestamp between  metrics of all instances

This is helpful when we want to sort metrics by something not timestamp(e.g. instance_name).

* Upgrade testground SDK to the latest version

* Rename dashboard

* Disable chrono's default features for the sake of compile times

* Remove debug code

* Add Grafana container with preconfigured datasources and dashboards

* Update README

Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com>
2022-11-22 09:30:40 +11:00
Akihito Nakano
0670c91d7c Initial implementation (#1)
* cargo init

* Scaffolding for test plan

* Implement smoke test

* Fix: test case stuck due to race condition

* Simply calling client.signal_and_wait will not advance Swarm processing.
* We need a sleep time to prevent a race condition caused by variations in the timing of receiving messages from the synchronization service of testground. Without the sleep time, can not count the events i.e. `Subscribed` correctly.

* Tweak messages

* Detect duplicated message

* Use Gossipsub::all_peers instead of Swarm::connected_peers for accuracy

* Add logging

* Specify `libp2p_gossipsub` for logging

* Record the Swarm events that happen while waiting for the barrier

* Parameterize `GossipsubConfig::history_length`

* Fix clippy warnings

* Add GitHub Actions workflow

* Move the `smoke` test plan to a nested directory

* Bump up the version

* Tweak

* Set working-directory as the plan directories are not included in the workspace

* Fix the dummy main function could remain in the release binary

* Remove `smoke` job since the test fails sporadically
2022-07-16 17:32:52 -05:00
Diva M
7207710305 setup workspace with CI and gitignore 2022-07-07 12:06:26 -05:00