Commit Graph

166 Commits

Author SHA1 Message Date
Youngjoon Lee f98c1c0864
remove duplicate log (#638) 2024-04-24 20:25:55 +09:00
Daniel Sanchez e085b6bef4
Split mempool into tx and da mempool (#636)
* Split mempool into tx and da mempool

* Fix tests

* Differentiate between da and cl mempool msgs in consensus

* Common mempool msg type

---------

Co-authored-by: Gusto <bacvinka@gmail.com>
2024-04-18 15:07:28 +02:00
Giacomo Pasini 7e4d00cc78
Switch from Carnot to Cryptarchia (#624)
* Switch from Carnot to Cryptarchia

* Do not delete old coins

* Update tests/src/lib.rs

Co-authored-by: davidrusu <davidrusu.me@gmail.com>

* clippy happy

---------

Co-authored-by: davidrusu <davidrusu.me@gmail.com>
2024-03-28 12:56:04 +01:00
Al Liu 16444cf32a
Fix race for nomos log service (#577) 2024-03-23 22:02:01 +08:00
gusto b341a11eb2
Metrics to nomos services (#623)
* Remove unused metrics crate from services

* Move prometheus metrics to nomos-services
2024-03-22 14:03:35 +02:00
gusto de6138fc27
Remove old http api implementation (#622) 2024-03-22 12:55:25 +02:00
Daniel Sanchez 2677199ed6
Cryptarchia block subscribe (#617)
* Pipe broadcast channel

* Add subscription to cryptarchia services message

* Clippy happy
2024-03-22 10:45:54 +01:00
Al Liu fd8ea50dd1
Use rocksdb as storage backend (#585)
* finish rocksdb storage service

* use rocksdb

* create missing cf

* Update Cargo.toml
2024-03-21 12:23:26 +01:00
Youngjoon Lee d449114044
Replace mixnet backend with mixnet addon (#615) 2024-03-19 19:15:09 +09:00
Youngjoon Lee ed81577ab5
Refactor libp2p StreamSend command more generic (#614) 2024-03-19 10:03:00 +09:00
Giacomo Pasini a933c73245
add cryptarchia leadership (#613) 2024-03-18 16:04:16 +01:00
Giacomo Pasini 1b925d9a3a
Add cryptarchia consensus service (#612)
* add cryptarchia consensus service

* fmt

* clippy happy

* review comments
2024-03-15 15:53:51 +01:00
Youngjoon Lee dbda061f04
Added `mixnet` compilation feature (#610) 2024-03-14 09:53:41 +09:00
Giacomo Pasini 50cff241fe
Refactor block (#609)
* Refactor Block/Header definition

Refactor block/header definition so that it's now responsibility
of the nomos-core crate. This removes definitions in ledger/consensus
crates since there's no need at that level to have an understanding
of the block format.

The new header format supports both carnot and cryptarchia.
2024-03-13 18:46:10 +01:00
Youngjoon Lee e7d591b7bc
Mixnet v1 (#569)
* base

* Remove mixnet client from libp2p network backend (#572)

* Mixnet v1: Remove all mixnet legacies: mixnet crate, mixnode binary, tests, and docker (#573)

* Mixnet v1: Skeleton (#570)

* Use QUIC for libp2p (#580)

* Add Poisson interval function for Mixnet (#575)

* Mixnet network backend skeleton (#586)

* Libp2p stream read/write (#587)

* Emitting packets from mixclient using libp2p stream (#588)

* Handle outputs from mixnode using libp2p stream/gossipsub (#589)

* Refactor poisson (#590)

* Mix client Poisson emission (#591)

* Mix node packet handling (#592)

* Mix Packet / Fragment logic (#593)

* Move FisherYates to `nomos-utils` (#594)

* Mixnet topology (#595)

* Mix client/node unit tests (#596)

* change multiaddr from tcp to udp with quic-v1 (#607)

---------

Co-authored-by: Al Liu <scygliu1@gmail.com>
2024-03-12 15:47:35 +09:00
Giacomo Pasini 06d225db20
Make block id generic in mempool (#605) 2024-03-11 11:07:58 +01:00
Al Liu fde0d29860
RocksDB Storage service (#584)
* finish rocksdb storage service
2024-02-29 12:32:45 +08:00
gusto 46d53479a2
Prometheus metrics service (#522)
* A wrapper crate for prometheus client

* Initial integration of metrics for mempool

* Merge mempool metrics imports

* Add cli flag to enable metrics

* Add nomos metrics service for serving metrics

* Use nomos prometheus metrics in the node

* Rename metrics to registry where applicable

* Expose metrics via http

* Featuregate the metrics service

* Style and fail on encode error

* Add metrics cargo feature for mempool
2024-01-12 16:15:12 +02:00
Daniel Sanchez c3b5dc98e4
Rename consensus service to carnot consensus (#556) 2024-01-09 11:08:24 +01:00
gusto 7077ef38fa
Limit number of committed blocks in info requests (#552)
* Limit number of committed blocks in info requests

* Make carnot info limit configurable
2024-01-05 11:21:59 +02:00
Daniel Sanchez 6287e554ae
consensus-engine to carnot-engine. (#551)
* Refactor: consensus-engine to carnot-engine.
Move under consensus/carnot-engine

* Fuzztests update with carnot-engine

* Update missing refactor in tests

---------

Co-authored-by: Gusto <bacvinka@gmail.com>
2024-01-04 15:09:43 +01:00
Giacomo Pasini 6e718e7bba
Add chat demo for testnet (#495)
* Add chat demo for testnet

This commit adds a simple demo to showcase the capabilities of the
Nomos architecture. In particular, we want to leverage the DA
features and explore participants roles.
At the same time, we're not ready to commit to any speficic format
or decision regarding common ground yet.
For this reason, we chose to implement the demo at the Execution
Zone (EZ) level.
In contrast to the coordination layer, each execution
zone can decide on its own format, which allows us to experiment
without having to set a standard.

The application of choice for the demo is an (almost) instant
messaging app where the messages are broadcast to the public by
leveraging the full replication data availability protocol.
In this context, the cli app acts as a small EZ disseminating
blobs, promoting blob inclusion and updating its state (i.e. list
of exchanged messages) upon blob inclusion in the chain.



---------

Co-authored-by: danielsanchezq <sanchez.quiros.daniel@gmail.com>
2024-01-03 15:47:21 +01:00
Youngjoon Lee 643bcef542
Reestablish conn with mixnode if err occurs (#501) 2023-11-28 18:38:48 +09:00
Daniel Sanchez cc6b6d1cc9
Refactor nomos api: (#521)
* Extracted common service into services
* Moved api implementation to nomos node crate
2023-11-10 09:28:10 +01:00
Giacomo Pasini 3e1a722bd2
Add option to not collect logs (#517)
There's currently no way for an app with a logger service to disable
log collection.
2023-11-08 15:47:07 +01:00
Giacomo Pasini ccc85904d9
do not use prefix in serialization (#514) 2023-11-07 15:24:49 +01:00
Giacomo Pasini 3028cdb5d1
Add option to provide custom writer to the logger backend (#518)
* Add option to provide custom writer to the logger backend

* fmt
2023-11-07 15:24:02 +01:00
Giacomo Pasini df683ad154
Limit GetBlocks response size (#515)
Put a hard limit of 512 blocks in the response returned by
GetBlocks to avoid slowing things down. This number was chosen
rather arbitrarily. We might want to do some more fine tuning.
2023-11-07 10:25:22 +01:00
Giacomo Pasini 56e8506704
Split long consensus response in separate APIs (#502)
* Split long consensus response in separate APIs

Consensus info was returning the full list of blocks even though
that can get quite large with time. Instead, this commit change
that API to return a constant size message and adds a new one to
return a chain of blocks with user specified endings.

* Update nomos-services/consensus/src/lib.rs

Co-authored-by: Youngjoon Lee <taxihighway@gmail.com>

* Fix test

---------

Co-authored-by: Youngjoon Lee <taxihighway@gmail.com>
2023-11-06 12:43:48 +01:00
Giacomo Pasini 350620b829
Do not skip Block::id during ser/de (#505)
Block.id is a necessary piece of information in the context
of the consensus engine since there it's not possible to recover
the id of the block since the contents are not available.
Instead, we should only skip that field when serializing/deserializing
a full block.
2023-11-03 10:14:26 +01:00
omahs e8310e3ea8
Fix typos (#503)
* fix typo

* fix typo

* fix typo

* fix typos

* fix typo
2023-11-03 09:29:40 +01:00
Al Liu ba90ed1b55
Nomos http API (#476)
* Info api

* Da blob api (#487)

* Add storage api for new http backend (#488)

* Mempool add APIs (#489)
2023-11-01 17:14:58 +08:00
Al Liu 9b3c675b3a
Metrics api (#466)
* Add metrics API
2023-10-31 17:20:04 +08:00
Giacomo Pasini e50561839d
Remove block contents from mempool (#485)
* Add Hash type param to Attestation and Certificate

* remove block contents from mempool
2023-10-30 12:38:04 +01:00
Daniel Sanchez ef243b0ee5
Add Sigkill handling to node binary (#480)
* Implement ctrlc watcher service

* Add ctrlc service to nomos node bin

* Use 1 sized buffer
2023-10-30 09:36:07 +01:00
Giacomo Pasini c84c3fb93b
Allow deprecated type in Swarm (#486)
We have to use the type of the upstream dependency
2023-10-27 17:47:53 +02:00
Al Liu 1553f29bd9
Humanize array ser/deser (#468)
* humanize array ser/deser

* split fns

* use `const-hex`

* fix fmt

* create `nomos-utils` crate

* Human serde committeeid (#478)

* Human readable serde for CommitteeId

* Deserialize bytes to string if human readable

* Don't allocate if possible in human serde bytes

---------

Co-authored-by: gusto <bacv@users.noreply.github.com>
2023-10-26 23:16:10 +08:00
Giacomo Pasini 2f9ebbd32f
Storage api (#473)
* Change impl of StorageReceiver to Option<Bytes>

Load and remove messages return Option<Bytes> and not Bytes, so
let's change the implementation to work around that.

* Add storage/block http api to retrieve blocks from storage

* add tests for storage/block api

* debug tests

* tweak test node online condition
2023-10-25 12:46:26 +02:00
Daniel Sanchez 75b36020c2
Lifecycle update and implementations (#457)
* Update deps

* Implement base lifecycle handling in network service

* Implement base lifecycle handling in storage service

* Use methods instead of functions

* Pipe lifecycle in metrics service

* Pipe lifecycle in mempool service

* Pipe lifecycle in log service

* Pipe lifecycle in da service

* Pipe lifecycle in consensus service

* Refactor handling of lifecycle message to should_stop_service

* Update overwatch version to fixed run_all one
2023-10-25 12:10:21 +02:00
Giacomo Pasini 89b8e27612
Add API to revieve DA blobs (#477)
* Use Vec instead of HashMap in DaMsg::Get

* Add http API to retrieve DA blobs
2023-10-24 15:38:33 +02:00
Giacomo Pasini 3ce8cacb30
Revert "Reestablish connection when mixclient fails (#445)" (#472)
This reverts commit aa69eeca00.
2023-10-23 16:53:20 +02:00
Al Liu aa69eeca00
Reestablish connection when mixclient fails (#445)
* Reestablish connection when mixclient fails

* Add delay and remove select
2023-10-20 14:58:58 +08:00
Giacomo Pasini f90704f1d7
Save safe blocks contents to storage (#464) 2023-10-17 11:04:47 +02:00
Giacomo Pasini 2016f75213
Add API to return DA blobs (#453)
* Add API to return DA blobs

* remove pending blobs API
2023-10-09 10:53:01 +02:00
Daniel Sanchez f04c4a6492
Use specific revision on overwatch (#455) 2023-10-09 09:18:56 +02:00
Al Liu dbac7d7597
fix clippy and check warnings (#452) 2023-10-06 15:08:52 +08:00
gusto 99d77f7e1c
Nomos node tree overlay (#415)
* Use tree overlay in nomos node

* Use tree overlay in tests module

* Handle unexpected consensus vote stream end in tally

* Spawn the next leader first (#425)

* Report unhappy blocks in happy path test (#430)

* report unhappy blocks in the happy path test

* Make threshold configurable for TreeOverlay (#426)

* Modified test, so that all nodes don’t all connect to the first node only (#442)

* merge fix

---------

Co-authored-by: Youngjoon Lee <taxihighway@gmail.com>
Co-authored-by: Al Liu <scygliu1@gmail.com>
2023-10-05 11:56:24 +03:00
Giacomo Pasini 58686b2a04
Send certificate to node after dissemination + tests (#450)
* Send DA certificate to node after dissemination

* rename mempool endpoints

* Check certificate inclusion in tests

* rename endpoint

* Rename addcert and addtx to add

* tweak test condition

* add option to save certificate to file

* move thread join

* remove fancy prints
2023-10-04 13:37:13 +02:00
Giacomo Pasini 29b963fa29
Add mempool status API (#449)
* Add status service API

* Add status API to node
2023-10-02 19:06:12 +02:00
Al Liu 4cf57eee74
remove waku from the codebase (#446) 2023-10-02 16:41:08 +08:00