chore: migrate nomos* to logos-blockchain* (#2028)

This commit is contained in:
Antonio 2026-01-20 11:45:39 +01:00 committed by GitHub
parent 0e88327ca7
commit 97b411ed0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
903 changed files with 5814 additions and 10875 deletions

View File

@ -57,7 +57,8 @@ name = "ring"
[sources]
allow-git = [
"https://github.com/EspressoSystems/jellyfish.git",
"https://github.com/logos-blockchain/logos-blockchain-testing.git",
# TODO: Re-enable this once the nomos->logos-blockchain PR is merged and the testing framework updated accordingly.
# "https://github.com/logos-blockchain/logos-blockchain-testing.git",
]
unknown-git = "deny"
unknown-registry = "deny"

14
.github/CODEOWNERS vendored
View File

@ -1,21 +1,21 @@
# Consensus
/consensus/ @youngjoon-lee @danielSanchezQ
/nomos-services/chain @youngjoon-lee @danielSanchezQ
/services/chain @youngjoon-lee @danielSanchezQ
# Mantle
/ledger/ @danielSanchezQ @youngjoon-lee @bacv
# Blend
/nomos-blend/ @youngjoon-lee @ntn-x2 @danielSanchezQ
/nomos-services/blend @youngjoon-lee @ntn-x2 @danielSanchezQ
/blend/ @youngjoon-lee @ntn-x2 @danielSanchezQ
/services/blend @youngjoon-lee @ntn-x2 @danielSanchezQ
# DA
/nomos-services/data-availability @danielSanchezQ @bacv @pradovic
/nomos-da/ @danielSanchezQ @bacv @pradovic
/da/ @danielSanchezQ @bacv @pradovic
/services/data-availability @danielSanchezQ @bacv @pradovic
# SDP
/nomos-sdp/ @bacv @pradovic @danielSanchezQ
/nomos-services/sdp @bacv @pradovic @danielSanchezQ
/sdp/ @bacv @pradovic @danielSanchezQ
/services/sdp @bacv @pradovic @danielSanchezQ
# This file
/.github/CODEOWNERS @danielSanchezQ

View File

@ -1,4 +1,4 @@
name: "Install Nomos Dependencies"
name: "Install Logos Blockchain Dependencies"
inputs:
github_token:
@ -11,7 +11,7 @@ inputs:
description: "The target triple to install dependencies for."
required: true
description: "Install dependencies for building and bundling Nomos."
description: "Install dependencies for building and bundling Logos blockchain."
runs:
using: "composite"

View File

@ -20,7 +20,7 @@ runs:
CACHE=$(curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ inputs.github-token }}" \
https://api.github.com/repos/logos-co/nomos-node/actions/caches | jq '.actions_caches[] | select(.key | startswith("${{ inputs.key-prefix }}")) | .id')
https://api.github.com/repos/logos-blockchain/logos-blockchain/actions/caches | jq '.actions_caches[] | select(.key | startswith("${{ inputs.key-prefix }}")) | .id')
echo "cache=$CACHE" >> "$GITHUB_OUTPUT"
continue-on-error: true
- name: Delete cache entry
@ -30,5 +30,5 @@ runs:
curl -X DELETE \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ inputs.github-token }}" \
https://api.github.com/repos/logos-co/nomos-node/actions/caches/${{ steps.fetch-outdated-cache.outputs.cache }}
https://api.github.com/repos/logos-blockchain/logos-blockchain/actions/caches/${{ steps.fetch-outdated-cache.outputs.cache }}
continue-on-error: true

View File

@ -1,6 +1,6 @@
name: Setup Circuits
description: Set up Circom Circuits, Rapidsnark prover and Rapidsnark verifier using the setup-nomos-circuits.sh script.
description: Set up Circom Circuits, Rapidsnark prover and Rapidsnark verifier using the setup-logos-blockchain-circuits.sh script.
inputs:
github-token:
@ -10,9 +10,9 @@ inputs:
runs:
using: "composite"
steps:
- name: Setup nomos-circuits
- name: Setup logos-blockchain-circuits
shell: bash
working-directory: ${{ github.workspace }}
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
run: "./scripts/setup-nomos-circuits.sh"
run: "./scripts/setup-logos-blockchain-circuits.sh"

View File

@ -163,13 +163,13 @@ jobs:
uses: actions-rs/cargo@9e120dd99b0fbad1c065f686657e914e76bd7b72 # Version 1.0.1
with:
command: run
args: --locked -p nomos-node nodes/nomos-node/config.yaml --check-config
args: --locked -p logos-blockchain-node nodes/node/config.yaml --check-config
- name: Run the executor binary to check the config file validity
uses: actions-rs/cargo@9e120dd99b0fbad1c065f686657e914e76bd7b72 # Version 1.0.1
with:
command: run
args: --locked -p nomos-executor nodes/nomos-executor/config.yaml --check-config
args: --locked -p logos-blockchain-executor nodes/executor/config.yaml --check-config
# This includes testing feature needed for tests
- name: Build binaries with all features
@ -183,8 +183,8 @@ jobs:
env:
POL_PROOF_DEV_MODE: true
CONSENSUS_SLOT_TIME: 5
NOMOS_NODE_BIN: ${{ github.workspace }}/target/debug/nomos-node
NOMOS_KZGRS_PARAMS_PATH: ${{ github.workspace }}/tests/kzgrs
LOGOS_BLOCKCHAIN_NODE_BIN: ${{ github.workspace }}/target/debug/logos-blockchain-node
LOGOS_BLOCKCHAIN_KZGRS_PARAMS_PATH: ${{ github.workspace }}/tests/kzgrs
with:
command: test
# We don't test benches as they take 6h+, leading to a timeout

View File

@ -11,7 +11,7 @@ jobs:
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C instrument-coverage"
LLVM_PROFILE_FILE: "nomos-node-%p-%m.profraw"
LLVM_PROFILE_FILE: "logos-blockchain-node-%p-%m.profraw"
runs-on: self-hosted
steps:
- name: Checkout repository
@ -22,14 +22,14 @@ jobs:
uses: actions-rs/cargo@9e120dd99b0fbad1c065f686657e914e76bd7b72 # Version 1.0.1
with:
command: build
args: --all-features -p nomos-node -p nomos-executor
args: --all-features -p logos-blockchain-node -p logos-blockchain-executor
- name: Run tests
uses: actions-rs/cargo@9e120dd99b0fbad1c065f686657e914e76bd7b72 # Version 1.0.1
env:
POL_PROOF_DEV_MODE: true
CONSENSUS_SLOT_TIME: 5
NOMOS_NODE_BIN: ${{ github.workspace }}/target/debug/nomos-node
NOMOS_KZGRS_PARAMS_PATH: ${{ github.workspace }}/tests/kzgrs
LOGOS_BLOCKCHAIN_NODE_BIN: ${{ github.workspace }}/target/debug/logos-blockchain-node
LOGOS_BLOCKCHAIN_KZGRS_PARAMS_PATH: ${{ github.workspace }}/tests/kzgrs
with:
command: test
args: --all --all-features
@ -49,4 +49,4 @@ jobs:
uses: codecov/codecov-action@ea99328d1c4d5f39fda7cbffe104afd6906c50b0 # Version 5.4.0
with:
directory: /tmp/coverage/
name: nomos-node-codecov
name: logos-blockchain-node-codecov

View File

@ -83,16 +83,16 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-rs/cargo@9e120dd99b0fbad1c065f686657e914e76bd7b72 # Version 1.0.1
name: Build Nomos Node
name: Build Logos blockchain node
with:
command: build
args: --package nomos-node --release --no-default-features --target ${{ matrix.platform.target_triple }}
args: --package logos-blockchain-node --release --no-default-features --target ${{ matrix.platform.target_triple }}
- uses: actions-rs/cargo@9e120dd99b0fbad1c065f686657e914e76bd7b72 # Version 1.0.1
name: Build Nomos Node Bundler
name: Build Logos blockchain node bundler
with:
command: build
args: --bin bundle-nomos-node --release --target ${{ matrix.platform.target_triple }}
args: --bin bundle-logos-blockchain-node --release --target ${{ matrix.platform.target_triple }}
- name: Bundle
shell: bash
@ -113,72 +113,72 @@ jobs:
EXTENSION=""
fi
"target/${{ matrix.platform.target_triple }}/release/bundle-nomos-node$EXTENSION" $PARAMETER
"target/${{ matrix.platform.target_triple }}/release/bundle-logos-blockchain-node$EXTENSION" $PARAMETER
- name: Flatten Linux bundles
if: matrix.platform.os == 'linux'
run: |
mv target/${{ matrix.platform.target_triple }}/release/bundle/rpm/nomos-node-${{ env.VERSION }}-1.x86_64.rpm nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.rpm
mv target/${{ matrix.platform.target_triple }}/release/bundle/deb/nomos-node_${{ env.VERSION }}_amd64.deb nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.deb
mv target/${{ matrix.platform.target_triple }}/release/bundle/appimage/nomos-node_${{ env.VERSION }}_amd64.AppImage nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.AppImage
mv target/${{ matrix.platform.target_triple }}/release/bundle/rpm/logos-blockchain-node-${{ env.VERSION }}-1.x86_64.rpm logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.rpm
mv target/${{ matrix.platform.target_triple }}/release/bundle/deb/logos-blockchain-node_${{ env.VERSION }}_amd64.deb logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.deb
mv target/${{ matrix.platform.target_triple }}/release/bundle/appimage/logos-blockchain-node_${{ env.VERSION }}_amd64.AppImage logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.AppImage
- name: Upload RPM (${{ matrix.platform.arch }})
if: matrix.platform.os == 'linux'
uses: actions/upload-artifact@6027e3dd177782cd8ab9af838c04fd81a07f1d47 # Version 4.6.2
with:
name: nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.rpm
path: nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.rpm
name: logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.rpm
path: logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.rpm
if-no-files-found: error
- name: Upload DEB (${{ matrix.platform.arch }})
if: matrix.platform.os == 'linux'
uses: actions/upload-artifact@6027e3dd177782cd8ab9af838c04fd81a07f1d47 # Version 4.6.2
with:
name: nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.deb
path: nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.deb
name: logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.deb
path: logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.deb
if-no-files-found: error
- name: Upload AppImage (${{ matrix.platform.arch }})
if: matrix.platform.os == 'linux'
uses: actions/upload-artifact@6027e3dd177782cd8ab9af838c04fd81a07f1d47 # Version 4.6.2
with:
name: nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.AppImage
path: nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.AppImage
name: logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.AppImage
path: logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.AppImage
if-no-files-found: error
- name: Flatten MacOS bundles
if: matrix.platform.os == 'macos'
run: |
mv target/${{ matrix.platform.target_triple }}/release/bundle/dmg/nomos-node_${{ env.VERSION }}_${{ matrix.platform.arch }}.dmg nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.dmg
mv target/${{ matrix.platform.target_triple }}/release/bundle/dmg/logos-blockchain-node_${{ env.VERSION }}_${{ matrix.platform.arch }}.dmg logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.dmg
- name: Upload DMG (${{ matrix.platform.arch }})
if: matrix.platform.os == 'macos'
uses: actions/upload-artifact@6027e3dd177782cd8ab9af838c04fd81a07f1d47 # Version 4.6.2
with:
name: nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.dmg
path: nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.dmg
name: logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.dmg
path: logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.dmg
if-no-files-found: error
- name: Flatten Windows bundles
if: matrix.platform.os == 'windows'
run: |
mv target/${{ matrix.platform.target_triple }}/release/bundle/msi/nomos-node_${{ env.VERSION }}_x64_en-US.msi nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.msi
mv target/${{ matrix.platform.target_triple }}/release/bundle/nsis/nomos-node_${{ env.VERSION }}_x64-setup.exe nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.exe
mv target/${{ matrix.platform.target_triple }}/release/bundle/msi/logos-blockchain-node_${{ env.VERSION }}_x64_en-US.msi logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.msi
mv target/${{ matrix.platform.target_triple }}/release/bundle/nsis/logos-blockchain-node_${{ env.VERSION }}_x64-setup.exe logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.exe
- name: Upload MSI (${{ matrix.platform.arch }})
if: matrix.platform.os == 'windows'
uses: actions/upload-artifact@6027e3dd177782cd8ab9af838c04fd81a07f1d47 # Version 4.6.2
with:
name: nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.msi
path: nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.msi
name: logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.msi
path: logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.msi
if-no-files-found: error
- name: Upload EXE (${{ matrix.platform.arch }})
if: matrix.platform.os == 'windows'
uses: actions/upload-artifact@6027e3dd177782cd8ab9af838c04fd81a07f1d47 # Version 4.6.2
with:
name: nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.exe
path: nomos_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.exe
name: logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.exe
path: logos_blockchain_node-${{ env.VERSION }}-${{ matrix.platform.arch }}.exe
if-no-files-found: error
create-release:
@ -201,9 +201,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: Nomos Node ${{ env.VERSION }}
release_name: Logos Blockchain Node ${{ env.VERSION }}
body: |
This is a release of Nomos Node ${{ env.VERSION }}.
This is a release of Logos Blockchain Node ${{ env.VERSION }}.
## Changelog
- feature(X): new feature
- fix(Y): bug description
@ -254,7 +254,7 @@ jobs:
env:
UPLOAD_URL: ${{ needs.create-release.outputs.upload_url }}
BINARY_NAME: nomos_node-${{ needs.setup.outputs.version }}-${{ matrix.platform.arch }}.${{ matrix.platform.extension }}
BINARY_NAME: logos_blockchain_node-${{ needs.setup.outputs.version }}-${{ matrix.platform.arch }}.${{ matrix.platform.extension }}
DOWNLOAD_DIRECTORY: artifacts
steps:
- name: Download Artifact

