Commit Graph

429 Commits

Author SHA1 Message Date
danielSanchezQ 723db30847 Clippy happy 2024-08-01 16:04:04 +02:00
danielSanchezQ 4518e23177 Refactor protocols names 2024-08-01 16:02:15 +02:00
danielSanchezQ 33aea058c4 Implement replication 2024-08-01 16:02:07 +02:00
danielSanchezQ ca9d70f747 First sketch 2024-07-31 23:12:10 +02:00
danielSanchezQ 6514682721 Rename test 2024-07-31 13:33:56 +02:00
danielSanchezQ 4e52258aa2 Improve waker on behaviour 2024-07-31 13:27:50 +02:00
danielSanchezQ 451e4628ec Cargo fmt 2024-07-31 13:22:18 +02:00
danielSanchezQ 24e1b237c5 Remove leftover features 2024-07-31 13:00:28 +02:00
danielSanchezQ 37daed9790 Clippy cleanup 2024-07-31 12:59:30 +02:00
danielSanchezQ 8563c646f3 reschedule polls 2024-07-31 12:33:08 +02:00
danielSanchezQ 1c4ca9684d Refactor test 2024-07-30 18:28:00 +02:00
danielSanchezQ 2fbd9310c9 cargo update fixed the panic 2024-07-30 14:52:26 +02:00
danielSanchezQ 9d1d6a857d Sends and receives 2024-07-30 12:17:52 +02:00
danielSanchezQ a7028c89a5 Use quic in test 2024-07-30 11:40:09 +02:00
danielSanchezQ deb9167616 Send 10 messages 2024-07-30 11:21:07 +02:00
danielSanchezQ b5ae477096 Use stream style for test 2024-07-30 09:59:26 +02:00
danielSanchezQ 8e2481d4d7 Remove unnecessary loop 2024-07-30 08:59:09 +02:00
danielSanchezQ d7b26d2723 Use tracing 2024-07-29 19:00:24 +02:00
danielSanchezQ 4be88640cb Fix reading messages state machine 2024-07-29 17:55:29 +02:00
danielSanchezQ 618ed22a48 Expand outbound lifecycle to openstream state 2024-07-29 12:37:56 +02:00
danielSanchezQ ee675e4ecf Added missing open stream request 2024-07-29 11:35:25 +02:00
danielSanchezQ dc00b67796 Fix attempt 1 - nonworking 2024-07-26 17:10:10 +02:00
Daniel Sanchez 91d3558cb2
Create basic structure of mempool network adapter for da sampling (#683)
* Create basic structure of mempool network adapter for da sampling

* Return blob instead from sample method

* fmt
2024-07-26 08:49:24 +00:00
Daniel Sanchez b9efe1f1ba
Da: network replication core (#680)
* Add core structure
Sketch first version of da network handler

* Added assgination module
Added basic assignation trait

* Added assgination module
Added basic assignation trait

* Refuse connection for non members

* Use proper protocol name

* Split in broadcast/dispersal/sampling modules
Move behaviour and handler to broadcast

* Remove unused broadcast behaviour attributes

* Add basic docs

* Remove unused pending errors on broadcast handler

* Clippy happy

* Refactor Broadcast -> Replication

* Pipe message sending

* Clippy happy

* Clippy fmt

* Refactor outgoing -> outgoing_events

* Pipe out replication

* Include subnetworks id in dispersal and replication messages

* Pipe replication messaging

* fmt

* Fix tests
2024-07-25 17:03:32 +00:00
gusto 9ff90e7d1c
DA: Network message types (#681)
* Split message definitions for broadcast, dispersal and sampling

* Expose dispersal messages via crate

* Create nomos-da-messages crate

* From trait implementations for messages

* Rename broadcast to replication
2024-07-25 12:27:55 +03:00
gusto 5c17221d16
Protoc in testnet and integration tests (#682) 2024-07-25 10:06:54 +03:00
gusto 4cd3d040f3
DA Improve indexer integration test (#679)
* Improve indexer test

* Use workspace gh api token

* Unpin rustls version for libp2p
2024-07-24 18:59:47 +03:00
gusto fcda9a6da8
DA Prost integration (#678)
* Prost crate integration for DA

* Packing and unpacking for protobuf messages

* Minimal helper macro for dispersal message

* Use protoc in gh actions

* Move dispersal related protocol to nomos-da-dispersal
2024-07-23 18:24:21 +03:00
Daniel Sanchez f58c296959
Da: verifier bench (#672)
* Use reference for DaBlob on verify

* Add verifier bench

* Fix missing reference refactor

* Clippy happy
2024-07-23 12:43:54 +00:00
Daniel Sanchez fc815069a2
Just use openssl.dev, no binaries (#677) 2024-07-23 10:32:16 +00:00
Roman Zajic 50f3078e6a
chore: Da full replication unit tests update (#675)
* test: add metadata getter test for VidCertificate

* fix: uncomment assertion for SeqCst

* fix: formatting

* test: get Metadata for Certificate
- generate signature for Certificate

* test: generate hash for Attestation

* fix: add assertion for generate hash

* fix: wrap in test module
- add helper functions

* fix: undo wrap in test module

* test: Hash implementation for Certificate with default Hasher
2024-07-22 11:33:18 +02:00
Daniel Sanchez 8bbbfcfc5f
Core services tracing spans (#673)
* Add cryptarchia tracing span

* Add debug id main span

* Add verifier spawn

* Pin rustls version

---------

Co-authored-by: Gusto <bacvinka@gmail.com>
2024-07-12 10:50:53 +02:00
Daniel Sanchez 77e65c96e4
Added const sizes to encoder bench (#671) 2024-07-03 12:55:05 +02:00
gusto c9c94c4e55
DA Http Endpoints (#670)
* Api endpoint to add blob and receive attestation

* Nomos DA Certificate serialization

* Kzgrs verification params provider

* Indexer http api using kzgrs

* Plug da http endpoints into nomos api
2024-07-03 12:37:23 +03:00
Daniel Sanchez 126b0b890b
Da: Missing parallel features (#669)
* Added missing ark parallel features

* Remove unnecessary copy

* Toeplitz3 in place

* Fix blob size in encoder bench
2024-07-01 10:54:48 +02:00
Jakub Sokołowski 05bf69823a
fix missing build settings for libp2p nodes (#668)
Otherwise we get:
```
ERROR: for libp2p-node-1  pull access denied for nomos, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
ERROR: for libp2p-node-2  pull access denied for nomos, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
ERROR: for libp2p-node-3  pull access denied for nomos, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
ERROR: for chatbot  pull access denied for nomos, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
ERROR: pull access denied for nomos, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
```
Required for:
* https://github.com/status-im/infra-misc/pull/294

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2024-06-28 11:13:48 +03:00
Roman Zajic 91854e2db6
chore: cryptarchia unit tests update (#657)
* test: getters for Branches
- derive(PartialEq) for Branch

* fix: format code

* test: Slot genesis and add

* fix: change expect message

* test: add ParentMissing error case
- derive(PartialEq) only for tests

* fix: false positive for ParentMissing

* fix: add PartialEq to derive for Branch

* fix: unwrap once only

* fix: simply create an Id

* fix: remove inappropriate meaning

* fix: simplify unwrap for branches.get()
2024-06-27 19:22:54 +02:00
Roman Zajic e48a26a8b5
chore: cryptarchia ledger unit tests update (#660)
* test: conversions for LeaderProof

* fix: formatting

* test: ser/de for Nullifier and Commitment

* test: cryptarchia ledger error cases
- LedgerError::InvalidSlot

* test: cryptarchia ledger error cases
- LedgerError::CommitmentExists

* test: add coin value check

* test: add can_spend and total_stake check

* fix: refactor error cases into more tests
2024-06-27 09:03:59 +02:00
Daniel Sanchez fdc242fa48
Da: cache toeplitz1 (#667)
* Added toeplitz1 cache to fk20

* Added toeplitz1 cache benches

* Use toeplitz cache in encoder

* Use cache in bench

* Clippy happy
2024-06-26 16:30:38 +02:00
gusto c3375b1c48
Feature flag to toggle tracing (#666) 2024-06-26 11:02:18 +03:00
Daniel Sanchez 8936c331a6
Da: parallel encoder (#665)
* Added basic parallelization to encoder

* Added encoder benchmarks
2024-06-25 15:39:40 +02:00
Daniel Sanchez 96a8ef6032
Da: fk20 encoder (#664)
* Use fft for rs

* Specify evaluation domains

* Fix domains in verifier, decoder and dispersal

* Fix domains in verifier, decoder and dispersal

* Fix size in verifier to fit tests
2024-06-25 13:16:25 +02:00
Daniel Sanchez 9adfbdddc6
Da: fk20 implementation (#663)
* Implement fft_g1

* Fix ifft_g1
Added fft/ifft g1 test

* Parallelize i/fft

* Add i/fft benches

* Fix parallel feature tagging

* Fix bench

* Fix parallelization

* Implement fk20

* Add compute roots of unity method

* Fix ranges

* Remove innecesary collect in fft_g1

* Use domaın and ark fft

* Remove custom fft

* Add fk20 benches

* Clippy happy

* Use threadcount for parallelization

---------

Co-authored-by: mgonen <mehmet@status.im>
2024-06-21 12:43:17 +02:00
gusto b4b24e4678
Rust 1.79 stable (#661)
* Rust 1.79 clippy fix

* Rust 1.79 stable in ci and docker

* Allow unused_var in nomos tests

Clippy struggle to recognize the usage of enumeration variable inside one particular testcase.
2024-06-18 10:53:56 +03:00
gusto 572d286f5f
Missing generic param to the mempool metrics (#662) 2024-06-17 16:30:07 +03:00
gusto 1dbc0c236e
Graylog service for the Testnet (#659)
* Graylog service in docker compose

* Retry graylog connection

* Graylog container configuration

* Add tokio sleep instead of std
2024-06-14 14:22:16 +03:00
Daniel Sanchez 7b9643f17e
DA Protocol V1 (#626)
* Base cleaning of da to new traits/structure
Added new da protocols and types

* DA: KZG+RS core (#632)

* Removed old kzg rs modules

* Added new kzgrs core module

* Implemented bytes_to_polynomial and tests

* Use coefficient form

* Refactor evaluations into method

* Use domain elements instead of roots of unity in tests

* Fix encoding and test

* Clippy happy

* Add comments

* Implement polynomial commitment

* Implement proof generation

* Sketch fn signature for verification

* implement proof verification

* Implemented verification and tests

* Return evaluations from bytes_to_polynomial as well

* Use modular le bytes

* Implement rs encode/decode

* Implement decoding tests

* Implement decode using lagrange

* Cleanup imports

* Da: v1 encoder (#633)

* Added new kzgrs core module

* Implemented bytes_to_polynomial and tests

* Use coefficient form

* Refactor evaluations into method

* Use domain elements instead of roots of unity in tests

* Fix encoding and test

* Clippy happy

* Add comments

* Implement polynomial commitment

* Implement proof generation

* Sketch fn signature for verification

* implement proof verification

* Implemented verification and tests

* Return evaluations from bytes_to_polynomial as well

* Use modular le bytes

* Implement rs encode/decode

* Implement decoding tests

* Implement decode using lagrange

* Added chunksmatrix

* Implement encoder with chunkify

* Added missing files

* Implement commit row commitments

* Implement compute elements (row) proofs

* Fix lib and types exposures

* Implement encoder main methods

* Implement encode method

* Implement chunkify test
Fix related bugs

* Implement compute row kzg commitments
Fix related bugs

* Implement rs encode rows test
Fix related bugs
Refactored API

* Implement row proofs tests
Fix fieldelement encoding/decoding bug

* Implement aggregated commitment test
Implement aggregated column proofs test

* Cleanup

* Fix deps

* Fix tests

* Fix chunk too big test

* Da: v1 verifier (#635)

* Fix encoding and test

* Implement commit row commitments

* Implemented dablob

* Implement verifier new
Implement verifier check column

* Clippy cleanup

* Implement verifier

* Implemented verify column test

* Implemented full verify test

* DA API Payload to Item in mempool  (#634)

* Base cleaning of da to new traits/structure
Added new da protocols and types

* DA: KZG+RS core (#632)

* Removed old kzg rs modules

* Added new kzgrs core module

* Implemented bytes_to_polynomial and tests

* Use coefficient form

* Refactor evaluations into method

* Use domain elements instead of roots of unity in tests

* Fix encoding and test

* Clippy happy

* Add comments

* Implement polynomial commitment

* Implement proof generation

* Sketch fn signature for verification

* implement proof verification

* Implemented verification and tests

* Return evaluations from bytes_to_polynomial as well

* Use modular le bytes

* Implement rs encode/decode

* Implement decoding tests

* Implement decode using lagrange

* Cleanup imports

* Reduce abstraction for certificate and vid metadata

* Allow payload to mempool as long as it converts into item

* Da Certificate verifier

* Add mock certificate for core tests

* Mempool payload verification

* Integrate mock verifiers for tx and certs

* Detach verification from cert and tx

* Seperate payload and item in mempools

* Mempools in integration tests

* Remove old cert verifier

* Network payload to item constraints in da mempool

* Update nomos-da/full-replication/src/lib.rs

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

* Sort attestations for cert signature

* Update nomos-da/full-replication/src/lib.rs

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

---------

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

* DA API Certificate verification  (#641)

* Redo certificate verification in mempool

* FullReplication verifier params provider

* Integrate da params provider into the node

* DA API Indexer service (#643)

* Base cleaning of da to new traits/structure
Added new da protocols and types

* Remove da availability crate completely

* Scaffold for da storage service

* Indexer service responsible for storage and blockchain subscription

* Handle index related ops only

* Acquire storage and consensus relays

* Indexer trait

* wip: storage adapter

* Use storage adapter instead of storage

* Add consensus adapter trait for block subscriptions

* Consensus block subscriber adapter

* Use metadata from da core in indexer

* Update nomos-services/data-availability/indexer/src/lib.rs

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

* Update nomos-services/data-availability/indexer/src/lib.rs

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

* Use std::ops::Range for da queries

* Return certificate metadata

* Da storage adapter methods

---------

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

* Reuse evaluations when computing proofs (#647)

* Reuse precomputed evaluations instead of evaluation polynomial for each proof

* kzgrs benchmarks

* Clippy happy

* DA API indexer implementation (#644)

* Rocksb adapter in da indexer

* Handle da service messages

* Remove indexer trait, use storage directly in the indexer service

* Return unordered indexes range

* Load blob by vid from file

* Use VID in consensus

* Change full replication index type to byte array

* Change payload to cert and item to vid where required

* Service integration tests for indexer

* Feature gate rocksdb backend

* Propagate range response send error

* FRIndex to Index

* VID to VidCertificate

* Pass blobs file dir via settings

* Da v1 multiple proofs bench (#648)

* Parallel proof generation bench

* Added bench comment

* Modify domain to fit exact sizes

* Fix domain in benches

* Force parallelization features in lib

* DA: Implement base structure for verifier service (#627)

* Base cleaning of da to new traits/structure
Added new da protocols and types

* Implement base structure for verifier service

* Added comments and todo!

* Cleanup imports

* Size of VidCert in full replication

* Nomos Da Verifier service crate

* Extension replaced with metadata

* Fix DaIndexer service name

* Storage adapter trait in verifier

* Manage lifecycle and messages in verifier

* Blob trait in core

* Common nomos da storage crate

* Use updated nomos da storage in indexer

* Verifier storage adapter

* Libp2p adaper for verifier

* Kzgrs backend in verifier service

* Fix fmt

* Clippy happy

---------

Co-authored-by: Gusto <bacvinka@gmail.com>

* DA Verifier service integration tests (#650)

* Base cleaning of da to new traits/structure
Added new da protocols and types

* Implement base structure for verifier service

* Added comments and todo!

* Cleanup imports

* Size of VidCert in full replication

* Nomos Da Verifier service crate

* Extension replaced with metadata

* Storage adapter trait in verifier

* Manage lifecycle and messages in verifier

* Common nomos da storage crate

* Use updated nomos da storage in indexer

* Verifier storage adapter

* Libp2p adaper for verifier

* Kzgrs backend in verifier service

* Fix fmt

* Data availability tests module

* Return attestation in service msg response

* Common definitions for da tests

* Serde for kzgrs proofs and commitments

* Da verifier integration test

* WIP nomos-core in kzgrs backend

* Kzgrs blob to common module

* Add client zone to verifier test and check if attestations are created

* Cleanup and comments

* Use libp2p only for verifier and indexer service tests

* Lint in da tests

* Simplify da blob serialization

* Remove attester from nomos-core attestation

* Verifier backend error

---------

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

* DA Kzgrs Backend Certificate implementation (#651)

* Kzgrs backend certificate definition

* Encoded data to certificate test

* Nomos da domain specific tag

* Handle errors in da certificate creation

* Add nomos core traits to da cert

* Derive ordering traits for da index

* Add failure test cases to kzgrs certificate

* Da v1 benches expand (#658)

* Update benches with more cases

* Expand benches

* Added parallel feature

* Fix test comment

Co-authored-by: Youngjoon Lee <5462944+youngjoon-lee@users.noreply.github.com>

* Remove outdated comment

---------

Co-authored-by: Gusto <bacvinka@gmail.com>
Co-authored-by: gusto <bacv@users.noreply.github.com>
Co-authored-by: Youngjoon Lee <5462944+youngjoon-lee@users.noreply.github.com>
2024-06-13 11:23:11 +03:00
gusto 7d6ae1b823
Testnet consensus configuration (#656)
* Update metrics for split mempool

* Update required packages for node in docker

* Expose env and cli params for coin

* Set coin params via env in testnet

* Predefined genesis state

* Chain start time from env vars
2024-05-30 12:46:02 +03:00
Youngjoon Lee e904793b7e
Add mdBook skeleton (#640) 2024-04-24 23:18:51 +09:00
Youngjoon Lee cddd215025
update config.yaml for cryptarchia and mixnet (#639) 2024-04-24 22:38:44 +09:00