Commit Graph

120 Commits

Author SHA1 Message Date
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
Giacomo Pasini 2c23bda702
Carnot info api (#177)
* add missing accessors

* add api to return info from consensus service

* move processing into its own function

* feat: add HTTP GET `/carnot/info` API (#178)

---------

Co-authored-by: Youngjoon Lee <taxihighway@gmail.com>
2023-06-15 11:29:50 +02:00
Al Liu e57cb7b3cf
remove RwLock from SimmulationRunnerInner (#189) 2023-06-15 11:16:28 +02:00
Al Liu 27d9f72035
Simulation happy path (#161)
* finish subscriber manager

* optimize subscribe on SimulationRunnerHandle

* fix comment

* replace std locks to parking_lot locks

* move producer initialization out simulate fn

* WIP

* optimize run fn

* update condition

* fix CI

* collect run times

* Add happy-path consensus engine

* tmp

* Fit types from spec (#124)

* Match types to spec

* Remove Output import

* Consensus engine rework (#126)

* rework

* fix test

* clippy happy

---------

Co-authored-by: Giacomo Pasini <Zeegomo@users.noreply.github.com>

* Adapt carnot network adapter interfaces and implementations

* Fix errors

* Update network with engine types

* Fit types yet again

* Remove leadership and old overlay
Create carnot event builder
Added some adjustments

* Add view to vote

* Fix serde derive in consensus-engine

* Add serde feature for engine in core

* Use view in tally

* Move carnot tally to consensus service

* Add new view msg

* Fit engine types in adapter

* Missing serde feature in consensus service

* Implement carnot event builder

* Implement even builder run main tasks

* Fill up view resolver

* Fix errors on network adapter implementations

* Clippy happy

* Extract event handling to independent methods in View

* Fix test

* Refactor carnot event builder (#135)

* refactor

* format

* Discriminate proposal messages (#136)

* Derive block id from wire format (#139)

* Derive block id from wire format

* Derive id on block creation

* Use compile time hash size

* Add leader role (#138)

* add leadership stub

* fix gather_new_views

* fmt

* actually build qc

* remove redundant fields

* add flat overlay (#143)

* add flat overlay

* fix

* sort imports

* fix tests

* Fix waku update

* rewrite data collection add different kind of subscribers

* fix fmt

* Unhappy tally (#137)

* Refactor tally module

* Implement tally for new view messages

* Assess pr comments

* Fix rebase

* simplify tally

---------

Co-authored-by: Giacomo Pasini <g.pasini98@gmail.com>

* fix gather_new_views

* working node

* fix unhappy path

* remove leftover

* Kickstart event building in sim app

* finish event builder

* fix comment

* add Tally

* gather enough new views then construct ProposalBlock event

* Revert "gather enough new views then construct ProposalBlock event"

This reverts commit 87da2bdd0c.

* WIP: CarnotNode

* WIP

* finish event handle

* dump state

* WIP

* finish message sending

* fix some compile errors

* make project compile

* update

* fix fmt and clippy

* optimize json ser/deser and add a config

* update Cargo.toml

* Implement leader proposing (#154)

* Implement leader proposing

* fix fmt

---------

Co-authored-by: al8n <scygliu1@gmail.com>

* fix ser/deser bugs

* fix subscriber bugs

* Fix proposing genesis

* Fix genesis retrieval in consensus-engine

* Bring back general block proposal event

* Fix leaf voting

* fix init node bugs

* add more tracing

* fix empty qc

* fix data race

* fix all panics

* cleanup

* propose new blocks

* fix comment

* do not approve for the same block

* no panics

* fix some comments

* use serde_with

* Bring back genesis on 0

* Fix genesis retrieval
Replace output enum
Vote for genesis proposal

* Genesis methods

* fix StardardQc::genesis()

* fix genesis block bug

* fix PR comment

* fix PR comment

* fix PR comment

* fix PR comment

* fix PR comment

* Fix tally
Fix proposing

* Remove public block building
Added raw method

* Missing fmt

* clippy happy

* fix io stream downcast

* optional stream-type arg, by default we do not run any subscriber

* fmt

* cleanup

* Remove from header block constructor

* Fix duplicated approve (#180)

* fix duplicated approve

* Success tally just on threshold

* Integrate random beacon on happy path

* Fix missing updating beacon

* Replicate consensus output

* Prune older non relevant messages from cache

* Remove view info just again

* Refactor Block deps

* Reverse wrong parent committee call in Consensus engine

* Remove useless event builder settings

* Remove blocks store from event builder

* Remove unnecessary carnot seed

* Remove duplicated proposals check

---------

Co-authored-by: Giacomo Pasini <g.pasini98@gmail.com>
Co-authored-by: Daniel Sanchez <sanchez.quiros.daniel@gmail.com>
Co-authored-by: Giacomo Pasini <Zeegomo@users.noreply.github.com>
2023-06-14 16:52:37 +02:00
Giacomo Pasini 75025e8cf0
Consensus service refactor (#176)
The consensus service was becoming a bit messy and difficult to maintain.
This PR moves handling invididual events to their own function and refactors the cancelabe task system in a separate struct.
2023-06-13 12:11:55 +02:00
Jakub Sokołowski fe0361a5b8
ci: fix GOCACHE and GOPATH to avoid poisoning (#125)
We've had this issue before with some `go-waku` builds:
https://github.com/waku-org/go-waku/pull/512

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-06-13 11:29:01 +03:00
Giacomo Pasini 9c81b72711
Random beacon (#167)
* move overlay to consensus engine

* Integrate random beacon in overlay

This commit integrates the random beacon as specified in the nomos
spec into the consensus engine library as part of the overlay.
In addition, it separates the overlay part responsible for leader
selection as an independent trait LeaderSelection, so as to share
the overall overlay structure among most constructions.

Furthermore, a leader proof has been added to a block to verify
that the proposer had valid rights to do so.

The current implementation hardcodes the leader selection update
in the consensus service, but we probably want to abstract it away
through something like the adapter pattern we use of other services
in the node.

* Move leader selection update to separate function

* Add generic support for leader selection in consensus service (#170)

* Add generic support for leader selection in consensus service

* fix

* use settings struct instead of tuple

* fix tests
2023-06-12 15:14:49 +02:00
Youngjoon Lee cfaa7cf772
fix: prevent skipping the current view when calculating latest_committed_block (#163) 2023-06-07 19:32:48 +09:00
Youngjoon Lee a055c2524a
fix: prevent skipping one view when proposing a block in unhappy path (#166) 2023-06-07 09:56:21 +09:00
Al Liu d864fecd07
chore: replace std locks to parking_lot locks in simulations (#141)
* replace std locks to parking_lot locks
2023-05-31 12:57:42 +08:00
Youngjoon Lee 2d60ce9921
fix: remove duplicate `tracing_subscriber` init for `nomos-node` bin (#157) 2023-05-29 22:40:22 +09:00
Youngjoon Lee 6229fc98bc
fix gather_timeout being pending (#156) 2023-05-27 09:32:39 +09:00
Giacomo Pasini 6c64720e39
Add root timeout handling (#153)
* Add handling of root timeout

* Use StandardQc instead of Qc for high_qc

Since high_qc is guaranteed to be a standard qc, let's just use
StandardQc as a type in all messages that use it.
2023-05-22 15:23:30 +02:00
Daniel Sanchez bc453b686f
Consensus orchestrator (#128)
* Add happy-path consensus engine

* tmp

* Fit types from spec (#124)

* Match types to spec

* Remove Output import

* Consensus engine rework (#126)

* rework

* fix test

* clippy happy

---------

Co-authored-by: Giacomo Pasini <Zeegomo@users.noreply.github.com>

* Adapt carnot network adapter interfaces and implementations

* Fix errors

* Update network with engine types

* Fit types yet again

* Remove leadership and old overlay
Create carnot event builder
Added some adjustments

* Add view to vote

* Fix serde derive in consensus-engine

* Add serde feature for engine in core

* Use view in tally

* Move carnot tally to consensus service

* Add new view msg

* Fit engine types in adapter

* Missing serde feature in consensus service

* Implement carnot event builder

* Implement even builder run main tasks

* Fill up view resolver

* Fix errors on network adapter implementations

* Clippy happy

* Extract event handling to independent methods in View

* Fix test

* Refactor carnot event builder (#135)

* refactor

* format

* Discriminate proposal messages (#136)

* Derive block id from wire format (#139)

* Derive block id from wire format

* Derive id on block creation

* Use compile time hash size

* Add leader role (#138)

* add leadership stub

* fix gather_new_views

* fmt

* actually build qc

* remove redundant fields

* add flat overlay (#143)

* add flat overlay

* fix

* sort imports

* fix tests

* Unhappy tally (#137)

* Refactor tally module

* Implement tally for new view messages

* Assess pr comments

* Fix rebase

* simplify tally

---------

Co-authored-by: Giacomo Pasini <g.pasini98@gmail.com>

* Working node (#149)

* fix gather_new_views

* working node

* fix unhappy path

* remove leftover

* fix comments

* update waku (#146)

* update waku

* Fix waku update

---------

Co-authored-by: danielsanchezq <sanchez.quiros.daniel@gmail.com>

* little fixes

* Consensus tasks cancellation (#147)

* fix

* Create view cancel and cancel cache

* Attach cancellation to consensus tasks

* Fix view binds

---------

Co-authored-by: Giacomo Pasini <g.pasini98@gmail.com>

---------

Co-authored-by: danielsanchezq <sanchez.quiros.daniel@gmail.com>

* Remove clones on consts

---------

Co-authored-by: Al Liu <scygliu1@gmail.com>
Co-authored-by: Giacomo Pasini <g.pasini98@gmail.com>
Co-authored-by: Giacomo Pasini <Zeegomo@users.noreply.github.com>
2023-05-22 14:56:56 +02:00
Giacomo Pasini fdc22111d3
use nanosecond precision in waku timestamp (#152) 2023-05-18 15:19:36 +02:00
Giacomo Pasini bbd313f70a
update waku (#146)
* update waku

* Fix waku update

---------

Co-authored-by: danielsanchezq <sanchez.quiros.daniel@gmail.com>
2023-05-15 16:21:49 +02:00
Al Liu 4b880778ab
finish subscriber manager (#140)
* finish subscriber manager
2023-05-11 16:09:53 +08:00
Giacomo Pasini eb6f36782d
fix link flgs (#144) 2023-05-08 17:28:10 +02:00
gusto 0bf6e6d272
Simulation initialization (#122)
* Use enums for different settings types

* Enum for overlay settings

* Configurable simulation overlay

* Use duration type for network behaviour delays

* Configurable simulation nodes

* Runner for different node types

* Seedable rng

* Convert settings to required objects

* Implement IOStreamSettings deserialization

* Use common run method for different node types

* Configuration for simapp

* Testcase for region distribution

* Use unix time if seed is not provided
2023-05-08 13:06:39 +03:00
Daniel Sanchez 26d10856ff
Adapt carnot network adapter interfaces and implementations to latest spec (#121)
* Add happy-path consensus engine

* tmp

* Fit types from spec (#124)

* Match types to spec

* Remove Output import

* Consensus engine rework (#126)

* rework

* fix test

* clippy happy

---------

Co-authored-by: Giacomo Pasini <Zeegomo@users.noreply.github.com>

* Adapt carnot network adapter interfaces and implementations

* Fix errors

* Update network with engine types

* Fit types yet again

---------

Co-authored-by: Al Liu <scygliu1@gmail.com>
Co-authored-by: Giacomo Pasini <g.pasini98@gmail.com>
Co-authored-by: Giacomo Pasini <Zeegomo@users.noreply.github.com>
2023-05-01 17:47:56 +02:00
Giacomo Pasini f8617d7331
Consensus engine rework (#127)
---------

Co-authored-by: Giacomo Pasini <Zeegomo@users.noreply.github.com>

---------

Co-authored-by: Al Liu <scygliu1@gmail.com>
Co-authored-by: Daniel Sanchez <sanchez.quiros.daniel@gmail.com>
2023-04-27 19:18:24 +02:00
Al Liu ea7896f06c
Simulation streaming and gracefully shutdown (#119)
* add stream supports

* add test case

* add polars stream, and force to use stream for the runner

* using arcswap instead RefCell for producers

* finish gracefully shutdown

* - add IOProducer and IOSubscriber
- fix deadlock in sync runner
- fix testcases
2023-04-25 19:14:30 +08:00
Álvaro Castro-Castilla b1381d727f
Update README.md (#120) 2023-04-24 11:05:00 +02:00
Al Liu c2d1ee1291
add rustfmt.toml (#118) 2023-04-19 15:59:51 +08:00
gusto 2206d7a291
Use par_iter in network module (#116)
* Use par_iter in network module

* Pass rng from filter function

* Remove locking for network messages
2023-04-13 17:24:27 +03:00
gusto a87418c908
Test voting steps with various node roles (#114)
* Single step send receive runner tests

* Rename network to overlay state

* Store every overlay that might happen

* Get related nodes for from node id

* Add leader role

* WIP dummy handle events

* Leader and root roles

* Add intent as helper to dummy vote

* Check if has enough votes

* Proposal to vote to new view tests

* Update sync runner tests

* Smallrng in send receive tests

* Send initial vote next view leaders in tests

* Local view struct for node

* Large node number tests

* Fix internal to internal case
2023-04-10 13:18:20 +03:00
Al Liu a19278480d
Pipe output data (#111) 2023-04-04 20:26:57 +08:00
Al Liu d07da7ba5a
add missing ward (#112) 2023-04-03 17:17:14 +08:00
gusto 901ebf4152
Message sending between simulation nodes (#110)
* Dummy node for simulations

* Shared network state for nodes

* Runner one step test

* Beginning of network interface

* Connect dummy node to network

* Network step tests

* Pop messages that are being sent

* Regions send receive tests

* Setup network in sync runner tests

* Dispatch and collect node messages during sim step

* Improve network interface receiver
2023-03-31 12:48:06 +03:00
Al Liu c882a58286
Add StalledViewWard (#109) 2023-03-30 16:35:29 +08:00
Al Liu 61356f1116
Add minmax warding (#108)
* add minmax warding
2023-03-28 00:20:01 +08:00
Al Liu f4b94c8267
Simple warding fix (#107)
* fix negated analyze
2023-03-27 19:16:48 +08:00
Al Liu ae16e8583b
impl ward condition for max view ward (#106)
* impl ward condition for max view ward
2023-03-27 18:45:50 +08:00
Daniel Sanchez 92ef9e5a77
Simulation app runners (#105)
* Integrate new runners, fit types...make it compile

* Added missing runners

* Fix rebased changes

* Make tests pass

* Clippy happy

* More clippy happy
2023-03-24 13:21:10 -07:00
Al Liu 4a90ba6926
chore: types wrapper (#104)
* chore: types wrapper
2023-03-24 19:50:30 +08:00
Al Liu ea589d018a
Simulation App: Make step cost configurable (#102)
* WIP: make step cost configurable

* fix fmt
2023-03-23 16:57:18 +08:00