7
.gitignore vendored
View File

@ -8,7 +8,7 @@
# Files generated by build processes or applications
config.yml
db
nomos_db
logos_blockchain_db
store.*
sim_config.json
*.txt
@ -23,11 +23,8 @@ tests/.tmp*
# Wildcard for any file that contains ignore
*ignore*
# Circom Circuits' Binaries
zk/**/bin/*
# C headers
nomos-c/libnomos.h
c-bindings/lib_logos_blockchain.h
# Demo sequencer related ignores
node_modules

View File

@ -1,6 +1,6 @@
# Contributing to Nomos Node
# Contributing to Logos Blockchain Node
We're glad you're interested in contributing to Nomos Node!
We're glad you're interested in contributing to Logos Blockchain Node!
This document describes the guidelines for contributing to the project. We will be updating it as we grow and we figure
out what works best for us.

4784
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,70 +1,70 @@
[workspace.package]
categories = ["cryptography", "cryptography::cryptocurrencies", "security"]
description = "Nomos blockchain workspace crates. For more information please visit https://nomos.tech/."
description = "Logos blockchain workspace crates. For more information please visit https://logos.co/."
edition = "2024"
keywords = ["blockchain", "privacy"]
license = "MIT or Apache-2.0"
readme = "README.md"
repository = "https://github.com/logos-co/nomos"
repository = "https://github.com/logos-blockchain/logos-blockchain"
version = "0.1.0"
[workspace]
# Make sure any excluded crates are still clipped in our CI. Also, make sure they use the same Clippy and rustc lints we specify in this file down below.
members = [
"blend/core",
"blend/crypto",
"blend/message",
"blend/network",
"blend/proofs",
"blend/scheduling",
"bundler",
"c-bindings",
"cli",
"consensus/cryptarchia-engine",
"consensus/cryptarchia-sync",
"ledger/nomos-ledger",
"core",
"da/kzgrs",
"da/kzgrs-backend",
"da/network/core",
"da/network/messages",
"da/network/subnetworks-assignations",
"kms/keys",
"kms/macros",
"ledger",
"libp2p",
"mmr",
"nodes/api-common",
"nodes/nomos-executor/executor",
"nodes/nomos-executor/http-client",
"nodes/nomos-node/http-client",
"nodes/nomos-node/node",
"nomos-blend/core",
"nomos-blend/crypto",
"nomos-blend/message",
"nomos-blend/network",
"nomos-blend/proofs",
"nomos-blend/scheduling",
"nomos-bundler",
"nomos-c",
"nomos-cli",
"nomos-core/chain-defs",
"nomos-da/kzgrs",
"nomos-da/kzgrs-backend",
"nomos-da/network/core",
"nomos-da/network/messages",
"nomos-da/network/subnetworks-assignations",
"nomos-kms/keys",
"nomos-kms/macros",
"nomos-libp2p",
"nomos-services/api",
"nomos-services/blend",
"nomos-services/chain/broadcast-service",
"nomos-services/chain/chain-common",
"nomos-services/chain/chain-leader",
"nomos-services/chain/chain-network",
"nomos-services/chain/chain-service",
"nomos-services/data-availability/dispersal",
"nomos-services/data-availability/network",
"nomos-services/data-availability/sampling",
"nomos-services/data-availability/verifier",
"nomos-services/key-management-system",
"nomos-services/network",
"nomos-services/sdp",
"nomos-services/storage",
"nomos-services/system-sig",
"nomos-services/time",
"nomos-services/tracing",
"nomos-services/tx-service",
"nomos-services/utils",
"nomos-services/wallet",
"nomos-tracing",
"nomos-utils",
"nodes/executor/binary",
"nodes/executor/http-client",
"nodes/node/binary",
"nodes/node/http-client",
"services/api",
"services/blend",
"services/chain/broadcast-service",
"services/chain/chain-common",
"services/chain/chain-leader",
"services/chain/chain-network",
"services/chain/chain-service",
"services/data-availability/dispersal",
"services/data-availability/network",
"services/data-availability/sampling",
"services/data-availability/verifier",
"services/key-management-system",
"services/network",
"services/sdp",
"services/storage",
"services/system-sig",
"services/time",
"services/tracing",
"services/tx-service",
"services/utils",
"services/wallet",
"testnet/cfgsync",
"testnet/l2-sequencer-archival-demo/archiver",
"testnet/l2-sequencer-archival-demo/sequencer",
"tests",
"tracing",
"utils",
"utxotree",
"wallet",
"wallet-http-client",
@ -83,73 +83,72 @@ resolver = "2"
[workspace.dependencies]
# Internal
archiver = { default-features = false, path = "./testnet/l2-sequencer-archival-demo/archiver" }
broadcast-service = { default-features = false, path = "./nomos-services/chain/broadcast-service" }
bundler = { default-features = false, path = "./nomos-bundler" }
cfgsync = { default-features = false, path = "./testnet/cfgsync" }
chain-common = { default-features = false, path = "./nomos-services/chain/chain-common" }
chain-leader = { default-features = false, path = "./nomos-services/chain/chain-leader" }
chain-network = { default-features = false, path = "./nomos-services/chain/chain-network" }
chain-service = { default-features = false, path = "./nomos-services/chain/chain-service" }
circuits-prover = { default-features = false, path = "./zk/circuits/prover" }
circuits-utils = { default-features = false, path = "./zk/circuits/utils" }
circuits-verifier = { default-features = false, path = "./zk/circuits/verifier" }
common-http-client = { default-features = false, path = "./nodes/nomos-node/http-client" }
cryptarchia-engine = { default-features = false, path = "./consensus/cryptarchia-engine" }
cryptarchia-sync = { default-features = false, path = "./consensus/cryptarchia-sync" }
demo-sequencer = { default-features = false, path = "./testnet/l2-sequencer-archival-demo/sequencer" }
executor-http-client = { default-features = false, path = "./nodes/nomos-executor/http-client" }
groth16 = { default-features = false, path = "./zk/groth16" }
key-management-system-keys = { default-features = false, path = "./nomos-kms/keys" }
key-management-system-macros = { default-features = false, path = "./nomos-kms/macros" }
key-management-system-service = { default-features = false, path = "./nomos-services/key-management-system" }
kzgrs = { default-features = false, path = "./nomos-da/kzgrs" }
kzgrs-backend = { default-features = false, path = "./nomos-da/kzgrs-backend" }
mmr = { default-features = false, path = "./mmr" }
nomos-api = { default-features = false, path = "./nomos-services/api" }
nomos-blend = { default-features = false, path = "./nomos-blend/core" }
nomos-blend-crypto = { default-features = false, path = "./nomos-blend/crypto" }
nomos-blend-message = { default-features = false, path = "./nomos-blend/message" }
nomos-blend-network = { default-features = false, path = "./nomos-blend/network" }
nomos-blend-proofs = { default-features = false, path = "./nomos-blend/proofs" }
nomos-blend-scheduling = { default-features = false, path = "./nomos-blend/scheduling" }
nomos-blend-service = { default-features = false, path = "./nomos-services/blend" }
nomos-cli = { default-features = false, path = "./nomos-cli" }
nomos-core = { default-features = false, path = "./nomos-core/chain-defs" }
nomos-da-dispersal = { default-features = false, path = "./nomos-services/data-availability/dispersal" }
nomos-da-messages = { default-features = false, path = "./nomos-da/network/messages" }
nomos-da-network-core = { default-features = false, path = "./nomos-da/network/core" }
nomos-da-network-service = { default-features = false, path = "./nomos-services/data-availability/network" }
nomos-da-sampling = { default-features = false, path = "./nomos-services/data-availability/sampling" }
nomos-da-verifier = { default-features = false, path = "./nomos-services/data-availability/verifier" }
nomos-executor = { default-features = false, path = "./nodes/nomos-executor/executor" }
nomos-http-api-common = { default-features = false, path = "./nodes/api-common" }
nomos-ledger = { default-features = false, path = "./ledger/nomos-ledger" }
nomos-libp2p = { default-features = false, path = "./nomos-libp2p" }
nomos-mantle-core = { default-features = false, path = "./nomos-mantle" }
nomos-network = { default-features = false, path = "./nomos-services/network" }
nomos-node = { default-features = false, path = "./nodes/nomos-node/node" }
nomos-sdp = { default-features = false, path = "./nomos-services/sdp" }
nomos-storage = { default-features = false, path = "./nomos-services/storage" }
nomos-system-sig = { default-features = false, path = "./nomos-services/system-sig" }
nomos-time = { default-features = false, path = "./nomos-services/time" }
nomos-tracing = { default-features = false, path = "./nomos-tracing" }
nomos-tracing-service = { default-features = false, path = "./nomos-services/tracing" }
nomos-utils = { default-features = false, path = "./nomos-utils" }
nomos-wallet = { default-features = false, path = "./nomos-services/wallet" }
poc = { default-features = false, path = "./zk/proofs/poc" }
pol = { default-features = false, path = "./zk/proofs/pol" }
poq = { default-features = false, path = "zk/proofs/poq" }
poseidon2 = { default-features = false, path = "./zk/poseidon2" }
services-utils = { default-features = false, path = "./nomos-services/utils" }
subnetworks-assignations = { default-features = false, path = "./nomos-da/network/subnetworks-assignations" }
tests = { default-features = false, path = "./tests" }
tx-service = { default-features = false, path = "./nomos-services/tx-service" }
utxotree = { default-features = false, path = "./utxotree" }
wallet = { default-features = false, path = "./wallet" }
wallet-http-client = { default-features = false, path = "./wallet-http-client" }
witness-generator = { default-features = false, path = "zk/circuits/witness-generator" }
zksign = { default-features = false, path = "./zk/proofs/zksign" }
lb-api-service = { default-features = false, path = "./services/api", package = "logos-blockchain-api-service" }
lb-blend = { default-features = false, path = "./blend/core", package = "logos-blockchain-blend" }
lb-blend-crypto = { default-features = false, path = "./blend/crypto", package = "logos-blockchain-blend-crypto" }
lb-blend-message = { default-features = false, path = "./blend/message", package = "logos-blockchain-blend-message" }
lb-blend-network = { default-features = false, path = "./blend/network", package = "logos-blockchain-blend-network" }
lb-blend-proofs = { default-features = false, path = "./blend/proofs", package = "logos-blockchain-blend-proofs" }
lb-blend-scheduling = { default-features = false, path = "./blend/scheduling", package = "logos-blockchain-blend-scheduling" }
lb-blend-service = { default-features = false, path = "./services/blend", package = "logos-blockchain-blend-service" }
lb-bundler = { default-features = false, path = "./bundler", package = "logos-blockchain-bundler" }
lb-cfgsync = { default-features = false, path = "./testnet/cfgsync", package = "logos-blockchain-cfgsync" }
lb-chain-broadcast-service = { default-features = false, path = "./services/chain/broadcast-service", package = "logos-blockchain-chain-broadcast-service" }
lb-chain-leader-service = { default-features = false, path = "./services/chain/chain-leader", package = "logos-blockchain-chain-leader-service" }
lb-chain-network-service = { default-features = false, path = "./services/chain/chain-network", package = "logos-blockchain-chain-network-service" }
lb-chain-service = { default-features = false, path = "./services/chain/chain-service", package = "logos-blockchain-chain-service" }
lb-chain-service-common = { default-features = false, path = "./services/chain/chain-common", package = "logos-blockchain-chain-service-common" }
lb-circuits-prover = { default-features = false, path = "./zk/circuits/prover", package = "logos-blockchain-circuits-prover" }
lb-circuits-utils = { default-features = false, path = "./zk/circuits/utils", package = "logos-blockchain-circuits-utils" }
lb-circuits-verifier = { default-features = false, path = "./zk/circuits/verifier", package = "logos-blockchain-circuits-verifier" }
lb-cli = { default-features = false, path = "./cli", package = "logos-blockchain-cli" }
lb-common-http-client = { default-features = false, path = "./nodes/node/http-client", package = "logos-blockchain-common-http-client" }
lb-core = { default-features = false, path = "./core", package = "logos-blockchain-core" }
lb-cryptarchia-engine = { default-features = false, path = "./consensus/cryptarchia-engine", package = "logos-blockchain-cryptarchia-engine" }
lb-cryptarchia-sync = { default-features = false, path = "./consensus/cryptarchia-sync", package = "logos-blockchain-cryptarchia-sync" }
lb-da-dispersal-service = { default-features = false, path = "./services/data-availability/dispersal", package = "logos-blockchain-da-dispersal-service" }
lb-da-messages = { default-features = false, path = "./da/network/messages", package = "logos-blockchain-da-messages" }
lb-da-network-core = { default-features = false, path = "./da/network/core", package = "logos-blockchain-da-network-core" }
lb-da-network-service = { default-features = false, path = "./services/data-availability/network", package = "logos-blockchain-da-network-service" }
lb-da-sampling-service = { default-features = false, path = "./services/data-availability/sampling", package = "logos-blockchain-da-sampling-service" }
lb-da-verifier-service = { default-features = false, path = "./services/data-availability/verifier", package = "logos-blockchain-da-verifier-service" }
lb-demo-archiver = { default-features = false, path = "./testnet/l2-sequencer-archival-demo/archiver", package = "logos-blockchain-demo-archiver" }
lb-demo-sequencer = { default-features = false, path = "./testnet/l2-sequencer-archival-demo/sequencer", package = "logos-blockchain-demo-sequencer" }
lb-executor = { default-features = false, path = "./nodes/executor/binary", package = "logos-blockchain-executor" }
lb-executor-http-client = { default-features = false, path = "./nodes/executor/http-client", package = "logos-blockchain-executor-http-client" }
lb-groth16 = { default-features = false, path = "./zk/groth16", package = "logos-blockchain-groth16" }
lb-http-api-common = { default-features = false, path = "./nodes/api-common", package = "logos-blockchain-http-api-common" }
lb-key-management-system-keys = { default-features = false, path = "./kms/keys", package = "logos-blockchain-key-management-system-keys" }
lb-key-management-system-macros = { default-features = false, path = "./kms/macros", package = "logos-blockchain-key-management-system-macros" }
lb-key-management-system-service = { default-features = false, path = "./services/key-management-system", package = "logos-blockchain-key-management-system-service" }
lb-kzgrs = { default-features = false, path = "./da/kzgrs", package = "logos-blockchain-kzgrs" }
lb-kzgrs-backend = { default-features = false, path = "./da/kzgrs-backend", package = "logos-blockchain-kzgrs-backend" }
lb-ledger = { default-features = false, path = "./ledger", package = "logos-blockchain-ledger" }
lb-libp2p = { default-features = false, path = "./libp2p", package = "logos-blockchain-libp2p" }
lb-mmr = { default-features = false, path = "./mmr", package = "logos-blockchain-mmr" }
lb-network-service = { default-features = false, path = "./services/network", package = "logos-blockchain-network-service" }
lb-node = { default-features = false, path = "./nodes/node/binary", package = "logos-blockchain-node" }
lb-poc = { default-features = false, path = "./zk/proofs/poc", package = "logos-blockchain-poc" }
lb-pol = { default-features = false, path = "./zk/proofs/pol", package = "logos-blockchain-pol" }
lb-poq = { default-features = false, path = "./zk/proofs/poq", package = "logos-blockchain-poq" }
lb-poseidon2 = { default-features = false, path = "./zk/poseidon2", package = "logos-blockchain-poseidon2" }
lb-sdp-service = { default-features = false, path = "./services/sdp", package = "logos-blockchain-sdp-service" }
lb-services-utils = { default-features = false, path = "./services/utils", package = "logos-blockchain-services-utils" }
lb-storage-service = { default-features = false, path = "./services/storage", package = "logos-blockchain-storage-service" }
lb-subnetworks-assignations = { default-features = false, path = "./da/network/subnetworks-assignations", package = "logos-blockchain-subnetworks-assignations" }
lb-system-sig-service = { default-features = false, path = "./services/system-sig", package = "logos-blockchain-system-sig-service" }
lb-tests = { default-features = false, path = "./tests", package = "logos-blockchain-tests" }
lb-time-service = { default-features = false, path = "./services/time", package = "logos-blockchain-time-service" }
lb-tracing = { default-features = false, path = "./tracing", package = "logos-blockchain-tracing" }
lb-tracing-service = { default-features = false, path = "./services/tracing", package = "logos-blockchain-tracing-service" }
lb-tx-service = { default-features = false, path = "./services/tx-service", package = "logos-blockchain-tx-service" }
lb-utils = { default-features = false, path = "./utils", package = "logos-blockchain-utils" }
lb-utxotree = { default-features = false, path = "./utxotree", package = "logos-blockchain-utxotree" }
lb-wallet = { default-features = false, path = "./wallet", package = "logos-blockchain-wallet" }
lb-wallet-http-client = { default-features = false, path = "./wallet-http-client", package = "logos-blockchain-wallet-http-client" }
lb-wallet-service = { default-features = false, path = "./services/wallet", package = "logos-blockchain-wallet-service" }
lb-witness-generator = { default-features = false, path = "./zk/circuits/witness-generator", package = "logos-blockchain-witness-generator" }
lb-zksign = { default-features = false, path = "./zk/proofs/zksign", package = "logos-blockchain-zksign" }
# External
blake2 = { default-features = false, version = "0.10" }

View File

@ -13,22 +13,22 @@ FROM rust:1.92.0-slim-bookworm AS builder
ARG VERSION
LABEL maintainer="augustinas@status.im" \
source="https://github.com/logos-co/nomos-node" \
description="Nomos node build image"
source="https://github.com/logos-blockchain/logos-blockchain" \
description="Logos blockchain node build image"
WORKDIR /nomos
WORKDIR /logos-blockchain
COPY . .
# Install dependencies needed for building RocksDB.
RUN apt-get update && apt-get install -yq \
git gcc g++ clang libssl-dev pkg-config ca-certificates curl
RUN chmod +x scripts/setup-nomos-circuits.sh && \
scripts/setup-nomos-circuits.sh "$VERSION" "/opt/circuits"
RUN chmod +x scripts/setup-logos-blockchain-circuits.sh && \
scripts/setup-logos-blockchain-circuits.sh "$VERSION" "/opt/circuits"
ENV NOMOS_CIRCUITS=/opt/circuits
ENV LOGOS_BLOCKCHAIN_CIRCUITS=/opt/circuits
RUN cargo build --locked --release -p nomos-node
RUN cargo build --locked --release -p logos-blockchain-node
# ===========================
# NODE IMAGE
@ -39,8 +39,8 @@ FROM debian:bookworm-slim
ARG VERSION
LABEL maintainer="augustinas@status.im" \
source="https://github.com/logos-co/nomos-node" \
description="Nomos node image"
source="https://github.com/logos-blockchain/logos-blockchain" \
description="Logos blockchain node image"
RUN apt-get update && apt-get install -yq \
libstdc++6 \
@ -49,10 +49,10 @@ RUN apt-get update && apt-get install -yq \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /opt/circuits /opt/circuits
COPY --from=builder /nomos/target/release/nomos-node /usr/local/bin/nomos-node
COPY --from=builder /logos-blockchain/target/release/logos-blockchain-node /usr/local/bin/logos-blockchain-node
ENV NOMOS_CIRCUITS=/opt/circuits
ENV LOGOS_BLOCKCHAIN_CIRCUITS=/opt/circuits
EXPOSE 3000 8080 9000 60000
ENTRYPOINT ["nomos-node"]
ENTRYPOINT ["logos-blockchain-node"]

108
README.md
View File

@ -1,10 +1,9 @@
# Nomos
# Logos Blockchain
Nomos is the blockchain layer of the Logos technology stack, providing a privacy-preserving and censorship-resistant
framework for decentralized network states.
Logos blockchain is a component of the Logos technology stack, providing a privacy-preserving and censorship-resistant framework for decentralized network states.
This monorepo serves as a unified codebase for the Nomos ecosystem, housing all core components, services, and tools
necessary for running and interacting with the Nomos blockchain. Key features include:
This monorepo serves as a unified codebase for the Logos blockchain ecosystem, housing all core components, services, and tools
necessary for running and interacting with the Logos blockchain. Key features include:
- Consensus mechanisms for secure and scalable network agreement
- Ledger management for state persistence and validation
@ -16,7 +15,7 @@ necessary for running and interacting with the Nomos blockchain. Key features in
## Table of Contents
- [Nomos](#nomos)
- [Logos blockchain](#logos-blockchain)
- [Table of Contents](#table-of-contents)
- [Requirements](#requirements)
- [Setting Up Zero-Knowledge Circuits](#setting-up-zero-knowledge-circuits)
@ -39,7 +38,7 @@ necessary for running and interacting with the Nomos blockchain. Key features in
- [Command line](#command-line)
- [Setting `chain_start_time` timestamp](#setting-chain_start_time-timestamp)
- [Manually set chain start time in config](#manually-set-chain-start-time-in-config)
- [Running a Nomos Node](#running-a-nomos-node)
- [Running a Logos blockchain Node](#running-a-logos-blockchain-node)
- [Docker](#docker-1)
- [Running Logos Blockchain Node locally](#running-logos-blockchain-node-locally)
- [Running Logos Blockchain Node with integration test](#running-logos-blockchain-node-with-integration-test)
@ -62,23 +61,23 @@ necessary for running and interacting with the Nomos blockchain. Key features in
## Setting Up Zero-Knowledge Circuits
Nomos uses zero-knowledge circuits for various cryptographic operations. To set up the required circuit binaries and keys:
Logos blockchain uses zero-knowledge circuits for various cryptographic operations. To set up the required circuit binaries and keys:
### Quick Setup (Recommended)
Run the setup script to download and install the latest nomos-circuits release, which will install circuits to
`~/.nomos-circuits/` (`Linux`) or `$env:USERPROFILE\.nomos-circuits` (`Windows`) by default.:
Run the setup script to download and install the latest logos-blockchain-circuits release, which will install circuits to
`~/.logos-blockchain-circuits/` (`Linux`) or `$env:USERPROFILE\.logos-blockchain-circuits` (`Windows`) by default.:
#### Linux
```bash
./scripts/setup-nomos-circuits.sh
./scripts/setup-logos-blockchain-circuits.sh
```
#### Windows
```powershell
.\scripts\setup-nomos-circuits.ps1
.\scripts\setup-logos-blockchain-circuits.ps1
```
Also make sure that Visual Studio build tools with LLVM (or other LLVM with clang) are installed with the
@ -93,32 +92,32 @@ You can specify a custom version or installation directory:
```bash
# Install a specific version
./scripts/setup-nomos-circuits.sh v0.3.0
./scripts/setup-logos-blockchain-circuits.sh v0.3.0
# Install to a custom directory
./scripts/setup-nomos-circuits.sh v0.2.0 /opt/circuits
./scripts/setup-logos-blockchain-circuits.sh v0.2.0 /opt/circuits
```
If you use a custom directory, you'll need to set the `NOMOS_CIRCUITS` environment variable:
If you use a custom directory, you'll need to set the `LOGOS_BLOCKCHAIN_CIRCUITS` environment variable:
```bash
export NOMOS_CIRCUITS=/opt/circuits
export LOGOS_BLOCKCHAIN_CIRCUITS=/opt/circuits
```
#### Windows
```powershell
# Install a specific version
.\scripts\setup-nomos-circuits.ps1 v0.3.0
.\scripts\setup-logos-blockchain-circuits.ps1 v0.3.0
# Install to a custom directory
.\scripts\setup-nomos-circuits.ps1 v0.2.0 $env:USERPROFILE\circuits
.\scripts\setup-logos-blockchain-circuits.ps1 v0.2.0 $env:USERPROFILE\circuits
```
If you use a custom directory, you'll need to set the `NOMOS_CIRCUITS` environment variable:
If you use a custom directory, you'll need to set the `LOGOS_BLOCKCHAIN_CIRCUITS` environment variable:
```powershell
$env:NOMOS_CIRCUITS="$env:USERPROFILE\circuits"
$env:LOGOS_BLOCKCHAIN_CIRCUITS="$env:USERPROFILE\circuits"
```
### macOS Users
@ -139,7 +138,7 @@ cargo test -p circuits-prover -p circuits-verifier --lib
### Service Architecture
Nomos services follow a consistent design pattern: a front layer handles the `Overwatch` service, while a back layer
Logos blockchain services follow a consistent design pattern: a front layer handles the `Overwatch` service, while a back layer
implements the actual service logic.
This modular approach allows for easy replacement of components in a declarative manner.
@ -159,40 +158,13 @@ struct MockPoolNode {
### Static Dispatching
Nomos favours static dispatching over dynamic, influenced by Overwatch.
Logos blockchain favours static dispatching over dynamic, influenced by Overwatch.
This means you'll encounter Generics sprinkled throughout the codebase.
While it might occasionally feel a bit over the top, it brings some solid advantages, such as:
- Compile-time type checking
- Highly modular and adaptable applications
## Project Structure
```
nomos/
├── book/ # Documentation in Markdown format
├── ci/ # Non-GitHub scripts, such as Jenkins' nightly integration and fuzzy testing
├── clients/ # General-purpose clients
├── consensus/ # Engine and protocols for agreement and validation
├── ledger/ # Ledger management and state transition logic
├── nodes/ # Node implementations
├── nomos-blend/ # Blend Network, our privacy routing protocol
├── nomos-bundler/ # Crate packaging and bundling
├── nomos-cli/ # Command-line interface for interacting with the Nomos blockchain
├── nomos-core/ # Collection of essential structures
├── nomos-da/ # Data availability layer
├── nomos-libp2p/ # Libp2p integration
├── nomos-services/ # Building blocks for the Node
├── nomos-tracing/ # Tracing, logging, and metrics
├── nomos-utils/ # Shared utility functions and helpers
├── scripts/ # Utility scripts including circuit setup
├── testnet/ # Testnet configurations, monitoring, and deployment scripts
├── tests/ # Integration and E2E test suites
└── zk/ # Zero-knowledge proof infrastructure
├── circuits/ # ZK circuit utilities (prover, verifier, witness generators)
└── proofs/ # Proof implementations (pol, poq, poc, zksign)
```
## Development Workflow
### Feature exclusions
@ -203,15 +175,15 @@ Currently the `"profiling"` feature is not supported in Windows builds.
#### Docker
To build the Nomos Docker image, run:
To build the Logos blockchain Docker image, run:
```bash
docker build -t nomos .
docker build -t logos-blockchain .
```
#### Command line
To build the Nomos command line executable, run:
To build the Logos blockchain command line executable, run:
```bash
cargo build --release
@ -230,7 +202,7 @@ a few minutes of your current system time) before launching the node, **or use a
with the chain start time set to the current time:
```bash
CONSENSUS_SLOT_TIME=5 POL_PROOF_DEV_MODE=true nomos-node nodes/nomos-node/config-one-node.yaml --dev-mode-reset-chain-clock
CONSENSUS_SLOT_TIME=5 POL_PROOF_DEV_MODE=true logos-blockchain-node nodes/node/config-one-node.yaml --dev-mode-reset-chain-clock
```
#### Manually set chain start time in config
@ -242,7 +214,7 @@ Bash
date -u +"%Y-%m-%d %H:%M:%S.000000 +00:00:00"
```
Open nodes/nomos-node/config-one-node.yaml and locate the time section. Replace the chain_start_time value with the
Open nodes/node/config-one-node.yaml and locate the time section. Replace the `chain_start_time` value with the
output from the command above:
YAML
@ -256,26 +228,26 @@ time:
Once updated, restart the node.
### Running a Nomos Node
### Running a Logos Blockchain Node
#### Docker
To run a docker container with the Nomos node you need to mount both `config.yml` and `global_params_path` specified in
To run a docker container with the Logos blockchain node you need to mount both `config.yml` and `global_params_path` specified in
the configuration.
```bash
docker run -v "/path/to/config.yml" -v "/path/to/global_params:global/params/path" nomos /etc/nomos/config.yml
docker run -v "/path/to/config.yml" -v "/path/to/global_params:global/params/path" logos-blockchain /etc/logos-blockchain/config.yml
```
To use an example configuration located at `nodes/nomos-node/config.yaml`, first run the test that generates the random
To use an example configuration located at `nodes/node/config.yaml`, first run the test that generates the random
kzgrs file and then run the docker container with the appropriate config and global params:
```bash
cargo test --package kzgrs-backend write_random_kzgrs_params_to_file -- --ignored
docker run -v "$(pwd)/nodes/nomos-node/config.yaml:/etc/nomos/config.yml" \
-v "$(pwd)/nomos-da/kzgrs-backend/kzgrs_test_params:/app/tests/kzgrs/kzgrs_test_params" \
nomos /etc/nomos/config.yml
docker run -v "$(pwd)/nodes/node/config.yaml:/etc/logos-blockchain/config.yml" \
-v "$(pwd)/logos-blockchain-da/kzgrs-backend/kzgrs_test_params:/app/tests/kzgrs/kzgrs_test_params" \
logos-blockchain /etc/logos-blockchain/config.yml
```
@ -287,7 +259,7 @@ When the node is built locally, it can be run with example config for one node n
cargo build --all-features --all-targets
# Run node without connecting to any other node.
CONSENSUS_SLOT_TIME=5 POL_PROOF_DEV_MODE=true target/debug/nomos-node nodes/nomos-node/config-one-node.yaml
CONSENSUS_SLOT_TIME=5 POL_PROOF_DEV_MODE=true target/debug/logos-blockchain-node nodes/node/config-one-node.yaml
```
Node stores its state inside the `db` directory. If there are any issues when restarting the node, please try removing
@ -295,7 +267,7 @@ Node stores its state inside the `db` directory. If there are any issues when re
**Notes**
- To use an example configuration located at `nodes/nomos-node/config.yaml`, first run the test that generates the
- To use an example configuration located at `nodes/node/config.yaml`, first run the test that generates the
random kzgrs file (`kzgrs_test_params`), leave it in `./tests/kzgrs/kzgrs_test_params` or place it in a convenient
location:
@ -303,17 +275,17 @@ location:
cargo test --package kzgrs-backend write_random_kzgrs_params_to_file -- --ignored
```
- To run the Nomos node directly from the command line, edit the `global_params_path:` key in `/path/to/config.yaml` to
- To run the Logos blockchain node directly from the command line, edit the `global_params_path:` key in `/path/to/config.yaml` to
point to the kzgrs file (`kzgrs_test_params`) and run with:
```bash
cargo run --package nomos-node -- /path/to/config.yaml
cargo run --package logos-blockchain-node -- /path/to/config.yaml
```
or copy the executable and run the binary directly:
```bash
./nomos-node /path/to/config.yaml
./logos-blockchain-node /path/to/config.yaml
```
@ -407,7 +379,7 @@ See [LICENSE-APACHE2.0](LICENSE-APACHE2.0) and [LICENSE-MIT](LICENSE-MIT) for de
## Community
Join the Nomos community on [Discord](https://discord.gg/8Q7Q7vz) and follow us
Join the Logos community on [Discord](https://discord.gg/dUnm7CcB) and follow us
on [Twitter](https://twitter.com/nomos_tech).
For more information, visit [nomos.tech](https://nomos.tech/?utm_source=chatgpt.com).
For more information, visit [logos.co](https://logos.co/?utm_source=chatgpt.com).

28
blend/core/Cargo.toml Normal file
View File

@ -0,0 +1,28 @@
[package]
categories = { workspace = true }
description = { workspace = true }
edition = { workspace = true }
keywords = { workspace = true }
license = { workspace = true }
name = "logos-blockchain-blend"
readme = { workspace = true }
repository = { workspace = true }
version = { workspace = true }
[lints]
workspace = true
[dependencies]
lb-blend-crypto = { workspace = true }
lb-blend-message = { workspace = true }
lb-blend-network = { workspace = true }
lb-blend-proofs = { workspace = true }
lb-blend-scheduling = { workspace = true }
[features]
unsafe-test-functions = [
"lb-blend-message/unsafe-test-functions",
"lb-blend-network/unsafe-test-functions",
"lb-blend-proofs/unsafe-test-functions",
"lb-blend-scheduling/unsafe-test-functions",
]

5
blend/core/src/lib.rs Normal file
View File

@ -0,0 +1,5 @@
pub use lb_blend_crypto as crypto;
pub use lb_blend_message as message;
pub use lb_blend_network as network;
pub use lb_blend_proofs as proofs;
pub use lb_blend_scheduling as scheduling;

View File

@ -4,7 +4,7 @@ description = { workspace = true }
edition = { workspace = true }
keywords = { workspace = true }
license = { workspace = true }
name = "nomos-blend-crypto"
name = "logos-blockchain-blend-crypto"
readme = { workspace = true }
repository = { workspace = true }
version = { workspace = true }
@ -14,10 +14,10 @@ workspace = true
[dependencies]
blake2 = { workspace = true }
groth16 = { workspace = true }
nomos-utils = { features = ["rng"], workspace = true }
poq = { workspace = true }
poseidon2 = { workspace = true }
lb-groth16 = { workspace = true }
lb-poq = { workspace = true }
lb-poseidon2 = { workspace = true }
lb-utils = { features = ["rng"], workspace = true }
rs-merkle-tree = { default-features = false, version = "0.1", features = ["memory_store"] }
thiserror = "1"

View File

@ -1,4 +1,4 @@
use nomos_utils::blake_rng::{BlakeRng, RngCore as _, SeedableRng as _};
use lb_utils::blake_rng::{BlakeRng, RngCore as _, SeedableRng as _};
use crate::blake2b512;

View File

@ -1,11 +1,11 @@
use blake2::{Blake2b512, digest::Digest as _};
use nomos_utils::blake_rng::{BlakeRng, RngCore as _, SeedableRng as _};
use lb_utils::blake_rng::{BlakeRng, RngCore as _, SeedableRng as _};
pub mod cipher;
pub mod merkle;
pub type ZkHash = groth16::Fr;
pub type ZkHasher = poseidon2::Poseidon2Bn254Hasher;
pub type ZkHash = lb_groth16::Fr;
pub type ZkHasher = lb_poseidon2::Poseidon2Bn254Hasher;
/// Generates random bytes of the constant size using [`BlakeRng`].
#[must_use]

View File

@ -1,8 +1,8 @@
use core::fmt::{self, Debug, Formatter};
use std::collections::HashMap;
use groth16::{fr_from_bytes_unchecked, fr_to_bytes};
use poq::{CORE_MERKLE_TREE_HEIGHT, CorePathAndSelectors};
use lb_groth16::{fr_from_bytes_unchecked, fr_to_bytes};
use lb_poq::{CORE_MERKLE_TREE_HEIGHT, CorePathAndSelectors};
use rs_merkle_tree::{Node, stores::MemoryStore, tree::MerkleProof};
use thiserror::Error;
@ -47,7 +47,7 @@ impl rs_merkle_tree::hasher::Hasher for InnerTreeZkHasher {
///
/// It is a fixed-height tree, with the height expected by the [`PoQ` specification](https://www.notion.so/nomos-tech/Proof-of-Quota-Specification-215261aa09df81d88118ee22205cbafe?source=copy_link#215261aa09df81ec850ad7965bf6e76b).
/// It is a wrapped around an instance of an [`rs_merkle_tree`], configured with
/// our [`nomos_core::crypto::ZkHasher`] and additional information to make it
/// our [`lb_core::crypto::ZkHasher`] and additional information to make it
/// suitable for `PoQ` usage.
pub struct MerkleTree {
/// A map of key -> index after the input keys have been sorted, for proof
@ -227,7 +227,7 @@ pub fn sort_nodes_and_build_merkle_tree<Node>(
mod tests {
use core::iter::repeat_n;
use groth16::{Field as _, fr_from_bytes_unchecked};
use lb_groth16::{Field as _, fr_from_bytes_unchecked};
use num_bigint::BigUint;
use crate::{

36
blend/message/Cargo.toml Normal file
View File

@ -0,0 +1,36 @@
[package]
categories = { workspace = true }
description = { workspace = true }
edition = { workspace = true }
keywords = { workspace = true }
license = { workspace = true }
name = "logos-blockchain-blend-message"
readme = { workspace = true }
repository = { workspace = true }
version = { workspace = true }
[lints]
workspace = true
[dependencies]
blake2 = { workspace = true }
derivative = { default-features = false, version = "2" }
itertools = { default-features = false, version = "0.14" }
lb-blend-crypto = { workspace = true }
lb-blend-proofs = { workspace = true }
lb-core = { workspace = true }
lb-groth16 = { workspace = true }
lb-key-management-system-keys = { workspace = true }
lb-utils = { features = ["rng"], workspace = true }
serde = { workspace = true }
serde-big-array = { workspace = true }
serde_with = { default-features = false, features = ["alloc"], version = "3" }
thiserror = { default-features = false, version = "1.0.69" }
tracing = { workspace = true }
zeroize = { workspace = true }
[dev-dependencies]
test-log = { default-features = false, features = ["trace"], version = "0.2" }
[features]
unsafe-test-functions = []

View File

@ -1,12 +1,12 @@
use key_management_system_keys::{
use lb_blend_crypto::cipher::Cipher;
use lb_key_management_system_keys::{
keys::UnsecuredEd25519Key, operators::ed25519::derive_x25519::SharedKey,
};
use nomos_blend_crypto::cipher::Cipher;
use nomos_utils::blake_rng::{BlakeRng, SeedableRng as _};
use lb_utils::blake_rng::{BlakeRng, SeedableRng as _};
use zeroize::ZeroizeOnDrop;
// This extension trait must go here instead of `nomos-blend-crypto` because
// else we would have a circular dependency between that and
// This extension trait must go here instead of `logos-blockchain-blend-crypto`
// because else we would have a circular dependency between that and
// `key-management-system-keys`. Also, these extension functions are mostly used
// in this crate, so it makes most sense for them to be defined here.
pub trait Ed25519SecretKeyExt: ZeroizeOnDrop {

View File

@ -1,7 +1,6 @@
use core::mem::swap;
use key_management_system_keys::keys::Ed25519PublicKey;
use nomos_blend_proofs::{
use lb_blend_proofs::{
quota::{
self, ProofOfQuota, VerifiedProofOfQuota,
inputs::prove::{
@ -11,6 +10,7 @@ use nomos_blend_proofs::{
},
selection::{self, ProofOfSelection, VerifiedProofOfSelection, inputs::VerifyInputs},
};
use lb_key_management_system_keys::keys::Ed25519PublicKey;
use serde::{Deserialize, Serialize};
use thiserror::Error;
@ -29,7 +29,7 @@ pub struct PoQVerificationInputsMinusSigningKey {
#[cfg(test)]
impl Default for PoQVerificationInputsMinusSigningKey {
fn default() -> Self {
use nomos_core::crypto::ZkHash;
use lb_core::crypto::ZkHash;
Self {
session: 1,

View File

@ -1,4 +1,4 @@
use nomos_blend_proofs::selection::VerifiedProofOfSelection;
use lb_blend_proofs::selection::VerifiedProofOfSelection;
use crate::{
PayloadType,

View File

@ -1,14 +1,14 @@
use itertools::Itertools as _;
use key_management_system_keys::{
keys::{Ed25519PublicKey, Ed25519Signature, UnsecuredEd25519Key},
operators::ed25519::derive_x25519::SharedKey,
};
use nomos_blend_crypto::cipher::Cipher;
use nomos_blend_proofs::{
use lb_blend_crypto::cipher::Cipher;
use lb_blend_proofs::{
quota::{self, VerifiedProofOfQuota},
selection::{self, VerifiedProofOfSelection, inputs::VerifyInputs},
};
use nomos_core::codec::{DeserializeOp as _, SerializeOp as _};
use lb_core::codec::{DeserializeOp as _, SerializeOp as _};
use lb_key_management_system_keys::{
keys::{Ed25519PublicKey, Ed25519Signature, UnsecuredEd25519Key},
operators::ed25519::derive_x25519::SharedKey,
};
use serde::{Deserialize, Serialize};
use crate::{

View File

@ -1,8 +1,8 @@
use key_management_system_keys::keys::Ed25519PublicKey;
use nomos_blend_proofs::{
use lb_blend_proofs::{
quota::{ProofOfQuota, VerifiedProofOfQuota, inputs::prove::public::LeaderInputs},
selection::{ProofOfSelection, VerifiedProofOfSelection, inputs::VerifyInputs},
};
use lb_key_management_system_keys::keys::Ed25519PublicKey;
use crate::crypto::proofs::PoQVerificationInputsMinusSigningKey;

View File

@ -1,14 +1,14 @@
use core::convert::Infallible;
use key_management_system_keys::{
keys::{Ed25519PublicKey, Ed25519Signature, UnsecuredEd25519Key},
operators::ed25519::derive_x25519::X25519PrivateKey,
};
use nomos_blend_proofs::{
use lb_blend_proofs::{
quota::{ProofOfQuota, VerifiedProofOfQuota, inputs::prove::public::LeaderInputs},
selection::{ProofOfSelection, VerifiedProofOfSelection, inputs::VerifyInputs},
};
use nomos_core::codec::{DeserializeOp as _, SerializeOp as _};
use lb_core::codec::{DeserializeOp as _, SerializeOp as _};
use lb_key_management_system_keys::{
keys::{Ed25519PublicKey, Ed25519Signature, UnsecuredEd25519Key},
operators::ed25519::derive_x25519::X25519PrivateKey,
};
use crate::{
Error, PayloadType,
@ -227,7 +227,7 @@ fn invalid_public_header_signature() {
#[test]
fn invalid_public_header_proof_of_quota() {
use nomos_blend_proofs::quota::Error as PoQError;
use lb_blend_proofs::quota::Error as PoQError;
const PAYLOAD_BODY: &[u8] = b"hello";
let verifier = AlwaysFailingProofOfQuotaVerifier;
@ -250,7 +250,7 @@ fn invalid_public_header_proof_of_quota() {
#[test]
fn invalid_blend_header_proof_of_selection() {
use nomos_blend_proofs::selection::Error as PoSelError;
use lb_blend_proofs::selection::Error as PoSelError;
const PAYLOAD_BODY: &[u8] = b"hello";
let verifier = AlwaysFailingProofOfSelectionVerifier;

View File

@ -1,8 +1,8 @@
use key_management_system_keys::{
use lb_blend_crypto::random_sized_bytes;
use lb_blend_proofs::{quota::VerifiedProofOfQuota, selection::inputs::VerifyInputs};
use lb_key_management_system_keys::{
keys::UnsecuredEd25519Key, operators::ed25519::derive_x25519::X25519PrivateKey,
};
use nomos_blend_crypto::random_sized_bytes;
use nomos_blend_proofs::{quota::VerifiedProofOfQuota, selection::inputs::VerifyInputs};
use serde::{Deserialize, Serialize};
use crate::{

View File

@ -1,4 +1,4 @@
use nomos_blend_proofs::{quota, selection};
use lb_blend_proofs::{quota, selection};
#[derive(thiserror::Error, Debug)]
pub enum Error {

View File

@ -1,8 +1,8 @@
use key_management_system_keys::{
use lb_blend_proofs::{quota::VerifiedProofOfQuota, selection::VerifiedProofOfSelection};
use lb_key_management_system_keys::{
keys::{Ed25519PublicKey, UnsecuredEd25519Key},
operators::ed25519::derive_x25519::SharedKey,
};
use nomos_blend_proofs::{quota::VerifiedProofOfQuota, selection::VerifiedProofOfSelection};
/// Input for a single encapsulation,
pub struct EncapsulationInput {

View File

@ -1,12 +1,12 @@
use key_management_system_keys::keys::{
ED25519_PUBLIC_KEY_SIZE, ED25519_SIGNATURE_SIZE, Ed25519PublicKey, Ed25519Signature,
UnsecuredEd25519Key,
};
use nomos_blend_crypto::pseudo_random_sized_bytes;
use nomos_blend_proofs::{
use lb_blend_crypto::pseudo_random_sized_bytes;
use lb_blend_proofs::{
quota::{PROOF_OF_QUOTA_SIZE, ProofOfQuota, VerifiedProofOfQuota},
selection::{PROOF_OF_SELECTION_SIZE, ProofOfSelection, VerifiedProofOfSelection},
};
use lb_key_management_system_keys::keys::{
ED25519_PUBLIC_KEY_SIZE, ED25519_SIGNATURE_SIZE, Ed25519PublicKey, Ed25519Signature,
UnsecuredEd25519Key,
};
use serde::{Deserialize, Serialize};
use crate::crypto::domains;

View File

@ -1,5 +1,5 @@
use key_management_system_keys::keys::{Ed25519PublicKey, Ed25519Signature};
use nomos_blend_proofs::quota::{self, ProofOfQuota, VerifiedProofOfQuota};
use lb_blend_proofs::quota::{self, ProofOfQuota, VerifiedProofOfQuota};
use lb_key_management_system_keys::keys::{Ed25519PublicKey, Ed25519Signature};
use serde::{Deserialize, Serialize};
use crate::{Error, MessageIdentifier, encap::ProofsVerifier};
@ -161,9 +161,9 @@ impl VerifiedPublicHeader {
#[cfg(test)]
mod tests {
use key_management_system_keys::keys::{ED25519_PUBLIC_KEY_SIZE, Ed25519PublicKey};
use nomos_blend_proofs::quota::VerifiedProofOfQuota;
use nomos_core::codec::{DeserializeOp as _, SerializeOp as _};
use lb_blend_proofs::quota::VerifiedProofOfQuota;
use lb_core::codec::{DeserializeOp as _, SerializeOp as _};
use lb_key_management_system_keys::keys::{ED25519_PUBLIC_KEY_SIZE, Ed25519PublicKey};
use crate::message::{PublicHeader, public_header::VerifiedPublicHeader};

View File

@ -1,6 +1,6 @@
use derivative::Derivative;
use nomos_blend_proofs::selection::inputs::VerifyInputs;
use nomos_core::sdp::SessionNumber;
use lb_blend_proofs::selection::inputs::VerifyInputs;
use lb_core::sdp::SessionNumber;
use serde::Serialize;
use tracing::debug;
@ -37,7 +37,7 @@ impl ActivityProof {
}
pub fn verify_and_build<ProofsVerifier>(
proof: &nomos_core::sdp::blend::ActivityProof,
proof: &lb_core::sdp::blend::ActivityProof,
verifier: &ProofsVerifier,
node_index: u64,
membership_size: u64,
@ -81,7 +81,7 @@ pub fn activity_threshold(token_count_bit_len: u64, network_size_bit_len: u64) -
.into()
}
impl From<&ActivityProof> for nomos_core::sdp::blend::ActivityProof {
impl From<&ActivityProof> for lb_core::sdp::blend::ActivityProof {
fn from(proof: &ActivityProof) -> Self {
Self {
session: proof.session_number,

View File

@ -5,7 +5,7 @@ mod token;
use std::collections::HashSet;
pub use activity::ActivityProof;
use nomos_core::sdp::SessionNumber;
use lb_core::sdp::SessionNumber;
use serde::{Deserialize, Serialize};
pub use session::SessionInfo;
pub use token::{BlendingToken, HammingDistance};
@ -113,12 +113,12 @@ pub const fn evaluate_hamming_distance(distance: u64, activity_threshold: u64) -
#[cfg(test)]
mod tests {
use key_management_system_keys::keys::Ed25519Key;
use nomos_blend_proofs::{
use lb_blend_proofs::{
quota::{PROOF_OF_QUOTA_SIZE, VerifiedProofOfQuota},
selection::{PROOF_OF_SELECTION_SIZE, VerifiedProofOfSelection},
};
use nomos_core::crypto::ZkHash;
use lb_core::crypto::ZkHash;
use lb_key_management_system_keys::keys::Ed25519Key;
use super::*;

View File

@ -1,9 +1,9 @@
use std::ops::{Add as _, Deref};
use groth16::fr_to_bytes;
use nomos_blend_crypto::blake2b512;
use nomos_core::{crypto::ZkHash, sdp::SessionNumber};
use nomos_utils::math::{F64Ge1, NonNegativeF64};
use lb_blend_crypto::blake2b512;
use lb_core::{crypto::ZkHash, sdp::SessionNumber};
use lb_groth16::fr_to_bytes;
use lb_utils::math::{F64Ge1, NonNegativeF64};
use serde::{Deserialize, Serialize};
use crate::reward::{BlendingToken, activity, token::HammingDistance};
@ -147,8 +147,8 @@ pub fn activity_threshold(
#[cfg(test)]
mod tests {
use key_management_system_keys::keys::Ed25519Key;
use nomos_blend_proofs::{quota::VerifiedProofOfQuota, selection::VerifiedProofOfSelection};
use lb_blend_proofs::{quota::VerifiedProofOfQuota, selection::VerifiedProofOfSelection};
use lb_key_management_system_keys::keys::Ed25519Key;
use super::*;

View File

@ -2,9 +2,9 @@ use blake2::{
Blake2bVar,
digest::{Update as _, VariableOutput as _},
};
use key_management_system_keys::keys::Ed25519PublicKey;
use nomos_blend_proofs::{quota::VerifiedProofOfQuota, selection::VerifiedProofOfSelection};
use nomos_core::codec::SerializeOp as _;
use lb_blend_proofs::{quota::VerifiedProofOfQuota, selection::VerifiedProofOfSelection};
use lb_core::codec::SerializeOp as _;
use lb_key_management_system_keys::keys::Ed25519PublicKey;
use serde::{Deserialize, Serialize};
use crate::reward::session::SessionRandomness;
@ -105,8 +105,8 @@ impl From<u64> for HammingDistance {
#[cfg(test)]
mod tests {
use key_management_system_keys::keys::Ed25519Key;
use nomos_blend_proofs::{quota::PROOF_OF_QUOTA_SIZE, selection::PROOF_OF_SELECTION_SIZE};
use lb_blend_proofs::{quota::PROOF_OF_QUOTA_SIZE, selection::PROOF_OF_SELECTION_SIZE};
use lb_key_management_system_keys::keys::Ed25519Key;
use super::*;

41
blend/network/Cargo.toml Normal file
View File

@ -0,0 +1,41 @@
[package]
categories = { workspace = true }
description = { workspace = true }
edition = { workspace = true }
keywords = { workspace = true }
license = { workspace = true }
name = "logos-blockchain-blend-network"
readme = { workspace = true }
repository = { workspace = true }
version = { workspace = true }
[lints]
workspace = true
[dependencies]
either = { default-features = false, version = "1.15.0" }
futures = { default-features = false, version = "0.3.30" }
futures-timer = { version = "3.0.3" }
lb-blend-message = { workspace = true }
lb-blend-proofs = { workspace = true }
lb-blend-scheduling = { workspace = true }
lb-core = { workspace = true }
lb-key-management-system-keys = { workspace = true }
lb-libp2p = { workspace = true }
libp2p = { workspace = true }
tracing = { workspace = true }
[dev-dependencies]
async-trait = { version = "0.1" }
lb-blend-message = { features = ["unsafe-test-functions"], workspace = true }
lb-blend-scheduling = { features = ["unsafe-test-functions"], workspace = true }
lb-groth16 = { default-features = false, workspace = true }
libp2p = { default-features = false, workspace = true, features = ["plaintext", "tcp", "yamux"] }
libp2p-stream = { workspace = true }
libp2p-swarm-test = { default-features = false, features = ["tokio"], version = "0.5.0" }
test-log = { default-features = false, version = "0.2.18" }
tokio = { default-features = false, version = "1" }
tokio-stream = { default-features = false, version = "0.1" }
[features]
unsafe-test-functions = []

View File

@ -4,10 +4,10 @@ pub mod with_edge;
#[cfg(test)]
mod tests;
use lb_blend_message::encap;
use lb_blend_proofs::quota::inputs::prove::public::LeaderInputs;
use lb_blend_scheduling::membership::Membership;
use libp2p::{PeerId, StreamProtocol};
use nomos_blend_message::encap;
use nomos_blend_proofs::quota::inputs::prove::public::LeaderInputs;
use nomos_blend_scheduling::membership::Membership;
use self::{
with_core::behaviour::Behaviour as CoreToCoreBehaviour,
@ -20,7 +20,7 @@ use crate::core::{
/// A composed behaviour that wraps the two sub-behaviours for dealing with core
/// and edge nodes.
#[derive(nomos_libp2p::NetworkBehaviour)]
#[derive(lb_libp2p::NetworkBehaviour)]
pub struct NetworkBehaviour<ProofsVerifier, ObservationWindowClockProvider> {
with_core: CoreToCoreBehaviour<ProofsVerifier, ObservationWindowClockProvider>,
with_edge: CoreToEdgeBehaviour<ProofsVerifier>,

View File

@ -6,25 +6,27 @@ use core::{
};
use std::time::Duration;
use key_management_system_keys::keys::{Ed25519PublicKey, Ed25519Signature, UnsecuredEd25519Key};
use libp2p::{
PeerId, StreamProtocol, Swarm, Transport as _, core::transport::MemoryTransport,
identity::PublicKey, plaintext, swarm, tcp, yamux,
};
use libp2p_swarm_test::SwarmExt as _;
use nomos_blend_message::{
use lb_blend_message::{
PayloadType,
crypto::{key_ext::Ed25519SecretKeyExt as _, proofs::PoQVerificationInputsMinusSigningKey},
encap::{ProofsVerifier, validated::EncapsulatedMessageWithVerifiedPublicHeader},
input::EncapsulationInput,
};
use nomos_blend_proofs::{
use lb_blend_proofs::{
quota::{ProofOfQuota, VerifiedProofOfQuota, inputs::prove::public::LeaderInputs},
selection::{ProofOfSelection, VerifiedProofOfSelection, inputs::VerifyInputs},
};
use nomos_blend_scheduling::message_blend::provers::BlendLayerProof;
use nomos_core::sdp::SessionNumber;
use nomos_libp2p::{NetworkBehaviour, ed25519, upgrade::Version};
use lb_blend_scheduling::message_blend::provers::BlendLayerProof;
use lb_core::sdp::SessionNumber;
use lb_key_management_system_keys::keys::{
Ed25519PublicKey, Ed25519Signature, UnsecuredEd25519Key,
};
use lb_libp2p::{NetworkBehaviour, ed25519, upgrade::Version};
use libp2p::{
PeerId, StreamProtocol, Swarm, Transport as _, core::transport::MemoryTransport,
identity::PublicKey, plaintext, swarm, tcp, yamux,
};
use libp2p_swarm_test::SwarmExt as _;
pub const PROTOCOL_NAME: StreamProtocol = StreamProtocol::new("/blend/core-behaviour/test");

View File

@ -11,6 +11,17 @@ use std::{
use either::Either;
use futures::Stream;
use lb_blend_message::{
MessageIdentifier,
encap::{
self, encapsulated::EncapsulatedMessage,
validated::EncapsulatedMessageWithVerifiedPublicHeader,
},
};
use lb_blend_proofs::quota::inputs::prove::public::LeaderInputs;
use lb_blend_scheduling::{
deserialize_encapsulated_message, membership::Membership, serialize_encapsulated_message,
};
use libp2p::{
Multiaddr, PeerId, StreamProtocol,
core::{Endpoint, transport::PortUse},
@ -20,17 +31,6 @@ use libp2p::{
dummy::ConnectionHandler as DummyConnectionHandler,
},
};
use nomos_blend_message::{
MessageIdentifier,
encap::{
self, encapsulated::EncapsulatedMessage,
validated::EncapsulatedMessageWithVerifiedPublicHeader,
},
};
use nomos_blend_proofs::quota::inputs::prove::public::LeaderInputs;
use nomos_blend_scheduling::{
deserialize_encapsulated_message, membership::Membership, serialize_encapsulated_message,
};
use crate::core::with_core::{
behaviour::{

View File

@ -5,19 +5,19 @@ use std::{
};
use either::Either;
use libp2p::{
PeerId,
swarm::{ConnectionId, NotifyHandler, ToSwarm},
};
use nomos_blend_message::{
use lb_blend_message::{
MessageIdentifier,
encap::{
self, encapsulated::EncapsulatedMessage,
validated::EncapsulatedMessageWithVerifiedPublicHeader,
},
};
use nomos_blend_proofs::quota::inputs::prove::public::LeaderInputs;
use nomos_blend_scheduling::{deserialize_encapsulated_message, serialize_encapsulated_message};
use lb_blend_proofs::quota::inputs::prove::public::LeaderInputs;
use lb_blend_scheduling::{deserialize_encapsulated_message, serialize_encapsulated_message};
use libp2p::{
PeerId,
swarm::{ConnectionId, NotifyHandler, ToSwarm},
};
use crate::core::with_core::{
behaviour::{Event, handler::FromBehaviour},

View File

@ -1,12 +1,12 @@
use core::time::Duration;
use futures::StreamExt as _;
use lb_libp2p::SwarmEvent;
use libp2p::{
core::Endpoint,
swarm::{ConnectionId, dummy},
};
use libp2p_swarm_test::SwarmExt as _;
use nomos_libp2p::SwarmEvent;
use test_log::test;
use tokio::{select, time::sleep};

View File

@ -1,8 +1,8 @@
use core::time::Duration;
use futures::StreamExt as _;
use lb_libp2p::SwarmEvent;
use libp2p_swarm_test::SwarmExt as _;
use nomos_libp2p::SwarmEvent;
use test_log::test;
use tokio::{select, time::sleep};

View File

@ -2,9 +2,9 @@ use core::time::Duration;
use std::collections::HashSet;
use futures::StreamExt as _;
use lb_blend_message::encap::encapsulated::EncapsulatedMessage;
use lb_libp2p::SwarmEvent;
use libp2p_swarm_test::SwarmExt as _;
use nomos_blend_message::encap::encapsulated::EncapsulatedMessage;
use nomos_libp2p::SwarmEvent;
use test_log::test;
use tokio::{select, time::sleep};

View File

@ -1,6 +1,6 @@
use futures::StreamExt as _;
use lb_libp2p::SwarmEvent;
use libp2p_swarm_test::SwarmExt as _;
use nomos_libp2p::SwarmEvent;
use test_log::test;
use tokio::select;

View File

@ -6,21 +6,21 @@ use std::{
use async_trait::async_trait;
use futures::{Stream, StreamExt as _, select};
use groth16::Field as _;
use key_management_system_keys::keys::{Ed25519PublicKey, UnsecuredEd25519Key};
use lb_blend_message::{
crypto::{key_ext::Ed25519SecretKeyExt as _, proofs::PoQVerificationInputsMinusSigningKey},
encap,
};
use lb_blend_proofs::quota::inputs::prove::public::{CoreInputs, LeaderInputs};
use lb_blend_scheduling::membership::{Membership, Node};
use lb_core::{crypto::ZkHash, sdp::SessionNumber};
use lb_groth16::Field as _;
use lb_key_management_system_keys::keys::{Ed25519PublicKey, UnsecuredEd25519Key};
use lb_libp2p::{NetworkBehaviour, SwarmEvent};
use libp2p::{
Multiaddr, PeerId, Swarm,
identity::{PublicKey, ed25519},
};
use libp2p_swarm_test::SwarmExt as _;
use nomos_blend_message::{
crypto::{key_ext::Ed25519SecretKeyExt as _, proofs::PoQVerificationInputsMinusSigningKey},
encap,
};
use nomos_blend_proofs::quota::inputs::prove::public::{CoreInputs, LeaderInputs};
use nomos_blend_scheduling::membership::{Membership, Node};
use nomos_core::{crypto::ZkHash, sdp::SessionNumber};
use nomos_libp2p::{NetworkBehaviour, SwarmEvent};
use tokio::time::interval;
use tokio_stream::wrappers::IntervalStream;

View File

@ -8,6 +8,15 @@ use std::{
};
use either::Either;
use lb_blend_message::{
Error,
encap::{
self, encapsulated::EncapsulatedMessage,
validated::EncapsulatedMessageWithVerifiedPublicHeader,
},
};
use lb_blend_proofs::quota::{self, inputs::prove::public::LeaderInputs};
use lb_blend_scheduling::{deserialize_encapsulated_message, membership::Membership};
use libp2p::{
Multiaddr, PeerId, StreamProtocol,
core::{Endpoint, transport::PortUse},
@ -17,15 +26,6 @@ use libp2p::{
dummy::ConnectionHandler as DummyConnectionHandler,
},
};
use nomos_blend_message::{
Error,
encap::{
self, encapsulated::EncapsulatedMessage,
validated::EncapsulatedMessageWithVerifiedPublicHeader,
},
};
use nomos_blend_proofs::quota::{self, inputs::prove::public::LeaderInputs};
use nomos_blend_scheduling::{deserialize_encapsulated_message, membership::Membership};
use crate::core::with_edge::behaviour::handler::{ConnectionHandler, FromBehaviour, ToBehaviour};

View File

@ -2,10 +2,10 @@ use core::time::Duration;
use std::sync::{Arc, Mutex};
use futures::StreamExt as _;
use lb_libp2p::SwarmEvent;
use libp2p::{PeerId, Stream, swarm::dummy};
use libp2p_stream::{Behaviour as StreamBehaviour, OpenStreamError};
use libp2p_swarm_test::SwarmExt as _;
use nomos_libp2p::SwarmEvent;
use test_log::test;
use tokio::{select, spawn, time::sleep};

View File

@ -1,12 +1,12 @@
use core::time::Duration;
use futures::{StreamExt as _, select};
use lb_blend_message::encap::encapsulated::EncapsulatedMessage;
use lb_blend_scheduling::serialize_encapsulated_message;
use lb_libp2p::SwarmEvent;
use libp2p::PeerId;
use libp2p_stream::Behaviour as StreamBehaviour;
use libp2p_swarm_test::SwarmExt as _;
use nomos_blend_message::encap::encapsulated::EncapsulatedMessage;
use nomos_blend_scheduling::serialize_encapsulated_message;
use nomos_libp2p::SwarmEvent;
use test_log::test;
use crate::{

View File

@ -2,12 +2,12 @@ use core::{num::NonZeroUsize, time::Duration};
use std::collections::{HashSet, VecDeque};
use async_trait::async_trait;
use key_management_system_keys::keys::{ED25519_PUBLIC_KEY_SIZE, Ed25519PublicKey};
use lb_blend_message::encap;
use lb_blend_scheduling::membership::{Membership, Node};
use lb_key_management_system_keys::keys::{ED25519_PUBLIC_KEY_SIZE, Ed25519PublicKey};
use libp2p::{Multiaddr, PeerId, Stream, Swarm};
use libp2p_stream::Behaviour as StreamBehaviour;
use libp2p_swarm_test::SwarmExt as _;
use nomos_blend_message::encap;
use nomos_blend_scheduling::membership::{Membership, Node};
use crate::core::{
tests::utils::{AlwaysTrueVerifier, PROTOCOL_NAME},

31
blend/proofs/Cargo.toml Normal file
View File

@ -0,0 +1,31 @@
[package]
categories = { workspace = true }
description = { workspace = true }
edition = { workspace = true }
keywords = { workspace = true }
license = { workspace = true }
name = "logos-blockchain-blend-proofs"
readme = { workspace = true }
repository = { workspace = true }
version = { workspace = true }
[lints]
workspace = true
[dependencies]
ed25519-dalek = { workspace = true }
generic-array = { default-features = false, version = "1.2" }
lb-blend-crypto = { workspace = true }
lb-groth16 = { workspace = true }
lb-poq = { workspace = true }
num-bigint = { default-features = false, version = "0.4" }
serde = { workspace = true }
thiserror = "1"
[dev-dependencies]
const-hex = { default-features = false, version = "1.15.0" }
lb-core = { workspace = true }
lb-key-management-system-keys = { workspace = true }
[features]
unsafe-test-functions = []

View File

@ -1,5 +1,5 @@
use nomos_blend_crypto::{ZkHash, ZkHasher};
pub use poq::CorePathAndSelectors;
use lb_blend_crypto::{ZkHash, ZkHasher};
pub use lb_poq::CorePathAndSelectors;
pub mod quota;
pub mod selection;

View File

@ -1,5 +1,5 @@
use groth16::fr_from_bytes;
use poq::{
use lb_groth16::fr_from_bytes;
use lb_poq::{
PoQBlendInputsData, PoQChainInputsData, PoQCommonInputsData, PoQInputsFromDataError,
PoQWalletInputsData, PoQWitnessInputs,
};

View File

@ -1,4 +1,4 @@
use poq::NotePathAndSelectors;
use lb_poq::NotePathAndSelectors;
use crate::{CorePathAndSelectors, ZkHash};

View File

@ -28,7 +28,7 @@ impl Default for Inputs {
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(test, derive(Default))]
pub struct CoreInputs {
#[serde(with = "groth16::serde::serde_fr")]
#[serde(with = "lb_groth16::serde::serde_fr")]
pub zk_root: ZkHash,
pub quota: u64,
}
@ -36,9 +36,9 @@ pub struct CoreInputs {
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(test, derive(Default))]
pub struct LeaderInputs {
#[serde(with = "groth16::serde::serde_fr")]
#[serde(with = "lb_groth16::serde::serde_fr")]
pub pol_ledger_aged: ZkHash,
#[serde(with = "groth16::serde::serde_fr")]
#[serde(with = "lb_groth16::serde::serde_fr")]
pub pol_epoch_nonce: ZkHash,
pub message_quota: u64,
pub total_stake: u64,

View File

@ -1,5 +1,5 @@
use groth16::fr_from_bytes;
use poq::{PoQVerifierInput, PoQVerifierInputData};
use lb_groth16::fr_from_bytes;
use lb_poq::{PoQVerifierInput, PoQVerifierInputData};
use crate::{
ZkHash,

View File

@ -3,8 +3,8 @@ use std::sync::LazyLock;
use ::serde::{Deserialize, Serialize};
use ed25519_dalek::{PUBLIC_KEY_LENGTH, VerifyingKey};
use generic_array::{ArrayLength, GenericArray};
use groth16::{Bn254, CompressSize, fr_from_bytes, fr_from_bytes_unchecked, fr_to_bytes};
use poq::{PoQProof, PoQVerifierInput, PoQWitnessInputs, ProveError, prove, verify};
use lb_groth16::{Bn254, CompressSize, fr_from_bytes, fr_from_bytes_unchecked, fr_to_bytes};
use lb_poq::{PoQProof, PoQVerifierInput, PoQWitnessInputs, ProveError, prove, verify};
use thiserror::Error;
use crate::{
@ -45,7 +45,7 @@ pub enum Error {
/// A Proof of Quota as described in the Blend v1 spec: <https://www.notion.so/nomos-tech/Proof-of-Quota-Specification-215261aa09df81d88118ee22205cbafe?source=copy_link#26a261aa09df80f4b119f900fbb36f3f>.
#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq, Hash)]
pub struct ProofOfQuota {
#[serde(with = "groth16::serde::serde_fr")]
#[serde(with = "lb_groth16::serde::serde_fr")]
key_nullifier: ZkHash,
#[serde(with = "self::serde::proof::SerializablePoQProof")]
proof: PoQProof,

View File

@ -1,10 +1,10 @@
pub(super) mod proof {
use generic_array::GenericArray;
use groth16::CompressSize;
use lb_groth16::CompressSize;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
#[serde(remote = "groth16::CompressedProof")]
#[serde(remote = "lb_groth16::CompressedProof")]
pub struct SerializablePoQProof<E: CompressSize> {
pub pi_a: GenericArray<u8, E::G1CompressedSize>,
pub pi_b: GenericArray<u8, E::G2CompressedSize>,
@ -14,7 +14,7 @@ pub(super) mod proof {
#[cfg(test)]
mod tests {
use nomos_core::codec::{DeserializeOp as _, SerializeOp as _};
use lb_core::codec::{DeserializeOp as _, SerializeOp as _};
use crate::quota::{ProofOfQuota, VerifiedProofOfQuota};

View File

@ -1,7 +1,7 @@
use const_hex::FromHex as _;
use groth16::{Field as _, fr_from_bytes_unchecked};
use key_management_system_keys::keys::UnsecuredZkKey;
use nomos_blend_crypto::{ZkHash, merkle::MerkleTree};
use lb_blend_crypto::{ZkHash, merkle::MerkleTree};
use lb_groth16::{Field as _, fr_from_bytes_unchecked};
use lb_key_management_system_keys::keys::UnsecuredZkKey;
use crate::{
quota::{

View File

@ -1,8 +1,8 @@
use core::fmt::Debug;
use std::sync::LazyLock;
use groth16::{fr_from_bytes, fr_from_bytes_unchecked, fr_to_bytes};
use nomos_blend_crypto::pseudo_random_sized_bytes;
use lb_blend_crypto::pseudo_random_sized_bytes;
use lb_groth16::{fr_from_bytes, fr_from_bytes_unchecked, fr_to_bytes};
use num_bigint::BigUint;
use serde::{Deserialize, Serialize};
use thiserror::Error;
@ -42,7 +42,7 @@ pub enum Error {
/// A Proof of Selection as described in the Blend v1 spec: <https://www.notion.so/nomos-tech/Blend-Protocol-215261aa09df81ae8857d71066a80084?source=copy_link#215261aa09df81d6bb3febd62b598138>.
#[derive(Clone, Debug, Copy, Serialize, Deserialize, PartialEq, Eq, Hash)]
pub struct ProofOfSelection {
#[serde(with = "groth16::serde::serde_fr")]
#[serde(with = "lb_groth16::serde::serde_fr")]
selection_randomness: ZkHash,
}

View File

@ -1,6 +1,6 @@
use const_hex::FromHex as _;
use groth16::{Field as _, fr_from_bytes_unchecked};
use nomos_core::codec::{DeserializeOp as _, SerializeOp as _};
use lb_core::codec::{DeserializeOp as _, SerializeOp as _};
use lb_groth16::{Field as _, fr_from_bytes_unchecked};
use crate::{
ZkHash,

View File

@ -0,0 +1,41 @@
[package]
categories = { workspace = true }
description = { workspace = true }
edition = { workspace = true }
keywords = { workspace = true }
license = { workspace = true }
name = "logos-blockchain-blend-scheduling"
readme = { workspace = true }
repository = { workspace = true }
version = { workspace = true }
[lints]
workspace = true
[dependencies]
async-trait = { default-features = false, version = "0.1" }
derivative = "2"
fork_stream = { workspace = true }
futures = { default-features = false, version = "0.3" }
lb-blend-message = { workspace = true }
lb-blend-proofs = { workspace = true }
lb-core = { workspace = true }
lb-key-management-system-keys = { workspace = true }
lb-utils = { workspace = true, features = ["rng"] }
multiaddr = { default-features = false, version = "0.18" }
rand = { features = ["alloc"], workspace = true }
serde = { workspace = true }
thiserror = { default-features = false, version = "1" }
tokio = { default-features = false, version = "1" }
tokio-stream = { default-features = false, version = "0.1" }
tracing = { workspace = true }
[dev-dependencies]
lb-blend-message = { workspace = true, features = ["unsafe-test-functions"] }
lb-blend-proofs = { workspace = true, features = ["unsafe-test-functions"] }
lb-groth16 = { workspace = true }
libp2p = { workspace = true }
test-log = { default-features = false, version = "0.2.18", features = ["trace"] }
[features]
unsafe-test-functions = []

View File

@ -3,7 +3,7 @@ use std::{
hash::Hash,
};
use key_management_system_keys::keys::Ed25519PublicKey;
use lb_key_management_system_keys::keys::Ed25519PublicKey;
use multiaddr::Multiaddr;
use rand::{Rng, seq::IteratorRandom as _};
use serde::{Deserialize, Serialize};
@ -63,7 +63,7 @@ where
#[cfg(any(test, feature = "unsafe-test-functions"))]
#[must_use]
pub fn new_without_local(nodes: &[Node<NodeId>]) -> Self {
use key_management_system_keys::keys::ED25519_PUBLIC_KEY_SIZE;
use lb_key_management_system_keys::keys::ED25519_PUBLIC_KEY_SIZE;
Self::new(
nodes,
@ -140,7 +140,7 @@ impl<NodeId> Membership<NodeId> {
#[cfg(test)]
mod tests {
use key_management_system_keys::keys::UnsecuredEd25519Key;
use lb_key_management_system_keys::keys::UnsecuredEd25519Key;
use rand::rngs::OsRng;
use super::*;

View File

@ -1,14 +1,14 @@
use core::{hash::Hash, marker::PhantomData};
use std::num::NonZeroU64;
use key_management_system_keys::operators::ed25519::derive_x25519::X25519PrivateKey;
use nomos_blend_message::{
use lb_blend_message::{
Error, PaddedPayloadBody, PayloadType, crypto::proofs::PoQVerificationInputsMinusSigningKey,
input::EncapsulationInput,
};
use nomos_blend_proofs::quota::inputs::prove::{
use lb_blend_proofs::quota::inputs::prove::{
private::ProofOfLeadershipQuotaInputs, public::LeaderInputs,
};
use lb_key_management_system_keys::operators::ed25519::derive_x25519::X25519PrivateKey;
use crate::{
membership::Membership,
@ -212,15 +212,15 @@ where
mod test {
use std::num::NonZeroU64;
use groth16::Field as _;
use key_management_system_keys::keys::{ED25519_PUBLIC_KEY_SIZE, Ed25519PublicKey};
use multiaddr::{Multiaddr, PeerId};
use nomos_blend_message::crypto::proofs::PoQVerificationInputsMinusSigningKey;
use nomos_blend_proofs::quota::inputs::prove::{
use lb_blend_message::crypto::proofs::PoQVerificationInputsMinusSigningKey;
use lb_blend_proofs::quota::inputs::prove::{
private::ProofOfLeadershipQuotaInputs,
public::{CoreInputs, LeaderInputs},
};
use nomos_core::crypto::ZkHash;
use lb_core::crypto::ZkHash;
use lb_groth16::Field as _;
use lb_key_management_system_keys::keys::{ED25519_PUBLIC_KEY_SIZE, Ed25519PublicKey};
use multiaddr::{Multiaddr, PeerId};
use super::SessionCryptographicProcessor;
use crate::{

View File

@ -1,6 +1,6 @@
use core::ops::{Deref, DerefMut};
use nomos_blend_message::{
use lb_blend_message::{
Error,
crypto::proofs::PoQVerificationInputsMinusSigningKey,
encap::{
@ -8,7 +8,7 @@ use nomos_blend_message::{
validated::RequiredProofOfSelectionVerificationInputs,
},
};
use nomos_blend_proofs::quota::inputs::prove::public::LeaderInputs;
use lb_blend_proofs::quota::inputs::prove::public::LeaderInputs;
use crate::{
membership::Membership,
@ -137,12 +137,12 @@ impl<NodeId, CorePoQGenerator, ProofsGenerator, ProofsVerifier> DerefMut
mod test {
use std::num::NonZeroU64;
use groth16::Field as _;
use key_management_system_keys::keys::{ED25519_PUBLIC_KEY_SIZE, Ed25519PublicKey};
use lb_blend_message::crypto::proofs::PoQVerificationInputsMinusSigningKey;
use lb_blend_proofs::quota::inputs::prove::public::{CoreInputs, LeaderInputs};
use lb_core::crypto::ZkHash;
use lb_groth16::Field as _;
use lb_key_management_system_keys::keys::{ED25519_PUBLIC_KEY_SIZE, Ed25519PublicKey};
use multiaddr::{Multiaddr, PeerId};
use nomos_blend_message::crypto::proofs::PoQVerificationInputsMinusSigningKey;
use nomos_blend_proofs::quota::inputs::prove::public::{CoreInputs, LeaderInputs};
use nomos_core::crypto::ZkHash;
use super::SessionCryptographicProcessor;
use crate::{

View File

@ -1,11 +1,11 @@
use core::hash::Hash;
use std::num::NonZeroU64;
use nomos_blend_message::{
use lb_blend_message::{
Error, PaddedPayloadBody, PayloadType, crypto::proofs::PoQVerificationInputsMinusSigningKey,
input::EncapsulationInput,
};
use nomos_blend_proofs::quota::inputs::prove::{
use lb_blend_proofs::quota::inputs::prove::{
private::ProofOfLeadershipQuotaInputs, public::LeaderInputs,
};
@ -136,15 +136,15 @@ where
mod test {
use std::num::NonZeroU64;
use groth16::Field as _;
use key_management_system_keys::keys::{ED25519_PUBLIC_KEY_SIZE, Ed25519PublicKey};
use libp2p::{Multiaddr, PeerId};
use nomos_blend_message::crypto::proofs::PoQVerificationInputsMinusSigningKey;
use nomos_blend_proofs::quota::inputs::prove::{
use lb_blend_message::crypto::proofs::PoQVerificationInputsMinusSigningKey;
use lb_blend_proofs::quota::inputs::prove::{
private::ProofOfLeadershipQuotaInputs,
public::{CoreInputs, LeaderInputs},
};
use nomos_core::crypto::ZkHash;
use lb_core::crypto::ZkHash;
use lb_groth16::Field as _;
use lb_key_management_system_keys::keys::{ED25519_PUBLIC_KEY_SIZE, Ed25519PublicKey};
use libp2p::{Multiaddr, PeerId};
use super::SessionCryptographicProcessor;
use crate::{

View File

@ -1,14 +1,14 @@
use std::num::NonZeroU64;
use derivative::Derivative;
use key_management_system_keys::operators::ed25519::derive_x25519::X25519PrivateKey;
use nomos_blend_message::{
use lb_blend_message::{
Error,
encap::{
encapsulated::EncapsulatedMessage, validated::EncapsulatedMessageWithVerifiedPublicHeader,
},
};
use nomos_core::codec::{DeserializeOp as _, SerializeOp as _};
use lb_core::codec::{DeserializeOp as _, SerializeOp as _};
use lb_key_management_system_keys::operators::ed25519::derive_x25519::X25519PrivateKey;
pub mod core_and_leader;
pub use self::core_and_leader::{

View File

@ -2,11 +2,10 @@ use core::convert::Infallible;
use async_trait::async_trait;
use futures::future::ready;
use key_management_system_keys::keys::{Ed25519PublicKey, UnsecuredEd25519Key};
use nomos_blend_message::{
use lb_blend_message::{
crypto::proofs::PoQVerificationInputsMinusSigningKey, encap::ProofsVerifier,
};
use nomos_blend_proofs::{
use lb_blend_proofs::{
quota::{
self, ProofOfQuota, VerifiedProofOfQuota,
inputs::prove::{
@ -15,7 +14,8 @@ use nomos_blend_proofs::{
},
selection::{ProofOfSelection, VerifiedProofOfSelection, inputs::VerifyInputs},
};
use nomos_core::crypto::ZkHash;
use lb_core::crypto::ZkHash;
use lb_key_management_system_keys::keys::{Ed25519PublicKey, UnsecuredEd25519Key};
use crate::message_blend::{
CoreProofOfQuotaGenerator,
@ -66,7 +66,7 @@ impl CoreProofOfQuotaGenerator for MockCorePoQGenerator {
_key_index: u64,
) -> impl Future<Output = Result<(VerifiedProofOfQuota, ZkHash), quota::Error>> + Send + Sync
{
use groth16::Field as _;
use lb_groth16::Field as _;
ready(Ok((
VerifiedProofOfQuota::from_bytes_unchecked([0; _]),

View File

@ -1,5 +1,5 @@
use nomos_blend_proofs::quota::{self, VerifiedProofOfQuota, inputs::prove::PublicInputs};
use nomos_core::crypto::ZkHash;
use lb_blend_proofs::quota::{self, VerifiedProofOfQuota, inputs::prove::PublicInputs};
use lb_core::crypto::ZkHash;
pub mod crypto;
pub mod provers;

View File

@ -2,14 +2,14 @@ use core::pin::Pin;
use async_trait::async_trait;
use futures::stream::{self, Stream, StreamExt as _};
use key_management_system_keys::keys::UnsecuredEd25519Key;
use nomos_blend_message::crypto::{
use lb_blend_message::crypto::{
key_ext::Ed25519SecretKeyExt as _, proofs::PoQVerificationInputsMinusSigningKey,
};
use nomos_blend_proofs::{
use lb_blend_proofs::{
quota::inputs::prove::{PublicInputs, public::LeaderInputs},
selection::VerifiedProofOfSelection,
};
use lb_key_management_system_keys::keys::UnsecuredEd25519Key;
use crate::message_blend::{
CoreProofOfQuotaGenerator,

View File

@ -1,4 +1,4 @@
use nomos_blend_proofs::selection::inputs::VerifyInputs;
use lb_blend_proofs::selection::inputs::VerifyInputs;
use test_log::test;
use crate::message_blend::provers::{

View File

@ -1,5 +1,5 @@
use async_trait::async_trait;
use nomos_blend_proofs::quota::inputs::prove::{
use lb_blend_proofs::quota::inputs::prove::{
private::ProofOfLeadershipQuotaInputs, public::LeaderInputs,
};

View File

@ -1,4 +1,4 @@
use nomos_blend_proofs::selection::inputs::VerifyInputs;
use lb_blend_proofs::selection::inputs::VerifyInputs;
use test_log::test;
use crate::message_blend::provers::{

View File

@ -2,11 +2,10 @@ use core::pin::Pin;
use async_trait::async_trait;
use futures::{Stream, StreamExt as _, stream};
use key_management_system_keys::keys::UnsecuredEd25519Key;
use nomos_blend_message::crypto::{
use lb_blend_message::crypto::{
key_ext::Ed25519SecretKeyExt as _, proofs::PoQVerificationInputsMinusSigningKey,
};
use nomos_blend_proofs::{
use lb_blend_proofs::{
quota::{
VerifiedProofOfQuota,
inputs::prove::{
@ -16,6 +15,7 @@ use nomos_blend_proofs::{
},
selection::VerifiedProofOfSelection,
};
use lb_key_management_system_keys::keys::UnsecuredEd25519Key;
use tokio::task::spawn_blocking;
use crate::message_blend::provers::{BlendLayerProof, ProofsGeneratorSettings};

Some files were not shown because too many files have changed in this diff Show More