Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC - Mithril signature diffusion with a "fake Cardano network layer" #1902

Closed
wants to merge 30 commits into from

Conversation

Alenar
Copy link
Collaborator

@Alenar Alenar commented Aug 27, 2024

Content

This PR is a proof a concept of a decentralized message queue to diffuse Mithril signatures.

Since the protocol that will be used for signature diffusion through the Cardano node is still on the design phase, we simulate it with the creation of a new binary signature-network-node:

  • Nodes have an Unix socket were you can register signatures (using http) and pull the available signatures known by the node.
  • Nodes have an input directory were json serialized signatures can be put, it will be then added to the node available signatures.
  • Nodes share the signatures that are registered to them by writing them as json in their peers input directory.
  • Registered signatures can be pulled by calling a pull-signatures route on the node unix socket.

mithril-signer signature registration is abstracted with a new trait, SignaturePublisher, that have two implementations. One is the previous behavior communicating directly to the aggregator using http, the other foward signatures thought a signature-network-node unix socket.

mithril-aggregator have a new thread that pulls signatures constantly using the pull-signatures route of a signature-network-node unix socket and register them using the certifier-service the same way as its http server does.

mithil-end-to-end have been adapted to spawn one signature-network-node per mithril node.

Comments

🛑 DO NOT MERGE: 🛑 This PR should not be merged as it is intended for experimentation only.

As this is a POC several shortcuts were used:

  • signature-network-node stores registered signatures indefinitely until their pull-signatures route is called, meaning it's possible to make them crash by overloading their memory.
  • Tests were written but they are not exhaustive.
  • Windows isn't compatible.

Issue(s)

Relates to #1837

@Alenar Alenar changed the title DO NOT MERGE - POC - Mithril signature diffusion with a "fake Cardano network layer" POC - Mithril signature diffusion with a "fake Cardano network layer" Aug 27, 2024
Copy link

github-actions bot commented Aug 27, 2024

Test Results

    3 files   -  1     49 suites   - 6   10m 31s ⏱️ +6s
1 410 tests +15  1 410 ✅ +15  0 💤 ±0  0 ❌ ±0 
1 554 runs   - 55  1 554 ✅  - 55  0 💤 ±0  0 ❌ ±0 

Results for commit 8c3cdcd. ± Comparison against base commit 63e1204.

♻️ This comment has been updated with latest results.

@Alenar Alenar force-pushed the djo/1837/POC/multisig_diffusion_network_layer branch 6 times, most recently from a3c4fdd to 8bcda02 Compare August 27, 2024 14:30
Copy link
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

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

Good work 💪

@Alenar Alenar force-pushed the djo/1837/POC/multisig_diffusion_network_layer branch 3 times, most recently from 656b5a8 to e95e2fb Compare September 2, 2024 14:51
@Alenar Alenar force-pushed the djo/1837/POC/multisig_diffusion_network_layer branch 2 times, most recently from fb61945 to 881e3d4 Compare September 9, 2024 15:04
@jpraynaud jpraynaud added the prototype 🛠️ Prototype/PoC of a feature label Sep 12, 2024
@Alenar Alenar force-pushed the djo/1837/POC/multisig_diffusion_network_layer branch 3 times, most recently from 62e8461 to 9f0827d Compare September 19, 2024 13:32
@Alenar Alenar force-pushed the djo/1837/POC/multisig_diffusion_network_layer branch 2 times, most recently from eddd6ca to 7a47c7f Compare September 25, 2024 16:49
@Alenar Alenar force-pushed the djo/1837/POC/multisig_diffusion_network_layer branch from 7a47c7f to 3f99679 Compare October 7, 2024 13:24
@Alenar Alenar force-pushed the djo/1837/POC/multisig_diffusion_network_layer branch from 3f99679 to 454b1c3 Compare October 18, 2024 10:33
And push register signature message to the available sig queue.
By wiring the messageSender in the application.
…a subtype

Since it's the `Message`type that's written to peers by the `MessageSender`, not a `RegisterSignatureMessage`.
- Always remove given socket file even if it exist
- Create input dir if it doesn't exist even when an argument is provided
It listen to incoming signatures registered in a
`signatures-network-node` by calling its `pull_signatures`
endpoint regularly.
* Make the first `mithril-signer` use 'old' http endpoint to send single
  signatures
* Adjusts aggregator logs to make the process more apparent
* Slow down aggregator signature pulling interval so more signatures are
  pulled in batch
* Adjust explorer `Certificates` tab list to show in card the full signed
  entity type instead of the immutable file number
* Fix an error in aggregator when pulling signatures from the simulated
  network
@Alenar Alenar force-pushed the djo/1837/POC/multisig_diffusion_network_layer branch from 454b1c3 to 8c3cdcd Compare October 24, 2024 17:39
@Alenar Alenar closed this Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prototype 🛠️ Prototype/PoC of a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants