Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

feat: replace libp2p peer ids with validator ids #319

Merged
merged 36 commits into from
Oct 17, 2023
Merged

feat: replace libp2p peer ids with validator ids #319

merged 36 commits into from
Oct 17, 2023

Conversation

gruberb
Copy link
Contributor

@gruberb gruberb commented Oct 2, 2023

Description

Replacing PeerId from libp2p in the broadcast layer with our own ValidatorId (which is a Ethereum public address -H160 as for now).

Fixes TP-708

Additions and Changes

  • The broadcast layer stores the network peers now as HashSet<ValidatorId>, and supplies the list of validators through the genesis.json file during start.
  • As soon as the node starts, stable_sample is set to true right away
  • The cert_delivery test is adjusted so each node has validators and a validator_id to start with

Breaking changes

IMPORTANT: This removes the --push-peer-list command AND api endpoint.

PR Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added or updated tests that comprehensively prove my change is effective or that my feature works

crates/topos-p2p/src/command.rs Outdated Show resolved Hide resolved
crates/topos-tce-api/Cargo.toml Outdated Show resolved Hide resolved
crates/topos-tce-api/src/grpc/builder.rs Outdated Show resolved Hide resolved
crates/topos-tce-gatekeeper/Cargo.toml Outdated Show resolved Hide resolved
crates/topos-tce-gatekeeper/src/builder.rs Outdated Show resolved Hide resolved
crates/topos-tce-gatekeeper/src/client.rs Outdated Show resolved Hide resolved
crates/topos-tce-gatekeeper/src/lib.rs Outdated Show resolved Hide resolved
crates/topos-tce-transport/src/lib.rs Outdated Show resolved Hide resolved
crates/topos-tce/src/app_context/api.rs Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 6, 2023

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (64dfdfd) 61.07% compared to head (efd768a) 60.56%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #319      +/-   ##
==========================================
- Coverage   61.07%   60.56%   -0.51%     
==========================================
  Files         237      235       -2     
  Lines       13248    12934     -314     
==========================================
- Hits         8091     7834     -257     
+ Misses       5157     5100      -57     
Files Coverage Δ
...rates/topos-api/src/grpc/generated/topos.tce.v1.rs 66.43% <ø> (-2.36%) ⬇️
crates/topos-crypto/tests/messages.rs 100.00% <ø> (ø)
crates/topos-tce-api/src/grpc/builder.rs 98.75% <100.00%> (+0.04%) ⬆️
crates/topos-tce-api/src/grpc/console.rs 100.00% <ø> (+13.95%) ⬆️
crates/topos-tce-api/src/runtime/commands.rs 0.00% <ø> (ø)
crates/topos-tce-api/src/runtime/error.rs 100.00% <ø> (ø)
crates/topos-tce-api/src/runtime/mod.rs 61.78% <ø> (+0.46%) ⬆️
...s-tce-broadcast/src/double_echo/broadcast_state.rs 85.95% <100.00%> (ø)
crates/topos-tce-broadcast/src/double_echo/mod.rs 82.65% <100.00%> (-0.77%) ⬇️
crates/topos-tce-broadcast/src/lib.rs 85.52% <100.00%> (-2.39%) ⬇️
... and 26 more

... and 14 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gruberb gruberb marked this pull request as ready for review October 6, 2023 18:26
@gruberb gruberb requested review from Nashtare and a team as code owners October 6, 2023 18:26
@gruberb gruberb requested review from dvdplm and Freyskeyd October 6, 2023 18:26
crates/topos/src/config/genesis/mod.rs Outdated Show resolved Hide resolved
crates/topos/src/config/genesis/mod.rs Show resolved Hide resolved
crates/topos/src/components/tce/commands/run.rs Outdated Show resolved Hide resolved
crates/topos-crypto/src/messages.rs Outdated Show resolved Hide resolved
crates/topos-tce-api/src/grpc/builder.rs Show resolved Hide resolved
crates/topos-tce-broadcast/src/sampler/mod.rs Outdated Show resolved Hide resolved
crates/topos-tce-broadcast/src/lib.rs Outdated Show resolved Hide resolved
crates/topos-tce-gatekeeper/src/builder.rs Show resolved Hide resolved
crates/topos-tce/src/lib.rs Show resolved Hide resolved
crates/topos-test-sdk/src/tce/gatekeeper.rs Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
crates/topos-crypto/src/messages.rs Outdated Show resolved Hide resolved
crates/topos-test-sdk/src/tce/mod.rs Outdated Show resolved Hide resolved
crates/topos/src/components/tce/commands/run.rs Outdated Show resolved Hide resolved
crates/topos-tce-transport/src/lib.rs Outdated Show resolved Hide resolved
crates/topos-tce-gatekeeper/Cargo.toml Outdated Show resolved Hide resolved
tools/init.sh Outdated Show resolved Hide resolved
tools/node_config/node/test/config.toml Outdated Show resolved Hide resolved
tools/docker-compose.yml Show resolved Hide resolved
crates/topos-tce-broadcast/src/tests/mod.rs Outdated Show resolved Hide resolved
crates/topos-tce-transport/src/lib.rs Outdated Show resolved Hide resolved
crates/topos-tce-transport/src/lib.rs Outdated Show resolved Hide resolved
crates/topos-test-sdk/src/tce/mod.rs Outdated Show resolved Hide resolved
tools/docker-compose.yml Outdated Show resolved Hide resolved
@gruberb gruberb requested review from hadjiszs and Freyskeyd October 13, 2023 13:15
Copy link
Contributor

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

crates/topos-tce/src/lib.rs Show resolved Hide resolved
crates/topos-tce-api/src/grpc/console.rs Outdated Show resolved Hide resolved
crates/topos-tce-proxy/tests/tce_tests.rs Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
@gruberb gruberb requested a review from Freyskeyd October 17, 2023 13:32
@gruberb gruberb merged commit 06af265 into main Oct 17, 2023
15 checks passed
@gruberb gruberb deleted the feat/TP-708 branch October 17, 2023 14:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants